Skip to content

Commit

Permalink
Merge branch 'main' into boban/use-prettier-more
Browse files Browse the repository at this point in the history
  • Loading branch information
BobanL committed Jan 6, 2025
2 parents 8725ec7 + ea9e9f2 commit 2f11b87
Show file tree
Hide file tree
Showing 101 changed files with 987 additions and 577 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
*.sh text eol=lf
*.md text eol=lf
*.json text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.csv text eol=lf

File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions .github/workflows/container-ecr-viewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
node-version: ${{env.NODE_VERSION}}

- name: Start app
run: docker compose --env-file .env.test --profile postgres --profile ecr-viewer up -d
run: CONFIG_NAME=AWS_SQLSERVER_NON_INTEGRATED docker compose --profile AWS_SQLSERVER_NON_INTEGRATED --profile ecr-viewer up -d
working-directory: ./containers/${{env.CONTAINER}}

- name: Wait for Application to be ready
Expand Down Expand Up @@ -153,6 +153,7 @@ jobs:

convert-data:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -167,5 +168,5 @@ jobs:
working-directory: ./containers/${{env.CONTAINER}}

- name: Run seed data conversion
run: npm run convert-seed-data:build
run: npm run convert-seed-data
working-directory: ./containers/${{env.CONTAINER}}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.8.4
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion containers/ecr-viewer/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.next
.github
.env
docker-compose.yml
docker-compose.yaml
Dockerfile
node_modules
seed-scripts
Expand Down
79 changes: 72 additions & 7 deletions containers/ecr-viewer/.env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
APP_ENV=test
NEXT_PUBLIC_NON_INTEGRATED_VIEWER=true
SOURCE=postgres
CONFIG_NAME=AWS_SQLSERVER_NON_INTEGRATED

# Azure Connection
AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;"
Expand All @@ -13,12 +11,79 @@ ECR_BUCKET_NAME=ecr-viewer-files
AWS_ACCESS_KEY_ID=123
AWS_SECRET_ACCESS_KEY=xyz

# Metadata
# Postgres
DATABASE_URL=postgres://postgres:pw@localhost:5432/ecr_viewer_db
METADATA_DATABASE_TYPE=postgres
METADATA_DATABASE_SCHEMA=core

# SQL Server
SQL_SERVER_USER=sa
SQL_SERVER_PASSWORD=Password1!
SQL_SERVER_SERVER=sqlserver
SQL_SERVER_HOST=sqlserver


