<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://oda.fi/fhir/StructureDefinition/stu3/CarePlan" />
  <name value="ODA CarePlan" />
  <status value="draft" />
  <fhirVersion value="3.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="CarePlan" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/CarePlan" />
  <derivation value="constraint" />
  <differential>
    <element id="CarePlan.implicitRules">
      <path value="CarePlan.implicitRules" />
      <max value="0" />
    </element>
    <element id="CarePlan.language">
      <path value="CarePlan.language" />
      <min value="1" />
    </element>
    <element id="CarePlan.contained">
      <path value="CarePlan.contained" />
      <type>
        <code value="ActivityDefinition" />
        <profile value="http://hl7.org/fhir/StructureDefinition/ActivityDefinition" />
      </type>
      <type>
        <code value="Observation" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation" />
      </type>
    </element>
    <element id="CarePlan.definition">
      <path value="CarePlan.definition" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://oda.fi/fhir/StructureDefinition/stu3/CarePlanTemplate" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Questionnaire" />
      </type>
    </element>
    <element id="CarePlan.basedOn">
      <path value="CarePlan.basedOn" />
      <definition value="A care plan that is related to this plan. In Omaolo, this link represents loose coupling so that the related careplans can have their own status and life cycle." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://oda.fi/fhir/StructureDefinition/stu3/CarePlan" />
      </type>
    </element>
    <element id="CarePlan.replaces">
      <path value="CarePlan.replaces" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://oda.fi/fhir/StructureDefinition/stu3/CarePlan" />
      </type>
    </element>
    <element id="CarePlan.partOf">
      <path value="CarePlan.partOf" />
      <definition value="A larger care plan of which this particular care plan is a component or step. In Omaolo, this link represents tight coupling of care plans so that the status and life-cycle of this plan is same as the status of the &quot;master-plan&quot; ie. the plan partOf references." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://oda.fi/fhir/StructureDefinition/stu3/CarePlan" />
      </type>
    </element>
    <element id="CarePlan.intent">
      <path value="CarePlan.intent" />
      <short value="plan" />
      <fixedCode value="plan" />
    </element>
    <element id="CarePlan.category">
      <path value="CarePlan.category" />
      <min value="1" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="CarePlanCategory" />
        </extension>
        <strength value="required" />
        <description value="Identifies what &quot;kind&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. &quot;Home health&quot;, &quot;psychiatric&quot;, &quot;asthma&quot;, &quot;disease management&quot;, etc. Should contain one ODA template category and one careplan category." />
        <valueSetReference>
          <reference value="http://oda.fi/fhir/ValueSet/careplan-category" />
        </valueSetReference>
      </binding>
    </element>
    <element id="CarePlan.title">
      <path value="CarePlan.title" />
      <min value="1" />
    </element>
    <element id="CarePlan.subject">
      <path value="CarePlan.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element id="CarePlan.context">
      <path value="CarePlan.context" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
      </type>
    </element>
    <element id="CarePlan.period">
      <path value="CarePlan.period" />
      <min value="1" />
    </element>
    <element id="CarePlan.period.start">
      <path value="CarePlan.period.start" />
      <min value="1" />
    </element>
    <element id="CarePlan.author">
      <path value="CarePlan.author" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
    </element>
    <element id="CarePlan.careTeam">
      <path value="CarePlan.careTeam" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://oda.fi/fhir/StructureDefinition/stu3/ServiceRequestList" />
      </type>
    </element>
    <element id="CarePlan.addresses">
      <path value="CarePlan.addresses" />
      <max value="0" />
    </element>
    <element id="CarePlan.goal">
      <path value="CarePlan.goal" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://oda.fi/fhir/StructureDefinition/stu3/Goal" />
      </type>
    </element>
    <element id="CarePlan.activity.outcomeCodeableConcept">
      <path value="CarePlan.activity.outcomeCodeableConcept" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.progress">
      <path value="CarePlan.activity.progress" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.reference">
      <path value="CarePlan.activity.reference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Task" />
      </type>
    </element>
    <element id="CarePlan.activity.detail.category">
      <path value="CarePlan.activity.detail.category" />
      <min value="1" />
    </element>
    <element id="CarePlan.activity.detail.category.coding.system">
      <path value="CarePlan.activity.detail.category.coding.system" />
      <fixedUri value="http://oda.fi/fhir/ValueSet/activity-category" />
    </element>
    <element id="CarePlan.activity.detail.definition">
      <path value="CarePlan.activity.detail.definition" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PlanDefinition" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ActivityDefinition" />
      </type>
    </element>
    <element id="CarePlan.activity.detail.reasonReference">
      <path value="CarePlan.activity.detail.reasonReference" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.detail.goal">
      <path value="CarePlan.activity.detail.goal" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.detail.statusReason">
      <path value="CarePlan.activity.detail.statusReason" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.detail.prohibited">
      <path value="CarePlan.activity.detail.prohibited" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.detail.location">
      <path value="CarePlan.activity.detail.location" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.detail.performer">
      <path value="CarePlan.activity.detail.performer" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element id="CarePlan.activity.detail.product[x]">
      <path value="CarePlan.activity.detail.product[x]" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.detail.dailyAmount">
      <path value="CarePlan.activity.detail.dailyAmount" />
      <max value="0" />
    </element>
    <element id="CarePlan.activity.detail.quantity">
      <path value="CarePlan.activity.detail.quantity" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>