Skip to main content
Every record you share over ABDM travels as one FHIR R4 document bundle. Pick the sample for your hi_type, copy it, and replace the sample data with your own.
Every sample validates with 0 errors against the NRCES implementation guide ndhm.in 6.5.0, with SNOMED CT and LOINC codes checked by a terminology server. All patient, doctor and facility details are made up.

Sample bundles

A visit for fever, with a penicillin allergy, a history of hypertension, a CBC ordered, paracetamol prescribed and a follow-up booked.Clinical resources: Encounter, Condition, AllergyIntolerance, ServiceRequest, MedicationRequest, Appointment
OPConsultation.json
A laboratory report with haemoglobin (LOINC 718-7) and fasting glucose (LOINC 1558-6), linked to the order that requested them.Clinical resources: DiagnosticReport (DiagnosticReportLab), Observation, ServiceRequest
DiagnosticReport.json
Metformin for type 2 diabetes, with the condition the prescription treats.Clinical resources: MedicationRequest, Condition
Prescription.json
A stay for pneumonia: chief complaint, past history, a CBC report, a chest X-ray, discharge medication and a care plan.Clinical resources: Encounter, Condition, DiagnosticReport, Observation, Procedure, MedicationRequest, CarePlan
DischargeSummary.json
One dose of a COVID-19 vaccine.Clinical resources: Immunization
ImmunizationRecord.json
Blood pressure, heart rate, weight, height, a daily step count and smoking status, each in its NRCES section.Clinical resources: Observation (ObservationVitalSigns, ObservationBodyMeasurement, ObservationPhysicalActivity, ObservationLifestyle)
WellnessRecord.json
A scanned lab report the patient uploaded, carried as a PDF attachment.Clinical resources: DocumentReference
HealthDocumentRecord.json
A pharmacy bill for 30 metformin tablets: rate, MRP, discount, CGST and SGST, with net and gross totals in INR.Billing resources: Invoice, ChargeItem, MedicationUnlike the clinical record types, InvoiceRecord has no SNOMED CT coding on the Composition: type.text is fixed to Invoice Record. Its single section takes only Invoice entries. Invoice types, charge item codes and price components come from the NRCES code systems ndhm-billing-codes and ndhm-price-components.
Invoice.json

How a bundle is shaped

Every sample follows the same structure. The Composition comes first: it is the index of the document, and its sections point at the bundle’s other resources.
Bundle (type: document, profile: DocumentBundle)
entry[0] Composition (profile: the record profile for the hi_type)
subject → Patient
author → Practitioner
custodian → Organization
section[] → the clinical resources
entry[1…] Patient, Practitioner, Organization
entry[…] clinical or billing resources (Condition, Observation, Invoice, …)
  • Bundle.meta.versionId, Bundle.identifier (system and value) and Bundle.timestamp are required.
  • Every resource a reference points at is inside the bundle, addressed by a urn:uuid: fullUrl. Each reference also names its type, such as "type": "MedicationRequest".
  • Every resource declares its NRCES profile in meta.profile, for example https://nrces.in/ndhm/fhir/r4/StructureDefinition/Patient.

Sending a bundle

How you send a bundle depends on who keeps the data.

Eka stores the data

Base64-encode the bundle and put it in the care context’s data field when you call Care context linking. List its hi_type in hi_types. Eka answers every later data request for you.

You keep the data

Leave data out of the link call. When Eka sends abha.hip_data_fetch, encrypt the bundle with the webhook’s key material, then push it.
Care context entry when Eka stores the data
Send the hi_type that matches the profile on the bundle’s Composition: a PrescriptionRecord bundle goes out as Prescription, never as OPConsultation. See Encryption for the on-fetch path.

Check a bundle before you send it

1

Download the HL7 FHIR validator

It needs Java 17 or later.
2

Validate against the NRCES guide

3

Read the result

The bundle is ready when the run prints Success: 0 errors. Read each warning and fix it or decide it is acceptable. A clean run is the minimum, not a guarantee: the exchange adds its own rules on top of the profiles.
Validator releases older than 7.0.8 can fail every code check with The cache ... was never issued by this server. That error comes from the validator, not your bundle. Adding -tx n/a skips terminology checks, which also skips the required value sets for MIME types and UCUM units, so an offline run can report errors a full run does not.

Common validation failures

A Composition section entry has no type. Prescription, DiagnosticReport and ImmunizationRecord sort section entries by the reference’s type.Fix: set type on every reference, for example "type": "MedicationRequest". In a Prescription, the section takes only a MedicationRequest or a Binary, never a DocumentReference.
The referenced resource fails its own profile, or does not declare it in meta.profile.Fix: fix the errors the validator reports on that resource, and set its NRCES profile.
NRCES binds ServiceRequest.code and DiagnosticReport.category to SNOMED CT.Fix: code the order in SNOMED CT, for example 26604007 Complete blood count.
OPConsultRecord and DischargeSummaryRecord require an Encounter.Fix: add an Encounter for the visit (status, class such as AMB or IMP, the patient) and reference it from Composition.encounter.
DiagnosticReportLab requires both.Fix: add a conclusion and a reference to the practitioner who interpreted the results.
The display does not belong to the code, which usually means the code is wrong.Fix: look the code up. 323509004 is Amoxicillin 250 mg capsule, not 500 mg.
The section’s code is not the one the profile fixes for that slice. NRCES’s own OPConsult example codes Follow Up as 736271009; profile 6.5.0 fixes 390906007 Follow-up encounter.Fix: use the code the profile fixes. Wellness sections are matched by title, so use the profile’s titles exactly, such as Vital Signs or Document Reference.
A resource has no narrative.Fix: add text with status generated and a short XHTML div. If the resource has language, set lang and xml:lang on the div.
The WellnessRecord sample keeps one warning on purpose. The NRCES Lifestyle value set only offers findings such as 365981007 Finding of tobacco smoking behavior, and the validator warns when a finding carries a value.