@prefix fhir: <http://hl7.org/fhir/> .
@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 xsd: <http://www.w3.org/2001/XMLSchema#> .

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

<http://hl7.org/fhir/Encounter/emerg> a fhir:Encounter ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "emerg"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">Emergency visit that escalated into inpatient patient @example</div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:status [ fhir:v "in-progress"] ; # 
  fhir:businessStatus ( [
     fhir:code [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://hl7.org/fhir/encounter-businessstatus-emergency"^^xsd:anyURI ;
           fhir:l <http://hl7.org/fhir/encounter-businessstatus-emergency>
         ] ;
         fhir:code [ fhir:v "triaged" ] ;
         fhir:display [ fhir:v "Triaged" ]
       ] )
     ] ;
     fhir:type [
       fhir:system [
         fhir:v "http://hl7.org/fhir/encounter-businessstatus-type"^^xsd:anyURI ;
         fhir:l <http://hl7.org/fhir/encounter-businessstatus-type>
       ] ;
       fhir:code [ fhir:v "emergency" ] ;
       fhir:display [ fhir:v "Emergency" ]
     ] ;
     fhir:effectiveDate [ fhir:v "2017-02-01T08:00:00+10:00"^^xsd:dateTime ]
  ] [
     fhir:code [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://hl7.org/fhir/encounter-businessstatus-inpatient"^^xsd:anyURI ;
           fhir:l <http://hl7.org/fhir/encounter-businessstatus-inpatient>
         ] ;
         fhir:code [ fhir:v "admit" ] ;
         fhir:display [ fhir:v "Admitted" ]
       ] )
     ] ;
     fhir:type [
       fhir:system [
         fhir:v "http://hl7.org/fhir/encounter-businessstatus-type"^^xsd:anyURI ;
         fhir:l <http://hl7.org/fhir/encounter-businessstatus-type>
       ] ;
       fhir:code [ fhir:v "inpatient" ] ;
       fhir:display [ fhir:v "Inpatient" ]
     ] ;
     fhir:effectiveDate [ fhir:v "2017-02-01T09:27:00+10:00"^^xsd:dateTime ]
  ] ) ; # 
  fhir:class ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
         fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>
       ] ;
       fhir:code [ fhir:v "IMP" ] ;
       fhir:display [ fhir:v "inpatient encounter" ]
     ] )
  ] ) ; # 
  fhir:subject [
     fhir:l <http://hl7.org/fhir/Patient/example> ;
     fhir:reference [ fhir:v "Patient/example" ]
  ] ; # 
  fhir:actualPeriod [
     fhir:start [ fhir:v "2017-02-01T07:15:00+10:00"^^xsd:dateTime ]
  ] ; # 
  fhir:admission [
     fhir:admitSource [
       fhir:coding ( [
         fhir:system [
           fhir:v "http://terminology.hl7.org/CodeSystem/admit-source"^^xsd:anyURI ;
           fhir:l <http://terminology.hl7.org/CodeSystem/admit-source>
         ] ;
         fhir:code [ fhir:v "emd" ] ;
         fhir:display [ fhir:v "From accident/emergency department" ]
       ] )
     ]
  ] ; # 
  fhir:location ( [
     fhir:location [
       fhir:display [ fhir:v "Emergency Waiting Room" ]
     ] ;
     fhir:status [ fhir:v "active" ] ;
     fhir:period [
       fhir:start [ fhir:v "2017-02-01T07:15:00+10:00"^^xsd:dateTime ] ;
       fhir:end [ fhir:v "2017-02-01T08:45:00+10:00"^^xsd:dateTime ]
     ]
  ] [
     fhir:location [
       fhir:display [ fhir:v "Emergency" ]
     ] ;
     fhir:status [ fhir:v "active" ] ;
     fhir:period [
       fhir:start [ fhir:v "2017-02-01T08:45:00+10:00"^^xsd:dateTime ] ;
       fhir:end [ fhir:v "2017-02-01T09:27:00+10:00"^^xsd:dateTime ]
     ]
  ] [
     fhir:location [
       fhir:display [ fhir:v "Ward 1, Room 42, Bed 1" ]
     ] ;
     fhir:status [ fhir:v "active" ] ;
     fhir:period [
       fhir:start [ fhir:v "2017-02-01T09:27:00+10:00"^^xsd:dateTime ] ;
       fhir:end [ fhir:v "2017-02-01T12:15:00+10:00"^^xsd:dateTime ]
     ]
  ] [
     fhir:location [
       fhir:display [ fhir:v "Ward 1, Room 42, Bed 1" ]
     ] ;
     fhir:status [ fhir:v "reserved" ] ;
     fhir:period [
       fhir:start [ fhir:v "2017-02-01T12:15:00+10:00"^^xsd:dateTime ] ;
       fhir:end [ fhir:v "2017-02-01T12:45:00+10:00"^^xsd:dateTime ]
     ]
  ] [
     fhir:location [
       fhir:display [ fhir:v "Ward 1, Room 42, Bed 1" ]
     ] ;
     fhir:status [ fhir:v "active" ] ;
     fhir:period [
       fhir:start [ fhir:v "2017-02-01T12:45:00+10:00"^^xsd:dateTime ]
     ]
  ] ) . # 

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

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

