-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from mednax-it/nonprod
PDIP-116,117,118,119 SMILECDR-894,898,897,916
- Loading branch information
Showing
17 changed files
with
92 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
import importlib | ||
import json | ||
from omniparser_schemas.parser.universal_etl_parser import fetch_parsed_text | ||
|
||
|
||
|
||
def missing_segment_test(): | ||
|
||
# Get the segments to be tested | ||
segments = "MissingSegments" | ||
|
||
missing_segment_test_data_dir = f"tests/regression/regression_test_data/{segments}" | ||
|
||
filenames = os.listdir(missing_segment_test_data_dir) | ||
|
||
for filename in filenames: | ||
with importlib.resources.path("tests.regression.regression_test_data." + str(segments), str(filename)) as f: | ||
hl7content = f.read_text() | ||
|
||
# The universal parser need to have carriage return | ||
hl7content = hl7content.replace('\\r', '\r') | ||
|
||
# call universal etl parser | ||
fhir_bundle_from_hl7=fetch_parsed_text(hl7content) | ||
fhir_bundle = fhir_bundle_from_hl7[1:-1] | ||
|
||
json_data = json.loads(fhir_bundle) | ||
|
||
OUTPUT_ROOT_PATH = "tests/regression/regression_output/" | ||
PATH = OUTPUT_ROOT_PATH + str(segments) | ||
if not os.path.exists(PATH): | ||
os.makedirs(PATH) | ||
|
||
with open(PATH + "/regression_" + str(segments) + "_" + str(filename) + ".json", "w") as f: | ||
json.dump(json_data, f) | ||
|
||
|
||
print("FHIR bundle with missing segments tests were successful") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/regression/regression_test_data/MissingSegments/AL1DG1.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MSH|^~\\&|MS4_NY|BAOM|PDX|437|20230907070903||ADT^A08|00000000300746007|P|2.3\rEVN|A08|20230907070902|||TUSER1\rPID|1|H1234^^^MS4^PN|MR4567^^^MS4^MR^437||WICK^JOHN||19960513|Male||2106-3|123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|NYC|(555)888-1234||en|Single|OTH|31184017||||U|NY|||USA\rZPD||||ACTIVATED|||Y|20240507||||||||||N\rZTP|Health Maintenance Reminders^Health Maintenance Reminders|MYCH^Y\rZTP|Bulk Communication^Bulk Communication|MYCH^Y~Mail^Y\rZTP|Communication Management^Communication Management|MYCH^Y\rZTP|New Estimate^New Estimate|Email^Y~Push^Y~Text^Y\rPD1||||128303^BAUER^JANE^A|||N|||||N\rPV1||E||1|||116596^KAPUR^SIMRAN^S^^^MD|128303^BAUER^JANE^A||EER||||1||||E|00031184017437|2115|||||||||||||||||||BAOM|||||202309070619\rDG1|0001|I10||POV CP DIFF BREATHING||A|||||||||0\rOBX|0001|NM|PRICSN|1|735464236||||||M|||||||||||||||||||||\rOBX|0002|NM|HT^HEIGHT||51.5|cm||||||||20230745145100||||||||||||||||||\rOBX|0003|NM|WT^WEIGHT||2.872|kg||||||||20230752000000||||||||||||||||||\rOBX|0004|TX|ContactType^CONTACT TYPE|1|3|||||||||20240508||||||||||||||||||\rGT1|0001|00H1234^^^MS4^PN|WICK^JOHN||123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|(555)888-1234||19960513|M||A|||||DISABLED||||2|||||||||0000000002|S||||||||Y|||YYY||||||||||||||C\rIN1|0001|INS123456|2115|MERCY CARE RBHA|PO BOX 64835^^PHOENIX^NY^85082||(866)796-5598||||||||MCD|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||1|||||N|||||||||INS123456||||||3|M||N||||00H1234\rIN1|0002|INS222456|0094|PENDING MEDICAID IHMS|^^^^ |||999999|PENDING||||||COM|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||2|||||N|||||||||INS222456||||||3|M||N||||00H1234\rAL1|1|SYSTEMIC|^NO KNOWN ALLERGIES^\rDG1|1||^Newborn|Newborn||^W\rUB1||||||||||||||||23^20230907\rZAC|EXPLOSIVE EXPLODED IN PT FACE\rZQA|1|589723|^589724~^589725~^589726~^589727~^589728~^589729~^589730~^589731~^589732~^589733~^589734~^589735~^589736~^589737~^589738~^589739~^589740~^589741~^589742~^589743~^589744~^589745~^589746~^589747~^589748~^589749~^589750~^589751~^589752~^589753~^589754~^589755~^589756~^589757~^589758~^589759~^589760~^589761~^589762\rZCS||^^^^||||00005\rZSU|A44\r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MSH|^~\\&|MS4_NY|BAOM|PDX|437|20230907070903||ADT^A08|00000000300746007|P|2.3\rEVN|A08|20230907070902|||TUSER1\rPID|1|H1234^^^MS4^PN|MR4567^^^MS4^MR^437||WICK^JOHN||19960513|Male||2106-3|123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|NYC|(555)888-1234||en|Single|OTH|31184017||||U|NY|||USA\rZPD||||ACTIVATED|||Y|20240507||||||||||N\rZTP|Health Maintenance Reminders^Health Maintenance Reminders|MYCH^Y\rZTP|Bulk Communication^Bulk Communication|MYCH^Y~Mail^Y\rZTP|Communication Management^Communication Management|MYCH^Y\rZTP|New Estimate^New Estimate|Email^Y~Push^Y~Text^Y\rPD1||||128303^BAUER^JANE^A|||N|||||N\rARV|1|S|CELEBCONFIDENTIAL||Patient is a widely known celebrity. Restrict communication of parties involved.\rPV1||E||1|||116596^KAPUR^SIMRAN^S^^^MD|128303^BAUER^JANE^A||EER||||1||||E|00031184017437|2115|||||||||||||||||||BAOM|||||202309070619\rDG1|0001|I10||POV CP DIFF BREATHING||A|||||||||0\rOBX|0001|NM|PRICSN|1|735464236||||||M|||||||||||||||||||||\rOBX|0002|NM|HT^HEIGHT||51.5|cm||||||||20230745145100||||||||||||||||||\rOBX|0003|NM|WT^WEIGHT||2.872|kg||||||||20230752000000||||||||||||||||||\rOBX|0004|TX|ContactType^CONTACT TYPE|1|3|||||||||20240508||||||||||||||||||\rGT1|0001|00H1234^^^MS4^PN|WICK^JOHN||123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|(555)888-1234||19960513|M||A|||||DISABLED||||2|||||||||0000000002|S||||||||Y|||YYY||||||||||||||C\rIN1|0001|INS123456|2115|MERCY CARE RBHA|PO BOX 64835^^PHOENIX^NY^85082||(866)796-5598||||||||MCD|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||1|||||N|||||||||INS123456||||||3|M||N||||00H1234\rIN1|0002|INS222456|0094|PENDING MEDICAID IHMS|^^^^ |||999999|PENDING||||||COM|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||2|||||N|||||||||INS222456||||||3|M||N||||00H1234\rAL1|1|SYSTEMIC|^NO KNOWN ALLERGIES^\rDG1|1||^Newborn|Newborn||^W\rUB1||||||||||||||||23^20230907\rZAC|EXPLOSIVE EXPLODED IN PT FACE\rZQA|1|589723|^589724~^589725~^589726~^589727~^589728~^589729~^589730~^589731~^589732~^589733~^589734~^589735~^589736~^589737~^589738~^589739~^589740~^589741~^589742~^589743~^589744~^589745~^589746~^589747~^589748~^589749~^589750~^589751~^589752~^589753~^589754~^589755~^589756~^589757~^589758~^589759~^589760~^589761~^589762\rZCS||^^^^||||00005\rZSU|A44\r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MSH|^~\\&|MS4_NY|BAOM|PDX|437|20230907070903||ADT^A08|00000000300746007|P|2.3\rEVN|A08|20230907070902|||TUSER1\rPID|1|H1234^^^MS4^PN|MR4567^^^MS4^MR^437||WICK^JOHN||19960513|Male||2106-3|123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|NYC|(555)888-1234||en|Single|OTH|31184017||||U|NY|||USA\rZPD||||ACTIVATED|||Y|20240507||||||||||N\rZTP|Health Maintenance Reminders^Health Maintenance Reminders|MYCH^Y\rZTP|Bulk Communication^Bulk Communication|MYCH^Y~Mail^Y\rZTP|Communication Management^Communication Management|MYCH^Y\rZTP|New Estimate^New Estimate|Email^Y~Push^Y~Text^Y\rPD1||||128303^BAUER^JANE^A|||N|||||N\rNK1|1|ARES^ARES^^|F|MANOVER STREET^BLOCK 23 2077^NEW YORK^NY^10001^US|(555)111-2222^^PH^^^555^1112222||Emergency Contact 1\rNK1|2|ARES^ARES^^|F|MANOVER STREET^BLOCK 23 2077^NEW YORK^NY^10001^US|(555)111-2222^^PH^^^555^1112222||Partner\rPV1||E||1|||116596^KAPUR^SIMRAN^S^^^MD|128303^BAUER^JANE^A||EER||||1||||E|00031184017437|2115|||||||||||||||||||BAOM|||||202309070619\rDG1|0001|I10||POV CP DIFF BREATHING||A|||||||||0\rOBX|0001|NM|PRICSN|1|735464236||||||M|||||||||||||||||||||\rOBX|0002|NM|HT^HEIGHT||51.5|cm||||||||20230745145100||||||||||||||||||\rOBX|0003|NM|WT^WEIGHT||2.872|kg||||||||20230752000000||||||||||||||||||\rOBX|0004|TX|ContactType^CONTACT TYPE|1|3|||||||||20240508||||||||||||||||||\rGT1|0001|00H1234^^^MS4^PN|WICK^JOHN||123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|(555)888-1234||19960513|M||A|||||DISABLED||||2|||||||||0000000002|S||||||||Y|||YYY||||||||||||||C\rIN1|0001|INS123456|2115|MERCY CARE RBHA|PO BOX 64835^^PHOENIX^NY^85082||(866)796-5598||||||||MCD|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||1|||||N|||||||||INS123456||||||3|M||N||||00H1234\rIN1|0002|INS222456|0094|PENDING MEDICAID IHMS|^^^^ |||999999|PENDING||||||COM|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||2|||||N|||||||||INS222456||||||3|M||N||||00H1234\rAL1|1|SYSTEMIC|^NO KNOWN ALLERGIES^\rDG1|1||^Newborn|Newborn||^W\rUB1||||||||||||||||23^20230907\rZAC|EXPLOSIVE EXPLODED IN PT FACE\rZQA|1|589723|^589724~^589725~^589726~^589727~^589728~^589729~^589730~^589731~^589732~^589733~^589734~^589735~^589736~^589737~^589738~^589739~^589740~^589741~^589742~^589743~^589744~^589745~^589746~^589747~^589748~^589749~^589750~^589751~^589752~^589753~^589754~^589755~^589756~^589757~^589758~^589759~^589760~^589761~^589762\rZCS||^^^^||||00005\rZSU|A44\r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MSH|^~\\&|MS4_NY|BAOM|PDX|437|20230907070903||ADT^A08|00000000300746007|P|2.3\rEVN|A08|20230907070902|||TUSER1\rPID|1|H1234^^^MS4^PN|MR4567^^^MS4^MR^437||WICK^JOHN||19960513|Male||2106-3|123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|NYC|(555)888-1234||en|Single|OTH|31184017||||U|NY|||USA\rZPD||||ACTIVATED|||Y|20240507||||||||||N\rZTP|Health Maintenance Reminders^Health Maintenance Reminders|MYCH^Y\rZTP|Bulk Communication^Bulk Communication|MYCH^Y~Mail^Y\rZTP|Communication Management^Communication Management|MYCH^Y\rZTP|New Estimate^New Estimate|Email^Y~Push^Y~Text^Y\rPD1||||128303^BAUER^JANE^A|||N|||||N\rPV1||E||1|||116596^KAPUR^SIMRAN^S^^^MD|128303^BAUER^JANE^A||EER||||1||||E|00031184017437|2115|||||||||||||||||||BAOM|||||202309070619\rDG1|1|I10||POV CP DIFF BREATHING||A|||||||||0\rOBX|1|NM|PRICSN|1|735464236||||||M|||||||||||||||||||||\rOBX|2|NM|HT^HEIGHT||51.5|cm||||||||20230745145100||||||||||||||||||\rOBX|3|NM|WT^WEIGHT||2.872|kg||||||||20230752000000||||||||||||||||||\rOBX|4|TX|ContactType^CONTACT TYPE|1|3|||||||||20240508||||||||||||||||||\rGT1|1|00H1234^^^MS4^PN|WICK^JOHN||123 MAIN ST^^ANYTOWN^NY^11210^USA^^NYC|(555)888-1234||19960513|M||A|||||DISABLED||||2|||||||||0000000002|S||||||||Y|||YYY||||||||||||||C\rIN1|1|INS123456|2115|MERCY CARE RBHA|PO BOX 64835^^PHOENIX^NY^85082||(866)796-5598||||||||MCD|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||1|||||N|||||||||INS123456||||||3|M||N||||00H1234\rIN1|2|INS222456|0094|PENDING MEDICAID IHMS|^^^^ |||999999|PENDING||||||COM|WICK^JOHN|A|19960513|123 MAIN ST^^ANYTOWN^NY^11210^USA|||2|||||N|||||||||INS222456||||||3|M||N||||00H1234\rUB1||||||||||||||||23^20230907\rZAC|EXPLOSIVE EXPLODED IN PT FACE\rZQA|1|589723|^589724~^589725~^589726~^589727~^589728~^589729~^589730~^589731~^589732~^589733~^589734~^589735~^589736~^589737~^589738~^589739~^589740~^589741~^589742~^589743~^589744~^589745~^589746~^589747~^589748~^589749~^589750~^589751~^589752~^589753~^589754~^589755~^589756~^589757~^589758~^589759~^589760~^589761~^589762\r |
Oops, something went wrong.