Merged in bugfix/DAIP2-1870-dynamic-issues (pull request #892)
Bugfix/DAIP2-1870 dynamic issues * updated list format appending * fill bill type from claim type cd * Fixed remaining format fixes * Merged DEV into bugfix/DAIP2-1870-dynamic-issues * changed crosswalk mapping from PRODUCT to AARETE_DERIVED_PRODUCT * Merged DEV into bugfix/DAIP2-1870-dynamic-issues * updating LOB field values as well from PRODUCT AND PROGRAM * updated apply crosswalk for reverse mapping * Merged DEV into bugfix/DAIP2-1870-dynamic-issues * added QHP and BHP * removed lob reverse mapping * Merged DEV into bugfix/DAIP2-1870-dynamic-issues * Remove Bill Type/Claim Type fill * Merged DEV into bugfix/DAIP2-1870-dynamic-issues * Black format * Merged DEV into bugfix/DAIP2-1870-dynamic-issues Approved-by: Katon Minhas
This commit is contained in:
committed by
Katon Minhas
parent
786bab6118
commit
6744c57f95
@@ -1218,12 +1218,18 @@ def format_as_json_list(val):
|
||||
"""
|
||||
# 1. Handle actual lists or Nulls
|
||||
if isinstance(val, list):
|
||||
filtered = [
|
||||
str(i).strip()
|
||||
for i in val
|
||||
if i is not None and not _is_empty_list_placeholder(i)
|
||||
]
|
||||
return json.dumps(filtered) if filtered else ""
|
||||
# Flatten nested lists before processing
|
||||
flattened = []
|
||||
for i in val:
|
||||
if i is None or _is_empty_list_placeholder(i):
|
||||
continue
|
||||
# If item is a list itself, extend (flatten)
|
||||
if isinstance(i, list):
|
||||
flattened.extend([str(x).strip() for x in i if x is not None])
|
||||
else:
|
||||
flattened.append(str(i).strip())
|
||||
|
||||
return json.dumps(flattened) if flattened else ""
|
||||
if pd.isna(val) or val == "" or val == "[]":
|
||||
return ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user