From 44bcbfb069e81589727ff7642fe466165717ec8c Mon Sep 17 00:00:00 2001 From: fzhao99 Date: Thu, 7 Nov 2024 21:18:58 -0500 Subject: [PATCH] change tefca-viewer --> query-connector (#126) --- .github/codecov.yml | 50 ------- .github/workflows/ci.yaml | 2 +- README.md | 24 ++-- query-connector/README.md | 14 +- .../design-review/design-review.sh | 4 +- query-connector/docker-compose-e2e.yaml | 2 +- query-connector/docker-compose.yaml | 2 +- query-connector/next.config.js | 4 +- query-connector/package-lock.json | 4 +- query-connector/package.json | 2 +- query-connector/playwright-setup.ts | 6 +- query-connector/playwright.md | 4 +- ...uery_Connector_API.postman_collection.json | 128 ++++-------------- query-connector/src/app/middleware.js | 6 +- query-connector/src/app/page.tsx | 2 +- .../app/query/components/footer/footer.tsx | 2 +- .../app/query/components/header/header.tsx | 2 +- query-connector/src/app/signin/page.tsx | 2 +- 18 files changed, 71 insertions(+), 189 deletions(-) delete mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index cd5fb45d3..000000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,50 +0,0 @@ -comment: - layout: "diff, flags, files" - behavior: default -coverage: - range: 80...100 - status: - project: - default: - target: 80% - threshold: 10% - patch: - default: - target: 95% - threshold: 10% - flags: - - sdk -flags: - dibbs: - paths: - - "containers/dibbs" - ecr-viewer: - paths: - - "containers/ecr-viewer" - fhir-converter: - paths: - - "containers/fhir-converter" - ingestion: - paths: - - "containers/ingestion" - message-parser: - paths: - - "containers/message-parser" - message-refiner: - paths: - - "containers/message-refiner" - orchestration: - paths: - - "containers/orchestration" - record-linkage: - paths: - - "containers/record-linkage" - tefca-viewer: - paths: - - "containers/tefca-viewer" - trigger-code-reference: - paths: - - "containers/trigger-code-reference" - validation: - paths: - - "containers/validation" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 475a4f41b..6dbbc132b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/README.md b/README.md index f5aa9f290..6011cb493 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/query-connector/README.md b/query-connector/README.md index 422986b75..d6ecac366 100644 --- a/query-connector/README.md +++ b/query-connector/README.md @@ -25,11 +25,11 @@ 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 @@ -37,7 +37,7 @@ We recommend running the Query Connector app from a container, but if that is no 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. @@ -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) diff --git a/query-connector/design-review/design-review.sh b/query-connector/design-review/design-review.sh index 3c66ca101..01398cf17 100755 --- a/query-connector/design-review/design-review.sh +++ b/query-connector/design-review/design-review.sh @@ -65,7 +65,7 @@ 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 @@ -73,7 +73,7 @@ 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" diff --git a/query-connector/docker-compose-e2e.yaml b/query-connector/docker-compose-e2e.yaml index 6cb47cd32..079806f2a 100644 --- a/query-connector/docker-compose-e2e.yaml +++ b/query-connector/docker-compose-e2e.yaml @@ -15,7 +15,7 @@ services: retries: 20 # Next.js app with Flyway - tefca-viewer: + query-connector: platform: linux/amd64 build: context: . diff --git a/query-connector/docker-compose.yaml b/query-connector/docker-compose.yaml index 37f92fb45..f8cc43746 100644 --- a/query-connector/docker-compose.yaml +++ b/query-connector/docker-compose.yaml @@ -15,7 +15,7 @@ services: retries: 20 # Next.js app with Flyway - tefca-viewer: + query-connector: platform: linux/amd64 build: context: . diff --git a/query-connector/next.config.js b/query-connector/next.config.js index beb7e650e..969225488 100644 --- a/query-connector/next.config.js +++ b/query-connector/next.config.js @@ -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; diff --git a/query-connector/package-lock.json b/query-connector/package-lock.json index c7b911d11..c27ed92e6 100644 --- a/query-connector/package-lock.json +++ b/query-connector/package-lock.json @@ -1,11 +1,11 @@ { - "name": "tefca-viewer", + "name": "query-connector", "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "tefca-viewer", + "name": "query-connector", "version": "1.0.1", "dependencies": { "@aws-sdk/client-s3": "^3.515.0", diff --git a/query-connector/package.json b/query-connector/package.json index fef1f2854..8b6056700 100644 --- a/query-connector/package.json +++ b/query-connector/package.json @@ -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, diff --git a/query-connector/playwright-setup.ts b/query-connector/playwright-setup.ts index 06d9c6c5b..abd92717b 100644 --- a/query-connector/playwright-setup.ts +++ b/query-connector/playwright-setup.ts @@ -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"; /** * */ @@ -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)); } diff --git a/query-connector/playwright.md b/query-connector/playwright.md index 1c315191b..9a01064b9 100644 --- a/query-connector/playwright.md +++ b/query-connector/playwright.md @@ -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. @@ -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`). diff --git a/query-connector/src/app/assets/TEFCA_Query_Connector_API.postman_collection.json b/query-connector/src/app/assets/TEFCA_Query_Connector_API.postman_collection.json index b170f2af8..cadfb11e3 100644 --- a/query-connector/src/app/assets/TEFCA_Query_Connector_API.postman_collection.json +++ b/query-connector/src/app/assets/TEFCA_Query_Connector_API.postman_collection.json @@ -23,13 +23,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=HELIOS Meld: Direct&use_case=cancer", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -61,13 +56,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=HELIOS Meld: eHealthExchange&use_case=cancer", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -99,13 +89,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=JMC Meld: Direct&use_case=chlamydia", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -137,13 +122,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=JMC Meld: eHealthExchange&use_case=chlamydia", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -175,13 +155,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=JMC Meld: Direct&use_case=gonorrhea", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -213,13 +188,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=JMC Meld: eHealthExchange&use_case=gonorrhea", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -251,13 +221,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=CernerHelios: eHealthExchange&use_case=newborn-screening", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -289,13 +254,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=Helios Meld: eHealthExchange&use_case=newborn-screening", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -327,13 +287,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=HELIOS Meld: Direct&use_case=newborn-screening", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -365,13 +320,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=HELIOS Meld: Direct&use_case=social-determinants", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -403,13 +353,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=HELIOS Meld: eHealthExchange&use_case=social-determinants", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -441,13 +386,8 @@ }, "url": { "raw": "{{base_url}}/api/query?fhir_server=HELIOS Meld: Direct&use_case=syphilis", - "host": [ - "{{base_url}}" - ], - "path": [ - "api", - "query" - ], + "host": ["{{base_url}}"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -479,14 +419,8 @@ }, "url": { "raw": "dibbs.cloud/api/query?fhir_server=HELIOS Meld: eHealthExchange&use_case=syphilis", - "host": [ - "dibbs", - "cloud" - ], - "path": [ - "api", - "query" - ], + "host": ["dibbs", "cloud"], + "path": ["api", "query"], "query": [ { "key": "fhir_server", @@ -509,9 +443,7 @@ "script": { "type": "text/javascript", "packages": {}, - "exec": [ - "" - ] + "exec": [""] } }, { @@ -519,16 +451,14 @@ "script": { "type": "text/javascript", "packages": {}, - "exec": [ - "" - ] + "exec": [""] } } ], "variable": [ { "key": "base_url", - "value": "https://dibbs.cloud/tefca-viewer", + "value": "https://dibbs.cloud/query-connector", "type": "string" } ] diff --git a/query-connector/src/app/middleware.js b/query-connector/src/app/middleware.js index 024cd0c77..c4de6234d 100644 --- a/query-connector/src/app/middleware.js +++ b/query-connector/src/app/middleware.js @@ -11,12 +11,12 @@ export function middleware(request) { // Redirect only if the path is exactly '/' or empty if (url.pathname === "/" || url.pathname === "") { - url.pathname = "/tefca-viewer"; + url.pathname = "/query-connector"; return NextResponse.redirect(url); } - // Prevent any further redirects if the path already includes '/tefca-viewer' - if (url.pathname === "/tefca-viewer") { + // Prevent any further redirects if the path already includes '/query-connector' + if (url.pathname === "/query-connector") { return NextResponse.next(); } diff --git a/query-connector/src/app/page.tsx b/query-connector/src/app/page.tsx index 16a3ee215..a7a5a373b 100644 --- a/query-connector/src/app/page.tsx +++ b/query-connector/src/app/page.tsx @@ -36,7 +36,7 @@ export default function LandingPage() { Graphic illustrating what TEFCA is
CDC logo diff --git a/query-connector/src/app/signin/page.tsx b/query-connector/src/app/signin/page.tsx index cd9ee7d08..63aeb13a4 100644 --- a/query-connector/src/app/signin/page.tsx +++ b/query-connector/src/app/signin/page.tsx @@ -59,7 +59,7 @@ export default function SigninPage() {