Back to Blog

My $1,250 Upwork Project: Healthcare Middleware

September 10, 2024

A menopause clinic needed their systems to talk to each other. EasyPractice for booking. Gravity Forms for screening. Whereby for video calls. Vena for medical records.

They hired me to make it happen.

What I Actually Built

Flow 1: Patient books appointment

  1. EasyPractice webhook fires
  2. Create patient in Vena EHR
  3. Generate Whereby video link
  4. Create screening form token
  5. Email everything to patient

Flow 2: Patient fills screening form

  1. Gravity Forms webhook fires
  2. Match patient via token
  3. Generate PDF from responses
  4. Upload to Vena EHR

Flow 3: Consultation ends

  1. Whereby sends transcript
  2. GPT-4 generates clinician summary
  3. GPT-4 generates patient-friendly summary
  4. Both go to Vena for review

All automatic. Zero manual data entry.

The Scary Part: Healthcare Data

First thing I learned: you do NOT mess around with patient data.

// WRONG - Never do this await db.patients.create({ name: data.name, cpr: data.cpr, // NOPE NOPE NOPE }); // RIGHT - CPR lives in memory only const venaPatient = await venaApi.createPatient({ cpr: data.cpr, // Used once for API call }); await db.patients.create({ name: data.name, venaId: venaPatient.id, // Only store reference }); // CPR gone from memory after this function

The CPR number (Danish SSN) never touches my database. Ever.

Single-Use Tokens

How do you link a form submission to the right patient? Tokens.

function createScreeningToken(patientId: string) { const token = crypto.randomUUID(); await db.tokens.create({ token, patientId, expiresAt: addDays(new Date(), 7), used: false, }); return `${FORM_URL}?token=${token}`; }

Patient clicks link. Fills form. Token matches them to their booking. Token marked as used. Can't be reused.

AI Summaries That Don't Suck

The tricky part: clinicians need medical language, patients need plain English.

const clinicianPrompt = ` Summarize this consultation for a medical professional. Include: symptoms discussed, recommendations made, follow-up needed. Use clinical terminology where appropriate. `; const patientPrompt = ` Summarize this consultation for the patient. Use simple, clear language. Avoid medical jargon. Focus on: what was discussed, what to do next, when to follow up. `;

Same transcript. Two very different outputs. GPT-4o-mini handles both for ~$0.002 per consultation.

The Client's Reaction

"Technically skilled, structured in his approach, and capable of implementing complex integrations."

5.0 stars. $1,250. Best Upwork project so far.

What I'd Do Differently

  1. More upfront questions — Learned about Vena's API quirks the hard way
  2. Better error notifications — Added Slack alerts after launch
  3. Staging environment — Tested in prod more than I should admit

The Takeaway

Healthcare software is scary. But if you respect the data, document everything, and communicate constantly — it's just another integration project.

A very well-paying integration project.

GitHub
LinkedIn
X