Skip to content

Commit

Permalink
AEA-3808 Add Prescription Status message schema to API Specification (#8
Browse files Browse the repository at this point in the history
)

## Summary

:ticket: [AEA-3808](https://nhsd-jira.digital.nhs.uk/browse/AEA-3808)
Add Prescription Status message schema to API Specification

- Routine Change

### Details
The changes to the Prescription Status Update API specification
  • Loading branch information
kris-szlapa authored Feb 23, 2024
1 parent f28c6e6 commit 7b40495
Show file tree
Hide file tree
Showing 22 changed files with 357 additions and 702 deletions.
120 changes: 40 additions & 80 deletions packages/specification/eps-prescription-status-update-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ servers:
paths:

/:
put:
post:
operationId: prescription-status-update-bundle
summary: Put prescription status
summary: Update prescription status
description: |
## Overview
Use this endpoint to put a prescription status, expressed as a FHIR Bundle.
Use this endpoint to update a prescription status, expressed as a FHIR Bundle.
parameters:
- $ref: "#/components/parameters/BearerAuthorisation"
- $ref: "#/components/parameters/RequestID"
Expand All @@ -105,87 +105,49 @@ paths:
content:
application/fhir+json:
schema:
$ref: "#/components/schemas/PutPrescriptionStatusBundle"
$ref: "#/components/schemas/PostPrescriptionStatusBundle"
examples:
request-ready-to-collect:
summary: request-ready-to-collect
description: A request message contains tracking status ready to collect.
value:
$ref: examples/request-ready-to-collect.json
request-ready-to-collect-note:
summary: request-ready-to-collect-note
description: A request message contains tracking status ready to collect with note.
value:
$ref: examples/request-ready-to-collect-note.json
collected:
summary: collected
description: A request message contains tracking status collected.
value:
$ref: examples/request-collected.json
dispatched:
summary: dispatched
description: A request message contains tracking status dispatched.
value:
$ref: examples/request-dispatched.json
multiple-tasks:
summary: multiple-tasks
description: A transaction bundle, posted to root, containing multiple Tasks.
description: A request message contains multiple items.
value:
$ref: examples/Bundle/request-multiple-tasks.json
$ref: examples/request-multiple-items.json
responses:
"200":
description: Successful retrieval.
content:
application/fhir+json:
schema:
$ref: "#/components/schemas/bundle-response"
examples:
multiple-tasks:
description: A successful response to a PutPrescriptionStatus/Bundle request, containing multiple tasks.
value:
$ref: "examples/Bundle/response-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.json


/Task:
put:
operationId: prescription-status-update-bundle
summary: Put single prescription status
description: |
## Overview
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/PutPrescriptionStatusTask"
examples:
single-task:
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:
"200":
description: Successful retrieval.
content:
application/fhir+json:
schema:
$ref: "#/components/schemas/task-response"
examples:
single-task:
description: A successful response to a PutPrescriptionStatus/Task request, containing a single task.
description: A successful response to a UpdatePrescriptionStatus request, contains a single item.
value:
$ref: "examples/response-single-task.json"
multiple-tasks:
description: A successful response to a UpdatePrescriptionStatus request, contains multiple items.
value:
$ref: "examples/Task/response-single-task.json"
$ref: "examples/response-multiple-items.json"

"4XX":
description: |
Expand All @@ -208,9 +170,9 @@ paths:
example:
description: |
An error response to a request.
Resource not found for the given NHS number.
ODS code already in use.
value:
$ref: examples/Task/error.json
$ref: examples/error.json

components:
parameters:
Expand Down Expand Up @@ -247,7 +209,7 @@ components:
type: string
example: 11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA
schemas:
PutPrescriptionStatusBundle:
PostPrescriptionStatusBundle:
type: object
required:
- entry
Expand Down Expand Up @@ -279,7 +241,7 @@ components:
type: string
example: http://example.org/fhir/Task/4d70678c-81e4-4ff4-8c67-17596fd0aa46
resource:
$ref: "#/components/schemas/PutPrescriptionStatusTask"
$ref: "#/components/schemas/PostPrescriptionStatusTask"
request:
type: object
required:
Expand All @@ -292,13 +254,11 @@ components:
url:
type: string
default: Task
PutPrescriptionStatusTask:
$ref: schemas/resources/PutPrescriptionStatusTask.yaml
GetPrescriptionStatus:
$ref: schemas/resources/GetPrescriptionStatus.yaml
PostPrescriptionStatusTask:
$ref: schemas/resources/PostPrescriptionStatusTask.yaml
bundle-response:
$ref: "schemas/components/BundleResponse.yaml"
$ref: "schemas/components/MultipleResponse.yaml"
task-response:
$ref: "schemas/components/TaskResponse.yaml"
$ref: "schemas/components/SingleResponse.yaml"
operation-outcome:
$ref: schemas/resources/OperationOutcome.yaml
21 changes: 0 additions & 21 deletions packages/specification/examples/Bundle/error.json

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions packages/specification/examples/Task/error.json

This file was deleted.

46 changes: 0 additions & 46 deletions packages/specification/examples/Task/request-single-task.json

This file was deleted.

Loading

0 comments on commit 7b40495

Please sign in to comment.