Skip to content

Commit e5b261f

Browse files
committed
Resolve PR comments, move patch to a route param endpoint
1 parent f8c5f5b commit e5b261f

File tree

1 file changed

+33
-55
lines changed

1 file changed

+33
-55
lines changed

specification/validated-relationships-service-api.yaml

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ info:
1818
1919
- get verified relationships (to support decision making when granting proxy access)
2020
- create a new proxy access request
21-
- get proxy relationships
21+
- get proxy roles
2222
2323
In the future you will be able to:
2424
@@ -352,7 +352,7 @@ paths:
352352

353353
/Consent:
354354
get:
355-
summary: Get proxy relationships
355+
summary: Get proxy roles
356356
description: |
357357
## Overview
358358
Use this endpoint to get the details about proxy relationships, including current status, based on a provided proxy's NHS Number.
@@ -477,18 +477,10 @@ paths:
477477
$ref: "./examples/responses/errors/internal-server-error.yaml#/InternalServerError"
478478

479479
post:
480-
summary: Create a new FHIR Consent resource
480+
summary: Create a proxy role
481481
description: |
482482
## 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
483+
Use this endpoint to create a new proxy relationship between a patient and a related person (proxy).
492484
493485
## Sandbox test scenarios
494486
| Scenario | Request | Response |
@@ -511,7 +503,7 @@ paths:
511503
summary: Parent requesting access to child's record
512504
value:
513505
resourceType: Consent
514-
status: draft
506+
status: active
515507
scope:
516508
coding:
517509
- system: http://terminology.hl7.org/CodeSystem/consentscope
@@ -523,42 +515,25 @@ paths:
523515
code: proxy
524516
display: Proxy Consent
525517
patient:
526-
reference: Patient/child123
527518
type: Patient
519+
identifier:
520+
system: https://fhir.nhs.uk/Id/nhs-number
521+
value: "9000000017"
528522
dateTime: "2025-02-11T14:30:00Z"
529523
performer:
530-
- reference: RelatedPerson/parent456
531-
type: RelatedPerson
524+
type: RelatedPerson
525+
identifier:
526+
system: https://fhir.nhs.uk/Id/nhs-number
527+
value: "9000000012"
532528
provision:
533529
period:
534530
start: "2025-02-11"
535531
end: "2026-02-11"
536-
actor:
537-
- role:
538-
coding:
539-
- system: http://terminology.hl7.org/CodeSystem/v3-RoleCode
540-
code: PRN
541-
display: Parent
542-
reference:
543-
reference: RelatedPerson/parent456
544-
provision:
545-
- actor:
546-
- role:
547-
coding:
548-
- system: https://fhir.nhs.uk/CodeSystem/proxy-access-level
549-
code: FULL
550-
display: Full Access
551-
verification:
552-
- verified: true
553-
verifiedWith:
554-
reference: DocumentReference/birthCert789
555-
verificationDate: "2025-02-11T14:30:00Z"
556-
557532
guardianConsentRequest:
558533
summary: Legal guardian requesting access
559534
value:
560535
resourceType: Consent
561-
status: draft
536+
status: active
562537
scope:
563538
coding:
564539
- system: http://terminology.hl7.org/CodeSystem/consentscope
@@ -599,7 +574,7 @@ paths:
599574
summary: Limited access for appointment booking only
600575
value:
601576
resourceType: Consent
602-
status: draft
577+
status: active
603578
scope:
604579
coding:
605580
- system: http://terminology.hl7.org/CodeSystem/consentscope
@@ -656,40 +631,43 @@ paths:
656631
schema:
657632
$ref: "#/components/schemas/OperationOutcome"
658633

634+
/Consent/{id}:
659635
patch:
660-
summary: Update an existing Consent resource
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.
636+
summary: Update a proxy role
637+
description: |
638+
## Overview
639+
Use this endpoint to update an existing proxy role.
663640
664641
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
642+
* Revocation of the role (status change from "active" to inactive
643+
* Changing the legal basis of the role (which property this will be is TBC with IOPS)
644+
* Updating the end date for timebound access
645+
646+
NOTE:
647+
we will also need to record a coded reason, but this is with IOPS to confirm where the reasonCode is stored.
648+
670649
671650
## Request Requirements
672-
* The Consent resource must exist and be identified by a valid identifier
651+
* The proxy role must exist and be identified by a valid identifier
673652
* JSON Patch operations must be valid according to RFC 6902
674653
* 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
676654
677655
## Sandbox test scenarios
678656
| Scenario | Request | Response |
679657
| -------- | ------- | -------- |
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 |
658+
| Successful status update | Valid patch changing status to 'active' | HTTP Status 200 and OperationOutcome|
659+
| Successful access level update | Valid patch modifying access provisions | HTTP Status 200 and OperationOutcome |
682660
| Multiple valid changes | Valid patch with multiple operations | HTTP Status 200 and updated Bundle |
683661
| Invalid patch format | Malformed JSON patch document | HTTP Status 400 and INVALID_PATCH_FORMAT error response |
684662
| Invalid path | Patch targeting non-existent element | HTTP Status 400 and INVALID_PATCH_PATH error response |
685663
| Invalid status code | Patch with invalid status value | HTTP Status 422 and INVALID_STATUS_CODE error response |
686664
| Resource not found | Patch for non-existent Consent | HTTP Status 404 and RESOURCE_NOT_FOUND error response |
687665
| Invalid state transition | Patch attempting invalid status change | HTTP Status 422 and INVALID_STATE_TRANSITION error response |
688666
parameters:
689-
- name: identifier
690-
in: query
667+
- name: id
668+
in: path
691669
required: true
692-
description: The identifier of the Consent resource to update
670+
description: The logical id of the Consent resource to update
693671
schema:
694672
type: string
695673
requestBody:
@@ -750,7 +728,7 @@ paths:
750728
content:
751729
application/fhir+json:
752730
schema:
753-
$ref: "#/components/schemas/ConsentBundle"
731+
$ref: "#/components/schemas/OperationOutcome"
754732
"400":
755733
description: Invalid patch
756734
content:

0 commit comments

Comments
 (0)