PackagesCanonicalsLogsProblems
    Packages
    ca.on.mha.pds@2.0.0-snapshot14
    http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-bundle
{
  "description": null,
  "_filename": "StructureDefinition.ca-on-mha-profile-Bundle.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": "Bundle",
  "mapping": [ {
    "name": "MHA PDS Mapping",
    "identity": "MHA-PDS-Mapping"
  } ],
  "abstract": false,
  "type": "Bundle",
  "experimental": null,
  "resourceType": "StructureDefinition",
  "title": "MHA Bundle Profile",
  "package_version": "2.0.0-snapshot14",
  "status": "active",
  "id": "2b0031c0-ca40-4872-af9a-ee46fe03e6eb",
  "kind": "resource",
  "url": "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-bundle",
  "version": "2.0.0",
  "differential": {
    "element": [ {
      "id": "Bundle",
      "path": "Bundle",
      "constraint": [ {
        "key": "mha-pds-bundle-inv-1",
        "human": "Must contain exactly one patient resource in the bundle",
        "severity": "error",
        "expression": "entry.resource.ofType(Patient).count() = 1"
      }, {
        "key": "mha-pds-bundle-inv-2",
        "human": "Must contain exactly one organization resource in the bundle",
        "severity": "error",
        "expression": "entry.resource.ofType(Organization).count() = 1"
      }, {
        "key": "mha-pds-bundle-inv-3",
        "human": "Must contain exactly one location resource in the bundle",
        "severity": "error",
        "expression": "entry.resource.ofType(Location).count() = 1"
      }, {
        "key": "mha-bundle-rule-1",
        "human": "Service First Contact Date in EpisodeOfCare must be after Referral Received date in ServiceRequest",
        "severity": "error",
        "expression": "(entry.resource.where($this is EpisodeOfCare).extension('https://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-ext-FirstContactDate').exists() and entry.resource.where($this is EpisodeOfCare).referralRequest.resolve().extension('http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-ext-ServiceRequestReceivedDate').exists()) implies entry.resource.where($this is EpisodeOfCare).extension('https://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-ext-FirstContactDate').value >= entry.resource.where($this is EpisodeOfCare).referralRequest.resolve().extension('http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-ext-ServiceRequestReceivedDate').value"
      }, {
        "key": "mha-bundle-rule-2",
        "human": "If EpisodeOfCare status is 'planned', referral received date SHALL be present",
        "severity": "warning",
        "expression": "entry.resource.where($this is EpisodeOfCare).status='planned' implies entry.resource.where($this is EpisodeOfCare).referralRequest.resolve().extension('http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-ext-ServiceRequestReceivedDate').exists()"
      }, {
        "key": "mha-bundle-inv-4",
        "human": "Bundle must contain EpisodeOfCare and HealthcareService resource",
        "severity": "error",
        "expression": "entry.resource.where($this is EpisodeOfCare).exists() and entry.resource.where($this is HealthcareService).exists()"
      } ]
    }, {
      "id": "Bundle.meta",
      "min": 1,
      "path": "Bundle.meta",
      "mustSupport": true
    }, {
      "id": "Bundle.meta.lastUpdated",
      "path": "Bundle.meta.lastUpdated",
      "mustSupport": true
    }, {
      "id": "Bundle.meta.profile",
      "max": "1",
      "min": 1,
      "path": "Bundle.meta.profile",
      "mustSupport": true,
      "fixedCanonical": "http://ontariohealth.ca/fhir/StructureDefinition/ca-on-mha-profile-bundle"
    }, {
      "id": "Bundle.identifier",
      "path": "Bundle.identifier",
      "mustSupport": true
    }, {
      "id": "Bundle.type",
      "path": "Bundle.type",
      "fixedCode": "collection",
      "mustSupport": true
    }, {
      "id": "Bundle.timestamp",
      "min": 1,
      "path": "Bundle.timestamp",
      "mustSupport": true
    }, {
      "id": "Bundle.entry",
      "path": "Bundle.entry",
      "mustSupport": true
    }, {
      "id": "Bundle.entry.fullUrl",
      "path": "Bundle.entry.fullUrl",
      "mustSupport": true
    }, {
      "id": "Bundle.entry.resource",
      "path": "Bundle.entry.resource",
      "mustSupport": true
    } ]
  },
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle"
}