Skip to content

Commit e946b8e

Browse files
Merge pull request #718 from NHSDigital/feature/eema1-NRL-1049-allowNewNICIPTypesAndDiagnosticCategories
NRL-1049 update allowed categories and types for imaging
2 parents 3777015 + a1a997a commit e946b8e

File tree

5 files changed

+144
-59
lines changed

5 files changed

+144
-59
lines changed

api/consumer/searchDocumentReference/tests/test_search_document_reference_consumer.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,53 @@ def test_search_document_reference_happy_path_with_type(
135135
}
136136

137137

138+
@mock_aws
139+
@mock_repository
140+
def test_search_document_reference_happy_path_with_nicip_type(
141+
repository: DocumentPointerRepository,
142+
):
143+
doc_ref = load_document_reference("Y05868-736253002-Valid")
144+
doc_ref.type.coding[0].code = "MAULR"
145+
doc_ref.type.coding[0].system = "https://nicip.nhs.uk"
146+
doc_ref.type.coding[0].display = "MRA Upper Limb Rt"
147+
doc_ref.category[0].coding[0].code = "721981007"
148+
doc_ref.category[0].coding[0].display = "Diagnostic Studies Report"
149+
doc_pointer = DocumentPointer.from_document_reference(doc_ref)
150+
151+
repository.create(doc_pointer)
152+
153+
event = create_test_api_gateway_event(
154+
headers=create_headers(),
155+
query_string_parameters={
156+
"subject:identifier": "https://fhir.nhs.uk/Id/nhs-number|6700028191",
157+
"type": "https://nicip.nhs.uk|MAULR",
158+
},
159+
)
160+
161+
result = handler(event, create_mock_context())
162+
body = result.pop("body")
163+
164+
assert result == {
165+
"statusCode": "200",
166+
"headers": default_response_headers(),
167+
"isBase64Encoded": False,
168+
}
169+
170+
parsed_body = json.loads(body)
171+
assert parsed_body == {
172+
"resourceType": "Bundle",
173+
"type": "searchset",
174+
"link": [
175+
{
176+
"relation": "self",
177+
"url": "https://pytest.api.service.nhs.uk/record-locator/consumer/FHIR/R4/DocumentReference?subject:identifier=https://fhir.nhs.uk/Id/nhs-number|6700028191&type=https://nicip.nhs.uk|MAULR",
178+
}
179+
],
180+
"total": 1,
181+
"entry": [{"resource": doc_ref.dict(exclude_none=True)}],
182+
}
183+
184+
138185
@mock_aws
139186
@mock_repository
140187
def test_search_document_reference_no_results(repository: DocumentPointerRepository):

layer/nrlf/core/constants.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class PointerTypes(Enum):
5555
TREATMENT_ESCALATION_PLAN = "http://snomed.info/sct|735324008"
5656
SUMMARY_RECORD = "http://snomed.info/sct|824321000000109"
5757
PERSONALISED_CARE_AND_SUPPORT_PLAN = "http://snomed.info/sct|2181441000000107"
58+
MRA_UPPER_LIMB_ARTERY = "https://nicip.nhs.uk|MAULR"
59+
MRI_AXILLA_BOTH = "https://nicip.nhs.uk|MAXIB"
5860

5961
@staticmethod
6062
def list():
@@ -71,6 +73,8 @@ class Categories(Enum):
7173
CARE_PLAN = "http://snomed.info/sct|734163000"
7274
OBSERVATIONS = "http://snomed.info/sct|1102421000000108"
7375
CLINICAL_NOTE = "http://snomed.info/sct|823651000000106"
76+
DIAGNOSTIC_STUDIES_REPORT = "http://snomed.info/sct|721981007"
77+
DIAGNOSTIC_PROCEDURE = "http://snomed.info/sct|103693007"
7478

7579
@staticmethod
7680
def list():
@@ -93,6 +97,12 @@ def coding_value(self):
9397
Categories.CLINICAL_NOTE.value: {
9498
"display": "Clinical note",
9599
},
100+
Categories.DIAGNOSTIC_STUDIES_REPORT.value: {
101+
"display": "Diagnostic studies report",
102+
},
103+
Categories.DIAGNOSTIC_PROCEDURE.value: {
104+
"display": "Diagnostic procedure",
105+
},
96106
}
97107

98108
TYPE_CATEGORIES = {
@@ -114,7 +124,11 @@ def coding_value(self):
114124
#
115125
# Clinical notes
116126
PointerTypes.SUMMARY_RECORD.value: Categories.CLINICAL_NOTE.value,
127+
#
128+
# Imaging
129+
PointerTypes.MRA_UPPER_LIMB_ARTERY.value: Categories.DIAGNOSTIC_STUDIES_REPORT.value,
130+
PointerTypes.MRI_AXILLA_BOTH.value: Categories.DIAGNOSTIC_PROCEDURE.value,
117131
}
118132

119133

120-
SYSTEM_SHORT_IDS = {"http://snomed.info/sct": "SCT"}
134+
SYSTEM_SHORT_IDS = {"http://snomed.info/sct": "SCT", "https://nicip.nhs.uk": "NICIP"}

