diff --git a/examples/fhir/psa/poc_working_examples/rduh_order_servicerequest_example.json b/examples/fhir/psa/poc_working_examples/rduh_order_servicerequest_example.json new file mode 100644 index 0000000..2658395 --- /dev/null +++ b/examples/fhir/psa/poc_working_examples/rduh_order_servicerequest_example.json @@ -0,0 +1,171 @@ +{ + "resourceType": "Bundle", + "type": "transaction", + "entry": [ + { + "request": { + "method": "POST", + "url": "Organization" + }, + "fullUrl": "urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "value": "RH8" + } + ] + } + }, + { + "request": { + "method": "POST", + "url": "Organization" + }, + "fullUrl": "urn:uuid:b9b174d9-aa4a-477a-acbd-f833eb6b70c5", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "value": "https://fhir.hl7.org.uk/Id/nhs-number" + } + ] + } + }, + { + "request": { + "method": "POST", + "url": "Patient" + }, + "fullUrl": "urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53", + "resource": { + "resourceType": "Patient", + "address": [ + { + "city": "PLYMOUTH", + "country": "ENG", + "district": "DEVON", + "line": [ + "113 BEAUMONT ROAD" + ], + "postalCode": "PL4 9EE" + } + ], + "birthDate": "1987-10-05", + "gender": "female", + "identifier": [ + { + "assigner": { + "reference": "urn:uuid:b9b174d9-aa4a-477a-acbd-f833eb6b70c5" + }, + "system": "https://fhir.hl7.org.uk/Id/nhs-number", + "value": "9443211234" + } + ], + "managingOrganization": { + "reference": "urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012" + }, + "name": [ + { + "family": "MOUSE", + "given": [ + "MINNIE" + ], + "text": "MINNIE MOUSE", + "use": "official" + } + ] + } + }, + { + "request": { + "method": "POST", + "url": "Specimen" + }, + "fullUrl": "urn:uuid:9df086ae-598d-436d-b0c0-d87954d5d135", + "resource": { + "resourceType": "Specimen", + "collection": { + "bodySite": { + "coding": [ + { + "code": "20982000", + "display": "Capillary", + "system": "http://snomed.info/sct" + } + ] + } + }, + "subject": { + "reference": "urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53" + }, + "type": { + "coding": [ + { + "code": "122554006", + "display": "Capillary blood specimen", + "system": "http://snomed.info/sct" + } + ] + } + } + }, + { + "request": { + "method": "POST", + "url": "ServiceRequest" + }, + "fullUrl": "urn:uuid:685c4a3a-5ac3-498d-9703-c81da7a5d9f4", + "resource": { + "resourceType": "ServiceRequest", + "category": [ + { + "coding": [ + { + "code": "103693007", + "display": "Diagnostic procedure", + "system": "http://snomed.info/sct" + } + ], + "text": "Diagnostic procedure" + } + ], + "code": { + "coding": [ + { + "code": "63476009", + "display": "Measurement of prostate specific antigen", + "system": "http://snomed.info/sct" + } + ] + }, + "identifier": [ + { + "type": { + "coding": [ + { + "code": "PLAC", + "display": "Placer Identifier", + "system": "http://terminology.hl7.org/CodeSystem/v2-0203" + } + ], + "text": "PlacerId" + }, + "use": "official", + "value": "2812455" + } + ], + "intent": "order", + "specimen": [ + { + "reference": "urn:uuid:9df086ae-598d-436d-b0c0-d87954d5d135" + } + ], + "status": "unknown", + "subject": { + "reference": "urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53" + } + } + } + ] +} diff --git a/examples/fhir/psa/poc_working_examples/rduh_order_servicerequest_ukcore_example.json b/examples/fhir/psa/poc_working_examples/rduh_order_servicerequest_ukcore_example.json new file mode 100644 index 0000000..75934ad --- /dev/null +++ b/examples/fhir/psa/poc_working_examples/rduh_order_servicerequest_ukcore_example.json @@ -0,0 +1,186 @@ +{ + "resourceType": "Bundle", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "type": "transaction", + "entry": [ + { + "request": { + "method": "POST", + "url": "Organization" + }, + "fullUrl": "urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012", + "resource": { + "resourceType": "Organization", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization" + ] + }, + "identifier": [ + { + "value": "REQUESTER_ODS_CODE" + } + ] + } + }, + { + "request": { + "method": "POST", + "url": "Patient" + }, + "fullUrl": "urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53", + "resource": { + "resourceType": "Patient", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient" + ] + }, + "address": [ + { + "city": "PLYMOUTH", + "country": "ENG", + "district": "DEVON", + "line": [ + "113 BEAUMONT ROAD" + ], + "postalCode": "PL4 9EE" + } + ], + "birthDate": "1987-10-05", + "gender": "female", + "managingOrganization": { + "reference": "urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012" + }, + "name": [ + { + "family": "MOUSE", + "given": [ + "MINNIE" + ], + "text": "MINNIE MOUSE", + "use": "official" + } + ] + } + }, + { + "request": { + "method": "POST", + "url": "Specimen" + }, + "fullUrl": "urn:uuid:9df086ae-598d-436d-b0c0-d87954d5d135", + "resource": { + "resourceType": "Specimen", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen" + ] + }, + "status": "available", + "subject": { + "reference": "urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53" + }, + "type": { + "coding": [ + { + "code": "122554006", + "display": "Capillary blood specimen", + "system": "http://snomed.info/sct" + } + ] + } + } + }, + { + "request": { + "method": "POST", + "url": "ServiceRequest" + }, + "fullUrl": "urn:uuid:685c4a3a-5ac3-498d-9703-c81da7a5d9f4", + "resource": { + "resourceType": "ServiceRequest", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest" + ] + }, + "category": [ + { + "coding": [ + { + "code": "103693007", + "display": "Diagnostic procedure", + "system": "http://snomed.info/sct" + } + ], + "text": "Diagnostic procedure" + } + ], + "code": { + "coding": [ + { + "code": "63476009", + "display": "Measurement of prostate specific antigen", + "system": "http://snomed.info/sct" + } + ] + }, + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-SpecimenCollectionMethod", + "valueCodeableConcept": { + "coding": [ + { + "code": "122554006", + "display": "Capillary blood specimen", + "system": "http://snomed.info/sct" + } + ], + "text": "Capillary blood specimen" + } + } + ], + "identifier": [ + { + "type": { + "coding": [ + { + "code": "PLAC", + "display": "Placer Identifier", + "system": "http://terminology.hl7.org/CodeSystem/v2-0203" + } + ], + "text": "PlacerId" + }, + "use": "official", + "value": "2812455" + } + ], + "intent": "order", + "performer": [ + { + "reference": "Organization/ODS_CODE", + "type": "Organization" + } + ], + "requester": { + "reference": "urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012" + }, + "specimen": [ + { + "reference": "urn:uuid:9df086ae-598d-436d-b0c0-d87954d5d135" + } + ], + "status": "active", + "subject": { + "reference": "urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53" + } + } + } + ] +} diff --git a/examples/fhir/psa/observation_high.example.json b/examples/fhir/psa/reference/observation_high.example.json similarity index 100% rename from examples/fhir/psa/observation_high.example.json rename to examples/fhir/psa/reference/observation_high.example.json diff --git a/examples/fhir/psa/observation_normal.example.json b/examples/fhir/psa/reference/observation_normal.example.json similarity index 100% rename from examples/fhir/psa/observation_normal.example.json rename to examples/fhir/psa/reference/observation_normal.example.json diff --git a/examples/fhir/psa/order_servicerequest.example.json b/examples/fhir/psa/reference/order_servicerequest.example.json similarity index 100% rename from examples/fhir/psa/order_servicerequest.example.json rename to examples/fhir/psa/reference/order_servicerequest.example.json diff --git a/examples/fhir/psa/order_servicerequest_with_note.example.json b/examples/fhir/psa/reference/order_servicerequest_with_note.example.json similarity index 100% rename from examples/fhir/psa/order_servicerequest_with_note.example.json rename to examples/fhir/psa/reference/order_servicerequest_with_note.example.json diff --git a/examples/fhir/psa/reference/order_servicerequest_with_note_bundle.example.json b/examples/fhir/psa/reference/order_servicerequest_with_note_bundle.example.json new file mode 100644 index 0000000..77b6b50 --- /dev/null +++ b/examples/fhir/psa/reference/order_servicerequest_with_note_bundle.example.json @@ -0,0 +1,145 @@ +{ + "resourceType": "Bundle", + "id": "psa-order-bundle-with-note", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "type": "collection", + "entry": [ + { + "fullUrl": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e90", + "resource": { + "resourceType": "ServiceRequest", + "id": "psa-order-with-note", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest" + ] + }, + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-SpecimenCollectionMethod", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "122554006", + "display": "Capillary blood specimen" + } + ], + "text": "Capillary blood specimen" + } + } + ], + "status": "active", + "intent": "order", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "63476009", + "display": "Measurement of prostate specific antigen" + } + ], + "text": "Measurement of prostate specific antigen" + }, + "subject": { + "reference": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e91", + "display": "John Doe" + }, + "authoredOn": "2026-09-15T09:00:00Z", + "requester": { + "reference": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e92", + "display": "Dr Sarah Jenkins" + }, + "performer": [ + { + "reference": "Organization/SUPP002", + "display": "PSA Test Lab Ltd" + } + ], + "note": [ + { + "text": "PSA test required for Active Surveillance" + } + ] + } + }, + { + "fullUrl": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e91", + "resource": { + "resourceType": "Patient", + "id": "psa-patient-example", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient" + ] + }, + "active": true, + "identifier": [ + { + "system": "https://fhir.hl7.org.uk/Id/nhs-number", + "value": "9443211234" + } + ], + "name": [ + { + "use": "official", + "family": "Doe", + "given": [ + "John" + ], + "text": "John Doe" + } + ], + "gender": "male", + "birthDate": "1970-01-01", + "address": [ + { + "use": "home", + "type": "both", + "line": [ + "123 Evergreen Terrace" + ], + "city": "Birmingham", + "postalCode": "B15 XXX", + "country": "United Kingdom" + } + ] + } + }, + { + "fullUrl": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e92", + "resource": { + "resourceType": "Practitioner", + "id": "psa-practitioner-example", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner" + ] + }, + "identifier": [ + { + "system": "https://fhir.hl7.org.uk/Id/gmc-number", + "value": "7011234" + } + ], + "name": [ + { + "use": "official", + "family": "Jenkins", + "given": [ + "Sarah" + ], + "prefix": [ + "Dr" + ], + "text": "Dr Sarah Jenkins" + } + ] + } + } + ] +} diff --git a/examples/fhir/psa/reference/order_servicerequest_with_note_specimen_bundle.example.json b/examples/fhir/psa/reference/order_servicerequest_with_note_specimen_bundle.example.json new file mode 100644 index 0000000..6071bfe --- /dev/null +++ b/examples/fhir/psa/reference/order_servicerequest_with_note_specimen_bundle.example.json @@ -0,0 +1,179 @@ +{ + "resourceType": "Bundle", + "id": "psa-order-bundle-with-note-and-specimen", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle" + ] + }, + "type": "collection", + "entry": [ + { + "fullUrl": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e90", + "resource": { + "resourceType": "ServiceRequest", + "id": "psa-order-with-note", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest" + ] + }, + "status": "active", + "intent": "order", + "category": [ + { + "coding": [ + { + "system": "https://fhir.hometest.nhs.uk/CodeSystem/service-request-category", + "code": "home-test", + "display": "Home test" + } + ], + "text": "Home test" + } + ], + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "63476009", + "display": "Measurement of prostate specific antigen" + } + ], + "text": "Measurement of prostate specific antigen" + }, + "subject": { + "reference": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e91", + "display": "John Doe" + }, + "specimen": [ + { + "reference": "urn:uuid:specimen-001" + } + ], + "authoredOn": "2026-09-15T09:00:00Z", + "requester": { + "reference": "urn:uuid:requesting-hospital-001", + "display": "Example NHS Foundation Trust" + }, + "performer": [ + { + "reference": "Organization/SUPP002", + "display": "PSA Test Lab Ltd" + } + ], + "note": [ + { + "text": "PSA test required for Active Surveillance" + } + ] + } + }, + { + "fullUrl": "urn:uuid:specimen-001", + "resource": { + "resourceType": "Specimen", + "id": "specimen-001", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen" + ] + }, + "status": "available", + "subject": { + "reference": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e91", + "display": "John Doe" + }, + "request": [ + { + "reference": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e90" + } + ], + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "122554006", + "display": "Capillary blood specimen" + } + ], + "text": "Capillary blood specimen" + }, + "collection": { + "method": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "122554006", + "display": "Capillary blood specimen" + } + ], + "text": "Capillary blood specimen" + } + } + } + }, + { + "fullUrl": "urn:uuid:7d2a4f1e-0a7a-4b67-9c2f-8f3c6a1d5e91", + "resource": { + "resourceType": "Patient", + "id": "psa-patient-example", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient" + ] + }, + "active": true, + "identifier": [ + { + "system": "https://fhir.hl7.org.uk/Id/nhs-number", + "value": "9443211234" + } + ], + "name": [ + { + "use": "official", + "family": "Doe", + "given": [ + "John" + ], + "text": "John Doe" + } + ], + "gender": "male", + "birthDate": "1970-01-01", + "address": [ + { + "use": "home", + "type": "both", + "line": [ + "123 Evergreen Terrace" + ], + "city": "Birmingham", + "postalCode": "B15 XXX", + "country": "United Kingdom" + } + ] + } + }, + { + "fullUrl": "urn:uuid:requesting-hospital-001", + "resource": { + "resourceType": "Organization", + "id": "requesting-hospital-001", + "meta": { + "profile": [ + "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization" + ] + }, + "identifier": [ + { + "system": "https://fhir.hl7.org.uk/Id/ods-organization-code", + "value": "RGT" + } + ], + "name": "Example NHS Foundation Trust" + } + } + ] +} diff --git a/examples/fhir/psa/reference/rduh-service-request-example.json b/examples/fhir/psa/reference/rduh-service-request-example.json new file mode 100644 index 0000000..16c4941 --- /dev/null +++ b/examples/fhir/psa/reference/rduh-service-request-example.json @@ -0,0 +1,143 @@ +{ + "resourceType": "Bundle", + "id": "ukcore-pathology-order-bundle", + "meta": { + "profile": [ + "https://hl7.org.uk" + ] + }, + "type": "collection", + "entry": [ + { + "fullUrl": "urn:uuid:6f6634d0-997d-4171-be17-1f4153096001", + "resource": { + "resourceType": "ServiceRequest", + "id": "ukcore-pathology-order-fbc", + "meta": { + "profile": [ + "https://hl7.org.uk" + ] + }, + "status": "active", + "intent": "order", + "category": [ + { + "coding": [ + { + "system": "http://snomed.info", + "code": "108252007", + "display": "Laboratory procedure" + } + ] + } + ], + "priority": "routine", + "code": { + "coding": [ + { + "system": "http://snomed.info", + "code": "444158007", + "display": "Full blood count" + } + ], + "text": "Full Blood Count (FBC)" + }, + "subject": { + "reference": "urn:uuid:6f6634d0-997d-4171-be17-1f4153096002", + "display": "Richard Jones" + }, + "authoredOn": "2026-09-15T14:30:00Z", + "requester": { + "reference": "urn:uuid:6f6634d0-997d-4171-be17-1f4153096003", + "display": "Dr. Sarah Jenkins" + }, + "reasonCode": [ + { + "coding": [ + { + "system": "http://snomed.info", + "code": "84229001", + "display": "Fatigue" + } + ], + "text": "Lethargy and tiredness" + } + ] + } + }, + { + "fullUrl": "urn:uuid:6f6634d0-997d-4171-be17-1f4153096002", + "resource": { + "resourceType": "Patient", + "id": "ukcore-patient-example", + "meta": { + "profile": [ + "https://hl7.org.uk" + ] + }, + "active": true, + "identifier": [ + { + "extension": [ + { + "url": "https://hl7.org.uk", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://hl7.org.uk", + "code": "01", + "display": "Number present and verified" + } + ] + } + } + ], + "system": "https://fhir.nhs.uk", + "value": "9443211234" + } + ], + "name": [ + { + "use": "official", + "family": "Jones", + "given": [ + "Richard" + ] + } + ], + "gender": "male", + "birthDate": "1974-04-12" + } + }, + { + "fullUrl": "urn:uuid:6f6634d0-997d-4171-be17-1f4153096003", + "resource": { + "resourceType": "Practitioner", + "id": "ukcore-practitioner-example", + "meta": { + "profile": [ + "https://hl7.org.uk" + ] + }, + "identifier": [ + { + "system": "https://fhir.nhs.uk", + "value": "7011234" + } + ], + "name": [ + { + "use": "official", + "family": "Jenkins", + "given": [ + "Sarah" + ], + "prefix": [ + "Dr" + ] + } + ] + } + } + ] +} diff --git a/examples/hl7/psa/epic-order-hl7-2.txt b/examples/hl7/psa/epic-order-hl7-2.txt new file mode 100644 index 0000000..9be95fa --- /dev/null +++ b/examples/hl7/psa/epic-order-hl7-2.txt @@ -0,0 +1,5 @@ +MSH|^~\&|Epic|RH8|HomeTest|X26|20260904153627||ORM^O01|4128|P|2.5.1|||AL|NE +PID|1||9443211234^^^https://fhir.hl7.org.uk/Id/nhs-number^||MOUSE^MINNIE^^^^^D||19871005|F|||113 BEAUMONT ROAD^^PLYMOUTH^^PL4 9EE^ENG^P^^DEVON|||||||||||||||||||N +ORC|NW|2812455^EPC|||||^||||||||||||||||||||||LAB +OBR|1|2812455^EPC||63476009^Measurement of prostate specific antigen^SCT|||||||||||122554006&Capillary blood specimen&SCT^^^20982000&Capillary&SCT|||||||||||||||| +SPM|1|^||122554006^Capillary blood specimen^SCT^^^^|||^^^^^^|20982000^Capillary^SCT^^^^|||||||||| diff --git a/examples/hl7/psa/epic-order-hl7-generated.txt b/examples/hl7/psa/epic-order-hl7-generated.txt new file mode 100644 index 0000000..e003ca1 --- /dev/null +++ b/examples/hl7/psa/epic-order-hl7-generated.txt @@ -0,0 +1,7 @@ +MSH|^~\&|EPIC|RAA1|HOMETEST|SUPP002|20260821090000||ORM^O01|EPC202608210900001234|P|2.3|||AL|NE|GB +PID|1||9876543210^^^NHS^NH~MRN00445566^^^EPIC^MR||DOE^JOHN^^^^^L||19700101|M|||123 EVERGREEN TERRACE^^BIRMINGHAM^^B15 XXX^GBR^H +PV1|1|O|||||G1234567^SMITH^JANE^^^^^^NPI^^^^ORDERING +ORC|NW|ORD-A3F8C2D1-7B4E^EPIC|||||||20260821090000|||G1234567^SMITH^JANE^^^^^^NPI +OBR|1|ORD-A3F8C2D1-7B4E^EPIC||63476009^Measurement of prostate specific antigen^SCT|||20260821090000||||||PSA test required for Active Surveillance|||G1234567^SMITH^JANE^^^^^^NPI|||||||||L +NTE|1|OBR|PSA test required for Active Surveillance +SPM|1|SPEC-A3F8C2D1^EPIC||122554006^Capillary blood specimen^SCT|||||||P diff --git a/examples/hl7/psa/generated-order-request.txt b/examples/hl7/psa/generated-order-request.txt new file mode 100644 index 0000000..aec684f --- /dev/null +++ b/examples/hl7/psa/generated-order-request.txt @@ -0,0 +1,4 @@ +MSH|^~\&#|HomeTest|X26|Epic|RH8|20260923161613+0000||ORM^O01|8880C7BF-8CD7-446F-ACF7-2A87C3F1BB8B|P|2.5.1|||AL|NE +PID|1||9443211234^^^HC^PI~944 321 1234^^^NHS^NH||MOUSE^MINNIE^^^^^B||19871005|F|||113 BEAUMONT ROAD^^PLYMOUTH^^PL4 9EE^ENG^H^^DEVON||||||||944 321 1234|||||||||||N||||RH8^^ISO +ORC|NW|2812455^|^|||||||||||||||||||XAD^^^^^^L||XAD^^^^^^B +OBR|1|2812455^|^|63476009^Measurement of prostate specific antigen^SCT^^^^|||||||||||122554006&Capillary blood specimen&SCT^^^20982000&Capillary&SCT||||||||||||||||^^^^^^ diff --git a/schemas/supplier-api-spec-v2.yaml b/schemas/supplier-api-spec-v2.yaml index 36dd416..db1ee03 100644 --- a/schemas/supplier-api-spec-v2.yaml +++ b/schemas/supplier-api-spec-v2.yaml @@ -96,7 +96,10 @@ paths: /order: post: summary: Receive Test Order - description: Receive a new test order from the home test platform + description: >- + Receive a new test order from the home test platform. Accepts the legacy standalone + ServiceRequest format and the UK Core transaction Bundle format. Existing suppliers + may continue sending standalone ServiceRequests; Bundle support is additive. tags: - Order Management parameters: @@ -113,39 +116,119 @@ paths: content: application/fhir+json: schema: - $ref: '#/components/schemas/FHIRServiceRequest' + oneOf: + - $ref: '#/components/schemas/FHIRServiceRequest' + - $ref: '#/components/schemas/FHIRTransactionBundle' examples: - psa_order: - summary: PSA test order with clinical note + psa_ukcore_transaction_bundle: + summary: UK Core PSA transaction Bundle without an NHS number value: - resourceType: "ServiceRequest" - id: "660f9511-f3ac-42e5-b827-557766551111" - status: "active" - intent: "order" - code: - coding: - - system: "http://snomed.info/sct" - code: "63476009" - display: "Measurement of prostate specific antigen" - text: "Measurement of prostate specific antigen" - contained: - - resourceType: "Patient" - id: "patient-1" - name: - - use: "official" - family: "Smith" - given: ["John"] - gender: "male" - birthDate: "1965-03-15" - address: - - use: "home" - line: ["123 Main Street"] - postalCode: "SW1A 1AA" - subject: - reference: "#patient-1" - authoredOn: "2026-08-21T09:00:00Z" - note: - - text: "PSA test required for Active Surveillance" + resourceType: Bundle + meta: + profile: + - https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle + type: transaction + entry: + - fullUrl: urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012 + request: + method: POST + url: Organization + resource: + resourceType: Organization + meta: + profile: + - https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization + identifier: + - value: REQUESTER_ODS_CODE + - fullUrl: urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53 + request: + method: POST + url: Patient + resource: + resourceType: Patient + meta: + profile: + - https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient + address: + - city: PLYMOUTH + country: ENG + district: DEVON + line: [113 BEAUMONT ROAD] + postalCode: PL4 9EE + birthDate: "1987-10-05" + gender: female + managingOrganization: + reference: urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012 + name: + - family: MOUSE + given: [MINNIE] + text: MINNIE MOUSE + use: official + - fullUrl: urn:uuid:9df086ae-598d-436d-b0c0-d87954d5d135 + request: + method: POST + url: Specimen + resource: + resourceType: Specimen + meta: + profile: + - https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen + status: available + subject: + reference: urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53 + type: + coding: + - code: "122554006" + display: Capillary blood specimen + system: http://snomed.info/sct + - fullUrl: urn:uuid:685c4a3a-5ac3-498d-9703-c81da7a5d9f4 + request: + method: POST + url: ServiceRequest + resource: + resourceType: ServiceRequest + meta: + profile: + - https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest + category: + - coding: + - code: "103693007" + display: Diagnostic procedure + system: http://snomed.info/sct + text: Diagnostic procedure + code: + coding: + - code: "63476009" + display: Measurement of prostate specific antigen + system: http://snomed.info/sct + extension: + - url: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-SpecimenCollectionMethod + valueCodeableConcept: + coding: + - code: "122554006" + display: Capillary blood specimen + system: http://snomed.info/sct + text: Capillary blood specimen + identifier: + - type: + coding: + - code: PLAC + display: Placer Identifier + system: http://terminology.hl7.org/CodeSystem/v2-0203 + text: PlacerId + use: official + value: "2812455" + intent: order + performer: + - reference: Organization/ODS_CODE + type: Organization + requester: + reference: urn:uuid:528c4978-6d0d-45a5-9dda-40642b155012 + specimen: + - reference: urn:uuid:9df086ae-598d-436d-b0c0-d87954d5d135 + status: active + subject: + reference: urn:uuid:a9d98321-bfd1-4abd-8180-017228ad8b53 responses: '201': description: Order received and processed successfully @@ -153,38 +236,6 @@ paths: application/fhir+json: schema: $ref: '#/components/schemas/FHIRServiceRequest' - examples: - psa_order: - summary: PSA test order with clinical note - value: - resourceType: "ServiceRequest" - id: "660f9511-f3ac-42e5-b827-557766551111" - status: "active" - intent: "order" - code: - coding: - - system: "http://snomed.info/sct" - code: "63476009" - display: "Measurement of prostate specific antigen" - text: "Measurement of prostate specific antigen" - contained: - - resourceType: "Patient" - id: "patient-1" - name: - - use: "official" - family: "Smith" - given: ["John"] - gender: "male" - birthDate: "1965-03-15" - address: - - use: "home" - line: ["123 Main Street"] - postalCode: "SW1A 1AA" - subject: - reference: "#patient-1" - authoredOn: "2026-08-21T09:00:00Z" - note: - - text: "PSA test required for Active Surveillance" '400': $ref: '#/components/responses/BadRequest' '422': @@ -620,6 +671,10 @@ components: description: Requested performer (this supplier) items: $ref: '#/components/schemas/FHIRReference' + requester: + allOf: + - $ref: '#/components/schemas/FHIRReference' + - description: Organization or practitioner that initiated the request authoredOn: type: string format: date-time @@ -659,6 +714,298 @@ components: items: $ref: '#/components/schemas/FHIRAnnotation' + FHIRTransactionBundle: + type: object + description: >- + UK Core transaction Bundle order containing Organization, Patient, Specimen, and + ServiceRequest entries in that order. This is additive to the legacy standalone + ServiceRequest format. An NHS number is not required or expected in this Bundle. + References between Bundle entries MUST resolve to an entry fullUrl; suppliers should + accept urn:uuid references. + required: + - resourceType + - meta + - type + - entry + properties: + resourceType: + type: string + enum: [Bundle] + meta: + $ref: '#/components/schemas/UKCoreBundleMeta' + type: + type: string + enum: [transaction] + entry: + type: array + minItems: 4 + maxItems: 4 + description: Organization, Patient, Specimen, and ServiceRequest transaction entries, in that order + items: + oneOf: + - $ref: '#/components/schemas/FHIRTransactionOrganizationEntry' + - $ref: '#/components/schemas/FHIRTransactionPatientEntry' + - $ref: '#/components/schemas/FHIRTransactionSpecimenEntry' + - $ref: '#/components/schemas/FHIRTransactionServiceRequestEntry' + + UKCoreBundleMeta: + type: object + required: [profile] + properties: + profile: + type: array + minItems: 1 + items: + type: string + enum: ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Bundle"] + + FHIRTransactionEntryRequest: + type: object + required: [method, url] + properties: + method: + type: string + enum: [POST] + url: + type: string + enum: [Organization, Patient, Specimen, ServiceRequest] + + FHIRTransactionOrganizationEntry: + type: object + required: [fullUrl, request, resource] + properties: + fullUrl: + type: string + format: uri + request: + allOf: + - $ref: '#/components/schemas/FHIRTransactionEntryRequest' + - properties: + url: + type: string + enum: [Organization] + resource: + type: object + required: [resourceType, meta, identifier] + properties: + resourceType: + type: string + enum: [Organization] + meta: + type: object + required: [profile] + properties: + profile: + type: array + minItems: 1 + items: + type: string + enum: ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"] + identifier: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/FHIRBundleIdentifier' + + FHIRTransactionPatientEntry: + type: object + required: [fullUrl, request, resource] + properties: + fullUrl: + type: string + format: uri + request: + allOf: + - $ref: '#/components/schemas/FHIRTransactionEntryRequest' + - properties: + url: + type: string + enum: [Patient] + resource: + type: object + required: [resourceType, meta, address, birthDate, gender, managingOrganization, name] + properties: + resourceType: + type: string + enum: [Patient] + meta: + type: object + required: [profile] + properties: + profile: + type: array + minItems: 1 + items: + type: string + enum: ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"] + address: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/FHIRAddress' + birthDate: + type: string + format: date + gender: + type: string + enum: [male, female, other, unknown] + identifier: + type: array + description: Optional non-NHS identifier; do not include an NHS number in this order Bundle. + items: + $ref: '#/components/schemas/FHIRBundleIdentifier' + managingOrganization: + $ref: '#/components/schemas/FHIRReference' + name: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/FHIRHumanName' + + FHIRTransactionSpecimenEntry: + type: object + required: [fullUrl, request, resource] + properties: + fullUrl: + type: string + format: uri + request: + allOf: + - $ref: '#/components/schemas/FHIRTransactionEntryRequest' + - properties: + url: + type: string + enum: [Specimen] + resource: + type: object + required: [resourceType, meta, status, subject, type] + properties: + resourceType: + type: string + enum: [Specimen] + meta: + type: object + required: [profile] + properties: + profile: + type: array + minItems: 1 + items: + type: string + enum: ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen"] + status: + type: string + enum: [available, unavailable, unsatisfactory, entered-in-error] + subject: + $ref: '#/components/schemas/FHIRReference' + type: + $ref: '#/components/schemas/FHIRCodeableConcept' + + FHIRTransactionServiceRequestEntry: + type: object + required: [fullUrl, request, resource] + properties: + fullUrl: + type: string + format: uri + request: + allOf: + - $ref: '#/components/schemas/FHIRTransactionEntryRequest' + - properties: + url: + type: string + enum: [ServiceRequest] + resource: + type: object + required: [resourceType, meta, status, intent, category, code, subject, specimen] + properties: + resourceType: + type: string + enum: [ServiceRequest] + meta: + type: object + required: [profile] + properties: + profile: + type: array + minItems: 1 + items: + type: string + enum: ["https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest"] + status: + type: string + enum: [draft, active, on-hold, revoked, completed, entered-in-error, unknown] + intent: + type: string + enum: [proposal, plan, directive, order, original-order, reflex-order, filler-order, instance-order, option] + category: + type: array + items: + $ref: '#/components/schemas/FHIRCodeableConcept' + code: + $ref: '#/components/schemas/FHIRCodeableConcept' + extension: + type: array + description: >- + Include Extension-UKCore-SpecimenCollectionMethod when required by the ordered + test type. For PSA orders, use the SNOMED CT specimen collection method. + items: + $ref: '#/components/schemas/UKCoreSpecimenCollectionMethodExtension' + identifier: + type: array + items: + $ref: '#/components/schemas/FHIRBundleIdentifier' + performer: + type: array + description: >- + Requested performing Organization, identified by its ODS code using the + relative reference form Organization/{ODS code}. + items: + allOf: + - $ref: '#/components/schemas/FHIRReference' + - properties: + reference: + type: string + example: Organization/ODS_CODE + type: + type: string + enum: [Organization] + requester: + $ref: '#/components/schemas/FHIRReference' + specimen: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/FHIRReference' + subject: + $ref: '#/components/schemas/FHIRReference' + + FHIRBundleIdentifier: + type: object + required: [value] + properties: + assigner: + $ref: '#/components/schemas/FHIRReference' + system: + type: string + type: + $ref: '#/components/schemas/FHIRCodeableConcept' + use: + type: string + enum: [usual, official, temp, secondary, old] + value: + type: string + + UKCoreSpecimenCollectionMethodExtension: + type: object + required: [url, valueCodeableConcept] + properties: + url: + type: string + enum: ["https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-SpecimenCollectionMethod"] + valueCodeableConcept: + $ref: '#/components/schemas/FHIRCodeableConcept' + FHIRObservation: type: object description: FHIR Observation resource for test results @@ -1088,7 +1435,7 @@ components: text: type: string description: Free-text clinical note - example: "PSA test required for Active Surveillance" + example: "Clinical note text" FHIRBundleSearchsetResultsBundle: type: object description: FHIR Bundle of type 'searchset' containing a single results Bundle per order