From 5b806b4f937b17d242aedd35a4583446f6d283c2 Mon Sep 17 00:00:00 2001 From: acarriedev Date: Tue, 5 Nov 2024 15:52:00 +0000 Subject: [PATCH 1/3] EM-1332 Add patientflags --- .../patientflags-change-1/signal.json | 84 +++++++++++++++++++ .../examples/patientflagsChangeSignal.json | 9 ++ .../gpregChangeGpRequestSignal.yaml | 2 +- .../cloudevents/patientflagsChangeSignal.yaml | 82 ++++++++++++++++++ .../patientflags-change-1-filtering.yaml | 27 ++++++ .../multicast-notification-service.yaml | 28 ++++++- 6 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 signal-schemas/patientflags-change-1/signal.json create mode 100644 specification/components/schemas/cloudevents/examples/patientflagsChangeSignal.json create mode 100644 specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml create mode 100644 specification/components/schemas/filtering/patientflags-change-1-filtering.yaml diff --git a/signal-schemas/patientflags-change-1/signal.json b/signal-schemas/patientflags-change-1/signal.json new file mode 100644 index 0000000..f8c0ad6 --- /dev/null +++ b/signal-schemas/patientflags-change-1/signal.json @@ -0,0 +1,84 @@ +{ + "resourceType": "Bundle", + "id": "16dbfb42-b5c0-4831-8258-f1a4d2491748", + "type": "history", + "timestamp": "2020-06-01T13:00:00Z", + "entry": [ + { + "fullUrl": "urn:uuid:fb88f7a9-2cba-4580-8559-f2d928273759", + "resource": { + "resourceType": "Parameters", + "meta": { + "profile": [ + "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription-status-r4" + ] + }, + "id": "fb88f7a9-2cba-4580-8559-f2d928273759", + "parameter": [ + { + "name": "subscription", + "valueReference": { + "reference": "https://api.service.nhs.uk/multicast-notification-service/subscriptions" + } + }, + { + "name": "status", + "valueCode": "active" + }, + { + "name": "type", + "valueCode": "event-notification" + }, + { + "name": "notification-event", + "part": [ + { + "name": "event-number", + "valueString": "1" + }, + { + "name": "timestamp", + "valueInstant": "2020-06-01T13:00:00Z" + }, + { + "name": "focus", + "valueReference": { + "reference": "https://api.service.nhs.uk/patient-flags-api/PatientFlag?patient=9912003888&code=NRAF" + } + } + ] + }, + { + "name": "additional-context", + "part": [ + { + "name": "event-type", + "valueString": "patientflags-change-1" + }, + { + "name": "source", + "valueUri": "uk.nhs.patient-flags-service" + }, + { + "name": "subject", + "valueReference": { + "identifier": { + "value": "9912003888" + } + } + } + ] + } + ] + }, + "request": { + "method": "GET", + "url": "https://api.service.nhs.uk/multicast-notification-service/subscriptions" + }, + "response": { + "status": "200" + } + } + ] + } + \ No newline at end of file diff --git a/specification/components/schemas/cloudevents/examples/patientflagsChangeSignal.json b/specification/components/schemas/cloudevents/examples/patientflagsChangeSignal.json new file mode 100644 index 0000000..80a1e25 --- /dev/null +++ b/specification/components/schemas/cloudevents/examples/patientflagsChangeSignal.json @@ -0,0 +1,9 @@ +{ + "specversion": "1.0", + "id": "16dbfb42-b5c0-4831-8258-f1a4d2491748", + "source": "uk.nhs.patient-flags-service", + "type": "patientflags-change-1", + "time": "2020-06-01T13:00:00Z", + "dataref": "https://api.service.nhs.uk/patient-flags-api/PatientFlag?patient=9912003888&code=NRAF", + "subject": "9912003888" +} diff --git a/specification/components/schemas/cloudevents/gpregChangeGpRequestSignal.yaml b/specification/components/schemas/cloudevents/gpregChangeGpRequestSignal.yaml index 3e242d1..abae57f 100644 --- a/specification/components/schemas/cloudevents/gpregChangeGpRequestSignal.yaml +++ b/specification/components/schemas/cloudevents/gpregChangeGpRequestSignal.yaml @@ -33,7 +33,7 @@ properties: examples: - '2018-04-05T17:31:00Z' dataref: - description: A link to the Registration record on the Register with a GP Surgery Service API. (Speculative example - API under development.) + description: A link to the Registration record on the Register with a GP Surgery Service API. "$ref": "#/definitions/datarefdef" examples: - https://api.service.nhs.uk/register-with-a-gp-surgery/applications/236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b diff --git a/specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml b/specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml new file mode 100644 index 0000000..e452ca4 --- /dev/null +++ b/specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml @@ -0,0 +1,82 @@ +"$schema": http://json-schema.org/draft-07/schema# +description: The GP Patient Flags Change Signal. You will receive this object if you subscribe to `patientflags-change-1` events with an `application/json` format. +type: object +properties: + id: + description: Identifies the event. + "$ref": "#/definitions/iddef" + examples: + - 16dbfb42-b5c0-4831-8258-f1a4d2491748 + source: + description: Identifies the producer of your event. + "$ref": "#/definitions/sourcedef" + examples: + - uk.nhs.patient-flags-service + specversion: + description: The version of the CloudEvents specification which the event uses. + "$ref": "#/definitions/specversiondef" + examples: + - '1.0' + type: + description: Describes the occurrence; the name of the event. + "$ref": "#/definitions/typedef" + examples: + - patientflags-change-1 + subject: + description: The NHS Number of the patient associated with the clinical flag change + "$ref": "#/definitions/subjectdef" + examples: + - 9912003888 + time: + description: Timestamp of when the occurrence happened. Must adhere to RFC 3339. + "$ref": "#/definitions/timedef" + examples: + - '2018-04-05T17:31:00Z' + dataref: + description: A link to the Registration record on the Patient Flags API. + "$ref": "#/definitions/datarefdef" + examples: + - https://api.service.nhs.uk/patient-flags-api/PatientFlag?patient=9912003888&code=NRAF +required: +- id +- source +- specversion +- type +- time +- dataref +- subject +definitions: + iddef: + type: string + minLength: 1 + sourcedef: + type: string + format: uri-reference + minLength: 1 + specversiondef: + type: string + minLength: 1 + typedef: + type: string + minLength: 1 + subjectdef: + type: + - string + minLength: 1 + timedef: + type: + - string + format: date-time + minLength: 1 + datarefdef: + type: string + format: uri + minLength: 1 +example: + specversion: '1.0' + id: 16dbfb42-b5c0-4831-8258-f1a4d2491748 + source: uk.nhs.patient-flags-service + type: patientflags-change-1 + time: '2020-06-01T13:00:00Z' + dataref: https://api.service.nhs.uk/patient-flags-api/PatientFlag?patient=9912003888&code=NRAF + subject: '9912003888' diff --git a/specification/components/schemas/filtering/patientflags-change-1-filtering.yaml b/specification/components/schemas/filtering/patientflags-change-1-filtering.yaml new file mode 100644 index 0000000..b82fcf9 --- /dev/null +++ b/specification/components/schemas/filtering/patientflags-change-1-filtering.yaml @@ -0,0 +1,27 @@ +# "$schema": http://json-schema.org/draft-07/schema# +description: patientflags-change-1 filtering object schema. +type: object +properties: + flagtype: + type: string + example: "NRAF" + enum: + - "NRAF" + - "FGM" + - "CPIS" + description: | + Text-based code that represents the type of patient flag. + The permitted codes are as follows: + | Code | Type | Description | + | ---- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | NRAF | National Reasonable Adjustments Flag | Indicates a patient's key impairments across areas including learning, mobility, mental health, social or behavioural to make receiving organisations understand that the patient should be considered for adjustments to care. | + | FGM | Female Genital Mutilation | Indicates that a child with female genitalia has a family history of female genetal mutilation. | + | CPIS | Child Protection - Information Sharing | Indicates a child or young person who is known to social care because they are either looked after or have a child protection plan. | + generalpractitioner: + type: string + minLength: 1 + example: "Y12345" + description: The ODS Code of the requested GP Practice. +required: + - flagtype + - generalpractitioner diff --git a/specification/multicast-notification-service.yaml b/specification/multicast-notification-service.yaml index 421e9dd..eab7152 100644 --- a/specification/multicast-notification-service.yaml +++ b/specification/multicast-notification-service.yaml @@ -208,6 +208,19 @@ paths: filtering: registrationencountercode: '3' generalpractitioner: 'XY11' + patientflags-change-1: + description: "Create a Patient Flags Change event" + value: + specversion: '1.0' + id: 16dbfb42-b5c0-4831-8258-f1a4d2491748 + source: uk.nhs.patient-flags-service + type: patientflags-change-1 + time: '2020-06-01T13:00:00Z' + dataref: https://api.service.nhs.uk/patient-flags-api/PatientFlag?patient=9912003888&code=NRAF + subject: '9912003888' + filtering: + flagtype: 'NRAF' + generalpractitioner: 'XY11' application/json: schema: type: "object" @@ -616,7 +629,20 @@ paths: channel: type: "message" endpoint: "arn:aws:sqs:eu-west-2:123456789012:queue2" - payload: "application/json" + payload: "application/fhir+json" + patientflagsChangeSubscription: + description: "Create a Patient Flags Change subscription" + value: + resourceType: "Subscription" + status: "requested" + end: "2022-04-05T17:31:00.000Z" + reason: "A description of why this subscription should be created." + criteria: "eventType=patientflags-change-1&;flagtype=NRAF&;generalpractitioner=XY11" + channel: + type: "message" + endpoint: "arn:aws:sqs:eu-west-2:123456789012:queue2" + payload: "application/fhir+json" + responses: 201: From d418beb8fa44f109268881e473d5607a4b2fdc75 Mon Sep 17 00:00:00 2001 From: acarriedev Date: Thu, 7 Nov 2024 09:23:45 +0000 Subject: [PATCH 2/3] EM-1332 Fix descriptions --- .../schemas/cloudevents/patientflagsChangeSignal.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml b/specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml index e452ca4..654f18a 100644 --- a/specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml +++ b/specification/components/schemas/cloudevents/patientflagsChangeSignal.yaml @@ -1,5 +1,5 @@ "$schema": http://json-schema.org/draft-07/schema# -description: The GP Patient Flags Change Signal. You will receive this object if you subscribe to `patientflags-change-1` events with an `application/json` format. +description: The Patient Flags Change Signal. You will receive this object if you subscribe to `patientflags-change-1` events with an `application/json` format. type: object properties: id: @@ -33,7 +33,7 @@ properties: examples: - '2018-04-05T17:31:00Z' dataref: - description: A link to the Registration record on the Patient Flags API. + description: A link to the flag indicator and supported resources on the Patient Flags API. "$ref": "#/definitions/datarefdef" examples: - https://api.service.nhs.uk/patient-flags-api/PatientFlag?patient=9912003888&code=NRAF From 68b92376625c8186f37cad0ab10b5ac04a336c61 Mon Sep 17 00:00:00 2001 From: acarriedev Date: Fri, 8 Nov 2024 11:52:59 +0000 Subject: [PATCH 3/3] EM-1332 Update gp description --- .../schemas/filtering/patientflags-change-1-filtering.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/components/schemas/filtering/patientflags-change-1-filtering.yaml b/specification/components/schemas/filtering/patientflags-change-1-filtering.yaml index b82fcf9..76b346e 100644 --- a/specification/components/schemas/filtering/patientflags-change-1-filtering.yaml +++ b/specification/components/schemas/filtering/patientflags-change-1-filtering.yaml @@ -21,7 +21,7 @@ properties: type: string minLength: 1 example: "Y12345" - description: The ODS Code of the requested GP Practice. + description: The ODS Code of the GP Practice for the patient. required: - flagtype - generalpractitioner