layer/test_permissions/Y05868-TestApp-12345678/Y05868.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"http://snomed.info/sct|736253001",
33
"http://snomed.info/sct|736253002",
44
"http://snomed.info/sct|1363501000000100",
5-
"http://snomed.info/sct|861421000000109"
5+
"http://snomed.info/sct|861421000000109",
6+
"https://nicip.nhs.uk|MAULR"
67
]

resources/fhir/NRLF-RecordCategory-ValueSet.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"resourceType": "ValueSet",
33
"id": "NRLF-RecordCategory",
44
"url": "https://fhir.nhs.uk/England/CodeSystem/England-NRLRecordCategory",
5-
"version": "1.1.1",
5+
"version": "1.1.2",
66
"name": "NRLF Record Category",
77
"status": "draft",
8-
"date": "2024-03-20T00:00:00+00:00",
8+
"date": "2024-10-10T00:00:00+00:00",
99
"publisher": "NHS Digital",
1010
"contact": {
1111
"name": "NRL Team at NHS Digital",
@@ -33,6 +33,14 @@
3333
{
3434
"code": "823651000000106",
3535
"display": "Clinical note"
36+
},
37+
{
38+
"code": "721981007",
39+
"display": "Diagnostic studies report"
40+
},
41+
{
42+
"code": "103693007",
43+
"display": "Diagnostic procedure"
3644
}
3745
]
3846
}

resources/fhir/NRLF-RecordType-ValueSet.json

Lines changed: 70 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -15,61 +15,76 @@
1515
"use": "work"
1616
}
1717
},
18-
"description": "A code from the SNOMED Clinical Terminology UK coding system to represent the NRL clinical record type.",
19-
"copyright": "Copyright 2024 NHS Digital. This value set includes content from SNOMED CT, which is copyright 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement.",
18+
"description": "A code from the SNOMED Clinical Terminology UK coding system or another NHS coding system to represent the NRL clinical record type",
19+
"copyright": "Copyright 2024 NHS Digital. This value set includes content from SNOMED CT and other coding systems, which is copyright 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT and other coding systems is not covered by this agreement.",
2020
"compose": {
21-
"include": {
22-
"system": "http://snomed.info/sct",
23-
"concept": [
24-
{
25-
"code": "736253002",
26-
"display": "Mental health crisis plan"
27-
},
28-
{
29-
"code": "887701000000100",
30-
"display": "Emergency health care plan"
31-
},
32-
{
33-
"code": "861421000000109",
34-
"display": "End of life care coordination summary"
35-
},
36-
{
37-
"code": "1382601000000107",
38-
"display": "ReSPECT (Recommended Summary Plan for Emergency Care and Treatment) form"
39-
},
40-
{
41-
"code": "1363501000000100",
42-
"display": "Royal College of Physicians NEWS2 (National Early Warning Score 2) chart"
43-
},
44-
{
45-
"code": "325691000000100",
46-
"display": "Contingency plan"
47-
},
48-
{
49-
"code": "736373009",
50-
"display": "End of life care plan"
51-
},
52-
{
53-
"code": "16521000000101",
54-
"display": "Lloyd George record folder"
55-
},
56-
{
57-
"code": "736366004",
58-
"display": "Advanced care plan"
59-
},
60-
{
61-
"code": "735324008",
62-
"display": "Treatment escalation plan"
63-
},
64-
{
65-
"code": "824321000000109",
66-
"display": "Summary record"
67-
},
68-
{
69-
"code": "2181441000000107",
70-
"display": "Personalised Care and Support Plan"
71-
}
72-
]
73-
}
21+
"include": [
22+
{
23+
"system": "http://snomed.info/sct",
24+
"concept": [
25+
{
26+
"code": "736253002",
27+
"display": "Mental health crisis plan"
28+
},
29+
{
30+
"code": "887701000000100",
31+
"display": "Emergency health care plan"
32+
},
33+
{
34+
"code": "861421000000109",
35+
"display": "End of life care coordination summary"
36+
},
37+
{
38+
"code": "1382601000000107",
39+
"display": "ReSPECT (Recommended Summary Plan for Emergency Care and Treatment) form"
40+
},
41+
{
42+
"code": "1363501000000100",
43+
"display": "Royal College of Physicians NEWS2 (National Early Warning Score 2) chart"
44+
},
45+
{
46+
"code": "325691000000100",
47+
"display": "Contingency plan"
48+
},
49+
{
50+
"code": "736373009",
51+
"display": "End of life care plan"
52+
},
53+
{
54+
"code": "16521000000101",
55+
"display": "Lloyd George record folder"
56+
},
57+
{
58+
"code": "736366004",
59+
"display": "Advanced care plan"
60+
},
61+
{
62+
"code": "735324008",
63+
"display": "Treatment escalation plan"
64+
},
65+
{
66+
"code": "824321000000109",
67+
"display": "Summary record"
68+
},
69+
{
70+
"code": "2181441000000107",
71+
"display": "Personalised Care and Support Plan"
72+
}
73+
]
74+
},
75+
{
76+
"system": "https://nicip.nhs.uk",
77+
"concept": [
78+
{
79+
"code": "MAULR",
80+
"display": "MRA Upper Limb Rt"
81+
},
82+
{
83+
"code": "MAXIB",
84+
"display": "MRI Axilla Both"
85+
}
86+
]
87+
}
88+
]
7489
}
7590
}

0 commit comments

Comments
 (0)