@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 -------------------------------------------------------------------

# 
# Title:        Discharge Summary
#
# Based on:     C-CDA_R2_Discharge_Summary.xml
# 
# Updated for C-CDA R3.0 with a focus on header elements
#  - required/suggested sections are populated with nullFlavor="NI"
#	  to demonstrate WHICH sections should be included, but they
#		all contain "No information" as this is an example of the header
#  
# ********************************************************
# Disclaimer: This sample file contains representative data elements to represent a Discharge Summary. 
# The file depicts a fictional character's health data. Any resemblance to a real person is coincidental. 
# To illustrate as many data elements as possible, the clinical scenario may not be plausible. 
# The data in this sample file is not intended to represent real patients, people or clinical events. 
# This sample is designed to be used in conjunction with the C-CDA Clinical Notes Implementation Guide.
# ********************************************************
# 

[a fhir:ClinicalDocument ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:realmCode ( [
     fhir:code [ fhir:v "US" ]
  ] ) ; #  ** CDA Header ** 
  fhir:typeId [
     fhir:extension [ fhir:v "POCD_HD000040" ] ;
     fhir:root [ fhir:v "2.16.840.1.113883.1.3" ]
  ] ; # 
  fhir:templateId ( [
     fhir:extension [ fhir:v "2024-05-01" ] ;
     fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.1.1" ]
  ] [
     fhir:extension [ fhir:v "2024-05-01" ] ;
     fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.1.8" ]
  ] ) ; #  US General Header Template 
  fhir:id [
     fhir:extension [ fhir:v "TT988" ] ;
     fhir:root [ fhir:v "2.16.840.1.113883.19.5.99999.1" ]
  ] ; # 
  fhir:sdtcCategory ( [
     fhir:code [ fhir:v "18842-5" ] ;
     fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
     fhir:displayName [ fhir:v "Discharge summary" ]
  ] ) ; # 
  fhir:code [
     fhir:code [ fhir:v "18842-5" ] ;
     fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
     fhir:codeSystemName [ fhir:v "LOINC" ] ;
     fhir:displayName [ fhir:v "Discharge summary" ]
  ] ; # 
  fhir:title [
     fhir:xmlText [ fhir:v "Community Health and Hospitals: Discharge Summary" ]
  ] ; # 
  fhir:effectiveTime [
     fhir:value [ fhir:v "2014-09-17T19:04:00+05:00"^^xsd:dateTime ]
  ] ; # 
  fhir:confidentialityCode [
     fhir:code [ fhir:v "N" ] ;
     fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.25" ]
  ] ; # 
  fhir:languageCode [
     fhir:code [ fhir:v "en-US" ]
  ] ; # 
  fhir:setId [
     fhir:extension [ fhir:v "sTT988" ] ;
     fhir:root [ fhir:v "2.16.840.1.113883.19.5.99999.19" ]
  ] ; # 
  fhir:versionNumber [
     fhir:value [ fhir:v 1 ]
  ] ; # 
  fhir:recordTarget ( [
     fhir:patientRole [
       fhir:id ( [
         fhir:extension [ fhir:v "998991" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.19.5.99999.2" ]
       ] [
         fhir:extension [ fhir:v "111-00-2330" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.4.1" ]
       ] ) ;
       fhir:addr ( [
         fhir:use ( [ fhir:v "HP" ] ) ;
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "1357 Amber Drive" ]
           ] #  HP is \"primary home\" from codeSystem 2.16.840.1.113883.5.1119 
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Beaverton" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "97867" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ; #  Fake Social Security Number using the actual SSN OID. ,  US is \"United States\" from ISO 3166-1 Country Codes: 1.0.3166.1 
       fhir:telecom ( [
         fhir:use ( [ fhir:v "HP" ] ) ;
         fhir:value [
           fhir:v "tel:(816)276-6909"^^xsd:anyURI ;
           fhir:l fhir:tel:(816)276-6909
         ]
       ] ) ;
       fhir:patient [
         fhir:name ( [
           fhir:use ( [ fhir:v "L" ] ) ;
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Isabella" ]
             ] ) #  L is \"Legal\" from HL7 EntityNameUse 2.16.840.1.113883.5.45 
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Jones" ]
             ] )
           ] )
         ] ) ;
         fhir:administrativeGenderCode [
           fhir:code [ fhir:v "F" ] ;
           fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.1" ] ;
           fhir:displayName [ fhir:v "Female" ]
         ] ;
         fhir:birthTime [
           fhir:value [ fhir:v "2005-05-01"^^xsd:date ]
         ] ;
         fhir:maritalStatusCode [
           fhir:code [ fhir:v "M" ] ;
           fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.2" ] ;
           fhir:codeSystemName [ fhir:v "MaritalStatusCode" ] ;
           fhir:displayName [ fhir:v "Married" ]
         ] ;
         fhir:religiousAffiliationCode [
           fhir:code [ fhir:v "1013" ] ;
           fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.1076" ] ;
           fhir:codeSystemName [ fhir:v "HL7 Religious Affiliation" ] ;
           fhir:displayName [ fhir:v "Christian (non-Catholic, non-specific)" ]
         ] ;
         fhir:raceCode [
           fhir:code [ fhir:v "2028-9" ] ;
           fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.238" ] ;
           fhir:codeSystemName [ fhir:v "Race & Ethnicity - CDC" ] ;
           fhir:displayName [ fhir:v "Asian" ]
         ] ;
         fhir:ethnicGroupCode [
           fhir:code [ fhir:v "2186-5" ] ;
           fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.238" ] ;
           fhir:codeSystemName [ fhir:v "Race & Ethnicity - CDC" ] ;
           fhir:displayName [ fhir:v "Not Hispanic or Latino" ]
         ] ;
         fhir:guardian ( [
           fhir:code [
             fhir:code [ fhir:v "GRPRN" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.111" ] ;
             fhir:codeSystemName [ fhir:v "HL7 Role code" ] ;
             fhir:displayName [ fhir:v "Grandparent" ]
           ] ;
           fhir:addr ( [
             fhir:use ( [ fhir:v "HP" ] ) ;
             fhir:item ( [
               fhir:streetAddressLine [
                 fhir:xmlText [ fhir:v "1357 Amber Drive" ]
               ] #  HP is \"primary home\" from codeSystem 2.16.840.1.113883.5.1119 
             ] [
               fhir:city [
                 fhir:xmlText [ fhir:v "Beaverton" ]
               ]
             ] [
               fhir:state [
                 fhir:xmlText [ fhir:v "OR" ]
               ]
             ] [
               fhir:postalCode [
                 fhir:xmlText [ fhir:v "97867" ]
               ]
             ] [
               fhir:country [
                 fhir:xmlText [ fhir:v "US" ]
               ]
             ] )
           ] ) ; #  US is \"United States\" from ISO 3166-1 Country Codes: 1.0.3166.1 
           fhir:telecom ( [
             fhir:use ( [ fhir:v "HP" ] ) ;
             fhir:value [
               fhir:v "tel:(816)276-6909"^^xsd:anyURI ;
               fhir:l fhir:tel:(816)276-6909
             ]
           ] ) ;
           fhir:guardianPerson [
             fhir:name ( [
               fhir:item ( [
                 fhir:given ( [
                   fhir:xmlText [ fhir:v "Ralph" ]
                 ] )
               ] [
                 fhir:family ( [
                   fhir:xmlText [ fhir:v "Jones" ]
                 ] )
               ] )
             ] )
           ]
         ] ) ;
         fhir:birthplace [
           fhir:place [
             fhir:addr [
               fhir:item ( [
                 fhir:city [
                   fhir:xmlText [ fhir:v "Beaverton" ]
                 ]
               ] [
                 fhir:state [
                   fhir:xmlText [ fhir:v "OR" ]
                 ]
               ] [
                 fhir:postalCode [
                   fhir:xmlText [ fhir:v "97867" ]
                 ]
               ] [
                 fhir:country [
                   fhir:xmlText [ fhir:v "US" ]
                 ]
               ] )
             ]
           ]
         ] ;
         fhir:languageCommunication ( [
           fhir:languageCode [
             fhir:code [ fhir:v "en" ]
           ] ;
           fhir:modeCode [
             fhir:code [ fhir:v "ESP" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.60" ] ;
             fhir:codeSystemName [ fhir:v "LanguageAbilityMode" ] ;
             fhir:displayName [ fhir:v "Expressed spoken" ]
           ] ;
           fhir:proficiencyLevelCode [
             fhir:code [ fhir:v "G" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.61" ] ;
             fhir:codeSystemName [ fhir:v "LanguageAbilityProficiency" ] ;
             fhir:displayName [ fhir:v "Good" ]
           ] ;
           fhir:preferenceInd [
             fhir:value [ fhir:v true ]
           ]
         ] )
       ] ; #  HP is \"primary home\" from HL7 AddressUse 2.16.840.1.113883.5.1119 
       fhir:providerOrganization [
         fhir:id ( [
           fhir:root [ fhir:v "2.16.840.1.113883.19.5.9999.1393" ]
         ] ) ;
         fhir:name ( [
           fhir:item ( [
             fhir:xmlText [ fhir:v "Community Health and Hospitals" ]
           ] )
         ] ) ;
         fhir:telecom ( [
           fhir:use ( [ fhir:v "WP" ] ) ;
           fhir:value [
             fhir:v "tel:555-555-5000"^^xsd:anyURI ;
             fhir:l fhir:tel:555-555-5000
           ]
         ] ) ;
         fhir:addr ( [
           fhir:use ( [ fhir:v "WP" ] ) ;
           fhir:item ( [
             fhir:streetAddressLine [
               fhir:xmlText [ fhir:v "1001 Village Avenue" ]
             ]
           ] [
             fhir:city [
               fhir:xmlText [ fhir:v "Portland" ]
             ]
           ] [
             fhir:state [
               fhir:xmlText [ fhir:v "OR" ]
             ]
           ] [
             fhir:postalCode [
               fhir:xmlText [ fhir:v "99123" ]
             ]
           ] [
             fhir:country [
               fhir:xmlText [ fhir:v "US" ]
             ]
           ] )
         ] )
       ]
     ]
  ] ) ; # 
  fhir:author ( [
     fhir:time [
       fhir:value [ fhir:v "2014-09-17T19:04:00+05:00"^^xsd:dateTime ]
     ] ;
     fhir:assignedAuthor [
       fhir:id ( [
         fhir:extension [ fhir:v "99999999" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.4.6" ]
       ] ) ;
       fhir:code [
         fhir:code [ fhir:v "207R00000X" ] ;
         fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.101" ] ;
         fhir:displayName [ fhir:v "Internal Medicine" ]
       ] ;
       fhir:addr ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "1002 Healthcare Drive" ]
           ]
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Portland" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "99123" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ;
       fhir:telecom ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:value [
           fhir:v "tel:555-555-1002"^^xsd:anyURI ;
           fhir:l fhir:tel:555-555-1002
         ]
       ] ) ;
       fhir:assignedPerson [
         fhir:name ( [
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Henry" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Seven" ]
             ] )
           ] )
         ] )
       ]
     ]
  ] [
     fhir:time [
       fhir:value [ fhir:v "2014-09-17T19:04:00+05:00"^^xsd:dateTime ]
     ] ;
     fhir:assignedAuthor [
       fhir:id ( [
         fhir:nullFlavor [ fhir:v "NI" ]
       ] ) ;
       fhir:addr ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "1001 Village Avenue" ]
           ]
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Portland" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "99123" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ;
       fhir:telecom ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:value [
           fhir:v "tel:+1(555)555-1004"^^xsd:anyURI ;
           fhir:l fhir:tel:+1(555)555-1004
         ]
       ] ) ;
       fhir:assignedAuthoringDevice [
         fhir:manufacturerModelName [
           fhir:xmlText [ fhir:v "Generic EHR Clinical System 2.0.0.0.0.0" ]
         ] ;
         fhir:softwareName [
           fhir:xmlText [ fhir:v "Generic EHR C-CDA Factory 2.0.0.0.0.0 - C-CDA Transform 2.0.0.0.0" ]
         ]
       ] ;
       fhir:representedOrganization [
         fhir:id ( [
           fhir:root [ fhir:v "2.16.840.1.113883.19.5.9999.1393" ]
         ] ) ;
         fhir:name ( [
           fhir:item ( [
             fhir:xmlText [ fhir:v "Community Health and Hospitals" ]
           ] )
         ] ) ;
         fhir:telecom ( [
           fhir:use ( [ fhir:v "WP" ] ) ;
           fhir:value [
             fhir:v "tel:555-555-5000"^^xsd:anyURI ;
             fhir:l fhir:tel:555-555-5000
           ]
         ] ) ;
         fhir:addr ( [
           fhir:item ( [
             fhir:streetAddressLine [
               fhir:xmlText [ fhir:v "1001 Village Avenue" ]
             ]
           ] [
             fhir:city [
               fhir:xmlText [ fhir:v "Portland" ]
             ]
           ] [
             fhir:state [
               fhir:xmlText [ fhir:v "OR" ]
             ]
           ] [
             fhir:postalCode [
               fhir:xmlText [ fhir:v "99123" ]
             ]
           ] [
             fhir:country [
               fhir:xmlText [ fhir:v "US" ]
             ]
           ] )
         ] )
       ]
     ]
  ] ) ; # 
  fhir:dataEnterer [
     fhir:assignedEntity [
       fhir:id ( [
         fhir:extension [ fhir:v "999999943252" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.4.6" ]
       ] ) ;
       fhir:addr ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "1001 Village Avenue" ]
           ]
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Portland" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "99123" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ;
       fhir:telecom ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:value [
           fhir:v "tel:555-555-1002"^^xsd:anyURI ;
           fhir:l fhir:tel:555-555-1002
         ]
       ] ) ;
       fhir:assignedPerson [
         fhir:name ( [
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Henry" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Seven" ]
             ] )
           ] )
         ] )
       ]
     ]
  ] ; # 
  fhir:informant ( [
     fhir:assignedEntity [
       fhir:id ( [
         fhir:extension [ fhir:v "KP00017" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.19.5" ]
       ] ) ;
       fhir:addr ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "1001 Village Avenue" ]
           ]
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Portland" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "99123" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ;
       fhir:telecom ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:value [
           fhir:v "tel:555-555-1002"^^xsd:anyURI ;
           fhir:l fhir:tel:555-555-1002
         ]
       ] ) ;
       fhir:assignedPerson [
         fhir:name ( [
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Henry" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Seven" ]
             ] )
           ] )
         ] )
       ]
     ]
  ] [
     fhir:relatedEntity [
       fhir:classCode [ fhir:v "PRS" ] ;
       fhir:code [
         fhir:code [ fhir:v "SPS" ] ;
         fhir:codeSystem [ fhir:v "2.16.840.1.113883.1.11.19563" ] ;
         fhir:codeSystemName [ fhir:v "Personal Relationship Role Type Value Set" ] ;
         fhir:displayName [ fhir:v "SPOUSE" ]
       ] ; #  classCode PRS represents a person with personal relationship with\n        the patient. 
       fhir:relatedPerson [
         fhir:name ( [
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Frank" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Jones" ]
             ] )
           ] )
         ] )
       ]
     ]
  ] ) ; # 
  fhir:custodian [
     fhir:assignedCustodian [
       fhir:representedCustodianOrganization [
         fhir:id ( [
           fhir:extension [ fhir:v "99999999" ] ;
           fhir:root [ fhir:v "2.16.840.1.113883.4.6" ]
         ] ) ;
         fhir:name [
           fhir:item ( [
             fhir:xmlText [ fhir:v "Community Health and Hospitals" ]
           ] )
         ] ;
         fhir:telecom [
           fhir:use ( [ fhir:v "WP" ] ) ;
           fhir:value [
             fhir:v "tel:555-555-1002"^^xsd:anyURI ;
             fhir:l fhir:tel:555-555-1002
           ]
         ] ;
         fhir:addr [
           fhir:use ( [ fhir:v "WP" ] ) ;
           fhir:item ( [
             fhir:streetAddressLine [
               fhir:xmlText [ fhir:v "1001 Village Avenue" ]
             ]
           ] [
             fhir:city [
               fhir:xmlText [ fhir:v "Portland" ]
             ]
           ] [
             fhir:state [
               fhir:xmlText [ fhir:v "OR" ]
             ]
           ] [
             fhir:postalCode [
               fhir:xmlText [ fhir:v "99123" ]
             ]
           ] [
             fhir:country [
               fhir:xmlText [ fhir:v "US" ]
             ]
           ] )
         ]
       ]
     ]
  ] ; # 
  fhir:informationRecipient ( [
     fhir:intendedRecipient [
       fhir:informationRecipient [
         fhir:name ( [
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Henry" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Seven" ]
             ] )
           ] )
         ] )
       ] ;
       fhir:receivedOrganization [
         fhir:name ( [
           fhir:item ( [
             fhir:xmlText [ fhir:v "Community Health and Hospitals" ]
           ] )
         ] )
       ]
     ]
  ] ) ; # 
  fhir:legalAuthenticator [
     fhir:time [
       fhir:value [ fhir:v "2014-09-17T19:04:00+05:00"^^xsd:dateTime ]
     ] ;
     fhir:signatureCode [
       fhir:code [ fhir:v "S" ]
     ] ;
     fhir:assignedEntity [
       fhir:id ( [
         fhir:extension [ fhir:v "999999999" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.4.6" ]
       ] ) ;
       fhir:addr ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "1001 Village Avenue" ]
           ]
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Portland" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "99123" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ;
       fhir:telecom ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:value [
           fhir:v "tel:555-555-1002"^^xsd:anyURI ;
           fhir:l fhir:tel:555-555-1002
         ]
       ] ) ;
       fhir:assignedPerson [
         fhir:name ( [
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Henry" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Seven" ]
             ] )
           ] )
         ] )
       ]
     ]
  ] ; # 
  fhir:authenticator ( [
     fhir:time [
       fhir:value [ fhir:v "2014-09-17T19:04:00+05:00"^^xsd:dateTime ]
     ] ;
     fhir:signatureCode [
       fhir:code [ fhir:v "S" ]
     ] ;
     fhir:assignedEntity [
       fhir:id ( [
         fhir:extension [ fhir:v "999999999" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.4.6" ]
       ] ) ;
       fhir:addr ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "1001 Village Avenue" ]
           ]
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Portland" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "99123" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ;
       fhir:telecom ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:value [
           fhir:v "tel:555-555-1002"^^xsd:anyURI ;
           fhir:l fhir:tel:555-555-1002
         ]
       ] ) ;
       fhir:assignedPerson [
         fhir:name ( [
           fhir:item ( [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Henry" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Seven" ]
             ] )
           ] )
         ] )
       ]
     ]
  ] ) ; # 
  fhir:participant ( [
     fhir:typeCode [ fhir:v "IND" ] ;
     fhir:time [
       fhir:low [
         fhir:value [ fhir:v "1989-01-01"^^xsd:date ]
       ] ;
       fhir:high [
         fhir:value [ fhir:v "2014-09-16"^^xsd:date ]
       ]
     ] ;
     fhir:associatedEntity [
       fhir:classCode [ fhir:v "NOK" ] ;
       fhir:code [
         fhir:code [ fhir:v "MTH" ] ;
         fhir:codeSystem [ fhir:v "2.16.840.1.113883.5.111" ]
       ] ;
       fhir:addr ( [
         fhir:item ( [
           fhir:streetAddressLine [
             fhir:xmlText [ fhir:v "17 Daws Rd." ]
           ]
         ] [
           fhir:city [
             fhir:xmlText [ fhir:v "Beaverton" ]
           ]
         ] [
           fhir:state [
             fhir:xmlText [ fhir:v "OR" ]
           ]
         ] [
           fhir:postalCode [
             fhir:xmlText [ fhir:v "97867" ]
           ]
         ] [
           fhir:country [
             fhir:xmlText [ fhir:v "US" ]
           ]
         ] )
       ] ) ;
       fhir:telecom ( [
         fhir:use ( [ fhir:v "WP" ] ) ;
         fhir:value [
           fhir:v "tel:(999)555-1212"^^xsd:anyURI ;
           fhir:l fhir:tel:(999)555-1212
         ]
       ] ) ;
       fhir:associatedPerson [
         fhir:name ( [
           fhir:item ( [
             fhir:prefix ( [
               fhir:xmlText [ fhir:v "Mrs." ]
             ] )
           ] [
             fhir:given ( [
               fhir:xmlText [ fhir:v "Martha" ]
             ] )
           ] [
             fhir:family ( [
               fhir:xmlText [ fhir:v "Jones" ]
             ] )
           ] )
         ] )
       ]
     ]
  ] ) ; # 
  fhir:documentationOf ( [
     fhir:typeCode [ fhir:v "DOC" ] ;
     fhir:serviceEvent [
       fhir:classCode [ fhir:v "PCPR" ] ;
       fhir:code [
         fhir:code [ fhir:v "6025007" ] ;
         fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.96" ] ;
         fhir:codeSystemName [ fhir:v "SNOMED CT" ] ;
         fhir:displayName [ fhir:v "Laparoscopic appendectomy" ]
       ] ;
       fhir:effectiveTime [
         fhir:low [
           fhir:value [ fhir:v "2014-09-09T19:04:00+05:00"^^xsd:dateTime ]
         ] ;
         fhir:high [
           fhir:value [ fhir:v "2014-09-16T19:04:00+05:00"^^xsd:dateTime ]
         ]
       ] ;
       fhir:performer ( [
         fhir:typeCode [ fhir:v "PRF" ] ;
         fhir:functionCode [
           fhir:code [ fhir:v "PCP" ] ;
           fhir:codeSystem [ fhir:v "2.16.840.1.113883.12.443" ] ;
           fhir:codeSystemName [ fhir:v "Provider Role" ] ;
           fhir:displayName [ fhir:v "Primary Care Provider" ] ;
           fhir:originalText [
             fhir:xmlText [ fhir:v "Primary Care Provider" ]
           ]
         ] ;
         fhir:time [
           fhir:low [
             fhir:value [ fhir:v "2014-09-09T19:04:00+05:00"^^xsd:dateTime ]
           ] ;
           fhir:high [
             fhir:value [ fhir:v "2014-09-16T19:04:00+05:00"^^xsd:dateTime ]
           ]
         ] ;
         fhir:assignedEntity [
           fhir:id ( [
             fhir:extension [ fhir:v "PseudoMD-1" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.4.6" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "207RG0100X" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.101" ] ;
             fhir:codeSystemName [ fhir:v "Provider Codes" ] ;
             fhir:displayName [ fhir:v "Gastroenterology Physician" ]
           ] ;
           fhir:addr ( [
             fhir:use ( [ fhir:v "WP" ] ) ;
             fhir:item ( [
               fhir:streetAddressLine [
                 fhir:xmlText [ fhir:v "1001 Village Avenue" ]
               ]
             ] [
               fhir:city [
                 fhir:xmlText [ fhir:v "Portland" ]
               ]
             ] [
               fhir:state [
                 fhir:xmlText [ fhir:v "OR" ]
               ]
             ] [
               fhir:postalCode [
                 fhir:xmlText [ fhir:v "99123" ]
               ]
             ] [
               fhir:country [
                 fhir:xmlText [ fhir:v "US" ]
               ]
             ] )
           ] ) ;
           fhir:telecom ( [
             fhir:use ( [ fhir:v "WP" ] ) ;
             fhir:value [
               fhir:v "tel:+1-555-555-5000"^^xsd:anyURI ;
               fhir:l fhir:tel:+1-555-555-5000
             ]
           ] ) ;
           fhir:assignedPerson [
             fhir:name ( [
               fhir:item ( [
                 fhir:prefix ( [
                   fhir:xmlText [ fhir:v "Dr." ]
                 ] )
               ] [
                 fhir:given ( [
                   fhir:xmlText [ fhir:v "Henry" ]
                 ] )
               ] [
                 fhir:family ( [
                   fhir:xmlText [ fhir:v "Seven" ]
                 ] )
               ] )
             ] )
           ] ;
           fhir:representedOrganization [
             fhir:id ( [
               fhir:root [ fhir:v "2.16.840.1.113883.19.5.9999.1393" ]
             ] ) ;
             fhir:name ( [
               fhir:item ( [
                 fhir:xmlText [ fhir:v "Community Health and Hospitals" ]
               ] )
             ] ) ;
             fhir:telecom ( [
               fhir:use ( [ fhir:v "WP" ] ) ;
               fhir:value [
                 fhir:v "tel:+1-555-555-5000"^^xsd:anyURI ;
                 fhir:l fhir:tel:+1-555-555-5000
               ]
             ] ) ;
             fhir:addr ( [
               fhir:item ( [
                 fhir:streetAddressLine [
                   fhir:xmlText [ fhir:v "1001 Village Avenue" ]
                 ]
               ] [
                 fhir:city [
                   fhir:xmlText [ fhir:v "Portland" ]
                 ]
               ] [
                 fhir:state [
                   fhir:xmlText [ fhir:v "OR" ]
                 ]
               ] [
                 fhir:postalCode [
                   fhir:xmlText [ fhir:v "99123" ]
                 ]
               ] [
                 fhir:country [
                   fhir:xmlText [ fhir:v "US" ]
                 ]
               ] )
             ] )
           ]
         ]
       ] [
         fhir:typeCode [ fhir:v "PPRF" ] ;
         fhir:functionCode [
           fhir:code [ fhir:v "PCP" ] ;
           fhir:codeSystem [ fhir:v "2.16.840.1.113883.12.443" ] ;
           fhir:codeSystemName [ fhir:v "Provider Role" ] ;
           fhir:displayName [ fhir:v "Primary Performer" ] ;
           fhir:originalText [
             fhir:xmlText [ fhir:v "Primary Care Provider" ]
           ]
         ] ;
         fhir:time [
           fhir:low [
             fhir:value [ fhir:v "2014-09-09T19:04:00+05:00"^^xsd:dateTime ]
           ] ;
           fhir:high [
             fhir:value [ fhir:v "2014-09-16T19:04:00+05:00"^^xsd:dateTime ]
           ]
         ] ;
         fhir:assignedEntity [
           fhir:id ( [
             fhir:extension [ fhir:v "PseudoMD-3" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.4.6" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "207RG0100X" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.101" ] ;
             fhir:codeSystemName [ fhir:v "Provider Codes" ] ;
             fhir:displayName [ fhir:v "Gastroenterology Physician" ]
           ] ;
           fhir:addr ( [
             fhir:use ( [ fhir:v "WP" ] ) ;
             fhir:item ( [
               fhir:streetAddressLine [
                 fhir:xmlText [ fhir:v "1001 Village Avenue" ]
               ]
             ] [
               fhir:city [
                 fhir:xmlText [ fhir:v "Portland" ]
               ]
             ] [
               fhir:state [
                 fhir:xmlText [ fhir:v "OR" ]
               ]
             ] [
               fhir:postalCode [
                 fhir:xmlText [ fhir:v "99123" ]
               ]
             ] [
               fhir:country [
                 fhir:xmlText [ fhir:v "US" ]
               ]
             ] )
           ] ) ;
           fhir:telecom ( [
             fhir:use ( [ fhir:v "HP" ] ) ;
             fhir:value [
               fhir:v "tel:+1-555-555-5000"^^xsd:anyURI ;
               fhir:l fhir:tel:+1-555-555-5000
             ]
           ] ) ;
           fhir:assignedPerson [
             fhir:name ( [
               fhir:item ( [
                 fhir:prefix ( [
                   fhir:xmlText [ fhir:v "Dr." ]
                 ] )
               ] [
                 fhir:given ( [
                   fhir:xmlText [ fhir:v "Herman" ]
                 ] )
               ] [
                 fhir:family ( [
                   fhir:xmlText [ fhir:v "Eight" ]
                 ] )
               ] )
             ] )
           ] ;
           fhir:representedOrganization [
             fhir:id ( [
               fhir:root [ fhir:v "2.16.840.1.113883.19.5.9999.1393" ]
             ] ) ;
             fhir:name ( [
               fhir:item ( [
                 fhir:xmlText [ fhir:v "Community Health and Hospitals" ]
               ] )
             ] ) ;
             fhir:telecom ( [
               fhir:use ( [ fhir:v "HP" ] ) ;
               fhir:value [
                 fhir:v "tel:+1-555-555-5000"^^xsd:anyURI ;
                 fhir:l fhir:tel:+1-555-555-5000
               ]
             ] ) ;
             fhir:addr ( [
               fhir:use ( [ fhir:v "WP" ] ) ;
               fhir:item ( [
                 fhir:streetAddressLine [
                   fhir:xmlText [ fhir:v "1001 Village Avenue" ]
                 ]
               ] [
                 fhir:city [
                   fhir:xmlText [ fhir:v "Portland" ]
                 ]
               ] [
                 fhir:state [
                   fhir:xmlText [ fhir:v "OR" ]
                 ]
               ] [
                 fhir:postalCode [
                   fhir:xmlText [ fhir:v "99123" ]
                 ]
               ] [
                 fhir:country [
                   fhir:xmlText [ fhir:v "US" ]
                 ]
               ] )
             ] )
           ]
         ]
       ] )
     ]
  ] ) ; # 
  fhir:componentOf [
     fhir:encompassingEncounter [
       fhir:id ( [
         fhir:extension [ fhir:v "9937012" ] ;
         fhir:root [ fhir:v "2.16.840.1.113883.19" ]
       ] ) ;
       fhir:effectiveTime [
         fhir:low [
           fhir:value [ fhir:v "2014-09-09T19:04:00+05:00"^^xsd:dateTime ]
         ] ; #  This is the admission date of the hospitalization 
         fhir:high [
           fhir:value [ fhir:v "2014-09-16T19:04:00+05:00"^^xsd:dateTime ]
         ] #  This is the discharge date of the hospitalization 
       ] ; #  \n      <code codeSystem=\"2.16.840.1.113883.6.12\" codeSystemName=\"CPT-4\" code=\"99213\" displayName=\"Evaluation and Management\"\/>\n      
       fhir:dischargeDispositionCode [
         fhir:code [ fhir:v "01" ] ;
         fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.301.5" ] ;
         fhir:codeSystemName [ fhir:v "AHA NUBC Patient Discharge Status Codes" ] ;
         fhir:displayName [ fhir:v "Routine Discharge" ]
       ] ;
       fhir:location [
         fhir:healthCareFacility [
           fhir:id ( [
             fhir:root [ fhir:v "2.16.540.1.113883.19.2" ]
           ] )
         ]
       ]
     ]
  ] ; # 
  fhir:component [
     fhir:structuredBody [
       fhir:component ( [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:root [ fhir:v "1.3.6.1.4.1.19376.1.5.3.1.3.5" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "8648-8" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ] ;
             fhir:displayName [ fhir:v "HOSPITAL COURSE" ]
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "Hospital Course" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:extension [ fhir:v "2015-08-01" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.2.24" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "11535-2" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ] ;
             fhir:displayName [ fhir:v "Hospital Discharge Diagnosis" ] ;
             fhir:translation ( [
               fhir:code [ fhir:v "78375-3" ] ;
               fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
               fhir:codeSystemName [ fhir:v "LOINC" ] ;
               fhir:displayName [ fhir:v "Discharge Diagnosis" ]
             ] )
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "Discharge Diagnosis" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:extension [ fhir:v "2014-06-09" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.2.10" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "18776-5" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ] ;
             fhir:displayName [ fhir:v "Treatment plan" ]
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "TREATMENT PLAN" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.2.42" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "18841-7" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ] ;
             fhir:displayName [ fhir:v "Hospital Consultations Section" ]
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "HOSPITAL CONSULTATIONS" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:extension [ fhir:v "2015-08-01" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.2.11.1" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "10183-2" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ] ;
             fhir:displayName [ fhir:v "Hospital Discharge Medications" ] ;
             fhir:translation ( [
               fhir:code [ fhir:v "75311-1" ] ;
               fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
               fhir:codeSystemName [ fhir:v "LOINC" ] ;
               fhir:displayName [ fhir:v "Discharge Medications" ]
             ] )
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "Discharge Medications" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:extension [ fhir:v "2015-08-01" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.2.6.1" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "48765-2" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ]
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "ALLERGIES AND ADVERSE REACTIONS" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:extension [ fhir:v "2015-08-01" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.2.3.1" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "30954-2" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ] ;
             fhir:displayName [ fhir:v "RESULTS" ]
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "RESULTS" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] [
         fhir:section [
           fhir:nullFlavor [ fhir:v "NI" ] ;
           fhir:templateId ( [
             fhir:extension [ fhir:v "2014-06-09" ] ;
             fhir:root [ fhir:v "2.16.840.1.113883.10.20.22.2.7.1" ]
           ] ) ;
           fhir:code [
             fhir:code [ fhir:v "47519-4" ] ;
             fhir:codeSystem [ fhir:v "2.16.840.1.113883.6.1" ] ;
             fhir:codeSystemName [ fhir:v "LOINC" ] ;
             fhir:displayName [ fhir:v "PROCEDURES" ]
           ] ;
           fhir:title [
             fhir:xmlText [ fhir:v "Procedures" ]
           ] ;
           fhir:text [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"^^rdf:XMLLiteral ]
         ]
       ] )
     ] #  All sections are set to nullFlavor \/ text = No information, \n        as this is a header example, not a complete body example 
  ]] . # 

# -------------------------------------------------------------------------------------

