Skip to content

Commit

Permalink
Revert "Check for RR field presence before merging RR to eCR" (#868)
Browse files Browse the repository at this point in the history
Revert "Check for RR field presence before merging RR to eCR (#866)"

This reverts commit 8a090df.
  • Loading branch information
emmastephenson authored Oct 17, 2023
1 parent 8a090df commit 2220437
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
4 changes: 0 additions & 4 deletions phdi/fhir/conversion/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ def add_rr_data_to_eicr(rr, ecr):
rr = etree.fromstring(rr)
ecr = etree.fromstring(ecr)

if ecr.xpath('//*[@codeSystem="2.16.840.1.113883.6.1"]'):
print("This eCR has already been merged with RR data.")
return etree.tostring(ecr, encoding="unicode", method="xml")

# Create the tags for elements we'll be looking for
rr_tags = [
"templateId",
Expand Down
17 changes: 0 additions & 17 deletions tests/assets/fhir-converter/rr_extraction/merged_eICR.xml

This file was deleted.

27 changes: 0 additions & 27 deletions tests/fhir/conversion/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,30 +335,3 @@ def test_add_rr_to_ecr():
assert temps is not None
assert temps.attrib["root"] == "2.16.840.1.113883.10.20.15.2.3.29"
assert "RRVS19" in status_code.attrib["code"]


def test_add_rr_to_ecr_rr_already_present(capfd):
with open(
pathlib.Path(__file__).parent.parent.parent
/ "assets"
/ "fhir-converter"
/ "rr_extraction"
/ "CDA_RR.xml"
) as fp:
rr = fp.read()

# This eICR has already been merged with an RR
with open(
pathlib.Path(__file__).parent.parent.parent
/ "assets"
/ "fhir-converter"
/ "rr_extraction"
/ "merged_eICR.xml"
) as fp:
ecr = fp.read()

merged_ecr = add_rr_data_to_eicr(rr, ecr)
assert merged_ecr == ecr

out, err = capfd.readouterr()
assert "This eCR has already been merged with RR data." in out

0 comments on commit 2220437

Please sign in to comment.