From 9aa72fb8d6dd110cd977619aa3ac72ef00392dc0 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Mon, 19 Feb 2024 08:57:37 +0000 Subject: [PATCH 01/12] Add oas-build-checks to the .pre-commit-config --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ec9d1528..6053093b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,13 +23,13 @@ repos: - repo: local hooks: - # - id: oas-build-checks - # name: Build OAS - # entry: make - # args: ["build-specification"] - # language: system - # files: ^(examples|packages\/specification) - # types_or: [json, yaml] + - id: oas-build-checks + name: Build OAS + entry: make + args: ["build-specification"] + language: system + files: ^(examples|packages\/specification) + types_or: [json, yaml] - id: lint-githubactions name: Lint github actions From 52961328bea711c543fc92fc333c284cdbc76c62 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Mon, 19 Feb 2024 09:10:12 +0000 Subject: [PATCH 02/12] Add .github folder --- .github/dependabot.yml | 30 ++++++++++++++++++++++++++++ .github/pull_request_template.md | 13 ++++++++++++ .pre-commit-config.yaml | 34 ++++++++++++++++---------------- 3 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_template.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..1df53e630 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,30 @@ +######################################################################### +# Dependabot configuration file +######################################################################### + +version: 2 +updates: + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "daily" + + ################################### + # NPM workspace ################## + ################################### + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase + + ################################### + # Poetry ######################### + ################################### + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..29dd27b9f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +## Summary + +**Remove items from this list if they are not relevant. Remove this line once this has been done** + +- Routine Change +- :exclamation: Breaking Change +- :robot: Operational or Infrastructure Change +- :sparkles: New Feature +- :warning: Potential issues that might be caused by this change + +### Details + +Add any summary information of what is in the change. **Remove this line if you have nothing to add.** diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6053093b1..389ce9fd4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,23 +31,23 @@ repos: files: ^(examples|packages\/specification) types_or: [json, yaml] - - id: lint-githubactions - name: Lint github actions - entry: make - args: ["lint-githubactions"] - language: system - files: ^.github - types_or: [yaml] - pass_filenames: false - - - id: lint-githubaction-scripts - name: Lint github action scripts - entry: make - args: ["lint-githubaction-scripts"] - language: system - files: ^.github/scripts - types_or: [sh, shell] - pass_filenames: false + # - id: lint-githubactions + # name: Lint github actions + # entry: make + # args: ["lint-githubactions"] + # language: system + # files: ^.github + # types_or: [yaml] + # pass_filenames: false + + # - id: lint-githubaction-scripts + # name: Lint github action scripts + # entry: make + # args: ["lint-githubaction-scripts"] + # language: system + # files: ^.github/scripts + # types_or: [sh, shell] + # pass_filenames: false fail_fast: true default_stages: [commit] From af4f1d73fca3d21bfa05852751c4c84d1d928bd1 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 09:30:40 +0000 Subject: [PATCH 03/12] Add POST request --- .../eps-prescription-status-update-api.yaml | 82 +++- .../examples/Bundle/error-information.json | 12 + .../Bundle/error.json | 0 .../Bundle/success-multiple-tasks.json | 114 +++++ .../examples/Bundle/success-task.json | 46 ++ .../Bundle/success-distance-selling.json | 387 --------------- .../Bundle/success-empty.json | 10 - .../Bundle/success-multiple-exclusion.json | 405 ---------------- .../Bundle/success-multiple.json | 458 ------------------ .../Bundle/success-single-exclusion.json | 382 --------------- .../GetMyPrescriptions/Bundle/success.json | 342 ------------- 11 files changed, 228 insertions(+), 2010 deletions(-) create mode 100644 packages/specification/examples/Bundle/error-information.json rename packages/specification/examples/{GetMyPrescriptions => }/Bundle/error.json (100%) create mode 100644 packages/specification/examples/Bundle/success-multiple-tasks.json create mode 100644 packages/specification/examples/Bundle/success-task.json delete mode 100644 packages/specification/examples/GetMyPrescriptions/Bundle/success-distance-selling.json delete mode 100644 packages/specification/examples/GetMyPrescriptions/Bundle/success-empty.json delete mode 100644 packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple-exclusion.json delete mode 100644 packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple.json delete mode 100644 packages/specification/examples/GetMyPrescriptions/Bundle/success-single-exclusion.json delete mode 100644 packages/specification/examples/GetMyPrescriptions/Bundle/success.json diff --git a/packages/specification/eps-prescription-status-update-api.yaml b/packages/specification/eps-prescription-status-update-api.yaml index 1346108ca..798b9b96a 100755 --- a/packages/specification/eps-prescription-status-update-api.yaml +++ b/packages/specification/eps-prescription-status-update-api.yaml @@ -88,7 +88,57 @@ servers: description: "Production" paths: - /Bundle: + + /: + post: + operationId: prescription-status-update-bundle + summary: Post prescription status + description: | + ## Overview + Use this endpoint to post a prescription status, expressed as a FHIR Bundle. + parameters: + - $ref: "#/components/parameters/BearerAuthorisation" + - $ref: "#/components/parameters/RequestID" + - $ref: "#/components/parameters/CorrelationID" + responses: + "200": + description: Successful retrieval. + content: + application/fhir+json: + schema: + $ref: "#/components/schemas/bundle-response" + examples: + multiple-tasks: + description: A successful response posted to root, containing multiple Tasks. + value: + $ref: "examples/Bundle/success-multiple-tasks.json" + + "4XX": + description: | + An error occurred as follows: + + | HTTP status | Error code | Description | + | ----------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | + | 400 | `exception` | Missing or invalid NHS number in request | + | 401 | `processing` | Missing or invalid OAuth 2.0 bearer token in request | + | 404 | `not-found` | No records found for the NHS number in the request | + | 408 | `timeout` | Request timed out | + | 429 | `throttled` | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). | + + The error code will be included in the returned OperationOutcome (below). + content: + application/fhir+json: + schema: + $ref: "#/components/schemas/operation-outcome" + examples: + example: + description: | + An error response to a request. + Resource not found for the given NHS number. + value: + $ref: examples/Bundle/error-information.json + + /Task: get: operationId: prescription-status-update-bundle summary: Get prescription status @@ -107,30 +157,10 @@ paths: schema: $ref: "#/components/schemas/bundle-response" examples: - prescriptions-present: - description: A successful response to a GetMyPrescriptions/Bundle request, containing one prescription. - value: - $ref: "examples/GetMyPrescriptions/Bundle/success.json" - prescriptions-present-multiple: - description: A successful response to a GetMyPrescriptions/Bundle request, containing multiple prescriptions. - value: - $ref: "examples/GetMyPrescriptions/Bundle/success-multiple.json" - prescriptions-not-present: - description: A successful response to a GetMyPrescriptions/Bundle request, where no prescriptions were found. - value: - $ref: "examples/GetMyPrescriptions/Bundle/success-empty.json" - prescription-excluded: - description: A successful response to a GetMyPrescriptions/Bundle request, with a single prescription excluded. - value: - $ref: "examples/GetMyPrescriptions/Bundle/success-single-exclusion.json" - prescriptions-excluded: - description: A successful response to a GetMyPrescriptions/Bundle request, with a multiple prescriptions excluded. - value: - $ref: "examples/GetMyPrescriptions/Bundle/success-multiple-exclusion.json" - distance-selling-pharmacy: - description: A successful response to a GetMyPrescriptions/Bundle request, where the performer organisation is a distance selling pharmacy. + multiple-tasks: + description: A successful response. value: - $ref: "examples/GetMyPrescriptions/Bundle/success-distance-selling.json" + $ref: "examples/Bundle/success-task.json" "4XX": description: | @@ -152,10 +182,10 @@ paths: examples: example: description: | - An error response to a GetMyPrescriptions/Bundle request. + An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/GetMyPrescriptions/Bundle/error.json + $ref: examples/Bundle/error.json components: parameters: diff --git a/packages/specification/examples/Bundle/error-information.json b/packages/specification/examples/Bundle/error-information.json new file mode 100644 index 000000000..fc7d5b95c --- /dev/null +++ b/packages/specification/examples/Bundle/error-information.json @@ -0,0 +1,12 @@ +{ + "resourceType": "OperationOutcome", + "meta": { + "lastUpdated": "2022-10-21T13:47:00+00:00" + }, + "issue": [ + { + "code": "information", + "severity": "information" + } + ] +} diff --git a/packages/specification/examples/GetMyPrescriptions/Bundle/error.json b/packages/specification/examples/Bundle/error.json similarity index 100% rename from packages/specification/examples/GetMyPrescriptions/Bundle/error.json rename to packages/specification/examples/Bundle/error.json diff --git a/packages/specification/examples/Bundle/success-multiple-tasks.json b/packages/specification/examples/Bundle/success-multiple-tasks.json new file mode 100644 index 000000000..b82ee313a --- /dev/null +++ b/packages/specification/examples/Bundle/success-multiple-tasks.json @@ -0,0 +1,114 @@ +{ + "resourceType": "Bundle", + "type": "transaction", + "entry": [ + { + "fullUrl": "http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46", + "resource": { + "resourceType": "Task", + "id": "4d70678c-81e4-4ff4-8c67-17596fd0aa46", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] + }, + "request": { + "method": "POST", + "url": "Task" + } + }, + { + "fullUrl": "http://example.org/fhir/Task/346d2bfe-7dc0-451b-ad0d-da81833c08da", + "resource": { + "resourceType": "Task", + "id": "346d2bfe-7dc0-451b-ad0d-da81833c08da", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "e3843418-1900-44a1-8f6a-bff8601893b8" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] + }, + "request": { + "method": "POST", + "url": "Task" + } + } + ] +} diff --git a/packages/specification/examples/Bundle/success-task.json b/packages/specification/examples/Bundle/success-task.json new file mode 100644 index 000000000..fd6ea4588 --- /dev/null +++ b/packages/specification/examples/Bundle/success-task.json @@ -0,0 +1,46 @@ +{ + "resourceType": "Task", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] +} diff --git a/packages/specification/examples/GetMyPrescriptions/Bundle/success-distance-selling.json b/packages/specification/examples/GetMyPrescriptions/Bundle/success-distance-selling.json deleted file mode 100644 index 0b676bc3a..000000000 --- a/packages/specification/examples/GetMyPrescriptions/Bundle/success-distance-selling.json +++ /dev/null @@ -1,387 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "155e1102-9e71-4f19-9453-b905c0bbc494", - "meta": { - "lastUpdated": "2022-11-21T14:00:00+00:00" - }, - "type": "searchset", - "link": [ - { - "relation": "self", - "url": "https://sandbox.api.service.nhs.uk/electronic-prescriptions/Bundle" - } - ], - "total": 1, - "entry": [ - { - "fullUrl": "urn:uuid:0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "search": { - "mode": "match" - }, - "resource": { - "resourceType": "Bundle", - "id": "0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "type": "collection", - "entry": [ - { - "fullUrl": "urn:uuid:a54219b8-f741-4c47-b662-e4f8dfa49ab6", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "39732311000001104", - "display": "Amoxicillin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:6989b7bd-8db6-428c-a593-4022e3044c00", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "322341003", - "display": "Co-codamol 30mg/500mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:2868554c-5565-4d31-b92a-c5b8dab8b90a", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "321080004", - "display": "Pseudoephedrine hydrochloride 60mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:5cb17f5a-11ac-4e18-825f-6470467238b3", - "resource": { - "resourceType": "MedicationRequest", - "status": "cancelled", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "324252006", - "display": "Azithromycin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666", - "resource": { - "resourceType": "PractitionerRole", - "id": "56166769-c1c4-4d07-afa8-132b5dfca666", - "practitioner": { - "reference": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a" - }, - "organization": { - "reference": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8" - } - } - }, - { - "fullUrl": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "resource": { - "resourceType": "Practitioner", - "id": "a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "name": [ - { - "family": "BOIN", - "given": [ - "C" - ], - "prefix": [ - "DR" - ] - } - ] - } - }, - { - "fullUrl": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "resource": { - "resourceType": "Organization", - "id": "3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "A83008" - } - ], - "name": "HALLGARTH SURGERY", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9737320" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "HALLGARTH SURGERY", - "CHEAPSIDE" - ], - "city": "SHILDON", - "district": "COUNTY DURHAM", - "postalCode": "DL4 2HP" - } - ] - } - }, - { - "fullUrl": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "resource": { - "resourceType": "Organization", - "id": "afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "FLM49" - } - ], - "name": "PHARMACY2U", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9999999" - }, - { - "system": "url", - "use": "work", - "value": "www.pharmacy2u.co.uk" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "Unit 4B", - "Victoria Road" - ], - "city": "Leeds", - "district": "West Yorkshire", - "postalCode": "LS1 2LA" - } - ] - } - } - ] - } - }, - { - "fullUrl": "urn:uuid:1a388581-dbbe-43e3-9054-f5976c0245e5", - "search": { - "mode": "outcome" - }, - "resource": { - "resourceType": "OperationOutcome", - "id": "1a388581-dbbe-43e3-9054-f5976c0245e5", - "meta": { - "lastUpdated": "2023-09-29T10:52:00+00:00" - }, - "issue": [ - { - "code": "business-rule", - "severity": "warning", - "details": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", - "code": "INVALIDATED_RESOURCE", - "display": "Invalidated resource" - } - ] - }, - "diagnostics": "Some prescriptions have been invalidated so could not be returned." - } - ] - } - } - ] -} diff --git a/packages/specification/examples/GetMyPrescriptions/Bundle/success-empty.json b/packages/specification/examples/GetMyPrescriptions/Bundle/success-empty.json deleted file mode 100644 index 2bf4a3ade..000000000 --- a/packages/specification/examples/GetMyPrescriptions/Bundle/success-empty.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "155e1102-9e71-4f19-9453-b905c0bbc494", - "meta": { - "lastUpdated": "2022-11-21T14:00:00+00:00" - }, - "type": "searchset", - "total": 0, - "entry": [] -} diff --git a/packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple-exclusion.json b/packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple-exclusion.json deleted file mode 100644 index 5925592f4..000000000 --- a/packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple-exclusion.json +++ /dev/null @@ -1,405 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "155e1102-9e71-4f19-9453-b905c0bbc494", - "meta": { - "lastUpdated": "2022-11-21T14:00:00+00:00" - }, - "type": "searchset", - "total": 1, - "entry": [ - { - "fullUrl": "urn:uuid:0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "search": { - "mode": "match" - }, - "resource": { - "resourceType": "Bundle", - "id": "0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "type": "collection", - "entry": [ - { - "fullUrl": "urn:uuid:a54219b8-f741-4c47-b662-e4f8dfa49ab6", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "39732311000001104", - "display": "Amoxicillin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:6989b7bd-8db6-428c-a593-4022e3044c00", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "322341003", - "display": "Co-codamol 30mg/500mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:2868554c-5565-4d31-b92a-c5b8dab8b90a", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "321080004", - "display": "Pseudoephedrine hydrochloride 60mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:5cb17f5a-11ac-4e18-825f-6470467238b3", - "resource": { - "resourceType": "MedicationRequest", - "status": "cancelled", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "324252006", - "display": "Azithromycin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666", - "resource": { - "resourceType": "PractitionerRole", - "id": "56166769-c1c4-4d07-afa8-132b5dfca666", - "practitioner": { - "reference": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a" - }, - "organization": { - "reference": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8" - } - } - }, - { - "fullUrl": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "resource": { - "resourceType": "Practitioner", - "id": "a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "name": [ - { - "family": "BOIN", - "given": [ - "C" - ], - "prefix": [ - "DR" - ] - } - ] - } - }, - { - "fullUrl": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "resource": { - "resourceType": "Organization", - "id": "3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "A83008" - } - ], - "name": "HALLGARTH SURGERY", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9737320" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "HALLGARTH SURGERY", - "CHEAPSIDE" - ], - "city": "SHILDON", - "district": "COUNTY DURHAM", - "postalCode": "DL4 2HP" - } - ] - } - }, - { - "fullUrl": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "resource": { - "resourceType": "Organization", - "id": "afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "VNE51" - } - ], - "name": "Social Care Site - HEALTH AND CARE AT HOME", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9999999" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "THE HEALTH AND WELLBEING INNOVATION C", - "TRELISKE" - ], - "city": "TRURO", - "district": "CORNWALL", - "postalCode": "TR1 3FF" - } - ] - } - } - ] - } - }, - { - "fullUrl": "urn:uuid:1a388581-dbbe-43e3-9054-f5976c0245e5", - "search": { - "mode": "outcome" - }, - "resource": { - "resourceType": "OperationOutcome", - "id": "1a388581-dbbe-43e3-9054-f5976c0245e5", - "meta": { - "lastUpdated": "2023-09-29T10:52:00+00:00" - }, - "issue": [ - { - "code": "business-rule", - "severity": "warning", - "details": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", - "code": "INVALIDATED_RESOURCE", - "display": "Invalidated resource" - } - ] - }, - "diagnostics": "Prescription with short form ID D7AC09-A99968-4BA59C has been invalidated so could not be returned." - } - ] - } - }, - { - "fullUrl": "urn:uuid:fedef61e-bc62-452e-91c0-6f44ad2d5c0c", - "search": { - "mode": "outcome" - }, - "resource": { - "resourceType": "OperationOutcome", - "id": "fedef61e-bc62-452e-91c0-6f44ad2d5c0c", - "meta": { - "lastUpdated": "2023-09-29T10:52:00+00:00" - }, - "issue": [ - { - "code": "business-rule", - "severity": "warning", - "details": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", - "code": "INVALIDATED_RESOURCE", - "display": "Invalidated resource" - } - ] - }, - "diagnostics": "Prescription with short form ID CDF34E-A99968-4FF3BQ has been invalidated so could not be returned." - } - ] - } - } - ] -} diff --git a/packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple.json b/packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple.json deleted file mode 100644 index c045b7623..000000000 --- a/packages/specification/examples/GetMyPrescriptions/Bundle/success-multiple.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "155e1102-9e71-4f19-9453-b905c0bbc494", - "meta": { - "lastUpdated": "2022-11-21T14:00:00+00:00" - }, - "type": "searchset", - "total": 2, - "entry": [ - { - "fullUrl": "urn:uuid:0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "search": { - "mode": "match" - }, - "resource": { - "resourceType": "Bundle", - "id": "0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "type": "collection", - "entry": [ - { - "fullUrl": "urn:uuid:a54219b8-f741-4c47-b662-e4f8dfa49ab6", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "39732311000001104", - "display": "Amoxicillin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:6989b7bd-8db6-428c-a593-4022e3044c00", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "322341003", - "display": "Co-codamol 30mg/500mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:2868554c-5565-4d31-b92a-c5b8dab8b90a", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "321080004", - "display": "Pseudoephedrine hydrochloride 60mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:5cb17f5a-11ac-4e18-825f-6470467238b3", - "resource": { - "resourceType": "MedicationRequest", - "status": "cancelled", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "324252006", - "display": "Azithromycin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666", - "resource": { - "resourceType": "PractitionerRole", - "id": "56166769-c1c4-4d07-afa8-132b5dfca666", - "practitioner": { - "reference": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a" - }, - "organization": { - "reference": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8" - } - } - }, - { - "fullUrl": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "resource": { - "resourceType": "Practitioner", - "id": "a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "name": [ - { - "family": "BOIN", - "given": ["C"], - "prefix": ["DR"] - } - ] - } - }, - { - "fullUrl": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "resource": { - "resourceType": "Organization", - "id": "3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "A83008" - } - ], - "name": "HALLGARTH SURGERY", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9737320" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "HALLGARTH SURGERY", - "CHEAPSIDE", - "SHILDON", - "COUNTY DURHAM" - ], - "postalCode": "DL4 2HP" - } - ] - } - }, - { - "fullUrl": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "resource": { - "resourceType": "Organization", - "id": "afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "VNE51" - } - ], - "name": "Social Care Site - HEALTH AND CARE AT HOME", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9999999" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "text": "THE HEALTH AND WELLBEING INNOVATION C, TRELISKE, TRURO, CORNWALL", - "postalCode": "TR1 3FF" - } - ] - } - } - ] - } - }, - { - "fullUrl": "urn:uuid:0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "search": { - "mode": "match" - }, - "resource": { - "resourceType": "Bundle", - "id": "0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "type": "collection", - "entry": [ - { - "fullUrl": "urn:uuid:ee035711-7aac-48c4-951a-62c07891d37d", - "resource": { - "resourceType": "MedicationRequest", - "status": "cancelled", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "324252006", - "display": "Azithromycin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:815c6eb3-41f8-4f48-9e0d-2983624d4f90" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "566946-B86044-FEFEFN" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2023-03-14" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:815c6eb3-41f8-4f48-9e0d-2983624d4f90", - "resource": { - "resourceType": "PractitionerRole", - "id": "815c6eb3-41f8-4f48-9e0d-2983624d4f90", - "practitioner": { - "reference": "urn:uuid:acd5b009-c78f-40f2-a48b-b38ac72de992" - }, - "organization": { - "reference": "urn:uuid:9683c147-ddad-41d9-9858-6e585c3f04df" - } - } - }, - { - "fullUrl": "urn:uuid:acd5b009-c78f-40f2-a48b-b38ac72de992", - "resource": { - "resourceType": "Practitioner", - "id": "acd5b009-c78f-40f2-a48b-b38ac72de992", - "name": [ - { - "family": "ROBINSON", - "given": ["C"], - "prefix": ["DR"] - } - ] - } - }, - { - "fullUrl": "urn:uuid:9683c147-ddad-41d9-9858-6e585c3f04df", - "resource": { - "resourceType": "Organization", - "id": "9683c147-ddad-41d9-9858-6e585c3f04df", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "B86044" - } - ], - "name": "IRELAND WOOD SURGERY", - "telecom": [ - { - "system": "phone", - "value": "0113 2303470" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "text": "IVESON APPROACH, LEEDS, WEST YORKSHIRE, ENGLAND, LS16 6FR" - } - ] - } - } - ] - } - } - ] -} diff --git a/packages/specification/examples/GetMyPrescriptions/Bundle/success-single-exclusion.json b/packages/specification/examples/GetMyPrescriptions/Bundle/success-single-exclusion.json deleted file mode 100644 index 2237d92aa..000000000 --- a/packages/specification/examples/GetMyPrescriptions/Bundle/success-single-exclusion.json +++ /dev/null @@ -1,382 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "155e1102-9e71-4f19-9453-b905c0bbc494", - "meta": { - "lastUpdated": "2022-11-21T14:00:00+00:00" - }, - "type": "searchset", - "link": [ - { - "relation": "self", - "url": "https://sandbox.api.service.nhs.uk/electronic-prescriptions/Bundle" - } - ], - "total": 1, - "entry": [ - { - "fullUrl": "urn:uuid:0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "search": { - "mode": "match" - }, - "resource": { - "resourceType": "Bundle", - "id": "0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "type": "collection", - "entry": [ - { - "fullUrl": "urn:uuid:a54219b8-f741-4c47-b662-e4f8dfa49ab6", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "39732311000001104", - "display": "Amoxicillin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:6989b7bd-8db6-428c-a593-4022e3044c00", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "322341003", - "display": "Co-codamol 30mg/500mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:2868554c-5565-4d31-b92a-c5b8dab8b90a", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "321080004", - "display": "Pseudoephedrine hydrochloride 60mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:5cb17f5a-11ac-4e18-825f-6470467238b3", - "resource": { - "resourceType": "MedicationRequest", - "status": "cancelled", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "324252006", - "display": "Azithromycin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666", - "resource": { - "resourceType": "PractitionerRole", - "id": "56166769-c1c4-4d07-afa8-132b5dfca666", - "practitioner": { - "reference": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a" - }, - "organization": { - "reference": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8" - } - } - }, - { - "fullUrl": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "resource": { - "resourceType": "Practitioner", - "id": "a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "name": [ - { - "family": "BOIN", - "given": [ - "C" - ], - "prefix": [ - "DR" - ] - } - ] - } - }, - { - "fullUrl": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "resource": { - "resourceType": "Organization", - "id": "3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "A83008" - } - ], - "name": "HALLGARTH SURGERY", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9737320" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "HALLGARTH SURGERY", - "CHEAPSIDE" - ], - "city": "SHILDON", - "district": "COUNTY DURHAM", - "postalCode": "DL4 2HP" - } - ] - } - }, - { - "fullUrl": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "resource": { - "resourceType": "Organization", - "id": "afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "VNE51" - } - ], - "name": "Social Care Site - HEALTH AND CARE AT HOME", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9999999" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "THE HEALTH AND WELLBEING INNOVATION C", - "TRELISKE" - ], - "city": "TRURO", - "district": "CORNWALL", - "postalCode": "TR1 3FF" - } - ] - } - } - ] - } - }, - { - "fullUrl": "urn:uuid:1a388581-dbbe-43e3-9054-f5976c0245e5", - "search": { - "mode": "outcome" - }, - "resource": { - "resourceType": "OperationOutcome", - "id": "1a388581-dbbe-43e3-9054-f5976c0245e5", - "meta": { - "lastUpdated": "2023-09-29T10:52:00+00:00" - }, - "issue": [ - { - "code": "business-rule", - "severity": "warning", - "details": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", - "code": "INVALIDATED_RESOURCE", - "display": "Invalidated resource" - } - ] - }, - "diagnostics": "Some prescriptions have been invalidated so could not be returned." - } - ] - } - } - ] -} diff --git a/packages/specification/examples/GetMyPrescriptions/Bundle/success.json b/packages/specification/examples/GetMyPrescriptions/Bundle/success.json deleted file mode 100644 index d3677e58b..000000000 --- a/packages/specification/examples/GetMyPrescriptions/Bundle/success.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "155e1102-9e71-4f19-9453-b905c0bbc494", - "meta": { - "lastUpdated": "2022-11-21T14:00:00+00:00" - }, - "type": "searchset", - "total": 1, - "entry": [ - { - "fullUrl": "urn:uuid:0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "search": { - "mode": "match" - }, - "resource": { - "resourceType": "Bundle", - "id": "0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", - "type": "collection", - "entry": [ - { - "fullUrl": "urn:uuid:a54219b8-f741-4c47-b662-e4f8dfa49ab6", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "39732311000001104", - "display": "Amoxicillin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:6989b7bd-8db6-428c-a593-4022e3044c00", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "322341003", - "display": "Co-codamol 30mg/500mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 20, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:2868554c-5565-4d31-b92a-c5b8dab8b90a", - "resource": { - "resourceType": "MedicationRequest", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "321080004", - "display": "Pseudoephedrine hydrochloride 60mg tablets" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:5cb17f5a-11ac-4e18-825f-6470467238b3", - "resource": { - "resourceType": "MedicationRequest", - "status": "cancelled", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "324252006", - "display": "Azithromycin 250mg capsules" - } - ] - }, - "subject": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "requester": { - "reference": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666" - }, - "groupIdentifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - }, - "courseOfTherapyType": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy", - "code": "acute", - "display": "Short course (acute) therapy" - } - ] - }, - "dispenseRequest": { - "validityPeriod": { - "start": "2022-10-21" - }, - "quantity": { - "value": 30, - "unit": "tablet", - "system": "http://snomed.info/sct", - "code": "428673006" - }, - "performer": { - "reference": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1" - } - }, - "substitution": { - "allowedBoolean": false - } - } - }, - { - "fullUrl": "urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666", - "resource": { - "resourceType": "PractitionerRole", - "id": "56166769-c1c4-4d07-afa8-132b5dfca666", - "practitioner": { - "reference": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a" - }, - "organization": { - "reference": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8" - } - } - }, - { - "fullUrl": "urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "resource": { - "resourceType": "Practitioner", - "id": "a8c85454-f8cb-498d-9629-78e2cb5fa47a", - "name": [ - { - "family": "BOIN", - "given": [ - "C" - ], - "prefix": [ - "DR" - ] - } - ] - } - }, - { - "fullUrl": "urn:uuid:3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "resource": { - "resourceType": "Organization", - "id": "3b4b03a5-52ba-4ba6-9b82-70350aa109d8", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "A83008" - } - ], - "name": "HALLGARTH SURGERY", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9737320" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "line": [ - "HALLGARTH SURGERY", - "CHEAPSIDE", - "SHILDON", - "COUNTY DURHAM" - ], - "postalCode": "DL4 2HP" - } - ] - } - }, - { - "fullUrl": "urn:uuid:afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "resource": { - "resourceType": "Organization", - "id": "afb07f8b-e8d7-4cad-895d-494e6b35b2a1", - "identifier": [ - { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "VNE51" - } - ], - "name": "Social Care Site - HEALTH AND CARE AT HOME", - "telecom": [ - { - "system": "phone", - "use": "work", - "value": "0115 9999999" - } - ], - "address": [ - { - "use": "work", - "type": "both", - "text": "THE HEALTH AND WELLBEING INNOVATION C, TRELISKE, TRURO, CORNWALL", - "postalCode": "TR1 3FF" - } - ] - } - } - ] - } - } - ] -} From d3e4b30afbe6a17c2ce5cf5e1b35be5d187e9853 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 14:35:28 +0000 Subject: [PATCH 04/12] Add PutPrescriptionStatus folder --- .../specification/eps-prescription-status-update-api.yaml | 8 ++++---- .../Bundle/error-information.json | 0 .../{ => PutPrescriptionStatus}/Bundle/error.json | 0 .../Bundle/success-multiple-tasks.json | 0 .../{ => PutPrescriptionStatus}/Bundle/success-task.json | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename packages/specification/examples/{ => PutPrescriptionStatus}/Bundle/error-information.json (100%) rename packages/specification/examples/{ => PutPrescriptionStatus}/Bundle/error.json (100%) rename packages/specification/examples/{ => PutPrescriptionStatus}/Bundle/success-multiple-tasks.json (100%) rename packages/specification/examples/{ => PutPrescriptionStatus}/Bundle/success-task.json (100%) diff --git a/packages/specification/eps-prescription-status-update-api.yaml b/packages/specification/eps-prescription-status-update-api.yaml index 798b9b96a..13da780ed 100755 --- a/packages/specification/eps-prescription-status-update-api.yaml +++ b/packages/specification/eps-prescription-status-update-api.yaml @@ -111,7 +111,7 @@ paths: multiple-tasks: description: A successful response posted to root, containing multiple Tasks. value: - $ref: "examples/Bundle/success-multiple-tasks.json" + $ref: "examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json" "4XX": description: | @@ -136,7 +136,7 @@ paths: An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/Bundle/error-information.json + $ref: examples/PutPrescriptionStatus/Bundle/error-information.json /Task: get: @@ -160,7 +160,7 @@ paths: multiple-tasks: description: A successful response. value: - $ref: "examples/Bundle/success-task.json" + $ref: "examples/PutPrescriptionStatus/Bundle/success-task.json" "4XX": description: | @@ -185,7 +185,7 @@ paths: An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/Bundle/error.json + $ref: examples/PutPrescriptionStatus/Bundle/error.json components: parameters: diff --git a/packages/specification/examples/Bundle/error-information.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/error-information.json similarity index 100% rename from packages/specification/examples/Bundle/error-information.json rename to packages/specification/examples/PutPrescriptionStatus/Bundle/error-information.json diff --git a/packages/specification/examples/Bundle/error.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json similarity index 100% rename from packages/specification/examples/Bundle/error.json rename to packages/specification/examples/PutPrescriptionStatus/Bundle/error.json diff --git a/packages/specification/examples/Bundle/success-multiple-tasks.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json similarity index 100% rename from packages/specification/examples/Bundle/success-multiple-tasks.json rename to packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json diff --git a/packages/specification/examples/Bundle/success-task.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json similarity index 100% rename from packages/specification/examples/Bundle/success-task.json rename to packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json From 8dfeafda47d084e8a5e3a6dd42410c3c4e4feac1 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 15:00:20 +0000 Subject: [PATCH 05/12] Add PrescriptionStatusUpdate schema --- .../eps-prescription-status-update-api.yaml | 13 ++++++-- ...error-information.json => error-info.json} | 0 .../resources/PrescriptionStatusUpdate.yaml | 30 +++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) rename packages/specification/examples/PutPrescriptionStatus/Bundle/{error-information.json => error-info.json} (100%) create mode 100644 packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml diff --git a/packages/specification/eps-prescription-status-update-api.yaml b/packages/specification/eps-prescription-status-update-api.yaml index 13da780ed..6cd7895c7 100755 --- a/packages/specification/eps-prescription-status-update-api.yaml +++ b/packages/specification/eps-prescription-status-update-api.yaml @@ -109,7 +109,7 @@ paths: $ref: "#/components/schemas/bundle-response" examples: multiple-tasks: - description: A successful response posted to root, containing multiple Tasks. + description: A successful response to a PutPrescriptionStatus/Bundle request, containing multiple tasks. value: $ref: "examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json" @@ -136,7 +136,7 @@ paths: An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/PutPrescriptionStatus/Bundle/error-information.json + $ref: examples/PutPrescriptionStatus/Bundle/error-info.json /Task: get: @@ -158,7 +158,7 @@ paths: $ref: "#/components/schemas/bundle-response" examples: multiple-tasks: - description: A successful response. + description: A successful response to a PutPrescriptionStatus/Bundle request, containing multiple tasks. value: $ref: "examples/PutPrescriptionStatus/Bundle/success-task.json" @@ -284,11 +284,18 @@ components: description: A collection of resources contained within the Bundle. items: oneOf: + - $ref: "#/components/schemas/PrescriptionStatusUpdate-Resource" - $ref: "#/components/schemas/MedicationRequest-Resource" - $ref: "#/components/schemas/OrganisationDispensing-Resource" - $ref: "#/components/schemas/Practitioner-Resource" - $ref: "#/components/schemas/PractitionerRole-Resource" - $ref: "#/components/schemas/operation-outcome" + PrescriptionStatusUpdate-Resource: + type: object + description: PrescriptionStatusUpdate + properties: + resource: + $ref: schemas/resources/PrescriptionStatusUpdate.yaml MedicationRequest-Resource: type: object description: MedicationRequest diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/error-information.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/error-info.json similarity index 100% rename from packages/specification/examples/PutPrescriptionStatus/Bundle/error-information.json rename to packages/specification/examples/PutPrescriptionStatus/Bundle/error-info.json diff --git a/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml b/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml new file mode 100644 index 000000000..eeb3ede13 --- /dev/null +++ b/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml @@ -0,0 +1,30 @@ +type: object +description: Details of the organisation. +properties: + resourceType: + type: string + description: FHIR resource type. + default: Organization + identifier: + type: array + description: An array containing the ODS code of the organisation. + items: + $ref: ../fragments/identifiers.yaml#/OdsOrganisationCode + name: + type: string + description: Organisation name. + address: + type: array + description: | + Organisation address. + One of line or text, and optionally postalCode, will be populated. + If postalCode is not populated, the organization's postalCode may be included in line or text, if they are populated. + So address will contain use and type, along with one of: line, line and postalCode, text, text and postalCode, postalCode. + Note: city and district will not be populated by existing prescriptions. + items: + $ref: ../fragments/address.yaml + telecom: + type: array + description: The telephone number or Website URL associated with the organisation. + items: + $ref: ../fragments/telecom.yaml From 18d9c0cb65928940970da7ca0ec3abff6e3bac1e Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 15:25:55 +0000 Subject: [PATCH 06/12] Amend success messages --- .../Bundle/success-multiple-tasks.json | 150 +++++------------- .../Bundle/success-task.json | 55 ++----- 2 files changed, 55 insertions(+), 150 deletions(-) diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json index b82ee313a..488c6ae86 100644 --- a/packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json +++ b/packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json @@ -1,114 +1,52 @@ { "resourceType": "Bundle", - "type": "transaction", - "entry": [ - { - "fullUrl": "http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46", - "resource": { - "resourceType": "Task", - "id": "4d70678c-81e4-4ff4-8c67-17596fd0aa46", - "basedOn": [ - { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - } + "id": "08438419-7888-4be9-9490-37ffe202ae27", + "meta": { + "lastUpdated": "2024-01-30T12:01:24Z" + }, + "type": "transaction-response", + "entry": [ + { + "response": { + "status": "201 Created", + "location": "Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46/_history/1", + "etag": "W/\"1\"", + "lastModified": "2024-01-30T12:01:24Z", + "outcome": { + "resourceType": "OperationOutcome", + "meta": { + "lastUpdated": "2024-01-30T12:01:24Z" + }, + "issue": [ + { + "severity": "information", + "code": "informational", + "diagnostics": "No issues detected during validation" + } + ] } - ], - "status": "in-progress", - "businessStatus": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", - "code": "9001", - "display": "Ready to Collect" - } - ] - }, - "intent": "order", - "focus": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", - "value": "6989b7bd-8db6-428c-a593-4022e3044c00" - } - }, - "for": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "lastModified": "2024-01-30T12:01:24Z", - "owner": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "C9Z1O" - } - }, - "note": [ - { - "text": "Locker code: 556701" - } - ] - }, - "request": { - "method": "POST", - "url": "Task" } - }, - { - "fullUrl": "http://example.org/fhir/Task/346d2bfe-7dc0-451b-ad0d-da81833c08da", - "resource": { - "resourceType": "Task", - "id": "346d2bfe-7dc0-451b-ad0d-da81833c08da", - "basedOn": [ - { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - } - } - ], - "status": "in-progress", - "businessStatus": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", - "code": "9001", - "display": "Ready to Collect" - } - ] - }, - "intent": "order", - "focus": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", - "value": "e3843418-1900-44a1-8f6a-bff8601893b8" + }, + { + "response": { + "status": "201 Created", + "location": "Task/346d2bfe-7dc0-451b-ad0d-da81833c08da/_history/1", + "etag": "W/\"1\"", + "lastModified": "2024-01-30T12:01:24Z", + "outcome": { + "resourceType": "OperationOutcome", + "meta": { + "lastUpdated": "2024-01-30T12:01:24Z" + }, + "issue": [ + { + "severity": "information", + "code": "informational", + "diagnostics": "No issues detected during validation" + } + ] } - }, - "for": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "lastModified": "2024-01-30T12:01:24Z", - "owner": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "C9Z1O" - } - }, - "note": [ - { - "text": "Locker code: 556701" - } - ] - }, - "request": { - "method": "POST", - "url": "Task" - } } + } ] } diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json index fd6ea4588..c62eae2e5 100644 --- a/packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json +++ b/packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json @@ -1,46 +1,13 @@ { - "resourceType": "Task", - "basedOn": [ - { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - } - } - ], - "status": "in-progress", - "businessStatus": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", - "code": "9001", - "display": "Ready to Collect" - } - ] - }, - "intent": "order", - "focus": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", - "value": "6989b7bd-8db6-428c-a593-4022e3044c00" - } - }, - "for": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "lastModified": "2024-01-30T12:01:24Z", - "owner": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "C9Z1O" - } - }, - "note": [ - { - "text": "Locker code: 556701" - } - ] + "resourceType": "OperationOutcome", + "meta": { + "lastUpdated": "2024-01-30T12:01:24Z" + }, + "issue": [ + { + "severity": "information", + "code": "informational", + "diagnostics": "No issues detected during validation" + } + ] } From 323bc141b6419d5d1e823bb43e4fc92ae1ed42d4 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 15:42:06 +0000 Subject: [PATCH 07/12] Update the error message --- .../PutPrescriptionStatus/Bundle/error.json | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json index 874ab0e78..f29100f82 100644 --- a/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json +++ b/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json @@ -1,21 +1,22 @@ { "resourceType": "OperationOutcome", "meta": { - "lastUpdated": "2022-10-21T13:47:00+00:00" + "lastUpdated": "2024-01-30T12:01:24Z" }, - "issue": [ - { - "code": "not-found", - "severity": "error", - "details": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", - "code": "RESOURCE_NOT_FOUND", - "display": "Resource not found" - } - ] + "issue": [ + { + "severity": "error", + "code": "processing", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", + "code": "INVALID_VALUE", + "display": "Invalid value" + } + ] + }, +"diagnostics": "Invalid prescription ID" } - } ] } From e31e6a4559f80dab9f836ff1282d66a0eadc65db Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 16:19:35 +0000 Subject: [PATCH 08/12] Amend PrescriptionStatusUpdate schema --- .../resources/PrescriptionStatusUpdate.yaml | 136 +++++++++++++++--- 1 file changed, 113 insertions(+), 23 deletions(-) diff --git a/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml b/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml index eeb3ede13..05873b810 100644 --- a/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml +++ b/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml @@ -1,30 +1,120 @@ type: object -description: Details of the organisation. properties: resourceType: type: string - description: FHIR resource type. - default: Organization - identifier: - type: array - description: An array containing the ODS code of the organisation. - items: - $ref: ../fragments/identifiers.yaml#/OdsOrganisationCode - name: + example: Bundle + type: type: string - description: Organisation name. - address: - type: array - description: | - Organisation address. - One of line or text, and optionally postalCode, will be populated. - If postalCode is not populated, the organization's postalCode may be included in line or text, if they are populated. - So address will contain use and type, along with one of: line, line and postalCode, text, text and postalCode, postalCode. - Note: city and district will not be populated by existing prescriptions. - items: - $ref: ../fragments/address.yaml - telecom: + example: transaction + entry: type: array - description: The telephone number or Website URL associated with the organisation. items: - $ref: ../fragments/telecom.yaml + type: object + properties: + fullUrl: + type: string + example: http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46 + resource: + type: object + properties: + resourceType: + type: string + example: Task + id: + type: string + example: 4d70678c-81e4-4ff4-8c67-17596fd0aa46 + basedOn: + type: array + items: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-number + value: + type: string + example: 24F5DA-A83008-7EFE6Z + status: + type: string + example: in-progress + businessStatus: + type: object + properties: + coding: + type: array + items: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt + code: + type: string + format: date + example: "9001" + display: + type: string + example: Ready to Collect + intent: + type: string + example: order + focus: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-item-number + value: + type: string + example: 6989b7bd-8db6-428c-a593-4022e3044c00 + for: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/nhs-number + value: + type: string + example: "9449304130" + lastModified: + type: string + format: date-time + example: 2024-01-30T12:01:24Z + owner: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/ods-organization-code + value: + type: string + example: C9Z1O + note: + type: array + items: + type: object + properties: + text: + type: string + example: "Locker code: 556701" + request: + type: object + properties: + method: + type: string + example: POST + url: + type: string + example: Task From 21d69e68437cf92e29b1c4a80d3c393b94a36962 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 16:21:32 +0000 Subject: [PATCH 09/12] Remove wrong error message --- .../eps-prescription-status-update-api.yaml | 2 +- .../PutPrescriptionStatus/Bundle/error-info.json | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 packages/specification/examples/PutPrescriptionStatus/Bundle/error-info.json diff --git a/packages/specification/eps-prescription-status-update-api.yaml b/packages/specification/eps-prescription-status-update-api.yaml index 6cd7895c7..13ace0fb7 100755 --- a/packages/specification/eps-prescription-status-update-api.yaml +++ b/packages/specification/eps-prescription-status-update-api.yaml @@ -136,7 +136,7 @@ paths: An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/PutPrescriptionStatus/Bundle/error-info.json + $ref: examples/PutPrescriptionStatus/Bundle/error.json /Task: get: diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/error-info.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/error-info.json deleted file mode 100644 index fc7d5b95c..000000000 --- a/packages/specification/examples/PutPrescriptionStatus/Bundle/error-info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "resourceType": "OperationOutcome", - "meta": { - "lastUpdated": "2022-10-21T13:47:00+00:00" - }, - "issue": [ - { - "code": "information", - "severity": "information" - } - ] -} From caae39f086c2ac7f12eebb5edbb7728ee156815f Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 20 Feb 2024 18:17:54 +0000 Subject: [PATCH 10/12] Update error for the Task request --- .../eps-prescription-status-update-api.yaml | 8 ++--- .../PutPrescriptionStatus/Bundle/error.json | 29 +++++++++---------- .../PutPrescriptionStatus/Task/error.json | 22 ++++++++++++++ .../{Bundle => Task}/success-task.json | 0 4 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 packages/specification/examples/PutPrescriptionStatus/Task/error.json rename packages/specification/examples/PutPrescriptionStatus/{Bundle => Task}/success-task.json (100%) diff --git a/packages/specification/eps-prescription-status-update-api.yaml b/packages/specification/eps-prescription-status-update-api.yaml index 13ace0fb7..05eab3e38 100755 --- a/packages/specification/eps-prescription-status-update-api.yaml +++ b/packages/specification/eps-prescription-status-update-api.yaml @@ -157,10 +157,10 @@ paths: schema: $ref: "#/components/schemas/bundle-response" examples: - multiple-tasks: - description: A successful response to a PutPrescriptionStatus/Bundle request, containing multiple tasks. + success-task: + description: A successful response to a PutPrescriptionStatus/Task request, containing single task resource with a status update. value: - $ref: "examples/PutPrescriptionStatus/Bundle/success-task.json" + $ref: "examples/PutPrescriptionStatus/Task/success-task.json" "4XX": description: | @@ -185,7 +185,7 @@ paths: An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/PutPrescriptionStatus/Bundle/error.json + $ref: examples/PutPrescriptionStatus/Task/error.json components: parameters: diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json b/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json index f29100f82..874ab0e78 100644 --- a/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json +++ b/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json @@ -1,22 +1,21 @@ { "resourceType": "OperationOutcome", "meta": { - "lastUpdated": "2024-01-30T12:01:24Z" + "lastUpdated": "2022-10-21T13:47:00+00:00" }, - "issue": [ - { - "severity": "error", - "code": "processing", - "details": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", - "code": "INVALID_VALUE", - "display": "Invalid value" - } - ] - }, -"diagnostics": "Invalid prescription ID" + "issue": [ + { + "code": "not-found", + "severity": "error", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", + "code": "RESOURCE_NOT_FOUND", + "display": "Resource not found" + } + ] } + } ] } diff --git a/packages/specification/examples/PutPrescriptionStatus/Task/error.json b/packages/specification/examples/PutPrescriptionStatus/Task/error.json new file mode 100644 index 000000000..4b08391d5 --- /dev/null +++ b/packages/specification/examples/PutPrescriptionStatus/Task/error.json @@ -0,0 +1,22 @@ +{ + "resourceType": "OperationOutcome", + "meta": { + "lastUpdated": "2024-01-30T12:01:24Z" + }, + "issue": [ + { + "severity": "error", + "code": "processing", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode", + "code": "INVALID_VALUE", + "display": "Invalid value" + } + ] + }, + "diagnostics": "Invalid prescription ID" + } + ] +} diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json b/packages/specification/examples/PutPrescriptionStatus/Task/success-task.json similarity index 100% rename from packages/specification/examples/PutPrescriptionStatus/Bundle/success-task.json rename to packages/specification/examples/PutPrescriptionStatus/Task/success-task.json From 45daa662d14d7583d3be0b8e5e872581d331608a Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Wed, 21 Feb 2024 07:00:47 +0000 Subject: [PATCH 11/12] Add requestBody examples --- .../eps-prescription-status-update-api.yaml | 149 +++++++----------- .../Bundle/error.json | 0 .../Bundle/request-multiple-tasks.json | 114 ++++++++++++++ .../response-multiple-tasks.json} | 0 .../Task/error.json | 0 .../examples/Task/request-single-task.json | 46 ++++++ .../response-single-task.json} | 0 .../schemas/components/BundleResponse.yaml | 66 ++++++++ .../TaskResponse.yaml} | 0 .../schemas/fragments/address.yaml | 47 ------ .../schemas/fragments/groupIdentifier.yaml | 14 -- .../schemas/fragments/identifiers.yaml | 29 ---- .../schemas/fragments/structuredName.yaml | 25 --- .../schemas/fragments/telecom.yaml | 19 --- .../resources/GetPrescriptionStatus.yaml | 91 +++++++++++ .../schemas/resources/MedicationRequest.yaml | 114 -------------- .../schemas/resources/Organisation.yaml | 30 ---- .../schemas/resources/Practitioner.yaml | 21 --- .../schemas/resources/PractitionerRole.yaml | 26 --- .../resources/PutPrescriptionStatus.yaml | 120 ++++++++++++++ 20 files changed, 498 insertions(+), 413 deletions(-) rename packages/specification/examples/{PutPrescriptionStatus => }/Bundle/error.json (100%) create mode 100644 packages/specification/examples/Bundle/request-multiple-tasks.json rename packages/specification/examples/{PutPrescriptionStatus/Bundle/success-multiple-tasks.json => Bundle/response-multiple-tasks.json} (100%) rename packages/specification/examples/{PutPrescriptionStatus => }/Task/error.json (100%) create mode 100644 packages/specification/examples/Task/request-single-task.json rename packages/specification/examples/{PutPrescriptionStatus/Task/success-task.json => Task/response-single-task.json} (100%) create mode 100644 packages/specification/schemas/components/BundleResponse.yaml rename packages/specification/schemas/{resources/PrescriptionStatusUpdate.yaml => components/TaskResponse.yaml} (100%) delete mode 100644 packages/specification/schemas/fragments/address.yaml delete mode 100644 packages/specification/schemas/fragments/groupIdentifier.yaml delete mode 100644 packages/specification/schemas/fragments/identifiers.yaml delete mode 100644 packages/specification/schemas/fragments/structuredName.yaml delete mode 100644 packages/specification/schemas/fragments/telecom.yaml create mode 100644 packages/specification/schemas/resources/GetPrescriptionStatus.yaml delete mode 100644 packages/specification/schemas/resources/MedicationRequest.yaml delete mode 100644 packages/specification/schemas/resources/Organisation.yaml delete mode 100644 packages/specification/schemas/resources/Practitioner.yaml delete mode 100644 packages/specification/schemas/resources/PractitionerRole.yaml create mode 100644 packages/specification/schemas/resources/PutPrescriptionStatus.yaml diff --git a/packages/specification/eps-prescription-status-update-api.yaml b/packages/specification/eps-prescription-status-update-api.yaml index 05eab3e38..4f53266a6 100755 --- a/packages/specification/eps-prescription-status-update-api.yaml +++ b/packages/specification/eps-prescription-status-update-api.yaml @@ -90,16 +90,28 @@ servers: paths: /: - post: + put: operationId: prescription-status-update-bundle - summary: Post prescription status + summary: Put prescription status description: | ## Overview - Use this endpoint to post a prescription status, expressed as a FHIR Bundle. + Use this endpoint to put a prescription status, expressed as a FHIR Bundle. parameters: - $ref: "#/components/parameters/BearerAuthorisation" - $ref: "#/components/parameters/RequestID" - $ref: "#/components/parameters/CorrelationID" + requestBody: + required: true + content: + application/fhir+json: + schema: + $ref: "#/components/schemas/PutPrescriptionStatus" + examples: + multiple-tasks: + summary: multiple-tasks + description: A transaction bundle, posted to root, containing multiple Tasks + value: + $ref: examples/Bundle/request-multiple-tasks.json responses: "200": description: Successful retrieval. @@ -111,7 +123,7 @@ paths: multiple-tasks: description: A successful response to a PutPrescriptionStatus/Bundle request, containing multiple tasks. value: - $ref: "examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json" + $ref: "examples/Bundle/response-multiple-tasks.json" "4XX": description: | @@ -136,7 +148,7 @@ paths: An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/PutPrescriptionStatus/Bundle/error.json + $ref: examples/Bundle/error.json /Task: get: @@ -149,6 +161,18 @@ paths: - $ref: "#/components/parameters/BearerAuthorisation" - $ref: "#/components/parameters/RequestID" - $ref: "#/components/parameters/CorrelationID" + requestBody: + required: true + content: + application/fhir+json: + schema: + $ref: "#/components/schemas/GetPrescriptionStatus" + examples: + single-task: + summary: single-task + description: A transaction bundle, posted to root, containing multiple Tasks + value: + $ref: examples/Task/request-single-task.json responses: "200": description: Successful retrieval. @@ -160,7 +184,7 @@ paths: success-task: description: A successful response to a PutPrescriptionStatus/Task request, containing single task resource with a status update. value: - $ref: "examples/PutPrescriptionStatus/Task/success-task.json" + $ref: "examples/Task/response-single-task.json" "4XX": description: | @@ -185,7 +209,7 @@ paths: An error response to a request. Resource not found for the given NHS number. value: - $ref: examples/PutPrescriptionStatus/Task/error.json + $ref: examples/Task/error.json components: parameters: @@ -222,107 +246,56 @@ components: type: string example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA schemas: - operation-outcome: - $ref: schemas/resources/OperationOutcome.yaml - bundle-response: + PutPrescriptionStatus: type: object required: - entry - resourceType - type - description: A FHIR searchset Bundle. + description: A FHIR transaction Bundle. properties: resourceType: type: string description: FHIR resource type. default: Bundle - id: - type: string - description: Object ID for the Bundle. - example: 164996aa-29eb-4f14-a5ac-4b556a7baf6e type: type: string description: Denotes that the bundle is a list of resources returned as a result of a search. - enum: [searchset] - total: - type: number - description: | - The number of prescription bundles contained within the searchset - - Note that this excludes OperationOutcomes. + default: transaction entry: type: array description: | A collection of resources contained within the Bundle. - - Note that the presence of an OperationOutcome resource as part of the bundle implies that one - of a patient's prescriptions have been excluded from the response due to a processing error. - An OperationOutcome resource will be included for each prescription that cannot be processed. items: type: object required: - - resourceType - - identifier - - type - - entry + - fullUrl + - resource + - request description: A FHIR collection Bundle. properties: - resourceType: - type: string - description: FHIR resource type. - default: Bundle - id: - type: string - description: Object ID for the Bundle. - example: 164996aa-29eb-4f14-a5ac-4b556a7baf6e - type: + fullUrl: type: string - description: Denotes that the bundle is a collection of resources. Representing a Prescription, in this case. - enum: [collection] - entry: - type: array - description: A collection of resources contained within the Bundle. - items: - oneOf: - - $ref: "#/components/schemas/PrescriptionStatusUpdate-Resource" - - $ref: "#/components/schemas/MedicationRequest-Resource" - - $ref: "#/components/schemas/OrganisationDispensing-Resource" - - $ref: "#/components/schemas/Practitioner-Resource" - - $ref: "#/components/schemas/PractitionerRole-Resource" - - $ref: "#/components/schemas/operation-outcome" - PrescriptionStatusUpdate-Resource: - type: object - description: PrescriptionStatusUpdate - properties: - resource: - $ref: schemas/resources/PrescriptionStatusUpdate.yaml - MedicationRequest-Resource: - type: object - description: MedicationRequest - properties: - resource: - $ref: schemas/resources/MedicationRequest.yaml - OrganisationDispensing-Resource: - type: object - description: Dispensing Organisation - properties: - resource: - $ref: schemas/resources/Organisation.yaml - OrganisationPrescribing-Resource: - type: object - description: Prescribing Organisation - properties: - resource: - $ref: schemas/resources/Organisation.yaml - Practitioner-Resource: - type: object - description: Practitioner - properties: - resource: - $ref: schemas/resources/Practitioner.yaml - PractitionerRole-Resource: - type: object - description: PractitionerRole - properties: - resource: - $ref: schemas/resources/PractitionerRole.yaml + example: http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46 + resource: + $ref: "#/components/schemas/GetPrescriptionStatus" + request: + type: object + required: + - method + - url + properties: + method: + type: string + default: POST + url: + type: string + default: Task + GetPrescriptionStatus: + $ref: schemas/resources/GetPrescriptionStatus.yaml + bundle-response: + $ref: "schemas/components/BundleResponse.yaml" + task-response: + $ref: "schemas/components/TaskResponse.yaml" + operation-outcome: + $ref: schemas/resources/OperationOutcome.yaml diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/error.json b/packages/specification/examples/Bundle/error.json similarity index 100% rename from packages/specification/examples/PutPrescriptionStatus/Bundle/error.json rename to packages/specification/examples/Bundle/error.json diff --git a/packages/specification/examples/Bundle/request-multiple-tasks.json b/packages/specification/examples/Bundle/request-multiple-tasks.json new file mode 100644 index 000000000..6f9d7a968 --- /dev/null +++ b/packages/specification/examples/Bundle/request-multiple-tasks.json @@ -0,0 +1,114 @@ +{ + "resourceType": "Bundle", + "type": "transaction", + "entry": [ + { + "fullUrl": "http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46", + "resource": { + "resourceType": "Task", + "id": "4d70678c-81e4-4ff4-8c67-17596fd0aa46", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] + }, + "request": { + "method": "POST", + "url": "Task" + } + }, + { + "fullUrl": "http://example.org/fhir/Task/346d2bfe-7dc0-451b-ad0d-da81833c08da", + "resource": { + "resourceType": "Task", + "id": "346d2bfe-7dc0-451b-ad0d-da81833c08da", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "e3843418-1900-44a1-8f6a-bff8601893b8" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] + }, + "request": { + "method": "POST", + "url": "Task" + } + } + ] +} diff --git a/packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json b/packages/specification/examples/Bundle/response-multiple-tasks.json similarity index 100% rename from packages/specification/examples/PutPrescriptionStatus/Bundle/success-multiple-tasks.json rename to packages/specification/examples/Bundle/response-multiple-tasks.json diff --git a/packages/specification/examples/PutPrescriptionStatus/Task/error.json b/packages/specification/examples/Task/error.json similarity index 100% rename from packages/specification/examples/PutPrescriptionStatus/Task/error.json rename to packages/specification/examples/Task/error.json diff --git a/packages/specification/examples/Task/request-single-task.json b/packages/specification/examples/Task/request-single-task.json new file mode 100644 index 000000000..4e5c01a8d --- /dev/null +++ b/packages/specification/examples/Task/request-single-task.json @@ -0,0 +1,46 @@ +{ + "resourceType": "Task", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] +} diff --git a/packages/specification/examples/PutPrescriptionStatus/Task/success-task.json b/packages/specification/examples/Task/response-single-task.json similarity index 100% rename from packages/specification/examples/PutPrescriptionStatus/Task/success-task.json rename to packages/specification/examples/Task/response-single-task.json diff --git a/packages/specification/schemas/components/BundleResponse.yaml b/packages/specification/schemas/components/BundleResponse.yaml new file mode 100644 index 000000000..1c1cac92d --- /dev/null +++ b/packages/specification/schemas/components/BundleResponse.yaml @@ -0,0 +1,66 @@ +type: object +properties: + resourceType: + type: string + example: Bundle + id: + type: string + example: 08438419-7888-4be9-9490-37ffe202ae27 + meta: + type: object + properties: + lastUpdated: + type: string + format: date-time + example: 2024-01-30T12:01:24Z + type: + type: string + example: transaction-response + entry: + type: array + items: + type: object + properties: + response: + type: object + properties: + status: + type: string + example: 201 Created + location: + type: string + example: Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46/_history/1 + etag: + type: string + example: W/"1" + lastModified: + type: string + format: date-time + example: 2024-01-30T12:01:24Z + outcome: + type: object + properties: + resourceType: + type: string + example: OperationOutcome + meta: + type: object + properties: + lastUpdated: + type: string + format: date-time + example: 2024-01-30T12:01:24Z + issue: + type: array + items: + type: object + properties: + severity: + type: string + example: information + code: + type: string + example: informational + diagnostics: + type: string + example: No issues detected during validation diff --git a/packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml b/packages/specification/schemas/components/TaskResponse.yaml similarity index 100% rename from packages/specification/schemas/resources/PrescriptionStatusUpdate.yaml rename to packages/specification/schemas/components/TaskResponse.yaml diff --git a/packages/specification/schemas/fragments/address.yaml b/packages/specification/schemas/fragments/address.yaml deleted file mode 100644 index 41c4af9fd..000000000 --- a/packages/specification/schemas/fragments/address.yaml +++ /dev/null @@ -1,47 +0,0 @@ -type: object -properties: - use: - type: string - description: The purpose of the address. - default: work - enum: [home, work, billing, temp] - type: - type: string - description: The type of address. - default: both - enum: [postal, physical, both] - line: - type: array - description: | - All lines of the address, and optionally postal code. - Systems will apply the following formatting convention when adding or replacing addresses lines: - If any of the lines are blank, they are not returned due to FHIR conformance constraints. - items: - type: string - example: - - 1 Trevelyan Square - - Boar Lane - - City Centre - text: - type: string - description: | - A plain text string address, optionally including the postal code. - example: IVESON APPROACH, LEEDS, WEST YORKSHIRE, ENGLAND, LS16 6FR - city: - type: string - description: | - The city of the address. - Note: This will not be populated by existing prescriptions. - example: Leeds - district: - type: string - description: | - The district of the address. - Note: This will not be populated by existing prescriptions. - example: West Yorkshire - postalCode: - type: string - description: | - The postal code of the address. - Note: This is an optionally populated field. Postal code may be included in line or text if absent. - example: LS1 6AE diff --git a/packages/specification/schemas/fragments/groupIdentifier.yaml b/packages/specification/schemas/fragments/groupIdentifier.yaml deleted file mode 100644 index dbdb8c222..000000000 --- a/packages/specification/schemas/fragments/groupIdentifier.yaml +++ /dev/null @@ -1,14 +0,0 @@ -type: object -required: [value] -description: | - Prescription ID to be used by the client to generate a prescription barcode. - Can be used directly to facilitate accessing a prescription, in the event that a barcode scanner was inoperable. -properties: - system: - type: string - description: Codesystem URL for the short-form Prescription ID. - enum: [https://fhir.nhs.uk/Id/prescription-order-number] - value: - type: string - description: The short-form Prescription ID. - example: 04F4C2-A99968-7F717P diff --git a/packages/specification/schemas/fragments/identifiers.yaml b/packages/specification/schemas/fragments/identifiers.yaml deleted file mode 100644 index 8f42af27c..000000000 --- a/packages/specification/schemas/fragments/identifiers.yaml +++ /dev/null @@ -1,29 +0,0 @@ -OdsOrganisationCode: - type: object - description: The Organisation Data Service (ODS) code. - required: [system, value] - properties: - system: - type: string - description: Codesystem URL for the ODS code. - enum: [https://fhir.nhs.uk/Id/ods-organization-code] - value: - type: string - description: ODS code. - example: A83008 -NhsNumber: - type: object - required: [system, value] - properties: - system: - type: string - format: url - description: Codesystem URL for the NHS number. - enum: [https://fhir.nhs.uk/Id/nhs-number] - value: - description: | - The patient's NHS number. The primary identifier of a patient, unique within NHS England and Wales. - Always 10 digits and must be a [valid NHS number](https://www.datadictionary.nhs.uk/attributes/nhs_number.html). - type: string - pattern: "^\\d{10}$" - example: "9000000009" diff --git a/packages/specification/schemas/fragments/structuredName.yaml b/packages/specification/schemas/fragments/structuredName.yaml deleted file mode 100644 index db8a9d2ed..000000000 --- a/packages/specification/schemas/fragments/structuredName.yaml +++ /dev/null @@ -1,25 +0,0 @@ -type: object -description: A structured name -properties: - family: - type: string - description: Family name (often called Surname). - example: Smith - given: - type: array - description: Given names, including any middle names. - items: - type: string - example: John - prefix: - type: array - description: Name prefixes, titles, and prenominals. - items: - type: string - example: Dr - suffix: - type: array - description: Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. - items: - type: string - example: MD diff --git a/packages/specification/schemas/fragments/telecom.yaml b/packages/specification/schemas/fragments/telecom.yaml deleted file mode 100644 index 063dd5e49..000000000 --- a/packages/specification/schemas/fragments/telecom.yaml +++ /dev/null @@ -1,19 +0,0 @@ -type: object -required: - - use - - value -properties: - system: - description: Means of communication, such as phone or URL. - type: string - enum: [phone, URL, other] - default: phone - use: - type: string - description: Location associated with the contact details provided. - enum: [home, work, temp, mobile] - default: work - value: - description: Phone number, URL. - type: string - example: "01234567890" diff --git a/packages/specification/schemas/resources/GetPrescriptionStatus.yaml b/packages/specification/schemas/resources/GetPrescriptionStatus.yaml new file mode 100644 index 000000000..a6c0cd5f8 --- /dev/null +++ b/packages/specification/schemas/resources/GetPrescriptionStatus.yaml @@ -0,0 +1,91 @@ +type: object +properties: + resourceType: + type: string + example: Task + basedOn: + type: array + items: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-number + value: + type: string + example: 24F5DA-A83008-7EFE6Z + status: + type: string + example: in-progress + businessStatus: + type: object + properties: + coding: + type: array + items: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt + code: + type: string + format: date + example: "9001" + display: + type: string + example: Ready to Collect + intent: + type: string + example: order + focus: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-item-number + value: + type: string + example: 6989b7bd-8db6-428c-a593-4022e3044c00 + for: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/nhs-number + value: + type: string + example: "9449304130" + lastModified: + type: string + format: date-time + example: 2024-01-30T12:01:24Z + owner: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/ods-organization-code + value: + type: string + example: C9Z1O + note: + type: array + items: + type: object + properties: + text: + type: string + example: "Locker code: 556701" diff --git a/packages/specification/schemas/resources/MedicationRequest.yaml b/packages/specification/schemas/resources/MedicationRequest.yaml deleted file mode 100644 index 3e973434b..000000000 --- a/packages/specification/schemas/resources/MedicationRequest.yaml +++ /dev/null @@ -1,114 +0,0 @@ -type: object -required: - - resourceType - - identifier - - status - - intent - - medicationCodeableConcept - - subject - - requester - - groupIdentifier - - courseOfTherapyType - - dispenseRequest - - substitution -description: Information about a specific line item within a prescription. -properties: - resourceType: - type: string - description: FHIR resource type. - enum: [MedicationRequest] - status: - type: string - description: | - The status of the line item within the prescription. - Active means the item is ready to be dispensed or currently in the process of being dispensed. - Cancelled means the item has been cancelled by the prescriber. - Stopped means the item has not been issued to the patient by the dispenser. - enum: [active, cancelled, stopped] - intent: - type: string - description: The intent of a MedicationRequest object. Required by the FHIR standard but offers no patient value and can be ignored. - enum: [order, original-order, instance-order] - medicationCodeableConcept: - type: object - description: The medication prescribed to a patient. - properties: - coding: - type: array - items: - $ref: ../fragments/codes.yaml#/SnomedSctMedication - subject: - type: object - description: The NHS number of the patient the prescription is for. - properties: - identifier: - $ref: ../fragments/identifiers.yaml#/NhsNumber - requester: - type: object - description: | - The prescriber who created the prescription. - Useful if the patient or dispenser has a query about the prescription. - properties: - reference: - type: string - description: A reference to a PractitionerRole resource within the Bundle. - example: urn:uuid:56166769-c1c4-4d07-afa8-132b5dfca666 - groupIdentifier: - $ref: ../fragments/groupIdentifier.yaml - courseOfTherapyType: - type: object - description: Whether this prescription is an acute or a repeat. - properties: - coding: - type: array - items: - $ref: ../fragments/codes.yaml#/MedicationRequestCourseOfTherapy - dispenseRequest: - type: object - required: [quantity] - properties: - validityPeriod: - type: object - properties: - start: - type: string - description: The prescription's start date, could be after the precription is created for a post dated prescription. - format: date - example: "2023-06-02" - performer: - type: object - description: A reference to either the nominated dispensing organisation or the organisation currently processing the prescription if it has already been downloaded. - properties: - reference: - type: string - description: A reference to an Organisation resource within the Bundle. - example: urn:uuid:d16fe9ef-665a-4039-9e21-70bca37f8a4a - quantity: - type: object - description: The quantity of medication prescribed. - properties: - value: - type: integer - description: The numeric value of the quantity. - format: int32 - example: 20 - unit: - type: string - description: The units in which the quantity was prescribed, defined using Dictionary of Medicines and Devices (DM+D) units of measure. - example: tablet - system: - type: string - description: SNOMED codesystem URL. - enum: [http://snomed.info/sct] - code: - type: integer - description: The DM+D code associated with a given unit of measure. - example: 428673006 - substitution: - type: object - description: This is a boolean value that should always default to false because EPS does not support substitutions. - required: [allowedBoolean] - properties: - allowedBoolean: - type: boolean - enum: [false] diff --git a/packages/specification/schemas/resources/Organisation.yaml b/packages/specification/schemas/resources/Organisation.yaml deleted file mode 100644 index eeb3ede13..000000000 --- a/packages/specification/schemas/resources/Organisation.yaml +++ /dev/null @@ -1,30 +0,0 @@ -type: object -description: Details of the organisation. -properties: - resourceType: - type: string - description: FHIR resource type. - default: Organization - identifier: - type: array - description: An array containing the ODS code of the organisation. - items: - $ref: ../fragments/identifiers.yaml#/OdsOrganisationCode - name: - type: string - description: Organisation name. - address: - type: array - description: | - Organisation address. - One of line or text, and optionally postalCode, will be populated. - If postalCode is not populated, the organization's postalCode may be included in line or text, if they are populated. - So address will contain use and type, along with one of: line, line and postalCode, text, text and postalCode, postalCode. - Note: city and district will not be populated by existing prescriptions. - items: - $ref: ../fragments/address.yaml - telecom: - type: array - description: The telephone number or Website URL associated with the organisation. - items: - $ref: ../fragments/telecom.yaml diff --git a/packages/specification/schemas/resources/Practitioner.yaml b/packages/specification/schemas/resources/Practitioner.yaml deleted file mode 100644 index 9be319973..000000000 --- a/packages/specification/schemas/resources/Practitioner.yaml +++ /dev/null @@ -1,21 +0,0 @@ -type: object -required: [resourceType, name] -description: Details of the prescriber of a prescription. -properties: - resourceType: - type: string - description: FHIR resource type. - enum: [Practitioner] - name: - type: array - description: The prescriber's name. - items: - oneOf: - - $ref: ../fragments/structuredName.yaml - - type: object - description: An unstructured name - properties: - text: - type: string - description: Text representation of the full name - example: Dr John Paul Smith MD diff --git a/packages/specification/schemas/resources/PractitionerRole.yaml b/packages/specification/schemas/resources/PractitionerRole.yaml deleted file mode 100644 index 2c1aa559f..000000000 --- a/packages/specification/schemas/resources/PractitionerRole.yaml +++ /dev/null @@ -1,26 +0,0 @@ -type: object -required: - - practitioner - - organization -description: Role-specific details of the prescriber of a prescription. -properties: - resourceType: - type: string - description: FHIR resource type. - enum: [PractitionerRole] - practitioner: - type: object - description: A reference to a Practitioner resource for a given prescriber. - properties: - reference: - type: string - description: A FHIR reference object. - example: urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa47a - organization: - type: object - description: A reference to an Organization resource. - properties: - reference: - type: string - description: A FHIR reference object. - example: urn:uuid:a8c85454-f8cb-498d-9629-78e2cb5fa38b diff --git a/packages/specification/schemas/resources/PutPrescriptionStatus.yaml b/packages/specification/schemas/resources/PutPrescriptionStatus.yaml new file mode 100644 index 000000000..05873b810 --- /dev/null +++ b/packages/specification/schemas/resources/PutPrescriptionStatus.yaml @@ -0,0 +1,120 @@ +type: object +properties: + resourceType: + type: string + example: Bundle + type: + type: string + example: transaction + entry: + type: array + items: + type: object + properties: + fullUrl: + type: string + example: http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46 + resource: + type: object + properties: + resourceType: + type: string + example: Task + id: + type: string + example: 4d70678c-81e4-4ff4-8c67-17596fd0aa46 + basedOn: + type: array + items: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-number + value: + type: string + example: 24F5DA-A83008-7EFE6Z + status: + type: string + example: in-progress + businessStatus: + type: object + properties: + coding: + type: array + items: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt + code: + type: string + format: date + example: "9001" + display: + type: string + example: Ready to Collect + intent: + type: string + example: order + focus: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-item-number + value: + type: string + example: 6989b7bd-8db6-428c-a593-4022e3044c00 + for: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/nhs-number + value: + type: string + example: "9449304130" + lastModified: + type: string + format: date-time + example: 2024-01-30T12:01:24Z + owner: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/ods-organization-code + value: + type: string + example: C9Z1O + note: + type: array + items: + type: object + properties: + text: + type: string + example: "Locker code: 556701" + request: + type: object + properties: + method: + type: string + example: POST + url: + type: string + example: Task From 8f38a67a24407e1d405f5f4059bc23238151ff6a Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Wed, 21 Feb 2024 09:06:57 +0000 Subject: [PATCH 12/12] Add descriptions to the task schema --- .../eps-prescription-status-update-api.yaml | 29 ++-- .../Bundle/request-single-task-based-on.json | 118 +++++++++++++++ .../examples/Task/request-single-task.json | 86 +++++------ .../Task/response-single-task-by-id.json | 47 ++++++ .../GetPrescriptionStatusBasedOn.yaml | 142 ++++++++++++++++++ ....yaml => PutPrescriptionStatusBundle.yaml} | 0 .../resources/PutPrescriptionStatusTask.yaml | 98 ++++++++++++ 7 files changed, 464 insertions(+), 56 deletions(-) create mode 100644 packages/specification/examples/Bundle/request-single-task-based-on.json create mode 100644 packages/specification/examples/Task/response-single-task-by-id.json create mode 100644 packages/specification/schemas/resources/GetPrescriptionStatusBasedOn.yaml rename packages/specification/schemas/resources/{PutPrescriptionStatus.yaml => PutPrescriptionStatusBundle.yaml} (100%) create mode 100644 packages/specification/schemas/resources/PutPrescriptionStatusTask.yaml diff --git a/packages/specification/eps-prescription-status-update-api.yaml b/packages/specification/eps-prescription-status-update-api.yaml index 4f53266a6..bc9b31c65 100755 --- a/packages/specification/eps-prescription-status-update-api.yaml +++ b/packages/specification/eps-prescription-status-update-api.yaml @@ -105,11 +105,11 @@ paths: content: application/fhir+json: schema: - $ref: "#/components/schemas/PutPrescriptionStatus" + $ref: "#/components/schemas/PutPrescriptionStatusBundle" examples: multiple-tasks: summary: multiple-tasks - description: A transaction bundle, posted to root, containing multiple Tasks + description: A transaction bundle, posted to root, containing multiple Tasks. value: $ref: examples/Bundle/request-multiple-tasks.json responses: @@ -150,13 +150,14 @@ paths: value: $ref: examples/Bundle/error.json + /Task: - get: + put: operationId: prescription-status-update-bundle - summary: Get prescription status + summary: Put single prescription status description: | ## Overview - Use this endpoint to get a prescription status, expressed as a FHIR Bundle. + Use this endpoint to put a prescription status, expressed as a FHIR Bundle. parameters: - $ref: "#/components/parameters/BearerAuthorisation" - $ref: "#/components/parameters/RequestID" @@ -166,11 +167,11 @@ paths: content: application/fhir+json: schema: - $ref: "#/components/schemas/GetPrescriptionStatus" + $ref: "#/components/schemas/PutPrescriptionStatusTask" examples: single-task: - summary: single-task - description: A transaction bundle, posted to root, containing multiple Tasks + summary: single-tasks + description: A successful response to a PutPrescriptionStatus/Task request contains a single task resource with a status update. value: $ref: examples/Task/request-single-task.json responses: @@ -179,10 +180,10 @@ paths: content: application/fhir+json: schema: - $ref: "#/components/schemas/bundle-response" + $ref: "#/components/schemas/task-response" examples: - success-task: - description: A successful response to a PutPrescriptionStatus/Task request, containing single task resource with a status update. + single-task: + description: A successful response to a PutPrescriptionStatus/Task request, containing a single task. value: $ref: "examples/Task/response-single-task.json" @@ -246,7 +247,7 @@ components: type: string example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA schemas: - PutPrescriptionStatus: + PutPrescriptionStatusBundle: type: object required: - entry @@ -278,7 +279,7 @@ components: type: string example: http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46 resource: - $ref: "#/components/schemas/GetPrescriptionStatus" + $ref: "#/components/schemas/PutPrescriptionStatusTask" request: type: object required: @@ -291,6 +292,8 @@ components: url: type: string default: Task + PutPrescriptionStatusTask: + $ref: schemas/resources/PutPrescriptionStatusTask.yaml GetPrescriptionStatus: $ref: schemas/resources/GetPrescriptionStatus.yaml bundle-response: diff --git a/packages/specification/examples/Bundle/request-single-task-based-on.json b/packages/specification/examples/Bundle/request-single-task-based-on.json new file mode 100644 index 000000000..94db07767 --- /dev/null +++ b/packages/specification/examples/Bundle/request-single-task-based-on.json @@ -0,0 +1,118 @@ +{ + "resourceType": "Bundle", + "id": "155e1102-9e71-4f19-9453-b905c0bbc494", + "meta": { + "lastUpdated": "2024-01-31T13:01:24Z" + }, + "type": "searchset", + "link": [ + { + "relation": "self", + "url": "/Task?based-on=24F5DA-A83008-7EFE6Z" + } + ], + "total": 2, + "entry": [ + { + "fullUrl": "urn:uuid:4d70678c-81e4-4ff4-8c67-17596fd0aa46", + "search": { + "mode": "match" + }, + "resource": { + "resourceType": "Task", + "id": "4d70678c-81e4-4ff4-8c67-17596fd0aa46", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] + } + }, + { + "fullUrl": "urn:uuid:0cb82cfa-76c8-4fb2-a08e-bf0e326e5487", + "search": { + "mode": "match" + }, + "resource": { + "resourceType": "Task", + "id": "cb82cfa-76c8-4fb2-a08e-bf0e326e5487", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "completed", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9004", + "display": "Collected" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-31T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + } + } + } + ] +} diff --git a/packages/specification/examples/Task/request-single-task.json b/packages/specification/examples/Task/request-single-task.json index 4e5c01a8d..5d8f20a95 100644 --- a/packages/specification/examples/Task/request-single-task.json +++ b/packages/specification/examples/Task/request-single-task.json @@ -1,46 +1,46 @@ { - "resourceType": "Task", - "basedOn": [ - { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-number", - "value": "24F5DA-A83008-7EFE6Z" - } - } - ], - "status": "in-progress", - "businessStatus": { - "coding": [ - { - "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", - "code": "9001", - "display": "Ready to Collect" - } - ] - }, - "intent": "order", - "focus": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", - "value": "6989b7bd-8db6-428c-a593-4022e3044c00" - } - }, - "for": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "9449304130" - } - }, - "lastModified": "2024-01-30T12:01:24Z", - "owner": { - "identifier": { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "C9Z1O" - } - }, - "note": [ - { - "text": "Locker code: 556701" - } + "resourceType": "Task", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] } diff --git a/packages/specification/examples/Task/response-single-task-by-id.json b/packages/specification/examples/Task/response-single-task-by-id.json new file mode 100644 index 000000000..3a9961789 --- /dev/null +++ b/packages/specification/examples/Task/response-single-task-by-id.json @@ -0,0 +1,47 @@ +{ + "resourceType": "Task", + "id": "4d70678c-81e4-4ff4-8c67-17596fd0aa46", + "basedOn": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-number", + "value": "24F5DA-A83008-7EFE6Z" + } + } + ], + "status": "in-progress", + "businessStatus": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt", + "code": "9001", + "display": "Ready to Collect" + } + ] + }, + "intent": "order", + "focus": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/prescription-order-item-number", + "value": "6989b7bd-8db6-428c-a593-4022e3044c00" + } + }, + "for": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9449304130" + } + }, + "lastModified": "2024-01-30T12:01:24Z", + "owner": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "C9Z1O" + } + }, + "note": [ + { + "text": "Locker code: 556701" + } + ] +} diff --git a/packages/specification/schemas/resources/GetPrescriptionStatusBasedOn.yaml b/packages/specification/schemas/resources/GetPrescriptionStatusBasedOn.yaml new file mode 100644 index 000000000..f27f271ff --- /dev/null +++ b/packages/specification/schemas/resources/GetPrescriptionStatusBasedOn.yaml @@ -0,0 +1,142 @@ +type: object +properties: + resourceType: + type: string + example: Bundle + id: + type: string + example: 155e1102-9e71-4f19-9453-b905c0bbc494 + meta: + type: object + properties: + lastUpdated: + type: string + format: date-time + example: 2024-01-31T13:01:24Z + type: + type: string + example: searchset + link: + type: array + items: + type: object + properties: + relation: + type: string + example: self + url: + type: string + example: /Task?based-on=24F5DA-A83008-7EFE6Z + total: + type: integer + format: int32 + example: 2 + entry: + type: array + items: + type: object + properties: + fullUrl: + type: string + example: urn:uuid:4d70678c-81e4-4ff4-8c67-17596fd0aa46 + search: + type: object + properties: + mode: + type: string + example: match + resource: + type: object + properties: + resourceType: + type: string + example: Task + id: + type: string + example: 4d70678c-81e4-4ff4-8c67-17596fd0aa46 + basedOn: + type: array + items: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-number + value: + type: string + example: 24F5DA-A83008-7EFE6Z + status: + type: string + example: in-progress + businessStatus: + type: object + properties: + coding: + type: array + items: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt + code: + type: string + format: date + example: "9001" + display: + type: string + example: Ready to Collect + intent: + type: string + example: order + focus: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-item-number + value: + type: string + example: 6989b7bd-8db6-428c-a593-4022e3044c00 + for: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/nhs-number + value: + type: string + example: "9449304130" + lastModified: + type: string + format: date-time + example: 2024-01-30T12:01:24Z + owner: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/ods-organization-code + value: + type: string + example: C9Z1O + note: + type: array + items: + type: object + properties: + text: + type: string + example: "Locker code: 556701" diff --git a/packages/specification/schemas/resources/PutPrescriptionStatus.yaml b/packages/specification/schemas/resources/PutPrescriptionStatusBundle.yaml similarity index 100% rename from packages/specification/schemas/resources/PutPrescriptionStatus.yaml rename to packages/specification/schemas/resources/PutPrescriptionStatusBundle.yaml diff --git a/packages/specification/schemas/resources/PutPrescriptionStatusTask.yaml b/packages/specification/schemas/resources/PutPrescriptionStatusTask.yaml new file mode 100644 index 000000000..1f1bd9507 --- /dev/null +++ b/packages/specification/schemas/resources/PutPrescriptionStatusTask.yaml @@ -0,0 +1,98 @@ +type: object +properties: + resourceType: + type: string + example: Task + basedOn: + type: array + description: Short-form Prescription ID for the parent prescription. + items: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-number + value: + type: string + example: 24F5DA-A83008-7EFE6Z + status: + type: string + description: Indicator to identify when the prescription id status is a terminal status, one for which no further patient action is required. If the prescription item status is a terminal status, the Task.status value must be set to 'completed', otherwise the value must be set to 'in-progress'. + example: in-progress + businessStatus: + type: object + description: "The tracking status for the prescription id. Updates should only be provided when the prescription id is 'ready to collect' in which case the status value will be 'ready to collect', or when the patient has received the prescription item and there are no more actions for the patient, in this case the status value could be 'Collected' or 'Dispatched'. The dispensing system may update the prescription item status with any of the following values to correct a status update which has been made in error or where the status has since reverted: 'With Pharmacy', 'Ready to collect', 'Collected' or 'Dispatched'. Note: The 'With Pharmacy' status can be determined using the EPS record status for business as usual processing and is not required from the dispensing system unless the status needs to be rolled back." + properties: + coding: + type: array + items: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/CodeSystem/task-businessStatus-nppt + code: + type: string + format: date + example: "9001" + display: + type: string + example: Ready to Collect + intent: + type: string + example: order + focus: + type: object + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/prescription-order-item-number + value: + type: string + example: 6989b7bd-8db6-428c-a593-4022e3044c00 + for: + type: object + description: The patient's NHS number. The primary identifier of a patient, unique within NHS England and Wales. Always 10 digits and must be a valid NHS number. + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/nhs-number + value: + type: string + example: "9449304130" + lastModified: + type: string + description: Date and time when the prescription item status was updated. + format: date-time + example: 2024-01-30T12:01:24Z + owner: + type: object + description: ODS organisation code for the pharmacy that is processing the prescription. + properties: + identifier: + type: object + properties: + system: + type: string + example: https://fhir.nhs.uk/Id/ods-organization-code + value: + type: string + example: C9Z1O + note: + type: array + description: Enables dispensing systems to provide supplementary information relating to the prescription item status update. + items: + type: object + properties: + text: + type: string + example: "Locker code: 556701"