Skip to content

Commit 0b0f532

Browse files
committed
pre_validate_vaccination_procedure_display
1 parent af00d98 commit 0b0f532

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

backend/src/models/fhir_immunization_pre_validators.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def validate(self):
9696
self.pre_validate_value_codeable_concept,
9797
self.pre_validate_extension_length,
9898
self.pre_validate_vaccination_procedure_code,
99+
self.pre_validate_vaccination_procedure_display,
99100
self.pre_validate_vaccine_code,
100101
]
101102

@@ -600,6 +601,22 @@ def pre_validate_vaccination_procedure_code(self, values: dict) -> dict:
600601
except (KeyError, IndexError):
601602
pass
602603

604+
def pre_validate_vaccination_procedure_display(self, values: dict) -> dict:
605+
"""
606+
Pre-validate that, if extension[?(@.url=='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-
607+
VaccinationProcedure')].valueCodeableConcept.coding[?(@.system=='http://snomed.info/sct')].display
608+
(legacy CSV field name: VACCINATION_PROCEDURE_TERM) exists, then it is a non-empty string
609+
"""
610+
url = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-" + "VaccinationProcedure"
611+
system = "http://snomed.info/sct"
612+
field_type = "display"
613+
field_location = generate_field_location_for_extension(url, system, field_type)
614+
try:
615+
field_value = get_generic_extension_value(values, url, system, field_type)
616+
PreValidation.for_string(field_value, field_location)
617+
except (KeyError, IndexError):
618+
pass
619+
603620
def pre_validate_vaccination_situation_code(self, values: dict) -> dict:
604621
"""
605622
Pre-validate that, if extension[?(@.url=='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-

0 commit comments

Comments
 (0)