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

<Encounter xmlns="http://hl7.org/fhir">
  <id value="agy1002135"/>
  <meta>
    <profile value="http://dips.no/fhir/R4/StructureDefinition/DIPSR4Encounter"/>
    <security>
      <system value="http://terminology.hl7.org/CodeSystem/v3-Confidentiality"/>
      <code value="N"/>
    </security>
    <tag>
      <system value="http://dips.no/fhir/namingsystem/encountersource"/>
      <code value="episodeofcare"/>
    </tag>
  </meta>
  <contained>
    <Encounter>
      <id value="amw1004667"/>
      <meta>
        <profile value="http://dips.no/fhir/R4/StructureDefinition/DIPSHospitalStayEncounter"/>
        <tag>
          <system value="http://dips.no/fhir/namingsystem/encountersource"/>
          <code value="hospitalstay"/>
        </tag>
      </meta>
      <identifier>
        <system value="http://dips.no/fhir/namingsystem/dips-hospitalstayid"/>
        <value value="1004667"/>
      </identifier>
      <status value="in-progress"/>
      <class>
        <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
        <code value="IMP"/>
        <display value="inpatient encounter"/>
      </class>
    </Encounter>
  </contained>
  <extension url="http://dips.no/fhir/R4/StructureDefinition/ReferredBy">
    <valueReference>
      <reference value="PractitionerRole/agb27"/>
      <identifier>
        <system value="urn:oid:1.3.6.1.4.1.9038.51.1"/>
        <value value="27"/>
      </identifier>
    </valueReference>
  </extension>
  <extension url="http://dips.no/fhir/R4/StructureDefinition/Reminder">
    <valueBoolean value="false"/>
  </extension>
  <extension url="http://dips.no/fhir/R4/StructureDefinition/TerminationExtension">
    <valueCodeableConcept>
      <coding>
        <system value="http://dips.no/fhir/namingsystem/dips-terminationcodeid"/>
        <code value="314"/>
        <display value="Ordinært avsluttet"/>
      </coding>
      <coding>
        <system value="http://dips.no/fhir/namingsystem/dips-terminationcode"/>
        <code value="OR"/>
        <display value="Ordinært avsluttet"/>
      </coding>
    </valueCodeableConcept>
  </extension>
  <extension url="http://dips.no/fhir/R4/StructureDefinition/PlannedContactEndTimeExtension">
    <valueDateTime value="2009-11-26T00:00:00+00:00"/>
  </extension>
  <extension url="http://dips.no/fhir/R4/StructureDefinition/Department">
    <valueReference>
      <reference value="Organization/afa22"/>
      <identifier>
        <system value="urn:oid:1.3.6.1.4.1.9038.70.3"/>
        <value value="22"/>
      </identifier>
      <display value="Kirurgisk avdeling"/>
    </valueReference>
  </extension>
  <identifier>
    <system value="http://dips.no/fhir/namingsystem/dips-omsorgsepisodeid"/>
    <value value="1002135"/>
  </identifier>
  <identifier>
    <system value="http://dips.no/fhir/namingsystem/dips-plannedcontactid"/>
    <value value="1004667"/>
  </identifier>
  <identifier>
    <system value="http://dips.no/fhir/namingsystem/dips-bookingid"/>
    <value value="1b8e6e90-621a-9d45-a2e4-dcdebfe06902"/>
  </identifier>
  <status value="in-progress"/>
  <class>
    <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
    <code value="IMP"/>
    <display value="inpatient encounter"/>
  </class>
  <type id="NprLevelOfCare">
    <coding>
      <system value="urn:oid:2.16.578.1.12.4.1.1.8406"/>
      <code value="1"/>
      <display value="Heldøgn"/>
    </coding>
    <coding>
      <system value="http://dips.no/fhir/namingsystem/dips-nprlevelofcarecodeid"/>
      <code value="215642"/>
      <display value="Heldøgn"/>
    </coding>
  </type>
  <type id="ContactType">
    <coding>
      <system value="http://dips.no/fhir/namingsystem/dips-contacttypecodeid"/>
      <code value="106800"/>
      <display value="Heldøgn"/>
    </coding>
    <coding>
      <system value="urn:oid:2.16.578.1.12.4.1.1.8240"/>
      <code value="01"/>
      <display value="Heldøgn"/>
    </coding>
  </type>
  <subject>
    <reference value="Patient/cdp2008844"/>
    <identifier>
      <system value="http://dips.no/fhir/namingsystem/dips-patientid"/>
      <value value="2008844"/>
    </identifier>
    <display value="Lab (Testplan For Lab-Xml), Xml"/>
  </subject>
  <basedOn>
    <reference value="ServiceRequest/agc1002251"/>
    <identifier>
      <system value="http://dips.no/fhir/namingsystem/dips-referralid"/>
      <value value="1002251"/>
    </identifier>
  </basedOn>
  <appointment>
    <reference value="Appointment/ahi1004667"/>
    <identifier>
      <system value="http://dips.no/fhir/namingsystem/dips-plannedcontactid"/>
      <value value="1004667"/>
    </identifier>
  </appointment>
  <period>
    <start value="2009-11-26T08:00:00+00:00"/>
  </period>
  <reasonCode>
    <text value="Meldingstest lab"/>
  </reasonCode>
  <location>
    <extension url="http://dips.no/fhir/R4/StructureDefinition/BedTime">
      <valueDateTime value="2009-11-26T09:15:42+00:00"/>
    </extension>
    <location>
      <reference value="Location/aie1000000"/>
      <identifier>
        <system value="http://dips.no/fhir/namingsystem/dips-bedid"/>
        <value value="1000000"/>
      </identifier>
      <display value="Kirurgisk post 2, Seng: Korridor-2"/>
    </location>
    <status value="reserved"/>
    <physicalType>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/location-physical-type"/>
        <code value="bd"/>
        <display value="Bed"/>
      </coding>
    </physicalType>
    <period>
      <start value="2009-11-26T08:00:00+00:00"/>
    </period>
  </location>
  <location>
    <location>
      <reference value="Location/ahl21"/>
      <identifier>
        <system value="urn:oid:2.16.578.1.12.4.1.4.102"/>
        <value value="10066"/>
      </identifier>
      <display value="Kirurgisk post 2, Seng: Korridor-2"/>
    </location>
    <status value="reserved"/>
    <physicalType>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/location-physical-type"/>
        <code value="wa"/>
        <display value="Ward"/>
      </coding>
    </physicalType>
    <period>
      <start value="2009-11-26T08:00:00+00:00"/>
    </period>
  </location>
  <location>
    <extension url="http://dips.no/fhir/R4/StructureDefinition/BedTime">
      <valueDateTime value="2009-11-26T09:16:41+00:00"/>
    </extension>
    <location>
      <reference value="Location/aie1000050"/>
      <identifier>
        <system value="http://dips.no/fhir/namingsystem/dips-bedid"/>
        <value value="1000050"/>
      </identifier>
      <display value="Intensiv post 1, Seng: Blå 2"/>
    </location>
    <status value="active"/>
    <physicalType>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/location-physical-type"/>
        <code value="bd"/>
        <display value="Bed"/>
      </coding>
    </physicalType>
    <period>
      <start value="2009-11-26T09:15:57+00:00"/>
    </period>
  </location>
  <location>
    <location>
      <reference value="Location/ahl25"/>
      <identifier>
        <system value="urn:oid:2.16.578.1.12.4.1.4.102"/>
        <value value="10068"/>
      </identifier>
      <display value="Intensiv post 1, Seng: Blå 2"/>
    </location>
    <status value="active"/>
    <physicalType>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/location-physical-type"/>
        <code value="wa"/>
        <display value="Ward"/>
      </coding>
    </physicalType>
    <period>
      <start value="2009-11-26T09:15:57+00:00"/>
    </period>
  </location>
  <serviceProvider>
    <reference value="Organization/afa22"/>
    <identifier>
      <system value="urn:oid:2.16.578.1.12.4.1.4.102"/>
      <value value="10013"/>
    </identifier>
    <display value="Kirurgisk avdeling | Testsykehuset DIPS"/>
  </serviceProvider>
  <partOf>
    <reference value="#amw1004667"/>
  </partOf>
</Encounter>