<?xml version="1.0" encoding="UTF-8"?>

<Observation xmlns="http://hl7.org/fhir">
  <id value="20minute-apgar-score"/>
  <contained>
    <Patient>
      <id value="newborn"/>
      <!--    MRN assigned by ACME healthcare on    -->
      <identifier>
        <system value="http://acmehealthcare/org/mrns"/>
        <value value="12345"/>
      </identifier>
      <active value="true"/>
      <!--    Peter James Chalmers    -->
      <name>
        <family value="Chalmers"/>
        <given value="Peter"/>
        <given value="James"/>
      </name>
      <!--    use FHIR code system for male / female    -->
      <gender value="male"/>
      <birthDate value="2016-05-18">
        <extension url="http://hl7.org/fhir/StructureDefinition/patient-birthTime">
          <valueDateTime value="2016-05-18T10:28:45Z"/>
        </extension>
      </birthDate>
    </Patient>
  </contained>
  <status value="final"/>
  <category>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/observation-category"/>
      <code value="survey"/>
      <display value="Survey"/>
    </coding>
    <text value="Survey"/>
  </category>
  <code>
    <coding>
      <system value="http://snomed.info/sct"/>
      <code value="443849008"/>
      <display value="Apgar score at 20 minutes"/>
    </coding>
    <text value="20 minute Apgar Score"/>
  </code>
  <subject>
    <reference value="#newborn"/>
  </subject>
  <effectiveDateTime value="2016-05-18T22:33:22Z"/>
  <performer>
    <reference value="Practitioner/example"/>
  </performer>
  <valueQuantity>
    <value value="10"/>
    <system value="http://unitsofmeasure.org"/>
    <code value="{score}"/>
  </valueQuantity>
  <component>
    <code>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="249227004"/>
        <display value="Apgar color score"/>
      </coding>
      <text value="Apgar color score"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <!-- this  extension  maps a numeric score to the code this may already be known and unecessary -->
        <extension url="http://hl7.org/fhir/StructureDefinition/itemWeight">
          <valueDecimal value="2"/>
        </extension>
        <system value="http://loinc.org"/>
        <code value="LA6724-4"/>
        <display value="Good color all over"/>
      </coding>
      <coding>
        <system value="http://acme.ped/apgarcolor"/>
        <code value="2"/>
      </coding>
      <text value="2. Good color all over"/>
    </valueCodeableConcept>
  </component>
  <component>
    <code>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="249223000"/>
        <display value="Apgar heart rate score"/>
      </coding>
      <text value="Apgar heart rate score"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <!-- this  extension  maps a numeric score to the code this may already be known and unecessary -->
        <extension url="http://hl7.org/fhir/StructureDefinition/itemWeight">
          <valueDecimal value="2"/>
        </extension>
        <system value="http://loinc.org"/>
        <code value="LA6718-6"/>
        <display value="At least 100 beats per minute"/>
      </coding>
      <coding>
        <system value="http://acme.ped/apgarheartrate"/>
        <code value="2"/>
      </coding>
      <text value="2. At least 100 beats per minute"/>
    </valueCodeableConcept>
  </component>
  <component>
    <code>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="249226008"/>
        <display value="Apgar response to stimulus score"/>
      </coding>
      <text value="Apgar response to stimulus score"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <!-- this  extension  maps a numeric score to the code this may already be known and unecessary -->
        <extension url="http://hl7.org/fhir/StructureDefinition/itemWeight">
          <valueDecimal value="2"/>
        </extension>
        <system value="http://loinc.org"/>
        <code value="LA6721-0"/>
        <display value="Grimace and pulling away, cough, or sneeze during suctioning"/>
      </coding>
      <coding>
        <system value="http://acme.ped/apgarreflexirritability"/>
        <code value="2"/>
      </coding>
      <text value="2. Grimace and pulling away, cough, or sneeze during suctioning"/>
    </valueCodeableConcept>
  </component>
  <component>
    <code>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="249225007"/>
        <display value="Apgar muscle tone score"/>
      </coding>
      <text value="Apgar muscle tone score"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <!-- this  extension  maps a numeric score to the code this may already be known and unecessary -->
        <extension url="http://hl7.org/fhir/StructureDefinition/itemWeight">
          <valueDecimal value="2"/>
        </extension>
        <system value="http://loinc.org"/>
        <code value="LA6715-2"/>
        <display value="Active motion"/>
      </coding>
      <coding>
        <system value="http://acme.ped/apgarmuscletone"/>
        <code value="2"/>
      </coding>
      <text value="2. Active motion"/>
    </valueCodeableConcept>
  </component>
  <component>
    <code>
      <coding>
        <system value="http://snomed.info/sct"/>
        <code value="249224006"/>
        <display value="Apgar respiratory effort score"/>
      </coding>
      <text value="Apgar respiratory effort score"/>
    </code>
    <valueCodeableConcept>
      <coding>
        <!-- this  extension  maps a numeric score to the code this may already be known and unecessary -->
        <extension url="http://hl7.org/fhir/StructureDefinition/itemWeight">
          <valueDecimal value="2"/>
        </extension>
        <system value="http://loinc.org"/>
        <code value="LA6727-7"/>
        <display value="Good, strong cry; normal rate and effort of breathing"/>
      </coding>
      <coding>
        <system value="http://acme.ped/apgarrespiratoryeffort"/>
        <code value="2"/>
      </coding>
      <text value="2. Good, strong cry; normal rate and effort of breathing"/>
    </valueCodeableConcept>
  </component>
</Observation>