This document provides some JSON examples to aid with re-integration of consumers to breaking API changes for patient records brought about by NDMS-1984.
Included are happy path before/after examples for common cases:
- With and without NHS Number
- Read and write payloads
- With and without explicit reason for missing NHS Number
as well as some canonical invalid payloads.
This document is provided to supplement the written explanation of changes found in the description of NDMS-1985 and the full before and after specifications attached.
{
"identifiers": [
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": "0123456789",
"created_by": null,
},
{
"type": "0e5913f3-3e8f-41c5-90c1-589a89c0921e", // localid
"value": "abcdef",
"created_by": null,
},
]
}
{
"identifiers": [
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": "0123456789",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null,
},
{
"type": "0e5913f3-3e8f-41c5-90c1-589a89c0921e", // localid
"value": "abcdef",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null,
},
]
}
{
"identifiers": [
{
"type": "0e5913f3-3e8f-41c5-90c1-589a89c0921e", // localid
"value": "abcdef",
"created_by": null
}
]
}
{
"identifiers": [
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": null,
"created_by": null,
"missing_reason": "5acbc0c5-f3ba-47db-8a68-602009cdab2e", // foetalpatient
"missing_reason_description": null
},
{
"type": "0e5913f3-3e8f-41c5-90c1-589a89c0921e", // localid
"value": "abcdef",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null
}
]
}
OR
{
"identifiers": [
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": null,
"created_by": null,
"missing_reason": "163923c9-0553-413f-9c27-23a06eefa345", // other
"missing_reason_description": "This Patient's NHS number has not yet been entered in SPINE"
},
{
"type": "0e5913f3-3e8f-41c5-90c1-589a89c0921e", // localid
"value": "abcdef",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null
}
]
}
{
"identifiers": [
{
"type": {
"uid": "0ad2397c-a8b3-4962-901a-8e9892a41f14",
"codesystem_uri": "identifier_type",
"code": "nhsnumber",
"display": "NHS Number"
},
"value": "0123456789",
"created_by": null
},
{
"type": {
"uid": "0e5913f3-3e8f-41c5-90c1-589a89c0921e",
"codesystem_uri": "identifier_type",
"code": "localid",
"display": "Local Identifier"
},
"value": "abcdef",
"created_by": null
}
]
}
{
"identifiers": [
{
"type": {
"uid": "0ad2397c-a8b3-4962-901a-8e9892a41f14",
"codesystem_uri": "identifier_type",
"code": "nhsnumber",
"display": "NHS Number"
},
"value": "0123456789",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null
},
{
"type": {
"uid": "0e5913f3-3e8f-41c5-90c1-589a89c0921e",
"codesystem_uri": "identifier_type",
"code": "localid",
"display": "Local Identifier"
},
"value": "abcdef",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null
}
]
}
{
"identifiers": [
{
"type": {
"uid": "0e5913f3-3e8f-41c5-90c1-589a89c0921e",
"codesystem_uri": "identifier_type",
"code": "localid",
"display": "Local Identifier"
},
"value": "abcdef",
"created_by": null
}
]
}
{
"identifiers": [
{
"type": {
"uid": "0ad2397c-a8b3-4962-901a-8e9892a41f14",
"codesystem_uri": "identifier_type",
"code": "nhsnumber",
"display": "NHS Number",
},
"value": null,
"created_by": null,
"missing_reason": {
"uid": "e4f5f51a-b14b-42e5-9073-a23aeb853420",
"codesystem_uri": "identifier_missing_reason",
"code": "foetal_patient",
"display": "Foetal Patient"
},
"missing_reason_description": null
},
{
"type": {
"uid": "0e5913f3-3e8f-41c5-90c1-589a89c0921e",
"codesystem_uri": "identifier_type",
"code": "localid",
"display": "Local Identifier",
},
"value": "abcdef",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null
}
]
}
OR
{
"identifiers": [
{
"type": {
"uid": "0ad2397c-a8b3-4962-901a-8e9892a41f14",
"codesystem_uri": "identifier_type",
"code": "nhsnumber",
"display": "NHS Number",
},
"value": null,
"created_by": null,
"missing_reason": {
"uid": "e4f5f51a-b14b-42e5-9073-a23aeb853420",
"codesystem_uri": "identifier_missing_reason",
"code": "other",
"display": "Other"
},
"missing_reason_description": "This Patient's NHS number has not yet been entered in SPINE"
},
{
"type": {
"uid": "0e5913f3-3e8f-41c5-90c1-589a89c0921e",
"codesystem_uri": "identifier_type",
"code": "localid",
"display": "Local Identifier",
},
"value": "abcdef",
"created_by": null,
"missing_reason": null,
"missing_reason_description": null
}
]
}
The following NHS Number Identifiers are invalid and will result in a 400 Bad Request:
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": null,
"created_by": null,
"missing_reason": null,
"missing_reason_description": null
} // ERROR: Must provide one of `value` or `missing_reason` for NHS Number
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": null,
"created_by": null,
"missing_reason": "5acbc0c5-f3ba-47db-8a68-602009cdab2e", // foetalpatient
"missing_reason_description": "This is a foetal patient" // ERROR: Dont provide `missing_reason_description`` if `missing_reason` is not "Other"
}
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": "0123456789",
"created_by": null,
"missing_reason": "5acbc0c5-f3ba-47db-8a68-602009cdab2e", // ERROR: Dont provide `missing_reason` if providing a value
"missing_reason_description": null
}
{
"type": "0ad2397c-a8b3-4962-901a-8e9892a41f14", // nhsnumber
"value": null,
"created_by": null,
"missing_reason": "e4f5f51a-b14b-42e5-9073-a23aeb853420", // Other
"missing_reason_description": null // ERROR: Must provide a description it missing reason is Other
}