Skip to content

Commit 5d06916

Browse files
committed
add unique error response for search by identifier
1 parent c6deaa5 commit 5d06916

File tree

1 file changed

+55
-23
lines changed

1 file changed

+55
-23
lines changed

specification/immunisation-fhir-api.json

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,18 +1692,29 @@
16921692
"get": {
16931693
"summary": "Search immunisations by record identifier",
16941694
"operationId": "searchImmunizationByIdentifier",
1695-
"description": "Use this interaction to find Immunization records by their unique identifier assigned by the submitting system. Provide the composite FHIR search parameter `identifier` as `<system>|<value>`, for example: `identifier=https://supplierABC/identifiers/vacc|e2154d29-1ead-4830-a513-0d59705078fa`. This returns a Bundle of matching Immunization resources",
1695+
"description": "Use this interaction to find Immunization records by their unique identifier assigned by the submitting system. Provide the composite FHIR search parameter `identifier` as `<system>|<value>`, for example: `identifier=https://supplierABC/identifiers/vacc|e2154d29-1ead-4830-a513-0d59705078fa`. This returns a Bundle of matching Immunization resources.",
16961696
"parameters": [
1697-
{ "$ref": "#/components/parameters/CorrelationID" },
1698-
{ "$ref": "#/components/parameters/RequestID" },
1699-
{ "$ref": "#/components/parameters/Identifier" },
1700-
{ "$ref": "#/components/parameters/Include" }
1697+
{
1698+
"$ref": "#/components/parameters/CorrelationID"
1699+
},
1700+
{
1701+
"$ref": "#/components/parameters/RequestID"
1702+
},
1703+
{
1704+
"$ref": "#/components/parameters/Identifier"
1705+
},
1706+
{
1707+
"$ref": "#/components/parameters/Include"
1708+
}
17011709
],
17021710
"responses": {
17031711
"200": {
1704-
"description": "Search immunisation operation successful",
1712+
"description": "Search immunisation by identifier operation successful",
17051713
"content": {
17061714
"application/fhir+json": {
1715+
"schema": {
1716+
"$ref": "#/paths/~1Immunization/get/responses/200/content/application~1fhir+json/schema"
1717+
},
17071718
"example": {
17081719
"resourceType": "Bundle",
17091720
"type": "searchset",
@@ -1719,7 +1730,9 @@
17191730
"resource": {
17201731
"resourceType": "Immunization",
17211732
"id": "191f288a-17f3-4cd5-a33c-a52aade6473c",
1722-
"meta": { "versionId": "1" },
1733+
"meta": {
1734+
"versionId": "1"
1735+
},
17231736
"extension": [
17241737
{
17251738
"url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-VaccinationProcedure",
@@ -1836,21 +1849,6 @@
18361849
]
18371850
},
18381851
"search": { "mode": "match" }
1839-
},
1840-
{
1841-
"fullUrl": "urn:uuid:a7a5bc28-5831-4158-8a73-0d3e6e43c1ac",
1842-
"resource": {
1843-
"resourceType": "Patient",
1844-
"id": "9449306206",
1845-
"identifier": [
1846-
{
1847-
"system": "https://fhir.nhs.uk/Id/nhs-number",
1848-
"value": "9449306206"
1849-
}
1850-
],
1851-
"birthDate": "2014-03-25"
1852-
},
1853-
"search": { "mode": "include" }
18541852
}
18551853
],
18561854
"total": 1
@@ -1859,7 +1857,7 @@
18591857
}
18601858
},
18611859
"4XX": {
1862-
"$ref": "#/components/responses/4XX-imms-search"
1860+
"$ref": "#/components/responses/400-imms-search-by-identifier"
18631861
}
18641862
}
18651863
}
@@ -3604,6 +3602,40 @@
36043602
}
36053603
}
36063604
},
3605+
"400-imms-search-by-identifier": {
3606+
"description": "Below are examples of potential HTTP 400 responses specific to the search-by-identifier interaction.\n\n| HTTP status | Error code | Description | Example |\n| ----------- | ---------- | ----------- | ------- |\n| 400 | Bad Request | Missing identifier parameter | {\"resourceType\":\"OperationOutcome\",\"id\":\"2d4b2d7c-6c5e-4e3a-8f0d-4e6d9bdc3e5a\",\"meta\":{\"profile\":[\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]},\"issue\":[{\"severity\":\"error\",\"code\":\"invalid\",\"details\":{\"coding\":[{\"system\":\"https://fhir.nhs.uk/Codesystem/http-error-codes\",\"code\":\"INVALID\"}]},\"diagnostics\":\"Search parameter identifier must have one value.\"}]} |\n| 400 | Bad Request | Invalid value for identifier | {\"resourceType\":\"OperationOutcome\",\"id\":\"3c5e8a1f-2f61-4a9c-8f5e-615e8ea5d9a0\",\"meta\":{\"profile\":[\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]},\"issue\":[{\"severity\":\"error\",\"code\":\"invalid\",\"details\":{\"coding\":[{\"system\":\"https://fhir.nhs.uk/Codesystem/http-error-codes\",\"code\":\"INVALID\"}]},\"diagnostics\":\"identifier must be in the format of \\\"<system>|<value>\\\" e.g. \\\"https://supplierABC/identifiers/vacc|e2154d29-1ead-4830-a513-0d59705078fa\\\"\"}]} |\n| 400 | Bad Request | Conflicting search parameters | {\"resourceType\":\"OperationOutcome\",\"id\":\"1a7f4b9c-54b0-4a4d-8b2a-9f3f6a2b7cde\",\"meta\":{\"profile\":[\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]},\"issue\":[{\"severity\":\"error\",\"code\":\"invalid\",\"details\":{\"coding\":[{\"system\":\"https://fhir.nhs.uk/Codesystem/http-error-codes\",\"code\":\"INVALID\"}]},\"diagnostics\":\"When using 'identifier', do not supply patient.identifier, -immunization.target, -date.from or -date.to.\"}]} |\n",
3607+
"content": {
3608+
"application/fhir+json": {
3609+
"schema": {
3610+
"$ref": "#/components/schemas/OperationOutcome"
3611+
},
3612+
"example": {
3613+
"resourceType": "OperationOutcome",
3614+
"id": "3c5e8a1f-2f61-4a9c-8f5e-615e8ea5d9a0",
3615+
"meta": {
3616+
"profile": [
3617+
"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome"
3618+
]
3619+
},
3620+
"issue": [
3621+
{
3622+
"severity": "error",
3623+
"code": "invalid",
3624+
"details": {
3625+
"coding": [
3626+
{
3627+
"system": "https://fhir.nhs.uk/Codesystem/http-error-codes",
3628+
"code": "INVALID"
3629+
}
3630+
]
3631+
},
3632+
"diagnostics": "identifier must be in the format of \"<system>|<value>\" e.g. \"https://supplierABC/identifiers/vacc|e2154d29-1ead-4830-a513-0d59705078fa\""
3633+
}
3634+
]
3635+
}
3636+
}
3637+
}
3638+
},
36073639
"4XX-imms-read": {
36083640
"description": "Below are examples of potential HTTP status codes and their associated error codes, which could be returned in the event of a fault.\n\n| HTTP status | Error code | Description | Example |\n| ----------- | -------------------------- | --------------------------------------------- |--------------------------------------------------------------------------------------|\n| 400 | Bad Request | Missing immunization event identifier (id) | {\"resourceType\": \"OperationOutcome\", \"id\": \"438f5c0d-f89d-46ec-b4ba-c08dc5a44ff3\", \"meta\": {\"profile\": [\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]}, \"issue\": [{\"severity\": \"error\", \"code\": \"invalid\", \"details\": {\"coding\": [{\"system\": \"https://fhir.nhs.uk/Codesystem/http-error-codes\", \"code\": \"INVALID\"}]}, \"diagnostics\": \"the provided event ID is either missing or not in the expected format.\"}]} |\n| 401 | Unauthorized | Authorization is required for the interaction that was attempted | {\"resourceType\":\"OperationOutcome\",\"id\":\"a5abca2a-4eda-41da-b2cc-95d48c6b791d\",\"meta\":{\"profile\":[\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]},\"issue\":[{\"severity\":\"error\",\"code\":\"expired\",\"details\":{\"coding\":[{\"system\":\"https://fhir.nhs.uk/Codesystem/http-error-codes\",\"code\":\"SEND_UNAUTHORIZED\"}]},\"diagnostics\":\"The sender has not provided a token or it has expired or is otherwise invalid.\"}]} |\n| 403 | Forbidden | The sender does not have permissions to access this resource | {\"resourceType\":\"OperationOutcome\",\"id\":\"a5abca2a-4eda-41da-b2cc-95d48c6b791d\",\"meta\":{\"profile\":[\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]},\"issue\":[{\"severity\":\"error\",\"code\":\"forbidden\",\"details\":{\"coding\":[{\"system\":\"https://fhir.nhs.uk/Codesystem/http-error-codes\",\"code\":\"SEND_UNAUTHORIZED\"}]},\"diagnostics\":\"The sender does not have permissions to access this resource. Please check your credentials and permissions.\"}]} |\n| 403 | Forbidden | The sender does not have permission for the specific operation or vaccine type | {\"resourceType\": \"OperationOutcome\", \"id\": \"1b7eec0a-316f-4f6e-a342-4b37f6705050\", \"meta\": {\"profile\": [\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]}, \"issue\": [{\"severity\": \"error\", \"code\": \"forbidden\", \"details\": {\"coding\": [{\"system\": \"https://fhir.nhs.uk/Codesystem/http-error-codes\", \"code\": \"FORBIDDEN\"}]}, \"diagnostics\": \"Unauthorized request for vaccine type\"}]} |\n| 404 | Not Found | Unrecognized immunization event identifier (id) | {\"resourceType\": \"OperationOutcome\", \"id\": \"5b51e331-5f9c-442f-a4c3-b5f52a1ba83e\", \"meta\": {\"profile\": [\"https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome\"]}, \"issue\": [{\"severity\": \"error\", \"code\": \"not-found\", \"details\": {\"coding\": [{\"system\": \"https://fhir.nhs.uk/Codesystem/http-error-codes\", \"code\": \"NOT-FOUND\"}]}, \"diagnostics\": \"The requested resource was not found.\"}]} |\n",
36093641
"content": {

0 commit comments

Comments
 (0)