-
Notifications
You must be signed in to change notification settings - Fork 3
NPA-5191: Update POST QuestionnaireResponse DUPLICATE_RELATIONSHIP #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LeoKHoward
merged 6 commits into
master
from
task/NPA-5191/update-oas-postman-duplicate-relationship
Jul 3, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0750f0b
NPA-5191: Update POST QuestionnaireResponse DUPLICATE_RELATIONSHIP
LeoKHoward b1b3636
NPA-5191: Add new test
LeoKHoward 08ac996
NPA-5191: Formatting fix
LeoKHoward 4b86e60
NPA-5191: EB suggestions
LeoKHoward 242673a
NPA-5191: Formatting in test
LeoKHoward 93683bb
NPA-5191: Update Postman URL
LeoKHoward File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
specification/examples/requests/POST_QuestionnaireResponse/duplicate_relationship.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| QuestionnaireResponseDuplicateRelationship: | ||
| summary: Duplicate relationship request | ||
| description: | | ||
| Example proxy access request that triggers a 409 DUPLICATE_RELATIONSHIP error due to an existing proxy role with NHS number `9000000049` requesting access to act on behalf of a patient (Jill Jones) with NHS number `9000000006`. | ||
|
|
||
| Significant details to point out: | ||
|
|
||
| - `source.type` should be `RelatedPerson` when a proxy is applying | ||
| - `source.identifier.value` should be the NHS number of the user completing the form - this should correlate with the Identity token in the request | ||
| - `subject.type` should be `Patient` since it is the patient that is the subject of the application | ||
| - `subject.identifier.value` should be the NHS Number of the patient to which the application relates | ||
| - `patient` demographics are present in the request as a result of being provided by the applicant | ||
| value: | ||
| resourceType: "QuestionnaireResponse" | ||
| status: "completed" | ||
| authored: "2024-07-15T09:43:03.280Z" | ||
| source: | ||
| type: "RelatedPerson" | ||
| identifier: | ||
| system: "https://fhir.nhs.uk/Id/nhs-number" | ||
| value: "9000000049" | ||
| subject: | ||
| type: "Patient" | ||
| identifier: | ||
| system: "https://fhir.nhs.uk/Id/nhs-number" | ||
| value: "9000000006" | ||
| questionnaire: "https://api.service.nhs.uk/validated-relationships/FHIR/R4/Questionnaire/01dc6813-3421-4d14-948d-a4888241add1" | ||
| item: | ||
| - linkId: "relatedPerson" | ||
| text: "Proxy details" | ||
| item: | ||
| - linkId: "relatedPerson_identifier" | ||
| text: "NHS number" | ||
| answer: | ||
| - valueString: "9000000049" | ||
| - linkId: "relatedPerson_basisForAccess" | ||
| text: "Basis for Access" | ||
| answer: | ||
| - valueCoding: | ||
| system: "https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole" | ||
| code: "Personal" | ||
| display: "Personal relationship with the patient" | ||
| - linkId: "relatedPerson_relationship" | ||
| text: "Relationship" | ||
| answer: | ||
| - valueCoding: | ||
| system: "http://terminology.hl7.org/CodeSystem/v3-RoleCode" | ||
| code: "SPS" | ||
| display: "Spouse" | ||
| - linkId: "patient" | ||
| text: "Patient details" | ||
| item: | ||
| - linkId: "patient_identifier" | ||
| text: "NHS number" | ||
| answer: | ||
| - valueString: "9000000006" | ||
| - linkId: "patient_name" | ||
| text: "Name" | ||
| item: | ||
| - linkId: "patient_name_first" | ||
| text: "First name" | ||
| answer: | ||
| - valueString: "Jill" | ||
| - linkId: "patient_name_family" | ||
| text: "Last name" | ||
| answer: | ||
| - valueString: "Jones" | ||
| - linkId: "patient_birthDate" | ||
| text: "Date of birth" | ||
| answer: | ||
| - valueDate: "1965-01-01" | ||
| - linkId: "requestedAccess" | ||
| text: "Requested access" | ||
| item: | ||
| - linkId: "requestedAccess_accessLevel" | ||
| text: "Requested access level" | ||
| answer: | ||
| - valueCoding: | ||
| system: "https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess" | ||
| code: "APPT" | ||
| display: "Appointment Booking" | ||
| - valueCoding: | ||
| system: "https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-RequestedAccess" | ||
| code: "VACC" | ||
| display: "Vaccination Records" | ||
| - linkId: "requestedAccess_reasonsForAccess" | ||
| text: "Reason for access" | ||
| answer: | ||
| - valueCoding: | ||
| system: "https://fhir.nhs.uk/CodeSystem/Proxy-Placeholder-ReasonForAccess" | ||
| code: "PRAC" | ||
| display: "Practical Reasons" |
15 changes: 15 additions & 0 deletions
15
...on/examples/responses/POST_QuestionnaireResponse/errors/duplicate_relationship_error.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| PostQuestionnaireResponseDuplicateRelationshipError: | ||
| summary: Duplicate request for proxy role that already exists | ||
| description: Error response for a duplicate proxy role | ||
| value: | ||
| issue: | ||
| - code: invalid | ||
| diagnostics: "Proxy role already exists." | ||
| details: | ||
| coding: | ||
| - code: "DUPLICATE_RELATIONSHIP" | ||
| display: "Request must be for a new proxy role." | ||
| system: "https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode" | ||
| version: '1' | ||
| severity: error | ||
| resourceType: "OperationOutcome" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.