From 222043791e5694284abc36cbe5d3de5667bf102e Mon Sep 17 00:00:00 2001 From: emmastephenson <80282552+emmastephenson@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:20:06 -0700 Subject: [PATCH] Revert "Check for RR field presence before merging RR to eCR" (#868) Revert "Check for RR field presence before merging RR to eCR (#866)" This reverts commit 8a090dfa8d4e9c9d00ed7ca6effbd021b45f9813. --- phdi/fhir/conversion/convert.py | 4 --- .../rr_extraction/merged_eICR.xml | 17 ------------ tests/fhir/conversion/test_conversion.py | 27 ------------------- 3 files changed, 48 deletions(-) delete mode 100644 tests/assets/fhir-converter/rr_extraction/merged_eICR.xml diff --git a/phdi/fhir/conversion/convert.py b/phdi/fhir/conversion/convert.py index 7cafc6cb7f..6511b33218 100644 --- a/phdi/fhir/conversion/convert.py +++ b/phdi/fhir/conversion/convert.py @@ -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", diff --git a/tests/assets/fhir-converter/rr_extraction/merged_eICR.xml b/tests/assets/fhir-converter/rr_extraction/merged_eICR.xml deleted file mode 100644 index 26ea65fa86..0000000000 --- a/tests/assets/fhir-converter/rr_extraction/merged_eICR.xml +++ /dev/null @@ -1,17 +0,0 @@ -
- - - Reportability Response - - - - - - - - - - - - -
\ No newline at end of file diff --git a/tests/fhir/conversion/test_conversion.py b/tests/fhir/conversion/test_conversion.py index 85d0e88a73..6e6e6a8a01 100644 --- a/tests/fhir/conversion/test_conversion.py +++ b/tests/fhir/conversion/test_conversion.py @@ -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