Skip to main content
Every FHIR Extraction response contains exactly one Patient and one Encounter, always as the first two entries of the Bundle. They give the clinical resources their context: whose record they belong to, and which visit produced them. You cannot turn them off. They follow the FHIR R4 Patient and FHIR R4 Encounter specifications, and each field name below links to its R4 definition. The endpoint can fill both resources from the note, but your system usually knows these values better than the note does. Send them in the patient and encounter request fields: each value you send replaces what the endpoint reads from the note. Reduce extraction errors shows which mistakes this avoids.

What the endpoint reads from the note

For any value you do not send, the endpoint looks for it in the note. It fills a field only when the note states the value directly, and does not infer one:
  • It reads “male”, “female”, “M”, or “F” as the gender, but does not infer gender from a name.
  • It reads a stated date of birth, such as “DOB: 1968-04-02”, but does not calculate one from an age.
  • It reads “ED” as emergency and “admitted to ward” as inpatient, but does not infer the setting from the type of note.
  • It reads “admitted” as in-progress and “discharged” as finished. Without such a word, status stays in-progress.
  • It reads a time of day only together with a timezone. A time without one is cut back to its date, because R4 accepts a time only with a timezone offset.
  • It reads admission and discharge dates for period, but ignores dates that belong to other events, such as the date of a past operation.
When the note states nothing about the patient, the Patient resource holds only its id and identifier. When the note states nothing about the encounter, the Encounter holds its id, identifier, the subject reference, status unknown, and a class marked as unknown. R4 requires class, so instead of guessing one the endpoint returns it with only the standard data-absent-reason extension:

Patient fields

Encounter fields

The generated IDs are stable: the same note always gets the same Patient and Encounter id. Two different notes about the same patient get two different IDs, though. Only your own identifier ties notes from one patient together. Sending an identifier never changes the id.

Codes the endpoint can assign

Patient and Encounter use no clinical code systems. Every coded field holds a value from a fixed HL7 or FHIR list: gender from administrative gender, class from ActCode, and priority from ActPriority. type, serviceType, and reasonCode hold text only, so you can send any wording your system uses.

Example

This request sends every patient and encounter value:
It returns this Patient and Encounter. Every field comes from the request, so neither resource carries a mention.
The diagnosis “community-acquired pneumonia” also becomes a Condition with a SNOMED CT code, which references this Encounter. The Encounter’s reasonCode only holds the text you sent.

Next steps

Reduce extraction errors

Learn where each patient and encounter value comes from in an EHR.

Condition resource group

Learn how diagnoses, problems, symptoms, and signs look in FHIR.