Skip to content

Commit

Permalink
Merge branch 'main' into josh/message-parser-readable-conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
JNygaard-Skylight authored Jan 16, 2025
2 parents 34abb8d + e1385f0 commit df0ad6c
Show file tree
Hide file tree
Showing 42 changed files with 12,188 additions and 472 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/container-ecr-viewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ jobs:
- name: Run seed data conversion
working-directory: ./containers/${{env.CONTAINER}}
run: npm run convert-seed-data
env:
SEED_DATA_DIRECTORIES: e2e

- name: Run Playwright tests
working-directory: ./containers/${{env.CONTAINER}}
Expand Down
3 changes: 3 additions & 0 deletions containers/ecr-viewer/.env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CONFIG_NAME=AWS_SQLSERVER_NON_INTEGRATED

# Seed script configuration (default, "LA")
# SEED_DATA_DIRECTORIES=DIR1,DIR2

# Azure Connection
AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;"
AZURE_CONTAINER_NAME=ecr-viewer-files
Expand Down
5 changes: 3 additions & 2 deletions containers/ecr-viewer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker.io/docker/dockerfile:1.7-labs
FROM node:18-alpine AS base

# Install dependencies only when needed
Expand All @@ -15,7 +16,7 @@ RUN npm ci
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
COPY --exclude=./seed-scripts . .

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
Expand Down Expand Up @@ -64,4 +65,4 @@ ENV OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel-collector:4318/v1/traces

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["node", "server.js"]
CMD ["node", "server.js"]
4 changes: 3 additions & 1 deletion containers/ecr-viewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Sample eICRs are included in `containers/ecr-viewer/seed-scripts/baseECR/`. If y
2. Run `npm run convert-seed-data` to re-run the FHIR conversion of the seed eCRs
3. Run `npm run local-dev` to re-run the eCR Viewer with the newly converted data.

By default, the seed data in the `LA` subfolder converts. To convert other (or additional) subfolders, set the `SEED_DATA_DIRECTORIES` environment variable to a comma delimited list of subfolders (e.g. `LA,Dir2` or `Dir2`).

### Developer Commands

Additional commands can be found in [`package.json`](package.json).
Expand All @@ -97,7 +99,7 @@ Running tests:
End to end test utilize the Playwright framerwork.
Running Tests:

1. `npm run convert-seed-data:build` to save all required eCRs necessary for e2e tests. The tests require all eCRs located in `/seed-scripts/baseECR/LA` have been saved (and no other eCRs).
1. set `SEED_DATA_DIRECTORIES=e2e` in your `.env.local`, then `npm run convert-seed-data:build` to save all required eCRs necessary for e2e tests. The tests require all eCRs located in `/seed-scripts/baseECR/e2e` have been saved (and no other eCRs).
2. `npm run test:e2e` to run the tests against http://localhost:3000/ecr-viewer.
- If the service isn't available, Playwright is [configured to spin it up](https://playwright.dev/docs/test-webserver).
- If you would prefer to spin up the service manually, you can run `npm run local-dev` or `npm run local-docker`.
Expand Down
12 changes: 6 additions & 6 deletions containers/ecr-viewer/e2e/ecr-library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test.describe("eCR Library page", () => {
});
});
test.describe("eCR Library Filtering", () => {
const totalNumOfConditions = "24";
const totalNumOfConditions = "4";
test("Set reportable condition filter to anthrax", async ({ page }) => {
await page.goto("/ecr-viewer");
await page.waitForURL("/ecr-viewer?columnId=date_created&direction=DESC");
Expand All @@ -30,9 +30,9 @@ test.describe("eCR Library Filtering", () => {
await page.getByText("Deselect all").click({ delay: 200 });
await page.getByRole("group").getByText("Anthrax").click();
await page.getByLabel("Apply Filter").click();
await expect(page.getByText("Showing 1-16")).toBeVisible();
await expect(page.getByText("Showing 1-1")).toBeVisible();
expect((await page.locator("tbody > tr").allTextContents()).length).toEqual(
16,
1,
);
});

Expand All @@ -43,12 +43,12 @@ test.describe("eCR Library Filtering", () => {
totalNumOfConditions,
);

await page.getByTestId("textInput").fill("Victoria");
await page.getByTestId("textInput").fill("Abel");
await page.getByTestId("form").getByTestId("button").click();

await expect(page.getByText("Showing 1-1 of 1 eCRs")).toBeVisible();
await expect(
page.getByRole("cell", { name: "Victoria Hunter DOB: 11/15/" }),
page.getByRole("cell", { name: "Abel Castillo DOB: 04/15/2015" }),
).toBeVisible();
expect((await page.locator("tbody > tr").allTextContents()).length).toEqual(
1,
Expand All @@ -65,7 +65,7 @@ test.describe("eCR Library Filtering", () => {
);

await page.getByTestId("textInput").click();
await page.getByTestId("textInput").fill("Victoria");
await page.getByTestId("textInput").fill("Abel");
await page.getByTestId("form").getByTestId("button").click();

await expect(page.getByText("Showing 1-1 of 1 eCRs")).toBeVisible();
Expand Down
15 changes: 3 additions & 12 deletions containers/ecr-viewer/e2e/ecr-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test("should not have any automatically detectable accessibility issues", async
test.setTimeout(120_000);

await page.goto(
"/ecr-viewer/view-data?id=1.2.840.114350.1.13.297.3.7.8.688883.573942",
"/ecr-viewer/view-data?id=1.2.840.114350.1.13.297.3.7.8.688883.567479",
);
await page.getByText("Patient Name").first().waitFor();

Expand All @@ -21,20 +21,11 @@ test("fully expanded should not have any automatically detectable accessibility
page,
}) => {
await page.goto(
"/ecr-viewer/view-data?id=1.2.840.114350.1.13.297.3.7.8.688883.573942",
"/ecr-viewer/view-data?id=1.2.840.114350.1.13.297.3.7.8.688883.567479",
);
await page.getByTestId("accordionButton_giardiasis").click();
await page.getByRole("button", { name: "Expand all labs" }).click();

const accordionButtons = await page
.getByTestId("accordionItem_giardiasis")
.getByTestId("accordionButton_stool-pathogens-naat-parasite")
.all();
for (let accordionButton of accordionButtons) {
await accordionButton.scrollIntoViewIfNeeded();
await accordionButton.click();
}
const viewCommentButtons = await page.getByText("View comment").all();
const viewCommentButtons = await page.getByTestId("comment-button").all();
for (let viewCommentButton of viewCommentButtons) {
await viewCommentButton.scrollIntoViewIfNeeded();
await viewCommentButton.click();
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.567479</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.

Loading

0 comments on commit df0ad6c

Please sign in to comment.