diff --git a/sandbox/src/mocks/stu3/cancelReferral/requests/bookedOutsideCabWithoutComment.json b/sandbox/src/mocks/stu3/cancelReferral/requests/bookedOutsideCabWithoutComment.json new file mode 100644 index 000000000..20e88be56 --- /dev/null +++ b/sandbox/src/mocks/stu3/cancelReferral/requests/bookedOutsideCabWithoutComment.json @@ -0,0 +1,17 @@ +{ + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-CancelReferral-Request-Parameters-1" + ] + }, + "resourceType": "Parameters", + "parameter": [ + { + "name": "cancellationReason", + "valueCoding": { + "system": "_baseurl_/STU3/CodeSystem/REFERRAL-CANCELLATION-REASON", + "code": "BOOKED_OUTSIDE_CAB" + } + } + ] +} diff --git a/sandbox/src/mocks/stu3/cancelReferral/requests/outpatientService.json b/sandbox/src/mocks/stu3/cancelReferral/requests/outpatientService.json new file mode 100644 index 000000000..f0118abe8 --- /dev/null +++ b/sandbox/src/mocks/stu3/cancelReferral/requests/outpatientService.json @@ -0,0 +1,21 @@ +{ + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-CancelReferral-Request-Parameters-1" + ] + }, + "resourceType": "Parameters", + "parameter": [ + { + "name": "cancellationReason", + "valueCoding": { + "system": "_baseurl_/STU3/CodeSystem/REFERRAL-CANCELLATION-REASON", + "code": "OUTPATIENT_SERVICE_NA" + } + }, + { + "name": "cancellationComments", + "valueString": "This is a cancellation reason comment" + } + ] +} diff --git a/sandbox/src/mocks/stu3/cancelReferral/responses/CancelledReferralBookedOutsideCabWithoutComment.json b/sandbox/src/mocks/stu3/cancelReferral/responses/CancelledReferralBookedOutsideCabWithoutComment.json new file mode 100644 index 000000000..9121b84fd --- /dev/null +++ b/sandbox/src/mocks/stu3/cancelReferral/responses/CancelledReferralBookedOutsideCabWithoutComment.json @@ -0,0 +1,170 @@ +{ + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-CancelReferral-Response-Parameters-1" + ] + }, + "resourceType": "Parameters", + "parameter": [ + { + "name": "updatedReferralRequest", + "resource": { + "id": "000000070000", + "meta": { + "versionId": "4", + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-ReferralRequest-1" + ] + }, + "resourceType": "ReferralRequest", + "extension": [ + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-ReferralPriority-1", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-Priority-1", + "code": "ROUTINE", + "display": "Routine" + } + ] + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-ReferralShortlist-1", + "valueReference": { + "reference": "#shortlist" + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Commissioning-Rule-Org-1", + "valueIdentifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "R69" + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-ReferralState-1", + "extension": [ + { + "url": "state", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralState-1", + "code": "CANCELLED_REFERRAL", + "display": "Cancelled Referral" + } + }, + { + "url": "reason", + "valueCoding": { + "system": "_baseUrl_/STU3/CodeSystem/REFERRAL-CANCELLATION-REASON", + "code": "BOOKED_OUTSIDE_CAB", + "display": "Patient booked outside NHS e-Referral Service" + } + } + ] + } + ], + "contained": [ + { + "id": "serviceSearchCriteria", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-ServiceSearchCriteria-Parameters-1" + ] + }, + "resourceType": "Parameters", + "parameter": [ + { + "name": "priority", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-Priority-1", + "code": "ROUTINE" + } + }, + { + "name": "specialty", + "valueCoding": { + "system": "_baseUrl_/STU3/CodeSystem/SPECIALTY", + "code": "CARDIOLOGY" + } + }, + { + "name": "clinicType", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ClinicType-1", + "code": "HEART_FAILURE" + } + }, + { + "name": "ageAndGenderAppropriate", + "valueBoolean": false + }, + { + "name": "commissioningProvisioning", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-CommissioningProvisioning-1", + "code": "ALL_AVAILABLE_FOR_BOOKING" + } + } + ] + }, + { + "id": "shortlist", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-Shortlist-List-1" + ] + }, + "resourceType": "List", + "extension": [ + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Shortlist-SearchCriteria-1", + "valueReference": { + "reference": "#serviceSearchCriteria" + } + } + ], + "status": "current", + "mode": "snapshot", + "entry": [ + { + "item": { + "identifier": { + "system": "http://fhir.nhs.net/Id/ers-service", + "value": "11004" + }, + "display": "Cardiology Triage Business Service" + } + } + ] + } + ], + "status": "cancelled", + "specialty": { + "coding": [ + { + "system": "_baseUrl_/STU3/CodeSystem/SPECIALTY", + "code": "CARDIOLOGY", + "display": "Cardiology" + } + ] + }, + "subject": { + "identifier": { + "system": "http://fhir.nhs.net/Id/nhs-number", + "value": "9912003888" + } + }, + "supportingInfo": [], + "intent": "plan", + "identifier":[ + { + "system":"https://fhir.nhs.uk/Id/ers-request-id", + "value":"r.c18c4ec4-7d0a-480e-8506-347e0ec228b0" + } + ] + } + } + ] +} diff --git a/sandbox/src/mocks/stu3/cancelReferral/responses/CancelledReferralOutpatientService.json b/sandbox/src/mocks/stu3/cancelReferral/responses/CancelledReferralOutpatientService.json new file mode 100644 index 000000000..9e658931d --- /dev/null +++ b/sandbox/src/mocks/stu3/cancelReferral/responses/CancelledReferralOutpatientService.json @@ -0,0 +1,272 @@ +{ + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-CancelReferral-Response-Parameters-1" + ] + }, + "resourceType": "Parameters", + "parameter": [ + { + "name": "updatedReferralRequest", + "resource": { + "id": "000000070000", + "meta": { + "versionId": "4", + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-ReferralRequest-1" + ] + }, + "resourceType": "ReferralRequest", + "extension": [ + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Appointment-Reference-1", + "valueReference": { + "reference": "Appointment/70001" + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Appointment-1", + "valueReference": { + "reference": "#appointment" + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-ReferralPriority-1", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-Priority-1", + "code": "ROUTINE", + "display": "Routine" + } + ] + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-ReferralShortlist-1", + "valueReference": { + "reference": "#shortlist" + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Commissioning-Rule-Org-1", + "valueIdentifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "R69" + } + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-ReferralState-1", + "extension": [ + { + "url": "state", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralState-1", + "code": "CANCELLED_REFERRAL", + "display": "Cancelled Referral" + } + }, + { + "url": "reason", + "valueCoding": { + "system": "_baseUrl_/STU3/CodeSystem/REQUEST-CANCELLATION-REASON", + "code": "OUTPATIENT_SERVICE_NA", + "display": "Sent to outpatient service not available in this system" + } + }, + { + "url": "comments", + "valueString": "This is a cancellation reason comment" + } + ] + }, + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-PatientAdditionalRequirement-1", + "valueCoding": { + "code": "TRANSPORT", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AdditionalRequirementType-1", + "display": "Transport" + } + } + ], + "contained": [ + { + "id": "serviceSearchCriteria", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-ServiceSearchCriteria-Parameters-1" + ] + }, + "resourceType": "Parameters", + "parameter": [ + { + "name": "priority", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-Priority-1", + "code": "ROUTINE" + } + }, + { + "name": "specialty", + "valueCoding": { + "system": "_baseUrl_/STU3/CodeSystem/SPECIALTY", + "code": "CARDIOLOGY" + } + }, + { + "name": "clinicType", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ClinicType-1", + "code": "HEART_FAILURE" + } + }, + { + "valueString": "LS1 2TW", + "name": "postcode" + }, + { + "name": "distanceLimit", + "valueUnsignedInt": 123 + }, + { + "name": "ageAndGenderAppropriate", + "valueBoolean": false + }, + { + "name": "commissioningProvisioning", + "valueCoding": { + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-CommissioningProvisioning-1", + "code": "ALL_AVAILABLE_FOR_BOOKING" + } + } + ] + }, + { + "id": "shortlist", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-Shortlist-List-1" + ] + }, + "resourceType": "List", + "extension": [ + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-eRS-Shortlist-SearchCriteria-1", + "valueReference": { + "reference": "#serviceSearchCriteria" + } + } + ], + "status": "current", + "mode": "snapshot", + "entry": [ + { + "item": { + "identifier": { + "system": "http://fhir.nhs.net/Id/ers-service", + "value": "11004" + }, + "display": "Cardiology Triage Business Service" + } + } + ] + }, + { + "id": "appointment", + "meta": { + "versionId": "1", + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/eRS-Appointment-1", + "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Appointment-1" + ] + }, + "language": "en", + "resourceType": "Appointment", + "status": "proposed", + "reason": [ + { + "coding": [ + { + "code": "ACCEPT_REFER_BOOK_LATER", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReviewOutcome-1", + "display": "Accept Refer Book Later" + } + ] + } + ], + "description": "e-Referral Appointment", + "created": "2021-05-06T11:21:45.652Z", + "comment": "Outcome", + "incomingReferral": [ + { + "reference": "ReferralRequest/000000070000/_history/4" + } + ], + "participant": [ + { + "actor": { + "identifier": { + "system": "http://fhir.nhs.net/Id/ers-service", + "value": "11004" + }, + "display": "Cardiology Triage Business Service" + }, + "status": "accepted" + }, + { + "actor": { + "identifier": { + "system": "http://fhir.nhs.net/Id/nhs-number", + "value": "9912003888" + } + }, + "status": "accepted" + }, + { + "actor": { + "identifier": { + "system": "http://fhir.nhs.net/Id/sds-user-id", + "value": "021600556514" + } + }, + "type": { + "coding": [ + { + "system": "http://hl7.org/fhir/ValueSet/encounter-participant-type", + "code": "CON" + } + ] + }, + "status": "accepted" + } + ] + } + ], + "status": "cancelled", + "specialty": { + "coding": [ + { + "system": "_baseUrl_/STU3/CodeSystem/SPECIALTY", + "code": "CARDIOLOGY", + "display": "Cardiology" + } + ] + }, + "subject": { + "identifier": { + "system": "http://fhir.nhs.net/Id/nhs-number", + "value": "9912003888" + } + }, + "supportingInfo": [], + "intent": "plan", + "identifier":[ + { + "system":"https://fhir.nhs.uk/Id/ers-request-id", + "value":"r.c18c4ec4-7d0a-480e-8506-347e0ec228b0" + } + ] + } + } + ] +} diff --git a/sandbox/src/mocks/stu3/getCodeSystem/responses/ReferralCancellationReasonCodeSystem.json b/sandbox/src/mocks/stu3/getCodeSystem/responses/ReferralCancellationReasonCodeSystem.json index 1e114f83f..94d28a7d7 100644 --- a/sandbox/src/mocks/stu3/getCodeSystem/responses/ReferralCancellationReasonCodeSystem.json +++ b/sandbox/src/mocks/stu3/getCodeSystem/responses/ReferralCancellationReasonCodeSystem.json @@ -28,6 +28,11 @@ "uri": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-Concept-Properties-1#effectiveTo", "type": "dateTime" }, + { + "code": "appointmentRequestCancellationReasonType", + "uri": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-Concept-Properties-1#appointmentRequestCancellationReasonType", + "type": "Coding" + }, { "code": "commentIsMandatory", "uri": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-Concept-Properties-1#commentIsMandatory", @@ -58,6 +63,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -65,6 +77,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -76,6 +116,13 @@ "code": "effectiveFrom", "valueDateTime": "2007-09-14T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -83,6 +130,34 @@ { "code": "canCancelAppointment", "valueBoolean": true + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -94,6 +169,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -101,6 +183,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -112,6 +222,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -119,6 +236,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -130,6 +275,13 @@ "code": "effectiveFrom", "valueDateTime": "2004-06-01T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PATIENT", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -141,22 +293,43 @@ { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN_ADMIN" + "code": "REFERRING_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "REFERRING_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN" + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "referrerUsage", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1", - "code": "CANCEL_REFERRAL" + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" } } ] @@ -169,6 +342,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -176,6 +356,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -187,6 +395,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -194,6 +409,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -205,6 +448,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -212,6 +462,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -223,6 +501,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -230,6 +515,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -241,6 +554,13 @@ "code": "effectiveFrom", "valueDateTime": "2004-06-01T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PATIENT", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -252,22 +572,43 @@ { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN_ADMIN" + "code": "REFERRING_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "REFERRING_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN" + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "referrerUsage", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1", - "code": "CANCEL_REFERRAL" + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" } } ] @@ -280,6 +621,13 @@ "code": "effectiveFrom", "valueDateTime": "2004-06-01T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PATIENT", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -291,22 +639,43 @@ { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN_ADMIN" + "code": "REFERRING_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "REFERRING_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN" + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "referrerUsage", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1", - "code": "CANCEL_REFERRAL" + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" } } ] @@ -319,6 +688,13 @@ "code": "effectiveFrom", "valueDateTime": "2007-09-14T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "UNKNOWN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -330,22 +706,22 @@ { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN_ADMIN" + "code": "REFERRING_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN" + "code": "REFERRING_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "referrerUsage", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1", - "code": "CANCEL_REFERRAL" + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" } } ] @@ -358,6 +734,13 @@ "code": "effectiveFrom", "valueDateTime": "2007-09-14T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "UNKNOWN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -369,22 +752,22 @@ { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN_ADMIN" + "code": "REFERRING_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN" + "code": "REFERRING_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "referrerUsage", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1", - "code": "CANCEL_REFERRAL" + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" } } ] @@ -397,6 +780,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": true @@ -404,6 +794,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -415,6 +833,13 @@ "code": "effectiveFrom", "valueDateTime": "2004-06-01T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PATIENT", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -426,22 +851,43 @@ { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN_ADMIN" + "code": "REFERRING_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "REFERRING_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "businessFunction", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1", - "code": "REFERRING_CLINICIAN" + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" } }, { "code": "referrerUsage", "valueCoding": { - "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1", - "code": "CANCEL_REFERRAL" + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" } } ] @@ -454,6 +900,13 @@ "code": "effectiveFrom", "valueDateTime": "2019-07-23T17:09:56.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PROVIDER_TRIAGE", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -461,6 +914,34 @@ { "code": "canCancelAppointment", "valueBoolean": false + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "SERVICE_PROVIDER_CLINICIAN_ADMIN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "businessFunction", + "valueCoding": { + "code": "PROVIDER_AUTHORISED_APPLICATION", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-BusinessFunction-1" + } + }, + { + "code": "referrerUsage", + "valueCoding": { + "code": "CANCEL_REFERRAL", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralRequestCancellationReasonUsage-1" + } } ] }, @@ -472,6 +953,13 @@ "code": "effectiveFrom", "valueDateTime": "2004-06-01T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "PATIENT", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false @@ -490,6 +978,13 @@ "code": "effectiveFrom", "valueDateTime": "2004-06-01T00:00:00.000Z" }, + { + "code": "appointmentRequestCancellationReasonType", + "valueCoding": { + "code": "UNKNOWN", + "system": "https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1" + } + }, { "code": "commentIsMandatory", "valueBoolean": false diff --git a/sandbox/src/routes/stu3/cancelReferral.js b/sandbox/src/routes/stu3/cancelReferral.js index 2711c47a4..3fb6fd8ed 100644 --- a/sandbox/src/routes/stu3/cancelReferral.js +++ b/sandbox/src/routes/stu3/cancelReferral.js @@ -10,7 +10,7 @@ module.exports = [ path: '/FHIR/STU3/ReferralRequest/{ubrn}/$ers.cancelReferral', handler: (request, h) => { - const allowedBusinessFunctions = ["REFERRING_CLINICIAN", "REFERRING_CLINICIAN_ADMIN"] + const allowedBusinessFunctions = ["REFERRING_CLINICIAN", "REFERRING_CLINICIAN_ADMIN", "SERVICE_PROVIDER_CLINICIAN", "SERVICE_PROVIDER_CLINICIAN_ADMIN"] const validationResult = validationUtils.validateBusinessFunction(request, h, allowedBusinessFunctions) diff --git a/specification/components/stu3/schemas/CodeSystemConcept.yaml b/specification/components/stu3/schemas/CodeSystemConcept.yaml index 46dd37948..3ac83f9da 100644 --- a/specification/components/stu3/schemas/CodeSystemConcept.yaml +++ b/specification/components/stu3/schemas/CodeSystemConcept.yaml @@ -55,6 +55,7 @@ properties: | Usage | APPOINTMENT-CANCELLATION-REASON | | CommentIsMandatory | APPOINTMENT-CANCELLATION-REASON/REFERRAL-CANCELLATION-REASON | | businessFunction | APPOINTMENT-CANCELLATION-REASON/REFERRAL-CANCELLATION-REASON | + | AppointmentRequestCancellationReasonType | REFERRAL-CANCELLATION-REASON | | CanCancelAppointment | REFERRAL-CANCELLATION-REASON | | RequestCancellationReferrerUsage | REFERRAL-CANCELLATION-REASON | | DeferToProviderContactDays | PRIORITY | @@ -72,6 +73,7 @@ properties: - $ref: 'codings/AppointmentCancellationUsage.yaml' - $ref: 'codings/CommentIsMandatory.yaml' - $ref: 'codings/BusinessFunction.yaml' + - $ref: 'codings/AppointmentRequestCancellationReasonType.yaml' - $ref: 'codings/CanCancelAppointment.yaml' - $ref: 'codings/RequestCancellationReferrerUsage.yaml' - $ref: 'codings/DeferToProviderContactDays.yaml' diff --git a/specification/components/stu3/schemas/CodeSystemProperties.yaml b/specification/components/stu3/schemas/CodeSystemProperties.yaml index 7eeb3cd23..107ef4bba 100644 --- a/specification/components/stu3/schemas/CodeSystemProperties.yaml +++ b/specification/components/stu3/schemas/CodeSystemProperties.yaml @@ -13,6 +13,7 @@ description: | | Usage | APPOINTMENT-CANCELLATION-REASON | | CommentIsMandatory | APPOINTMENT-CANCELLATION-REASON / REFERRAL-CANCELLATION-REASON | | BusinessFunction | APPOINTMENT-CANCELLATION-REASON / REFERRAL-CANCELLATION-REASON | + | AppointmentRequestCancellationReasonType | REFERRAL-CANCELLATION-REASON | | CanCancelAppointment | REFERRAL-CANCELLATION-REASON | | ReferrerUsage | REFERRAL-CANCELLATION-REASON | | DeferToProviderContactDays | PRIORITY | @@ -29,6 +30,7 @@ items: - $ref: 'properties/Usage.yaml' - $ref: 'properties/CommentIsMandatory.yaml' - $ref: 'properties/BusinessFunction.yaml' + - $ref: 'properties/AppointmentRequestCancellationReasonType.yaml' - $ref: 'properties/CanCancelAppointment.yaml' - $ref: 'properties/ReferrerUsage.yaml' - $ref: 'properties/DeferToProviderContactDays.yaml' diff --git a/specification/components/stu3/schemas/codings/AppointmentRequestCancellationReasonType.yaml b/specification/components/stu3/schemas/codings/AppointmentRequestCancellationReasonType.yaml new file mode 100644 index 000000000..70880573e --- /dev/null +++ b/specification/components/stu3/schemas/codings/AppointmentRequestCancellationReasonType.yaml @@ -0,0 +1,25 @@ +title: Appointment request cancellation reason type +description: This will only be returned when codeSystemType is REFERRAL-CANCELLATION-REASON +type: object +required: + - code + - valueCoding +properties: + code: + type: string + enum: + - appointmentRequestCancellationReasonType + valueCoding: + type: object + required: + - system + - code + properties: + system: + type: string + enum: + - 'https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1' + example: 'https://fhir.nhs.uk/STU3/CodeSystem/eRS-AppointmentRequestCancellationReasonType-1' + code: + type: string + example: 'PROVIDER' diff --git a/specification/components/stu3/schemas/endpoints/a029-available-actions-for-user-list.yaml b/specification/components/stu3/schemas/endpoints/a029-available-actions-for-user-list.yaml index 69aa06daa..38e42ad88 100644 --- a/specification/components/stu3/schemas/endpoints/a029-available-actions-for-user-list.yaml +++ b/specification/components/stu3/schemas/endpoints/a029-available-actions-for-user-list.yaml @@ -23,6 +23,7 @@ description: | Supported action: - Record Review Outcome + - Cancel Referral ### Healthcare worker, user-restricted access @@ -53,8 +54,9 @@ description: | - Change Shortlist - Change Shortlist and Send for Triage - As a service provider, the only action returned will be: - - Record Review Outcome + As a service provider, the actions returned can include: + - Record Review Outcome + - Cancel Referral ## Related endpoints diff --git a/specification/components/stu3/schemas/endpoints/a036-cancel-referral.yaml b/specification/components/stu3/schemas/endpoints/a036-cancel-referral.yaml index 1c6d8395d..999321331 100644 --- a/specification/components/stu3/schemas/endpoints/a036-cancel-referral.yaml +++ b/specification/components/stu3/schemas/endpoints/a036-cancel-referral.yaml @@ -14,18 +14,27 @@ description: | ## Supported security patterns - Healthcare worker, user-restricted access + - Application-restricted, unattended access ## Pre-requisites + ### Application-restricted, unattended access + In order to use this endpoint you must be an authenticated e-RS calling application, working in the context of a Service Provider Organisation. + + To access this endpoint in application-restricted, unattended mode, you will be required to submit your use case for review. The only use case currently permitted is for non-clinical provider actions. + + ### Healthcare worker, user-restricted access In order to use this endpoint you must be an authenticated e-RS user and use one of the following e-RS roles: - `REFERRING_CLINICIAN` - `REFERRING_CLINICIAN_ADMIN` + - `SERVICE_PROVIDER_CLINICIAN` + - `SERVICE_PROVIDER_CLINICIAN_ADMIN` You must use [[HYPERLINK_A004]] to retrieve a list of reference data, which detail the reason the cancellation is being performed. You can only use reference data from the set `REFERRAL-CANCELLATION-REASON`. To find out which reference data from this set can be used, the following filters can be used depending on the cancellation scenario: - ***1. I want to cancel the referral and the current appointment*** + ***1. I want to cancel the referral and the current appointment as a Referrer*** * Obtain reference data from `REFERRAL-CANCELLATION-REASON` and filter: @@ -40,30 +49,83 @@ description: | * if provided, `effectiveTo` must **not** be in the past - ***2. I want to cancel a referral, for which there is no current appointment*** + ***2. I want to cancel a referral, for which there is no current appointment as a Referrer*** * Obtain reference data from `REFERRAL-CANCELLATION-REASON` and filter: * `referrerUsage` must be `CANCEL_REFERRAL`, and - * `businessFunction` must be `REFERRING_CLINICIAN` or `REFERRING_CLINICIAN_ADMIN` *(depending which authenticated user will be performing the action), and + * `businessFunction` must be `REFERRING_CLINICIAN` or `REFERRING_CLINICIAN_ADMIN` (depending which authenticated user will be performing the action), and * `canCancelAppointment` could be true or false, and * `effectiveFrom` must be in the past, and * if provided, `effectiveTo` must **not** be in the past + + ***3. I want to cancel the referral and the current appointment as a Service Provider*** + + * Obtain reference data from `REFERRAL-CANCELLATION-REASON` and filter: + + * `referrerUsage` must be `CANCEL_REFERRAL`, and + + * `businessFunction` must be `SERVICE_PROVIDER_CLINICIAN` or `SERVICE_PROVIDER_CLINICIAN_ADMIN` (depending which authenticated user will be performing the action), and + + * `appointmentRequestCancellationReasonType` must be `PROVIDER` and `PATIENT`, and + + * `canCancelAppointment` must be true, and + + * `effectiveFrom` must be in the past, and + + * `effectiveTo` must **not** be in the past + + ***4. I want to cancel a referral, for which there is no current appointment as a Service Provider*** + + * Obtain reference data from `REFERRAL-CANCELLATION-REASON` and filter: + + * `referrerUsage` must be `CANCEL_REFERRAL`, and + + * `businessFunction` must be `SERVICE_PROVIDER_CLINICIAN` or `SERVICE_PROVIDER_CLINICIAN_ADMIN` (depending which authenticated user will be performing the action), and + * `appointmentRequestCancellationReasonType` must be `PROVIDER` and `PATIENT`, and + + * `canCancelAppointment` could be true or false, and + + * `effectiveFrom` must be in the past, and + + * `effectiveTo` must **not** be in the past + + ***5. I want to cancel the triage referral as a Service Provider*** + + * Obtain reference data from `REFERRAL-CANCELLATION-REASON` and filter: + + * `referrerUsage` must be `CANCEL_REFERRAL`, and + + * `businessFunction` must be `SERVICE_PROVIDER_CLINICIAN` or `SERVICE_PROVIDER_CLINICIAN_ADMIN` (depending which authenticated user will be performing the action), and + + * `appointmentRequestCancellationReasonType` must be `PROVIDER_TRIAGE`, and + + * `effectiveFrom` must be in the past, and + + * `effectiveTo` must **not** be in the past You need to use [[HYPERLINK_A005]] to retrieve details of the referral in order to make this clinical decision. - ## Important notes + ## Important note when retrieving attachments In order to retrieve an attachment using the [[HYPERLINK_A042]] (or deprecated [[HYPERLINK_A006]]) endpoint, the attachment must be available for download. The availability status of attachments associated with a referral are returned via this endpoint as a eRS-AvailabilityStatus-1 code. Further details on attachment availability status and eRS-AvailabilityStatus-1 codes can be found in the [[HYPERLINK_A005]] and [[HYPERLINK_A042]] specifications. + ## Important notes when providing an appointment request cancellation reason + + When cancelling a referral as a Service Provider Clinician: + + * If the referral is in the **"Triaged - Provider to action"** state, the cancellation reason must be an **Appointment Request End Triage Reason** type. + + * If the referral is **not** in that state, the cancellation reason must be a **Provider Appointment Request Cancellation Reason** or **Patient Appointment Request Cancellation Reason** type. + ## Use case As an authenticated user @@ -89,14 +151,16 @@ description: | You can test the following scenarios in our sandbox environment: - | Scenario | Request details | - | ------------------------------------------------------------------------ | --------------------------------- | - | Reason for Cancellation without Comment (Comment Not Mandatory) | Intend Private With No Comment | - | Reason for Cancellation with Comment (Comment Mandatory) | Patient Cancellation With Comment | - | Cancelled Referral | Raised in Error | - | Cancelled Appointment and Referral | Referrer Cancellation | - | Cancelled Referral After Prior Appointment Cancellation | Treatment No Longer Required | - | Cancelled Referral with Existing Review Outcome | Intend Private With Comment | + | Scenario | Request details | + | ------------------------------------------------------------------------ | ------------------------------------- | + | Reason for Cancellation without Comment (Comment Not Mandatory) | Intend Private With No Comment | + | Reason for Cancellation with Comment (Comment Mandatory) | Patient Cancellation With Comment | + | Cancelled Referral | Raised in Error | + | Cancelled Appointment and Referral | Referrer Cancellation | + | Cancelled Referral After Prior Appointment Cancellation | Treatment No Longer Required | + | Cancelled Referral with Existing Review Outcome | Intend Private With Comment | + | Cancelled Referral (Provider) without Comment (Comment Not Mandatory) | Provider Cancellation With No Comment | + | Cancelled Referral with Triage Response | Provider Cancellation via End Triage | summary: Cancel referral (A036, FHIR STU3) operationId: a036-cancel-referral tags: @@ -139,6 +203,14 @@ requestBody: summary: Cancelled Referral with Existing Review Outcome value: $ref: '../../examples/cancelReferral/requests/IntendPrivateWithComment.json' + cancel-referral-provider-without-comment: + summary: Cancelled Referral (Provider) without Comment (Comment Not Mandatory) + value: + $ref: '../../examples/cancelReferral/requests/bookedOutsideCabWithoutComment.json' + cancel-referral-with-triage-response: + summary: Cancelled Referral with Triage Response + value: + $ref: '../../examples/cancelReferral/requests/outpatientService.json' responses: '200': $ref: '../responses/cancelReferral/200Response.yaml' diff --git a/specification/components/stu3/schemas/properties/AppointmentRequestCancellationReasonType.yaml b/specification/components/stu3/schemas/properties/AppointmentRequestCancellationReasonType.yaml new file mode 100644 index 000000000..86ad3d95e --- /dev/null +++ b/specification/components/stu3/schemas/properties/AppointmentRequestCancellationReasonType.yaml @@ -0,0 +1,23 @@ +title: Appointment Request Cancellation Reason Type +description: This will only be returned when codeSystemType is REFERRAL-CANCELLATION-REASON +type: object +required: + - code + - uri + - type +properties: + code: + type: string + enum: + - appointmentRequestCancellationReasonType + example: 'appointmentRequestCancellationReasonType' + uri: + type: string + enum: + - 'https://fhir.nhs.uk/STU3/CodeSystem/eRS-Concept-Properties-1#appointmentRequestCancellationReasonType' + example: 'https://fhir.nhs.uk/STU3/CodeSystem/eRS-Concept-Properties-1#appointmentRequestCancellationReasonType' + type: + type: string + enum: + - Coding + example: 'Coding' diff --git a/specification/components/stu3/schemas/responses/cancelReferral/200Response.yaml b/specification/components/stu3/schemas/responses/cancelReferral/200Response.yaml index f20c32527..8ba4444da 100644 --- a/specification/components/stu3/schemas/responses/cancelReferral/200Response.yaml +++ b/specification/components/stu3/schemas/responses/cancelReferral/200Response.yaml @@ -35,3 +35,11 @@ content: summary: Cancelled Referral with Existing Review Outcome with Reason 'Patient will go to a private clinic' value: $ref: '../../../examples/cancelReferral/responses/CancelledReferralResolvedDeferralIntendPrivateWithComment.json' + cancelled-referral-provider-booked-outside: + summary: Cancelled Referral without Booking with Reason 'Patient booked outside NHS e-Referral Service' without Comment (Comment Not Mandatory)' + value: + $ref: '../../../examples/cancelReferral/responses/CancelledReferralBookedOutsideCabWithoutComment.json' + cancelled-referral-provider-triaged-and-sent-to-outpatient-service: + summary: Cancelled Referral with Triage Response with Reason 'Sent to outpatient service not available in this system' with Comment (Comment Mandatory)' + value: + $ref: '../../../examples/cancelReferral/responses/CancelledReferralOutpatientService.json' diff --git a/specification/components/stu3/schemas/responses/cancelReferral/422Response.yaml b/specification/components/stu3/schemas/responses/cancelReferral/422Response.yaml index 13b9aab0e..c03d70e38 100644 --- a/specification/components/stu3/schemas/responses/cancelReferral/422Response.yaml +++ b/specification/components/stu3/schemas/responses/cancelReferral/422Response.yaml @@ -9,6 +9,7 @@ description: | | PATIENT_ERROR | An error occurred while retrieving the requested patient. Do not attempt again. | | NO_RELATIONSHIP | The user does not have a legitimate relationship with the request. | | UNABLE_TO_CANCEL_APPOINTMENT | System is unable to cancel the appointment. | + | INAPPROPRIATE_VALUE | A value, which is acceptable under different conditions, is inappropriate in the context of the other information provided. | headers: X-Correlation-ID: $ref: '../../headers/response/CorrelationID.yaml' diff --git a/specification/e-referrals-service-api.yaml b/specification/e-referrals-service-api.yaml index 8e3f03fcd..3024e2545 100644 --- a/specification/e-referrals-service-api.yaml +++ b/specification/e-referrals-service-api.yaml @@ -39,6 +39,7 @@ info: - accept or reject a referral request - retrieve Advice & Guidance (A&G) conversations and send responses - convert Advice & Guidance (A&G) conversations into a referral + - cancel a referral **You cannot use this API to:** @@ -78,7 +79,7 @@ info: | Access mode | Authentication via | Functions | Availability | | ----------------------------- | -------------------------- | ----------------------- | ------------------------------- | - | Application-restricted,
unattended access | [[HYPERLINK_SIGNED_JWT]] | | [[HYPERLINK_PRODUCTION]] | + | Application-restricted,
unattended access | [[HYPERLINK_SIGNED_JWT]] | | [[HYPERLINK_PRODUCTION]] | | Healthcare worker,
user-restricted access | [[HYPERLINK_CIS_AUTH_SHORT]] | All Endpoints | [[HYPERLINK_PRODUCTION]] | ##### Application-restricted, unattended access @@ -89,8 +90,9 @@ info: Write operations are currently supported for specific use cases via: - [[HYPERLINK_A028]] - [[HYPERLINK_A013]] + - [[HYPERLINK_A036]] - You will be required to submit your use case for review when using this endpoint via application-restricted, unattended access. + You will be required to submit your use case for review when using these endpoints via application-restricted, unattended access. ##### Healthcare worker, user-restricted access diff --git a/tests/sandbox/stu3/test_a036_cancel_referral.py b/tests/sandbox/stu3/test_a036_cancel_referral.py index eea2a9ab3..067522b7d 100644 --- a/tests/sandbox/stu3/test_a036_cancel_referral.py +++ b/tests/sandbox/stu3/test_a036_cancel_referral.py @@ -14,6 +14,8 @@ class TestCancelReferral(SandboxTest): allowed_business_function_data = [ "REFERRING_CLINICIAN", "REFERRING_CLINICIAN_ADMIN", + "SERVICE_PROVIDER_CLINICIAN", + "SERVICE_PROVIDER_CLINICIAN_ADMIN", ] authorised_actor_data = Actor.all(