Clean crosswalk function
This commit is contained in:
@@ -5,7 +5,7 @@ from src.constants.constants import Constants
|
||||
constants = Constants()
|
||||
|
||||
all_exhibit_rows = [
|
||||
{"PRODUCT" : ['HEALTHfirst', 'KIDSfirst']}
|
||||
{"LOB" : ['Medicaid']}
|
||||
]
|
||||
|
||||
all_exhibit_rows = aarete_derived.get_crosswalk_fields(all_exhibit_rows, constants)
|
||||
|
||||
@@ -136,10 +136,7 @@ def fill_na_mapping(answer_dicts):
|
||||
def get_crosswalk_fields(answer_dicts: list, constants: Constants):
|
||||
|
||||
crosswalk_fields = FieldSet(file_path=config.FIELD_JSON_PATH, crosswalk=True)
|
||||
print("crosswalk_fields: ", crosswalk_fields)
|
||||
|
||||
for to_field in crosswalk_fields.fields:
|
||||
print("to_field: ", to_field)
|
||||
to_field_name, from_field_name = to_field.field_name, to_field.base_field
|
||||
# Find crosswalk
|
||||
crosswalk = constants.get_constant(to_field.crosswalk)
|
||||
@@ -147,10 +144,6 @@ def get_crosswalk_fields(answer_dicts: list, constants: Constants):
|
||||
for answer_dict in answer_dicts:
|
||||
to_field_value = answer_dict.get(to_field_name)
|
||||
from_field_value = answer_dict.get(from_field_name)
|
||||
|
||||
print("to_field_value: ", to_field_value)
|
||||
print("from_field_value: ", from_field_value)
|
||||
|
||||
# If from_field_value is populated and to_field_value is not populated, perform mapping
|
||||
if not string_utils.is_empty(
|
||||
from_field_value
|
||||
|
||||
Reference in New Issue
Block a user