Skip to content

Commit

Permalink
AEA-3816 Create Prescription Status Update API specification (#12)
Browse files Browse the repository at this point in the history
## Summary

🎫 [AEA-3816](https://nhsd-jira.digital.nhs.uk/browse/AEA-3816) Create
Prescription Status Update API specification

- Routine Change
- 🤖 Operational or Infrastructure Change

### Details

Create Prescription Status Update API specification
  • Loading branch information
kris-szlapa authored Feb 26, 2024
1 parent 2cac2c8 commit 7b17b79
Show file tree
Hide file tree
Showing 18 changed files with 1,054 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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; \
Expand Down
8 changes: 0 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
114 changes: 114 additions & 0 deletions packages/specification/examples/Bundle/request-multiple-tasks.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
}
]
}
22 changes: 22 additions & 0 deletions packages/specification/examples/Task/error.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Loading

0 comments on commit 7b17b79

Please sign in to comment.