{
  "resourceType": "StructureDefinition",
  "url": "http://ehealth.bc.ca/fhir/StructureDefinition/bc-bcyimmunizationandsupplementaldata/RiskAssessment",
  "name": "RiskAssessment",
  "status": "draft",
  "fhirVersion": "4.3.0",
  "kind": "resource",
  "abstract": false,
  "type": "RiskAssessment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/RiskAssessment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "RiskAssessment.id",
        "path": "RiskAssessment.id",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-HA",
            "map": "HA External Risk Factor ID"
          }
        ]
      },
      {
        "id": "RiskAssessment.meta",
        "path": "RiskAssessment.meta",
        "min": 1
      },
      {
        "id": "RiskAssessment.meta.versionId",
        "path": "RiskAssessment.meta.versionId",
        "comment": "Apply \"2024.09\".  This indicates the FHIR Specs as of year 2024 Sept.",
        "fixedId": "2024.08"
      },
      {
        "id": "RiskAssessment.meta.profile",
        "path": "RiskAssessment.meta.profile",
        "comment": "Apply \"http://ehealth.bc.ca/fhir/StructureDefinition/bc-bcyimmunizationandsupplementaldata/RiskAssessment\"",
        "min": 1,
        "max": "1"
      },
      {
        "id": "RiskAssessment.identifier",
        "path": "RiskAssessment.identifier",
        "comment": "Two possible identifiers: 1. Risk Factor ID @ Client Level  2. External Source System Investigation ID @ Case Level.  See Mappings of TYPE for details.",
        "min": 1
      },
      {
        "id": "RiskAssessment.identifier.type",
        "path": "RiskAssessment.identifier.type",
        "min": 1
      },
      {
        "id": "RiskAssessment.identifier.type.coding",
        "path": "RiskAssessment.identifier.type.coding",
        "max": "0"
      },
      {
        "id": "RiskAssessment.identifier.type.coding.system",
        "path": "RiskAssessment.identifier.type.coding.system",
        "max": "0"
      },
      {
        "id": "RiskAssessment.identifier.type.coding.code",
        "path": "RiskAssessment.identifier.type.coding.code",
        "max": "0"
      },
      {
        "id": "RiskAssessment.identifier.type.text",
        "path": "RiskAssessment.identifier.type.text",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-RF-FHA",
            "map": "FHARISKFACTORID"
          },
          {
            "identity": "source-RF-NHA",
            "map": "NHARISKFACTORID"
          },
          {
            "identity": "source-RF-VCHA",
            "map": "VCHARISKFACTORID"
          },
          {
            "identity": "source-INVG-FHA",
            "map": "FHAINVESTIGATIONID"
          },
          {
            "identity": "source-INVG-NHA",
            "map": "NHAINVESTIGATIONID"
          },
          {
            "identity": "source-INVG-VCHA",
            "map": "VCHAINVESTIGATIONID"
          }
        ]
      },
      {
        "id": "RiskAssessment.identifier.system",
        "path": "RiskAssessment.identifier.system",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-FHA",
            "map": "https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-fha"
          },
          {
            "identity": "source-NHA",
            "map": "https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-nha"
          },
          {
            "identity": "source-vcha",
            "map": "https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-vcha"
          }
        ]
      },
      {
        "id": "RiskAssessment.identifier.value",
        "path": "RiskAssessment.identifier.value",
        "min": 1
      },
      {
        "id": "RiskAssessment.status",
        "path": "RiskAssessment.status",
        "comment": "Maps status = final\" only"
      },
      {
        "id": "RiskAssessment.subject.reference",
        "path": "RiskAssessment.subject.reference",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-HA",
            "map": "fullURL + \"Patient\" + (PatientID)",
            "comment": "e.g. http://ehealth.bc.ca/fha/fhr/Patient/12345"
          }
        ]
      },
      {
        "id": "RiskAssessment.occurrence[x]",
        "path": "RiskAssessment.occurrence[x]",
        "comment": "Maps to Source System's REPORTED DATE if available, else sends Source System's CREATED ON DATE",
        "min": 1,
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "RiskAssessment.prediction",
        "path": "RiskAssessment.prediction",
        "min": 1
      },
      {
        "id": "RiskAssessment.prediction.outcome.coding",
        "path": "RiskAssessment.prediction.outcome.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "RiskAssessment.prediction.outcome.coding.system",
        "path": "RiskAssessment.prediction.outcome.coding.system",
        "comment": "Apply \"https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-panorama-code\"",
        "min": 1
      },
      {
        "id": "RiskAssessment.prediction.outcome.coding.code",
        "path": "RiskAssessment.prediction.outcome.coding.code",
        "min": 1
      },
      {
        "id": "RiskAssessment.prediction.outcome.coding.display",
        "path": "RiskAssessment.prediction.outcome.coding.display",
        "min": 1
      },
      {
        "id": "RiskAssessment.prediction.when[x]",
        "path": "RiskAssessment.prediction.when[x]",
        "min": 1,
        "type": [
          {
            "code": "Period"
          }
        ]
      },
      {
        "id": "RiskAssessment.prediction.when[x].start",
        "path": "RiskAssessment.prediction.when[x].start",
        "comment": "Maps to Effective From Date, Effective From Date cannot be in future",
        "min": 1
      },
      {
        "id": "RiskAssessment.prediction.when[x].end",
        "path": "RiskAssessment.prediction.when[x].end",
        "comment": "Maps to Effect To Date.  Effective To Date must be >= Effective From Date"
      },
      {
        "id": "RiskAssessment.prediction.rationale",
        "path": "RiskAssessment.prediction.rationale",
        "comment": "Refer to IMMS codeset spreadsheet for all acceptable values.  DA |NO|UNK|YES|NASS|ABU|ENTEREDINERROR.",
        "min": 1
      },
      {
        "id": "RiskAssessment.note.text",
        "path": "RiskAssessment.note.text",
        "comment": "If element prediction.outcome.coding.code Description contains \"Specify\", then element note.TEXT has cardinality of 1..1"
      }
    ]
  }
}