Skip to content

Commit

Permalink
Merge pull request #245 from NHSDigital/em-1332-add-patient-flags
Browse files Browse the repository at this point in the history
EM-1332 Add patientflags
  • Loading branch information
acarriedev authored Nov 11, 2024
2 parents 6c03143 + 68b9237 commit 8bf2dc5
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 2 deletions.
84 changes: 84 additions & 0 deletions signal-schemas/patientflags-change-1/signal.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}

Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
"$schema": http://json-schema.org/draft-07/schema#
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:
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 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
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'
Original file line number Diff line number Diff line change
@@ -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 GP Practice for the patient.
required:
- flagtype
- generalpractitioner
28 changes: 27 additions & 1 deletion specification/multicast-notification-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8bf2dc5

Please sign in to comment.