Skip to content

Commit

Permalink
change tefca-viewer --> query-connector (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 authored Nov 8, 2024
1 parent 753c4d2 commit 44bcbfb
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 189 deletions.
50 changes: 0 additions & 50 deletions .github/codecov.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: docker compose -f ./docker-compose-e2e.yaml up -d
- name: Poll until Query Connector is ready
run: |
until curl -s http://localhost:3000/tefca-viewer; do
until curl -s http://localhost:3000/query-connector; do
echo "Waiting for Query Connector to be ready before running Playwright..."
sleep 5
done
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

This repository is a part of the CDC/USDS [PHDI project](https://cdcgov.github.io/phdi-site/) and seeks to build the DIBBs Query Connector.

The DIBBs Query Connector app offers a REST API and comprehensive UI for public health staff to query a wide network of healthcare organizations (HCOs), providing access to more complete and timely data.
The DIBBs Query Connector app offers a REST API and comprehensive UI for public health staff to query a wide network of healthcare organizations (HCOs), providing access to more complete and timely data.

The Query Connector is a tool for public health practitioners to quickly retrieve patient records and relevant case information from HCOs. The tool works by connecting to Qualified Health Information Networks (QHINs) within the Trusted Exchange Framework and Common Agreement (TEFCA), ensuring immediate access to essential health data and facilitating timely public health decisions and interventions. Public health staff can interact with the Query Connector manually by entering simple patient details — such as name, date of birth, or medical identifiers — into a web-based search form. The tool also allows for automated queries via integration engines like Rhapsody and Mirth.  
The Query Connector is a tool for public health practitioners to quickly retrieve patient records and relevant case information from HCOs. The tool works by connecting to Qualified Health Information Networks (QHINs) within the Trusted Exchange Framework and Common Agreement (TEFCA), ensuring immediate access to essential health data and facilitating timely public health decisions and interventions. Public health staff can interact with the Query Connector manually by entering simple patient details — such as name, date of birth, or medical identifiers — into a web-based search form. The tool also allows for automated queries via integration engines like Rhapsody and Mirth.

### Problem Scope

Current public health systems that digest, analyze, and respond to data are siloed. Lacking access to actionable data, our national, as well as state, local, and territorial infrastructure, isn’t pandemic-ready. Our objective is to help the CDC best support PHAs in moving towards a modern public health data infrastructure. See our [public website](https://cdcgov.github.io/dibbs-site/) for more details.

The current methods that public health jurisdictions use to collect data from HCOs can be time-consuming and cumbersome, often involving manual interventions like phone calls and faxes. The Query Connector aims to streamline the collection of health data using an intuitive querying process that can leverage QHINs within TEFCA or direct connections, thereby enabling data exchange from multiple HCOs for a variety of public health use cases such as newborn screening or STI case investigation. 
The current methods that public health jurisdictions use to collect data from HCOs can be time-consuming and cumbersome, often involving manual interventions like phone calls and faxes. The Query Connector aims to streamline the collection of health data using an intuitive querying process that can leverage QHINs within TEFCA or direct connections, thereby enabling data exchange from multiple HCOs for a variety of public health use cases such as newborn screening or STI case investigation.

DIBBs Query Connector is a sibling project to

* [PHDI](https://github.com/CDCgov/phdi) to further help display, access, and interpret publich health data;
* [PRIME ReportStream](https://reportstream.cdc.gov), which focuses on improving the delivery of COVID-19 test data to public health departments; and
* [PRIME SimpleReport](https://simplereport.gov), which provides a better way for organizations and testing facilities to report COVID-19 rapid tests to public health departments.
- [PHDI](https://github.com/CDCgov/phdi) to further help display, access, and interpret publich health data;
- [PRIME ReportStream](https://reportstream.cdc.gov), which focuses on improving the delivery of COVID-19 test data to public health departments; and
- [PRIME SimpleReport](https://simplereport.gov), which provides a better way for organizations and testing facilities to report COVID-19 rapid tests to public health departments.

## Implementation

Expand All @@ -38,17 +38,17 @@ DIBBs Query Connector is a sibling project to

DIBBs Query Connector documentation, including instructions on how to install dependencies and run locally, is currently hosted within the repository, [here](https://github.com/CDCgov/dibbs-query-connector/blob/main/query-connector/README.md).

Access to the demo instance of the DIBBs Query Connector is available at [dibbs.cloud/tefca-viewer]().
Access to the demo instance of the DIBBs Query Connector is available at [dibbs.cloud/query-connector]().

## Additional Acknowledgments

We mapped the rootnames of the PHDI database to nicknames produced by the aggregation and synthesis of open source work from a number of projects. While we do not employ the packages and wrappers used by the various projects (merely their open source data), we wish to give credit to their various works building collections of nickname mappings. These projects are:

* [Secure Enterprise Master Patient Index](https://github.com/MrCsabaToth/SOEMPI), based on OpenEMPI, conducted by Vanderbilt University
* [Curated Nicknames](https://github.com/carltonnorthern/nicknames), scraped from genealogy webpages and run by Old Dominion University Web Science and Digital Libraries Research Group
* [Simple Public Domain Nickname Mappings](https://github.com/onyxrev/common_nickname_csv), hand collected using various sources
* [Lingua En Nickname](https://github.com/brianary/Lingua-EN-Nickname), collected from a series of GenWeb projects
* [diminutives.db](https://github.com/HaJongler/diminutives.db), compiled via a nickname extract using Wikipedia and Wiktionary
- [Secure Enterprise Master Patient Index](https://github.com/MrCsabaToth/SOEMPI), based on OpenEMPI, conducted by Vanderbilt University
- [Curated Nicknames](https://github.com/carltonnorthern/nicknames), scraped from genealogy webpages and run by Old Dominion University Web Science and Digital Libraries Research Group
- [Simple Public Domain Nickname Mappings](https://github.com/onyxrev/common_nickname_csv), hand collected using various sources
- [Lingua En Nickname](https://github.com/brianary/Lingua-EN-Nickname), collected from a series of GenWeb projects
- [diminutives.db](https://github.com/HaJongler/diminutives.db), compiled via a nickname extract using Wikipedia and Wiktionary

## Standard Notices

Expand Down
14 changes: 7 additions & 7 deletions query-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ To run the Query Connector app with Docker, follow these steps.
Docker version 20.10.21, build baeda1f
```

2. Download a copy of the Docker image from the PHDI repository by running `docker pull ghcr.io/cdcgov/phdi/tefca-viewer:latest`.
1. If you're using an M1 Mac, you'll need to tell Docker to pull the non-Apple Silicon image using `docker pull --platform linux/amd64 ghcr.io/cdcgov/phdi/tefca-viewer:latest` since we don't have a image for Apple Silicon. If you're using this setup, there might be some issues with architecture incompatability that the team hasn't run into, so please flag if you run into something!
3. Run the service with `docker run -p 3000:3000 tefca-viewer:latest`. If you're on a Windows machine, you may need to run `docker run -p 3000:3000 ghcr.io/cdcgov/phdi/tefca-viewer:latest` instead.
2. Download a copy of the Docker image from the PHDI repository by running `docker pull ghcr.io/cdcgov/phdi/query-connector:latest`.
1. If you're using an M1 Mac, you'll need to tell Docker to pull the non-Apple Silicon image using `docker pull --platform linux/amd64 ghcr.io/cdcgov/phdi/query-connector:latest` since we don't have a image for Apple Silicon. If you're using this setup, there might be some issues with architecture incompatability that the team hasn't run into, so please flag if you run into something!
3. Run the service with `docker run -p 3000:3000 query-connector:latest`. If you're on a Windows machine, you may need to run `docker run -p 3000:3000 ghcr.io/cdcgov/phdi/query-connector:latest` instead.

Congratulations, the Query Connector app should now be running on `localhost:3000/tefca-viewer`!
Congratulations, the Query Connector app should now be running on `localhost:3000/query-connector`!

#### Running from Node.js Source Code

We recommend running the Query Connector app from a container, but if that is not feasible for a given use-case, it may also be run directly from Node using the steps below.

1. Ensure that both Git and Node 18.x or higher are installed.
2. Clone the PHDI repository with `git clone https://github.com/CDCgov/phdi`.
3. Navigate to `/phdi/containers/tefca-viewer/`.
3. Navigate to `/phdi/containers/query-connector/`.
4. Install all of the Node dependencies for the Query Connector app with `npm install`.
5. Run the Query Connector app on `localhost:3000` with `npm run dev`. If you are on a Windows Machine, you may need to run `npm run dev-win` instead.

Expand All @@ -47,8 +47,8 @@ To build the Docker image for the Query Connector app from source instead of dow

1. Ensure that both [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker](https://docs.docker.com/get-docker/) are installed.
2. Clone the PHDI repository with `git clone https://github.com/CDCgov/phdi`.
3. Navigate to `/phdi/containers/tefca-viewer/`.
4. Run `docker build -t tefca-viewer .`.
3. Navigate to `/phdi/containers/query-connector/`.
4. Run `docker build -t query-connector .`.

### Running via docker-compose (WIP)

Expand Down
4 changes: 2 additions & 2 deletions query-connector/design-review/design-review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ git checkout $BRANCH_NAME
docker-compose build --no-cache && docker-compose up -d

# Wait for TEFCA Viewer to be available
URL="http://localhost:3000/tefca-viewer"
URL="http://localhost:3000/query-connector"
while ! curl -s -o /dev/null -w "%{http_code}" "$URL" | grep -q "200"; do
echo "Waiting for $URL to be available..."
sleep 5
done


# Open in default browser
open http://localhost:3000/tefca-viewer
open http://localhost:3000/query-connector

# Prompt to end review session
read -p "Press enter to end review"
Expand Down
2 changes: 1 addition & 1 deletion query-connector/docker-compose-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
retries: 20

# Next.js app with Flyway
tefca-viewer:
query-connector:
platform: linux/amd64
build:
context: .
Expand Down
2 changes: 1 addition & 1 deletion query-connector/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
retries: 20

# Next.js app with Flyway
tefca-viewer:
query-connector:
platform: linux/amd64
build:
context: .
Expand Down
4 changes: 2 additions & 2 deletions query-connector/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const nextConfig = {
async rewrites() {
return [
{
source: "/tefca-viewer/:slug*",
source: "/query-connector/:slug*",
destination: "/:slug*",
},
];
},
output: "standalone",
basePath: process.env.NODE_ENV === "production" ? "/tefca-viewer" : "",
basePath: process.env.NODE_ENV === "production" ? "/query-connector" : "",
};

module.exports = nextConfig;
4 changes: 2 additions & 2 deletions query-connector/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 query-connector/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "tefca-viewer",
"name": "query-connector",
"description": "The DIBBs TryTEFCA Viewer is a FHIR client for public health specific queries.",
"version": "1.0.1",
"private": true,
Expand Down
6 changes: 4 additions & 2 deletions query-connector/playwright-setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const TEST_URL =
process.env.TEST_ENV ?? "http://localhost:3000/tefca-viewer";
process.env.TEST_ENV ?? "http://localhost:3000/query-connector";
/**
*
*/
Expand All @@ -22,7 +22,9 @@ async function globalSetup() {
}
} catch (error) {
console.log(
`Fetch failed for ${TEST_URL}: ${(error as Error).message}. Retrying...`,
`Fetch failed for ${TEST_URL}: ${
(error as Error).message
}. Retrying...`,
);
await new Promise((resolve) => setTimeout(resolve, delay));
}
Expand Down
4 changes: 2 additions & 2 deletions query-connector/playwright.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ By default, Playwright will look for end to end tests in `/e2e`.

## Testing Commands and Demos

Playwright provides a number of different ways of executing end to end tests. From the `tefca-viewer/` directory, you can run several commands:
Playwright provides a number of different ways of executing end to end tests. From the `query-connector/` directory, you can run several commands:

`npx playwright test`
Runs the end-to-end tests.
Expand Down Expand Up @@ -41,4 +41,4 @@ A suite of end to end tests for a sample application called "Todo App" can be fo

## Github Integration

Playwright is managed by an end-to-end job in the `.github/workflows/container-tefca-viewer.yaml` file of the project root. Since it requires browser installation to effectively test, and since it operates using an independent framework from jest, it is explicitly _not_ included in the basic `npm test` scripts (specified in `package.json`).
Playwright is managed by an end-to-end job in the `.github/workflows/container-query-connector.yaml` file of the project root. Since it requires browser installation to effectively test, and since it operates using an independent framework from jest, it is explicitly _not_ included in the basic `npm test` scripts (specified in `package.json`).
Loading

0 comments on commit 44bcbfb

Please sign in to comment.