Skip to content

Commit 1bdeefc

Browse files
committed
NPA-7317: Bring spec in line with service
1 parent b7ec0c1 commit 1bdeefc

1 file changed

Lines changed: 145 additions & 14 deletions

File tree

specification/validated-relationships-service-api.yaml

Lines changed: 145 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,7 @@ paths:
989989
* The proxy role must exist and be identified by a valid ID
990990
* JSON Patch operations must be valid according to RFC 6902
991991
* Status changes must use valid status codes from <http://hl7.org/fhir/consent-state-codes>
992+
* Each patch operation in the request body is validated according to its `path`. The allowed `op` values and shape of `value` depend on which `path` is being patched - see the `PatchOperation` schema for the full set of supported per-path operations.
992993
993994
### IMPORTANT: Business Rule Enforcement for `/status` updates
994995
@@ -2692,30 +2693,160 @@ components:
26922693
description: "A human-readable representation of the code."
26932694

26942695
PatchOperation:
2696+
description: |
2697+
A single JSON Patch (RFC 6902) operation to apply to a Consent resource.
2698+
2699+
This is a discriminated union, keyed on `path`. The set of allowed `op` values, and the shape of `value`, is
2700+
specific to each `path` - see each per-path schema below for details. Providing an `op` that isn't listed for
2701+
a given `path` (e.g. `remove` on `/status`) will be rejected as invalid.
2702+
2703+
Supported paths are:
2704+
- `/status` - update the status of the proxy role. Must be paired with a `/extension/-` operation in the same
2705+
patch array to supply the `statusReason`.
2706+
- `/extension/-` - append an extension (e.g. `statusReason` or `grantor`) to the Consent resource.
2707+
- `/policyRule` - update the legal basis for the proxy role.
2708+
- `/provision/period/end` - add, replace or remove the end date of the proxy role, for time-bound access.
2709+
- `/provision/actor` - deprecated and not supported for update; any request including this path is rejected.
2710+
oneOf:
2711+
- $ref: "#/components/schemas/StatusPatchOperation"
2712+
- $ref: "#/components/schemas/ExtensionPatchOperation"
2713+
- $ref: "#/components/schemas/PolicyRulePatchOperation"
2714+
- $ref: "#/components/schemas/ProvisionPeriodEndPatchOperation"
2715+
- $ref: "#/components/schemas/ProvisionActorPatchOperation"
2716+
discriminator:
2717+
propertyName: path
2718+
mapping:
2719+
/status: "#/components/schemas/StatusPatchOperation"
2720+
/extension/-: "#/components/schemas/ExtensionPatchOperation"
2721+
/policyRule: "#/components/schemas/PolicyRulePatchOperation"
2722+
/provision/period/end: "#/components/schemas/ProvisionPeriodEndPatchOperation"
2723+
/provision/actor: "#/components/schemas/ProvisionActorPatchOperation"
2724+
2725+
StatusPatchOperation:
26952726
type: object
2727+
description: |
2728+
Update the status of the proxy role. Must be accompanied by a `/extension/-` operation in the same patch
2729+
array, adding a `statusReason` extension. The requested status transition is validated against the proxy
2730+
role lifecycle.
26962731
required:
26972732
- op
26982733
- path
2734+
- value
26992735
properties:
27002736
op:
27012737
type: string
2702-
enum: [add, remove, replace]
2738+
description: Only `replace` is supported for `/status`.
2739+
enum:
2740+
- replace
27032741
path:
27042742
type: string
2705-
oneOf:
2706-
- description: "Static paths that do not require an index."
2707-
enum:
2708-
- /status
2709-
- /extension/-
2710-
- /provision/period/end
2711-
- /provision/actor
2712-
- /policyRule
2743+
enum:
2744+
- /status
27132745
value:
2714-
oneOf:
2715-
- type: string
2716-
- type: array
2717-
items:
2718-
type: object
2746+
type: string
2747+
description: "The new status, following the ConsentStateCodes value set: http://hl7.org/fhir/consent-state-codes"
2748+
enum:
2749+
- proposed
2750+
- active
2751+
- rejected
2752+
- inactive
2753+
- entered-in-error
2754+
2755+
ExtensionPatchOperation:
2756+
type: object
2757+
description: |
2758+
Append an extension to the Consent resource. Used to provide a `statusReason` (required alongside a
2759+
`/status` update) and/or a `grantor` (required when creating or activating an active proxy role).
2760+
required:
2761+
- op
2762+
- path
2763+
- value
2764+
properties:
2765+
op:
2766+
type: string
2767+
description: Only `add` is supported for `/extension/-`.
2768+
enum:
2769+
- add
2770+
path:
2771+
type: string
2772+
enum:
2773+
- /extension/-
2774+
value:
2775+
type: array
2776+
minItems: 1
2777+
items:
2778+
anyOf:
2779+
- $ref: "#/components/schemas/StatusReasonExtension"
2780+
- $ref: "#/components/schemas/GrantorExtension"
2781+
2782+
PolicyRulePatchOperation:
2783+
type: object
2784+
description: Update the legal basis (policy rule) for the proxy role.
2785+
required:
2786+
- op
2787+
- path
2788+
- value
2789+
properties:
2790+
op:
2791+
type: string
2792+
description: "`add` or `replace` are supported for `/policyRule`."
2793+
enum:
2794+
- add
2795+
- replace
2796+
path:
2797+
type: string
2798+
enum:
2799+
- /policyRule
2800+
value:
2801+
$ref: "#/components/schemas/LegalBasisCodeableConcept"
2802+
2803+
ProvisionPeriodEndPatchOperation:
2804+
type: object
2805+
description: |
2806+
Add, replace or remove the end date of the proxy role, for time-bound access. `value` is not required when
2807+
`op` is `remove`.
2808+
required:
2809+
- op
2810+
- path
2811+
properties:
2812+
op:
2813+
type: string
2814+
description: "`add`, `replace` or `remove` are supported for `/provision/period/end`."
2815+
enum:
2816+
- add
2817+
- replace
2818+
- remove
2819+
path:
2820+
type: string
2821+
enum:
2822+
- /provision/period/end
2823+
value:
2824+
type: string
2825+
format: date
2826+
description: "The end date of the proxy role. Not required, and disregarded, when `op` is `remove`."
2827+
2828+
ProvisionActorPatchOperation:
2829+
type: object
2830+
description: |
2831+
This path is deprecated and not supported for update. It is documented here for completeness only - any
2832+
request including a patch operation with this path will be rejected with an
2833+
`INVALID_LEGAL_BASIS_UPDATE_REQUEST` error. Use `/policyRule` instead.
2834+
deprecated: true
2835+
required:
2836+
- op
2837+
- path
2838+
properties:
2839+
op:
2840+
type: string
2841+
description: Any `op` value provided with `/provision/actor` will be rejected.
2842+
path:
2843+
type: string
2844+
enum:
2845+
- /provision/actor
2846+
value:
2847+
type: array
2848+
items:
2849+
type: object
27192850

27202851
PDSName:
27212852
type: array

0 commit comments

Comments
 (0)