This is Snapshot #3 for FHIR R5, released to support Connectathon 32. For a full list of available versions, see the Directory of published versions.
FHIR Infrastructure Work Group | Maturity Level: N/A | Standards Status: Informative | Compartments: Not linked to any defined compartments |
Raw Turtle (+ also see Turtle/RDF Format Specification)
An example transaction
@prefix fhir: <http://hl7.org/fhir/> . @prefix loinc: <http://loinc.org/rdf#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . # - resource ------------------------------------------------------------------- [a fhir:Bundle; fhir:nodeRole fhir:treeRoot; fhir:Resource.id [ fhir:value "bundle-transaction"]; # fhir:Resource.meta [ fhir:Meta.lastUpdated [ fhir:value "2014-08-18T01:43:30Z"^^xsd:dateTime ] ]; # this example bundle is a transaction , when the transaction was constructed fhir:Bundle.type [ fhir:value "transaction"]; # fhir:Bundle.entry [ fhir:index 0; fhir:Bundle.entry.fullUrl [ fhir:value "urn:uuid:61ebe359-bfdc-4613-8bf2-c5e300945f0a" ]; fhir:Bundle.entry.resource <urn:uuid:61ebe359-bfdc-4613-8bf2-c5e300945f0a>; # a simple create operation , first, the resource to create fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "POST" ]; # POST to [base]\/Patient - that's a create fhir:Bundle.entry.request.url [ fhir:value "Patient" ] # actually, in a transaction, you don't specify the [base], \n so [base]\/Patient becomes just 'Patient': ] # now, details about the action to take with the resource ], [ fhir:index 1; fhir:Bundle.entry.fullUrl [ fhir:value "urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059" ]; fhir:Bundle.entry.resource <urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059>; # a conditional create operation , first, the resource fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "POST" ]; # POST to [base]\/Patient - that's a create fhir:Bundle.entry.request.url [ fhir:value "Patient" ]; # actually, in a transaction, you don't specify the [base], \n so [base]\/Patient becomes just 'Patient': fhir:Bundle.entry.request.ifNoneExist [ fhir:value "identifier=http:/example.org/fhir/ids|234234" ] # the conditional header: only add this resource if \n there isn't already one for this patient. If there is one,\n the content of this resource will be ignored ] # transaction details ], [ fhir:index 2; fhir:Bundle.entry.fullUrl [ fhir:value "http://example.org/fhir/Patient/123" ]; fhir:Bundle.entry.resource <http://example.org/fhir/Patient/123>; # a simple update operation , first, the resource fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "PUT" ]; # PUT to [base]\/Patient\/[id] - that's an update fhir:Bundle.entry.request.url [ fhir:value "Patient/123" ] # actually, in a transaction, you don't specify the [base], \n so [base]\/Patient becomes just 'Patient': ] # transaction details ], [ fhir:index 3; fhir:Bundle.entry.fullUrl [ fhir:value "urn:uuid:74891afc-ed52-42a2-bcd7-f13d9b60f096" ]; fhir:Bundle.entry.resource <urn:uuid:74891afc-ed52-42a2-bcd7-f13d9b60f096>; # a conditional update operation , first, the resource fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "PUT" ]; # PUT to [base]\/Patient?search_params - that's a conditional update fhir:Bundle.entry.request.url [ fhir:value "Patient?identifier=http:/example.org/fhir/ids|456456" ] # actually, in a transaction, you don't specify the [base], \n so [base]\/Patient?params becomes just 'Patient?params': ] # transaction details ], [ fhir:index 4; fhir:Bundle.entry.fullUrl [ fhir:value "http://example.org/fhir/Patient/123a" ]; fhir:Bundle.entry.resource <http://example.org/fhir/Patient/123a>; fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "PUT" ]; fhir:Bundle.entry.request.url [ fhir:value "Patient/123a" ]; fhir:Bundle.entry.request.ifMatch [ fhir:value "W/\"2\"" ] # this will only succeed if the source version is correct: ] ], [ fhir:index 5; fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "DELETE" ]; # DELETE to [base]\/Patient\/[id]- that's a delete operation fhir:Bundle.entry.request.url [ fhir:value "Patient/234" ] # actually, in a transaction, you don't specify the [base], \n so [base]\/Patient\/234 becomes just 'Patient\/234': , btw, couldn't re-use Patient\/123 for the delete, since \n the transaction couldn't do two different operations on the\n same resource ] # a simple delete operation , no resource in this case , transaction details ], [ fhir:index 6; fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "DELETE" ]; # DELETE to [base]\/Patient?params- that's a conditional delete operation fhir:Bundle.entry.request.url [ fhir:value "Patient?identifier=123456" ] # actually, in a transaction, you don't specify the [base], \n so [base]\/Patient?params becomes just 'Patient?params': ] # a conditional delete operation , no resource in this case , transaction details ], [ fhir:index 7; fhir:Bundle.entry.fullUrl [ fhir:value "urn:uuid:79378cb8-8f58-48e8-a5e8-60ac2755b674" ]; fhir:Bundle.entry.resource <urn:uuid:79378cb8-8f58-48e8-a5e8-60ac2755b674>; # can do more than just create\/update\/delete. \n This is how to invoke an operation with a set of parameters fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "POST" ]; # POST to [base]\/ValueSet\/$lookup - invoking a lookup operation (see Terminology Service) fhir:Bundle.entry.request.url [ fhir:value "http://hl7.org/fhir/ValueSet/$lookup" ] ] ], [ fhir:index 8; fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "GET" ]; # GET from [base]\/Patient?params - searching for a patient fhir:Bundle.entry.request.url [ fhir:value "Patient?name=peter" ] ] # can also do read-only operations. \n \n Note that these do not 'fail' - see discussion on transaction \n atomicity for further information \n ], [ fhir:index 9; fhir:Bundle.entry.request [ fhir:Bundle.entry.request.method [ fhir:value "GET" ]; fhir:Bundle.entry.request.url [ fhir:value "Patient/12334" ]; fhir:Bundle.entry.request.ifNoneMatch [ fhir:value "W/\"4\"" ]; # in practice, you'd only specify one of these fhir:Bundle.entry.request.ifModifiedSince [ fhir:value "2015-08-31T08:14:33+10:00"^^xsd:dateTime ] ] # and an example conditional read: ]] . # now, each entry is an action to take in the transaction <urn:uuid:61ebe359-bfdc-4613-8bf2-c5e300945f0a> a fhir:Patient; fhir:DomainResource.text [ fhir:Narrative.status [ fhir:value "generated" ]; fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>" ]; # no id for create operations , and no metadata on this resource, though it would be valid fhir:Patient.active [ fhir:value "true"^^xsd:boolean]; # fhir:Patient.name [ fhir:index 0; fhir:HumanName.use [ fhir:value "official" ]; fhir:HumanName.family [ fhir:value "Chalmers" ]; fhir:HumanName.given [ fhir:value "Peter"; fhir:index 0 ], [ fhir:value "James"; fhir:index 1 ] ]; # fhir:Patient.gender [ fhir:value "male"]; # fhir:Patient.birthDate [ fhir:value "1974-12-25"^^xsd:date] . # <urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059> a fhir:Patient; fhir:DomainResource.text [ fhir:Narrative.status [ fhir:value "generated" ]; fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>" ]; # no id for create operations , and no metadata on this resource, though it would be valid fhir:Patient.identifier [ fhir:index 0; fhir:Identifier.system [ fhir:value "http:/example.org/fhir/ids" ]; fhir:Identifier.value [ fhir:value "234234" ] ]; # fhir:Patient.active [ fhir:value "true"^^xsd:boolean]; # fhir:Patient.name [ fhir:index 0; fhir:HumanName.use [ fhir:value "official" ]; fhir:HumanName.family [ fhir:value "Chalmers" ]; fhir:HumanName.given [ fhir:value "Peter"; fhir:index 0 ], [ fhir:value "James"; fhir:index 1 ] ]; # fhir:Patient.gender [ fhir:value "male"]; # fhir:Patient.birthDate [ fhir:value "1974-12-25"^^xsd:date] . # <http://example.org/fhir/Patient/123> a fhir:Patient; fhir:Resource.id [ fhir:value "123"]; # the id here and in the URL have to match fhir:DomainResource.text [ fhir:Narrative.status [ fhir:value "generated" ]; fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>" ]; # and no metadata on this resource, though it would be valid fhir:Patient.active [ fhir:value "true"^^xsd:boolean]; # fhir:Patient.name [ fhir:index 0; fhir:HumanName.use [ fhir:value "official" ]; fhir:HumanName.family [ fhir:value "Chalmers" ]; fhir:HumanName.given [ fhir:value "Peter"; fhir:index 0 ], [ fhir:value "James"; fhir:index 1 ] ]; # fhir:Patient.gender [ fhir:value "male"]; # fhir:Patient.birthDate [ fhir:value "1974-12-25"^^xsd:date] . # <urn:uuid:74891afc-ed52-42a2-bcd7-f13d9b60f096> a fhir:Patient; fhir:DomainResource.text [ fhir:Narrative.status [ fhir:value "generated" ]; fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>" ]; # no id for conditional update operations , and no metadata on this resource, though it would be valid fhir:Patient.identifier [ fhir:index 0; fhir:Identifier.system [ fhir:value "http:/example.org/fhir/ids" ]; fhir:Identifier.value [ fhir:value "456456" ] ]; # fhir:Patient.active [ fhir:value "true"^^xsd:boolean]; # fhir:Patient.name [ fhir:index 0; fhir:HumanName.use [ fhir:value "official" ]; fhir:HumanName.family [ fhir:value "Chalmers" ]; fhir:HumanName.given [ fhir:value "Peter"; fhir:index 0 ], [ fhir:value "James"; fhir:index 1 ] ]; # fhir:Patient.gender [ fhir:value "male"]; # fhir:Patient.birthDate [ fhir:value "1974-12-25"^^xsd:date] . # <http://example.org/fhir/Patient/123a> a fhir:Patient; fhir:Resource.id [ fhir:value "123a"]; # fhir:DomainResource.text [ fhir:Narrative.status [ fhir:value "generated" ]; fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>" ]; # fhir:Patient.active [ fhir:value "true"^^xsd:boolean]; # fhir:Patient.name [ fhir:index 0; fhir:HumanName.use [ fhir:value "official" ]; fhir:HumanName.family [ fhir:value "Chalmers" ]; fhir:HumanName.given [ fhir:value "Peter"; fhir:index 0 ], [ fhir:value "James"; fhir:index 1 ] ]; # fhir:Patient.gender [ fhir:value "male"]; # fhir:Patient.birthDate [ fhir:value "1974-12-25"^^xsd:date] . # <urn:uuid:79378cb8-8f58-48e8-a5e8-60ac2755b674> a fhir:Parameters; fhir:Parameters.parameter [ fhir:index 0; fhir:Parameters.parameter.name [ fhir:value "coding" ]; fhir:Parameters.parameter.valueCoding [ a loinc:1963-8; fhir:Coding.system [ fhir:value "http://loinc.org" ]; fhir:Coding.code [ fhir:value "1963-8" ] ] ] . # # - ontology header ------------------------------------------------------------ [a owl:Ontology; owl:imports fhir:fhir.ttl] . # -------------------------------------------------------------------------------------
Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.
FHIR ®© HL7.org 2011+. FHIR R5 Ballot hl7.fhir.core#5.0.0-snapshot3 generated on Wed, Dec 14, 2022 07:16+1100.
Links: Search |
Version History |
Contents |
Glossary |
QA |
Compare to R4B |
Compare to R5 Draft |
|
Propose a change