What a resource is (practically)
A FHIR resource is a JSON document with a known shape. It might represent a person (Patient), an event (Encounter), or a clinical fact (Observation).
Every resource has a resourceType, and most resources you read from a server
will also include an id and meta.
Some “infrastructure” resources show up constantly too: Bundle (search
results), OperationOutcome (errors/validation), and CapabilityStatement
(/metadata).
Anatomy of a resource
Most resources share the same “envelope”, plus fields that are specific to that resource type.resourceType(required) — the type of the resource (Patient,Observation, …)id— the logical id used in URLs (/fhir/{resourceType}/{id})meta— server-managed metadata (e.g.versionId,lastUpdated, tags, profiles)text— human-readable narrative (often present, not always)extension/modifierExtension— add fields beyond the base spec (with strict rules)contained— inline resources without their own URL identity (referenced as#id)
URLs and content types
FHIR REST endpoints are prefixed with/fhir (for TLQ’s local dev setup, that’s
http://localhost:8080/fhir).
- URLs and IDs are case-sensitive (
/Patient/123≠/patient/123) - Use
Accept: application/fhir+jsonfor JSON responses - When sending JSON, also set
Content-Type: application/fhir+json - Trailing slashes may be accepted (TLQ supports both
/Patientand/Patient/)
IDs vs identifiers (common pitfall)
Two different concepts show up in many resources:id— the server’s logical id, used in URLsidentifier[]— business identifiers (MRN, external ids, etc.), not used in the URL
References connect resources
References are just another datatype (Reference) that points to a different
resource.
Observation.subject).
Datatypes (a quick mental model)
FHIR fields aren’t “just JSON”; they have defined types (“datatypes”).- Primitives:
boolean,string,date,dateTime,code, … - Complex types:
HumanName,Identifier,Address,CodeableConcept,Quantity,Reference, …
name[], identifier[], telecom[], …). If something
looks unfamiliar, the datatype list is the best place to start:
https://hl7.org/fhir/datatypes.html.
Try it
1
Read one resource
2
Scan for the basics
In the response, find:
resourceTypeidmeta.versionIdmeta.lastUpdated
3
Spot references
References look like this:They’re how resources connect to each other (e.g. an
Observation.subject).4
Notice datatypes and arrays
Skim a few fields and note the “shape”:
- Arrays like
name[]oridentifier[] - Nested datatypes like
name[0](HumanName) oridentifier[0](Identifier)