Skip to content

Commit d9645ea

Browse files
committed
validation expression fix
1 parent 840237b commit d9645ea

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

delta_backend/src/ConversionLayout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@
184184
"fieldNameFlat": "VACCINE_PRODUCT_CODE",
185185
"expression": {
186186
"expressionName": "Not Empty",
187-
"expressionType": "SNOMED",
188-
"expressionRule": "validate-code"
187+
"expressionType": "NOTEMPTY",
188+
"expressionRule": ""
189189
}
190190
},
191191
{

delta_backend/src/FHIRParser.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@ def _validate_expression_rule(self, expression_type, expression_rule, key_value_
2424
which item(s) satisfy specific criteria based on the logic defined by the
2525
expression type and rule.
2626
"""
27-
28-
if not expression_rule:
29-
return True
30-
31-
elif expression_type == "SNOMED" and expression_rule == "validate-code":
27+
if expression_type == "SNOMED" and expression_rule == "validate-code":
3228
if key_value_pair.get("code"):
3329
return is_valid_simple_snomed(key_value_pair["code"])
3430

35-
return False
31+
return True
3632

3733
# scan for a key name or a value
3834
def _scanValuesForMatch(self, parent, matchValue):
@@ -97,7 +93,7 @@ def _scanForValue(self, FHIRFields, expression_type, expression_rule: str = ""):
9793
return rootfield
9894

9995
# get the value for a key
100-
def getKeyValue(self, fieldName, expression_type, expression_rule: str = ""):
96+
def getKeyValue(self, fieldName, expression_type: str = "", expression_rule: str = ""):
10197
value = []
10298
try:
10399
responseValue = self._scanForValue(fieldName, expression_type, expression_rule)

0 commit comments

Comments
 (0)