Builder lab · Module 1 · 40 min
Your First Healthcare GenAI Application
Assemble an LLM API request that turns a synthetic consultation transcript into validated structured clinical output — then break it, diagnose it and fix it.
After this module you can
Assemble and inspect a basic LLM API request that turns an unstructured consultation transcript into validated structured clinical output.
- Identify every part of an LLM API request: model, system instruction, user input, response format and sampling settings.
- Design a JSON schema for a structured clinical note and justify each required field.
- Diagnose a weak request from its output: missing fields, unsupported detail, prose instead of JSON.
- Run format validation and explain why valid JSON is not evidence of clinical correctness.
Step 1
The task
You are building a consultation summariser. Input: an unstructured transcript. Output: a structured clinical note another system can consume.
API simulation. Everything in this module is synthetic. The API call is simulated locally with fixed logic — no external model is contacted, no key is used, and no output here is clinical advice.
Visual Guide 02 — How an AI Healthcare Application Fits Together
Keep the terminology map next to you while you continue the technical track.
[SYNTHETIC CONSULTATION — TEACHING MATERIAL ONLY] Clinician: Come in, have a seat. What brings you in today? Patient: I've had this burning feeling in my chest, mostly after dinner. Started maybe three weeks ago. Clinician: Every evening, or now and then? Patient: Most evenings. Worse if I lie down soon after eating. Sometimes a sour taste at the back of my throat. Clinician: Any pain on exertion — walking up stairs, carrying shopping? Patient: No, nothing like that. Only after meals. Clinician: Weight loss, trouble swallowing, vomiting, black stools? Patient: No. Appetite is fine. Clinician: Are you taking anything for it? Patient: Over-the-counter antacids, maybe twice a week. They help for an hour or so. Clinician: Smoking, alcohol? Patient: Non-smoker. A glass of wine at the weekend. Clinician: Right. Your description fits reflux rather than anything cardiac, and there are no alarm features today. I'd like to start a standard reflux treatment plan and discuss the details with you now. Patient: And if it doesn't settle? Clinician: Then come back and we'll reconsider — including whether you need referral for endoscopy. We'll review how you respond in four weeks either way. If you get chest pain on exertion, difficulty swallowing or any bleeding, contact us straight away.
{
"reason_for_visit": "string",
"symptoms": ["string"],
"assessment": "string",
"plan": ["string"],
"follow_up": "string"
}Why structure
Prose has to be re-read by a human before anything can happen with it. A validated JSON object can be written to a field, queued for review, counted, audited and diffed against the transcript.
Structure also makes failure visible: a missing key or a wrong type is caught by a validator in milliseconds, long before it reaches a clinician. Format validity is not clinical correctness — it only tells you the output is machine-usable.
0 of 7 steps complete
Sources & evidence · 3 sources
This module cites standards and specifications, technical documentation, vendor documentation.
Content reviewed: September 2026. Publication dates of the individual sources are shown in each citation.
OpenAI — Structured Outputs guide
How a JSON schema is attached to a request and enforced on the response.
Open sourceJSON Schema specification
The vocabulary used to declare required fields, types and additionalProperties.
Open sourceHL7 FHIR — Clinical documents and resources
Where a structured note eventually has to land if it is to live in the record.
Open source