{
  "resourceType": "StructureDefinition",
  "id": "zd-episodeofcare",
  "url": "http://zorgdomein.nl/fhir/StructureDefinition/zd-episodeofcare",
  "name": "ZD EpisodeOfCare",
  "status": "draft",
  "date": "2017-03-01T11:00:00+00:00",
  "publisher": "ZorgDomein",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "https://zorgdomein.nl"
        },
        {
          "system": "email",
          "value": "io@zorgdomein.nl"
        }
      ]
    }
  ],
  "fhirVersion": "3.0.2",
  "kind": "resource",
  "abstract": false,
  "type": "EpisodeOfCare",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "EpisodeOfCare",
        "path": "EpisodeOfCare",
        "short": "An association of a Patient with an Organization and Healthcare Provider(s) for a period of time that the Organization assumes some level of responsibility",
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.id",
        "path": "EpisodeOfCare.id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.extension",
        "path": "EpisodeOfCare.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "EpisodeOfCare.extension:zd-classification-code",
        "path": "EpisodeOfCare.extension",
        "sliceName": "zd-classification-code",
        "short": "Classification code(s) for the episode",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": "http://zorgdomein.nl/fhir/StructureDefinition/zd-classification-code"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.extension:zd-classification-code.valueCodeableConcept:valueCodeableConcept",
        "path": "EpisodeOfCare.extension.valueCodeableConcept",
        "sliceName": "valueCodeableConcept",
        "short": "Classification code for the episode"
      },
      {
        "id": "EpisodeOfCare.extension:zd-classification-code.valueCodeableConcept:valueCodeableConcept.coding",
        "path": "EpisodeOfCare.extension.valueCodeableConcept.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "EpisodeOfCare.extension:zd-classification-code.valueCodeableConcept:valueCodeableConcept.coding:ICPC",
        "path": "EpisodeOfCare.extension.valueCodeableConcept.coding",
        "sliceName": "ICPC",
        "short": "ICPC code",
        "max": "1"
      },
      {
        "id": "EpisodeOfCare.extension:zd-classification-code.valueCodeableConcept:valueCodeableConcept.coding:ICPC.system",
        "path": "EpisodeOfCare.extension.valueCodeableConcept.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/sid/icpc-1-nl"
      },
      {
        "id": "EpisodeOfCare.extension:zd-classification-code.valueCodeableConcept:valueCodeableConcept.coding:ICPC.code",
        "path": "EpisodeOfCare.extension.valueCodeableConcept.coding.code",
        "short": "Actual ICPC code",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.type",
        "path": "EpisodeOfCare.type",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.code"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.type:flaggedEpisode",
        "path": "EpisodeOfCare.type",
        "sliceName": "flaggedEpisode",
        "short": "Use coding.code = \"flagged-episode\" if the episode should be flagged as an episode with attention value",
        "max": "1"
      },
      {
        "id": "EpisodeOfCare.type:flaggedEpisode.coding",
        "path": "EpisodeOfCare.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "EpisodeOfCare.type:flaggedEpisode.coding.code",
        "path": "EpisodeOfCare.type.coding.code",
        "min": 1,
        "fixedCode": "flagged-episode"
      },
      {
        "id": "EpisodeOfCare.type:flaggedEpisode.coding.display",
        "path": "EpisodeOfCare.type.coding.display",
        "fixedString": "Episode met attentiewaarde"
      },
      {
        "id": "EpisodeOfCare.diagnosis",
        "path": "EpisodeOfCare.diagnosis",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.diagnosis.condition",
        "path": "EpisodeOfCare.diagnosis.condition",
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.diagnosis.condition.display",
        "path": "EpisodeOfCare.diagnosis.condition.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.patient",
        "path": "EpisodeOfCare.patient",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://zorgdomein.nl/fhir/StructureDefinition/zd-patient"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "EpisodeOfCare.period",
        "path": "EpisodeOfCare.period",
        "mustSupport": true
      }
    ]
  }
}