Skip to content

Commit f8abefc

Browse files
kevinmason-nhsTomKinghorn
authored andcommitted
422 response for A042 endpoint
1 parent c5952cb commit f8abefc

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"resourceType": "OperationOutcome",
3+
"meta": {
4+
"lastUpdated": "2022-03-01T10:00:00.42Z"
5+
},
6+
"issue": [
7+
{
8+
"severity": "error",
9+
"code": "invalid",
10+
"details": {
11+
"coding": [
12+
{
13+
"system": "https://fhir.nhs.uk/CodeSystem/ers-error-codes",
14+
"code": "PENDING"
15+
}
16+
]
17+
},
18+
"diagnostics": "The file is being scanned and cannot be retrieved. Wait at least 5 minutes before checking its availability again."
19+
}
20+
]
21+
}

specification/components/r4/schemas/endpoints/a042-retrieve-attachment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ description: |
2929
- `SERVICE_PROVIDER_CLINICIAN_ADMIN`
3030
3131
### Attachment availability
32-
To use this endpoint, the attachment must be available for download. Attachments are only available after successful validation and malware scans. A request to retrieve an attachment that is not available for download will result in a 400 error. See the Response HTTP 400 section for further information.
32+
To use this endpoint, the attachment must be available for download. Attachments are only available after successful validation and malware scans. A request to retrieve an attachment that is not available for download will result in a 422 error. See the Response HTTP 422 section for further information.
3333
3434
The availability status of an attachment can be retrieved via any endpoint that provides details of an attachment in the success response. Details of the availability statuses that may be returned via these endpoints can be found in the specification for [[HYPERLINK_A005]].
3535
@@ -100,6 +100,8 @@ responses:
100100
$ref: '../responses/ForbiddenOrNoLR.yaml'
101101
'404':
102102
$ref: '../responses/NotFound.yaml'
103+
'422':
104+
$ref: '../responses/retrieveAttachment/422Response.yaml'
103105
'429':
104106
$ref: '../responses/TooManyRequests.yaml'
105107
'500':
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
description: |
2+
Where status code 422 (Unprocessable Entity) is returned then an [NHSDigital-OperationOutcome](https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome) will be included in the body, as detailed below.
3+
Check diagnostics property for specific information regarding the error.
4+
5+
| issue.details.coding.code | issue.code | Coding System | Description |
6+
| ------------------------- | ---------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7+
| PENDING | invalid | [eRS Error Code](https://fhir.nhs.uk/CodeSystem/ers-error-codes) | The file is being scanned and cannot be retrieved. Wait at least 5 minutes before checking its availability again. |
8+
| THREATS_FOUND | invalid | [eRS Error Code](https://fhir.nhs.uk/CodeSystem/ers-error-codes) | The file has been quarantined after detecting a threat and cannot be retrieved. Contact the organisation that uploaded the file to resolve the issue and get the information you need. Details of who uploaded the file can be retrieved via any endpoint that provides details of an attachment in the success response (via the [[HYPERLINK_A005]] or [[HYPERLINK_A024]] endpoints, for example)|
9+
| VALIDATION_FAILED | invalid | [eRS Error Code](https://fhir.nhs.uk/CodeSystem/ers-error-codes) | The file has failed validation and cannot be retrieved. Contact the organisation that uploaded the file to resolve the issue and get the information you need. Details of who uploaded a file can be retrieved via any endpoint that provides details of an attachment in the success response (via the [[HYPERLINK_A005]] or [[HYPERLINK_A024]] endpoints, for example)<br>Validation can fail because the:<ul><li>content type of the file is not supported</li><li>content type of the file does not correlate with the file extension</li><li>file provided is too large and is not supported by e-RS. Note, this indicates that the file size is larger than the system supports as a whole, not the 5MB limit associated with this endpoint</ul> |
10+
headers:
11+
x-correlation-id:
12+
$ref: '../../headers/response/CorrelationID.yaml'
13+
x-request-id:
14+
$ref: '../../headers/response/RequestID.yaml'
15+
Content-Type:
16+
$ref: '../../headers/response/ContentTypeFhirJson.yaml'
17+
content:
18+
application/fhir+json:
19+
schema:
20+
$ref: '../../NHSDigital-OperationOutcome.yaml'
21+
example:
22+
$ref: '../../../examples/NHSDigital-OperationOutcome-422.json'

0 commit comments

Comments
 (0)