From 463956b79b49848551be83274206792e467420f2 Mon Sep 17 00:00:00 2001 From: martin-nhs <127403254+martin-nhs@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:11:34 +0100 Subject: [PATCH 01/86] [NIAD-3217] Add test data --- .../diagnostic-report-with-test-result.json | 41 + .../mapper/diagnosticreport/fhir_bundle.json | 845 ++++++++++-------- 2 files changed, 502 insertions(+), 384 deletions(-) create mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-test-result.json diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-test-result.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-test-result.json new file mode 100644 index 0000000000..aaae045e25 --- /dev/null +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-test-result.json @@ -0,0 +1,41 @@ +{ + "resource": { + "resourceType": "DiagnosticReport", + "id": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" + ] + }, + "identifier": [ + { + "system": "https://wiremock/", + "value": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC" + } + ], + "status": "unknown", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + }, + "issued": "2001-02-03T09:00:00+00:00", + "specimen": [ + { + "reference": "Specimen/NON-SIGNIFICANT-SPECIMEN" + } + ], + "result": [ + { + "reference": "Observation/TEST-RESULT-NO-SPECIMEN" + } + ] + } +} \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index c1fad1813b..eec39b4c91 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -8,725 +8,802 @@ "type": "searchset", "entry": [ { - "resource":{ - "resourceType":"DiagnosticReport", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098", - "meta":{ - "profile":[ + "resource": { + "resourceType": "DiagnosticReport", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098" } ], - "status":"unknown", - "category":{ - "coding":[ + "status": "unknown", + "category": { + "coding": [ { - "system":"http://hl7.org/fhir/v2/0074", - "code":"PAT", - "display":"Pathology (gross & histopath, not surgical)" + "system": "http://hl7.org/fhir/v2/0074", + "code": "PAT", + "display": "Pathology (gross & histopath, not surgical)" } ] }, - "code":{ - "coding":[ + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"721981007", - "display":"Diagnostic studies report" + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "issued":"2010-02-25T15:41:00+00:00", - "specimen":[ + "issued": "2010-02-25T15:41:00+00:00", + "specimen": [ { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], - "result":[ + "result": [ { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" }, { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" }, { - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" }, { - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" }, { - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" }, { - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ] } }, { - "resource":{ - "resourceType":"Specimen", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Specimen", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" } ], - "accessionIdentifier":{ - "value":"CH000056DN" + "accessionIdentifier": { + "value": "CH000056DN" }, - "type":{ - "text":"URINE" + "type": { + "text": "URINE" }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime":"2010-02-24T15:41:00+00:00", - "collection":{ - "collectedDateTime":"2010-02-23T00:00:00+00:00" + "receivedTime": "2010-02-24T15:41:00+00:00", + "collection": { + "collectedDateTime": "2010-02-23T00:00:00+00:00" } } }, { - "resource":{ - "resourceType":"Specimen", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Specimen", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" } ], - "accessionIdentifier":{ - "value":"CH000056DO" + "accessionIdentifier": { + "value": "CH000056DO" }, - "type":{ - "text":"SERUM" + "type": { + "text": "SERUM" }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime":"2001-03-30T12:21:00+01:00", - "collection":{ - "collectedDateTime":"2010-02-23T15:41:00+00:00" + "receivedTime": "2001-03-30T12:21:00+01:00", + "collection": { + "collectedDateTime": "2010-02-23T15:41:00+00:00" } } }, { - "resource":{ - "resourceType":"Specimen", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Specimen", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], - "accessionIdentifier":{ - "value":"CH000056DP" + "accessionIdentifier": { + "value": "CH000056DP" }, - "type":{ - "text":"SERUM" + "type": { + "text": "SERUM" }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime":"2010-02-24T15:41:00+00:00" + "receivedTime": "2010-02-24T15:41:00+00:00" } }, { - "resource":{ - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } ], - "status":"unknown", - "category":[ + "status": "unknown", + "category": [ { - "coding":[ + "coding": [ { - "system":"http://hl7.org/fhir/observation-category", - "code":"laboratory", - "display":"Laboratory" + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "Laboratory" } ] } ], - "code":{ - "coding":[ + "code": { + "coding": [ { - "system":"http://read.info/readv2", - "code":"465..00", - "display":"Urine pregnancy test", - "userSelected":true + "system": "http://read.info/readv2", + "code": "465..00", + "display": "Urine pregnancy test", + "userSelected": true }, { - "extension":[ + "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension":[ + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension": [ { - "url":"descriptionId", - "valueId":"2564081000000118" + "url": "descriptionId", + "valueId": "2564081000000118" } ] } ], - "system":"http://snomed.info/sct", - "code":"1003161000000106", - "display":"Urine pregnancy test" + "system": "http://snomed.info/sct", + "code": "1003161000000106", + "display": "Urine pregnancy test" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2010-02-23", - "issued":"2010-02-25T15:41:00+00:00", - "performer":[ + "effectiveDateTime": "2010-02-23", + "issued": "2010-02-25T15:41:00+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", - "specimen":{ - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "comment": "NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", + "specimen": { + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, - "related":[ + "related": [ { - "type":"has-member", - "target":{ - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "type": "has-member", + "target": { + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Specimen", + "id": "NON-SIGNIFICANT-SPECIMEN", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" + ] + }, + "identifier": [ + { + "system": "https://wiremock/", + "value": "NON-SIGNIFICANT-SPECIMEN" + } + ], + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + }, + "receivedTime": "2001-02-03T10:00:00+00:00", + "collection": { + "collectedDateTime": "2001-02-03T11:00:00+00:00" + } + } + }, + { + "resource": { + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } ], - "status":"unknown", - "code":{ - "coding":[ + "status": "unknown", + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"(q) - Normal - No Action", - "related":[ + "comment": "(q) - Normal - No Action", + "related": [ { - "type":"derived-from", - "target":{ - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "type": "derived-from", + "target": { + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"FILING-COMMENT-WITH-NO-COMMENT", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "FILING-COMMENT-WITH-NO-COMMENT", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"FILING-COMMENT-WITH-NO-COMMENT" + "system": "https://EMISWeb/A82038", + "value": "FILING-COMMENT-WITH-NO-COMMENT" } ], - "status":"unknown", - "code":{ - "coding":[ + "status": "unknown", + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "related":[ + "related": [ { - "target":{ - "reference":"Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" + "target": { + "reference": "Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" } ], - "status":"unknown", - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "status": "unknown", + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "related":[ + "related": [ { - "type":"has-member", - "target":{ - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "type": "has-member", + "target": { + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } }, { - "type":"has-member", - "target":{ - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "type": "has-member", + "target": { + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } ], - "status":"unknown", - "code":{ - "coding":[ + "status": "unknown", + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"TEST COMMENT 1", - "related":[ + "comment": "TEST COMMENT 1", + "related": [ { - "type":"derived-from", - "target":{ - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "type": "derived-from", + "target": { + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } ], - "status":"unknown", - "code":{ - "coding":[ + "status": "unknown", + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"TEST COMMENT 2", - "related":[ + "comment": "TEST COMMENT 2", + "related": [ { - "type":"derived-from", - "target":{ - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "type": "derived-from", + "target": { + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "system": "https://EMISWeb/A82038", + "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } ], - "status":"unknown", - "category":[ + "status": "unknown", + "category": [ { - "coding":[ + "coding": [ { - "system":"http://hl7.org/fhir/observation-category", - "code":"laboratory", - "display":"Laboratory" + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "Laboratory" } ] } ], - "code":{ - "coding":[ + "code": { + "coding": [ { - "system":"http://read.info/readv2", - "code":"4465.00", - "display":"Serum oestradiol level", - "userSelected":true + "system": "http://read.info/readv2", + "code": "4465.00", + "display": "Serum oestradiol level", + "userSelected": true }, { - "extension":[ + "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension":[ + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension": [ { - "url":"descriptionId", - "valueId":"2551971000000110" + "url": "descriptionId", + "valueId": "2551971000000110" } ] } ], - "system":"http://snomed.info/sct", - "code":"1010521000000102", - "display":"Serum oestradiol level" + "system": "http://snomed.info/sct", + "code": "1010521000000102", + "display": "Serum oestradiol level" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2010-02-23", - "issued":"2010-02-25T15:41:00+00:00", - "performer":[ + "effectiveDateTime": "2010-02-23", + "issued": "2010-02-25T15:41:00+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "valueQuantity":{ - "value":8.800, - "unit":"mmol/L" + "valueQuantity": { + "value": 8.800, + "unit": "mmol/L" }, - "specimen":{ - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "specimen": { + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, - "referenceRange":[ + "referenceRange": [ { - "low":{ - "value":10.000, - "unit":"mmol/L" + "low": { + "value": 10.000, + "unit": "mmol/L" }, - "high":{ - "value":90.000, - "unit":"mmol/L" + "high": { + "value": 90.000, + "unit": "mmol/L" } } ], - "related":[ + "related": [ { - "type":"has-member", - "target":{ - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "type": "has-member", + "target": { + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "system": "https://EMISWeb/A82038", + "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } ], - "status":"unknown", - "code":{ - "coding":[ + "status": "unknown", + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:13.46+00:00", - "issued":"2020-12-15T15:17:13.46+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:13.46+00:00", + "issued": "2020-12-15T15:17:13.46+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"(q) - Normal - No Action", - "related":[ + "comment": "(q) - Normal - No Action", + "related": [ { - "type":"derived-from", - "target":{ - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "type": "derived-from", + "target": { + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"D0A358C9-4833-4827-B14B-E8515C25CB12", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "D0A358C9-4833-4827-B14B-E8515C25CB12", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"D0A358C9-4833-4827-B14B-E8515C25CB12" + "system": "https://EMISWeb/A82038", + "value": "D0A358C9-4833-4827-B14B-E8515C25CB12" } ], - "status":"unknown", - "category":[ + "status": "unknown", + "category": [ { - "coding":[ + "coding": [ { - "system":"http://hl7.org/fhir/observation-category", - "code":"laboratory", - "display":"Laboratory" + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "Laboratory" } ] } ], - "code":{ - "coding":[ + "code": { + "coding": [ { - "system":"http://read.info/readv2", - "code":"4483.00", - "display":"Serum ACTH", - "userSelected":true + "system": "http://read.info/readv2", + "code": "4483.00", + "display": "Serum ACTH", + "userSelected": true }, { - "extension":[ + "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension":[ + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension": [ { - "url":"descriptionId", - "valueId":"2563401000000119" + "url": "descriptionId", + "valueId": "2563401000000119" } ] } ], - "system":"http://snomed.info/sct", - "code":"997201000000100", - "display":"Serum ACTH (adrenocorticotrophic hormone) level" + "system": "http://snomed.info/sct", + "code": "997201000000100", + "display": "Serum ACTH (adrenocorticotrophic hormone) level" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2010-02-23", - "issued":"2010-02-25T15:41:00+00:00", - "performer":[ + "effectiveDateTime": "2010-02-23", + "issued": "2010-02-25T15:41:00+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"Test not available", - "specimen":{ - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "comment": "Test not available", + "specimen": { + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" }, - "related":[ + "related": [ { - "type":"has-member", - "target":{ - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "type": "has-member", + "target": { + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } } ] } }, { - "resource":{ - "resourceType":"Observation", - "id":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "system": "https://EMISWeb/A82038", + "value": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ], - "status":"unknown", - "code":{ - "coding":[ + "status": "unknown", + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:13.51+00:00", - "issued":"2020-12-15T15:17:13.51+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:13.51+00:00", + "issued": "2020-12-15T15:17:13.51+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"(q) - Normal - No Action", - "related":[ + "comment": "(q) - Normal - No Action", + "related": [ { - "type":"derived-from", - "target":{ - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "type": "derived-from", + "target": { + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" } } ] } }, + { + "resource": { + "resourceType": "Observation", + "id": "TEST-RESULT-NO-SPECIMEN", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" + ] + }, + "identifier": [ + { + "system": "https://wiremock/", + "value": "TEST-RESULT-NO-SPECIMEN" + } + ], + "status": "final", + "code": { + "coding": [ + { + "system": "http://read.info/readv2", + "code": "42R5.00", + "display": "Serum TIBC", + "userSelected": true + }, + { + "extension": [ + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension": [ + { + "url": "descriptionId", + "valueId": "2580111000000118" + } + ] + } + ], + "system": "http://snomed.info/sct", + "code": "1015451000000101", + "display": "Serum total iron binding capacity" + } + ] + }, + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + }, + "effectiveDateTime": "2001-02-03T12:00:00+00:00", + "issued": "2001-02-03T13:00:00+00:00", + "valueQuantity": { + "value": 42.000, + "unit": "umol/L" + } + } + }, { "resource": { "resourceType": "Practitioner", From 1fdc9e0241e595d770e94f9105756aba0f606c23 Mon Sep 17 00:00:00 2001 From: martin-nhs <127403254+martin-nhs@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:15:09 +0100 Subject: [PATCH 02/86] [NIAD-3217] Rename test data filename for clarity --- ...eport-with-one-specimen-and-test-result-with-no-specimen.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename service/src/test/resources/ehr/mapper/diagnosticreport/{diagnostic-report-with-test-result.json => diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json} (100%) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-test-result.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json similarity index 100% rename from service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-test-result.json rename to service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json From 2b17133824046dba2855f5a6bc4f8a1df5809a49 Mon Sep 17 00:00:00 2001 From: martin-nhs <127403254+martin-nhs@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:07:25 +0100 Subject: [PATCH 03/86] [NIAD-3217] Create initial test skeleton --- .../mapper/diagnosticreport/DiagnosticReportMapperTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 202b51e51c..ebb60e90cc 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -291,6 +291,11 @@ void When_DiagnosticReport_With_NoReferencedSpecimenAndFilingCommentWithNoCommen assertThat(actualXml).isEqualToIgnoringWhitespace(expectedXml); } + @Test + void When_DiagnosticReport_With_SpecimenAndTestResultWithNoSpecimen_Expect_TestResultDataToBePresentWithinObservationStatement() { + + } + private Bundle getBundleResourceFromJson(String filename) { final String filePath = TEST_FILE_DIRECTORY + filename; return FileParsingUtility.parseResourceFromJsonFile(filePath, Bundle.class); From e0327885ef7d41b1cafa52d915babf78eb9f9fde Mon Sep 17 00:00:00 2001 From: martin-nhs <127403254+martin-nhs@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:54:30 +0100 Subject: [PATCH 04/86] [NIAD-3217] Basic test implementation, fixed test data --- .../DiagnosticReportMapperTest.java | 20 ++++++ ...imen-and-test-result-with-no-specimen.json | 70 +++++++++---------- 2 files changed, 54 insertions(+), 36 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 9967cb3f1a..6f35a0e530 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -291,9 +291,29 @@ void When_DiagnosticReport_With_NoReferencedSpecimenAndFilingCommentWithNoCommen assertThat(actualXml).isEqualToIgnoringWhitespace(expectedXml); } + /** + * TODO + * + * It makes no sense whatsoever to place any logic within the SpecimenMapper - what we care + * about here is a DiagnosticReport with a Test Result (Observation). If the Observation has + * a related specimen - then this should be picked up by the SpecimenMapper. + * + * If there is an Observation (Test Result) WITHOUT a Specimen, then this I think should be handled + * within the ObservationMapper. + */ + @Test void When_DiagnosticReport_With_SpecimenAndTestResultWithNoSpecimen_Expect_TestResultDataToBePresentWithinObservationStatement() { + final String diagnosticReportFileName = "diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json"; + final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); + final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); + final InputBundle inputBundle = new InputBundle(bundle); + + when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); + + final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); + assertThat(actualXml).contains("ObservationStatement"); } private Bundle getBundleResourceFromJson(String filename) { diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json index aaae045e25..8f6701fce7 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json @@ -1,41 +1,39 @@ { - "resource": { - "resourceType": "DiagnosticReport", - "id": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC", - "meta": { - "profile": [ - "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" - ] - }, - "identifier": [ - { - "system": "https://wiremock/", - "value": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC" - } - ], - "status": "unknown", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "721981007", - "display": "Diagnostic studies report" - } - ] - }, - "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" - }, - "issued": "2001-02-03T09:00:00+00:00", - "specimen": [ - { - "reference": "Specimen/NON-SIGNIFICANT-SPECIMEN" - } - ], - "result": [ + "resourceType": "DiagnosticReport", + "id": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" + ] + }, + "identifier": [ + { + "system": "https://wiremock/", + "value": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC" + } + ], + "status": "unknown", + "code": { + "coding": [ { - "reference": "Observation/TEST-RESULT-NO-SPECIMEN" + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" } ] - } + }, + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + }, + "issued": "2001-02-03T09:00:00+00:00", + "specimen": [ + { + "reference": "Specimen/NON-SIGNIFICANT-SPECIMEN" + } + ], + "result": [ + { + "reference": "Observation/TEST-RESULT-NO-SPECIMEN" + } + ] } \ No newline at end of file From 65d36d0a2b259657d40fc5b15b49a44d2466fcae Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 30 Oct 2024 16:05:24 +0000 Subject: [PATCH 05/86] Minor changes. --- .../diagnosticreport/DiagnosticReportMapper.java | 11 +++++------ .../mapper/diagnosticreport/ObservationMapper.java | 2 +- .../diagnosticreport/DiagnosticReportMapperTest.java | 2 -- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index f4f773a9f4..03aa51f216 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -33,11 +33,7 @@ import uk.nhs.adaptors.gp2gp.common.service.ConfidentialityService; import uk.nhs.adaptors.gp2gp.common.service.RandomIdGeneratorService; -import uk.nhs.adaptors.gp2gp.ehr.mapper.CommentType; -import uk.nhs.adaptors.gp2gp.ehr.mapper.IdMapper; -import uk.nhs.adaptors.gp2gp.ehr.mapper.MessageContext; -import uk.nhs.adaptors.gp2gp.ehr.mapper.ParticipantMapper; -import uk.nhs.adaptors.gp2gp.ehr.mapper.ParticipantType; +import uk.nhs.adaptors.gp2gp.ehr.mapper.*; import uk.nhs.adaptors.gp2gp.ehr.mapper.parameters.diagnosticreport.DiagnosticReportCompoundStatementTemplateParameters; import uk.nhs.adaptors.gp2gp.ehr.mapper.parameters.diagnosticreport.NarrativeStatementTemplateParameters; import uk.nhs.adaptors.gp2gp.ehr.utils.CodeableConceptMappingUtils; @@ -114,6 +110,9 @@ private String fetchExtensionId(List identifiers) { } private List fetchSpecimens(DiagnosticReport diagnosticReport) { + + //if there are any orphan diagnostic reports, add a dummy specimen to each of them + if (!diagnosticReport.hasSpecimen()) { return Collections.singletonList(generateDefaultSpecimen(diagnosticReport)); } @@ -143,7 +142,7 @@ private List fetchObservations(DiagnosticReport diagnosticReport) { return Collections.singletonList(generateDefaultObservation(diagnosticReport)); } - var inputBundleHolder = messageContext.getInputBundleHolder(); + InputBundle inputBundleHolder = messageContext.getInputBundleHolder(); return diagnosticReport.getResult().stream() .map(Reference::getReferenceElement) .map(inputBundleHolder::getResource) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java index 7b3fc4557f..418ee64aa1 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java @@ -421,7 +421,7 @@ private String prepareStatementsForDerivedObservations(List { - var derivedObservation = derivedObservationHolder.getObservation(); + Observation derivedObservation = derivedObservationHolder.getObservation(); Optional observationStatement = prepareObservationStatement(derivedObservationHolder, CompoundStatementClassCode.CLUSTER); Optional narrativeStatements = prepareNarrativeStatements( diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 6f35a0e530..877d169673 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -115,8 +115,6 @@ public void setUp() throws IOException { when(idMapper.getOrNew(any(ResourceType.class), any(IdType.class))).thenAnswer(mockIdForResourceAndId()); when(agentDirectory.getAgentId(any(Reference.class))).thenAnswer(mockIdForReference()); when(randomIdGeneratorService.createNewId()).thenReturn(TEST_ID); - when(specimenMapper.mapSpecimenToCompoundStatement(any(Specimen.class), anyList(), any(DiagnosticReport.class))) - .thenAnswer(mockSpecimenMapping()); when(codeableConceptCdMapper.mapCodeableConceptToCd(any(CodeableConcept.class))) .thenReturn(CodeableConceptMapperMockUtil.NULL_FLAVOR_CODE); From df9bd6293712c318c968c931710f7123671d782d Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Fri, 1 Nov 2024 16:41:00 +0000 Subject: [PATCH 06/86] Adding JSON and XML files for unit tests Scenario 1: Files: diagnostic-report-with-one-specimen-and-one-unrelated-observation Diagnostic Report linked to Specimen Observation linked to Diagnostic Report Specimen linked to Diagnostic report (Observation is not linked to Specimen) ---- Scenario 2: Files: diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation Diagnostic Report linked to Specimen Observation linked to Diagnostic Report Specimen linked to both Diagnostic Report and Observation Observation linked to only Diagnostic Report (This creates an Observation unlinked to a Specimen) --- ...pecimen-and-one-unrelated-observation.json | 43 ++++++++++++ ...specimen-and-one-unrelated-observation.xml | 26 ++++++++ ...ervation-and-one-unlinked-observation.json | 47 +++++++++++++ ...servation-and-one-unlinked-observation.xml | 27 ++++++++ .../mapper/diagnosticreport/fhir_bundle.json | 66 +++++++++++++++++++ 5 files changed, 209 insertions(+) create mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json create mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml create mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json create mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json new file mode 100644 index 0000000000..f9994ece1e --- /dev/null +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json @@ -0,0 +1,43 @@ +{ + "resourceType": "DiagnosticReport", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" + ] + }, + "identifier": [ + { + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098" + } + ], + "status": "unknown", + "category": { + "coding": [ + { + "system": "http://hl7.org/fhir/v2/0074", + "code": "PAT", + "display": "Pathology (gross & histopath, not surgical)" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + }, + "issued": "2010-02-25T15:41:00+00:00", + "result": [ + { + "reference": "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7" + } + ] +} \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml new file mode 100644 index 0000000000..a36968b23f --- /dev/null +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml @@ -0,0 +1,26 @@ + + + + + Filed Report + + + +
+ + + + + + CommentType:LABORATORY RESULT COMMENT(E141) +CommentDate:20100225154100 + +Status: unknown + + + + + + + + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json new file mode 100644 index 0000000000..46369a294b --- /dev/null +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json @@ -0,0 +1,47 @@ +{ + "resourceType": "DiagnosticReport", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" + ] + }, + "identifier": [ + { + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098" + } + ], + "status": "unknown", + "category": { + "coding": [ + { + "system": "http://hl7.org/fhir/v2/0074", + "code": "PAT", + "display": "Pathology (gross & histopath, not surgical)" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + }, + "issued": "2010-02-25T15:41:00+00:00", + "specimen": [{ + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + }], + "result": [ + { + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", + "reference": "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7" + } + ] +} \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml new file mode 100644 index 0000000000..16df4a5268 --- /dev/null +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml @@ -0,0 +1,27 @@ + + + + + Filed Report + + + +
+ + + + + + CommentType:LABORATORY RESULT COMMENT(E141) +CommentDate:20100225154100 + +Status: unknown + + + + + + + + + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index eec39b4c91..bbf9a3e03d 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -628,6 +628,72 @@ ] } }, + { + "resource": { + "resourceType": "Observation", + "id": "AD373CA7-3940-4249-85A2-D3A22E9F17C7", + "meta": { + "profile": [ + "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" + ] + }, + "identifier": [ + { + "system": "https://EMISWeb/A82038", + "value": "AD373CA7-3940-4249-85A2-D3A22E9F17C7" + } + ], + "status": "unknown", + "category": [ + { + "coding": [ + { + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://read.info/readv2", + "code": "4483.00", + "display": "Serum ACTH", + "userSelected": true + }, + { + "extension": [ + { + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension": [ + { + "url": "descriptionId", + "valueId": "2563401000000119" + } + ] + } + ], + "system": "http://snomed.info/sct", + "code": "997201000000100", + "display": "Normal levels detected" + } + ] + }, + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + }, + "effectiveDateTime": "2010-02-23", + "issued": "2010-02-25T15:41:00+00:00", + "performer": [ + { + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + } + ], + "comment": "Test not available - this is a test result without a specimen." + } + }, { "resource": { "resourceType": "Observation", From 48c16b7d1568998595162b37fa5eedc97ab101b2 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 4 Nov 2024 10:20:16 +0000 Subject: [PATCH 07/86] Adding missing specimen --- ...port-with-one-specimen-and-one-unrelated-observation.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json index f9994ece1e..a0472d0c3c 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.json @@ -39,5 +39,10 @@ { "reference": "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7" } + ], + "specimen":[ + { + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + } ] } \ No newline at end of file From 4da233e7f5b7b1b48e9e60c28cfe412d63a13153 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 4 Nov 2024 15:06:29 +0000 Subject: [PATCH 08/86] Adding basic test case This is not complete as it: a) does no ID checking for the dummy specimen b) we do not yet verify that a result has a link to specimen, we just check that there is a specimen and result in a diagnostic report --- .../DiagnosticReportMapperTest.java | 20 +++++++------------ ...specimen-and-one-unrelated-observation.xml | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 877d169673..5364ba3252 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -115,6 +115,8 @@ public void setUp() throws IOException { when(idMapper.getOrNew(any(ResourceType.class), any(IdType.class))).thenAnswer(mockIdForResourceAndId()); when(agentDirectory.getAgentId(any(Reference.class))).thenAnswer(mockIdForReference()); when(randomIdGeneratorService.createNewId()).thenReturn(TEST_ID); + when(specimenMapper.mapSpecimenToCompoundStatement(any(Specimen.class), anyList(), any(DiagnosticReport.class))) + .thenAnswer(mockSpecimenMapping()); when(codeableConceptCdMapper.mapCodeableConceptToCd(any(CodeableConcept.class))) .thenReturn(CodeableConceptMapperMockUtil.NULL_FLAVOR_CODE); @@ -290,19 +292,12 @@ void When_DiagnosticReport_With_NoReferencedSpecimenAndFilingCommentWithNoCommen } /** - * TODO - * - * It makes no sense whatsoever to place any logic within the SpecimenMapper - what we care - * about here is a DiagnosticReport with a Test Result (Observation). If the Observation has - * a related specimen - then this should be picked up by the SpecimenMapper. - * - * If there is an Observation (Test Result) WITHOUT a Specimen, then this I think should be handled - * within the ObservationMapper. + * A Diagnosis Report may have an Observation (Test Result) and Specimen. If the result and specimen are not + * linked then we need to create a dummy specimen linked to the result. */ - @Test - void When_DiagnosticReport_With_SpecimenAndTestResultWithNoSpecimen_Expect_TestResultDataToBePresentWithinObservationStatement() { - final String diagnosticReportFileName = "diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json"; + void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecimenLinkedToTestResult() { + final String diagnosticReportFileName = "diagnostic-report-with-one-specimen-and-one-unrelated-observation.json"; final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); @@ -310,8 +305,7 @@ void When_DiagnosticReport_With_SpecimenAndTestResultWithNoSpecimen_Expect_TestR when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - - assertThat(actualXml).contains("ObservationStatement"); + assertThat(actualXml).contains("Mapped Specimen with id: DUMMY-SPECIMEN-"); } private Bundle getBundleResourceFromJson(String filename) { diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml index a36968b23f..277f673bfd 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml @@ -21,6 +21,6 @@ Status: unknown - + \ No newline at end of file From ff830baa1287e6f3e0a88f8517cfad4c7d122b98 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 4 Nov 2024 15:36:31 +0000 Subject: [PATCH 09/86] Adjust format of JSON --- ...one-linked-observation-and-one-unlinked-observation.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json index 46369a294b..4a00f170a5 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json @@ -39,9 +39,7 @@ "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }], "result": [ - { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", - "reference": "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7" - } + { "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" }, + { "reference": "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7" } ] } \ No newline at end of file From 3a7c375ac93dca651a5141eda3bab2b4535c4651 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Mon, 4 Nov 2024 15:45:25 +0000 Subject: [PATCH 10/86] Fixed test data Added placeholder for new linking between specimen and observation, and removed the old one. Added test for the second scenario and fixed the test data. --- .../DiagnosticReportMapper.java | 22 ++++++++++++++-- .../diagnosticreport/SpecimenMapper.java | 12 +-------- .../DiagnosticReportMapperTest.java | 26 ++++++++++++++++++- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 03aa51f216..4222ad93b6 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -111,13 +111,15 @@ private String fetchExtensionId(List identifiers) { private List fetchSpecimens(DiagnosticReport diagnosticReport) { - //if there are any orphan diagnostic reports, add a dummy specimen to each of them + //if there are any orphan observations, add a dummy specimen to each of them if (!diagnosticReport.hasSpecimen()) { return Collections.singletonList(generateDefaultSpecimen(diagnosticReport)); } - var inputBundleHolder = messageContext.getInputBundleHolder(); + fixOrphanedTestResults(diagnosticReport); + + InputBundle inputBundleHolder = messageContext.getInputBundleHolder(); return diagnosticReport.getSpecimen() .stream() .map(specimenReference -> inputBundleHolder.getResource(specimenReference.getReferenceElement())) @@ -126,6 +128,22 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport) { .collect(Collectors.toList()); } + private void fixOrphanedTestResults(DiagnosticReport diagnosticReport) { + + + if (diagnosticReport.hasResult()){ + List results = diagnosticReport.getResult(); + List specimens = diagnosticReport.getSpecimen(); + for (Reference specimen : specimens){ + + } + for (Reference result : results) { + // + //check each test result one by one, and if it doesn't have a dummy assigned to it, assign it. + } + } + } + private Specimen generateDefaultSpecimen(DiagnosticReport diagnosticReport) { Specimen specimen = new Specimen(); diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java index 963bfe60a7..3cf13ba710 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java @@ -137,18 +137,8 @@ private Optional buildSpecimenMaterialType(Specimen specimen) { } private String mapObservationsAssociatedWithSpecimen(Specimen specimen, List observations) { - List observationsAssociatedWithSpecimen; - - if (dummySpecimenOrObservationExists(specimen, observations)) { - observationsAssociatedWithSpecimen = observations; - } else { - observationsAssociatedWithSpecimen = observations.stream() - .filter(Observation::hasSpecimen) - .filter(observation -> observation.getSpecimen().getReference().equals(specimen.getId())) - .collect(Collectors.toList()); - } - return observationsAssociatedWithSpecimen.stream() + return observations.stream() .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) .map(observationMapper::mapObservationToCompoundStatement) .collect(Collectors.joining()); diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 5364ba3252..178c3661de 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -308,6 +308,19 @@ void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecime assertThat(actualXml).contains("Mapped Specimen with id: DUMMY-SPECIMEN-"); } + @Test + void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectScenario2() { + final String diagnosticReportFileName = "diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json"; + final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); + final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); + final InputBundle inputBundle = new InputBundle(bundle); + + when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); + + final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); + assertThat(actualXml).contains("Mapped Specimen with id: DUMMY-SPECIMEN-"); + } + private Bundle getBundleResourceFromJson(String filename) { final String filePath = TEST_FILE_DIRECTORY + filename; return FileParsingUtility.parseResourceFromJsonFile(filePath, Bundle.class); @@ -359,7 +372,18 @@ private Answer mockIdForReference() { private Answer mockSpecimenMapping() { return invocation -> { Specimen specimen = invocation.getArgument(0); - return String.format("", specimen.getId()); + List observations = invocation.getArgument(1); + + String linkedObservations = ""; + + for (Observation observation : observations) { + if(observation.getSpecimen().getReference() != null && observation.getSpecimen().getReference().equals(specimen.getId())){ + linkedObservations = linkedObservations + observation.getId() + ", "; + } + } + + + return String.format("", specimen.getId(), linkedObservations); }; } } \ No newline at end of file From 553d2e2d3f292008030caa955190cbaf12dfbcd6 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 5 Nov 2024 10:02:15 +0000 Subject: [PATCH 11/86] Added logic for creating and assigning dummy specimens. --- .../DiagnosticReportMapper.java | 76 ++++++++++++------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 4222ad93b6..19895a1457 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -8,6 +8,7 @@ import static uk.nhs.adaptors.gp2gp.ehr.mapper.CommentType.LABORATORY_RESULT_COMMENT; import static uk.nhs.adaptors.gp2gp.ehr.mapper.diagnosticreport.ObservationMapper.NARRATIVE_STATEMENT_TEMPLATE; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; @@ -69,13 +70,17 @@ public class DiagnosticReportMapper { private final ConfidentialityService confidentialityService; public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnosticReport) { - List specimens = fetchSpecimens(diagnosticReport); List observations = fetchObservations(diagnosticReport); + List specimens = fetchSpecimens(diagnosticReport, observations); final IdMapper idMapper = messageContext.getIdMapper(); markObservationsAsProcessed(idMapper, observations); + observations = fixOrphanedTestResults(observations, specimens, diagnosticReport); + + final List finalObservations = observations; + String mappedSpecimens = specimens.stream() - .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, observations, diagnosticReport)) + .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, finalObservations, diagnosticReport)) .collect(Collectors.joining()); String reportLevelNarrativeStatements = prepareReportLevelNarrativeStatements(diagnosticReport, observations); @@ -109,39 +114,62 @@ private String fetchExtensionId(List identifiers) { .orElse(StringUtils.EMPTY); } - private List fetchSpecimens(DiagnosticReport diagnosticReport) { + private List fetchSpecimens(DiagnosticReport diagnosticReport, List observations) { - //if there are any orphan observations, add a dummy specimen to each of them + // If there are any orphan observations, add a dummy specimen to each of them - if (!diagnosticReport.hasSpecimen()) { - return Collections.singletonList(generateDefaultSpecimen(diagnosticReport)); - } + List specimens = new ArrayList<>(); - fixOrphanedTestResults(diagnosticReport); + if (hasOrphanedTestResults(observations)) { + specimens.add(generateDefaultSpecimen(diagnosticReport)); + } InputBundle inputBundleHolder = messageContext.getInputBundleHolder(); - return diagnosticReport.getSpecimen() - .stream() - .map(specimenReference -> inputBundleHolder.getResource(specimenReference.getReferenceElement())) - .flatMap(Optional::stream) - .map(Specimen.class::cast) - .collect(Collectors.toList()); + List preExistingSpecimens = diagnosticReport.getSpecimen() + .stream() + .map(specimenReference -> inputBundleHolder.getResource(specimenReference.getReferenceElement())) + .flatMap(Optional::stream) + .map(Specimen.class::cast) + .collect(Collectors.toList()); + + specimens.addAll(preExistingSpecimens); + + return specimens; + } - private void fixOrphanedTestResults(DiagnosticReport diagnosticReport) { + private boolean hasOrphanedTestResults(List observations) { + for (Observation observation : observations) { + if (!observation.hasSpecimen()){ + return true; + } + } + + return false; + } + private List fixOrphanedTestResults(List observations, List specimens, DiagnosticReport diagnosticReport) { - if (diagnosticReport.hasResult()){ - List results = diagnosticReport.getResult(); - List specimens = diagnosticReport.getSpecimen(); - for (Reference specimen : specimens){ + Specimen dummySpecimen = new Specimen(); + for (Specimen specimen : specimens) { + if (specimen.getId().contains(DUMMY_SPECIMEN_ID_PREFIX)){ + dummySpecimen = specimen; + break; } - for (Reference result : results) { - // - //check each test result one by one, and if it doesn't have a dummy assigned to it, assign it. + } + + for (Observation observation : observations) { + if (!observation.hasSpecimen()){ + Reference dummySpecimenReference = new Reference(); + dummySpecimenReference.setReference(dummySpecimen.getId()); + dummySpecimenReference.setResource(dummySpecimen); + + observation.setSpecimen(dummySpecimenReference); } } + + return observations; } private Specimen generateDefaultSpecimen(DiagnosticReport diagnosticReport) { @@ -156,10 +184,6 @@ private Specimen generateDefaultSpecimen(DiagnosticReport diagnosticReport) { } private List fetchObservations(DiagnosticReport diagnosticReport) { - if (!diagnosticReport.hasResult()) { - return Collections.singletonList(generateDefaultObservation(diagnosticReport)); - } - InputBundle inputBundleHolder = messageContext.getInputBundleHolder(); return diagnosticReport.getResult().stream() .map(Reference::getReferenceElement) From 7a5be6629f86490156e3274edbb548e5f0bd690d Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Tue, 5 Nov 2024 10:06:28 +0000 Subject: [PATCH 12/86] Improve test name --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 178c3661de..b6a4d04c97 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -309,7 +309,7 @@ void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecime } @Test - void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectScenario2() { + void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ExpectASpecimenOnAllTestResults() { final String diagnosticReportFileName = "diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json"; final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); From af999655ebc7597a089feb835f5adc998527a105 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 5 Nov 2024 10:43:45 +0000 Subject: [PATCH 13/86] Added better assertion. --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapper.java | 1 - .../mapper/diagnosticreport/DiagnosticReportMapperTest.java | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 19895a1457..08526a7946 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -9,7 +9,6 @@ import static uk.nhs.adaptors.gp2gp.ehr.mapper.diagnosticreport.ObservationMapper.NARRATIVE_STATEMENT_TEMPLATE; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index b6a4d04c97..d9cb8d8634 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -318,7 +318,9 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - assertThat(actualXml).contains("Mapped Specimen with id: DUMMY-SPECIMEN-"); + + assertThat(actualXml).matches("(?s).*.*"); + } private Bundle getBundleResourceFromJson(String filename) { From 50320099649beb35bca036c687775fcf3334ddf6 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Tue, 5 Nov 2024 10:48:15 +0000 Subject: [PATCH 14/86] Cleaner --- .../mapper/diagnosticreport/DiagnosticReportMapperTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index d9cb8d8634..0659c969f5 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -314,12 +314,14 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); + final String regexpUuid = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"; + final String expectObservation = "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7"; when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - assertThat(actualXml).matches("(?s).*.*"); + assertThat(actualXml).matches("(?s).*.*"); } From f5afeb822347d8544f6b72a708a67c6d7d1a56dc Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Tue, 5 Nov 2024 10:49:34 +0000 Subject: [PATCH 15/86] Break lines up for readability. --- .../diagnosticreport/DiagnosticReportMapperTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 0659c969f5..547169dcc0 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -321,7 +321,12 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - assertThat(actualXml).matches("(?s).*.*"); + assertThat(actualXml).matches("(?s).*.*" + ); } From fd5bf52099b13ebd1c5300cf212f31893c2ed3d3 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Tue, 5 Nov 2024 10:53:17 +0000 Subject: [PATCH 16/86] Adding conditions for both types of test result, linked and unlinked --- .../DiagnosticReportMapperTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 547169dcc0..fc811b1c1e 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -320,11 +320,20 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - + + // This checks that the unlinked test result is given a dummy specimen. assertThat(actualXml).matches("(?s).*.*" + ); + + // This checks that the linked test result has its correct specimen. + assertThat(actualXml).matches("(?s).*.*" ); From 5b51bde60ed7ca6a01508223f2d04ed69ed7cbe5 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Tue, 5 Nov 2024 10:57:14 +0000 Subject: [PATCH 17/86] Changed matches to contains --- .../mapper/diagnosticreport/DiagnosticReportMapperTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index fc811b1c1e..d443b12c49 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -330,11 +330,11 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ ); // This checks that the linked test result has its correct specimen. - assertThat(actualXml).matches("(?s).*.*" + ", -->" ); } From a08509ea2c75c757330cd7f4ce9cccb5c57efb49 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Tue, 5 Nov 2024 11:16:24 +0000 Subject: [PATCH 18/86] Check the ids of dummy specimens map to the expected observations --- .../DiagnosticReportMapperTest.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index d443b12c49..1c4e292d59 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -87,6 +87,7 @@ class DiagnosticReportMapperTest { private static final String OUTPUT_XML_MULTIPLE_CODED_DIAGNOSIS = "diagnostic-report-with-multiple-coded-diagnosis.xml"; private static final String OUTPUT_XML_EXTENSION_ID = "diagnostic-report-with-extension-id.xml"; private static final String OUTPUT_XML_MULTIPLE_RESULTS = "diagnostic-report-with-multiple-results.xml"; + private static final String REGEXP_UUID = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"; @Mock private CodeableConceptCdMapper codeableConceptCdMapper; @@ -301,11 +302,19 @@ void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecime final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); + final String expectObservation = "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7"; when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - assertThat(actualXml).contains("Mapped Specimen with id: DUMMY-SPECIMEN-"); + + // This checks that the unlinked test result is given a dummy specimen. + assertThat(actualXml).matches("(?s).*.*" + ); } @Test @@ -314,7 +323,6 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); - final String regexpUuid = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"; final String expectObservation = "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7"; when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); @@ -323,7 +331,7 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ // This checks that the unlinked test result is given a dummy specimen. assertThat(actualXml).matches("(?s).*.*" From 983e4ab33b5317fa3f1962f6020b33b92f4215af Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Tue, 5 Nov 2024 11:27:56 +0000 Subject: [PATCH 19/86] Making code more DRY. --- .../DiagnosticReportMapperTest.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 1c4e292d59..049bffc2bd 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -88,6 +88,8 @@ class DiagnosticReportMapperTest { private static final String OUTPUT_XML_EXTENSION_ID = "diagnostic-report-with-extension-id.xml"; private static final String OUTPUT_XML_MULTIPLE_RESULTS = "diagnostic-report-with-multiple-results.xml"; private static final String REGEXP_UUID = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"; + private static final String MOCKED_SPECIMEN_PREFIX = "Mapped Specimen with id"; + private static final String MOCKED_SPECIMEN_LINKED_OBSERVATION = "with linked Observations"; @Mock private CodeableConceptCdMapper codeableConceptCdMapper; @@ -303,15 +305,16 @@ void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecime final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); final String expectObservation = "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7"; + final String dummyNamePrefix = DiagnosticReportMapper.DUMMY_SPECIMEN_ID_PREFIX; when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); // This checks that the unlinked test result is given a dummy specimen. - assertThat(actualXml).matches("(?s).*.*" ); @@ -324,23 +327,23 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); final String expectObservation = "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7"; - + final String dummyNamePrefix = DiagnosticReportMapper.DUMMY_SPECIMEN_ID_PREFIX; when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); // This checks that the unlinked test result is given a dummy specimen. - assertThat(actualXml).matches("(?s).*.*" ); // This checks that the linked test result has its correct specimen. - assertThat(actualXml).containsIgnoringWhitespaces("" ); @@ -407,9 +410,8 @@ private Answer mockSpecimenMapping() { linkedObservations = linkedObservations + observation.getId() + ", "; } } - - - return String.format("", specimen.getId(), linkedObservations); + + return String.format("", specimen.getId(), linkedObservations); }; } } \ No newline at end of file From 84dce4aec4d804ad54202cf58a3c0536bcce9eaf Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 5 Nov 2024 14:01:17 +0000 Subject: [PATCH 20/86] Refactoring the logic for assigning specimens to observations. --- .../DiagnosticReportMapper.java | 47 +++++++------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 08526a7946..3518f1b2b8 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -69,20 +69,18 @@ public class DiagnosticReportMapper { private final ConfidentialityService confidentialityService; public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnosticReport) { - List observations = fetchObservations(diagnosticReport); - List specimens = fetchSpecimens(diagnosticReport, observations); + List initialObservations = fetchObservations(diagnosticReport); + List specimens = fetchSpecimens(diagnosticReport, initialObservations); final IdMapper idMapper = messageContext.getIdMapper(); - markObservationsAsProcessed(idMapper, observations); + markObservationsAsProcessed(idMapper, initialObservations); - observations = fixOrphanedTestResults(observations, specimens, diagnosticReport); - - final List finalObservations = observations; + final List processedObservations = assignDummySpecimensToOrphanedTestResults(initialObservations, specimens, diagnosticReport); String mappedSpecimens = specimens.stream() - .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, finalObservations, diagnosticReport)) + .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, processedObservations, diagnosticReport)) .collect(Collectors.joining()); - String reportLevelNarrativeStatements = prepareReportLevelNarrativeStatements(diagnosticReport, observations); + String reportLevelNarrativeStatements = prepareReportLevelNarrativeStatements(diagnosticReport, processedObservations); var diagnosticReportCompoundStatementTemplateParameters = DiagnosticReportCompoundStatementTemplateParameters.builder() .compoundStatementId(idMapper.getOrNew(ResourceType.DiagnosticReport, diagnosticReport.getIdElement())) @@ -114,9 +112,7 @@ private String fetchExtensionId(List identifiers) { } private List fetchSpecimens(DiagnosticReport diagnosticReport, List observations) { - - // If there are any orphan observations, add a dummy specimen to each of them - + List specimens = new ArrayList<>(); if (hasOrphanedTestResults(observations)) { @@ -129,7 +125,7 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List inputBundleHolder.getResource(specimenReference.getReferenceElement())) .flatMap(Optional::stream) .map(Specimen.class::cast) - .collect(Collectors.toList()); + .toList(); specimens.addAll(preExistingSpecimens); @@ -138,32 +134,23 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List observations) { - for (Observation observation : observations) { - if (!observation.hasSpecimen()){ - return true; - } - } - return false; + return observations + .stream() + .anyMatch(observation -> !observation.hasSpecimen()); } - private List fixOrphanedTestResults(List observations, List specimens, DiagnosticReport diagnosticReport) { + private List assignDummySpecimensToOrphanedTestResults(List observations, List specimens, DiagnosticReport diagnosticReport) { - Specimen dummySpecimen = new Specimen(); + // The assumption was made that all test results without a specimen will have the same specimen referenced + Specimen dummySpecimen = specimens.stream() + .filter(specimen -> specimen.getId().contains(DUMMY_SPECIMEN_ID_PREFIX)) + .toList().getFirst(); - for (Specimen specimen : specimens) { - if (specimen.getId().contains(DUMMY_SPECIMEN_ID_PREFIX)){ - dummySpecimen = specimen; - break; - } - } + Reference dummySpecimenReference = new Reference(dummySpecimen.getId()); for (Observation observation : observations) { if (!observation.hasSpecimen()){ - Reference dummySpecimenReference = new Reference(); - dummySpecimenReference.setReference(dummySpecimen.getId()); - dummySpecimenReference.setResource(dummySpecimen); - observation.setSpecimen(dummySpecimenReference); } } From d511258f9d7d6b465b59e134cc1144c832649e23 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 5 Nov 2024 15:43:20 +0000 Subject: [PATCH 21/86] Added check for orphaned results before dummy specimens are assigned. --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 3518f1b2b8..7a28beafc9 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -112,7 +112,7 @@ private String fetchExtensionId(List identifiers) { } private List fetchSpecimens(DiagnosticReport diagnosticReport, List observations) { - + List specimens = new ArrayList<>(); if (hasOrphanedTestResults(observations)) { @@ -142,6 +142,10 @@ private boolean hasOrphanedTestResults(List observations) { private List assignDummySpecimensToOrphanedTestResults(List observations, List specimens, DiagnosticReport diagnosticReport) { + if (!hasOrphanedTestResults(observations)) { + return observations; + } + // The assumption was made that all test results without a specimen will have the same specimen referenced Specimen dummySpecimen = specimens.stream() .filter(specimen -> specimen.getId().contains(DUMMY_SPECIMEN_ID_PREFIX)) From cc146ea318d112e96c01fb4449151a7c9542d1b1 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 6 Nov 2024 16:39:47 +0000 Subject: [PATCH 22/86] Added better marking in tests for mapped specimens. --- .../DiagnosticReportMapper.java | 2 +- .../DiagnosticReportMapperTest.java | 17 +++++++++++------ .../diagnostic-report-with-multiple-results.xml | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 7a28beafc9..5bba535bb4 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -115,7 +115,7 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List specimens = new ArrayList<>(); - if (hasOrphanedTestResults(observations)) { + if (!diagnosticReport.hasSpecimen() || hasOrphanedTestResults(observations)) { specimens.add(generateDefaultSpecimen(diagnosticReport)); } diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 049bffc2bd..14ce0517c9 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -6,6 +6,7 @@ import static org.mockito.Mockito.when; import java.io.IOException; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; @@ -316,7 +317,7 @@ void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecime REGEXP_UUID + " " + MOCKED_SPECIMEN_LINKED_OBSERVATION + ": " + expectObservation + - ", -->.*" + "-->.*" ); } @@ -337,7 +338,7 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ REGEXP_UUID + " " + MOCKED_SPECIMEN_LINKED_OBSERVATION + ": " + expectObservation + - ", -->.*" + "-->.*" ); // This checks that the linked test result has its correct specimen. @@ -345,7 +346,7 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + MOCKED_SPECIMEN_LINKED_OBSERVATION + ":" + "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + - ", -->" + " -->" ); } @@ -403,15 +404,19 @@ private Answer mockSpecimenMapping() { Specimen specimen = invocation.getArgument(0); List observations = invocation.getArgument(1); - String linkedObservations = ""; + List linkedObservations = new ArrayList<>(); for (Observation observation : observations) { if(observation.getSpecimen().getReference() != null && observation.getSpecimen().getReference().equals(specimen.getId())){ - linkedObservations = linkedObservations + observation.getId() + ", "; + linkedObservations.add(observation.getId()); } } + + if(linkedObservations.isEmpty()){ + return String.format("", specimen.getId()); + } - return String.format("", specimen.getId(), linkedObservations); + return String.format("", specimen.getId(), String.join(",", linkedObservations)); }; } } \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml index 737f71cac4..3029b75293 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml @@ -62,6 +62,6 @@ CommentDate:20100225154100 - + \ No newline at end of file From 71cdc9f9709ce044fbfa7bba6e50251ba70f18ac Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 6 Nov 2024 17:23:13 +0000 Subject: [PATCH 23/86] Fixed test data from ehr extract mapper. --- ...ed-xml-with-observations-inside-report.xml | 280 +++++++------ ...ected-xml-with-standalone-observations.xml | 388 +++++++++--------- 2 files changed, 346 insertions(+), 322 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml index fc567ff8ca..5577d1d584 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml @@ -39,133 +39,167 @@ - - - - - - Unknown - - - - TEMPLE SOWERBY MEDICAL PRACTICE - - - - - - - - - - - - -
- - - - - - - - - - - - - - Filed Report - - - -
- - - - - - CommentType:LABORATORY RESULT COMMENT(E141) -CommentDate:20030221115000 + + + + + + Unknown + + + + TEMPLE SOWERBY MEDICAL PRACTICE + + + + + + + + + + + + +
+ + + + + + + + + + + + + + Filed Report + + + +
+ + + + + + CommentType:LABORATORY RESULT COMMENT(E141) + CommentDate:20030221115000 -Status: unknown - - - - - - - CommentType:AGGREGATE COMMENT SET -CommentDate:20030221115000 + Status: unknown + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20030221115000 -Filing Date: 2010-01-13 - - - - - - - CommentType:USER COMMENT -CommentDate:20030221115000 + Filing Date: 2010-01-13 + + + + + + + CommentType:USER COMMENT + CommentDate:20030221115000 -This is some random free text - - - - - - - - - - -
- - - - - - - -
- - - Blood - - - - - - - CommentType:LAB SPECIMEN COMMENT(E271) -CommentDate:20030109000000 + This is some random free text + + + + + + + + + + +
+ + + + + + + +
+ + + UNKNOWN + + + + + + + Mocked code + + +
+ + + + + + + + + + + +
+ + + + + + + +
+ + + Blood + + + + + + + CommentType:LAB SPECIMEN COMMENT(E271) + CommentDate:20030109000000 -Received Date: 2003-01-09 13:54 - - - - - - - - Mocked code - - -
- - - - - - - - - - + Received Date: 2003-01-09 13:54 + + + + + + + + + Mocked code + + +
+ + + + + + + + + + diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index aea9b667b2..23617abc3d 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -39,211 +39,201 @@ - - - - - - Unknown - - - - TEMPLE SOWERBY MEDICAL PRACTICE - - - - - - - - - Unknown - - - - Dr - David - McAvenue - - - - - - - - - - - - -
- - - - - - - - - - - - - - Filed Report - - - -
- - - - - - CommentType:LABORATORY RESULT COMMENT(E141) -CommentDate:20030221115000 + + + + + + Unknown + + + + TEMPLE SOWERBY MEDICAL PRACTICE + + + + + + + + + Unknown + + + + Dr + David + McAvenue + + + + + + + + + + + + +
+ + + + + + + + + + + + + + Filed Report + + + +
+ + + + + + CommentType:LABORATORY RESULT COMMENT(E141) + CommentDate:20030221115000 -Status: unknown - - - - - - - - - - -
- - - - - - - -
- - - Blood - - - - - - - CommentType:LAB SPECIMEN COMMENT(E271) -CommentDate:20030109000000 + Status: unknown + + + + + + + + + + +
+ + + + + + + +
+ + + Blood + + + + + + + CommentType:LAB SPECIMEN COMMENT(E271) + CommentDate:20030109000000 -Received Date: 2003-01-09 13:54 - - - - - - - - - CommentType:AGGREGATE COMMENT SET -CommentDate:UNK + Received Date: 2003-01-09 13:54 -EMPTY REPORT - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - This is some random free text - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - Mocked code - - -
- - + EMPTY SPECIMEN + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + This is some random free text + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Mocked code + + +
+ + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + From 57f792fa4f0a77f529c2f49996c156f231ee8371 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 6 Nov 2024 17:34:50 +0000 Subject: [PATCH 24/86] Fixed checkstyle violations --- .../diagnosticreport/DiagnosticReportMapper.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 5bba535bb4..c17200050f 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -33,7 +33,12 @@ import uk.nhs.adaptors.gp2gp.common.service.ConfidentialityService; import uk.nhs.adaptors.gp2gp.common.service.RandomIdGeneratorService; -import uk.nhs.adaptors.gp2gp.ehr.mapper.*; +import uk.nhs.adaptors.gp2gp.ehr.mapper.CommentType; +import uk.nhs.adaptors.gp2gp.ehr.mapper.IdMapper; +import uk.nhs.adaptors.gp2gp.ehr.mapper.MessageContext; +import uk.nhs.adaptors.gp2gp.ehr.mapper.ParticipantMapper; +import uk.nhs.adaptors.gp2gp.ehr.mapper.ParticipantType; +import uk.nhs.adaptors.gp2gp.ehr.mapper.InputBundle; import uk.nhs.adaptors.gp2gp.ehr.mapper.parameters.diagnosticreport.DiagnosticReportCompoundStatementTemplateParameters; import uk.nhs.adaptors.gp2gp.ehr.mapper.parameters.diagnosticreport.NarrativeStatementTemplateParameters; import uk.nhs.adaptors.gp2gp.ehr.utils.CodeableConceptMappingUtils; @@ -74,7 +79,8 @@ public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnostic final IdMapper idMapper = messageContext.getIdMapper(); markObservationsAsProcessed(idMapper, initialObservations); - final List processedObservations = assignDummySpecimensToOrphanedTestResults(initialObservations, specimens, diagnosticReport); + final List processedObservations = + assignDummySpecimensToOrphanedTestResults(initialObservations, specimens); String mappedSpecimens = specimens.stream() .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, processedObservations, diagnosticReport)) @@ -140,7 +146,8 @@ private boolean hasOrphanedTestResults(List observations) { .anyMatch(observation -> !observation.hasSpecimen()); } - private List assignDummySpecimensToOrphanedTestResults(List observations, List specimens, DiagnosticReport diagnosticReport) { + private List assignDummySpecimensToOrphanedTestResults( + List observations, List specimens) { if (!hasOrphanedTestResults(observations)) { return observations; @@ -154,7 +161,7 @@ private List assignDummySpecimensToOrphanedTestResults(List Date: Wed, 6 Nov 2024 17:46:07 +0000 Subject: [PATCH 25/86] Fixed checkstyle violations in the test file --- .../DiagnosticReportMapperTest.java | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 14ce0517c9..d8b55128b6 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -300,7 +300,7 @@ void When_DiagnosticReport_With_NoReferencedSpecimenAndFilingCommentWithNoCommen * linked then we need to create a dummy specimen linked to the result. */ @Test - void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecimenLinkedToTestResult() { + void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_Expect_ADummySpecimenLinkedToTestResult() { final String diagnosticReportFileName = "diagnostic-report-with-one-specimen-and-one-unrelated-observation.json"; final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); @@ -313,17 +313,18 @@ void When_DiagnosticReport_Has_SpecimenAndUnlinkedTestResult_ExpectADummySpecime final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); // This checks that the unlinked test result is given a dummy specimen. - assertThat(actualXml).matches("(?s).*.*" + assertThat(actualXml).matches("(?s).*.*" ); } @Test - void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ExpectASpecimenOnAllTestResults() { - final String diagnosticReportFileName = "diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json"; + void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_Expect_ASpecimenOnAllTestResults() { + final String diagnosticReportFileName = + "diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json"; final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); @@ -332,21 +333,19 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - // This checks that the unlinked test result is given a dummy specimen. - assertThat(actualXml).matches("(?s).*.*" + assertThat(actualXml).matches("(?s).*.*" ); - // This checks that the linked test result has its correct specimen. - assertThat(actualXml).containsIgnoringWhitespaces("" + assertThat(actualXml).containsIgnoringWhitespaces("" ); } @@ -407,16 +406,19 @@ private Answer mockSpecimenMapping() { List linkedObservations = new ArrayList<>(); for (Observation observation : observations) { - if(observation.getSpecimen().getReference() != null && observation.getSpecimen().getReference().equals(specimen.getId())){ + if (observation.getSpecimen().getReference() != null + && observation.getSpecimen().getReference().equals(specimen.getId())) { linkedObservations.add(observation.getId()); } } - if(linkedObservations.isEmpty()){ + if (linkedObservations.isEmpty()) { return String.format("", specimen.getId()); } - - return String.format("", specimen.getId(), String.join(",", linkedObservations)); + return String.format("", + specimen.getId(), + String.join(",", linkedObservations)); }; } } \ No newline at end of file From 4370cba665641e6ffb436d17496931828bfcf7a0 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Thu, 7 Nov 2024 14:26:05 +0000 Subject: [PATCH 26/86] Updating test result XML This file has new observations with dummy specimens that were being left out previously due to unlinked specimens. The resulting diff was huge, and the XML still poorly formatted. The unprettied diff didn't provide much useful context anyway, so I've pretty-printed it. --- .../expected-components-1.xml | 623 +++++++++++++++--- 1 file changed, 528 insertions(+), 95 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml index 240bffd73a..bccc16f85a 100644 --- a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml +++ b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml @@ -1,49 +1,51 @@ - Mocked code + + Mocked code + - + + - - Mocked code + + Mocked code + - + + - - + - + Mocked code - +
- - + - + observation comment - - + + - - + Active Problem, minor @@ -55,7 +57,7 @@ - + @@ -83,32 +85,31 @@ - - + Mocked code - + - - + + - - + + - + Mocked code - +
- + @@ -126,51 +127,49 @@ - - - Mocked code + + Mocked code + - + + - - Mocked code + + Mocked code + - + + - - + - + Mocked code - +
- - - + observation uncategorised - - @@ -192,7 +191,6 @@ - @@ -214,7 +212,6 @@ - @@ -236,7 +233,6 @@ - @@ -260,23 +256,19 @@ - Reason Ended: Patient reports no subsequent recurrence on same medication Status: Resolved - Type: Allergy Criticality: Low Risk Last Occurred: 1978-12-31 Example note text - + Reason Ended: Patient reports no subsequent recurrence on same medication Status: Resolved Type: Allergy Criticality: Low Risk Last Occurred: 1978-12-31 Example note text - - + - - Type: Referral Letter (21-Sep-2020) Description: for 2 week rule referral - skin ${ERROR_MESSAGE_PLACEHOLDER_ID=394559384658936}Setting: Practice Setting Text - - - + + Type: Referral Letter (21-Sep-2020) Description: for 2 week rule referral - skin ${ERROR_MESSAGE_PLACEHOLDER_ID=394559384658936}Setting: Practice Setting Text + + @@ -293,7 +285,6 @@ - @@ -347,14 +338,11 @@ - - + - + - UBRN: bb2378b6-dde2-11e9-9d36-2a2ae2dbcce4 Specialty: unknown Referred for investigation into low blood - pressure - + UBRN: bb2378b6-dde2-11e9-9d36-2a2ae2dbcce4 Specialty: unknown Referred for investigation into low blood pressure
@@ -365,7 +353,6 @@ - @@ -383,77 +370,237 @@ CommentType:LABORATORY RESULT COMMENT(E141) CommentDate:20100225154100 - Status: unknown - + Status: unknown - CommentType:AGGREGATE COMMENT SET CommentDate:20100225154100 - Filing Date: 2020-12-15 15:17:04 - + Filing Date: 2020-12-15 15:17:04 - CommentType:AGGREGATE COMMENT SET CommentDate:20100225154100 - Participants: Dr David McAvenue - + Participants: Dr David McAvenue - CommentType:USER COMMENT CommentDate:20100225154100 - (q) - Normal - No Action - + (q) - Normal - No Action - CommentType:USER COMMENT CommentDate:20100225154100 - (q) - Normal - No Action - + (q) - Normal - No Action - CommentType:USER COMMENT CommentDate:20100225154100 - (q) - Normal - No Action - + (q) - Normal - No Action + + + + + + +
+ + + + + + + +
+ + + UNKNOWN + + + + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + NEGATIVE + In normal pregnancies the test will usually be positive from the + second day after the expected menstruation. + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151704 + + (q) - Normal - No Action + + + + + + + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + mmol/L + + + + + + + + + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + + (q) - Normal - No Action + + + + + + + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + Test not available + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + + (q) - Normal - No Action + + + + + + + + @@ -519,8 +666,7 @@ NEGATIVE In normal pregnancies the test will usually be positive from the - second day after the expected menstruation. - + second day after the expected menstruation. @@ -531,17 +677,113 @@ CommentType:USER COMMENT CommentDate:20201215151704 - (q) - Normal - No Action - + (q) - Normal - No Action + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + mmol/L + + + + + + + + + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + + (q) - Normal - No Action + + + + + + + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + Test not available + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + + (q) - Normal - No Action + + + + + + - @@ -575,6 +817,56 @@ + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + NEGATIVE + In normal pregnancies the test will usually be positive from the + second day after the expected menstruation. + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151704 + + (q) - Normal - No Action + + + + + + @@ -610,17 +902,63 @@ + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + (q) - Normal - No Action + + + + + + + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + Test not available + + + + CommentType:USER COMMENT CommentDate:20201215151713 - (q) - Normal - No Action - + (q) - Normal - No Action @@ -629,7 +967,6 @@ - @@ -693,8 +1030,107 @@ CommentType:AGGREGATE COMMENT SET CommentDate:20100223 - Test not available - + NEGATIVE + In normal pregnancies the test will usually be positive from the + second day after the expected menstruation. + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151704 + + (q) - Normal - No Action + + + + + + + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + mmol/L + + + + + + + + + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + + (q) - Normal - No Action + + + + + + + + + + + Mocked code + + + +
+ + + + + + + Mocked code + + + +
+ + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + Test not available @@ -705,8 +1141,7 @@ CommentType:USER COMMENT CommentDate:20201215151713 - (q) - Normal - No Action - + (q) - Normal - No Action @@ -722,9 +1157,7 @@ - - \ No newline at end of file From 4002ef9a210061b1f08208b1fdfe3bbfdf379790 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Thu, 7 Nov 2024 14:26:05 +0000 Subject: [PATCH 27/86] Updating test result XML This file has new observations with dummy specimens that were being left out previously due to unlinked specimens. The resulting diff was huge, and the XML still poorly formatted. The unprettied diff didn't provide much useful context anyway, so I've pretty-printed it. Returning XML to un-pretty, without updates. From 38b9eef0e11a1dfb85a407b8a8354a1097a11a7f Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Thu, 7 Nov 2024 16:19:28 +0000 Subject: [PATCH 28/86] Reverted some unnecessary changes --- .../DiagnosticReportMapper.java | 25 +++++++++++-------- .../diagnosticreport/ObservationMapper.java | 2 +- .../diagnosticreport/SpecimenMapper.java | 20 +++++++++++---- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index c17200050f..927253be77 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -9,6 +9,7 @@ import static uk.nhs.adaptors.gp2gp.ehr.mapper.diagnosticreport.ObservationMapper.NARRATIVE_STATEMENT_TEMPLATE; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -74,13 +75,13 @@ public class DiagnosticReportMapper { private final ConfidentialityService confidentialityService; public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnosticReport) { - List initialObservations = fetchObservations(diagnosticReport); - List specimens = fetchSpecimens(diagnosticReport, initialObservations); + List observations = fetchObservations(diagnosticReport); + List specimens = fetchSpecimens(diagnosticReport, observations); final IdMapper idMapper = messageContext.getIdMapper(); - markObservationsAsProcessed(idMapper, initialObservations); + markObservationsAsProcessed(idMapper, observations); final List processedObservations = - assignDummySpecimensToOrphanedTestResults(initialObservations, specimens); + assignDummySpecimensToOrphanedTestResults(observations, specimens); String mappedSpecimens = specimens.stream() .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, processedObservations, diagnosticReport)) @@ -121,11 +122,12 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List specimens = new ArrayList<>(); + // At least one specimen is required to exist for any DiagnosticReport if (!diagnosticReport.hasSpecimen() || hasOrphanedTestResults(observations)) { - specimens.add(generateDefaultSpecimen(diagnosticReport)); + specimens.add(generateDummySpecimen(diagnosticReport)); } - InputBundle inputBundleHolder = messageContext.getInputBundleHolder(); + var inputBundleHolder = messageContext.getInputBundleHolder(); List preExistingSpecimens = diagnosticReport.getSpecimen() .stream() .map(specimenReference -> inputBundleHolder.getResource(specimenReference.getReferenceElement())) @@ -140,7 +142,6 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List observations) { - return observations .stream() .anyMatch(observation -> !observation.hasSpecimen()); @@ -153,7 +154,7 @@ private List assignDummySpecimensToOrphanedTestResults( return observations; } - // The assumption was made that all test results without a specimen will have the same specimen referenced + // The assumption was made that all test results without a specimen will have the same dummy specimen referenced Specimen dummySpecimen = specimens.stream() .filter(specimen -> specimen.getId().contains(DUMMY_SPECIMEN_ID_PREFIX)) .toList().getFirst(); @@ -169,7 +170,7 @@ private List assignDummySpecimensToOrphanedTestResults( return observations; } - private Specimen generateDefaultSpecimen(DiagnosticReport diagnosticReport) { + private Specimen generateDummySpecimen(DiagnosticReport diagnosticReport) { Specimen specimen = new Specimen(); specimen.setId(DUMMY_SPECIMEN_ID_PREFIX + randomIdGeneratorService.createNewId()); @@ -181,7 +182,11 @@ private Specimen generateDefaultSpecimen(DiagnosticReport diagnosticReport) { } private List fetchObservations(DiagnosticReport diagnosticReport) { - InputBundle inputBundleHolder = messageContext.getInputBundleHolder(); + if (!diagnosticReport.hasResult()) { + return Collections.singletonList(generateDefaultObservation(diagnosticReport)); + } + + var inputBundleHolder = messageContext.getInputBundleHolder(); return diagnosticReport.getResult().stream() .map(Reference::getReferenceElement) .map(inputBundleHolder::getResource) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java index cf2c55a091..400c9854e9 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java @@ -421,7 +421,7 @@ private String prepareStatementsForDerivedObservations(List { - Observation derivedObservation = derivedObservationHolder.getObservation(); + var derivedObservation = derivedObservationHolder.getObservation(); Optional observationStatement = prepareObservationStatement(derivedObservationHolder, CompoundStatementClassCode.CLUSTER); Optional narrativeStatements = prepareNarrativeStatements( diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java index 3cf13ba710..2b084e52f5 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java @@ -137,16 +137,26 @@ private Optional buildSpecimenMaterialType(Specimen specimen) { } private String mapObservationsAssociatedWithSpecimen(Specimen specimen, List observations) { + List observationsAssociatedWithSpecimen; + + if (dummySpecimenOrObservationExists(specimen, observations)) { + observationsAssociatedWithSpecimen = observations; + } else { + observationsAssociatedWithSpecimen = observations.stream() + .filter(Observation::hasSpecimen) + .filter(observation -> observation.getSpecimen().getReference().equals(specimen.getId())) + .collect(Collectors.toList()); + } - return observations.stream() - .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) - .map(observationMapper::mapObservationToCompoundStatement) - .collect(Collectors.joining()); + return observationsAssociatedWithSpecimen.stream() + .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) + .map(observationMapper::mapObservationToCompoundStatement) + .collect(Collectors.joining()); } private boolean dummySpecimenOrObservationExists(Specimen specimen, List observations) { return specimen.getIdElement().getIdPart().contains(DUMMY_SPECIMEN_ID_PREFIX) - || (!observations.isEmpty() && observations.getFirst().getIdElement().getIdPart().contains(DUMMY_OBSERVATION_ID_PREFIX)); + || (!observations.isEmpty() && observations.getFirst().getIdElement().getIdPart().contains(DUMMY_OBSERVATION_ID_PREFIX)); } private Optional buildSpecimenNarrativeStatement(Specimen specimen, String availabilityTimeElement, From 5641eb7556972fe55fbff6543a49a596580e180a Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Thu, 7 Nov 2024 16:21:26 +0000 Subject: [PATCH 29/86] Reverted unnecessary change --- .../diagnosticreport/DiagnosticReportMapper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 927253be77..b5b970c3a0 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -129,11 +129,11 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List preExistingSpecimens = diagnosticReport.getSpecimen() - .stream() - .map(specimenReference -> inputBundleHolder.getResource(specimenReference.getReferenceElement())) - .flatMap(Optional::stream) - .map(Specimen.class::cast) - .toList(); + .stream() + .map(specimenReference -> inputBundleHolder.getResource(specimenReference.getReferenceElement())) + .flatMap(Optional::stream) + .map(Specimen.class::cast) + .toList(); specimens.addAll(preExistingSpecimens); From c2433e3b8ad1d38248c06c0e9f78296497502f27 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Thu, 7 Nov 2024 16:22:54 +0000 Subject: [PATCH 30/86] Reverted unnecessary change --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index b5b970c3a0..5a53ea30b1 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -133,7 +133,7 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List inputBundleHolder.getResource(specimenReference.getReferenceElement())) .flatMap(Optional::stream) .map(Specimen.class::cast) - .toList(); + .collect(Collectors.toList()); specimens.addAll(preExistingSpecimens); From 05b6209b4ef0fee49256539906640f4adade137b Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Thu, 7 Nov 2024 16:24:13 +0000 Subject: [PATCH 31/86] Reverted unnecessary change --- .../mapper/diagnosticreport/SpecimenMapper.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java index 2b084e52f5..963bfe60a7 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java @@ -143,20 +143,20 @@ private String mapObservationsAssociatedWithSpecimen(Specimen specimen, List observation.getSpecimen().getReference().equals(specimen.getId())) - .collect(Collectors.toList()); + .filter(Observation::hasSpecimen) + .filter(observation -> observation.getSpecimen().getReference().equals(specimen.getId())) + .collect(Collectors.toList()); } return observationsAssociatedWithSpecimen.stream() - .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) - .map(observationMapper::mapObservationToCompoundStatement) - .collect(Collectors.joining()); + .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) + .map(observationMapper::mapObservationToCompoundStatement) + .collect(Collectors.joining()); } private boolean dummySpecimenOrObservationExists(Specimen specimen, List observations) { return specimen.getIdElement().getIdPart().contains(DUMMY_SPECIMEN_ID_PREFIX) - || (!observations.isEmpty() && observations.getFirst().getIdElement().getIdPart().contains(DUMMY_OBSERVATION_ID_PREFIX)); + || (!observations.isEmpty() && observations.getFirst().getIdElement().getIdPart().contains(DUMMY_OBSERVATION_ID_PREFIX)); } private Optional buildSpecimenNarrativeStatement(Specimen specimen, String availabilityTimeElement, From 545ecab12136a000b483a69112b32c680d04599d Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Thu, 7 Nov 2024 16:33:53 +0000 Subject: [PATCH 32/86] Scenario: Diagnostic Report with no Specimen or Observation Therefore create a dummy specimen and link it to a dummy observation. --- .../diagnostic-report-with-status-narrative.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-status-narrative.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-status-narrative.xml index c3887c0569..980c082748 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-status-narrative.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-status-narrative.xml @@ -20,6 +20,6 @@ Status: unknown - + \ No newline at end of file From dd1a5fcc97f97dbaa0f26fc29b180d628aba0c79 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Thu, 7 Nov 2024 16:55:23 +0000 Subject: [PATCH 33/86] Updating mapped dummy observations test cases --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java | 2 +- .../diagnosticreport/diagnostic-report-with-conclusion.xml | 2 +- .../diagnosticreport/diagnostic-report-with-extension-id.xml | 2 +- .../diagnosticreport/diagnostic-report-with-multi-specimens.xml | 2 +- .../diagnostic-report-with-multiple-coded-diagnosis.xml | 2 +- .../diagnosticreport/diagnostic-report-with-one-specimen.xml | 1 + .../diagnosticreport/diagnostic-report-with-participant.xml | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index d8b55128b6..1c88fcd1f3 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -141,7 +141,7 @@ void When_MappingDiagnosticReportJson_Expect_CompoundStatementXmlOutput(String i final String outputMessage = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); - assertThat(removeLineEndings(outputMessage)).isEqualTo(removeLineEndings(expectedOutputMessage.toString())); + assertThat(removeLineEndings(outputMessage)).isEqualToIgnoringWhitespace(removeLineEndings(expectedOutputMessage.toString())); } @Test diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-conclusion.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-conclusion.xml index ae32c6c163..bbf2a38a35 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-conclusion.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-conclusion.xml @@ -30,6 +30,6 @@ Status: unknown - + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-extension-id.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-extension-id.xml index 911c174646..2e8e85a438 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-extension-id.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-extension-id.xml @@ -21,6 +21,6 @@ Status: unknown - + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml index 805aac6620..4f249eb622 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml @@ -20,6 +20,6 @@ Status: unknown - + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-coded-diagnosis.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-coded-diagnosis.xml index fd9303aced..50737bd992 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-coded-diagnosis.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-coded-diagnosis.xml @@ -30,6 +30,6 @@ Status: unknown - + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen.xml index 040389af10..81dc98b00b 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen.xml @@ -20,6 +20,7 @@ Status: unknown + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-participant.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-participant.xml index 9da82f5740..ee7125e52f 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-participant.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-participant.xml @@ -30,7 +30,7 @@ Participants: TEMPLE SOWERBY MEDICAL PRACTICE - + From fb9d12da982fe26091c20b531e062c6f41b22d6a Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Thu, 7 Nov 2024 17:01:55 +0000 Subject: [PATCH 34/86] Linking dummy observations to dummy specimen --- .../diagnosticreport/diagnostic-report-with-coded-diagnosis.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-coded-diagnosis.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-coded-diagnosis.xml index 0075a26cef..e0f4f94e3b 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-coded-diagnosis.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-coded-diagnosis.xml @@ -30,6 +30,6 @@ Status: unknown - + \ No newline at end of file From 663c0a3e08d95105e2a56376c4c2ea99486ad4df Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Thu, 7 Nov 2024 17:03:30 +0000 Subject: [PATCH 35/86] Adding injected dummy specimen Looks like an ugly diff, but what it's actually doing is injecting a dummy specimen, leaving the rest of the data in-tact (albeit, moved) --- ...ected-xml-with-standalone-observations.xml | 63 ++++++++++++++++--- 1 file changed, 53 insertions(+), 10 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 23617abc3d..fb67f9d7ef 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -124,30 +124,73 @@ - + -
+
- Blood + UNKNOWN - CommentType:LAB SPECIMEN COMMENT(E271) - CommentDate:20030109000000 + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK - Received Date: 2003-01-09 13:54 - - EMPTY SPECIMEN + EMPTY REPORT - + - + + + + + + +
+ + + + + + + +
+ + + Blood + + + + + + + CommentType:LAB SPECIMEN COMMENT(E271) + CommentDate:20030109000000 + + Received Date: 2003-01-09 13:54 + + + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK + + EMPTY REPORT + + + + + + From 2f29e6c284a9a0673f1d9f457ed6942459868f19 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Fri, 8 Nov 2024 17:00:24 +0000 Subject: [PATCH 36/86] Adding injected block from scenario where the only changes made are to DiagnosticReportMapper.java and no changes to other test files. --- .../expected-components-1.xml | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml index bccc16f85a..cf05506547 100644 --- a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml +++ b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml @@ -431,7 +431,163 @@ + + + + + +
+ + + + + + + +
+ + + UNKNOWN + + + + + + + Mocked code + + +
+ + + + + + Mocked code + + +
+ + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + NEGATIVE + In normal pregnancies the test will usually be positive from the + second day after the expected menstruation. + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151704 + + (q) - Normal - No Action + + + + + + + + + Mocked code + + +
+ + + + + + Mocked code + + +
+ + + + + mmol/L + + + + + + + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + + (q) - Normal - No Action + + + + + + + + + Mocked code + + +
+ + + + + + Mocked code + + +
+ + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:20100223 + + Test not available + + + + + + + + CommentType:USER COMMENT + CommentDate:20201215151713 + + (q) - Normal - No Action + + + + + + + + + + From 13c6ea71d5d874bbe08f38e44fc50468e07b9f4d Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Fri, 8 Nov 2024 17:14:12 +0000 Subject: [PATCH 37/86] Removing superfluous XML, generated by our other changed tests. --- .../expected-components-1.xml | 467 ------------------ 1 file changed, 467 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml index cf05506547..523c85702d 100644 --- a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml +++ b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml @@ -587,177 +587,6 @@ - - - - - -
- - - - - - - -
- - - UNKNOWN - - - - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - - NEGATIVE - In normal pregnancies the test will usually be positive from the - second day after the expected menstruation. - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151704 - - (q) - Normal - No Action - - - - - - - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - mmol/L - - - - - - - - - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - - Test not available - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - - - - @@ -840,104 +669,6 @@ - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - mmol/L - - - - - - - - - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - - Test not available - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - @@ -973,56 +704,6 @@ - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - - NEGATIVE - In normal pregnancies the test will usually be positive from the - second day after the expected menstruation. - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151704 - - (q) - Normal - No Action - - - - - - @@ -1073,54 +754,6 @@ - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - - Test not available - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - @@ -1186,106 +819,6 @@ CommentType:AGGREGATE COMMENT SET CommentDate:20100223 - NEGATIVE - In normal pregnancies the test will usually be positive from the - second day after the expected menstruation. - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151704 - - (q) - Normal - No Action - - - - - - - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - mmol/L - - - - - - - - - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - - - - - - Mocked code - - - -
- - - - - - - Mocked code - - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - Test not available From 6a270e4a570fffb98ad906d51f045d711750f733 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Mon, 11 Nov 2024 13:35:05 +0000 Subject: [PATCH 38/86] Removed unused import --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapper.java | 1 - 1 file changed, 1 deletion(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 5a53ea30b1..04a19fafff 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -39,7 +39,6 @@ import uk.nhs.adaptors.gp2gp.ehr.mapper.MessageContext; import uk.nhs.adaptors.gp2gp.ehr.mapper.ParticipantMapper; import uk.nhs.adaptors.gp2gp.ehr.mapper.ParticipantType; -import uk.nhs.adaptors.gp2gp.ehr.mapper.InputBundle; import uk.nhs.adaptors.gp2gp.ehr.mapper.parameters.diagnosticreport.DiagnosticReportCompoundStatementTemplateParameters; import uk.nhs.adaptors.gp2gp.ehr.mapper.parameters.diagnosticreport.NarrativeStatementTemplateParameters; import uk.nhs.adaptors.gp2gp.ehr.utils.CodeableConceptMappingUtils; From 92b9c30a772afad54bf729b7a0de3d47ecca1ce3 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 16:21:56 +0000 Subject: [PATCH 39/86] Adjusting indention --- ...ed-xml-with-observations-inside-report.xml | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml index 5577d1d584..f7af7515cf 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml @@ -39,74 +39,74 @@ - - - - - - Unknown - - - - TEMPLE SOWERBY MEDICAL PRACTICE - - - - - - - - - - - - -
- - - - - - - - - - - - - - Filed Report - - - -
- - - - - - CommentType:LABORATORY RESULT COMMENT(E141) - CommentDate:20030221115000 - - Status: unknown - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20030221115000 + + + + + + Unknown + + + + TEMPLE SOWERBY MEDICAL PRACTICE + + + + + + + + + + + + +
+ + + + + + + + + + + + + + Filed Report + + + +
+ + + + + + CommentType:LABORATORY RESULT COMMENT(E141) +CommentDate:20030221115000 +Status: unknown + + + + + + + CommentType:AGGREGATE COMMENT SET +CommentDate:20030221115000 - Filing Date: 2010-01-13 - - - - +Filing Date: 2010-01-13 + + + + + CommentType:USER COMMENT From a1163fc97b6ab9fd6814431c52a0c1bf21ba571d Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 16:31:42 +0000 Subject: [PATCH 40/86] Adjusting indentation --- ...ed-xml-with-observations-inside-report.xml | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml index f7af7515cf..d0a98e5e61 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml @@ -91,11 +91,12 @@ CommentType:LABORATORY RESULT COMMENT(E141) CommentDate:20030221115000 + Status: unknown - - + + CommentType:AGGREGATE COMMENT SET @@ -105,51 +106,50 @@ Filing Date: 2010-01-13 + + + + CommentType:USER COMMENT + CommentDate:20030221115000 + + This is some random free text + + + + + + + + + +
+ + + + + + + +
+ + + UNKNOWN + + + - - - CommentType:USER COMMENT - CommentDate:20030221115000 - - This is some random free text - - - - - - - - - - -
- - - - - - - -
- - - UNKNOWN - - - - - - - Mocked code - - -
- - - - - + + + Mocked code + + +
+ + + + + From 297b9d79504fcc85ebc22a5812337c3b00005519 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 16:37:02 +0000 Subject: [PATCH 41/86] Adjusting indentation --- ...ed-xml-with-observations-inside-report.xml | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml index d0a98e5e61..06736ce25c 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml @@ -106,38 +106,38 @@ Filing Date: 2010-01-13 - - - - CommentType:USER COMMENT - CommentDate:20030221115000 + + + + CommentType:USER COMMENT +CommentDate:20030221115000 - This is some random free text - - - +This is some random free text + + + - - - - -
- - - - - - - -
- - - UNKNOWN - - - + + + + +
+ + + + + + + +
+ + + UNKNOWN + + + @@ -194,12 +194,12 @@ Filing Date: 2010-01-13 - - - - - - + + + + + + From 5f5d31ae9da70087e76330a9c67cbc597d2cb557 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 16:40:51 +0000 Subject: [PATCH 42/86] Adjust indentation --- ...ed-xml-with-observations-inside-report.xml | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml index 06736ce25c..7abd3776f1 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml @@ -117,8 +117,8 @@ This is some random free text - - + + @@ -172,28 +172,27 @@ This is some random free text - - - CommentType:LAB SPECIMEN COMMENT(E271) - CommentDate:20030109000000 + + + CommentType:LAB SPECIMEN COMMENT(E271) +CommentDate:20030109000000 - Received Date: 2003-01-09 13:54 - - - - - - - - - Mocked code - - -
- - - - +Received Date: 2003-01-09 13:54 + + + + + + + + Mocked code + + +
+ + + + From 6bf1f2162d6b544bd0092d6785ac0b5f3561dda8 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 16:42:00 +0000 Subject: [PATCH 43/86] Adjusting indentation --- .../output/expected-xml-with-observations-inside-report.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml index 7abd3776f1..3e3b7e484a 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml @@ -117,8 +117,8 @@ This is some random free text - - + + From f11a18b5b14c4e5f8402038f686ef57a7eee302e Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 16:56:20 +0000 Subject: [PATCH 44/86] Adjusting indentation --- .../expected-components-1.xml | 144 +++++++++++------- 1 file changed, 87 insertions(+), 57 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml index 523c85702d..40dd5b89f1 100644 --- a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml +++ b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml @@ -1,51 +1,49 @@ - - Mocked code - + Mocked code - - + + - - Mocked code - + Mocked code - - + + - + Mocked code - +
+ - + observation comment - - + + + - + Active Problem, minor @@ -57,7 +55,7 @@ - + @@ -85,31 +83,32 @@ + - + Mocked code - + - - + + - - + + - + Mocked code - +
- + @@ -127,49 +126,51 @@ + + - - Mocked code - + Mocked code - - + + - - Mocked code - + Mocked code - - + + - + Mocked code - +
+ + - + observation uncategorised + + @@ -191,6 +192,7 @@ + @@ -212,6 +214,7 @@ + @@ -233,6 +236,7 @@ + @@ -256,19 +260,23 @@ - Reason Ended: Patient reports no subsequent recurrence on same medication Status: Resolved Type: Allergy Criticality: Low Risk Last Occurred: 1978-12-31 Example note text + Reason Ended: Patient reports no subsequent recurrence on same medication Status: Resolved + Type: Allergy Criticality: Low Risk Last Occurred: 1978-12-31 Example note text + + - - Type: Referral Letter (21-Sep-2020) Description: for 2 week rule referral - skin ${ERROR_MESSAGE_PLACEHOLDER_ID=394559384658936}Setting: Practice Setting Text - - + + Type: Referral Letter (21-Sep-2020) Description: for 2 week rule referral - skin ${ERROR_MESSAGE_PLACEHOLDER_ID=394559384658936}Setting: Practice Setting Text + + + @@ -285,6 +293,7 @@ + @@ -338,11 +347,14 @@ + - + - UBRN: bb2378b6-dde2-11e9-9d36-2a2ae2dbcce4 Specialty: unknown Referred for investigation into low blood pressure + UBRN: bb2378b6-dde2-11e9-9d36-2a2ae2dbcce4 Specialty: unknown Referred for investigation into low blood + pressure +
@@ -353,6 +365,7 @@ + @@ -370,68 +383,79 @@ CommentType:LABORATORY RESULT COMMENT(E141) CommentDate:20100225154100 - Status: unknown + Status: unknown + + CommentType:AGGREGATE COMMENT SET CommentDate:20100225154100 - Filing Date: 2020-12-15 15:17:04 + Filing Date: 2020-12-15 15:17:04 + + CommentType:AGGREGATE COMMENT SET CommentDate:20100225154100 - Participants: Dr David McAvenue + Participants: Dr David McAvenue + + CommentType:USER COMMENT CommentDate:20100225154100 - (q) - Normal - No Action + (q) - Normal - No Action + + CommentType:USER COMMENT CommentDate:20100225154100 - (q) - Normal - No Action + (q) - Normal - No Action + + CommentType:USER COMMENT CommentDate:20100225154100 - (q) - Normal - No Action + (q) - Normal - No Action + - + @@ -480,7 +504,8 @@ NEGATIVE In normal pregnancies the test will usually be positive from the - second day after the expected menstruation. + second day after the expected menstruation. + @@ -491,7 +516,8 @@ CommentType:USER COMMENT CommentDate:20201215151704 - (q) - Normal - No Action + (q) - Normal - No Action + @@ -819,7 +845,8 @@ CommentType:AGGREGATE COMMENT SET CommentDate:20100223 - Test not available + Test not available + @@ -830,7 +857,8 @@ CommentType:USER COMMENT CommentDate:20201215151713 - (q) - Normal - No Action + (q) - Normal - No Action + @@ -846,7 +874,9 @@ + + \ No newline at end of file From 52dda17ec76fa72d8ecc840fc08c28db6393a5cf Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 17:01:07 +0000 Subject: [PATCH 45/86] Adjusting indentation --- .../expected-components-1.xml | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml index 40dd5b89f1..27c321756c 100644 --- a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml +++ b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml @@ -18,7 +18,7 @@ - + @@ -32,7 +32,7 @@ - + observation comment @@ -260,7 +260,7 @@ - Reason Ended: Patient reports no subsequent recurrence on same medication Status: Resolved + Reason Ended: Patient reports no subsequent recurrence on same medication Status: Resolved Type: Allergy Criticality: Low Risk Last Occurred: 1978-12-31 Example note text @@ -270,7 +270,7 @@ - + Type: Referral Letter (21-Sep-2020) Description: for 2 week rule referral - skin ${ERROR_MESSAGE_PLACEHOLDER_ID=394559384658936}Setting: Practice Setting Text @@ -348,11 +348,11 @@ - + - UBRN: bb2378b6-dde2-11e9-9d36-2a2ae2dbcce4 Specialty: unknown Referred for investigation into low blood + UBRN: bb2378b6-dde2-11e9-9d36-2a2ae2dbcce4 Specialty: unknown Referred for investigation into low blood pressure @@ -677,7 +677,8 @@ NEGATIVE In normal pregnancies the test will usually be positive from the - second day after the expected menstruation. + second day after the expected menstruation. + @@ -688,7 +689,8 @@ CommentType:USER COMMENT CommentDate:20201215151704 - (q) - Normal - No Action + (q) - Normal - No Action + @@ -697,6 +699,7 @@ + @@ -765,6 +768,7 @@ + @@ -773,7 +777,8 @@ CommentType:USER COMMENT CommentDate:20201215151713 - (q) - Normal - No Action + (q) - Normal - No Action + @@ -782,6 +787,7 @@ + From 3a16cbf7c9a59e9db4cd1eaa2f4e0574e70691c0 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 17:04:21 +0000 Subject: [PATCH 46/86] Adjust indentation --- .../mapper/encountercomponents/expected-components-1.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml index 27c321756c..370115a4ef 100644 --- a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml +++ b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml @@ -148,7 +148,7 @@ - + @@ -157,10 +157,10 @@
- - + + @@ -454,7 +454,6 @@ - From 03eea810d0cdd52909de426d2dfc1cd989e5c4ba Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 17:09:20 +0000 Subject: [PATCH 47/86] Adjusting whitespace --- .../mapper/diagnosticreport/fhir_bundle.json | 604 +++++++++--------- 1 file changed, 302 insertions(+), 302 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 6113615de6..a67589d572 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -1,87 +1,87 @@ { - "resourceType": "Bundle", + "resourceType":"Bundle", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/GPConnect-Searchset-Bundle-1" ] }, - "type": "searchset", + "type":"searchset", "entry": [ { - "resource": { - "resourceType": "DiagnosticReport", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098", - "meta": { - "profile": [ + "resource":{ + "resourceType":"DiagnosticReport", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098", + "meta":{ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098" + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098" } ], - "status": "unknown", - "category": { - "coding": [ + "status":"unknown", + "category":{ + "coding":[ { - "system": "http://hl7.org/fhir/v2/0074", - "code": "PAT", - "display": "Pathology (gross & histopath, not surgical)" + "system":"http://hl7.org/fhir/v2/0074", + "code":"PAT", + "display":"Pathology (gross & histopath, not surgical)" } ] }, - "code": { - "coding": [ + "code":{ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "721981007", - "display": "Diagnostic studies report" + "system":"http://snomed.info/sct", + "code":"721981007", + "display":"Diagnostic studies report" } ] }, - "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject":{ + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "issued": "2010-02-25T15:41:00+00:00", - "specimen": [ + "issued":"2010-02-25T15:41:00+00:00", + "specimen":[ { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], - "result": [ + "result":[ { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" }, { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" }, { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" }, { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" }, { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" }, { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ] } }, { "resource": { - "resourceType": "Specimen", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", + "resourceType":"Specimen", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" @@ -89,29 +89,29 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" } ], "accessionIdentifier": { - "value": "CH000056DN" + "value":"CH000056DN" }, "type": { - "text": "URINE" + "text":"URINE" }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime": "2010-02-24T15:41:00+00:00", + "receivedTime":"2010-02-24T15:41:00+00:00", "collection": { - "collectedDateTime": "2010-02-23T00:00:00+00:00" + "collectedDateTime":"2010-02-23T00:00:00+00:00" } } }, { "resource": { - "resourceType": "Specimen", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", + "resourceType":"Specimen", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" @@ -119,29 +119,29 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" } ], "accessionIdentifier": { - "value": "CH000056DO" + "value":"CH000056DO" }, "type": { - "text": "SERUM" + "text":"SERUM" }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime": "2001-03-30T12:21:00+01:00", + "receivedTime":"2001-03-30T12:21:00+01:00", "collection": { - "collectedDateTime": "2010-02-23T15:41:00+00:00" + "collectedDateTime":"2010-02-23T15:41:00+00:00" } } }, { "resource": { - "resourceType": "Specimen", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", + "resourceType":"Specimen", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" @@ -149,26 +149,26 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], "accessionIdentifier": { - "value": "CH000056DP" + "value":"CH000056DP" }, "type": { - "text": "SERUM" + "text":"SERUM" }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime": "2010-02-24T15:41:00+00:00" + "receivedTime":"2010-02-24T15:41:00+00:00" } }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -176,18 +176,18 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } ], - "status": "unknown", + "status":"unknown", "category": [ { "coding": [ { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "Laboratory" + "system":"http://hl7.org/fhir/observation-category", + "code":"laboratory", + "display":"Laboratory" } ] } @@ -195,48 +195,48 @@ "code": { "coding": [ { - "system": "http://read.info/readv2", - "code": "465..00", - "display": "Urine pregnancy test", + "system":"http://read.info/readv2", + "code":"465..00", + "display":"Urine pregnancy test", "userSelected": true }, { "extension": [ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url": "descriptionId", - "valueId": "2564081000000118" + "url":"descriptionId", + "valueId":"2564081000000118" } ] } ], - "system": "http://snomed.info/sct", - "code": "1003161000000106", - "display": "Urine pregnancy test" + "system":"http://snomed.info/sct", + "code":"1003161000000106", + "display":"Urine pregnancy test" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2010-02-23", - "issued": "2010-02-25T15:41:00+00:00", + "effectiveDateTime":"2010-02-23", + "issued":"2010-02-25T15:41:00+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", + "comment":"NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", "specimen": { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, "related": [ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } } ] @@ -244,8 +244,8 @@ }, { "resource": { - "resourceType": "Specimen", - "id": "NON-SIGNIFICANT-SPECIMEN", + "resourceType":"Specimen", + "id":"NON-SIGNIFICANT-SPECIMEN", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" @@ -253,23 +253,23 @@ }, "identifier": [ { - "system": "https://wiremock/", - "value": "NON-SIGNIFICANT-SPECIMEN" + "system":"https://wiremock/", + "value":"NON-SIGNIFICANT-SPECIMEN" } ], "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime": "2001-02-03T10:00:00+00:00", + "receivedTime":"2001-02-03T10:00:00+00:00", "collection": { - "collectedDateTime": "2001-02-03T11:00:00+00:00" + "collectedDateTime":"2001-02-03T11:00:00+00:00" } } }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -277,36 +277,36 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } ], - "status": "unknown", + "status":"unknown", "code": { "coding": [ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "(q) - Normal - No Action", + "comment":"(q) - Normal - No Action", "related": [ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -314,8 +314,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "FILING-COMMENT-WITH-NO-COMMENT", + "resourceType":"Observation", + "id":"FILING-COMMENT-WITH-NO-COMMENT", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -323,34 +323,34 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "FILING-COMMENT-WITH-NO-COMMENT" + "system":"https://EMISWeb/A82038", + "value":"FILING-COMMENT-WITH-NO-COMMENT" } ], - "status": "unknown", + "status":"unknown", "code": { "coding": [ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], "related": [ { "target": { - "reference": "Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" + "reference":"Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" } } ] @@ -358,8 +358,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -367,32 +367,32 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" } ], - "status": "unknown", + "status":"unknown", "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], "related": [ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } }, { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } } ] @@ -400,8 +400,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -409,36 +409,36 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } ], - "status": "unknown", + "status":"unknown", "code": { "coding": [ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "TEST COMMENT 1", + "comment":"TEST COMMENT 1", "related": [ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -446,8 +446,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -455,36 +455,36 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } ], - "status": "unknown", + "status":"unknown", "code": { "coding": [ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "TEST COMMENT 2", + "comment":"TEST COMMENT 2", "related": [ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -492,8 +492,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", + "resourceType":"Observation", + "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -501,18 +501,18 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "system":"https://EMISWeb/A82038", + "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } ], - "status": "unknown", + "status":"unknown", "category": [ { "coding": [ { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "Laboratory" + "system":"http://hl7.org/fhir/observation-category", + "code":"laboratory", + "display":"Laboratory" } ] } @@ -520,63 +520,63 @@ "code": { "coding": [ { - "system": "http://read.info/readv2", - "code": "4465.00", - "display": "Serum oestradiol level", + "system":"http://read.info/readv2", + "code":"4465.00", + "display":"Serum oestradiol level", "userSelected": true }, { "extension": [ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url": "descriptionId", - "valueId": "2551971000000110" + "url":"descriptionId", + "valueId":"2551971000000110" } ] } ], - "system": "http://snomed.info/sct", - "code": "1010521000000102", - "display": "Serum oestradiol level" + "system":"http://snomed.info/sct", + "code":"1010521000000102", + "display":"Serum oestradiol level" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2010-02-23", - "issued": "2010-02-25T15:41:00+00:00", + "effectiveDateTime":"2010-02-23", + "issued":"2010-02-25T15:41:00+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], "valueQuantity": { "value": 8.800, - "unit": "mmol/L" + "unit":"mmol/L" }, "specimen": { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, "referenceRange": [ { "low": { "value": 10.000, - "unit": "mmol/L" + "unit":"mmol/L" }, "high": { "value": 90.000, - "unit": "mmol/L" + "unit":"mmol/L" } } ], "related": [ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } } ] @@ -584,8 +584,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", + "resourceType":"Observation", + "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -593,36 +593,36 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "system":"https://EMISWeb/A82038", + "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } ], - "status": "unknown", + "status":"unknown", "code": { "coding": [ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:13.46+00:00", - "issued": "2020-12-15T15:17:13.46+00:00", + "effectiveDateTime":"2020-12-15T15:17:13.46+00:00", + "issued":"2020-12-15T15:17:13.46+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "(q) - Normal - No Action", + "comment":"(q) - Normal - No Action", "related": [ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } } ] @@ -630,8 +630,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "AD373CA7-3940-4249-85A2-D3A22E9F17C7", + "resourceType":"Observation", + "id":"AD373CA7-3940-4249-85A2-D3A22E9F17C7", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -639,18 +639,18 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "AD373CA7-3940-4249-85A2-D3A22E9F17C7" + "system":"https://EMISWeb/A82038", + "value":"AD373CA7-3940-4249-85A2-D3A22E9F17C7" } ], - "status": "unknown", + "status":"unknown", "category": [ { "coding": [ { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "Laboratory" + "system":"http://hl7.org/fhir/observation-category", + "code":"laboratory", + "display":"Laboratory" } ] } @@ -658,46 +658,46 @@ "code": { "coding": [ { - "system": "http://read.info/readv2", - "code": "4483.00", - "display": "Serum ACTH", + "system":"http://read.info/readv2", + "code":"4483.00", + "display":"Serum ACTH", "userSelected": true }, { "extension": [ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url": "descriptionId", - "valueId": "2563401000000119" + "url":"descriptionId", + "valueId":"2563401000000119" } ] } ], - "system": "http://snomed.info/sct", - "code": "997201000000100", - "display": "Normal levels detected" + "system":"http://snomed.info/sct", + "code":"997201000000100", + "display":"Normal levels detected" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2010-02-23", - "issued": "2010-02-25T15:41:00+00:00", + "effectiveDateTime":"2010-02-23", + "issued":"2010-02-25T15:41:00+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "Test not available - this is a test result without a specimen." + "comment":"Test not available - this is a test result without a specimen." } }, { "resource": { - "resourceType": "Observation", - "id": "D0A358C9-4833-4827-B14B-E8515C25CB12", + "resourceType":"Observation", + "id":"D0A358C9-4833-4827-B14B-E8515C25CB12", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -705,18 +705,18 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "D0A358C9-4833-4827-B14B-E8515C25CB12" + "system":"https://EMISWeb/A82038", + "value":"D0A358C9-4833-4827-B14B-E8515C25CB12" } ], - "status": "unknown", + "status":"unknown", "category": [ { "coding": [ { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "Laboratory" + "system":"http://hl7.org/fhir/observation-category", + "code":"laboratory", + "display":"Laboratory" } ] } @@ -724,48 +724,48 @@ "code": { "coding": [ { - "system": "http://read.info/readv2", - "code": "4483.00", - "display": "Serum ACTH", + "system":"http://read.info/readv2", + "code":"4483.00", + "display":"Serum ACTH", "userSelected": true }, { "extension": [ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url": "descriptionId", - "valueId": "2563401000000119" + "url":"descriptionId", + "valueId":"2563401000000119" } ] } ], - "system": "http://snomed.info/sct", - "code": "997201000000100", - "display": "Serum ACTH (adrenocorticotrophic hormone) level" + "system":"http://snomed.info/sct", + "code":"997201000000100", + "display":"Serum ACTH (adrenocorticotrophic hormone) level" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2010-02-23", - "issued": "2010-02-25T15:41:00+00:00", + "effectiveDateTime":"2010-02-23", + "issued":"2010-02-25T15:41:00+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "Test not available", + "comment":"Test not available", "specimen": { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" }, "related": [ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } } ] @@ -773,8 +773,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", + "resourceType":"Observation", + "id":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -782,36 +782,36 @@ }, "identifier": [ { - "system": "https://EMISWeb/A82038", - "value": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "system":"https://EMISWeb/A82038", + "value":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ], - "status": "unknown", + "status":"unknown", "code": { "coding": [ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:13.51+00:00", - "issued": "2020-12-15T15:17:13.51+00:00", + "effectiveDateTime":"2020-12-15T15:17:13.51+00:00", + "issued":"2020-12-15T15:17:13.51+00:00", "performer": [ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "(q) - Normal - No Action", + "comment":"(q) - Normal - No Action", "related": [ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" } } ] @@ -819,8 +819,8 @@ }, { "resource": { - "resourceType": "Observation", - "id": "TEST-RESULT-NO-SPECIMEN", + "resourceType":"Observation", + "id":"TEST-RESULT-NO-SPECIMEN", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -828,62 +828,62 @@ }, "identifier": [ { - "system": "https://wiremock/", - "value": "TEST-RESULT-NO-SPECIMEN" + "system":"https://wiremock/", + "value":"TEST-RESULT-NO-SPECIMEN" } ], - "status": "final", + "status":"final", "code": { "coding": [ { - "system": "http://read.info/readv2", - "code": "42R5.00", - "display": "Serum TIBC", + "system":"http://read.info/readv2", + "code":"42R5.00", + "display":"Serum TIBC", "userSelected": true }, { "extension": [ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url": "descriptionId", - "valueId": "2580111000000118" + "url":"descriptionId", + "valueId":"2580111000000118" } ] } ], - "system": "http://snomed.info/sct", - "code": "1015451000000101", - "display": "Serum total iron binding capacity" + "system":"http://snomed.info/sct", + "code":"1015451000000101", + "display":"Serum total iron binding capacity" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2001-02-03T12:00:00+00:00", - "issued": "2001-02-03T13:00:00+00:00", + "effectiveDateTime":"2001-02-03T12:00:00+00:00", + "issued":"2001-02-03T13:00:00+00:00", "valueQuantity": { "value": 42.000, - "unit": "umol/L" + "unit":"umol/L" } } }, { "resource": { - "resourceType": "Practitioner", - "id": "89890-1985-45D9-993E-C5FF51F36828", + "resourceType":"Practitioner", + "id":"89890-1985-45D9-993E-C5FF51F36828", "meta": { - "versionId": "7786052607397903776", + "versionId":"7786052607397903776", "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" ] }, "name": [ { - "use": "official", - "family": "Test", + "use":"official", + "family":"Test", "given": [ "NHS" ], @@ -892,34 +892,34 @@ ] } ], - "gender": "male" + "gender":"male" } }, { "resource": { - "resourceType": "Organization", - "id": "5E496953-065B-41F2-9577-BE8F2FBD0757", + "resourceType":"Organization", + "id":"5E496953-065B-41F2-9577-BE8F2FBD0757", "meta": { - "versionId": "1112974926854455048", + "versionId":"1112974926854455048", "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" ] }, "extension": [ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", "valueReference": { - "reference": "Location/EB3994A6-5A87-4B53-A414-913137072F57" + "reference":"Location/EB3994A6-5A87-4B53-A414-913137072F57" } } ], "identifier": [ { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "A82038" + "system":"https://fhir.nhs.uk/Id/ods-organization-code", + "value":"A82038" } ], - "name": "TEMPLE SOWERBY MEDICAL PRACTICE" + "name":"TEMPLE SOWERBY MEDICAL PRACTICE" } }, { @@ -967,7 +967,7 @@ "value":8.800, "unit":"mmol/L" }, - "comment": "Notes provided alongside test result", + "comment":"Notes provided alongside test result", "status":"unknown", "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" @@ -983,7 +983,7 @@ { "type":"has-member", "target":{ - "display": "Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", + "display":"Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", "reference":"Observation/TestResult-WithRelatedMember-WhichIsntAFilingComment" } } From d81a55b72f29b75b451526cd7875c23eb399f9e9 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 17:24:24 +0000 Subject: [PATCH 48/86] Fixing whitespace --- .../mapper/diagnosticreport/fhir_bundle.json | 584 +++++++++--------- 1 file changed, 292 insertions(+), 292 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index a67589d572..96fd460314 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -1,87 +1,87 @@ { - "resourceType":"Bundle", + "resourceType": "Bundle", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/GPConnect-Searchset-Bundle-1" ] }, - "type":"searchset", + "type": "searchset", "entry": [ { - "resource":{ - "resourceType":"DiagnosticReport", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098", - "meta":{ - "profile":[ + "resource": { + "resourceType": "DiagnosticReport", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098" } ], - "status":"unknown", - "category":{ - "coding":[ + "status": "unknown", + "category": { + "coding": [ { - "system":"http://hl7.org/fhir/v2/0074", - "code":"PAT", - "display":"Pathology (gross & histopath, not surgical)" + "system": "http://hl7.org/fhir/v2/0074", + "code": "PAT", + "display": "Pathology (gross & histopath, not surgical)" } ] }, - "code":{ - "coding":[ + "code": { + "coding": [ { - "system":"http://snomed.info/sct", - "code":"721981007", - "display":"Diagnostic studies report" + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" } ] }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "issued":"2010-02-25T15:41:00+00:00", - "specimen":[ + "issued": "2010-02-25T15:41:00+00:00", + "specimen": [ { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], - "result":[ + "result": [ { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" }, { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" }, { - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" }, { - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" }, { - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" }, { - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ] } }, { "resource": { - "resourceType":"Specimen", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", + "resourceType": "Specimen", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" @@ -89,29 +89,29 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" } ], "accessionIdentifier": { - "value":"CH000056DN" + "value": "CH000056DN" }, "type": { - "text":"URINE" + "text": "URINE" }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime":"2010-02-24T15:41:00+00:00", + "receivedTime": "2010-02-24T15:41:00+00:00", "collection": { - "collectedDateTime":"2010-02-23T00:00:00+00:00" + "collectedDateTime": "2010-02-23T00:00:00+00:00" } } }, { "resource": { - "resourceType":"Specimen", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", + "resourceType": "Specimen", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" @@ -119,29 +119,29 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" } ], "accessionIdentifier": { - "value":"CH000056DO" + "value": "CH000056DO" }, "type": { - "text":"SERUM" + "text": "SERUM" }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime":"2001-03-30T12:21:00+01:00", + "receivedTime": "2001-03-30T12:21:00+01:00", "collection": { - "collectedDateTime":"2010-02-23T15:41:00+00:00" + "collectedDateTime": "2010-02-23T15:41:00+00:00" } } }, { "resource": { - "resourceType":"Specimen", - "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", + "resourceType": "Specimen", + "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" @@ -149,26 +149,26 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "system": "https://EMISWeb/A82038", + "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], "accessionIdentifier": { - "value":"CH000056DP" + "value": "CH000056DP" }, "type": { - "text":"SERUM" + "text": "SERUM" }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime":"2010-02-24T15:41:00+00:00" + "receivedTime": "2010-02-24T15:41:00+00:00" } }, { "resource": { - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -176,18 +176,18 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } ], - "status":"unknown", + "status": "unknown", "category": [ { "coding": [ { - "system":"http://hl7.org/fhir/observation-category", - "code":"laboratory", - "display":"Laboratory" + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "Laboratory" } ] } @@ -195,48 +195,48 @@ "code": { "coding": [ { - "system":"http://read.info/readv2", - "code":"465..00", - "display":"Urine pregnancy test", + "system": "http://read.info/readv2", + "code": "465..00", + "display": "Urine pregnancy test", "userSelected": true }, { "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url":"descriptionId", - "valueId":"2564081000000118" + "url": "descriptionId", + "valueId": "2564081000000118" } ] } ], - "system":"http://snomed.info/sct", - "code":"1003161000000106", - "display":"Urine pregnancy test" + "system": "http://snomed.info/sct", + "code": "1003161000000106", + "display": "Urine pregnancy test" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2010-02-23", - "issued":"2010-02-25T15:41:00+00:00", + "effectiveDateTime": "2010-02-23", + "issued": "2010-02-25T15:41:00+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", + "comment": "NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", "specimen": { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, "related": [ { - "type":"has-member", + "type": "has-member", "target": { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } } ] @@ -268,8 +268,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -277,36 +277,36 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } ], - "status":"unknown", + "status": "unknown", "code": { "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"(q) - Normal - No Action", + "comment": "(q) - Normal - No Action", "related": [ { - "type":"derived-from", + "type": "derived-from", "target": { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -314,8 +314,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"FILING-COMMENT-WITH-NO-COMMENT", + "resourceType": "Observation", + "id": "FILING-COMMENT-WITH-NO-COMMENT", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -323,34 +323,34 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"FILING-COMMENT-WITH-NO-COMMENT" + "system": "https://EMISWeb/A82038", + "value": "FILING-COMMENT-WITH-NO-COMMENT" } ], - "status":"unknown", + "status": "unknown", "code": { "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], "related": [ { "target": { - "reference":"Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" + "reference": "Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" } } ] @@ -358,8 +358,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -367,32 +367,32 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" } ], - "status":"unknown", + "status": "unknown", "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], "related": [ { - "type":"has-member", + "type": "has-member", "target": { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } }, { - "type":"has-member", + "type": "has-member", "target": { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } } ] @@ -400,8 +400,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -409,36 +409,36 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } ], - "status":"unknown", + "status": "unknown", "code": { "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"TEST COMMENT 1", + "comment": "TEST COMMENT 1", "related": [ { - "type":"derived-from", + "type": "derived-from", "target": { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -446,8 +446,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", + "resourceType": "Observation", + "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -455,36 +455,36 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "system": "https://EMISWeb/A82038", + "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } ], - "status":"unknown", + "status": "unknown", "code": { "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"TEST COMMENT 2", + "comment": "TEST COMMENT 2", "related": [ { - "type":"derived-from", + "type": "derived-from", "target": { - "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -492,8 +492,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", + "resourceType": "Observation", + "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -501,18 +501,18 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "system": "https://EMISWeb/A82038", + "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } ], - "status":"unknown", + "status": "unknown", "category": [ { "coding": [ { - "system":"http://hl7.org/fhir/observation-category", - "code":"laboratory", - "display":"Laboratory" + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "Laboratory" } ] } @@ -520,63 +520,63 @@ "code": { "coding": [ { - "system":"http://read.info/readv2", - "code":"4465.00", - "display":"Serum oestradiol level", + "system": "http://read.info/readv2", + "code": "4465.00", + "display": "Serum oestradiol level", "userSelected": true }, { "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url":"descriptionId", - "valueId":"2551971000000110" + "url": "descriptionId", + "valueId": "2551971000000110" } ] } ], - "system":"http://snomed.info/sct", - "code":"1010521000000102", - "display":"Serum oestradiol level" + "system": "http://snomed.info/sct", + "code": "1010521000000102", + "display": "Serum oestradiol level" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2010-02-23", - "issued":"2010-02-25T15:41:00+00:00", + "effectiveDateTime": "2010-02-23", + "issued": "2010-02-25T15:41:00+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], "valueQuantity": { "value": 8.800, - "unit":"mmol/L" + "unit": "mmol/L" }, "specimen": { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, "referenceRange": [ { "low": { "value": 10.000, - "unit":"mmol/L" + "unit": "mmol/L" }, "high": { "value": 90.000, - "unit":"mmol/L" + "unit": "mmol/L" } } ], "related": [ { - "type":"has-member", + "type": "has-member", "target": { - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } } ] @@ -584,8 +584,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", + "resourceType": "Observation", + "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -593,43 +593,43 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "system": "https://EMISWeb/A82038", + "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } ], - "status":"unknown", + "status": "unknown", "code": { "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:13.46+00:00", - "issued":"2020-12-15T15:17:13.46+00:00", + "effectiveDateTime": "2020-12-15T15:17:13.46+00:00", + "issued": "2020-12-15T15:17:13.46+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"(q) - Normal - No Action", + "comment": "(q) - Normal - No Action", "related": [ { - "type":"derived-from", + "type": "derived-from", "target": { - "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } } ] } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"AD373CA7-3940-4249-85A2-D3A22E9F17C7", "meta": { @@ -696,8 +696,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"D0A358C9-4833-4827-B14B-E8515C25CB12", + "resourceType": "Observation", + "id": "D0A358C9-4833-4827-B14B-E8515C25CB12", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -705,18 +705,18 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"D0A358C9-4833-4827-B14B-E8515C25CB12" + "system": "https://EMISWeb/A82038", + "value": "D0A358C9-4833-4827-B14B-E8515C25CB12" } ], - "status":"unknown", + "status": "unknown", "category": [ { "coding": [ { - "system":"http://hl7.org/fhir/observation-category", - "code":"laboratory", - "display":"Laboratory" + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "Laboratory" } ] } @@ -724,48 +724,48 @@ "code": { "coding": [ { - "system":"http://read.info/readv2", - "code":"4483.00", - "display":"Serum ACTH", + "system": "http://read.info/readv2", + "code": "4483.00", + "display": "Serum ACTH", "userSelected": true }, { "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", "extension": [ { - "url":"descriptionId", - "valueId":"2563401000000119" + "url": "descriptionId", + "valueId": "2563401000000119" } ] } ], - "system":"http://snomed.info/sct", - "code":"997201000000100", - "display":"Serum ACTH (adrenocorticotrophic hormone) level" + "system": "http://snomed.info/sct", + "code": "997201000000100", + "display": "Serum ACTH (adrenocorticotrophic hormone) level" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2010-02-23", - "issued":"2010-02-25T15:41:00+00:00", + "effectiveDateTime": "2010-02-23", + "issued": "2010-02-25T15:41:00+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"Test not available", + "comment": "Test not available", "specimen": { - "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" }, "related": [ { - "type":"has-member", + "type": "has-member", "target": { - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } } ] @@ -773,8 +773,8 @@ }, { "resource": { - "resourceType":"Observation", - "id":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", + "resourceType": "Observation", + "id": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" @@ -782,36 +782,36 @@ }, "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "system": "https://EMISWeb/A82038", + "value": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ], - "status":"unknown", + "status": "unknown", "code": { "coding": [ { - "system":"http://snomed.info/sct", - "code":"37331000000100", - "display":"Comment note" + "system": "http://snomed.info/sct", + "code": "37331000000100", + "display": "Comment note" } ] }, "subject": { - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:13.51+00:00", - "issued":"2020-12-15T15:17:13.51+00:00", + "effectiveDateTime": "2020-12-15T15:17:13.51+00:00", + "issued": "2020-12-15T15:17:13.51+00:00", "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment":"(q) - Normal - No Action", + "comment": "(q) - Normal - No Action", "related": [ { - "type":"derived-from", + "type": "derived-from", "target": { - "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" } } ] @@ -872,18 +872,18 @@ }, { "resource": { - "resourceType":"Practitioner", - "id":"89890-1985-45D9-993E-C5FF51F36828", + "resourceType": "Practitioner", + "id": "89890-1985-45D9-993E-C5FF51F36828", "meta": { - "versionId":"7786052607397903776", + "versionId": "7786052607397903776", "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" ] }, "name": [ { - "use":"official", - "family":"Test", + "use": "official", + "family": "Test", "given": [ "NHS" ], @@ -892,99 +892,99 @@ ] } ], - "gender":"male" + "gender": "male" } }, { "resource": { - "resourceType":"Organization", - "id":"5E496953-065B-41F2-9577-BE8F2FBD0757", + "resourceType": "Organization", + "id": "5E496953-065B-41F2-9577-BE8F2FBD0757", "meta": { - "versionId":"1112974926854455048", + "versionId": "1112974926854455048", "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" ] }, "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", "valueReference": { - "reference":"Location/EB3994A6-5A87-4B53-A414-913137072F57" + "reference": "Location/EB3994A6-5A87-4B53-A414-913137072F57" } } ], "identifier": [ { - "system":"https://fhir.nhs.uk/Id/ods-organization-code", - "value":"A82038" + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "A82038" } ], - "name":"TEMPLE SOWERBY MEDICAL PRACTICE" + "name": "TEMPLE SOWERBY MEDICAL PRACTICE" } }, { - "resource":{ - "resourceType":"Observation", - "id":"TestResult-WithRelatedMember-WhichIsntAFilingComment", - "meta":{ - "profile":[ + "resource": { + "resourceType": "Observation", + "id": "TestResult-WithRelatedMember-WhichIsntAFilingComment", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier":[ + "identifier": [ { - "system":"https://EMISWeb/A82038", - "value":"TestResult-WithRelatedMember-WhichIsntAFilingComment" + "system": "https://EMISWeb/A82038", + "value": "TestResult-WithRelatedMember-WhichIsntAFilingComment" } ], - "code":{ - "coding":[ + "code": { + "coding": [ { - "system":"http://read.info/readv2", - "code":"4465.00", - "display":"Serum oestradiol level", - "userSelected":true + "system": "http://read.info/readv2", + "code": "4465.00", + "display": "Serum oestradiol level", + "userSelected": true }, { - "extension":[ + "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension":[ + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension": [ { - "url":"descriptionId", - "valueId":"2551971000000110" + "url": "descriptionId", + "valueId": "2551971000000110" } ] } ], - "system":"http://snomed.info/sct", - "code":"1010521000000102", - "display":"Serum oestradiol level" + "system": "http://snomed.info/sct", + "code": "1010521000000102", + "display": "Serum oestradiol level" } ] }, - "valueQuantity":{ - "value":8.800, - "unit":"mmol/L" + "valueQuantity": { + "value": 8.800, + "unit": "mmol/L" }, - "comment":"Notes provided alongside test result", - "status":"unknown", - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "comment": "Notes provided alongside test result", + "status": "unknown", + "subject": { + "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", - "issued":"2020-12-15T15:17:04.917+00:00", - "performer":[ + "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", + "issued": "2020-12-15T15:17:04.917+00:00", + "performer": [ { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "related":[ + "related": [ { - "type":"has-member", - "target":{ - "display":"Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", - "reference":"Observation/TestResult-WithRelatedMember-WhichIsntAFilingComment" + "type": "has-member", + "target": { + "display": "Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", + "reference": "Observation/TestResult-WithRelatedMember-WhichIsntAFilingComment" } } ] From 05887cafc1924c014d3ce381cac3e0262f99fc46 Mon Sep 17 00:00:00 2001 From: Steven McCullagh Date: Mon, 11 Nov 2024 17:30:40 +0000 Subject: [PATCH 49/86] Adjust whitespace --- .../mapper/diagnosticreport/fhir_bundle.json | 748 +++++++++--------- 1 file changed, 374 insertions(+), 374 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 96fd460314..60b147e7ed 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -1,242 +1,242 @@ { - "resourceType": "Bundle", + "resourceType":"Bundle", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/GPConnect-Searchset-Bundle-1" ] }, - "type": "searchset", - "entry": [ + "type":"searchset", + "entry":[ { - "resource": { - "resourceType": "DiagnosticReport", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098", - "meta": { - "profile": [ + "resource":{ + "resourceType":"DiagnosticReport", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098", + "meta":{ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" ] }, - "identifier": [ - { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098" - } + "identifier": + { + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098" + } ], - "status": "unknown", + "status":"unknown", "category": { - "coding": [ + "coding":[ { - "system": "http://hl7.org/fhir/v2/0074", - "code": "PAT", - "display": "Pathology (gross & histopath, not surgical)" + "system":"http://hl7.org/fhir/v2/0074", + "code":"PAT", + "display":"Pathology (gross & histopath, not surgical)" } ] }, "code": { - "coding": [ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "721981007", - "display": "Diagnostic studies report" + "system":"http://snomed.info/sct", + "code":"721981007", + "display":"Diagnostic studies report" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "issued": "2010-02-25T15:41:00+00:00", - "specimen": [ + "issued":"2010-02-25T15:41:00+00:00", + "specimen":[ { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], - "result": [ + "result":[ { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" }, { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" }, { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" }, { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" }, { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" }, { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ] } }, { "resource": { - "resourceType": "Specimen", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", + "resourceType":"Specimen", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" } ], "accessionIdentifier": { - "value": "CH000056DN" + "value":"CH000056DN" }, "type": { - "text": "URINE" + "text":"URINE" }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime": "2010-02-24T15:41:00+00:00", + "receivedTime":"2010-02-24T15:41:00+00:00", "collection": { - "collectedDateTime": "2010-02-23T00:00:00+00:00" + "collectedDateTime":"2010-02-23T00:00:00+00:00" } } }, { "resource": { - "resourceType": "Specimen", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", + "resourceType":"Specimen", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" } ], "accessionIdentifier": { - "value": "CH000056DO" + "value":"CH000056DO" }, "type": { - "text": "SERUM" + "text":"SERUM" }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime": "2001-03-30T12:21:00+01:00", + "receivedTime":"2001-03-30T12:21:00+01:00", "collection": { - "collectedDateTime": "2010-02-23T15:41:00+00:00" + "collectedDateTime":"2010-02-23T15:41:00+00:00" } } }, { "resource": { - "resourceType": "Specimen", - "id": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", + "resourceType":"Specimen", + "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], "accessionIdentifier": { - "value": "CH000056DP" + "value":"CH000056DP" }, "type": { - "text": "SERUM" + "text":"SERUM" }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "receivedTime": "2010-02-24T15:41:00+00:00" + "receivedTime":"2010-02-24T15:41:00+00:00" } }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } ], - "status": "unknown", - "category": [ + "status":"unknown", + "category":[ { - "coding": [ + "coding":[ { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "Laboratory" + "system":"http://hl7.org/fhir/observation-category", + "code":"laboratory", + "display":"Laboratory" } ] } ], "code": { - "coding": [ + "coding":[ { - "system": "http://read.info/readv2", - "code": "465..00", - "display": "Urine pregnancy test", + "system":"http://read.info/readv2", + "code":"465..00", + "display":"Urine pregnancy test", "userSelected": true }, { - "extension": [ + "extension":[ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension": [ + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension":[ { - "url": "descriptionId", - "valueId": "2564081000000118" + "url":"descriptionId", + "valueId":"2564081000000118" } ] } ], - "system": "http://snomed.info/sct", - "code": "1003161000000106", - "display": "Urine pregnancy test" + "system":"http://snomed.info/sct", + "code":"1003161000000106", + "display":"Urine pregnancy test" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2010-02-23", - "issued": "2010-02-25T15:41:00+00:00", - "performer": [ + "effectiveDateTime":"2010-02-23", + "issued":"2010-02-25T15:41:00+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", + "comment":"NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", "specimen": { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, - "related": [ + "related":[ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } } ] @@ -247,11 +247,11 @@ "resourceType":"Specimen", "id":"NON-SIGNIFICANT-SPECIMEN", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] }, - "identifier": [ + "identifier":[ { "system":"https://wiremock/", "value":"NON-SIGNIFICANT-SPECIMEN" @@ -268,45 +268,45 @@ }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } ], - "status": "unknown", + "status":"unknown", "code": { - "coding": [ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "(q) - Normal - No Action", - "related": [ + "comment":"(q) - Normal - No Action", + "related":[ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -314,43 +314,43 @@ }, { "resource": { - "resourceType": "Observation", - "id": "FILING-COMMENT-WITH-NO-COMMENT", + "resourceType":"Observation", + "id":"FILING-COMMENT-WITH-NO-COMMENT", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "FILING-COMMENT-WITH-NO-COMMENT" + "system":"https://EMISWeb/A82038", + "value":"FILING-COMMENT-WITH-NO-COMMENT" } ], - "status": "unknown", + "status":"unknown", "code": { - "coding": [ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "related": [ + "related":[ { "target": { - "reference": "Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" + "reference":"Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" } } ] @@ -358,41 +358,41 @@ }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST" } ], - "status": "unknown", + "status":"unknown", "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "related": [ + "related":[ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } }, { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } } ] @@ -400,45 +400,45 @@ }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } ], - "status": "unknown", + "status":"unknown", "code": { - "coding": [ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "TEST COMMENT 1", - "related": [ + "comment":"TEST COMMENT 1", + "related":[ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -446,45 +446,45 @@ }, { "resource": { - "resourceType": "Observation", - "id": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", + "resourceType":"Observation", + "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" + "system":"https://EMISWeb/A82038", + "value":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } ], - "status": "unknown", + "status":"unknown", "code": { - "coding": [ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "TEST COMMENT 2", - "related": [ + "comment":"TEST COMMENT 2", + "related":[ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" + "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } ] @@ -492,91 +492,91 @@ }, { "resource": { - "resourceType": "Observation", - "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", + "resourceType":"Observation", + "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "system":"https://EMISWeb/A82038", + "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } ], - "status": "unknown", - "category": [ + "status":"unknown", + "category":[ { - "coding": [ + "coding":[ { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "Laboratory" + "system":"http://hl7.org/fhir/observation-category", + "code":"laboratory", + "display":"Laboratory" } ] } ], "code": { - "coding": [ + "coding":[ { - "system": "http://read.info/readv2", - "code": "4465.00", - "display": "Serum oestradiol level", + "system":"http://read.info/readv2", + "code":"4465.00", + "display":"Serum oestradiol level", "userSelected": true }, { - "extension": [ + "extension":[ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension": [ + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension":[ { - "url": "descriptionId", - "valueId": "2551971000000110" + "url":"descriptionId", + "valueId":"2551971000000110" } ] } ], - "system": "http://snomed.info/sct", - "code": "1010521000000102", - "display": "Serum oestradiol level" + "system":"http://snomed.info/sct", + "code":"1010521000000102", + "display":"Serum oestradiol level" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2010-02-23", - "issued": "2010-02-25T15:41:00+00:00", - "performer": [ + "effectiveDateTime":"2010-02-23", + "issued":"2010-02-25T15:41:00+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], "valueQuantity": { "value": 8.800, - "unit": "mmol/L" + "unit":"mmol/L" }, "specimen": { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, - "referenceRange": [ + "referenceRange":[ { "low": { "value": 10.000, - "unit": "mmol/L" + "unit":"mmol/L" }, "high": { "value": 90.000, - "unit": "mmol/L" + "unit":"mmol/L" } } ], - "related": [ + "related":[ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } } ] @@ -584,45 +584,45 @@ }, { "resource": { - "resourceType": "Observation", - "id": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", + "resourceType":"Observation", + "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" + "system":"https://EMISWeb/A82038", + "value":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } ], - "status": "unknown", + "status":"unknown", "code": { - "coding": [ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:13.46+00:00", - "issued": "2020-12-15T15:17:13.46+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:13.46+00:00", + "issued":"2020-12-15T15:17:13.46+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "(q) - Normal - No Action", - "related": [ + "comment":"(q) - Normal - No Action", + "related":[ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" + "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } } ] @@ -633,20 +633,20 @@ "resourceType":"Observation", "id":"AD373CA7-3940-4249-85A2-D3A22E9F17C7", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { "system":"https://EMISWeb/A82038", "value":"AD373CA7-3940-4249-85A2-D3A22E9F17C7" } ], "status":"unknown", - "category": [ + "category":[ { - "coding": [ + "coding":[ { "system":"http://hl7.org/fhir/observation-category", "code":"laboratory", @@ -656,7 +656,7 @@ } ], "code": { - "coding": [ + "coding":[ { "system":"http://read.info/readv2", "code":"4483.00", @@ -664,10 +664,10 @@ "userSelected": true }, { - "extension": [ + "extension":[ { "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension": [ + "extension":[ { "url":"descriptionId", "valueId":"2563401000000119" @@ -686,7 +686,7 @@ }, "effectiveDateTime":"2010-02-23", "issued":"2010-02-25T15:41:00+00:00", - "performer": [ + "performer":[ { "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } @@ -696,76 +696,76 @@ }, { "resource": { - "resourceType": "Observation", - "id": "D0A358C9-4833-4827-B14B-E8515C25CB12", + "resourceType":"Observation", + "id":"D0A358C9-4833-4827-B14B-E8515C25CB12", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "D0A358C9-4833-4827-B14B-E8515C25CB12" + "system":"https://EMISWeb/A82038", + "value":"D0A358C9-4833-4827-B14B-E8515C25CB12" } ], - "status": "unknown", - "category": [ + "status":"unknown", + "category":[ { - "coding": [ + "coding":[ { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "Laboratory" + "system":"http://hl7.org/fhir/observation-category", + "code":"laboratory", + "display":"Laboratory" } ] } ], "code": { - "coding": [ + "coding":[ { - "system": "http://read.info/readv2", - "code": "4483.00", - "display": "Serum ACTH", + "system":"http://read.info/readv2", + "code":"4483.00", + "display":"Serum ACTH", "userSelected": true }, { - "extension": [ + "extension":[ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension": [ + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension":[ { - "url": "descriptionId", - "valueId": "2563401000000119" + "url":"descriptionId", + "valueId":"2563401000000119" } ] } ], - "system": "http://snomed.info/sct", - "code": "997201000000100", - "display": "Serum ACTH (adrenocorticotrophic hormone) level" + "system":"http://snomed.info/sct", + "code":"997201000000100", + "display":"Serum ACTH (adrenocorticotrophic hormone) level" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2010-02-23", - "issued": "2010-02-25T15:41:00+00:00", - "performer": [ + "effectiveDateTime":"2010-02-23", + "issued":"2010-02-25T15:41:00+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "Test not available", + "comment":"Test not available", "specimen": { - "reference": "Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" + "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" }, - "related": [ + "related":[ { - "type": "has-member", + "type":"has-member", "target": { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } } ] @@ -773,45 +773,45 @@ }, { "resource": { - "resourceType": "Observation", - "id": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", + "resourceType":"Observation", + "id":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" + "system":"https://EMISWeb/A82038", + "value":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } ], - "status": "unknown", + "status":"unknown", "code": { - "coding": [ + "coding":[ { - "system": "http://snomed.info/sct", - "code": "37331000000100", - "display": "Comment note" + "system":"http://snomed.info/sct", + "code":"37331000000100", + "display":"Comment note" } ] }, "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:13.51+00:00", - "issued": "2020-12-15T15:17:13.51+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:13.51+00:00", + "issued":"2020-12-15T15:17:13.51+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "comment": "(q) - Normal - No Action", - "related": [ + "comment":"(q) - Normal - No Action", + "related":[ { - "type": "derived-from", + "type":"derived-from", "target": { - "reference": "Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" + "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" } } ] @@ -822,11 +822,11 @@ "resourceType":"Observation", "id":"TEST-RESULT-NO-SPECIMEN", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { "system":"https://wiremock/", "value":"TEST-RESULT-NO-SPECIMEN" @@ -834,7 +834,7 @@ ], "status":"final", "code": { - "coding": [ + "coding":[ { "system":"http://read.info/readv2", "code":"42R5.00", @@ -842,10 +842,10 @@ "userSelected": true }, { - "extension": [ + "extension":[ { "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension": [ + "extension":[ { "url":"descriptionId", "valueId":"2580111000000118" @@ -872,119 +872,119 @@ }, { "resource": { - "resourceType": "Practitioner", - "id": "89890-1985-45D9-993E-C5FF51F36828", + "resourceType":"Practitioner", + "id":"89890-1985-45D9-993E-C5FF51F36828", "meta": { - "versionId": "7786052607397903776", - "profile": [ + "versionId":"7786052607397903776", + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" ] }, - "name": [ + "name":[ { - "use": "official", - "family": "Test", - "given": [ + "use":"official", + "family":"Test", + "given":[ "NHS" ], - "prefix": [ + "prefix":[ "Mr" ] } ], - "gender": "male" + "gender":"male" } }, { "resource": { - "resourceType": "Organization", - "id": "5E496953-065B-41F2-9577-BE8F2FBD0757", + "resourceType":"Organization", + "id":"5E496953-065B-41F2-9577-BE8F2FBD0757", "meta": { - "versionId": "1112974926854455048", - "profile": [ + "versionId":"1112974926854455048", + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" ] }, - "extension": [ + "extension":[ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", "valueReference": { - "reference": "Location/EB3994A6-5A87-4B53-A414-913137072F57" + "reference":"Location/EB3994A6-5A87-4B53-A414-913137072F57" } } ], - "identifier": [ + "identifier":[ { - "system": "https://fhir.nhs.uk/Id/ods-organization-code", - "value": "A82038" + "system":"https://fhir.nhs.uk/Id/ods-organization-code", + "value":"A82038" } ], - "name": "TEMPLE SOWERBY MEDICAL PRACTICE" + "name":"TEMPLE SOWERBY MEDICAL PRACTICE" } }, { "resource": { - "resourceType": "Observation", - "id": "TestResult-WithRelatedMember-WhichIsntAFilingComment", + "resourceType":"Observation", + "id":"TestResult-WithRelatedMember-WhichIsntAFilingComment", "meta": { - "profile": [ + "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] }, - "identifier": [ + "identifier":[ { - "system": "https://EMISWeb/A82038", - "value": "TestResult-WithRelatedMember-WhichIsntAFilingComment" + "system":"https://EMISWeb/A82038", + "value":"TestResult-WithRelatedMember-WhichIsntAFilingComment" } ], "code": { - "coding": [ + "coding":[ { - "system": "http://read.info/readv2", - "code": "4465.00", - "display": "Serum oestradiol level", + "system":"http://read.info/readv2", + "code":"4465.00", + "display":"Serum oestradiol level", "userSelected": true }, { - "extension": [ + "extension":[ { - "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension": [ + "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", + "extension":[ { - "url": "descriptionId", - "valueId": "2551971000000110" + "url":"descriptionId", + "valueId":"2551971000000110" } ] } ], - "system": "http://snomed.info/sct", - "code": "1010521000000102", - "display": "Serum oestradiol level" + "system":"http://snomed.info/sct", + "code":"1010521000000102", + "display":"Serum oestradiol level" } ] }, "valueQuantity": { "value": 8.800, - "unit": "mmol/L" + "unit":"mmol/L" }, - "comment": "Notes provided alongside test result", - "status": "unknown", + "comment":"Notes provided alongside test result", + "status":"unknown", "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" + "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, - "effectiveDateTime": "2020-12-15T15:17:04.917+00:00", - "issued": "2020-12-15T15:17:04.917+00:00", - "performer": [ + "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", + "issued":"2020-12-15T15:17:04.917+00:00", + "performer":[ { - "reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" + "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "related": [ + "related":[ { - "type": "has-member", + "type":"has-member", "target": { - "display": "Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", - "reference": "Observation/TestResult-WithRelatedMember-WhichIsntAFilingComment" + "display":"Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", + "reference":"Observation/TestResult-WithRelatedMember-WhichIsntAFilingComment" } } ] From 22c05ea2e5a97fcb660f411c4b561aa718781630 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 09:20:01 +0000 Subject: [PATCH 50/86] Adjust Whitespace --- .../mapper/diagnosticreport/fhir_bundle.json | 222 +++++++++--------- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 60b147e7ed..8243364565 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -1,6 +1,6 @@ { "resourceType":"Bundle", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/GPConnect-Searchset-Bundle-1" ] @@ -23,7 +23,7 @@ } ], "status":"unknown", - "category": { + "category":{ "coding":[ { "system":"http://hl7.org/fhir/v2/0074", @@ -32,7 +32,7 @@ } ] }, - "code": { + "code":{ "coding":[ { "system":"http://snomed.info/sct", @@ -41,7 +41,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "issued":"2010-02-25T15:41:00+00:00", @@ -79,10 +79,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Specimen", "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] @@ -93,26 +93,26 @@ "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" } ], - "accessionIdentifier": { + "accessionIdentifier":{ "value":"CH000056DN" }, - "type": { + "type":{ "text":"URINE" }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "receivedTime":"2010-02-24T15:41:00+00:00", - "collection": { + "collection":{ "collectedDateTime":"2010-02-23T00:00:00+00:00" } } }, { - "resource": { + "resource":{ "resourceType":"Specimen", "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] @@ -123,26 +123,26 @@ "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" } ], - "accessionIdentifier": { + "accessionIdentifier":{ "value":"CH000056DO" }, - "type": { + "type":{ "text":"SERUM" }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "receivedTime":"2001-03-30T12:21:00+01:00", - "collection": { + "collection":{ "collectedDateTime":"2010-02-23T15:41:00+00:00" } } }, { - "resource": { + "resource":{ "resourceType":"Specimen", "id":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] @@ -153,23 +153,23 @@ "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" } ], - "accessionIdentifier": { + "accessionIdentifier":{ "value":"CH000056DP" }, - "type": { + "type":{ "text":"SERUM" }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "receivedTime":"2010-02-24T15:41:00+00:00" } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -192,13 +192,13 @@ ] } ], - "code": { + "code":{ "coding":[ { "system":"http://read.info/readv2", "code":"465..00", "display":"Urine pregnancy test", - "userSelected": true + "userSelected":true }, { "extension":[ @@ -218,7 +218,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2010-02-23", @@ -229,13 +229,13 @@ } ], "comment":"NEGATIVE\n In normal pregnancies the test will usually be positive from the\n second day after the expected menstruation.", - "specimen": { + "specimen":{ "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0" }, "related":[ { "type":"has-member", - "target": { + "target":{ "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM" } } @@ -243,10 +243,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Specimen", "id":"NON-SIGNIFICANT-SPECIMEN", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" ] @@ -257,20 +257,20 @@ "value":"NON-SIGNIFICANT-SPECIMEN" } ], - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "receivedTime":"2001-02-03T10:00:00+00:00", - "collection": { + "collection":{ "collectedDateTime":"2001-02-03T11:00:00+00:00" } } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-COMM", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -282,7 +282,7 @@ } ], "status":"unknown", - "code": { + "code":{ "coding":[ { "system":"http://snomed.info/sct", @@ -291,7 +291,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", @@ -305,7 +305,7 @@ "related":[ { "type":"derived-from", - "target": { + "target":{ "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } @@ -313,10 +313,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"FILING-COMMENT-WITH-NO-COMMENT", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -328,7 +328,7 @@ } ], "status":"unknown", - "code": { + "code":{ "coding":[ { "system":"http://snomed.info/sct", @@ -337,7 +337,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", @@ -349,7 +349,7 @@ ], "related":[ { - "target": { + "target":{ "reference":"Observation/461839A4-9B28-46D4-BC27-297C46F4F80E" } } @@ -357,10 +357,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TEST", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -372,7 +372,7 @@ } ], "status":"unknown", - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", @@ -385,13 +385,13 @@ "related":[ { "type":"has-member", - "target": { + "target":{ "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1" } }, { "type":"has-member", - "target": { + "target":{ "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2" } } @@ -399,10 +399,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST1", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -414,7 +414,7 @@ } ], "status":"unknown", - "code": { + "code":{ "coding":[ { "system":"http://snomed.info/sct", @@ -423,7 +423,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", @@ -437,7 +437,7 @@ "related":[ { "type":"derived-from", - "target": { + "target":{ "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } @@ -445,10 +445,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2-TST2", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -460,7 +460,7 @@ } ], "status":"unknown", - "code": { + "code":{ "coding":[ { "system":"http://snomed.info/sct", @@ -469,7 +469,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", @@ -483,7 +483,7 @@ "related":[ { "type":"derived-from", - "target": { + "target":{ "reference":"Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" } } @@ -491,10 +491,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -517,13 +517,13 @@ ] } ], - "code": { + "code":{ "coding":[ { "system":"http://read.info/readv2", "code":"4465.00", "display":"Serum oestradiol level", - "userSelected": true + "userSelected":true }, { "extension":[ @@ -543,7 +543,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2010-02-23", @@ -553,21 +553,21 @@ "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" } ], - "valueQuantity": { - "value": 8.800, + "valueQuantity":{ + "value":8.800, "unit":"mmol/L" }, - "specimen": { + "specimen":{ "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1" }, "referenceRange":[ { - "low": { - "value": 10.000, + "low":{ + "value":10.000, "unit":"mmol/L" }, - "high": { - "value": 90.000, + "high":{ + "value":90.000, "unit":"mmol/L" } } @@ -575,7 +575,7 @@ "related":[ { "type":"has-member", - "target": { + "target":{ "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM" } } @@ -583,10 +583,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78-COMM", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -598,7 +598,7 @@ } ], "status":"unknown", - "code": { + "code":{ "coding":[ { "system":"http://snomed.info/sct", @@ -607,7 +607,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:13.46+00:00", @@ -621,7 +621,7 @@ "related":[ { "type":"derived-from", - "target": { + "target":{ "reference":"Observation/6E30A9E3-FF9A-4868-8FCD-7DAC26A16E78" } } @@ -632,7 +632,7 @@ "resource":{ "resourceType":"Observation", "id":"AD373CA7-3940-4249-85A2-D3A22E9F17C7", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -655,13 +655,13 @@ ] } ], - "code": { + "code":{ "coding":[ { "system":"http://read.info/readv2", "code":"4483.00", "display":"Serum ACTH", - "userSelected": true + "userSelected":true }, { "extension":[ @@ -681,7 +681,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2010-02-23", @@ -695,10 +695,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"D0A358C9-4833-4827-B14B-E8515C25CB12", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -721,13 +721,13 @@ ] } ], - "code": { + "code":{ "coding":[ { "system":"http://read.info/readv2", "code":"4483.00", "display":"Serum ACTH", - "userSelected": true + "userSelected":true }, { "extension":[ @@ -747,7 +747,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2010-02-23", @@ -758,13 +758,13 @@ } ], "comment":"Test not available", - "specimen": { + "specimen":{ "reference":"Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2" }, "related":[ { "type":"has-member", - "target": { + "target":{ "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12-COMM" } } @@ -772,10 +772,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"D0A358C9-4833-4827-B14B-E8515C25CB12-COMM", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -787,7 +787,7 @@ } ], "status":"unknown", - "code": { + "code":{ "coding":[ { "system":"http://snomed.info/sct", @@ -796,7 +796,7 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:13.51+00:00", @@ -810,7 +810,7 @@ "related":[ { "type":"derived-from", - "target": { + "target":{ "reference":"Observation/D0A358C9-4833-4827-B14B-E8515C25CB12" } } @@ -818,10 +818,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"TEST-RESULT-NO-SPECIMEN", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -833,13 +833,13 @@ } ], "status":"final", - "code": { + "code":{ "coding":[ { "system":"http://read.info/readv2", "code":"42R5.00", "display":"Serum TIBC", - "userSelected": true + "userSelected":true }, { "extension":[ @@ -859,22 +859,22 @@ } ] }, - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2001-02-03T12:00:00+00:00", "issued":"2001-02-03T13:00:00+00:00", - "valueQuantity": { - "value": 42.000, + "valueQuantity":{ + "value":42.000, "unit":"umol/L" } } }, { - "resource": { + "resource":{ "resourceType":"Practitioner", "id":"89890-1985-45D9-993E-C5FF51F36828", - "meta": { + "meta":{ "versionId":"7786052607397903776", "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" @@ -896,10 +896,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Organization", "id":"5E496953-065B-41F2-9577-BE8F2FBD0757", - "meta": { + "meta":{ "versionId":"1112974926854455048", "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" @@ -908,7 +908,7 @@ "extension":[ { "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", - "valueReference": { + "valueReference":{ "reference":"Location/EB3994A6-5A87-4B53-A414-913137072F57" } } @@ -923,10 +923,10 @@ } }, { - "resource": { + "resource":{ "resourceType":"Observation", "id":"TestResult-WithRelatedMember-WhichIsntAFilingComment", - "meta": { + "meta":{ "profile":[ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" ] @@ -937,13 +937,13 @@ "value":"TestResult-WithRelatedMember-WhichIsntAFilingComment" } ], - "code": { + "code":{ "coding":[ { "system":"http://read.info/readv2", "code":"4465.00", "display":"Serum oestradiol level", - "userSelected": true + "userSelected":true }, { "extension":[ @@ -963,13 +963,13 @@ } ] }, - "valueQuantity": { - "value": 8.800, + "valueQuantity":{ + "value":8.800, "unit":"mmol/L" }, "comment":"Notes provided alongside test result", "status":"unknown", - "subject": { + "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" }, "effectiveDateTime":"2020-12-15T15:17:04.917+00:00", @@ -982,7 +982,7 @@ "related":[ { "type":"has-member", - "target": { + "target":{ "display":"Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", "reference":"Observation/TestResult-WithRelatedMember-WhichIsntAFilingComment" } From 20821165abed5b9aab5f708a9eb2829a9e4d9f0b Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 09:29:35 +0000 Subject: [PATCH 51/86] Adjust Whitespace --- .../mapper/diagnosticreport/fhir_bundle.json | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 8243364565..e411b69a60 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -1,12 +1,12 @@ { - "resourceType":"Bundle", - "meta":{ - "profile":[ + "resourceType": "Bundle", + "meta": { + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/GPConnect-Searchset-Bundle-1" ] }, - "type":"searchset", - "entry":[ + "type": "searchset", + "entry": [ { "resource":{ "resourceType":"DiagnosticReport", @@ -17,10 +17,10 @@ ] }, "identifier": - { - "system":"https://EMISWeb/A82038", - "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098" - } + { + "system":"https://EMISWeb/A82038", + "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098" + } ], "status":"unknown", "category":{ @@ -880,28 +880,28 @@ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" ] }, - "name":[ + "name": [ { - "use":"official", - "family":"Test", - "given":[ + "use": "official", + "family": "Test", + "given": [ "NHS" ], - "prefix":[ + "prefix": [ "Mr" ] } ], - "gender":"male" + "gender": "male" } }, { - "resource":{ - "resourceType":"Organization", - "id":"5E496953-065B-41F2-9577-BE8F2FBD0757", - "meta":{ - "versionId":"1112974926854455048", - "profile":[ + "resource": { + "resourceType": "Organization", + "id": "5E496953-065B-41F2-9577-BE8F2FBD0757", + "meta": { + "versionId": "1112974926854455048", + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" ] }, From 1ef50df8f89ce919509a0d9d01717682b6176a26 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 09:31:18 +0000 Subject: [PATCH 52/86] Adjust Whitespace --- .../mapper/diagnosticreport/fhir_bundle.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index e411b69a60..62e6768221 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -905,21 +905,21 @@ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" ] }, - "extension":[ + "extension": [ { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", - "valueReference":{ - "reference":"Location/EB3994A6-5A87-4B53-A414-913137072F57" + "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MainLocation-1", + "valueReference": { + "reference": "Location/EB3994A6-5A87-4B53-A414-913137072F57" } } ], - "identifier":[ + "identifier": [ { - "system":"https://fhir.nhs.uk/Id/ods-organization-code", - "value":"A82038" + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "A82038" } ], - "name":"TEMPLE SOWERBY MEDICAL PRACTICE" + "name": "TEMPLE SOWERBY MEDICAL PRACTICE" } }, { @@ -967,7 +967,7 @@ "value":8.800, "unit":"mmol/L" }, - "comment":"Notes provided alongside test result", + "comment": "Notes provided alongside test result", "status":"unknown", "subject":{ "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" @@ -983,7 +983,7 @@ { "type":"has-member", "target":{ - "display":"Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", + "display": "Referencing itself as a member, as opposed to a filing comment. This is invalid according to GP Connect.", "reference":"Observation/TestResult-WithRelatedMember-WhichIsntAFilingComment" } } From cccf39cd2e87efc73afcb7ec4bb1eaac064684f8 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 09:40:32 +0000 Subject: [PATCH 53/86] Adjust Whitespace --- ...ected-xml-with-standalone-observations.xml | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index fb67f9d7ef..5cf908a28c 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -39,73 +39,73 @@ - - - - - - Unknown - - - - TEMPLE SOWERBY MEDICAL PRACTICE - - - - - - - - - Unknown - - - - Dr - David - McAvenue - - - - - - - - - - - - -
- - - - - - - - - - - - - - Filed Report - - - -
- - - - - - CommentType:LABORATORY RESULT COMMENT(E141) - CommentDate:20030221115000 + + + + + + Unknown + + + + TEMPLE SOWERBY MEDICAL PRACTICE + + + + + + + + + Unknown + + + + Dr + David + McAvenue + + + + + + + + + + + + +
+ + + + + + + + + + + + + + Filed Report + + + +
+ + + + + + CommentType:LABORATORY RESULT COMMENT(E141) + CommentDate:20030221115000 Status: unknown From 844cb90df8cf7c8443fb491d50b4a994319a57a0 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 09:42:01 +0000 Subject: [PATCH 54/86] Adjust Whitespace --- ...ected-xml-with-standalone-observations.xml | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 5cf908a28c..a8b9c24586 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -41,33 +41,33 @@ - - - - Unknown - - - - TEMPLE SOWERBY MEDICAL PRACTICE - - - - - - - - - Unknown - - - - Dr - David - McAvenue - - - - + + + + Unknown + + + + TEMPLE SOWERBY MEDICAL PRACTICE + + + + + + + + + Unknown + + + + Dr + David + McAvenue + + + + From fdc3bd773accc72617422412b21a6f947e8d7915 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:30:09 +0000 Subject: [PATCH 55/86] Adjust whitespace --- .../ehr/mapper/diagnosticreport/fhir_bundle.json | 2 +- .../expected-xml-with-standalone-observations.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 62e6768221..28f5449fc0 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -16,7 +16,7 @@ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" ] }, - "identifier": + "identifier":[ { "system":"https://EMISWeb/A82038", "value":"96B93E28-293D-46E7-B4C2-D477EEBF7098" diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index a8b9c24586..747330fe62 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -91,12 +91,12 @@ - + - - Filed Report - - + + Filed Report + +
From eb8eb57c3ba1559cb40b64c5004cbf63eafbf42d Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:32:07 +0000 Subject: [PATCH 56/86] Adjust Whitespace --- ...ected-xml-with-standalone-observations.xml | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 747330fe62..c3e8483896 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -92,39 +92,39 @@ - + Filed Report - -
- - - - - - CommentType:LABORATORY RESULT COMMENT(E141) - CommentDate:20030221115000 + +
+ + + + + + CommentType:LABORATORY RESULT COMMENT(E141) + CommentDate:20030221115000 - Status: unknown - - - - - - + Status: unknown + + + + + + + + + + +
+ + + + - - - -
- - - - - - +
From 1f4bfbee8b30d7ad33873e50f28ee9d7fb706700 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:33:31 +0000 Subject: [PATCH 57/86] Adjust Whitespace --- .../expected-xml-with-standalone-observations.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index c3e8483896..977fae7f1a 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -101,11 +101,11 @@
- - - - CommentType:LABORATORY RESULT COMMENT(E141) - CommentDate:20030221115000 + + + + CommentType:LABORATORY RESULT COMMENT(E141) + CommentDate:20030221115000 Status: unknown From bfff9369a6f40b75c39e17cef392ed67d8787900 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:35:30 +0000 Subject: [PATCH 58/86] Adjust Whitespace --- ...ected-xml-with-standalone-observations.xml | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 977fae7f1a..7a1cf694ce 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -102,42 +102,42 @@ - - - CommentType:LABORATORY RESULT COMMENT(E141) - CommentDate:20030221115000 + + + CommentType:LABORATORY RESULT COMMENT(E141) + CommentDate:20030221115000 - Status: unknown - - - - - - - - - - -
- - - - - - - -
- - - UNKNOWN - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:UNK + Status: unknown + + + + + + + + + + +
+ + + + + + + +
+ + + UNKNOWN + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK EMPTY REPORT From 84cc604b5c63607161c164419ae6a18b858cd6ac Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:36:45 +0000 Subject: [PATCH 59/86] Adjust Whitespace --- ...ected-xml-with-standalone-observations.xml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 7a1cf694ce..7f087d9db2 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -124,20 +124,20 @@ - - -
- - - UNKNOWN - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:UNK + + +
+ + + UNKNOWN + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK EMPTY REPORT From e0ffd568c5fa2983c9d6ace2fe68b9bc2312d28c Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:41:28 +0000 Subject: [PATCH 60/86] Adjusted Whitespace --- ...ected-xml-with-standalone-observations.xml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 7f087d9db2..2d3e9f5e23 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -133,17 +133,17 @@ - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:UNK + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK - EMPTY REPORT - - - - + EMPTY REPORT + + + + From 05188323a227e73ff40d0de1cfc97b1596b71e02 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:44:52 +0000 Subject: [PATCH 61/86] Adjusted Whitespace --- ...ected-xml-with-standalone-observations.xml | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 2d3e9f5e23..6dfae3c831 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -139,57 +139,57 @@ CommentType:AGGREGATE COMMENT SET CommentDate:UNK - EMPTY REPORT - - - - - - - - - - - -
- - - - - - - -
- - - Blood - - - - - - - CommentType:LAB SPECIMEN COMMENT(E271) - CommentDate:20030109000000 + EMPTY REPORT + + + + + + + + + + + +
+ + + + + + + +
+ + + Blood + + + + + + + CommentType:LAB SPECIMEN COMMENT(E271) + CommentDate:20030109000000 - Received Date: 2003-01-09 13:54 - - - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:UNK + Received Date: 2003-01-09 13:54 + + + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK - EMPTY REPORT - - - - - + EMPTY REPORT + + + + + From b168f8bb32cd6f1af3465efe7972a7cfdde33fc6 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:48:15 +0000 Subject: [PATCH 62/86] Adjusted Whitespace --- ...pected-xml-with-standalone-observations.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 6dfae3c831..8e9e11b666 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -268,15 +268,15 @@ - - - - - - - - - + + + + + + + + + From e589b9b83ffb2511d665e251c9031f80367c5fbd Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 10:51:03 +0000 Subject: [PATCH 63/86] Adjusted Whitespace --- ...ected-xml-with-standalone-observations.xml | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 8e9e11b666..26bd7aa691 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -232,41 +232,41 @@ - - - - -
- - - - - - - - - - - - - Mocked code - - -
- - + + + + +
+ + + + + + + + + + + + + Mocked code + + +
+ + - - - - - - + + + + + + From b4090a6b45485b09dc3460af3ec4e58014cdd180 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 12:24:52 +0000 Subject: [PATCH 64/86] Adjusted Whitespace --- ...ected-xml-with-standalone-observations.xml | 85 ++++++++++--------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 26bd7aa691..b9e54f9bd6 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -145,51 +145,52 @@ - - - - - - -
- - - - - - - -
- - - Blood - - - + - - - CommentType:LAB SPECIMEN COMMENT(E271) - CommentDate:20030109000000 + + + + + +
+ + + + + + + +
+ + + Blood + + + + + + + CommentType:LAB SPECIMEN COMMENT(E271) + CommentDate:20030109000000 - Received Date: 2003-01-09 13:54 - - - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:UNK + Received Date: 2003-01-09 13:54 + + + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK - EMPTY REPORT - - - - - + EMPTY REPORT + + + + + From 656e38437e8a167f36d11fee7cfdb07aabebd2d8 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 12:29:04 +0000 Subject: [PATCH 65/86] Adjusted Whitespace --- .../expected-xml-with-standalone-observations.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index b9e54f9bd6..78834ea9db 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -53,7 +53,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -105,14 +105,14 @@ CommentType:LABORATORY RESULT COMMENT(E141) - CommentDate:20030221115000 +CommentDate:20030221115000 - Status: unknown +Status: unknown - + From 5a854f16816b5d49af752cbe01606d721340ca95 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 12:33:01 +0000 Subject: [PATCH 66/86] Adjusted Whitespace --- .../output/expected-xml-with-standalone-observations.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 78834ea9db..6b62fd19e7 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -53,7 +53,7 @@ - + @@ -124,7 +124,7 @@ Status: unknown - +
@@ -133,7 +133,7 @@ Status: unknown - + CommentType:AGGREGATE COMMENT SET From 913631b985d14e842e6f3db0256ffdf3f5dfc4bc Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Tue, 12 Nov 2024 12:46:32 +0000 Subject: [PATCH 67/86] Adjusted Whitespace --- .../output/expected-xml-with-standalone-observations.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index 6b62fd19e7..c5218a3a12 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -137,9 +137,9 @@ Status: unknown CommentType:AGGREGATE COMMENT SET - CommentDate:UNK +CommentDate:UNK - EMPTY REPORT +EMPTY REPORT @@ -250,8 +250,8 @@ Status: unknown - - + + Mocked code From 9b83a08db487baf42c91f43be13c85998317f5fd Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Wed, 13 Nov 2024 11:02:14 +0000 Subject: [PATCH 68/86] Remove test file which appears to be duplicate --- ...imen-and-test-result-with-no-specimen.json | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json deleted file mode 100644 index 8f6701fce7..0000000000 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-test-result-with-no-specimen.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "resourceType": "DiagnosticReport", - "id": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC", - "meta": { - "profile": [ - "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1" - ] - }, - "identifier": [ - { - "system": "https://wiremock/", - "value": "486785FA-C3A5-4AB2-B317-FF9C24A3FDBC" - } - ], - "status": "unknown", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "721981007", - "display": "Diagnostic studies report" - } - ] - }, - "subject": { - "reference": "Patient/DAED5527-1985-45D9-993E-C5FF51F36828" - }, - "issued": "2001-02-03T09:00:00+00:00", - "specimen": [ - { - "reference": "Specimen/NON-SIGNIFICANT-SPECIMEN" - } - ], - "result": [ - { - "reference": "Observation/TEST-RESULT-NO-SPECIMEN" - } - ] -} \ No newline at end of file From 97d6bd4c178729710e3ec78616bc62f1a59c997d Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Wed, 13 Nov 2024 11:05:31 +0000 Subject: [PATCH 69/86] Remove unused test file --- ...servation-and-one-unlinked-observation.xml | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml deleted file mode 100644 index 16df4a5268..0000000000 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Filed Report - - - -
- - - - - - CommentType:LABORATORY RESULT COMMENT(E141) -CommentDate:20100225154100 - -Status: unknown - - - - - - - - - \ No newline at end of file From baf4a8af26982575ee66528e621e3df657f95159 Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Wed, 13 Nov 2024 11:09:07 +0000 Subject: [PATCH 70/86] Remove unused Observation --- .../mapper/diagnosticreport/fhir_bundle.json | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 7f8b054728..4cbfa54797 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -242,30 +242,6 @@ ] } }, - { - "resource":{ - "resourceType":"Specimen", - "id":"NON-SIGNIFICANT-SPECIMEN", - "meta":{ - "profile":[ - "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1" - ] - }, - "identifier":[ - { - "system":"https://wiremock/", - "value":"NON-SIGNIFICANT-SPECIMEN" - } - ], - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" - }, - "receivedTime":"2001-02-03T10:00:00+00:00", - "collection":{ - "collectedDateTime":"2001-02-03T11:00:00+00:00" - } - } - }, { "resource":{ "resourceType":"Observation", From 58eb397106398a6d75bace2723a26e7928b49666 Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Wed, 13 Nov 2024 11:12:21 +0000 Subject: [PATCH 71/86] Remove unused Observation --- .../mapper/diagnosticreport/fhir_bundle.json | 65 ++----------------- 1 file changed, 6 insertions(+), 59 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 4cbfa54797..338c808471 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -861,65 +861,12 @@ } }, { - "resource":{ - "resourceType":"Observation", - "id":"TEST-RESULT-NO-SPECIMEN", - "meta":{ - "profile":[ - "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" - ] - }, - "identifier":[ - { - "system":"https://wiremock/", - "value":"TEST-RESULT-NO-SPECIMEN" - } - ], - "status":"final", - "code":{ - "coding":[ - { - "system":"http://read.info/readv2", - "code":"42R5.00", - "display":"Serum TIBC", - "userSelected":true - }, - { - "extension":[ - { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension":[ - { - "url":"descriptionId", - "valueId":"2580111000000118" - } - ] - } - ], - "system":"http://snomed.info/sct", - "code":"1015451000000101", - "display":"Serum total iron binding capacity" - } - ] - }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" - }, - "effectiveDateTime":"2001-02-03T12:00:00+00:00", - "issued":"2001-02-03T13:00:00+00:00", - "valueQuantity":{ - "value":42.000, - "unit":"umol/L" - } - } - }, - { - "resource":{ - "resourceType":"Practitioner", - "id":"89890-1985-45D9-993E-C5FF51F36828", - "meta":{ - "versionId":"7786052607397903776", - "profile":[ + "resource": { + "resourceType": "Practitioner", + "id": "89890-1985-45D9-993E-C5FF51F36828", + "meta": { + "versionId": "7786052607397903776", + "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" ] }, From b7a998d3ea6cc1dc432678de94f550cffaa35994 Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Wed, 13 Nov 2024 11:15:32 +0000 Subject: [PATCH 72/86] Replaces references to Observation for one which already exists in bundle --- .../DiagnosticReportMapperTest.java | 2 +- ...ervation-and-one-unlinked-observation.json | 2 +- .../mapper/diagnosticreport/fhir_bundle.json | 66 ------------------- 3 files changed, 2 insertions(+), 68 deletions(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index 36a2fabcc7..68e8d69cd3 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -330,7 +330,7 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); - final String expectObservation = "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7"; + final String expectObservation = "Observation/TestResult-WithoutSpecimenReference"; final String dummyNamePrefix = DiagnosticReportMapper.DUMMY_SPECIMEN_ID_PREFIX; when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json index 4a00f170a5..a4e5ea74fe 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-one-linked-observation-and-one-unlinked-observation.json @@ -40,6 +40,6 @@ }], "result": [ { "reference": "Observation/B7F05EA7-A1A4-48C0-9C4C-CDB5768796B2" }, - { "reference": "Observation/AD373CA7-3940-4249-85A2-D3A22E9F17C7" } + { "reference": "Observation/TestResult-WithoutSpecimenReference" } ] } \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json index 338c808471..9c558c7799 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/fhir_bundle.json @@ -671,72 +671,6 @@ ] } }, - { - "resource":{ - "resourceType":"Observation", - "id":"AD373CA7-3940-4249-85A2-D3A22E9F17C7", - "meta":{ - "profile":[ - "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1" - ] - }, - "identifier":[ - { - "system":"https://EMISWeb/A82038", - "value":"AD373CA7-3940-4249-85A2-D3A22E9F17C7" - } - ], - "status":"unknown", - "category":[ - { - "coding":[ - { - "system":"http://hl7.org/fhir/observation-category", - "code":"laboratory", - "display":"Laboratory" - } - ] - } - ], - "code":{ - "coding":[ - { - "system":"http://read.info/readv2", - "code":"4483.00", - "display":"Serum ACTH", - "userSelected":true - }, - { - "extension":[ - { - "url":"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid", - "extension":[ - { - "url":"descriptionId", - "valueId":"2563401000000119" - } - ] - } - ], - "system":"http://snomed.info/sct", - "code":"997201000000100", - "display":"Normal levels detected" - } - ] - }, - "subject":{ - "reference":"Patient/DAED5527-1985-45D9-993E-C5FF51F36828" - }, - "effectiveDateTime":"2010-02-23", - "issued":"2010-02-25T15:41:00+00:00", - "performer":[ - { - "reference":"Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B" - } - ], - "comment":"Test not available - this is a test result without a specimen." - } - }, { "resource":{ "resourceType":"Observation", From b53d885435c387e40d8ed759602e43036bdbd1bf Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 11:59:33 +0000 Subject: [PATCH 73/86] Reverted test test files with filing comments associated with specimens --- ...ed-xml-with-observations-inside-report.xml | 39 +--- ...ected-xml-with-standalone-observations.xml | 166 +++++++----------- 2 files changed, 69 insertions(+), 136 deletions(-) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml index 3e3b7e484a..fc567ff8ca 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-observations-inside-report.xml @@ -129,49 +129,16 @@ This is some random free text - + -
+
- UNKNOWN + Blood - - - Mocked code - - -
- - - - - - - - - - - -
- - - - - - - -
- - - Blood - - - - CommentType:LAB SPECIMEN COMMENT(E271) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index c5218a3a12..aea9b667b2 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -124,16 +124,28 @@ Status: unknown - + -
+
- UNKNOWN + Blood + + + CommentType:LAB SPECIMEN COMMENT(E271) +CommentDate:20030109000000 + +Received Date: 2003-01-09 13:54 + + + + + + CommentType:AGGREGATE COMMENT SET @@ -146,110 +158,64 @@ EMPTY REPORT - - - - - + + + + + + + + + -
+
- - - - - - -
- - - Blood - - - - - - - CommentType:LAB SPECIMEN COMMENT(E271) - CommentDate:20030109000000 - - Received Date: 2003-01-09 13:54 - - - - - - - + + + + + - CommentType:AGGREGATE COMMENT SET - CommentDate:UNK - - EMPTY REPORT - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - This is some random free text - - - - - - - - - - - - - - - - - -
- - - - - + This is some random free text + + + + + + + + + + + + + + +
+ + + + + + + + From f630524f9cfbb12046c98852a0534aeabf24ec91 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:04:48 +0000 Subject: [PATCH 74/86] Removed filtering of filing comments from Specimen mapper and added it to diagnostic report mapper --- .../DiagnosticReportMapper.java | 6 ++- .../diagnosticreport/SpecimenMapper.java | 1 - .../DiagnosticReportMapperTest.java | 37 ++++--------------- ...iagnostic-report-with-multiple-results.xml | 2 +- ...tput_default_specimen_with_observation.xml | 2 +- 5 files changed, 14 insertions(+), 34 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 04a19fafff..b06bdc3371 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -12,6 +12,7 @@ import java.util.Collections; import java.util.List; import java.util.Optional; +import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -121,7 +122,7 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List specimens = new ArrayList<>(); - // At least one specimen is required to exist for any DiagnosticReport + // At least one specimen is required to exist for any DiagnosticReport, according to the mim if (!diagnosticReport.hasSpecimen() || hasOrphanedTestResults(observations)) { specimens.add(generateDummySpecimen(diagnosticReport)); } @@ -143,6 +144,7 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List observations) { return observations .stream() + .filter(observation -> !isFilingComment(observation)) .anyMatch(observation -> !observation.hasSpecimen()); } @@ -161,7 +163,7 @@ private List assignDummySpecimensToOrphanedTestResults( Reference dummySpecimenReference = new Reference(dummySpecimen.getId()); for (Observation observation : observations) { - if (!observation.hasSpecimen()) { + if (!observation.hasSpecimen() && !isFilingComment(observation)) { observation.setSpecimen(dummySpecimenReference); } } diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java index 963bfe60a7..045ca501be 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java @@ -149,7 +149,6 @@ private String mapObservationsAssociatedWithSpecimen(Specimen specimen, List.*" - ); + assertThat(actualXml).containsIgnoringWhitespaces( + ""); } @Test @@ -330,25 +322,13 @@ void When_DiagnosticReport_Has_SpecimenALinkedTestResultAndAnUnlinkedTestResult_ final DiagnosticReport diagnosticReport = getDiagnosticReportResourceFromJson(diagnosticReportFileName); final Bundle bundle = getBundleResourceFromJson(INPUT_JSON_BUNDLE); final InputBundle inputBundle = new InputBundle(bundle); - final String expectObservation = "Observation/TestResult-WithoutSpecimenReference"; - final String dummyNamePrefix = DiagnosticReportMapper.DUMMY_SPECIMEN_ID_PREFIX; when(messageContext.getInputBundleHolder()).thenReturn(inputBundle); final String actualXml = mapper.mapDiagnosticReportToCompoundStatement(diagnosticReport); // This checks that the unlinked test result is given a dummy specimen. - assertThat(actualXml).matches("(?s).*.*" - ); - // This checks that the linked test result has its correct specimen. - assertThat(actualXml).containsIgnoringWhitespaces("" - ); + assertThat(actualXml).containsIgnoringWhitespaces( + ""); } @@ -412,10 +392,9 @@ private Answer mockSpecimenMapping() { } if (linkedObservations.isEmpty()) { - return String.format("", specimen.getId()); + return String.format("", specimen.getId()); } - return String.format("", + return String.format("", specimen.getId(), String.join(",", linkedObservations)); }; diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml index 3029b75293..434a62d8e3 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml @@ -62,6 +62,6 @@ CommentDate:20100225154100 - + \ No newline at end of file diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/specimen/expected_output_default_specimen_with_observation.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/specimen/expected_output_default_specimen_with_observation.xml index aa913507b7..229a309ce4 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/specimen/expected_output_default_specimen_with_observation.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/specimen/expected_output_default_specimen_with_observation.xml @@ -31,6 +31,6 @@ Received Date: 2010-02-24 15:41 - + \ No newline at end of file From 99f4f8300d5ac51bd39877f62ca40bb87af5613e Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:31:23 +0000 Subject: [PATCH 75/86] Moved filing comment filter to diagnostic report mapper --- .../mapper/diagnosticreport/DiagnosticReportMapper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index b06bdc3371..c88876db85 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -79,15 +79,17 @@ public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnostic List specimens = fetchSpecimens(diagnosticReport, observations); final IdMapper idMapper = messageContext.getIdMapper(); markObservationsAsProcessed(idMapper, observations); + observations = assignDummySpecimensToOrphanedTestResults(observations, specimens); - final List processedObservations = - assignDummySpecimensToOrphanedTestResults(observations, specimens); + var processedObservations = observations.stream() + .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) + .toList(); String mappedSpecimens = specimens.stream() .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, processedObservations, diagnosticReport)) .collect(Collectors.joining()); - String reportLevelNarrativeStatements = prepareReportLevelNarrativeStatements(diagnosticReport, processedObservations); + String reportLevelNarrativeStatements = prepareReportLevelNarrativeStatements(diagnosticReport, observations); var diagnosticReportCompoundStatementTemplateParameters = DiagnosticReportCompoundStatementTemplateParameters.builder() .compoundStatementId(idMapper.getOrNew(ResourceType.DiagnosticReport, diagnosticReport.getIdElement())) From 75738f26f3f5e5f34620f12419f858c690a7d4b5 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:35:35 +0000 Subject: [PATCH 76/86] Reverted expected-components-1.xml --- .../expected-components-1.xml | 157 ------------------ 1 file changed, 157 deletions(-) diff --git a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml index 370115a4ef..240bffd73a 100644 --- a/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml +++ b/service/src/test/resources/ehr/mapper/encountercomponents/expected-components-1.xml @@ -455,163 +455,6 @@ - - - - - -
- - - - - - - -
- - - UNKNOWN - - - - - - - Mocked code - - -
- - - - - - Mocked code - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - - NEGATIVE - In normal pregnancies the test will usually be positive from the - second day after the expected menstruation. - - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151704 - - (q) - Normal - No Action - - - - - - - - - - Mocked code - - -
- - - - - - Mocked code - - -
- - - - - mmol/L - - - - - - - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - - - - Mocked code - - -
- - - - - - Mocked code - - -
- - - - - - - - CommentType:AGGREGATE COMMENT SET - CommentDate:20100223 - - Test not available - - - - - - - - CommentType:USER COMMENT - CommentDate:20201215151713 - - (q) - Normal - No Action - - - - - - - - - From 9051dbb326c00d0b616958e7f9c1192bafc0cb2e Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:39:48 +0000 Subject: [PATCH 77/86] Updated test file --- ...ected-xml-with-standalone-observations.xml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml index aea9b667b2..8a5f1a6c55 100644 --- a/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml +++ b/service/src/test/resources/ehr/request/fhir/output/expected-xml-with-standalone-observations.xml @@ -124,6 +124,39 @@ Status: unknown + + +
+ + + UNKNOWN + + + + + + + CommentType:AGGREGATE COMMENT SET + CommentDate:UNK + + EMPTY REPORT + + + + + + + + + + + +
+ + + + +
From 69b58cab835c8eafcf48dcec0374ee82685a4b2c Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:46:26 +0000 Subject: [PATCH 78/86] Renamed methods. --- .../diagnosticreport/DiagnosticReportMapper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index c88876db85..af02285725 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -79,7 +79,7 @@ public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnostic List specimens = fetchSpecimens(diagnosticReport, observations); final IdMapper idMapper = messageContext.getIdMapper(); markObservationsAsProcessed(idMapper, observations); - observations = assignDummySpecimensToOrphanedTestResults(observations, specimens); + observations = assignDummySpecimensToObservationsWithNoSpecimen(observations, specimens); var processedObservations = observations.stream() .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) @@ -125,7 +125,7 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List specimens = new ArrayList<>(); // At least one specimen is required to exist for any DiagnosticReport, according to the mim - if (!diagnosticReport.hasSpecimen() || hasOrphanedTestResults(observations)) { + if (!diagnosticReport.hasSpecimen() || hasObservationsWithoutSpecimen(observations)) { specimens.add(generateDummySpecimen(diagnosticReport)); } @@ -143,17 +143,17 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List observations) { + private boolean hasObservationsWithoutSpecimen(List observations) { return observations .stream() .filter(observation -> !isFilingComment(observation)) .anyMatch(observation -> !observation.hasSpecimen()); } - private List assignDummySpecimensToOrphanedTestResults( + private List assignDummySpecimensToObservationsWithNoSpecimen( List observations, List specimens) { - if (!hasOrphanedTestResults(observations)) { + if (!hasObservationsWithoutSpecimen(observations)) { return observations; } From 93c2eb97cf75371fb128ed9a4ac7c9114b88b37a Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:48:15 +0000 Subject: [PATCH 79/86] Renamed Variable --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index af02285725..6855a32680 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -81,12 +81,12 @@ public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnostic markObservationsAsProcessed(idMapper, observations); observations = assignDummySpecimensToObservationsWithNoSpecimen(observations, specimens); - var processedObservations = observations.stream() + List observationsExcludingFilingComments = observations.stream() .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) .toList(); String mappedSpecimens = specimens.stream() - .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, processedObservations, diagnosticReport)) + .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, observationsExcludingFilingComments, diagnosticReport)) .collect(Collectors.joining()); String reportLevelNarrativeStatements = prepareReportLevelNarrativeStatements(diagnosticReport, observations); From b7e60d65915c5fb30a76ada45419bb7db125056c Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:53:02 +0000 Subject: [PATCH 80/86] Renamed variable --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index 6855a32680..cdee5a15b8 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -130,14 +130,14 @@ private List fetchSpecimens(DiagnosticReport diagnosticReport, List preExistingSpecimens = diagnosticReport.getSpecimen() + List nonDummySpecimens = diagnosticReport.getSpecimen() .stream() .map(specimenReference -> inputBundleHolder.getResource(specimenReference.getReferenceElement())) .flatMap(Optional::stream) .map(Specimen.class::cast) .collect(Collectors.toList()); - specimens.addAll(preExistingSpecimens); + specimens.addAll(nonDummySpecimens); return specimens; From fea624bc1b3ebdb9a433820d607865117407e113 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:57:04 +0000 Subject: [PATCH 81/86] Fixed indentation --- .../ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index a6d8348dec..a574c8627a 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -119,7 +119,7 @@ public void setUp() throws IOException { when(agentDirectory.getAgentId(any(Reference.class))).thenAnswer(mockIdForReference()); when(randomIdGeneratorService.createNewId()).thenReturn(TEST_ID); when(specimenMapper.mapSpecimenToCompoundStatement(any(Specimen.class), anyList(), any(DiagnosticReport.class))) - .thenAnswer(mockSpecimenMapping()); + .thenAnswer(mockSpecimenMapping()); when(codeableConceptCdMapper.mapCodeableConceptToCd(any(CodeableConcept.class))) .thenReturn(CodeableConceptMapperMockUtil.NULL_FLAVOR_CODE); From db4bec955f2475c08421d44399407cd5823853a7 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 15:59:09 +0000 Subject: [PATCH 82/86] Fixed whitespace --- .../diagnostic-report-with-multiple-results.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml index 434a62d8e3..737f71cac4 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multiple-results.xml @@ -62,6 +62,6 @@ CommentDate:20100225154100 - + \ No newline at end of file From efddaef6f8db7bdf2fd5dbfb6d5d9b0ecc504b08 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Wed, 13 Nov 2024 16:25:32 +0000 Subject: [PATCH 83/86] Removed redundant test. --- .../diagnosticreport/SpecimenMapper.java | 1 - .../DiagnosticReportMapperTest.java | 5 +--- ...specimen-and-one-unrelated-observation.xml | 26 ------------------- 3 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java index 045ca501be..d660d69092 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/SpecimenMapper.java @@ -43,7 +43,6 @@ import java.util.List; import java.util.Objects; import java.util.Optional; -import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java index a574c8627a..3e999f021f 100644 --- a/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java +++ b/service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapperTest.java @@ -77,7 +77,6 @@ class DiagnosticReportMapperTest { private static final String INPUT_JSON_MULTIPLE_CODED_DIAGNOSIS = "diagnostic-report-with-multiple-coded-diagnosis.json"; private static final String INPUT_JSON_EXTENSION_ID = "diagnostic-report-with-extension-id.json"; private static final String INPUT_JSON_URN_OID_EXTENSION_ID = "diagnostic-report-with-urn-oid-extension-id.json"; - private static final String INPUT_JSON_UNRELATED_TEST_RESULT = "diagnostic-report-with-one-specimen-and-one-unrelated-observation.json"; private static final String OUTPUT_XML_REQUIRED_DATA = "diagnostic-report-with-required-data.xml"; private static final String OUTPUT_XML_STATUS_NARRATIVE = "diagnostic-report-with-status-narrative.xml"; @@ -89,7 +88,6 @@ class DiagnosticReportMapperTest { private static final String OUTPUT_XML_MULTIPLE_CODED_DIAGNOSIS = "diagnostic-report-with-multiple-coded-diagnosis.xml"; private static final String OUTPUT_XML_EXTENSION_ID = "diagnostic-report-with-extension-id.xml"; private static final String OUTPUT_XML_MULTIPLE_RESULTS = "diagnostic-report-with-multiple-results.xml"; - private static final String OUTPUT_XML_UNRELATED_TEST_RESULT = "diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml"; @Mock private CodeableConceptCdMapper codeableConceptCdMapper; @@ -357,8 +355,7 @@ private static Stream resourceFileParams() { Arguments.of(INPUT_JSON_CODED_DIAGNOSIS, OUTPUT_XML_CODED_DIAGNOSIS), Arguments.of(INPUT_JSON_MULTIPLE_CODED_DIAGNOSIS, OUTPUT_XML_MULTIPLE_CODED_DIAGNOSIS), Arguments.of(INPUT_JSON_EXTENSION_ID, OUTPUT_XML_EXTENSION_ID), - Arguments.of(INPUT_JSON_URN_OID_EXTENSION_ID, OUTPUT_XML_EXTENSION_ID), - Arguments.of(INPUT_JSON_UNRELATED_TEST_RESULT, OUTPUT_XML_UNRELATED_TEST_RESULT) + Arguments.of(INPUT_JSON_URN_OID_EXTENSION_ID, OUTPUT_XML_EXTENSION_ID) ); } diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml deleted file mode 100644 index 57c1a63241..0000000000 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen-and-one-unrelated-observation.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Filed Report - - - -
- - - - - - CommentType:LABORATORY RESULT COMMENT(E141) -CommentDate:20100225154100 - -Status: unknown - - - - - - - - \ No newline at end of file From 47656e52a257a7039b15f4ab0b73f2f3b25f8a0d Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Thu, 14 Nov 2024 10:34:05 +0000 Subject: [PATCH 84/86] Add new lines to make test file clearer --- .../diagnostic-report-with-multi-specimens.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml index 4f249eb622..bc44680efb 100644 --- a/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml +++ b/service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml @@ -20,6 +20,9 @@ Status: unknown - + + + + \ No newline at end of file From c07f007002674be48b0db2b6c934317f706f69e9 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Thu, 14 Nov 2024 14:33:38 +0000 Subject: [PATCH 85/86] Refactoring --- .../mapper/diagnosticreport/DiagnosticReportMapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java index cdee5a15b8..f2009e4de7 100644 --- a/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java +++ b/service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java @@ -79,11 +79,12 @@ public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnostic List specimens = fetchSpecimens(diagnosticReport, observations); final IdMapper idMapper = messageContext.getIdMapper(); markObservationsAsProcessed(idMapper, observations); - observations = assignDummySpecimensToObservationsWithNoSpecimen(observations, specimens); - List observationsExcludingFilingComments = observations.stream() - .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) - .toList(); + List observationsExcludingFilingComments = assignDummySpecimensToObservationsWithNoSpecimen( + observations.stream() + .filter(Predicate.not(DiagnosticReportMapper::isFilingComment)) + .toList(), + specimens); String mappedSpecimens = specimens.stream() .map(specimen -> specimenMapper.mapSpecimenToCompoundStatement(specimen, observationsExcludingFilingComments, diagnosticReport)) From 30ad8807c57197a307d7c7e31a6e9d084d9eab80 Mon Sep 17 00:00:00 2001 From: Alex-Nita Date: Thu, 14 Nov 2024 15:20:22 +0000 Subject: [PATCH 86/86] Added changelog entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7df6f07be6..dd29aa7df5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## Added - +* When mapping a `DiagnosticReport` which contains a `TestResult` without a `Specimen` attached to it, a new `Specimen` is +created to allow the `TestResult` to be mapped correctly. * When mapping a `DocumentReference` which contains a `NOPAT` `meta.security` or `NOPAT` `securityLabel` tag the resultant XML for that resource will contain a `NOPAT` `confidentialityCode` element. * When mapping `AllergyIntolerances` which contain a `NOPAT` `meta.security` tag the resultant XML for that resource