<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="gp-JournalEntry" />
  <url value="http://nictiz.nl/fhir/StructureDefinition/gp-JournalEntry" />
  <version value="2.0.5" />
  <name value="gp-JournalEntry" />
  <title value="gp-JournalEntry" />
  <status value="active" />
  <publisher value="Nictiz" />
  <contact>
    <name value="Nictiz" />
    <telecom>
      <system value="url" />
      <value value="https://www.nictiz.nl" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="JournalEntry S-O-A-P (Dutch S-O-E-P) as defined in the NHG HIS Referentiemodel." />
  <fhirVersion value="3.0.2" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="http://fhir.nl/fhir/StructureDefinition/nl-core-observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation.extension:nl-core-episodeofcare">
      <path value="Observation.extension" />
      <sliceName value="nl-core-episodeofcare" />
      <comment value="It is recommended to use the nl-core-episodeofcare extension to reference nl-core-episodeofcare (EpisodeOfCare) instances rather than the `context` element, as this approach will be enforced in FHIR R4." />
      <type>
        <code value="Extension" />
        <profile value="http://nictiz.nl/fhir/StructureDefinition/extension-context-nl-core-episodeofcare" />
      </type>
    </element>
    <element id="Observation.identifier">
      <path value="Observation.identifier" />
      <max value="1" />
    </element>
    <element id="Observation.basedOn">
      <path value="Observation.basedOn" />
      <max value="0" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <short value="final" />
      <definition value="The status of the journal entry" />
      <fixedCode value="final" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <short value="NHG SOAP Code" />
      <definition value="Subjective, Objective, Evaluation, Plan" />
      <binding>
        <strength value="required" />
        <description value="NHG SOAP codes" />
        <valueSetReference>
          <reference value="http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.103.11.2--20111012000000" />
          <display value="JournaalregelType" />
        </valueSetReference>
      </binding>
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.nl/fhir/StructureDefinition/nl-core-patient" />
      </type>
    </element>
    <element id="Observation.context">
      <path value="Observation.context" />
      <short value="Encounter during which this observation is made" />
      <definition value="The encounter during which this journal entry was made." />
      <comment value="It is recommended to use the nl-core-episodeofcare extension to reference nl-core-episodeofcare (EpisodeOfCare) instances rather than the `context` element, as this approach will be enforced in FHIR R4." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/gp-Encounter" />
      </type>
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <definition value="Sending the effective date is recommended, but is otherwise understood to fall in the encounter date range." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.issued">
      <path value="Observation.issued" />
      <max value="0" />
    </element>
    <element id="Observation.value[x]">
      <path value="Observation.value[x]" />
      <short value="Journal Entry text" />
      <definition value="The text as recorded or generated for this journal entry." />
      <alias value="Journaalregel tekst" />
      <min value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <max value="0" />
    </element>
    <element id="Observation.interpretation">
      <path value="Observation.interpretation" />
      <max value="0" />
    </element>
    <element id="Observation.comment">
      <path value="Observation.comment" />
      <max value="0" />
    </element>
    <element id="Observation.bodySite">
      <path value="Observation.bodySite" />
      <max value="0" />
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <max value="0" />
    </element>
    <element id="Observation.specimen">
      <path value="Observation.specimen" />
      <max value="0" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
      <max value="0" />
    </element>
    <element id="Observation.referenceRange">
      <path value="Observation.referenceRange" />
      <max value="0" />
    </element>
    <element id="Observation.related">
      <path value="Observation.related" />
      <max value="0" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="code" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="Journal entry Evaluation often has an ICPC code that qualifies it. Journal entry Subjective is sometimes qualified using an ICPC code too." />
      <max value="2" />
    </element>
    <element id="Observation.component:ICPC_S">
      <path value="Observation.component" />
      <sliceName value="ICPC_S" />
      <max value="1" />
    </element>
    <element id="Observation.component:ICPC_S.code">
      <path value="Observation.component.code" />
      <definition value="ICPC code qualifying journal entry Subjective" />
      <patternCodeableConcept>
        <coding>
          <system value="http://hl7.org/fhir/v3/ActCode" />
          <code value="ADMDX" />
          <display value="admitting diagnosis" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:ICPC_S.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="Observation.component:ICPC_S.value[x].coding">
      <path value="Observation.component.value[x].coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:ICPC_S.value[x].coding.system">
      <path value="Observation.component.value[x].coding.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/sid/icpc-1-nl" />
    </element>
    <element id="Observation.component:ICPC_S.value[x].coding.code">
      <path value="Observation.component.value[x].coding.code" />
      <min value="1" />
    </element>
    <element id="Observation.component:ICPC_E">
      <path value="Observation.component" />
      <sliceName value="ICPC_E" />
      <max value="1" />
    </element>
    <element id="Observation.component:ICPC_E.code">
      <path value="Observation.component.code" />
      <definition value="ICPC code qualifying journal entry Evaluation" />
      <patternCodeableConcept>
        <coding>
          <system value="http://hl7.org/fhir/v3/ActCode" />
          <code value="DISDX" />
          <display value="discharge diagnosis" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:ICPC_E.value[x]">
      <path value="Observation.component.value[x]" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="Observation.component:ICPC_E.value[x].coding">
      <path value="Observation.component.value[x].coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:ICPC_E.value[x].coding.system">
      <path value="Observation.component.value[x].coding.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/sid/icpc-1-nl" />
    </element>
    <element id="Observation.component:ICPC_E.value[x].coding.code">
      <path value="Observation.component.value[x].coding.code" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>