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 042db8677..6011cb493 100644 --- a/README.md +++ b/README.md @@ -1,115 +1,54 @@ -# PRIME Public Health Data Infrastructure (PHDI) +# DIBBs Query Connector + [![codecov](https://codecov.io/gh/CDCgov/phdi/branch/main/graph/badge.svg)](https://codecov.io/gh/CDCgov/phdi) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Test github badge](https://github.com/CDCgov/phdi/actions/workflows/test.yaml/badge.svg)](https://github.com/CDCgov/phdi/actions/workflows/test.yaml) -- [PRIME Public Health Data Infrastructure (PHDI)](#prime-public-health-data-infrastructure-phdi) - - [Overview](#overview) - - [Problem Scope](#problem-scope) - - [Getting Started](#getting-started) - - [Main Features](#main-features) - - [Where to Get PHDI](#where-to-get-phdi) - - [Documentation](#documentation) - - [Additional Acknowledgments](#additional-acknowledgments) - - [Standard Notices](#standard-notices) - - [Public Domain Standard Notice](#public-domain-standard-notice) - - [License Standard Notice](#license-standard-notice) - - [Privacy Standard Notice](#privacy-standard-notice) - - [Contributing Standard Notice](#contributing-standard-notice) - - [Records Management Standard Notice](#records-management-standard-notice) - - [Related documents](#related-documents) - - [Additional Standard Notices](#additional-standard-notices) **General disclaimer** This repository was created for use by CDC programs to collaborate on public health related projects in support of the [CDC mission](https://www.cdc.gov/about/organization/mission.htm). GitHub is not hosted by the CDC, but is a third party website used by CDC and its partners to share information and collaborate on software. CDC use of GitHub does not imply an endorsement of any one particular service, product, or enterprise. ## Overview -This repository is a part of the CDC/USDS [PHDI project](https://cdcgov.github.io/phdi-site/) and has two components: -1. PHDI Python Package -2. PHDI containerized Building Blocks +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 PHDI Python package contains source code for a platform to help public health authorities (PHAs) ingest and report on public health data. This platform is composed of **Building Blocks**, which are modular software tools that, when composed together, can improve data quality and reduce data cleaning workloads by providing analysis-ready data to downstream public health surveillance systems and other analytical and reporting applications. +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. -PHDI contains: -- Our SDK — the Python library containing Building Block source code - - [Repository](https://github.com/CDCgov/phdi/tree/main/phdi) - - [API documentation](https://cdcgov.github.io/phdi/latest/sdk/phdi.html) -- Containerized web services exposing Building Block functionality as HTTP endpoints - - [Repository](https://github.com/CDCgov/phdi/tree/main/containers) - - [User guide](https://cdcgov.github.io/phdi/) (under Building Blocks) -- Cloud Starter Kit — Repositories that implement a complete cloud-based pipeline composed of Building Blocks - - [Azure](https://github.com/CDCgov/phdi-azure) - - [Google Cloud Platform](https://github.com/CDCgov/phdi-google-cloud) +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. -PHDI is a sibling project to [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. - -## Getting Started - -In order to use the PHDI library, you need [Python 3.9 or higher](https://www.python.org/downloads/) and [pip python package manager](https://pip.pypa.io/en/stable/installation/) (or any python package manager). - -To install using pip: -``` -pip install phdi -``` - -## Main Features - -Here are the current tools that PHDI offers: -- **Containerized Building Blocks** - - **[Alerts](https://cdcgov.github.io/phdi/latest/containers/alerts.html)** - Provides the ability to send alerts via SMS, Slack, or Microsoft Teams - - **[FHIR Converter](https://cdcgov.github.io/phdi/latest/containers/fhir-converter.html)** - Enables conversion of health data from legacy formats (e.g., HL7 version 2, CCDA) to [FHIR](https://hl7.org/FHIR/), a standard for health care data exchange - - **[Data Ingestion](https://cdcgov.github.io/phdi/latest/containers/ingestion.html)** - Includes the entire pipeline of Building Blocks below - - **[Harmonization](https://cdcgov.github.io/phdi/latest/containers/ingestion.html#tag/fhirharmonization)** - Standardizes input data (e.g., patient names and phone numbers) to streamline the process of cleaning data and improve data quality - - **[Geospatial](https://cdcgov.github.io/phdi/latest/containers/ingestion.html#tag/fhirgeospatial)** - Provides a common interface for obtaining precise geographic locations based on street addresses from input data - - **[Linkage](https://cdcgov.github.io/phdi/latest/containers/ingestion.html#tag/fhirlinkage)** - Assigns a common identifier to patient records in order to link and deduplicate patient records seen across data contributors - - **[Transport](https://cdcgov.github.io/phdi/latest/containers/ingestion.html#tag/fhirtransport)** - Offers functionality for reading and writing data from storage resources (e.g,. FHIR servers) - - **[Message Parser](https://cdcgov.github.io/phdi/latest/containers/message-parser.html)** - Extracts desired fields from a given message - - **[Tabulation](https://cdcgov.github.io/phdi/latest/containers/tabulation.html)** - Extracts data from a FHIR server, converts it to a tabular representation, and stores it to a user-defined tabular storage file type (e.g., Parquet or CSV) - - **[Record Linkage](https://cdcgov.github.io/phdi/latest/containers/record-linkage.html)** - Links new health care messages to existing records if a connection exists - - **[Validation](https://cdcgov.github.io/phdi/latest/containers/validation.html)** - Checks whether health care messages are in the proper format and contain user-defined fields of interest -- **Implementation Support** - Resources to help users implement PHDI tools to manage their data and analysis workflows - - **[Examples](https://github.com/CDCgov/phdi/tree/main/examples)** - Sample data that simulates how a Building Block could be used - - **[Tutorials](https://github.com/CDCgov/phdi/tree/main/tutorials)** - Step-by-step instructions to implement Building Blocks source code +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. -## Where to Get PHDI +DIBBs Query Connector is a sibling project to -The source code is hosted on GitHub at: https://github.com/CDCgov/phdi. +- [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. -The latest released version is available at the [Python Package Index (PyPI)](https://pypi.org/project/phdi/). +## Implementation -**Python modules** -``` -pip install phdi -``` +**Implementation Support** - Resources to help users implement DIBBs Query Connector tools to manage their data. -**Containerized services** -``` -build from source -build Docker locally -pull down Docker images from GitHub -``` +- **Examples** - Forthcoming! +- **Tutorials** - Forthcoming! ## Documentation -PHDI documentation is currently hosted on GitHub Pages: https://cdcgov.github.io/phdi/ +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). -There, you can find our: -- SDK API reference documentation -- User guide for containerized Building Blocks +Access to the demo instance of the DIBBs Query Connector is available at [dibbs.cloud/query-connector](). -## Additional Acknowledgments +## 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 @@ -165,13 +104,13 @@ published through the [CDC web site](http://www.cdc.gov). - [Open Practices](docs/open_practices.md) - [Rules of Behavior](docs/rules_of_behavior.md) -- [Disclaimer](docs/DISCLAIMER.md) +- [Disclaimer](docs/DISCLAIMER.md)g - [Contribution Notice](docs/CONTRIBUTING.md) - [Code of Conduct](docs/code-of-conduct.md) ### Additional Standard Notices -Please refer to [CDC's Template Repository](https://github.com/CDCgov/template) +Please refer to [CDC's Template Repository](https://github.com/CDCgov/template) for more information about [contributing to this repository](https://github.com/CDCgov/template/blob/master/CONTRIBUTING.md), [public domain notices and disclaimers](https://github.com/CDCgov/template/blob/master/DISCLAIMER.md), and [code of conduct](https://github.com/CDCgov/template/blob/master/code-of-conduct.md). 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/database-service.ts b/query-connector/src/app/database-service.ts index f2bbee22c..ce2c677eb 100644 --- a/query-connector/src/app/database-service.ts +++ b/query-connector/src/app/database-service.ts @@ -16,6 +16,10 @@ import { generateQueryToValueSetInsertionSql, } from "./query-building"; import { UUID } from "crypto"; +import { + CategoryToConditionArrayMap, + ConditionIdToNameMap, +} from "./queryBuilding/utils"; const getQuerybyNameSQL = ` select q.query_name, q.id, qtv.valueset_id, vs.name as valueset_name, vs.oid as valueset_external_id, vs.version, vs.author as author, vs.type, vs.dibbs_concept_type as dibbs_concept_type, qic.concept_id, qic.include, c.code, c.code_system, c.display @@ -579,7 +583,7 @@ export async function getConditionsData() { const rows = result.rows; // 1. Grouped by category with id:name pairs - const conditionCatergories = rows.reduce( + const categoryToConditionArrayMap: CategoryToConditionArrayMap = rows.reduce( (acc, row) => { const { category, id, name } = row; if (!acc[category]) { @@ -588,17 +592,16 @@ export async function getConditionsData() { acc[category].push({ [id]: name }); return acc; }, - {} as Record>>, + {} as CategoryToConditionArrayMap, ); // 2. ID-Name mapping - const conditionLookup = rows.reduce( - (acc, row) => { - acc[row.id] = row.name; - return acc; - }, - {} as Record, - ); - - return { conditionCatergories, conditionLookup }; + const conditionIdToNameMap: ConditionIdToNameMap = rows.reduce((acc, row) => { + acc[row.id] = row.name; + return acc; + }, {} as ConditionIdToNameMap); + return { + categoryToConditionArrayMap, + conditionIdToNameMap, + } as const; } 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 div { - flex-grow: 1; + overflow: scroll !important; } .cdcLogoContainer { display: flex; align-items: center; - gap: 0.5rem; + margin-right: 0.5rem; } -.contactUsContainer { +.cdcFooterTextContainer { display: flex; - justify-content: end; + justify-content: space-between; + width: 100%; + + p { + white-space: nowrap; + margin: 0; + } +} + +@media (max-width: 64em) { + .cdcFooterTextContainer { + flex-direction: column; + justify-content: flex-start; + } } diff --git a/query-connector/src/app/query/components/footer/footer.tsx b/query-connector/src/app/query/components/footer/footer.tsx index e44f7b783..ab42d600b 100644 --- a/query-connector/src/app/query/components/footer/footer.tsx +++ b/query-connector/src/app/query/components/footer/footer.tsx @@ -10,23 +10,21 @@ export default function FooterComponent() { return (