Skip to content

Commit bdc04d2

Browse files
NRL-1050 Add imaging type/category validation
1 parent 9170bad commit bdc04d2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

layer/nrlf/core/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ def coding_value(self):
150150
PointerTypes.PERSONALISED_CARE_AND_SUPPORT_PLAN.value: {
151151
"display": "Personalised Care and Support Plan",
152152
},
153+
PointerTypes.MRA_UPPER_LIMB_ARTERY.value: {
154+
"display": "MRA Upper Limb Artery",
155+
},
156+
PointerTypes.MRI_AXILLA_BOTH.value: {
157+
"display": "MRI Axilla Both",
158+
},
153159
}
154160

155161
TYPE_CATEGORIES = {

layer/nrlf/core/validators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,11 @@ def _validate_type(self, model: DocumentReference):
361361
return
362362

363363
coding = model.type.coding[0]
364-
if coding.system != "http://snomed.info/sct":
364+
if coding.system not in ["http://snomed.info/sct", "https://nicip.nhs.uk"]:
365365
self.result.add_error(
366366
issue_code="value",
367367
error_code="INVALID_RESOURCE",
368-
diagnostics=f"Invalid type system: {coding.system} Type system must be 'http://snomed.info/sct'",
368+
diagnostics=f"Invalid type system: {coding.system} Type system must be either 'http://snomed.info/sct' or 'https://nicip.nhs.uk'",
369369
field="type.coding[0].system",
370370
)
371371
return
@@ -416,11 +416,11 @@ def _validate_category(self, model: DocumentReference):
416416
return
417417

418418
coding = model.category[0].coding[0]
419-
if coding.system != "http://snomed.info/sct":
419+
if coding.system not in ["http://snomed.info/sct", "https://nicip.nhs.uk"]:
420420
self.result.add_error(
421421
issue_code="value",
422422
error_code="INVALID_RESOURCE",
423-
diagnostics=f"Invalid category system: {coding.system} Category system must be 'http://snomed.info/sct'",
423+
diagnostics=f"Invalid category system: {coding.system} Category system must be either 'http://snomed.info/sct' or 'https://nicip.nhs.uk'",
424424
field="category[0].coding[0].system",
425425
)
426426
return

0 commit comments

Comments
 (0)