{
  "resourceType": "StructureDefinition",
  "id": "poc-seguimiento-episodeofcare",
  "url": "http://poc-seguimiento.cens.cl/fhir/StructureDefinition/PocSeguimientoEpisodeOfCare",
  "name": "PocSeguimientoEpisodeOfCare",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "EpisodeOfCare",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "EpisodeOfCare.extension",
        "path": "EpisodeOfCare.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "EpisodeOfCare.extension:TipoUsuario",
        "path": "EpisodeOfCare.extension",
        "sliceName": "TipoUsuario",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ssmso.cl/Seguimiento/TipoUsuario"
            ]
          }
        ]
      },
      {
        "id": "EpisodeOfCare.extension:NumeroIdentificacionIndice",
        "path": "EpisodeOfCare.extension",
        "sliceName": "NumeroIdentificacionIndice",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ssmso.cl/Seguimiento/NumeroIdentificacionIndice"
            ]
          }
        ]
      },
      {
        "id": "EpisodeOfCare.extension:FolioEpivigilaCasoIndice",
        "path": "EpisodeOfCare.extension",
        "sliceName": "FolioEpivigilaCasoIndice",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ssmso.cl/Seguimiento/FolioEpivigilaCasoIndice"
            ]
          }
        ]
      },
      {
        "id": "EpisodeOfCare.identifier",
        "path": "EpisodeOfCare.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "EpisodeOfCare.identifier:FolioLocal",
        "path": "EpisodeOfCare.identifier",
        "sliceName": "FolioLocal",
        "min": 1,
        "max": "1"
      },
      {
        "id": "EpisodeOfCare.identifier:FolioLocal.system",
        "path": "EpisodeOfCare.identifier.system",
        "min": 1,
        "fixedUri": "http://ssmso.cl/Seguimiento/FolioLocal"
      },
      {
        "id": "EpisodeOfCare.identifier:FolioLocal.value",
        "path": "EpisodeOfCare.identifier.value",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.identifier:FolioEpivigila",
        "path": "EpisodeOfCare.identifier",
        "sliceName": "FolioEpivigila",
        "max": "1"
      },
      {
        "id": "EpisodeOfCare.identifier:FolioEpivigila.system",
        "path": "EpisodeOfCare.identifier.system",
        "min": 1,
        "fixedUri": "http://minsal.cl/Seguimiento/FolioEpivigila"
      },
      {
        "id": "EpisodeOfCare.identifier:FolioEpivigila.value",
        "path": "EpisodeOfCare.identifier.value",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.status",
        "path": "EpisodeOfCare.status",
        "fixedCode": "active"
      },
      {
        "id": "EpisodeOfCare.statusHistory",
        "path": "EpisodeOfCare.statusHistory",
        "min": 1,
        "max": "1"
      },
      {
        "id": "EpisodeOfCare.statusHistory.status",
        "path": "EpisodeOfCare.statusHistory.status",
        "fixedCode": "active"
      },
      {
        "id": "EpisodeOfCare.statusHistory.period.start",
        "path": "EpisodeOfCare.statusHistory.period.start",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.type",
        "path": "EpisodeOfCare.type",
        "max": "0"
      },
      {
        "id": "EpisodeOfCare.diagnosis",
        "path": "EpisodeOfCare.diagnosis",
        "max": "0"
      },
      {
        "id": "EpisodeOfCare.patient",
        "path": "EpisodeOfCare.patient",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://poc-seguimiento.cens.cl/fhir/StructureDefinition/PocSeguimientoPatient"
            ]
          }
        ]
      },
      {
        "id": "EpisodeOfCare.patient.reference",
        "path": "EpisodeOfCare.patient.reference",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.managingOrganization",
        "path": "EpisodeOfCare.managingOrganization",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://poc-seguimiento.cens.cl/fhir/StructureDefinition/PocSeguimientoOrganization"
            ]
          }
        ]
      },
      {
        "id": "EpisodeOfCare.managingOrganization.reference",
        "path": "EpisodeOfCare.managingOrganization.reference",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.period",
        "path": "EpisodeOfCare.period",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.period.start",
        "path": "EpisodeOfCare.period.start",
        "min": 1
      },
      {
        "id": "EpisodeOfCare.referralRequest",
        "path": "EpisodeOfCare.referralRequest",
        "max": "0"
      },
      {
        "id": "EpisodeOfCare.careManager",
        "path": "EpisodeOfCare.careManager",
        "max": "0"
      },
      {
        "id": "EpisodeOfCare.team",
        "path": "EpisodeOfCare.team",
        "max": "0"
      },
      {
        "id": "EpisodeOfCare.account",
        "path": "EpisodeOfCare.account",
        "max": "0"
      }
    ]
  }
}