From 3a377327eb3420188945c714ecb8e5ca45b73a16 Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Thu, 6 Feb 2025 15:23:44 +0000 Subject: [PATCH 1/4] [NRL-1279] Add sample pointer unit tests and initial sample from Orion --- layer/nrlf/core/tests/test_sample_pointers.py | 35 +++++++ tests/data/samples/README.md | 11 +++ ..._MentalHealthCrisisPlan_Orion_Feb2025.json | 97 +++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 layer/nrlf/core/tests/test_sample_pointers.py create mode 100644 tests/data/samples/README.md create mode 100644 tests/data/samples/YGM91_MentalHealthCrisisPlan_Orion_Feb2025.json diff --git a/layer/nrlf/core/tests/test_sample_pointers.py b/layer/nrlf/core/tests/test_sample_pointers.py new file mode 100644 index 000000000..3aea2c8e1 --- /dev/null +++ b/layer/nrlf/core/tests/test_sample_pointers.py @@ -0,0 +1,35 @@ +import os + +import pytest + +from nrlf.consumer.fhir.r4.model import DocumentReference as ConsumerDocumentReference +from nrlf.core.validators import DocumentReferenceValidator +from nrlf.producer.fhir.r4.model import DocumentReference as ProducerDocumentReference + + +@pytest.fixture +def sample_pointer_data() -> str: + json_files = [f for f in os.listdir("./tests/data/samples") if f.endswith(".json")] + + for file in json_files: + with open(f"./tests/data/samples/{file}", "r") as f: + pointer_data = f.read() + yield pointer_data + + +def test_sample_pointer_as_consumer(sample_pointer_data: str): + docref = ConsumerDocumentReference.model_validate_json(sample_pointer_data) + + validator = DocumentReferenceValidator() + result = validator.validate(data=docref) + + assert result.is_valid + + +def test_sample_pointer_as_producer(sample_pointer_data: str): + docref = ProducerDocumentReference.model_validate_json(sample_pointer_data) + + validator = DocumentReferenceValidator() + result = validator.validate(data=docref) + + assert result.is_valid diff --git a/tests/data/samples/README.md b/tests/data/samples/README.md new file mode 100644 index 000000000..196bcd10e --- /dev/null +++ b/tests/data/samples/README.md @@ -0,0 +1,11 @@ +# Supplier sample data + +This directory contains sample pointer data from our suppliers. Samples have +been sourced directly from suppliers or anonymised from live data. + +To add a new sample to this folder, follow these steps: + +- Remove any real PII from the DocumentReference data (NHS numbers, URLs, ids etc) +- Add the DocumentReference data to a .json file with a name describing the + supplier and the pointer type, something like __.json +- Run the tests to verify that the pointer works with our model and validators diff --git a/tests/data/samples/YGM91_MentalHealthCrisisPlan_Orion_Feb2025.json b/tests/data/samples/YGM91_MentalHealthCrisisPlan_Orion_Feb2025.json new file mode 100644 index 000000000..0bdbdf91e --- /dev/null +++ b/tests/data/samples/YGM91_MentalHealthCrisisPlan_Orion_Feb2025.json @@ -0,0 +1,97 @@ +{ + "resourceType": "DocumentReference", + "id": "YGM91-b5a1aef1-a3ee-4c38-be31-e98968fe7ae9", + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "b5a1aef1-a3ee-4c38-be31-e98968fe7ae9" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9658218873" + } + }, + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "YGM91" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "YGM91" + } + }, + "content": [ + { + "extension": [ + { + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "dynamic", + "display": "Dynamic" + } + ] + } + } + ], + "attachment": { + "contentType": "application/pdf", + "language": "en", + "url": "ssp://endpoint.nrlproducer.thirdparty.nhs.uk/nrl/content", + "title": "Treatment Escalation Plan" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + } + } + ], + "context": { + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "92221000000103", + "display": "Mental health home treatment team" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} From 9d37f6bf3117a271d0870c2a76e236b87938c4f9 Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Mon, 10 Feb 2025 16:52:35 +0000 Subject: [PATCH 2/4] [NRL-1279] Fix up unit test for sample pointer. Add redacted live sample pointers --- layer/nrlf/core/tests/test_sample_pointers.py | 31 ++-- .../samples/11X_ADVANCE_CARE_PLAN_Feb25.json | 103 +++++++++++++ ...SONALISED_CARE_AND_SUPPORT_PLAN_Feb25.json | 103 +++++++++++++ .../11X_TREATMENT_ESCALATION_PLAN_Feb25.json | 103 +++++++++++++ ...B3H2B_EMERGENCY_HEALTHCARE_PLAN_Feb25.json | 110 ++++++++++++++ .../data/samples/QUY_RESPECT_FORM_Feb25.json | 103 +++++++++++++ .../samples/RAT_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ .../samples/RHA_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ .../samples/RKL_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ .../samples/RP7_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ .../samples/RPG_MENTAL_HEALTH_PLAN_Feb25.json | 139 ++++++++++++++++++ .../samples/RQY_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ .../samples/RRE_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ .../samples/RV5_MENTAL_HEALTH_PLAN_Feb25.json | 139 ++++++++++++++++++ .../samples/RW1_MENTAL_HEALTH_PLAN_Feb25.json | 139 ++++++++++++++++++ .../samples/RW4_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ .../samples/RWK_MENTAL_HEALTH_PLAN_Feb25.json | 129 ++++++++++++++++ ...M91_MENTAL_HEALTH_PLAN_Orion_Feb2025.json} | 0 18 files changed, 1987 insertions(+), 15 deletions(-) create mode 100644 tests/data/samples/11X_ADVANCE_CARE_PLAN_Feb25.json create mode 100644 tests/data/samples/11X_PERSONALISED_CARE_AND_SUPPORT_PLAN_Feb25.json create mode 100644 tests/data/samples/11X_TREATMENT_ESCALATION_PLAN_Feb25.json create mode 100644 tests/data/samples/B3H2B_EMERGENCY_HEALTHCARE_PLAN_Feb25.json create mode 100644 tests/data/samples/QUY_RESPECT_FORM_Feb25.json create mode 100644 tests/data/samples/RAT_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RHA_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RKL_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RP7_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RPG_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RQY_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RRE_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RV5_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RW1_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RW4_MENTAL_HEALTH_PLAN_Feb25.json create mode 100644 tests/data/samples/RWK_MENTAL_HEALTH_PLAN_Feb25.json rename tests/data/samples/{YGM91_MentalHealthCrisisPlan_Orion_Feb2025.json => YGM91_MENTAL_HEALTH_PLAN_Orion_Feb2025.json} (100%) diff --git a/layer/nrlf/core/tests/test_sample_pointers.py b/layer/nrlf/core/tests/test_sample_pointers.py index 3aea2c8e1..60e681ecd 100644 --- a/layer/nrlf/core/tests/test_sample_pointers.py +++ b/layer/nrlf/core/tests/test_sample_pointers.py @@ -7,29 +7,30 @@ from nrlf.producer.fhir.r4.model import DocumentReference as ProducerDocumentReference -@pytest.fixture -def sample_pointer_data() -> str: - json_files = [f for f in os.listdir("./tests/data/samples") if f.endswith(".json")] +def sample_pointer_files() -> list[str]: + return [f for f in os.listdir("./tests/data/samples") if f.endswith(".json")] - for file in json_files: - with open(f"./tests/data/samples/{file}", "r") as f: - pointer_data = f.read() - yield pointer_data +def load_sample_pointer_data(pointer_file: str) -> str: + with open(f"./tests/data/samples/{pointer_file}", "r") as f: + return f.read() -def test_sample_pointer_as_consumer(sample_pointer_data: str): - docref = ConsumerDocumentReference.model_validate_json(sample_pointer_data) - validator = DocumentReferenceValidator() - result = validator.validate(data=docref) +@pytest.mark.parametrize("sample_pointer_file", sample_pointer_files()) +def test_sample_pointer_as_consumer(sample_pointer_file: str): + sample_pointer_data = load_sample_pointer_data(sample_pointer_file) + + docref = ConsumerDocumentReference.model_validate_json(sample_pointer_data) + result = DocumentReferenceValidator().validate(data=docref) assert result.is_valid -def test_sample_pointer_as_producer(sample_pointer_data: str): - docref = ProducerDocumentReference.model_validate_json(sample_pointer_data) +@pytest.mark.parametrize("sample_pointer_file", sample_pointer_files()) +def test_sample_pointer_as_producer(sample_pointer_file: str): + sample_pointer_data = load_sample_pointer_data(sample_pointer_file) - validator = DocumentReferenceValidator() - result = validator.validate(data=docref) + docref = ProducerDocumentReference.model_validate_json(sample_pointer_data) + result = DocumentReferenceValidator().validate(data=docref) assert result.is_valid diff --git a/tests/data/samples/11X_ADVANCE_CARE_PLAN_Feb25.json b/tests/data/samples/11X_ADVANCE_CARE_PLAN_Feb25.json new file mode 100644 index 000000000..92faecd21 --- /dev/null +++ b/tests/data/samples/11X_ADVANCE_CARE_PLAN_Feb25.json @@ -0,0 +1,103 @@ +{ + "resourceType": "DocumentReference", + "id": "11X-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.326Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736366004", + "display": "Advance care plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.326Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "L85012" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "11X" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.326Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.326Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1060971000000108", + "display": "General practice service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/11X_PERSONALISED_CARE_AND_SUPPORT_PLAN_Feb25.json b/tests/data/samples/11X_PERSONALISED_CARE_AND_SUPPORT_PLAN_Feb25.json new file mode 100644 index 000000000..80cad6374 --- /dev/null +++ b/tests/data/samples/11X_PERSONALISED_CARE_AND_SUPPORT_PLAN_Feb25.json @@ -0,0 +1,103 @@ +{ + "resourceType": "DocumentReference", + "id": "11X-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.327Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "2181441000000107", + "display": "Personalised Care and Support Plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.327Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "L85609" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "11X" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.327Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1060971000000108", + "display": "General practice service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/11X_TREATMENT_ESCALATION_PLAN_Feb25.json b/tests/data/samples/11X_TREATMENT_ESCALATION_PLAN_Feb25.json new file mode 100644 index 000000000..70940ebc1 --- /dev/null +++ b/tests/data/samples/11X_TREATMENT_ESCALATION_PLAN_Feb25.json @@ -0,0 +1,103 @@ +{ + "resourceType": "DocumentReference", + "id": "11X-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.327Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "735324008", + "display": "Treatment escalation plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.327Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "L85023" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "11X" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.327Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1060971000000108", + "display": "General practice service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/B3H2B_EMERGENCY_HEALTHCARE_PLAN_Feb25.json b/tests/data/samples/B3H2B_EMERGENCY_HEALTHCARE_PLAN_Feb25.json new file mode 100644 index 000000000..045739591 --- /dev/null +++ b/tests/data/samples/B3H2B_EMERGENCY_HEALTHCARE_PLAN_Feb25.json @@ -0,0 +1,110 @@ +{ + "resourceType": "DocumentReference", + "id": "B3H2B-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.326Z" + }, + "masterIdentifier": { + "system": "better.pdfCompositionUid", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "887701000000100", + "display": "Emergency health care plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.326Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "B3H2B" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "B3H2B" + } + }, + "relatesTo": [ + { + "code": "replaces", + "target": { + "identifier": { + "value": "rel_c2a99222-eb50-4451-ad6e-1e951627800e" + } + } + } + ], + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.326Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "224891009", + "display": "Healthcare services" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/QUY_RESPECT_FORM_Feb25.json b/tests/data/samples/QUY_RESPECT_FORM_Feb25.json new file mode 100644 index 000000000..cd50a2a45 --- /dev/null +++ b/tests/data/samples/QUY_RESPECT_FORM_Feb25.json @@ -0,0 +1,103 @@ +{ + "resourceType": "DocumentReference", + "id": "QUY-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.327Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1382601000000107", + "display": "ReSPECT (Recommended Summary Plan for Emergency Care and Treatment) form" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.327Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "L81014" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "QUY" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.327Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1060971000000108", + "display": "General practice service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RAT_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RAT_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..83a4df2b8 --- /dev/null +++ b/tests/data/samples/RAT_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RAT-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.326Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.326Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RAT" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RAT" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.326Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.326Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.326Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RHA_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RHA_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..419b559d4 --- /dev/null +++ b/tests/data/samples/RHA_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RHA-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.328Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.328Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RHA" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RHA" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.328Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RKL_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RKL_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..4697ef83c --- /dev/null +++ b/tests/data/samples/RKL_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RKL-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.328Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.328Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RKL" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RKL" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.328Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RP7_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RP7_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..3d493e4d0 --- /dev/null +++ b/tests/data/samples/RP7_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RP7-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.326Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.326Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RP7" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RP7" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.326Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.326Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.326Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RPG_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RPG_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..4e9f1abef --- /dev/null +++ b/tests/data/samples/RPG_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,139 @@ +{ + "resourceType": "DocumentReference", + "id": "RPG-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.328Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.328Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RPG" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RPG" + } + }, + "relatesTo": [ + { + "code": "replaces", + "target": { + "identifier": { + "value": "rel_c2a99222-eb50-4451-ad6e-1e951627800e" + } + } + } + ], + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.328Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RQY_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RQY_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..560d5f325 --- /dev/null +++ b/tests/data/samples/RQY_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RQY-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.325Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.325Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RQY" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RQY" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.325Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.325Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.325Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RRE_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RRE_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..5e0ae58c3 --- /dev/null +++ b/tests/data/samples/RRE_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RRE-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.328Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.328Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RRE" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RRE" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.328Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RV5_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RV5_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..01156cbb4 --- /dev/null +++ b/tests/data/samples/RV5_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,139 @@ +{ + "resourceType": "DocumentReference", + "id": "RV5-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.327Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.327Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RV5" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RV5" + } + }, + "relatesTo": [ + { + "code": "replaces", + "target": { + "identifier": { + "value": "rel_c2a99222-eb50-4451-ad6e-1e951627800e" + } + } + } + ], + "content": [ + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.327Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "708168004", + "display": "Mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RW1_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RW1_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..a3bb63ce0 --- /dev/null +++ b/tests/data/samples/RW1_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,139 @@ +{ + "resourceType": "DocumentReference", + "id": "RW1-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.327Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.327Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RW1" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RW1" + } + }, + "relatesTo": [ + { + "code": "replaces", + "target": { + "identifier": { + "value": "rel_c2a99222-eb50-4451-ad6e-1e951627800e" + } + } + } + ], + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.327Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RW4_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RW4_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..f85cd13c0 --- /dev/null +++ b/tests/data/samples/RW4_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RW4-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.327Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.327Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RW4" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RW4" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.327Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.327Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/RWK_MENTAL_HEALTH_PLAN_Feb25.json b/tests/data/samples/RWK_MENTAL_HEALTH_PLAN_Feb25.json new file mode 100644 index 000000000..3700b7e60 --- /dev/null +++ b/tests/data/samples/RWK_MENTAL_HEALTH_PLAN_Feb25.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DocumentReference", + "id": "RWK-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-10T16:48:27.328Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "736253002", + "display": "Mental health crisis plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-10T16:48:27.328Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RWK" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "RWK" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-10T16:48:27.328Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "period": { + "start": "2025-02-10T16:48:27.328Z" + }, + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "892811000000109", + "display": "Adult mental health service" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/YGM91_MentalHealthCrisisPlan_Orion_Feb2025.json b/tests/data/samples/YGM91_MENTAL_HEALTH_PLAN_Orion_Feb2025.json similarity index 100% rename from tests/data/samples/YGM91_MentalHealthCrisisPlan_Orion_Feb2025.json rename to tests/data/samples/YGM91_MENTAL_HEALTH_PLAN_Orion_Feb2025.json From 41dd84bb2cd21e4d47725cd9e34adc9f96566973 Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Tue, 11 Feb 2025 11:11:06 +0000 Subject: [PATCH 3/4] [NRL-1279] Add script that can redact live pointer samples --- scripts/redact_live_pointers.py | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 scripts/redact_live_pointers.py diff --git a/scripts/redact_live_pointers.py b/scripts/redact_live_pointers.py new file mode 100644 index 000000000..459759c83 --- /dev/null +++ b/scripts/redact_live_pointers.py @@ -0,0 +1,80 @@ +import json +import os +from datetime import datetime, timedelta, timezone +from typing import Any + +import boto3 +import fire + +from nrlf.consumer.fhir.r4.model import DocumentReference +from nrlf.core.constants import PointerTypes +from nrlf.core.logger import logger +from nrlf.core.utils import create_fhir_instant +from nrlf.core.validators import DocumentReferenceValidator + +dynamodb = boto3.client("dynamodb") +paginator = dynamodb.get_paginator("scan") + +logger.setLevel("ERROR") + +type_to_name = {pointer_type.value: pointer_type.name for pointer_type in PointerTypes} + + +def _redact_pointers(src_path: str, dest_path: str) -> None: + """ + Redact pointers in .json files in from the source path and write the redacted pointer to the destination path. + Parameters: + - src_path: The path to the source directory containing the pointers. + - dest_path: The path to the destination directory to write the redacted pointers. + """ + src_pointer_files = [f for f in os.listdir(src_path) if f.endswith(".json")] + + for src_pointer_file in src_pointer_files: + print("Reading", src_pointer_file) + with open(f"{src_path}/{src_pointer_file}", "r") as f: + pointer_data = f.read() + + docref = DocumentReference.model_validate_json(pointer_data) + + ods_code = docref.custodian.identifier.value + type_coding = docref.type.coding[0] + pointer_type = type_to_name[f"{type_coding.system}|{type_coding.code}"] + + mock_timestamp = create_fhir_instant() + docref.meta.lastUpdated = mock_timestamp + docref.date = mock_timestamp + + mock_id = f"c2a99222-eb50-4451-ad6e-1e951627800e" + docref.subject.identifier.value = "9999999999" + docref.id = f"{ods_code}-{mock_id}" + if docref.masterIdentifier: + docref.masterIdentifier.value = f"mid_{mock_id}" + if docref.relatesTo: + for relates_to in docref.relatesTo: + relates_to.target.identifier.value = f"rel_{mock_id}" + + for content in docref.content: + if content.attachment.url.startswith("ssp://"): + content.attachment.url = "ssp://content.test.local/content" + else: + content.attachment.url = "https://content.test.local/content" + content.attachment.creation = mock_timestamp + if docref.context.related: + for related in docref.context.related: + related.identifier.value = "012345678910" + if docref.context.period: + if docref.context.period.start: + docref.context.period.start = mock_timestamp + if docref.context.period.end: + docref.context.period.end = mock_timestamp + + month_year = datetime.now().strftime("%b%y") + filename = f"{dest_path}/{ods_code}_{pointer_type}_{month_year}.json" + + print("Writing", filename) + with open(filename, "w") as f: + f.write(docref.model_dump_json(indent=2, exclude_unset=True)) + + +if __name__ == "__main__": + fire.Fire(_redact_pointers) From cc19856c8f7369df8c4f6e24a413efc2f7cd5da4 Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Tue, 11 Feb 2025 12:30:46 +0000 Subject: [PATCH 4/4] [NRL-1279] Fix sonarcloud warnings. Add EOLCP and EHCP samples from care homes --- scripts/redact_live_pointers.py | 73 ++++++---- ...VM8W7_EMERGENCY_HEALTHCARE_PLAN_Feb25.json | 126 ++++++++++++++++++ .../VM8W7_EOL_COORDINATION_SUMMARY_Feb25.json | 126 ++++++++++++++++++ 3 files changed, 298 insertions(+), 27 deletions(-) create mode 100644 tests/data/samples/VM8W7_EMERGENCY_HEALTHCARE_PLAN_Feb25.json create mode 100644 tests/data/samples/VM8W7_EOL_COORDINATION_SUMMARY_Feb25.json diff --git a/scripts/redact_live_pointers.py b/scripts/redact_live_pointers.py index 459759c83..476b3441b 100644 --- a/scripts/redact_live_pointers.py +++ b/scripts/redact_live_pointers.py @@ -20,6 +20,48 @@ type_to_name = {pointer_type.value: pointer_type.name for pointer_type in PointerTypes} +def _redact_timestamps(docref: DocumentReference) -> None: + mock_timestamp = create_fhir_instant() + docref.meta.lastUpdated = mock_timestamp + docref.date = mock_timestamp + + +def _redact_ids(docref: DocumentReference) -> None: + ods_code = docref.custodian.identifier.value + + mock_id = "c2a99222-eb50-4451-ad6e-1e951627800e" + docref.subject.identifier.value = "9999999999" + docref.id = f"{ods_code}-{mock_id}" + if docref.masterIdentifier: + docref.masterIdentifier.value = f"mid_{mock_id}" + if docref.relatesTo: + for relates_to in docref.relatesTo: + relates_to.target.identifier.value = f"rel_{mock_id}" + + +def _redact_content(docref: DocumentReference) -> None: + mock_timestamp = create_fhir_instant() + for content in docref.content: + if content.attachment.url.startswith("ssp://"): + content.attachment.url = "ssp://content.test.local/content" + else: + content.attachment.url = "https://content.test.local/content" + content.attachment.creation = mock_timestamp + + +def _redact_context(docref: DocumentReference) -> None: + if docref.context.related: + for related in docref.context.related: + related.identifier.value = "012345678910" + + mock_timestamp = create_fhir_instant() + if docref.context.period: + if docref.context.period.start: + docref.context.period.start = mock_timestamp + if docref.context.period.end: + docref.context.period.end = mock_timestamp + + def _redact_pointers(src_path: str, dest_path: str) -> None: """ Redact pointers in .json files in from the source path and write the redacted pointer to the destination path. @@ -40,33 +82,10 @@ def _redact_pointers(src_path: str, dest_path: str) -> None: type_coding = docref.type.coding[0] pointer_type = type_to_name[f"{type_coding.system}|{type_coding.code}"] - mock_timestamp = create_fhir_instant() - docref.meta.lastUpdated = mock_timestamp - docref.date = mock_timestamp - - mock_id = f"c2a99222-eb50-4451-ad6e-1e951627800e" - docref.subject.identifier.value = "9999999999" - docref.id = f"{ods_code}-{mock_id}" - if docref.masterIdentifier: - docref.masterIdentifier.value = f"mid_{mock_id}" - if docref.relatesTo: - for relates_to in docref.relatesTo: - relates_to.target.identifier.value = f"rel_{mock_id}" - - for content in docref.content: - if content.attachment.url.startswith("ssp://"): - content.attachment.url = "ssp://content.test.local/content" - else: - content.attachment.url = "https://content.test.local/content" - content.attachment.creation = mock_timestamp - if docref.context.related: - for related in docref.context.related: - related.identifier.value = "012345678910" - if docref.context.period: - if docref.context.period.start: - docref.context.period.start = mock_timestamp - if docref.context.period.end: - docref.context.period.end = mock_timestamp + _redact_ids(docref) + _redact_timestamps(docref) + _redact_content(docref) + _redact_context(docref) month_year = datetime.now().strftime("%b%y") filename = f"{dest_path}/{ods_code}_{pointer_type}_{month_year}.json" diff --git a/tests/data/samples/VM8W7_EMERGENCY_HEALTHCARE_PLAN_Feb25.json b/tests/data/samples/VM8W7_EMERGENCY_HEALTHCARE_PLAN_Feb25.json new file mode 100644 index 000000000..b1fe8680d --- /dev/null +++ b/tests/data/samples/VM8W7_EMERGENCY_HEALTHCARE_PLAN_Feb25.json @@ -0,0 +1,126 @@ +{ + "resourceType": "DocumentReference", + "id": "VM8W7-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-11T12:25:44.382Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "887701000000100", + "display": "Emergency health care plan" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-11T12:25:44.382Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "VM8W7" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "VM8W7" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-11T12:25:44.382Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-11T12:25:44.382Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "224891009", + "display": "Healthcare services" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +} diff --git a/tests/data/samples/VM8W7_EOL_COORDINATION_SUMMARY_Feb25.json b/tests/data/samples/VM8W7_EOL_COORDINATION_SUMMARY_Feb25.json new file mode 100644 index 000000000..61033ef6b --- /dev/null +++ b/tests/data/samples/VM8W7_EOL_COORDINATION_SUMMARY_Feb25.json @@ -0,0 +1,126 @@ +{ + "resourceType": "DocumentReference", + "id": "VM8W7-c2a99222-eb50-4451-ad6e-1e951627800e", + "meta": { + "lastUpdated": "2025-02-11T12:25:44.435Z" + }, + "masterIdentifier": { + "system": "urn:ietf:rfc:3986", + "value": "mid_c2a99222-eb50-4451-ad6e-1e951627800e" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "861421000000109", + "display": "End of life care coordination summary" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "734163000", + "display": "Care plan" + } + ] + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9999999999" + } + }, + "date": "2025-02-11T12:25:44.435Z", + "author": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "VM8W7" + } + } + ], + "custodian": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "VM8W7" + } + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "ssp://content.test.local/content", + "creation": "2025-02-11T12:25:44.435Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:unstructured", + "display": "Unstructured Document" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + }, + { + "attachment": { + "contentType": "text/html", + "url": "https://content.test.local/content", + "creation": "2025-02-11T12:25:44.435Z" + }, + "format": { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLFormatCode", + "code": "urn:nhs-ic:record-contact", + "display": "Contact details (HTTP Unsecured)" + }, + "extension": [ + { + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability", + "code": "static", + "display": "Static" + } + ] + }, + "url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability" + } + ] + } + ], + "context": { + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "224891009", + "display": "Healthcare services" + } + ] + }, + "related": [ + { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhsSpineASID", + "value": "012345678910" + } + } + ] + } +}