Skip to content

Commit 857e32b

Browse files
authored
VED-942 Modify the update endpoint documentation (#1081)
1 parent ea57c65 commit 857e32b

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ publish: clean
3232
cp build/immunisation-fhir-api.json sandbox/
3333
cp -r specification sandbox/specification
3434

35+
make serve: publish
36+
npm run serve
37+
3538
#Creates a minified OAS spec in JSON for sending to APIM
3639
oas: publish
3740
mkdir -p oas

README.specification.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ There are `make` commands that alias some of this functionality:
5555

5656
- `lint` -- Lints the spec and code
5757
- `publish` -- Outputs the specification as a **single** JSON file into the `build/` directory
58+
- `serve` -- Serves a preview of the API document locally
5859

5960
### Modifying the OAS file
6061

6162
Note that the master OAS file is now the **YAML** version, as it is far easier to maintain than the JSON.
6263

63-
To review your modifications, use Swagger Editor (https://editor.swagger.io).
64+
To review your modifications, use Swagger Editor (https://editor.swagger.io). Or, alternatively, use the `make serve` command.
6465

6566
### Update the OAS file to the public website
6667

azure/templates/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ steps:
44
npm run publish 2> /dev/null
55
cp build/immunisation-fhir-api.json sandbox/
66
7-
cd sandbox
7+
cd sandbox
88
docker build -t sandbox .
99
displayName: Build sandbox image
1010
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)"

infrastructure/proxies/sandbox/apiproxy/policies/AssignMessage.AddCors.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<Set>
55
<Headers>
66
<Header name="Access-Control-Allow-Origin">{request.header.origin}</Header>
7-
<Header name="Access-Control-Allow-Headers">origin, x-requested-with, accept, content-type, nhsd-session-urid, X-Request-Id, X-Correlation-Id, Location</Header>
8-
<Header name="Access-Control-Expose-Headers">origin, x-requested-with, accept, content-type, nhsd-session-urid, X-Request-Id, X-Correlation-Id, Location</Header>
7+
<Header name="Access-Control-Allow-Headers">origin, x-requested-with, accept, content-type, e-tag, nhsd-session-urid, X-Request-Id, X-Correlation-Id, Location</Header>
8+
<Header name="Access-Control-Expose-Headers">origin, x-requested-with, accept, content-type, e-tag, nhsd-session-urid, X-Request-Id, X-Correlation-Id, Location</Header>
99
<Header name="Access-Control-Max-Age">3628800</Header>
1010
<Header name="Access-Control-Allow-Methods">GET, PUT, POST, DELETE</Header>
1111
</Headers>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"format-check": "prettier --check .",
99
"publish": "redocly bundle specification/immunisation-fhir-api.yaml --remove-unused-components --ext json -o build/immunisation-fhir-api.json",
1010
"check-licenses": "node_modules/.bin/license-checker --failOn GPL --failOn LGPL",
11-
"prepare": "husky"
11+
"prepare": "husky",
12+
"serve": "redocly preview --project-dir ./build"
1213
},
1314
"author": "NHS Digital",
1415
"license": "MIT",

specification/immunisation-fhir-api.yaml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,26 +2207,22 @@ paths:
22072207
description: >
22082208
## Overview
22092209
2210-
This interaction allows you to add a new updated record of a vaccination
2211-
event. Update replaces the full immunization resource, so you must
2212-
provide all data fields, not just the change (Patch is not currently
2213-
supported). You may obtain all the current data for the vaccination
2214-
event using the read interaction, which will also return an eTag for the
2215-
version.
2210+
The Update Immunization endpoint allows you to update or reinstate a vaccination event.
22162211
2212+
- You must provide the full FHIR immunization in the request body. (Patch is not currently
2213+
supported, so it is not possible to just provide the updated fields.)
22172214
2218-
You may use update to re-instate a deleted record, but our update
2219-
interaction does not support creating a new vaccination event where one
2220-
does not currently exist.
2215+
- You may need to first retrieve the existing vaccination record using the GET endpoint, which
2216+
will also return an E-Tag header for the resource version. When performing an update, the E-Tag
2217+
header must match the current resource version for the resource you are updating.
22212218
2219+
- The `id` and `identifier` in the request body and the `id` in the path parameters must match
2220+
the existing record for an update to succeed.
22222221
2223-
You must not change the identifier when updating a vaccination event.
2224-
The identifier is used as a primary identifier by downstream systems.
2225-
2226-
2227-
You must be authorised for update interaction and the disease type
2228-
associated with the vaccination event in order to update the record.
2222+
- You may also use this endpoint to reinstate a deleted record.
22292223
2224+
- Finally, you must be authorised for the update interaction and the vaccination type of the
2225+
existing record in order for the update to succeed.
22302226
22312227
## Sandbox testing
22322228
@@ -4610,6 +4606,7 @@ components:
46104606
description: >
46114607
Specific procedures, disorders, diseases, infections or
46124608
organisms.
4609+
example: FLU
46134610
enum:
46144611
- 3IN1
46154612
- COVID
@@ -4714,6 +4711,7 @@ components:
47144711
required: true
47154712
schema:
47164713
type: string
4714+
example: FLU
47174715
enum:
47184716
- 3IN1
47194717
- COVID

0 commit comments

Comments
 (0)