Skip to content

Commit

Permalink
fix: handle versioned eCR in tests (#3186)
Browse files Browse the repository at this point in the history
# PULL REQUEST

## Summary

Spinoff from #3057. Add a versioned eCR to the e2e data and update the
loading scripts to handle it (changing lab PK primarily). (the only
loading rr if we have it has to do with other seed data, but this seemed
like as good a place to put that change as any)
  • Loading branch information
mcmcgrath13 authored Jan 23, 2025
1 parent aa0b086 commit a76f564
Show file tree
Hide file tree
Showing 9 changed files with 3,874 additions and 17 deletions.
1 change: 1 addition & 0 deletions containers/ecr-viewer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ volume/
seed-scripts/baseECR/TN
seed-scripts/baseECR/KY
seed-scripts/baseECR/ME
seed-scripts/baseECR/CO

/test-results/
/playwright-report/
Expand Down
24 changes: 12 additions & 12 deletions containers/ecr-viewer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion containers/ecr-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@axe-core/playwright": "^4.10.1",
"@dotenvx/dotenvx": "^1.25.1",
"@next/eslint-plugin-next": "^14.2.5",
"@playwright/test": "^1.49.1",
"@playwright/test": "^1.50.0",
"@smithy/util-stream": "^2.1.2",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^15.0.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:in="urn:lantana-com:inline-variable-data" xmlns:n1="urn:hl7-org:v3">
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- Do NOT edit this HTML directly: it was generated via an XSLT transformation from a CDA Release 2 XML document. -->
<title>Reportability Response</title>
<style type="text/css">
body {
color: #003366;
background-color: #FFFFFF;
font-family: Verdana, Tahoma, sans-serif;
font-size: 11px;
}

a {

background-color: #FFFFFF;
}

h1 {
font-size: 12pt;
font-weight: bold;
}

h2 {
font-size: 11pt;
font-weight: bold;
}

h3 {
font-size: 10pt;
font-weight: bold;
}

h4 {
font-size: 8pt;
font-weight: bold;
}


table {
line-height: 10pt;
width: 50%;
}

th {

}

td {
padding: 0.1cm 0.2cm;
vertical-align: top;

}

.h1center {
font-size: 12pt;
font-weight: bold;
text-align: center;
width: 80%;
}

.header_table{
border: 1pt inset #00008b;
}

.td_label{
font-weight: bold;

}

.td_header_role_name{
width: 20%;

}

.td_header_role_value{
width: 80%;

}

.Bold{
font-weight: bold;
}

.Italics{
font-style: italic;
}

.Underline{
text-decoration:underline;
}

.Emphasis{
font-size: larger;
}


h5 {
position: absolute;
font-size: 8pt;
font-weight: bold;
top: 10%;
left: 53%;
}


ul li{
padding-left: 0px;
margin-left: -15px;
}

</style>
</head>
<body>
<table class="header_table">
<tr>
<td class="td_header_role_name"><span class="td_label">Patient</span></td><td class="td_header_role_value">Epictest, Peter Pan</td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Patient ID(s)</span></td><td class="td_header_role_value">POC1417409 1.2.840.114350.1.13.297.3.7.3.688884.100
<br>
</td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Contact info</span></td><td class="td_header_role_value"> Primary Home:
<br>
278 MAIN ST
<br>
NEWHALL,&nbsp;CA&nbsp;91321
<br>
</td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Date of Birth</span></td><td class="td_header_role_value">February 17, 1986 </td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Sex</span></td><td class="td_header_role_value">Male</td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Race</span></td><td class="td_header_role_value"></td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Ethnicity</span></td><td class="td_header_role_value"></td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Preferred Language</span></td><td class="td_header_role_value"><span class="generated-text">Information not available</span></td>
</tr>
</table>
<table class="header_table">
<tbody>
<tr>
<td class="td_header_role_name"><span class="td_label">Primary Information Recipient:</span></td><td class="td_header_role_value">Obstetrics, Midwife</td>
</tr>
<tr>
<td class="td_header_role_name"><span class="td_label">Contact info</span></td><td class="td_header_role_value"></td>
</tr>
</tbody>
</table>
<table class="header_table">
<tbody>
<tr>
<td class="td_header_role_name"><span class="td_label">eICR Identifier:</span></td><td class="td_header_role_value"> 1.2.840.114350.1.13.297.3.7.8.688883.567470</td>
</tr>
</tbody>
</table>
<div>
<br>
<span class="Bold">Subject:</span>
<p>Public Health Reporting Communication: one or more conditions are reportable, or may be reportable, to public health. </p>
</div>
<div></div>
<div>
<span class="Bold">Summary:</span>
<p>Your organization electronically submitted an initial case report to determine if reporting to public health is needed for a patient.</p>
<p>
"Overdose of opiate (disorder)" is reportable to "Los Angeles County Department of Public Health". The initial case report was sent to "Los Angeles County Department of Public Health". Additional information may be required for this report.
<br>
</p>
<p>
No determination of reportability could be made for any condition for "California Department of Public Health". This may be because it is not on the list of reportable conditions for the relevant Public Health Agency, or the information provided at the time of this report does not meet reporting criteria, or not all data needed to confirm reportability were available.
<br>
</p>
<p>
<span class="Bold">"Overdose of opiate (disorder)" for "Los Angeles County Department of Public Health" </span>
</p>
</div>
<br>
<br>
</body>
</html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions containers/ecr-viewer/seed-scripts/create-seed-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,24 @@ def _process_eicrs(subfolder, folder, folder_path, payload):

# If we are not just inserting the bundle, check for the necessary files
elif os.path.exists(os.path.join(folder_path, "CDA_eICR.xml")):
# Get the RR data if available
rr_data = None
if os.path.exists(os.path.join(folder_path, "CDA_RR.xml")):
with (
open(os.path.join(folder_path, "CDA_RR.xml"), "r") as rr_file,
):
rr_data = rr_file.read()

# Open the necessary files in the folder
with (
open(os.path.join(folder_path, "CDA_RR.xml"), "r") as rr_file,
open(os.path.join(folder_path, "CDA_eICR.xml"), "r") as eicr_file,
):
payload = {
"message_type": "ecr",
"data_type": "ecr",
"config_file_name": configName,
"message": eicr_file.read(),
"rr_data": rr_file.read(),
"rr_data": rr_data,
}

_process_eicrs(subfolder, folder, folder_path, payload)
Expand Down
5 changes: 3 additions & 2 deletions containers/ecr-viewer/sql/extended.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CREATE TABLE ecr_rr_rule_summaries

CREATE TABLE ecr_labs
(
UUID VARCHAR(200) PRIMARY KEY,
UUID VARCHAR(200),
eICR_ID VARCHAR(200) REFERENCES ECR_DATA (eICR_ID),
test_type VARCHAR(255),
test_type_code VARCHAR(50),
Expand All @@ -80,5 +80,6 @@ CREATE TABLE ecr_labs
test_result_reference_range_high_units VARCHAR(50),
specimen_type VARCHAR(255),
specimen_collection_date DATE,
performing_lab VARCHAR(255)
performing_lab VARCHAR(255),
PRIMARY KEY (UUID, eICR_ID)
);

0 comments on commit a76f564

Please sign in to comment.