In Part 1, we covered the fundamentals — FHIR resources, Document Bundles, the Composition resource, NRCES profiles, and all 8 Health Information types. Now we put that knowledge into action.
In this guide, we follow Priya Sharma through a complete hospital visit — from walking into the reception to viewing her health records on the ABHA app. Each clinical step generates a specific FHIR bundle, and we will look inside each one with annotated JSON examples showing exactly what goes where and why.
The Patient Journey — 8 Steps from Hospital to Health Record
A typical hospital visit involves multiple departments, each generating different types of clinical data. In an ABDM-integrated hospital, each department creates a FHIR bundle that gets linked to the patient's ABHA. Here is the complete flow:
Let us walk through each step and examine the FHIR bundles created along the way.
Step 1-2: Reception and Registration — Creating the Patient Resource
Priya arrives at City General Hospital. At reception, the staff verifies her ABHA (Ayushman Bharat Health Account) by scanning her ABHA QR code or entering her 14-digit ABHA number. Her demographics are confirmed — name, gender, date of birth, phone number.
This registration creates the Patient resource that will appear in every subsequent FHIR bundle generated during this visit:
{
"resourceType": "Patient",
"id": "patient-priya-001",
"meta": {
"profile": [
"https://nrces.in/ndhm/fhir/r4/StructureDefinition/Patient"
]
},
"identifier": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR",
"display": "Medical record number"
}
]
},
"system": "https://healthid.ndhm.gov.in",
"value": "91-7345-1816-0779"
}
],
"name": [
{
"text": "Priya Sharma",
"family": "Sharma",
"given": ["Priya"]
}
],
"gender": "female",
"birthDate": "1992-03-15",
"telecom": [
{
"system": "phone",
"value": "9876543210"
}
]
} Key points about the ABDM Patient resource:
- The
identifier.systemmust behttps://healthid.ndhm.gov.in— this is the ABHA identifier system - The
identifier.valueis the patient's 14-digit ABHA number - The
meta.profilereferences the NRCES Patient profile - This exact resource (with the same UUID) will be referenced by the Composition in every bundle
Similarly, the hospital itself becomes an Organization resource with its HFR (Health Facility Registry) ID, and the treating doctor becomes a Practitioner resource. These three resources — Patient, Organization, Practitioner — appear in every ABDM bundle.
Step 3: OPD — The OPConsultation Bundle
Priya sees Dr. Anjali Mehta in the OPD. The doctor records her chief complaint (fever and headache for 3 days), checks vitals (temperature 101.2°F, BP 130/85, pulse 88), notes a known allergy to penicillin, prescribes medications, and schedules a follow-up in one week.
This consultation generates an OPConsultation bundle — the most common ABDM bundle type. It is the richest outpatient record, with 8 Composition sections covering everything discussed in the visit.
The Composition for an OPConsultation uses the OPConsultRecord profile and SNOMED code 371530004 (Clinical consultation report). Here is what the Chief Complaints section looks like, referencing a Condition resource:
// Inside Composition.section[]
{
"title": "Chief Complaints",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "422843007",
"display": "Chief complaint section"
}
]
},
"entry": [
{
"reference": "urn:uuid:condition-fever-001",
"display": "Fever and headache"
}
]
}
// The referenced Condition resource
{
"resourceType": "Condition",
"id": "condition-fever-001",
"meta": {
"profile": [
"https://nrces.in/ndhm/fhir/r4/StructureDefinition/Condition"
]
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "386661006",
"display": "Fever"
}
],
"text": "Fever and headache for 3 days"
},
"subject": {
"reference": "urn:uuid:patient-priya-001",
"display": "Priya Sharma"
}
} The 8 sections in an OPConsultation and their corresponding resources:
| Section | FHIR Resource | What It Captures |
|---|---|---|
| Chief Complaints | Condition | Why the patient visited — symptoms, duration |
| Allergies | AllergyIntolerance | Known allergies (drugs, food, environmental) |
| Medical History | Condition | Past conditions, chronic diseases |
| Investigation Advice | ServiceRequest | Lab tests or imaging ordered by the doctor |
| Medications | MedicationStatement + MedicationRequest | Current and newly prescribed drugs |
| Procedures | Procedure | Any procedures performed during the visit |
| Follow Up | Appointment | Next visit date and instructions |
| Document Reference | DocumentReference | Attached clinical notes, images, PDFs |
Every OPConsultation bundle also includes an Encounter resource with class "AMB" (ambulatory) — indicating this is an outpatient visit. The total bundle typically contains 13 resources.
Step 4: Lab — The DiagnosticReport Bundle
Dr. Mehta orders a Complete Blood Count (CBC) and lipid panel. Priya goes to the lab, samples are collected, and results come back. The lab generates a DiagnosticReport bundle.
This bundle is structured differently from OPConsultation. Instead of multiple Composition sections, it has one main section containing a DiagnosticReport that links to multiple Observations — one per test parameter.
The key resource chain in a DiagnosticReport bundle:
// DiagnosticReport → references Observations
{
"resourceType": "DiagnosticReport",
"id": "report-cbc-001",
"meta": {
"profile": [
"https://nrces.in/ndhm/fhir/r4/StructureDefinition/DiagnosticReportLab"
]
},
"status": "final",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "104177005",
"display": "Complete blood count"
}
]
},
"result": [
{ "reference": "urn:uuid:obs-cholesterol-001" },
{ "reference": "urn:uuid:obs-triglyceride-001" },
{ "reference": "urn:uuid:obs-hdl-001" }
],
"conclusion": "Lipid panel within normal limits"
}
// One of the Observations (LOINC-coded)
{
"resourceType": "Observation",
"id": "obs-cholesterol-001",
"meta": {
"profile": [
"https://nrces.in/ndhm/fhir/r4/StructureDefinition/Observation"
]
},
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "2093-3",
"display": "Cholesterol [Mass/volume] in Serum or Plasma"
}
]
},
"subject": {
"reference": "urn:uuid:patient-priya-001",
"display": "Priya Sharma"
},
"valueQuantity": {
"value": 195,
"unit": "mg/dL",
"system": "http://unitsofmeasure.org",
"code": "mg/dL"
},
"referenceRange": [
{
"low": { "value": 0, "unit": "mg/dL" },
"high": { "value": 200, "unit": "mg/dL" },
"text": "Desirable: < 200 mg/dL"
}
]
} Important details about DiagnosticReport bundles:
- Each test parameter is a separate Observation with its own LOINC code — this is critical for machine readability
- The DiagnosticReport's
result[]array links to all Observations - A Specimen resource describes the sample (blood, urine, etc.)
- Often includes two Practitioners: the ordering doctor and the lab pathologist
- The
referenceRangeon each Observation lets receiving systems flag abnormal values
Step 5: Pharmacy — The Prescription Bundle
With the consultation complete, Priya picks up her prescribed medications from the pharmacy. The pharmacy generates a Prescription bundle containing one MedicationRequest per drug.
The Prescription bundle is dynamic — it grows with the number of medications. Here is what a single MedicationRequest looks like:
{
"resourceType": "MedicationRequest",
"id": "med-paracetamol-001",
"meta": {
"profile": [
"https://nrces.in/ndhm/fhir/r4/StructureDefinition/MedicationRequest"
]
},
"status": "active",
"intent": "order",
"medicationCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "387517004",
"display": "Paracetamol"
}
],
"text": "Paracetamol 500mg"
},
"subject": {
"reference": "urn:uuid:patient-priya-001",
"display": "Priya Sharma"
},
"dosageInstruction": [
{
"text": "500mg twice daily after meals for 5 days",
"timing": {
"repeat": {
"frequency": 2,
"period": 1,
"periodUnit": "d"
}
},
"doseAndRate": [
{
"doseQuantity": {
"value": 500,
"unit": "mg"
}
}
]
}
]
} For Priya's 3 prescribed medications (Paracetamol, Cetirizine, Azithromycin), the bundle contains 3 MedicationRequest resources plus a Binary resource for the scanned prescription copy. Total: 5 + 3 = 8 resources.
Step 6: Billing — The Invoice Bundle
Before leaving, Priya settles her bill at the billing counter. The hospital generates an Invoice bundle covering the consultation fee, lab charges, and medication costs.
The Invoice bundle uses SNOMED code 52471005 and contains Invoice resources with line items detailing each charge, tax calculations, and total amounts. While simpler in structure than clinical bundles, it provides a complete financial record linked to the patient's ABHA — essential for insurance claims and payment tracking.
The Other Bundle Types — DischargeSummary, WellnessRecord, ImmunizationRecord, and HealthDocumentRecord
Priya's outpatient visit generated OPConsultation, DiagnosticReport, Prescription, and Invoice bundles. But ABDM supports four more bundle types for different clinical scenarios. Let us examine each.
DischargeSummary — The Most Complex ABDM Bundle
If Priya had been admitted as an inpatient (say, for a surgery), her discharge would generate a DischargeSummary bundle — the largest and most complex bundle type in ABDM, with 7 Composition sections and 15+ resources.
What makes DischargeSummary unique:
- 7 Composition sections: Chief Complaints, Medical History, Investigations, Procedures, Medications, Care Plan (with follow-up appointment), and Documents
- Inpatient Encounter: Uses class
"IMP"(inpatient encounter) instead of"AMB", with both admission and discharge dates in theperiodfield - Multiple Practitioners: Primary treating doctor + secondary/specialist doctor
- Multiple Organizations: Hospital facility + lab/diagnostic center
- CarePlan resource: Post-discharge instructions, medication schedules, and lifestyle recommendations
- Richer medical history: Past procedures and conditions documented alongside current treatment
WellnessRecord — The Observation-Heavy Bundle
WellnessRecord bundles capture health and fitness data — from clinical vitals to activity tracking. With 18+ LOINC-coded Observations across 6 categories, it is the most observation-dense bundle type.
The 6 observation categories and their LOINC codes:
| Category | Observations | LOINC Codes | NRCES Profile |
|---|---|---|---|
| Vital Signs | Respiratory rate, Heart rate, SpO2, Temperature, Blood pressure | 9279-1, 8867-4, 2708-6, 61008-9, 85354-9 | ObservationVitalSigns |
| Body Measurement | Height, Weight, BMI | 8302-2, 29463-7, 39156-5 | ObservationBodyMeasurement |
| Physical Activity | Steps, Calories burned, Sleep duration | 55423-8, 41981-2, 93832-4 | ObservationPhysicalActivity |
| General Assessment | Body fat, Blood glucose, Fluid intake, Calorie intake | 73708-0, 2339-0, 8999-5, 9052-2 | ObservationGeneralAssessment |
| Lifestyle | Diet, Smoking status | Custom codes | ObservationLifestyle |
| Documents | Attached health reports | N/A | DocumentReference |
Note that each observation category uses a different NRCES Observation profile — not the generic Observation profile. Blood pressure is special: it uses a component-based observation with systolic and diastolic as sub-components rather than separate observations. BMI can be auto-calculated from height and weight.
ImmunizationRecord — Tracking Vaccinations
The ImmunizationRecord is straightforward — it captures one vaccination event with:
- Immunization resource: Vaccine name (SNOMED-coded), lot number, dose number, administration date, and site
- ImmunizationRecommendation resource: Next dose date and dose number for multi-dose vaccines
- DocumentReference: Vaccination certificate (e.g., CoWIN certificate)
With only 7 resources total, it is one of the simpler bundle types. SNOMED code: 41000179103.
HealthDocumentRecord — The Simplest Bundle
HealthDocumentRecord is the catch-all — used for any clinical document that does not fit the other 7 types. A scanned radiology report, a clinical note as PDF, or a referral letter can all be wrapped as a HealthDocumentRecord.
It typically contains just 5 resources: Composition, Patient, Practitioner, Organization, and a DocumentReference with base64-encoded content. SNOMED code: 419891008 (Record artifact). The DocumentReference's content.attachment field holds the actual document data.
Step 7: Linking Records — How Bundles Reach the Patient's ABHA
After Priya's visit, the hospital needs to connect all generated FHIR bundles to her ABHA. This is called care context linking — the M2 (HIP) workflow in ABDM.
A care context represents a single clinical interaction — in this case, "OPD Visit at City General Hospital on April 2, 2026". The hospital links this care context to Priya's ABHA via the ABDM Gateway, and associates all the FHIR bundles (OPConsultation, DiagnosticReport, Prescription, Invoice) with it.
Here is how the complete data flow works when these bundles are eventually requested:
The data transfer process:
- HIU sends consent request — A specialist Priya is referred to requests access to her hospital records
- Patient grants consent — Priya approves the request on her ABHA app, specifying what data can be shared and for how long
- Gateway notifies HIP — City General Hospital receives the approved consent artifact
- HIP encrypts bundles — Using the Fidelius protocol (ECDH key exchange + AES-GCM encryption), the hospital encrypts the FHIR bundles
- Encrypted transfer — Bundles flow from HIP → Gateway → HIU. A SHA-256 checksum ensures integrity — the receiving system can verify the bundle was not tampered with
- HIU decrypts and reads — The specialist's system decrypts the bundles and displays Priya's records
The SHA-256 checksum is calculated on the full JSON-serialized bundle. Both HIP and HIU compute the same checksum to verify data integrity.
Step 8: Patient View — The Full Circle
Priya opens her ABHA app on her phone. She can now see all the records from her hospital visit — organized by date and type. The OPConsultation shows her doctor's notes and diagnosis. The DiagnosticReport shows her lab results with reference ranges. The Prescription lists her medications with dosage instructions. The Invoice shows her payment details.
She is in complete control. If she visits a new doctor next month, she can share these records instantly through the consent flow — no need to carry paper reports or repeat lab tests. And she can revoke access at any time.
This is the promise of ABDM — a patient-controlled, interoperable health record system built on FHIR. Every hospital, clinic, lab, and pharmacy creating standards-compliant FHIR bundles means every patient gets a complete, portable health record.
Common Pitfalls and Implementation Tips
After explaining the complete bundle lifecycle, here are the most common mistakes developers make when implementing ABDM FHIR bundles — and how to avoid them:
- Composition must be the first entry — The ABDM gateway rejects bundles where Composition is not
entry[0]. This is the most common validation failure. - Every resource needs meta.profile — All resources must declare their NRCES profile URL in
meta.profile. Missing profiles cause silent failures during validation. - Use urn:uuid: references with display text — All internal references must use the
urn:uuid:format (not relative URLs). Always include adisplayfield for human readability. - Match SNOMED codes to HI types — Each bundle type has a specific SNOMED code for
Composition.type. Using the wrong code causes type mismatch errors. OPConsultation is 371530004, Prescription is 440545006, and so on. - Encounter class matters — Use
"AMB"(ambulatory) for outpatient bundles and"IMP"(inpatient) for DischargeSummary. Wrong class codes break workflow routing. - LOINC codes for Observations — Every Observation must have a LOINC code in
code.coding. Do not use free-text codes — they are not machine-readable and fail interoperability. - Checksum calculation — The SHA-256 hash must be computed on the canonical JSON string of the entire bundle. Whitespace differences change the hash, so always use
JSON.stringify()without pretty-printing. - Timestamps in IST — Use ISO 8601 with the Indian timezone offset
+05:30. Example:2026-04-02T10:30:00+05:30.
Frequently Asked Questions
What resources are included in an OPConsultation bundle?
An OPConsultation bundle typically contains 13 resources: Composition (with 8 sections), Patient, Practitioner, Organization, Encounter (ambulatory), Condition (chief complaint), AllergyIntolerance, Condition (medical history), ServiceRequest (investigation advice), MedicationStatement, MedicationRequest, Procedure, Appointment (follow-up), and DocumentReference.
How many MedicationRequests can a Prescription bundle have?
A Prescription bundle is dynamic — it contains one MedicationRequest per prescribed drug. If the doctor prescribes 5 medications, the bundle contains 5 MedicationRequest resources. There is no fixed limit. The Composition references all of them in a single section.
What is the most complex ABDM FHIR bundle type?
DischargeSummary is the most complex with 7 Composition sections, 15+ resources, multiple Practitioners (primary + specialist), multiple Organizations (hospital + lab), an inpatient Encounter with admission and discharge dates, and a CarePlan for post-discharge instructions.
How are FHIR bundles encrypted in ABDM?
ABDM uses the Fidelius protocol for data encryption — an ECDH (Elliptic Curve Diffie-Hellman) key exchange followed by AES-GCM symmetric encryption. The HIP and HIU exchange public keys, derive a shared secret, and use it to encrypt the FHIR bundles during transfer. A SHA-256 checksum ensures data integrity.
What LOINC codes does the WellnessRecord bundle use?
WellnessRecord uses 16+ LOINC codes across 5 observation categories: Vital Signs (9279-1, 8867-4, 2708-6, 61008-9, 85354-9), Body Measurement (8302-2, 29463-7, 39156-5), Physical Activity (55423-8, 41981-2, 93832-4), and General Assessment (73708-0, 2339-0, 8999-5, 9052-2). Lifestyle observations use custom SNOMED codes.



