Skip to content

Commit

Permalink
Remove input from FHIR conversion error messaging to reduce noise (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonfarrell authored Jun 20, 2023
1 parent b5d8270 commit d9d65f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 2 additions & 7 deletions containers/fhir-converter/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async def convert(input: FhirConverterInput, response: Response):
https://github.com/microsoft/FHIR-Converter.
"""
result = convert_to_fhir(**dict(input))
if "original_request" in result.get("response"):
if "fhir_conversion_failed" in result.get("response"):
response.status_code = status.HTTP_400_BAD_REQUEST

return result
Expand Down Expand Up @@ -242,11 +242,6 @@ def convert_to_fhir(

else:
result = vars(converter_response)
# Include original input data in the result.
result["original_request"] = {
"input_data": input_data,
"input_type": input_type,
"root_template": root_template,
}
result["fhir_conversion_failed"] = "true"

return {"response": result}
6 changes: 1 addition & 5 deletions containers/fhir-converter/tests/test_FHIR-Converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@
"_spec_set": None,
"_spec_signature": None,
"method_calls": [],
"original_request": {
"input_data": "VALID_INPUT_DATA",
"input_type": "elr",
"root_template": "ADT_A01",
},
"fhir_conversion_failed": "true",
"returncode": 1,
}

Expand Down

0 comments on commit d9d65f5

Please sign in to comment.