Healthcare IntegrationAcademy
Foundational Implementer

Lesson 01.02

JSON, XML & primitive rules

Easy28 minutes02 · Resource structure
0/100 answered · 70% required
JSON and XML express the same FHIR boolean differently: the fragment "active": true corresponds to <active value="true"/>. JSON repeating elements use arrays even for one entry. These are clearly labelled fragments, not complete FHIR resources.
Visual guide · One meaning, two FHIR formatsOpen full-size image
START HERE

Read and troubleshoot FHIR instances in both official wire formats.

Real-World Example

One phone number is still an array

Patient.telecom is 0..*. Even a single phone contact is represented as an array in JSON.

What You Will Learn
  • Recognize repeating and choice elements
  • Apply JSON primitive and XML ordering rules
  • Use resourceType and the FHIR XML namespace
Step-by-Step Explanation
  1. Read the definition first

    A maximum cardinality of * means JSON must use an array, even when one value is present. A choice such as effective[x] becomes effectiveDateTime or effectivePeriod.

  2. Apply format rules

    JSON uses resourceType and native JSON primitive values. XML uses the FHIR namespace, lower-camel element names, value attributes for primitives, and specification order.

  3. Separate narrative from data

    DomainResource.text is human-readable XHTML. Implementers must not treat narrative as a replacement for computable elements.

SAMPLE FHIR MESSAGE

Inspect and practice

"telecom": [{ "system": "phone", "value": "+1-416-555-0100" }]
Key Concept / Interview Takeaway

Cardinality determines the container; the number of values in today’s instance does not.

LESSON KNOWLEDGE CHECK

Loading 10 questions

0/10 answered · 0 correctAnswer every question to finish this lesson.
PRIVATE FEEDBACK & QUESTIONS

Ask your instructor

JSON, XML & primitive rules

Only you and the authorized instructor can view this conversation. Other learners cannot see your messages. Do not include patient information, passwords or payment details.

Loading private conversation...

    Open private message inbox