You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification/validated-relationships-service-api.yaml
+49-2Lines changed: 49 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -478,7 +478,28 @@ paths:
478
478
479
479
post:
480
480
summary: Create a new FHIR Consent resource
481
-
description: Create a new Consent resource for RelatedPerson access
481
+
description: |
482
+
## Overview
483
+
Use this endpoint to create a new proxy relationship between a patient and a related person (proxy). The request must include the necessary details about the relationship, evidence of responsibility, and requested access level.
484
+
485
+
## Request Requirements
486
+
* The performer must be specified using a valid NHS Number
487
+
* The patient must be specified using a valid NHS Number
488
+
* Evidence of responsibility must be provided (e.g., birth certificate for parental relationships)
489
+
* The requested access level must be specified
490
+
* For child proxy requests, the child's age must be under 16
491
+
* For adult proxy requests, evidence of capacity assessment may be required
492
+
493
+
## Sandbox test scenarios
494
+
| Scenario | Request | Response |
495
+
| -------- | ------- | -------- |
496
+
| Successful parent-child proxy creation | Valid request with parental relationship and birth certificate evidence | HTTP Status 201 and Bundle containing created Consent resource |
497
+
| Successful adult-adult proxy creation | Valid request with appropriate relationship and evidence | HTTP Status 201 and Bundle containing created Consent resource |
498
+
| Invalid performer NHS number | Request with invalid NHS number format | HTTP Status 400 and INVALID_NHS_NUMBER error response |
499
+
| Missing required evidence | Request without evidence of responsibility | HTTP Status 422 and MISSING_EVIDENCE error response |
500
+
| Invalid access level | Request with undefined access level code | HTTP Status 400 and INVALID_ACCESS_LEVEL error response |
501
+
| Patient age validation failure | Request for child proxy where child is over 16 | HTTP Status 422 and INVALID_PATIENT_AGE error response |
502
+
| Duplicate relationship | Request for relationship that already exists | HTTP Status 409 and DUPLICATE_RELATIONSHIP error response |
482
503
requestBody:
483
504
required: true
484
505
content:
@@ -637,7 +658,33 @@ paths:
637
658
638
659
patch:
639
660
summary: Update an existing Consent resource
640
-
description: Modify a Consent resource using FHIR patch operation
661
+
description: | ## Overview
662
+
Use this endpoint to update an existing proxy relationship. This can be used to modify the status, access levels, or other attributes of the relationship. The update is performed using JSON Patch operations.
663
+
664
+
Common update scenarios include:
665
+
* Changing the status of a relationship
666
+
* Modifying access levels
667
+
* Adding or updating verification information
668
+
* Updating the validity period
669
+
* Adding or removing specific provisions
670
+
671
+
## Request Requirements
672
+
* The Consent resource must exist and be identified by a valid identifier
673
+
* JSON Patch operations must be valid according to RFC 6902
674
+
* Status changes must use valid status codes from http://hl7.org/fhir/consent-state-codes
675
+
* Access level changes must use valid codes from the NHS proxy access level system
676
+
677
+
## Sandbox test scenarios
678
+
| Scenario | Request | Response |
679
+
| -------- | ------- | -------- |
680
+
| Successful status update | Valid patch changing status to 'active' | HTTP Status 200 and updated Bundle |
681
+
| Successful access level update | Valid patch modifying access provisions | HTTP Status 200 and updated Bundle |
682
+
| Multiple valid changes | Valid patch with multiple operations | HTTP Status 200 and updated Bundle |
683
+
| Invalid patch format | Malformed JSON patch document | HTTP Status 400 and INVALID_PATCH_FORMAT error response |
684
+
| Invalid path | Patch targeting non-existent element | HTTP Status 400 and INVALID_PATCH_PATH error response |
685
+
| Invalid status code | Patch with invalid status value | HTTP Status 422 and INVALID_STATUS_CODE error response |
686
+
| Resource not found | Patch for non-existent Consent | HTTP Status 404 and RESOURCE_NOT_FOUND error response |
687
+
| Invalid state transition | Patch attempting invalid status change | HTTP Status 422 and INVALID_STATE_TRANSITION error response |
0 commit comments