{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-WaitingList",
  "name": "DataStandardsWalesWaitingListProfile",
  "status": "draft",
  "date": "2023-03-28T11:42:37.5283509+00:00",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "WL.1",
      "name": "PMS Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "List",
  "baseDefinition": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-List",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "List.identifier.system",
        "path": "List.identifier.system",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "https://wales.nhs.uk/waiting-list/code"
          }
        ]
      },
      {
        "id": "List.identifier.value",
        "path": "List.identifier.value",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "OP_WAIT_LIST_NAMES->CODE"
          }
        ]
      },
      {
        "id": "List.status",
        "path": "List.status",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "current"
          }
        ]
      },
      {
        "id": "List.mode",
        "path": "List.mode",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "snapshot"
          }
        ]
      },
      {
        "id": "List.title",
        "path": "List.title",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "OP_WAIT_LIST_NAMES->NAME"
          }
        ]
      },
      {
        "id": "List.code.coding.system",
        "path": "List.code.coding.system",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "http://terminology.hl7.org/CodeSystem/list-example-use-codes"
          }
        ]
      },
      {
        "id": "List.code.coding.code",
        "path": "List.code.coding.code",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "waiting"
          }
        ]
      },
      {
        "id": "List.code.coding.display",
        "path": "List.code.coding.display",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "Waiting List"
          }
        ]
      },
      {
        "id": "List.date",
        "path": "List.date",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "OP_WAIT_LIST_NAMES->DATE_FROM"
          }
        ]
      },
      {
        "id": "List.entry.flag.coding.system",
        "path": "List.entry.flag.coding.system",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "https://wales.nhs.uk/list/status"
          }
        ]
      },
      {
        "id": "List.entry.flag.coding.code",
        "path": "List.entry.flag.coding.code",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "OP_WAIT_LIST_ENTRIES->STATUS"
          }
        ]
      },
      {
        "id": "List.entry.date",
        "path": "List.entry.date",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "OP_WAIT_LIST_ENTRIES->DATE_ENTERED | OP_WAIT_LIST_ENTRIES->TIME_ENTERED"
          }
        ]
      },
      {
        "id": "List.entry.item.reference",
        "path": "List.entry.item.reference",
        "mapping": [
          {
            "identity": "WL.1",
            "map": "ServiceRequest/OP_WAIT_LIST_ENTRIES->REFE_ID",
            "comment": "If OP_WAIT_LIST_ENTRIES->APSL_ID is not null use Appointment Resource otherwise ServiceRequest resource"
          },
          {
            "identity": "WL.1",
            "map": "Appointment/OP_WAIT_LIST_ENTRIES->APSL_ID"
          }
        ]
      }
    ]
  }
}