Lesson 01.02
JSON, XML & primitive rules
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
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.
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.
Separate narrative from data
DomainResource.text is human-readable XHTML. Implementers must not treat narrative as a replacement for computable elements.
Key Concept / Interview Takeaway
Cardinality determines the container; the number of values in today’s instance does not.
Loading 10 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