@prefix fhir: <http://hl7.org/fhir/> .
@prefix loinc: <https://loinc.org/rdf/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sct: <http://snomed.info/id/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://hl7.org/fhir/Observation/blood-pressure> a fhir:Observation ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "blood-pressure"] ; # 
  fhir:meta [
     fhir:profile ( [
       fhir:v "http://hl7.org/fhir/StructureDefinition/vitalsigns"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/vitalsigns>
     ] )
  ] ; # 
  fhir:identifier ( [
     fhir:system [
       fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ;
       fhir:l <urn:ietf:rfc:3986>
     ] ;
     fhir:value [ fhir:v "urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281" ]
  ] ) ; # 
  fhir:basedOn ( [
     fhir:identifier [
       fhir:system [
         fhir:v "https://acme.org/identifiers"^^xsd:anyURI ;
         fhir:l <https://acme.org/identifiers>
       ] ;
       fhir:value [ fhir:v "1234" ]
     ]
  ] ) ; # demonstrating the use of the baseOn element with a fictive identifier
  fhir:status [ fhir:v "final"] ; # 
  fhir:category ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "http://terminology.hl7.org/CodeSystem/observation-category"^^xsd:anyURI ;
         fhir:l <http://terminology.hl7.org/CodeSystem/observation-category>
       ] ;
       fhir:code [ fhir:v "vital-signs" ] ;
       fhir:display [ fhir:v "Vital Signs" ]
     ] )
  ] ) ; # 
  fhir:code [
     fhir:coding ( [
       a loinc:85354-9 ;
       fhir:system [
         fhir:v "http://loinc.org"^^xsd:anyURI ;
         fhir:l <http://loinc.org>
       ] ;
       fhir:code [ fhir:v "85354-9" ] ;
       fhir:display [ fhir:v "Blood pressure panel with all children optional" ]
     ] ) ; # replaced by 85354-9\n				<coding>\n					<system value=\"http:\/\/loinc.org\"\/>\n					<code value=\"85354-9\"\/>\n					<display value=\"Blood pressure systolic &amp; diastolic\"\/>\n				<\/coding>
     fhir:text [ fhir:v "Blood pressure systolic & diastolic" ]
  ] ; # 
  fhir:subject [
     fhir:l <http://hl7.org/fhir/Patient/example> ;
     fhir:reference [ fhir:v "Patient/example" ]
  ] ; # 
  fhir:effective [
     a fhir:DateTime ;
     fhir:v "2012-09-17"^^xsd:date
  ] ; # 
  fhir:performer ( [
     fhir:l <http://hl7.org/fhir/Practitioner/example> ;
     fhir:reference [ fhir:v "Practitioner/example" ]
  ] ) ; # 
  fhir:interpretation ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation"^^xsd:anyURI ;
         fhir:l <http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation>
       ] ;
       fhir:code [ fhir:v "L" ] ;
       fhir:display [ fhir:v "low" ]
     ] ) ;
     fhir:text [ fhir:v "Below low normal" ]
  ] ) ; # an interpretation offered to the combination observation
#        generally, it would only be appropriate to offer an interpretation
#        of an observation that has no value if it has "COMP" (component)
#        observations
  fhir:bodySite [
     fhir:coding ( [
       a sct:368209003 ;
       fhir:system [
         fhir:v "http://snomed.info/sct"^^xsd:anyURI ;
         fhir:l <http://snomed.info/sct>
       ] ;
       fhir:code [ fhir:v "368209003" ] ;
       fhir:display [ fhir:v "Right arm" ]
     ] )
  ] ; # The BodySite can be captured in a LOINC code but am showing it here to demonstrate populating the element
  fhir:component ( [
     fhir:code [
       fhir:coding ( [
         a loinc:8480-6 ;
         fhir:system [
           fhir:v "http://loinc.org"^^xsd:anyURI ;
           fhir:l <http://loinc.org>
         ] ;
         fhir:code [ fhir:v "8480-6" ] ;
         fhir:display [ fhir:v "Systolic blood pressure" ]
       ] [
         a sct:271649006 ;
         fhir:system [
           fhir:v "http://snomed.info/sct"^^xsd:anyURI ;
           fhir:l <http://snomed.info/sct>
         ] ;
         fhir:code [ fhir:v "271649006" ] ;
         fhir:display [ fhir:v "Systolic blood pressure" ]
       ] [
         fhir:system [
           fhir:v "http://acme.org/devices/clinical-codes"^^xsd:anyURI ;
           fhir:l <http://acme.org/devices/clinical-codes>
         ] ;
         fhir:code [ fhir:v "bp-s" ] ;
         fhir:display [ fhir:v "Systolic Blood pressure" ]
       ] ) # LOINC -code
     ] ; # Observations are often coded in multiple code systems.\n           - LOINC provides a very specific code (though not more specific in this particular case)\n           - snomed provides a clinically relevant code that is usually less granular than LOINC\n           - the source system provides its own code, which may be less or more granular than LOINC\n\nthis is shown here to demonstrate  the concept of translations within the codeableConcept datatype. The diastolic code below only has a LOINC code
     fhir:value [
       a fhir:Quantity ;
       fhir:value [ fhir:v "107"^^xsd:decimal ] ;
       fhir:unit [ fhir:v "mmHg" ] ;
       fhir:system [
         fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ;
         fhir:l <http://unitsofmeasure.org>
       ] ;
       fhir:code [ fhir:v "mm[Hg]" ]
     ] ;
     fhir:interpretation ( [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation"^^xsd:anyURI ;
           fhir:l <http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation>
         ] ;
         fhir:code [ fhir:v "N" ] ;
         fhir:display [ fhir:v "normal" ]
       ] ) ;
       fhir:text [ fhir:v "Normal" ]
     ] ) # an interpretation for the individual composite observation
  ] [
     fhir:code [
       fhir:coding ( [
         a loinc:8462-4 ;
         fhir:system [
           fhir:v "http://loinc.org"^^xsd:anyURI ;
           fhir:l <http://loinc.org>
         ] ;
         fhir:code [ fhir:v "8462-4" ] ;
         fhir:display [ fhir:v "Diastolic blood pressure" ]
       ] )
     ] ; # this codes only has a LOINC code
     fhir:value [
       a fhir:Quantity ;
       fhir:value [ fhir:v "60"^^xsd:decimal ] ;
       fhir:unit [ fhir:v "mmHg" ] ;
       fhir:system [
         fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ;
         fhir:l <http://unitsofmeasure.org>
       ] ;
       fhir:code [ fhir:v "mm[Hg]" ]
     ] ;
     fhir:interpretation ( [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation"^^xsd:anyURI ;
           fhir:l <http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation>
         ] ;
         fhir:code [ fhir:v "L" ] ;
         fhir:display [ fhir:v "low" ]
       ] ) ;
       fhir:text [ fhir:v "Below low normal" ]
     ] ) # an interpretation for the individual composite observation
  ] ) . # Should have a refrange as well

<http://hl7.org/fhir/Patient/example> a fhir:Patient .

<http://hl7.org/fhir/Practitioner/example> a fhir:Practitioner .

# -------------------------------------------------------------------------------------

