Skip to content

Commit 914dc16

Browse files
committed
Dose Amount
1 parent 87aec7f commit 914dc16

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

delta_backend/src/ConversionChecker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def _convertToDefaultTo(self, expressionRule, fieldName, fieldValue, summarise,
259259
try:
260260
if fieldValue == "":
261261
return expressionRule
262-
return fieldValue
262+
return str(fieldValue)
263263
except Exception as e:
264264
if report_unexpected_exception:
265265
message = ExceptionMessages.MESSAGES[ExceptionMessages.UNEXPECTED_EXCEPTION] % (e.__class__.__name__, e)

delta_backend/src/Converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def runConversion(self, json_data, summarise=False, report_unexpected_exception=
122122
if error_records:
123123
error_summary = error_records
124124
else:
125-
error_summary = ""
125+
error_summary = []
126126
self.converted["CONVERSION_ERRORS"] = error_summary
127127

128128
return self.converted

delta_backend/src/delta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def handler(event, context):
7676
flat_json = FHIRConverter.runConversion(resource_json) # Get the flat JSON
7777
error_records = FHIRConverter.getErrorRecords()
7878
flat_json["ACTION_FLAG"] = action_flag
79+
logger.info(f"Record to delta:{flat_json}")
7980
response = delta_table.put_item(
8081
Item={
8182
"PK": str(uuid.uuid4()),
@@ -145,6 +146,7 @@ def handler(event, context):
145146
return {"statusCode": 500, "body": "Records not processed successfully"}
146147

147148
except Exception as e:
149+
logger.info(f"Exception in Delta Handler {e}")
148150
operation_outcome["statusCode"] = "500"
149151
operation_outcome["statusDesc"] = "Exception"
150152
if intrusion_check:

delta_backend/tests/utils_for_converter_tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def get_expected_imms(expected_action_flag):
202202
"INDICATION_CODE": "443684005",
203203
"LOCATION_CODE": "EC1111",
204204
"LOCATION_CODE_TYPE_URI": "https://fhir.nhs.uk/Id/ods-organization-code",
205-
"CONVERSION_ERRORS": ''
205+
"CONVERSION_ERRORS": []
206206
}
207207

208208
expected_imms = {
@@ -240,7 +240,7 @@ def get_expected_imms(expected_action_flag):
240240
"INDICATION_CODE": "443684005",
241241
"LOCATION_CODE": "EC1111",
242242
"LOCATION_CODE_TYPE_URI": "https://fhir.nhs.uk/Id/ods-organization-code",
243-
"CONVERSION_ERRORS": ''
243+
"CONVERSION_ERRORS": []
244244
}
245245

246246
expected_imms2 = {
@@ -278,7 +278,7 @@ def get_expected_imms(expected_action_flag):
278278
"INDICATION_CODE": "443684005",
279279
"LOCATION_CODE": "EC1111",
280280
"LOCATION_CODE_TYPE_URI": "https://fhir.nhs.uk/Id/ods-organization-code",
281-
"CONVERSION_ERRORS": ''
281+
"CONVERSION_ERRORS": []
282282
}
283283

284284

@@ -431,6 +431,6 @@ def get_expected_imms_error_output(expected_action_flag):
431431
"INDICATION_CODE": "443684005",
432432
"LOCATION_CODE": "E712",
433433
"LOCATION_CODE_TYPE_URI": "https://fhir.nhs.uk/Id/ods-organization-code",
434-
"CONVERSION_ERRORS": ''
434+
"CONVERSION_ERRORS": []
435435
}
436436
]

0 commit comments

Comments
 (0)