diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6eb6ace61..340d0fd0a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -31,7 +31,7 @@ RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3; \ echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc; \ echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc; -ENV PATH="$PATH:/home/vscode/.asdf/bin/:/workspaces/eps-prescription-status-update/node_modules/.bin" +ENV PATH="$PATH:/home/vscode/.asdf/bin/:/workspaces/eps-prescription-status-update-api/node_modules/.bin" # Install ASDF plugins @@ -43,8 +43,8 @@ RUN asdf plugin add python; \ asdf plugin add actionlint; -WORKDIR /workspaces/eps-prescription-status-update -ADD .tool-versions /workspaces/eps-prescription-status-update/.tool-versions +WORKDIR /workspaces/eps-prescription-status-update-api +ADD .tool-versions /workspaces/eps-prescription-status-update-api/.tool-versions ADD .tool-versions /home/vscode/.tool-versions RUN asdf install; \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f5d8bafa5..5c7139847 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,14 +14,6 @@ "source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind", "source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind" ], - // Features to add to the dev container. More info: https://containers.dev/features. - "features": { - "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { - "version": "latest", - "moby": "true", - "installDockerBuildx": "true" - } - }, "customizations": { "vscode": { "extensions": [ diff --git a/.vscode/eps-prescription-tracking-service.code-workspace b/.vscode/eps-prescription-status-update-api.code-workspace similarity index 100% rename from .vscode/eps-prescription-tracking-service.code-workspace rename to .vscode/eps-prescription-status-update-api.code-workspace diff --git a/README.md b/README.md index 2d0afa61e..2c7b9e1d0 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The contents of this repository are protected by Crown Copyright (C). The GitHub Actions require a secret to exist on the repo called "SONAR_TOKEN". This can be obtained from [SonarCloud](https://sonarcloud.io/) as described [here](https://docs.sonarsource.com/sonarqube/latest/user-guide/user-account/generating-and-using-tokens/). -You will need the "Execute Analysis" permission for the project (NHSDigital_eps-prescription-tracking-service) in order for the token to work. +You will need the "Execute Analysis" permission for the project (NHSDigital_eps-prescription-status-update-api) in order for the token to work. ### Pre-commit hooks 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/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/Bundle/response-multiple-tasks.json b/packages/specification/examples/Bundle/response-multiple-tasks.json new file mode 100644 index 000000000..488c6ae86 --- /dev/null +++ b/packages/specification/examples/Bundle/response-multiple-tasks.json @@ -0,0 +1,52 @@ +{ + "resourceType": "Bundle", + "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" + } + ] + } + } + }, + { + "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" + } + ] + } + } + } + ] +} diff --git a/packages/specification/examples/Task/error.json b/packages/specification/examples/Task/error.json new file mode 100644 index 000000000..4b08391d5 --- /dev/null +++ b/packages/specification/examples/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/Task/request-single-task.json b/packages/specification/examples/Task/request-single-task.json new file mode 100644 index 000000000..5d8f20a95 --- /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/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/examples/Task/response-single-task.json b/packages/specification/examples/Task/response-single-task.json new file mode 100644 index 000000000..c62eae2e5 --- /dev/null +++ b/packages/specification/examples/Task/response-single-task.json @@ -0,0 +1,13 @@ +{ + "resourceType": "OperationOutcome", + "meta": { + "lastUpdated": "2024-01-30T12:01:24Z" + }, + "issue": [ + { + "severity": "information", + "code": "informational", + "diagnostics": "No issues detected during validation" + } + ] +} 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/components/TaskResponse.yaml b/packages/specification/schemas/components/TaskResponse.yaml new file mode 100644 index 000000000..05873b810 --- /dev/null +++ b/packages/specification/schemas/components/TaskResponse.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 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/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/PutPrescriptionStatusBundle.yaml b/packages/specification/schemas/resources/PutPrescriptionStatusBundle.yaml new file mode 100644 index 000000000..05873b810 --- /dev/null +++ b/packages/specification/schemas/resources/PutPrescriptionStatusBundle.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 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" diff --git a/sonar-project.properties b/sonar-project.properties index 57fe3252c..a1c76f0b0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ sonar.organization=nhsdigital -sonar.projectKey=NHSDigital_eps-prescription-tracking-service +sonar.projectKey=NHSDigital_eps-prescription-status-update-api sonar.host.url=https://sonarcloud.io sonar.coverage.exclusions=**/*.test.*,**/jest.config.ts,scripts/*,packages/common/testing/*