# Auth - For testing use only
NBS_PUB_KEY="-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnlA1YmmbydxQdBh7DAq0
wUfsjR25eWZOB995mHclT3C46oLat3YLu70akLfoMXd9YcJe0d4q3sP7tS1J4QDO
IkfapvK3ClDJR2VUERTzR9yQ+1B1Sd+MSful/V3aP9L6wPRAJmsmziizUBz+X0oN
WTkGP/xi0F/IlyBfh2sk89JKKmgXSFbgDTD7+8L5WeRY5koR0KfDJLBcyerrcIPW
1FyD8RbkUH78yJXc+/ThXKBNpsDTvV0k/4zqLSADIEmhQFkW8oYOfF4ufBGSnGdZ
gPoWbKHtlK+m1sFWMq0hAtJsNKsJQocPAEO2NIxRCX4k6X9HfvCYVniDI4OdVz0V
jTF+galQDAybgtYc9ZN8ROpePDVkCANHzniBJFOwzv2yekreqd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/kbOiy9UbfWr76xX2pOtPMRi/h7Juhxvfrlw2X80QzehBsP/Tu7dY
4j5nKfyXXGdoKdm28BySZM9via0ShN/IT4O208VKFtQRevfiUmQO+Mm3Xu5Wzxza
/7H6rq2mvsUgPVvsHZ5pM80hs1+nPa0kXPmTMqNp+vEk8+oaNAeVWcmds3uGWhJi
gIZiNO3MBX0aeeF7ic/JF2gmLXf/KAVzrkSynowwz3ZUeDsw2DeaL5A1zEOSHaMG
x4cpSw6JQiewiTjTdIMT+IU4+OAvKPkmzMFM+UYTdy1sTFvTNloXWpGrLQ==
-----END RSA PRIVATE KEY-----"
1 change: 0 additions & 1 deletion containers/ecr-viewer/.env.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
DATABASE_URL=postgres://postgres:pw@postgres:5432/ecr_viewer_db
APP_ENV=test
AZURE_CONTAINER_NAME=ecr-viewer-files
2 changes: 1 addition & 1 deletion containers/ecr-viewer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,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"]
2 changes: 1 addition & 1 deletion containers/ecr-viewer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ help:
@echo "\033[1;36mmake lint\033[0m \033[0;33m- Runs next lint\033[0m"
@echo "\033[1;36mmake test\033[0m \033[0;33m- Runs TZ=America/New_York jest\033[0m"
@echo "\033[1;36mmake test-watch\033[0m \033[0;33m- Runs TZ=America/New_York jest --watch\033[0m"
@echo "\033[1;36mmake convert-seed-data\033[0m \033[0;33m- Runs docker compose -f ./seed-scripts/docker-compose.yml up --abort-on-container-exit\033[0m"
@echo "\033[1;36mmake convert-seed-data\033[0m \033[0;33m- Runs docker compose -f ./seed-scripts/docker-compose.yaml up --abort-on-container-exit\033[0m"
@echo "\033[1;36mmake cypress-open\033[0m \033[0;33m- Opens Cypress\033[0m"
@echo "\033[1;36mmake cypress-run\033[0m \033[0;33m- Runs Cypress tests\033[0m"
@echo "\033[1;36mmake cypress-run-local\033[0m \033[0;33m- Runs Cypress tests in local environment\033[0m"
Expand Down
2 changes: 1 addition & 1 deletion containers/ecr-viewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The eCR Viewer is primailly deveoped on Mac silicon machines, See this [integrea

Sample eICRs are included in `containers/ecr-viewer/seed-scripts/baseECR/`. If you ever need to update the eCRs or add new eCRs you can regenerate the data by:

1. Delete the current volume used by your DB: `docker compose -f ./docker-compose.yml --profile "*" down -v`
1. Delete the current volume used by your DB: `docker compose -f ./docker-compose.yaml --profile "*" down -v`
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.

Expand Down
2 changes: 1 addition & 1 deletion containers/ecr-viewer/api-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Display an eCR

- `id=[string]` where `id` is the ID of the eCR.
- `snomed-code=[string]` where `snomed-code` is the condition the user is viewing the eCR for. OPTIONAL.
- `auth=[string]` where `auth` is the authentication token for the user. Only required if app_env is production.
- `auth=[string]` where `auth` is the authentication token for the user. Only required if NBS_AUTH is true.

**Method** : `GET`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ services:
- "3000:3000"
environment:
- DATABASE_URL=${DATABASE_URL:-postgres://postgres:pw@db:5432/ecr_viewer_db}
- APP_ENV=${APP_ENV:-prod}
- NBS_AUTH=${NBS_AUTH:-true}
16 changes: 11 additions & 5 deletions containers/ecr-viewer/design-review/design-review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,28 @@ npm i

# Write env vars to .env.local
npm run setup-local-env
echo "NEXT_PUBLIC_NON_INTEGRATED_VIEWER=$IS_NON_INTEGRATED" >> .env.local

if [ "$IS_NON_INTEGRATED" = true ]; then
echo "CONFIG_NAME=AWS_SQLSERVER_NON_INTEGRATED" >> .env.local
URL="http://localhost:3000/ecr-viewer"
else
echo "CONFIG_NAME=AWS_INTEGRATED" >> .env.local
URL=http://localhost:3000/ecr-viewer/view-data?id=6100896d-b520-497c-b2fe-1c111c679274&auth=eyJhbGciOiJSUzI1NiIsImlkIjoiYmxhaCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.hXmX6wu9ThiSqNEl6Y3pBETppiIt0j4RKSVPO_AAYZJZsngSFiu8GuGDtA13kJ-texfUHshqcy4euoVwfmN-naDi2Ly6p6lPjY6xzmTuQ1DtiKLZDNBsDupjoLAuIJQ3K8uWRnCdRGG1ZlTkZa-SG8b4jfDLRrl1fPiJCWM62XV7_gIvqCvRAPdP9kMrOV1LtLEuXgoXZGifVNnPQhtT7fQ7kDmbM-HDG4MquZy89CIRy2q22xIclePOAoe0Ifz6q7-NG3I9CzKOAa_Vx6Oy5ZYBYphfV1n46gp4OC0Cb_w-wFLfRDuDPJZvcS5ed2HxdyZrU_GeD4WSN5IQpEn_45CZifBzmv9-jweEUD2or3sp1DReORLZG2CvBqtixC0p3gIeGnY4HROduafmDfyI0gcv7pDM-fcreMCBG-7uqUPkk9rqhCPw9n6fhWvNMSGrtW9tx6hAPNxjKJ2AsyTh7cJyR0teVpijhXZz0dGJOtYY1-nlR7_BnJH2lC9tLiIJcVl1JKfGRu18MV1bHs7y25Wp1HxVDUXllShXa7_oD7ljnE3stmpO5GPMbxvWC_RKO_bu_e2mAgJ3yiPImFpLVYZZgBqClctciZMQeV1lZTAy-7Xlzgdx-IvFc9VuigKw6hfk4on98BxMUENeh20KIgVv8cMr4ZjAGV3MjnFnHWw
fi

# Run FHIR conversion on seed data
if [ "$CONVERT_SEED_DATA" = true ]; then
echo "Running seed data FHIR conversion..."
docker compose -f ./docker-compose.yml --profile "*" down -v
npm run clear-local
npm run convert-seed-data:build
else
echo "Skipping seed data FHIR conversion..."
fi

# Run ecr viewer
npx @dotenvx/dotenvx run -f .env.local -- sh -c 'docker compose -f ./docker-compose.yml --profile ${SOURCE} --profile ${METADATA_DATABASE_TYPE} --profile ecr-viewer up -d'
npm run local-docker

# Wait for eCR Viewer to be available
URL="http://localhost:3000/ecr-viewer"
while ! curl -s -o /dev/null -w "%{http_code}" "$URL" | grep -q "200"; do
echo "Waiting for $URL to be available..."
sleep 5
Expand All @@ -116,4 +122,4 @@ open $URL

# Prompt to end review session
read -p "Press enter to end review"
docker compose -f ./docker-compose.yml --profile "*" down
docker compose -f ./docker-compose.yaml --profile "*" down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ services:
ports:
- "3000:3000"
environment:
- APP_ENV=${APP_ENV:-test}
- METADATA_DATABASE_TYPE=${METADATA_DATABASE_TYPE:-postgres}
- SOURCE=${SOURCE:-postgres}
- CONFIG_NAME=${CONFIG_NAME:-AWS_SQLSERVER_NON_INTEGRATED}
- NBS_PUB_KEY=${NBS_PUB_KEY}
# POSTGRES
- DATABASE_URL=postgres://postgres:pw@postgres:5432/ecr_viewer_db
# AWS
- AWS_CUSTOM_ENDPOINT=http://aws-storage:4566
- AWS_REGION=${AWS_REGION:-us-east-1}
- ECR_BUCKET_NAME=${ECR_BUCKET_NAME:-ecr-viewer-files}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-123}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-xyz}
# Azure
- AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azure-storage:10000/devstoreaccount1;
- AZURE_CONTAINER_NAME=${AZURE_CONTAINER_NAME:-ecr-viewer-files}
- NEXT_PUBLIC_NON_INTEGRATED_VIEWER=${NEXT_PUBLIC_NON_INTEGRATED_VIEWER:-true}
- METADATA_DATABASE_SCHEMA=${METADATA_DATABASE_SCHEMA:-core}
- SQL_SERVER_USER=${SQL_SERVER_USER}
- SQL_SERVER_PASSWORD=${SQL_SERVER_PASSWORD}
# SQL Server
- SQL_SERVER_USER=${SQL_SERVER_USER:-sa}
- SQL_SERVER_PASSWORD=${SQL_SERVER_PASSWORD:-Password1!}
- SQL_SERVER_HOST=${SQL_SERVER_HOST:-sqlserver}
profiles:
- ecr-viewer
Expand All @@ -47,13 +48,14 @@ services:
timeout: 5s
retries: 20
profiles:
- postgres
- AWS_PG_NON_INTEGRATED
- AZURE_PG_NON_INTEGRATED

sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=${SQL_SERVER_PASSWORD}
- MSSQL_SA_PASSWORD=${SQL_SERVER_PASSWORD:-Password1!}
ports:
- "1433:1433"
volumes:
Expand All @@ -64,13 +66,13 @@ services:
test:
[
"CMD-SHELL",
"/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P Password1! -Q 'IF EXISTS (SELECT 1 FROM sys.tables WHERE name = 'ECR_DATA') SELECT 1 ELSE SELECT 0' -C | grep -q 1",
'opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P Password1! -Q "SELECT * FROM sys.tables where name=''ECR_DATA''" -C | grep -q "(0 rows affected)" && exit 1 || exit 0',
]
interval: 20s
timeout: 10s
retries: 5
profiles:
- sqlserver
- AWS_SQLSERVER_NON_INTEGRATED
- AZURE_SQLSERVER_NON_INTEGRATED

aws-storage:
image: gresau/localstack-persist:3
Expand All @@ -80,39 +82,38 @@ services:
- aws-data:/persisted-data
- ./seed-scripts/aws:/etc/localstack/init/ready.d
profiles:
- s3
- AWS_INTEGRATED
- AWS_PG_NON_INTEGRATED
- AWS_SQLSERVER_NON_INTEGRATED

azure-storage:
image: mcr.microsoft.com/azure-storage/azurite
build:
context: ./seed-scripts
dockerfile: azurite.Dockerfile
hostname: azurite
restart: always
command: "azurite --blobHost 0.0.0.0 --blobPort 10000 -l data --debug /data/debug.log"
command:
- /bin/sh
- -c
- |
azurite --blobHost 0.0.0.0 --blobPort 10000 -l data --debug /data/debug.log &
sleep 5
az storage container create --name ecr-viewer-files
tail -f /dev/null
volumes:
- azure-data:/opt/azurite/data
environment:
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;
healthcheck:
test: nc 127.0.0.1 10000 -z
interval: 1s
retries: 30
ports:
- "10000:10000"
profiles:
- azure

