From 1e1e4ca2385f8d7acd8bb0bbc8d06415fe68e528 Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 11:22:06 +0100 Subject: [PATCH 1/9] NPA-5063 Add RelatedPerson Patient Details Component --- .../validated-relationships-service-api.yaml | 91 ++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index da2fba21..d69c0ee2 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -89,7 +89,7 @@ info: ## Headers This API is case-insensitive when processing request headers, meaning it will accept headers regardless of the letter casing used. (e.g. X-Request-Id, x-request-id are treated the same). When sending headers back in the response, we preserve the exact casing as received in the original request. - + ## Errors We use standard HTTP status codes to show whether an API request succeeded or not. They are usually in the range: @@ -1808,7 +1808,7 @@ components: An empty bundle suggests that no candidate proxy/patient links were identified. items: anyOf: - - $ref: "#/components/schemas/RelatedPersonBundleEntry" + - $ref: "#/components/schemas/RelatedPersonPatientDetailsBundleEntry" - $ref: "#/components/schemas/PatientBundleEntry" ConsentBundle: @@ -1828,6 +1828,16 @@ components: - $ref: "#/components/schemas/PatientBundleEntry" - $ref: "#/components/schemas/ConsentBundleEntry" + RelatedPersonPatientDetailsBundleEntry: + type: object + description: A RelatedPerson bundle entry with patient name and birthDate. + $ref: "#/components/schemas/RelatedPersonBundleEntry" + properties: + name: + $ref: "#/components/schemas/PDSName" + birthDate: + $ref: "#/components/schemas/PDSBirthDate" + RelatedPersonBundleEntry: type: object description: A RelatedPerson bundle entry. @@ -2338,6 +2348,83 @@ components: items: type: object + PDSName: + type: array + description: List of names associated with the patient. + items: + type: object + required: + - use + - family + additionalProperties: false + properties: + id: + type: string + description: Unique object identifier for this name. + use: + type: string + description: | + How this name should be used. + * usual - Known as, conventional or the one patient normally uses. A patient always has a usual name. + * temp - An alias or temporary name. This may also be used for temporary names assigned at birth or in emergency situations. + * nickname - A name that the patient prefers to be addressed by, but is not part of their usual name. + * old - This name is no longer in use (or was never correct, but retained for records). + * maiden - Name changed for Marriage. A name used prior to changing name because of marriage. This term is not gender specific. The use of this term does not imply any particular history for a person's name. + + The following use codes are included in the [name-use](https://www.hl7.org/fhir/valueset-name-use.html) value set, but should not be used and is not be returned as part of a retrieval. + * official - The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". + * anonymous - Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons). + enum: [usual, temp, nickname, old, maiden] + period: + type: object + description: | + Business effective period when the name was, is, or will be in use. + required: + - start + properties: + start: + type: string + format: date + description: Start date of time period, if known, in format `yyyy-mm-dd`. Can be a future date. + end: + type: string + format: date + description: End date of time period, if known and if not ongoing, in format `yyyy-mm-dd`. Can be a future date. + given: + type: array + maxItems: 5 + description: | + Given names, including any middle names. + + Each name(s) should be a separate item in the list. The first given name may include multiple names, separated by a space. + Subsequent names must be broken down into list items. For example, the input `[Jane Marie Anne, Jo Adele]` returns `[Jane Marie Anne, Jo, Adele]`. + + items: + type: string + maxLength: 35 + family: + type: string + maxLength: 35 + description: Family name (often called Surname). + prefix: + type: array + description: Name prefixes, titles, and prenominals. + items: + type: string + suffix: + type: array + description: Name suffices and postnominals. + items: + type: string + + PDSBirthDate: + description: | + The date on which the patient was born or is officially deemed to have been born. + + It is a date in the format `yyyy-mm-dd`. Due to data quality issues on a small number of patients `yyyy-mm` and `yyyy` format may also be returned. + type: string + format: date + parameters: RelatedPersonIdentifier: in: query From 0be34f71be1e3d306e0edee6952288280f9c2785 Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 11:30:16 +0100 Subject: [PATCH 2/9] NPA-5063 Move additional resources to deeper location --- .../validated-relationships-service-api.yaml | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index d69c0ee2..30cae603 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -1829,14 +1829,19 @@ components: - $ref: "#/components/schemas/ConsentBundleEntry" RelatedPersonPatientDetailsBundleEntry: - type: object - description: A RelatedPerson bundle entry with patient name and birthDate. - $ref: "#/components/schemas/RelatedPersonBundleEntry" - properties: - name: - $ref: "#/components/schemas/PDSName" - birthDate: - $ref: "#/components/schemas/PDSBirthDate" + allOf: + - $ref: "#/components/schemas/RelatedPersonBundleEntry" + - type: object + description: A RelatedPerson bundle entry with patient name and birthDate. + properties: + resource: + $ref: "#/components/schemas/RelatedPerson" + properties: + properties: + name: + $ref: "#/components/schemas/PDSName" + birthDate: + $ref: "#/components/schemas/PDSBirthDate" RelatedPersonBundleEntry: type: object From 1b991a417d05946b60339fdbe82452471b22735b Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 11:49:07 +0100 Subject: [PATCH 3/9] NPA-5063 Update schema structure --- .../validated-relationships-service-api.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 30cae603..32839bcb 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -1835,13 +1835,14 @@ components: description: A RelatedPerson bundle entry with patient name and birthDate. properties: resource: - $ref: "#/components/schemas/RelatedPerson" - properties: - properties: - name: - $ref: "#/components/schemas/PDSName" - birthDate: - $ref: "#/components/schemas/PDSBirthDate" + allOf: + - $ref: "#/components/schemas/RelatedPerson" + - type: object + properties: + name: + $ref: "#/components/schemas/PDSName" + birthDate: + $ref: "#/components/schemas/PDSBirthDate" RelatedPersonBundleEntry: type: object From b6a35dab3ea69b90af7ae4599a5fced9a643901e Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 11:55:32 +0100 Subject: [PATCH 4/9] NPA-5063 Disable Additional Resources --- specification/validated-relationships-service-api.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 32839bcb..1fe89b01 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -1835,6 +1835,7 @@ components: description: A RelatedPerson bundle entry with patient name and birthDate. properties: resource: + additionalProperties: false allOf: - $ref: "#/components/schemas/RelatedPerson" - type: object From 925cdc0eae3fa0e659cef83053009a1184efecb5 Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 12:04:26 +0100 Subject: [PATCH 5/9] NPA-5063 Remove Duplicate Patient Spec Component --- .../validated-relationships-service-api.yaml | 75 +------------------ 1 file changed, 2 insertions(+), 73 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 1fe89b01..18421b98 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -2018,80 +2018,9 @@ components: type: string description: The NHS number. name: - type: array - description: List of names associated with the patient. - items: - type: object - required: - - use - - family - additionalProperties: false - properties: - id: - type: string - description: Unique object identifier for this name. - use: - type: string - description: | - How this name should be used. - * usual - Known as, conventional or the one patient normally uses. A patient always has a usual name. - * temp - An alias or temporary name. This may also be used for temporary names assigned at birth or in emergency situations. - * nickname - A name that the patient prefers to be addressed by, but is not part of their usual name. - * old - This name is no longer in use (or was never correct, but retained for records). - * maiden - Name changed for Marriage. A name used prior to changing name because of marriage. This term is not gender specific. The use of this term does not imply any particular history for a person's name. - - The following use codes are included in the [name-use](https://www.hl7.org/fhir/valueset-name-use.html) value set, but should not be used and is not be returned as part of a retrieval. - * official - The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". - * anonymous - Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons). - enum: [usual, temp, nickname, old, maiden] - period: - type: object - description: | - Business effective period when the name was, is, or will be in use. - required: - - start - properties: - start: - type: string - format: date - description: Start date of time period, if known, in format `yyyy-mm-dd`. Can be a future date. - end: - type: string - format: date - description: End date of time period, if known and if not ongoing, in format `yyyy-mm-dd`. Can be a future date. - given: - type: array - maxItems: 5 - description: | - Given names, including any middle names. - - Each name(s) should be a separate item in the list. The first given name may include multiple names, separated by a space. - Subsequent names must be broken down into list items. For example, the input `[Jane Marie Anne, Jo Adele]` returns `[Jane Marie Anne, Jo, Adele]`. - - items: - type: string - maxLength: 35 - family: - type: string - maxLength: 35 - description: Family name (often called Surname). - prefix: - type: array - description: Name prefixes, titles, and prenominals. - items: - type: string - suffix: - type: array - description: Name suffices and postnominals. - items: - type: string + $ref: "#/components/schemas/PDSName" birthDate: - description: | - The date on which the patient was born or is officially deemed to have been born. - - It is a date in the format `yyyy-mm-dd`. Due to data quality issues on a small number of patients `yyyy-mm` and `yyyy` format may also be returned. - type: string - format: date + $ref: "#/components/schemas/PDSBirthDate" generalPractitioner: type: array description: Patient's nominated primary care provider, each a Reference(Organization | Practitioner | PractitionerRole). From 50b35b5f208b436534145944648f21989953f099 Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 12:13:42 +0100 Subject: [PATCH 6/9] NPA-5063Update examples with new values --- .../list_relationship_9000000017.yaml | 22 ++++++++++++++++ .../list_relationship_9000000017_include.yaml | 22 ++++++++++++++++ .../verify_relationship_9000000009.yaml | 25 +++++++++++++------ ...erify_relationship_9000000009_include.yaml | 15 +++++++++-- .../verify_relationship_9000000025.yaml | 11 ++++++++ ...erify_relationship_9000000025_include.yaml | 11 ++++++++ 6 files changed, 97 insertions(+), 9 deletions(-) diff --git a/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017.yaml b/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017.yaml index c96f5603..3019805f 100644 --- a/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017.yaml +++ b/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017.yaml @@ -10,6 +10,7 @@ ListRelationship9000000017: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 resource: id: BE974742 + birthDate: '2017-09-23' identifier: - system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' @@ -18,6 +19,16 @@ ListRelationship9000000017: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000009' type: Patient + name: + - family: MOGAJI + given: + - GADIL + id: BLnbA + period: + start: '2021-07-08' + prefix: + - MR + use: usual relationship: - coding: - code: MTH @@ -29,6 +40,7 @@ ListRelationship9000000017: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2 resource: id: A3CC67E2 + birthDate: '2018-04-27' identifier: - system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' @@ -37,6 +49,16 @@ ListRelationship9000000017: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000025' type: Patient + name: + - family: FEARON + given: + - Daren + id: vitjN + period: + start: '2018-09-21' + prefix: + - MR + use: usual relationship: - coding: - code: MTH diff --git a/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017_include.yaml b/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017_include.yaml index c795bb44..67f5b7d0 100644 --- a/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017_include.yaml +++ b/specification/examples/responses/GET_RelatedPerson/list_relationship_9000000017_include.yaml @@ -31,6 +31,7 @@ ListRelationship9000000017Include: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 resource: id: BE974742 + birthDate: '2017-09-23' identifier: - system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' @@ -39,6 +40,16 @@ ListRelationship9000000017Include: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000009' type: Patient + name: + - family: MOGAJI + given: + - GADIL + id: BLnbA + period: + start: '2021-07-08' + prefix: + - MR + use: usual relationship: - coding: - code: MTH @@ -70,6 +81,7 @@ ListRelationship9000000017Include: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2 resource: id: A3CC67E2 + birthDate: '2018-04-27' identifier: - system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' @@ -78,6 +90,16 @@ ListRelationship9000000017Include: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000025' type: Patient + name: + - family: FEARON + given: + - Daren + id: vitjN + period: + start: '2018-09-21' + prefix: + - MR + use: usual relationship: - coding: - code: MTH diff --git a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009.yaml b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009.yaml index 16fac258..f95de2d3 100644 --- a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009.yaml +++ b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009.yaml @@ -13,19 +13,30 @@ VerifyRelationship9000000009: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 resource: id: BE974742 + birthDate: '2017-09-23' identifier: - - system: https://fhir.nhs.uk/Id/nhs-number - value: '9000000017' + - system: https://fhir.nhs.uk/Id/nhs-number + value: '9000000009' patient: identifier: system: https://fhir.nhs.uk/Id/nhs-number - value: '9000000009' + value: '9000000017' type: Patient + name: + - family: MOGAJI + given: + - GADIL + id: BLnbA + period: + start: '2021-07-08' + prefix: + - MR + use: usual relationship: - - coding: - - code: MTH - display: mother - system: http://terminology.hl7.org/CodeSystem/v3-RoleCode + - coding: + - code: MTH + display: mother + system: http://terminology.hl7.org/CodeSystem/v3-RoleCode resourceType: RelatedPerson search: mode: match diff --git a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009_include.yaml b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009_include.yaml index 8121141b..84d13469 100644 --- a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009_include.yaml +++ b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000009_include.yaml @@ -38,14 +38,25 @@ VerifyRelationship9000000009Include: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 resource: id: BE974742 + birthDate: '2017-09-23' identifier: - system: https://fhir.nhs.uk/Id/nhs-number - value: '9000000017' + value: '9000000009' patient: identifier: system: https://fhir.nhs.uk/Id/nhs-number - value: '9000000009' + value: '9000000017' type: Patient + name: + - family: MOGAJI + given: + - GADIL + id: BLnbA + period: + start: '2021-07-08' + prefix: + - MR + use: usual relationship: - coding: - code: MTH diff --git a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025.yaml b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025.yaml index 02d12084..3229101f 100644 --- a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025.yaml +++ b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025.yaml @@ -10,6 +10,7 @@ VerifyRelationship9000000025: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2 resource: id: A3CC67E2 + birthDate: '2018-04-27' identifier: - system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' @@ -18,6 +19,16 @@ VerifyRelationship9000000025: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000025' type: Patient + name: + - family: FEARON + given: + - Daren + id: vitjN + period: + start: '2018-09-21' + prefix: + - MR + use: usual relationship: - coding: - code: MTH diff --git a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025_include.yaml b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025_include.yaml index 3f7ac83b..fa4bcd2b 100644 --- a/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025_include.yaml +++ b/specification/examples/responses/GET_RelatedPerson/verify_relationship_9000000025_include.yaml @@ -31,6 +31,7 @@ VerifyRelationship9000000025Include: - fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2 resource: id: A3CC67E2 + birthDate: '2018-04-27' identifier: - system: https://fhir.nhs.uk/Id/nhs-number value: '9000000017' @@ -39,6 +40,16 @@ VerifyRelationship9000000025Include: system: https://fhir.nhs.uk/Id/nhs-number value: '9000000025' type: Patient + name: + - family: FEARON + given: + - Daren + id: vitjN + period: + start: '2018-09-21' + prefix: + - MR + use: usual relationship: - coding: - code: MTH From 232e69793fdf3f49719991caffd58eddec92804d Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 13:38:09 +0100 Subject: [PATCH 7/9] NPA-5063 Improve Schema Validator Job --- .github/workflows/openapi-validate.yml | 9 ++++++--- specification/validated-relationships-service-api.yaml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/openapi-validate.yml b/.github/workflows/openapi-validate.yml index bd8f9521..56b350ef 100644 --- a/.github/workflows/openapi-validate.yml +++ b/.github/workflows/openapi-validate.yml @@ -1,12 +1,15 @@ -name: Open API Validate -"on": +name: OpenAPI Validate Examples + +on: pull_request: branches: [master] + permissions: contents: read + jobs: ExamplesSchemasChecks: - name: Examples Schemas Checks + name: Check ${{ matrix.endpoint.name }} Examples runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 18421b98..67b3884c 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -1829,13 +1829,13 @@ components: - $ref: "#/components/schemas/ConsentBundleEntry" RelatedPersonPatientDetailsBundleEntry: + type: object allOf: - $ref: "#/components/schemas/RelatedPersonBundleEntry" - type: object description: A RelatedPerson bundle entry with patient name and birthDate. properties: resource: - additionalProperties: false allOf: - $ref: "#/components/schemas/RelatedPerson" - type: object From aee5c118fc60a5a33fec9e7e47db161c170e8ebd Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 15:16:30 +0100 Subject: [PATCH 8/9] NPA-5063 Update Component Name --- specification/validated-relationships-service-api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 67b3884c..6ceda027 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -1808,7 +1808,7 @@ components: An empty bundle suggests that no candidate proxy/patient links were identified. items: anyOf: - - $ref: "#/components/schemas/RelatedPersonPatientDetailsBundleEntry" + - $ref: "#/components/schemas/RelatedPersonWithDetailsBundleEntry" - $ref: "#/components/schemas/PatientBundleEntry" ConsentBundle: @@ -1828,7 +1828,7 @@ components: - $ref: "#/components/schemas/PatientBundleEntry" - $ref: "#/components/schemas/ConsentBundleEntry" - RelatedPersonPatientDetailsBundleEntry: + RelatedPersonWithDetailsBundleEntry: type: object allOf: - $ref: "#/components/schemas/RelatedPersonBundleEntry" From daa15117113c27f248beb0bf114dc263ce70949d Mon Sep 17 00:00:00 2001 From: github-actions <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 29 May 2025 16:22:58 +0100 Subject: [PATCH 9/9] NPA-5063 Fix Display Value --- specification/validated-relationships-service-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 6ceda027..8151955a 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -1986,7 +1986,7 @@ components: - "mother" - "parent" - "Personal relationship with the patient" - - "Child" + - "child" Patient: type: object