@@ -96,7 +96,9 @@ 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 ,
101+ self .pre_validate_vaccine_display ,
100102 ]
101103
102104 for method in validation_methods :
@@ -590,7 +592,7 @@ def pre_validate_vaccination_procedure_code(self, values: dict) -> dict:
590592 (legacy CSV field name: VACCINATION_PROCEDURE_CODE) exists, then it is a non-empty string
591593 """
592594 url = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-" + "VaccinationProcedure"
593- system = "http://snomed.info/sct"
595+ system = Urls . snomed
594596 field_type = "code"
595597 field_location = generate_field_location_for_extension (url , system , field_type )
596598 try :
@@ -600,14 +602,30 @@ def pre_validate_vaccination_procedure_code(self, values: dict) -> dict:
600602 except (KeyError , IndexError ):
601603 pass
602604
605+ def pre_validate_vaccination_procedure_display (self , values : dict ) -> dict :
606+ """
607+ Pre-validate that, if extension[?(@.url=='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-
608+ VaccinationProcedure')].valueCodeableConcept.coding[?(@.system=='http://snomed.info/sct')].display
609+ (legacy CSV field name: VACCINATION_PROCEDURE_TERM) exists, then it is a non-empty string
610+ """
611+ url = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-" + "VaccinationProcedure"
612+ system = Urls .snomed
613+ field_type = "display"
614+ field_location = generate_field_location_for_extension (url , system , field_type )
615+ try :
616+ field_value = get_generic_extension_value (values , url , system , field_type )
617+ PreValidation .for_string (field_value , field_location )
618+ except (KeyError , IndexError ):
619+ pass
620+
603621 def pre_validate_vaccination_situation_code (self , values : dict ) -> dict :
604622 """
605623 Pre-validate that, if extension[?(@.url=='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-
606624 VaccinationSituation')].valueCodeableConcept.coding[?(@.system=='http://snomed.info/sct')].code
607625 (legacy CSV field name: VACCINATION_SITUATION_CODE) exists, then it is a non-empty string
608626 """
609627 url = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-VaccinationSituation"
610- system = "http://snomed.info/sct"
628+ system = Urls . snomed
611629 field_type = "code"
612630 field_location = generate_field_location_for_extension (url , system , field_type )
613631 try :
@@ -623,7 +641,7 @@ def pre_validate_vaccination_situation_display(self, values: dict) -> dict:
623641 (legacy CSV field name: VACCINATION_SITUATION_TERM) exists, then it is a non-empty string
624642 """
625643 url = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-VaccinationSituation"
626- system = "http://snomed.info/sct"
644+ system = Urls . snomed
627645 field_type = "display"
628646 field_location = generate_field_location_for_extension (url , system , field_type )
629647 try :
@@ -702,7 +720,7 @@ def pre_validate_disease_type_coding_codes(self, values: dict) -> dict:
702720 Pre-validate that, if protocolApplied[0].targetDisease[{i}].coding[?(@.system=='http://snomed.info/sct')].code
703721 exists, then it is a non-empty string
704722 """
705- url = "http://snomed.info/sct"
723+ url = Urls . snomed
706724 try :
707725 for i in range (len (values ["protocolApplied" ][0 ]["targetDisease" ])):
708726 field_location = f"protocolApplied[0].targetDisease[{ i } ].coding[?(@.system=='{ url } ')].code"
@@ -761,7 +779,7 @@ def pre_validate_site_coding_code(self, values: dict) -> dict:
761779 Pre-validate that, if site.coding[?(@.system=='http://snomed.info/sct')].code
762780 (legacy CSV field name: SITE_OF_VACCINATION_CODE) exists, then it is a non-empty string
763781 """
764- url = "http://snomed.info/sct"
782+ url = Urls . snomed
765783 field_location = f"site.coding[?(@.system=='{ url } ')].code"
766784 try :
767785 site_coding_code = [x for x in values ["site" ]["coding" ] if x .get ("system" ) == url ][0 ]["code" ]
@@ -774,7 +792,7 @@ def pre_validate_site_coding_display(self, values: dict) -> dict:
774792 Pre-validate that, if site.coding[?(@.system=='http://snomed.info/sct')].display
775793 (legacy CSV field name: SITE_OF_VACCINATION_TERM) exists, then it is a non-empty string
776794 """
777- url = "http://snomed.info/sct"
795+ url = Urls . snomed
778796 field_location = f"site.coding[?(@.system=='{ url } ')].display"
779797 try :
780798 field_value = [x for x in values ["site" ]["coding" ] if x .get ("system" ) == url ][0 ]["display" ]
@@ -795,7 +813,7 @@ def pre_validate_route_coding_code(self, values: dict) -> dict:
795813 Pre-validate that, if route.coding[?(@.system=='http://snomed.info/sct')].code
796814 (legacy CSV field name: ROUTE_OF_VACCINATION_CODE) exists, then it is a non-empty string
797815 """
798- url = "http://snomed.info/sct"
816+ url = Urls . snomed
799817 field_location = f"route.coding[?(@.system=='{ url } ')].code"
800818 try :
801819 field_value = [x for x in values ["route" ]["coding" ] if x .get ("system" ) == url ][0 ]["code" ]
@@ -808,7 +826,7 @@ def pre_validate_route_coding_display(self, values: dict) -> dict:
808826 Pre-validate that, if route.coding[?(@.system=='http://snomed.info/sct')].display
809827 (legacy CSV field name: ROUTE_OF_VACCINATION_TERM) exists, then it is a non-empty string
810828 """
811- url = "http://snomed.info/sct"
829+ url = Urls . snomed
812830 field_location = f"route.coding[?(@.system=='{ url } ')].display"
813831 try :
814832 field_value = [x for x in values ["route" ]["coding" ] if x .get ("system" ) == url ][0 ]["display" ]
@@ -951,11 +969,24 @@ def pre_validate_vaccine_code(self, values: dict) -> dict:
951969 NOTE: vaccineCode is a mandatory FHIR field. A value of None will be rejected by the
952970 FHIR model before pre-validators are run.
953971 """
954- url = "http://snomed.info/sct"
972+ url = Urls . snomed
955973 field_location = f"vaccineCode.coding[?(@.system=='{ url } ')].code"
956974 try :
957975 field_value = [x for x in values ["vaccineCode" ]["coding" ] if x .get ("system" ) == url ][0 ]["code" ]
958976 PreValidation .for_string (field_value , field_location )
959977 PreValidation .for_snomed_code (field_value , field_location )
960978 except (KeyError , IndexError ):
961979 pass
980+
981+ def pre_validate_vaccine_display (self , values : dict ) -> dict :
982+ """
983+ Pre-validate that, if vaccineCode.coding[?(@.system=='http://snomed.info/sct')].display
984+ (legacy CSV field : VACCINE_PRODUCT_TERM) exists, then it is a non-empty string
985+ """
986+ url = Urls .snomed
987+ field_location = f"vaccineCode.coding[?(@.system=='{ url } ')].display"
988+ try :
989+ field_value = [x for x in values ["vaccineCode" ]["coding" ] if x .get ("system" ) == url ][0 ]["display" ]
990+ PreValidation .for_string (field_value , field_location )
991+ except (KeyError , IndexError ):
992+ pass
0 commit comments