azure-storage-init:
image: mcr.microsoft.com/azure-cli:latest
command:
- /bin/sh
- -c
- |
az storage container create --name ecr-viewer-files
depends_on:
azure-storage:
condition: service_healthy
environment:
# https://github.com/Azure/Azurite/blob/main/README.md#usage-with-azure-storage-sdks-or-tools
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azure-storage:10000/devstoreaccount1;
profiles:
- azure
- AZURE_INTEGRATED
- AZURE_PG_NON_INTEGRATED
- AZURE_SQLSERVER_NON_INTEGRATED

volumes:
db:
Expand Down
10 changes: 9 additions & 1 deletion containers/ecr-viewer/environment.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
/* eslint-disable unused-imports/no-unused-vars */
namespace NodeJS {
interface ProcessEnv {
APP_ENV: "test" | "dev" | "middleware" | "prod";
AWS_ACCESS_KEY_ID: string;
AWS_CUSTOM_ENDPOINT: string;
AWS_REGION: string;
AWS_SECRET_ACCESS_KEY: string;
AZURE_CONTAINER_NAME: string;
AZURE_STORAGE_CONNECTION_STRING: string;
BASE_PATH: string;
CONFIG_NAME:
| "AWS_INTEGRATED"
| "AWS_PG_NON_INTEGRATED"
| "AWS_SQLSERVER_NON_INTEGRATED"
| "AZURE_INTEGRATED"
| "AZURE_PG_NON_INTEGRATED"
| "AZURE_SQLSERVER_NON_INTEGRATED";
DATABASE_TYPE: string;
DATABASE_URL: string;
ECR_BUCKET_NAME: string;
GITHUB_ID: string;
GITHUB_SECRET: string;
METADATA_DATABASE_SCHEMA?: "core" | "extended";
METADATA_DATABASE_TYPE?: "postgres" | "sqlserver";
NBS_AUTH: "true" | "false";
NBS_PUB_KEY: string;
NEXT_PUBLIC_NON_INTEGRATED_VIEWER: "true" | "false";
NEXT_RUNTIME: string;
NEXTAUTH_SECRET: string;
NON_INTEGRATED_VIEWER: "true" | "false";
SOURCE: "s3" | "azure" | "postgres";
SQL_SERVER_HOST: string;
SQL_SERVER_PASSWORD: string;
Expand Down
1 change: 1 addition & 0 deletions containers/ecr-viewer/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const createJestConfig = nextJest({
const customJestConfig = {
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
testEnvironment: "jest-environment-jsdom",
modulePathIgnorePatterns: ["<rootDir>/.next"],
moduleNameMapper: {
"^mssql$": "<rootDir>/src/app/tests/__mocks__/mssql.js",
"^tedious$": "<rootDir>/src/app/tests/__mocks__/mssql.js",
Expand Down
Loading

0 comments on commit 2f11b87

Please sign in to comment.