Skip to content

Commit e8679db

Browse files
authored
VED-843: Refactor validator methods (#1090)
1 parent f306d5c commit e8679db

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lambdas/shared/src/common/models/fhir_immunization_pre_validators.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def pre_validate_practitioner_reference(self, values: dict) -> None:
230230
practitioner_id = str(practitioner[0]["id"])
231231

232232
# Ensure that there are no internal references other than to the contained practitioner
233-
if sum(1 for x in performer_internal_references if x != "#" + practitioner_id) != 0:
233+
if any(x != "#" + practitioner_id for x in performer_internal_references):
234234
raise ValueError(
235235
"performer must not contain any internal references other than"
236236
+ " to the contained Practitioner resource"
@@ -882,8 +882,6 @@ def pre_validate_dose_quantity_system_and_code(self, values: dict) -> None:
882882

883883
PreValidation.require_system_when_code_present(code, system, "doseQuantity.code", "doseQuantity.system")
884884

885-
return values
886-
887885
def pre_validate_dose_quantity_unit(self, values: dict) -> None:
888886
"""
889887
Pre-validate that, if doseQuantity.unit (legacy CSV field name: DOSE_UNIT_TERM) exists,

0 commit comments

Comments
 (0)