Closed ericprud closed 11 months ago
A typical MedicationRequest has contained Resources:
"contained": [ { "resourceType": "Medication", "id": "med0310", "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "430127000" } ] } }, { "resourceType": "Provenance", "id": "signature", "target": [ { "reference": "ServiceRequest/physiotherapy" } ], "recorded": "2017-02-01T17:23:07Z" } ],
fhir:DomainResource.contained [ a fhir:Medication; fhir:index 0; fhir:Resource.id [ fhir:value "med0310" ]; fhir:Medication.code [ fhir:CodeableConcept.coding [ fhir:index 0; a sct:430127000; fhir:Coding.system [ fhir:value "http://snomed.info/sct" ]; fhir:Coding.code [ fhir:value "430127000" ]; ] ] ], [ a fhir:Provenance; fhir:index 1; fhir:Resource.id [ fhir:value "signature" ]; fhir:Provenance.target [ fhir:index 0; fhir:link <http://hl7.org/fhir/ServiceRequest/physiotherapy>; fhir:Reference.reference [ fhir:value "ServiceRequest/physiotherapy" ] ]; fhir:Provenance.recorded [ fhir:value "2017-02-01T17:23:07Z"^^xsd:dateTime ]; ];
fhir:contained ([ a fhir:Medication; fhir:id "med0310"; fhir:code ([ fhir:coding [ a sct:430127000; fhir:system "http://snomed.info/sct"; fhir:code "430127000" ] ]) ], [ a fhir:Provenance; fhir:id [ fhir:value "signature" ]; fhir:target ([ fhir:link <http://hl7.org/fhir/ServiceRequest/physiotherapy>; fhir:reference "ServiceRequest/physiotherapy" ]); fhir:Provenance.recorded "2017-02-01T17:23:07Z"^^xsd:dateTime; ]);
So what's properties are allowed in a .contained element? AFAICT, it's every top-level property in every Resource.
.contained
The statically-generated context files don't address this. medicationrequest.context has:
"contained": { "@id": "fhir:DomainResource.contained", "@context": "resource.context.jsonld" },
and resource.context has only base properties that come from Resource:
{ "@context": { "@version": 1.1, "@vocab": "http://example.com/UNKNOWN#", "xsd": "http://www.w3.org/2001/XMLSchema#", "fhir": "http://hl7.org/fhir/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "id": { "@id": "fhir:Resource.id", "@context": "string.context.jsonld" }, "meta": { "@id": "fhir:Resource.meta", "@context": "meta.context.jsonld" }, "implicitRules": { "@id": "fhir:Resource.implicitRules", "@context": "uri.context.jsonld" }, "language": { "@id": "fhir:Resource.language", "@context": "string.context.jsonld" }, "index": { "@id": "fhir:index", "@type": "http://www.w3.org/2001/XMLSchema#integer" } } }
which means that (a preprocessed version of) the above JSON data would correctly handle on the .ids; the rest (e.g. .code, .target, .recorded) would be unrecognized, as well as any nested data structures like .coding and .reference.
.id
.code
.target
.recorded
.coding
.reference
Implemented in R5
A typical MedicationRequest has contained Resources:
JSON:
RDVch (R4):
rdvCH:
So what's properties are allowed in a
.contained
element? AFAICT, it's every top-level property in every Resource.previous work
The statically-generated context files don't address this. medicationrequest.context has:
and resource.context has only base properties that come from Resource:
which means that (a preprocessed version of) the above JSON data would correctly handle on the
.id
s; the rest (e.g..code
,.target
,.recorded
) would be unrecognized, as well as any nested data structures like.coding
and.reference
.