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/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 diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index da2fba21..8151955a 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/RelatedPersonWithDetailsBundleEntry" - $ref: "#/components/schemas/PatientBundleEntry" ConsentBundle: @@ -1828,6 +1828,23 @@ components: - $ref: "#/components/schemas/PatientBundleEntry" - $ref: "#/components/schemas/ConsentBundleEntry" + RelatedPersonWithDetailsBundleEntry: + type: object + allOf: + - $ref: "#/components/schemas/RelatedPersonBundleEntry" + - type: object + description: A RelatedPerson bundle entry with patient name and birthDate. + properties: + resource: + allOf: + - $ref: "#/components/schemas/RelatedPerson" + - type: object + properties: + name: + $ref: "#/components/schemas/PDSName" + birthDate: + $ref: "#/components/schemas/PDSBirthDate" + RelatedPersonBundleEntry: type: object description: A RelatedPerson bundle entry. @@ -1969,7 +1986,7 @@ components: - "mother" - "parent" - "Personal relationship with the patient" - - "Child" + - "child" Patient: type: object @@ -2001,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). @@ -2338,6 +2284,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