PackagesCanonicalsLogsProblems
    Packages
    ca.on.mha.pds@2.0.0-snapshot17
    http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-episodeofcare
{
  "description": null,
  "_filename": "StructureDefinition.ca-on-mha-profile-EpisodeOfCare.json",
  "package_name": "ca.on.mha.pds",
  "date": "2025-05-17T20:17:06.3613088+00:00",
  "derivation": "constraint",
  "publisher": null,
  "fhirVersion": "4.0.1",
  "name": "EpisodeOfCare",
  "mapping": [ {
    "name": "MHA PDS Mapping",
    "identity": "MHA-PDS-Mapping"
  } ],
  "abstract": false,
  "type": "EpisodeOfCare",
  "experimental": null,
  "resourceType": "StructureDefinition",
  "title": "MHA EpisodeOfCare",
  "package_version": "2.0.0-snapshot17",
  "status": "active",
  "id": "643f141c-7145-443a-b1a4-aa38926bc655",
  "kind": "resource",
  "url": "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-episodeofcare",
  "version": "2.0.0",
  "differential": {
    "element": [ {
      "id": "EpisodeOfCare",
      "path": "EpisodeOfCare",
      "mapping": [ {
        "map": "MHA-PDS-Mapping",
        "identity": "MHA-PDS-Mapping"
      } ],
      "constraint": [ {
        "key": "mha-eoc-key-1",
        "human": "Service Termination Date SHALL be present when Service Termination Reason is present",
        "severity": "error",
        "expression": "status.extension('https://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceTerminationReason').exists() = period.end.exists()"
      }, {
        "key": "mha-eoc-key-2",
        "human": "Service Termination Date SHALL be present when status is 'finished'",
        "severity": "error",
        "expression": "status = 'finished' implies period.end.exists()"
      }, {
        "key": "mha-eoc-key-3",
        "human": "If status is 'active' and both service enrollment date and service initiation     date are present, service initiation date must be equal to or after the service enrollment date",
        "severity": "error",
        "expression": "status = 'active' implies (period.start.exists().not() or extension.where(url = 'http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceInitiationDate').exists().not() or period.start.toString().substring(0,10) <= extension.where(url = 'http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceInitiationDate').value.toString().substring(0,10))"
      }, {
        "key": "mha-eoc-key-4",
        "human": "If status is 'active', at least one of service enrollment date or service initiation date SHALL be present",
        "severity": "error",
        "expression": "status = 'active' implies (period.start.exists() or extension.where(url = 'http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceInitiationDate').exists())"
      }, {
        "key": "mha-eoc-key-5",
        "human": "If status is 'cancelled' or 'finished', service termination date and termination reason SHALL be present",
        "severity": "error",
        "expression": "status in ('cancelled'|'finished') implies period.end.exists() and status.extension('https://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceTerminationReason').exists()"
      }, {
        "key": "mha-eoc-key-6",
        "human": "Service enrollment or service initiation date SHALL only exist when status is 'active' or 'finished'",
        "severity": "error",
        "expression": "status in ('active'|'finished') implies period.start.exists() or extension('http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceInitiationDate').exists()"
      }, {
        "key": "mha-eoc-key-7",
        "human": "If status is 'planned', Service enrollment and service initiation date SHALL not be provided",
        "severity": "error",
        "expression": "status = 'planned' implies period.start.exists().not() and extension('http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceInitiationDate').exists().not()"
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.meta",
      "min": 1,
      "path": "EpisodeOfCare.meta",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.meta.profile",
      "max": "1",
      "min": 1,
      "path": "EpisodeOfCare.meta.profile",
      "mustSupport": true,
      "fixedCanonical": "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-episodeofcare"
    }, {
      "id": "EpisodeOfCare.extension:FirstContactDate",
      "max": "1",
      "path": "EpisodeOfCare.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-ext-FirstContactDate" ]
      } ],
      "sliceName": "FirstContactDate",
      "definition": "The date the client first experienced contact with an HSP regarding a specific program",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.extension:EligibilityScreeningDate",
      "path": "EpisodeOfCare.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-eligibilityScreeningDate" ]
      } ],
      "sliceName": "EligibilityScreeningDate",
      "definition": "The date at which an eligibility determination is done by HSP  and client is accepted (eligible) or not accepted (ineligible) into program/service ."
    }, {
      "id": "EpisodeOfCare.extension:EligibilityScreeningDate.value[x]",
      "path": "EpisodeOfCare.extension.value[x]",
      "mapping": [ {
        "map": "Eligibility Screening Date",
        "identity": "MHA-PDS-Mapping"
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.extension:ServiceInitiationDate",
      "path": "EpisodeOfCare.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceInitiationDate" ]
      } ],
      "sliceName": "ServiceInitiationDate",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.extension:InitialAssessmentDate",
      "path": "EpisodeOfCare.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-InitialAssessmentDate" ]
      } ],
      "sliceName": "InitialAssessmentDate",
      "definition": "The date the client completed an initial assessment for a service",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.extension:InitialAssessmentDate.value[x]",
      "path": "EpisodeOfCare.extension.value[x]",
      "mapping": [ {
        "map": "Initial Assessment Date",
        "identity": "MHA-PDS-Mapping"
      } ]
    }, {
      "id": "EpisodeOfCare.identifier",
      "max": "1",
      "min": 1,
      "path": "EpisodeOfCare.identifier",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.identifier.system",
      "min": 1,
      "path": "EpisodeOfCare.identifier.system",
      "binding": {
        "strength": "required",
        "valueSet": "http://ontariohealth.ca/fhir/ValueSet/mha/EpisodeOfCare-identifier-system",
        "description": "The identifier URIs for patient episode of care"
      },
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.identifier.value",
      "min": 1,
      "path": "EpisodeOfCare.identifier.value",
      "mapping": [ {
        "map": "Episode of Care Identifier",
        "identity": "MHA-PDS-Mapping"
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.status",
      "path": "EpisodeOfCare.status",
      "mapping": [ {
        "map": "Health Service Status",
        "identity": "MHA-PDS-Mapping"
      } ],
      "constraint": [ {
        "key": "status-key-1",
        "human": "Service Termination Reason must be provided only when EOC status is \"finished\" or \"cancelled\"",
        "severity": "error",
        "expression": "value in ('finished' | 'cancelled') implies $this.extension('https://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceTerminationReason').exists()"
      }, {
        "key": "status-key-2",
        "human": "When service is terminated and termination reason is present, outbound referral source SHALL be empty when continuity indicates no further service planned",
        "severity": "error",
        "expression": "(value = 'finished' and $this.extension.extension('continuity').value.code ='3') implies $this.extension.extension('outbound-referral-source').empty()"
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.status.extension:serviceTerminationReason",
      "max": "1",
      "path": "EpisodeOfCare.status.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://ontariohealth.ca/fhir/StructureDefinition/ca-on-ext-ServiceTerminationReason" ]
      } ],
      "sliceName": "serviceTerminationReason",
      "isModifier": false,
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.patient",
      "path": "EpisodeOfCare.patient",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-patient" ]
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.patient.reference",
      "min": 1,
      "path": "EpisodeOfCare.patient.reference",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.managingOrganization",
      "min": 1,
      "path": "EpisodeOfCare.managingOrganization",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-organization" ]
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.managingOrganization.reference",
      "min": 1,
      "path": "EpisodeOfCare.managingOrganization.reference",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.period",
      "path": "EpisodeOfCare.period",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.period.start",
      "path": "EpisodeOfCare.period.start",
      "mapping": [ {
        "map": "Service Enrollment Date",
        "identity": "MHA-PDS-Mapping"
      } ],
      "definition": "The start of the period. The boundary is inclusive.\r\n\r\nThe date the HSP deems the client eligible for  treatment and enrolled in the service.",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.period.end",
      "path": "EpisodeOfCare.period.end",
      "comment": "The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has an end value of 2012-02-03.\r\n\r\nThe date when the client's need for service has ended or as per the HSP service termination criteria",
      "mapping": [ {
        "map": "Service Termination Date",
        "identity": "MHA-PDS-Mapping"
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.referralRequest",
      "max": "1",
      "path": "EpisodeOfCare.referralRequest",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-servicerequest" ]
      } ],
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.referralRequest.reference",
      "min": 1,
      "path": "EpisodeOfCare.referralRequest.reference",
      "mustSupport": true
    }, {
      "id": "EpisodeOfCare.account",
      "max": "1",
      "path": "EpisodeOfCare.account"
    } ]
  },
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"
}