diff --git a/.github/workflows/docker-tag-cd.yml b/.github/workflows/docker-tag-cd.yml new file mode 100644 index 00000000..c899e889 --- /dev/null +++ b/.github/workflows/docker-tag-cd.yml @@ -0,0 +1,41 @@ +name: ci + +on: + workflow_dispatch: + push: + branches: + - 'master' + tags: + - 'v*' + pull_request: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: codexrems/rems-administrator + - + name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/DeveloperSetupGuide.md b/DeveloperSetupGuide.md deleted file mode 100644 index 3472f1c0..00000000 --- a/DeveloperSetupGuide.md +++ /dev/null @@ -1,336 +0,0 @@ -# DRLS-REMS-Docker-The Ultimate Guide to Running DRLS REMS for Local Development - -## Purpose of this guide - -This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) REMS Workflow** system for Local Development. Be aware that each component of DRLS has its own README where you will find more detailed documentation. This document **is not designed to replace those individual READMEs**. - - -This document **is designed to take you through the entire set up process for DRLS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS documentation. - -This guide will take you through the development environment setup for each of the following DRLS components: -1. [Coverage Requirements Discovery (CRD)](https://github.com/mcode/CRD) -2. [(Test) EHR FHIR Service](https://github.com/HL7-DaVinci/test-ehr) -3. [Documents, Templates, and Rules (DTR) SMART on FHIR app](https://github.com/mcode/dtr) -4. [Clinical Decision Support (CDS) Library](https://github.com/mcode/CDS-Library) -5. [CRD Request Generator](https://github.com/mcode/crd-request-generator) -6. [REMS](https://github.com/mcode/REMS.git) -7. [Pharmacy Information System](https://github.com/mcode/pharmacy-information-system) -8. [Keycloak](https://www.keycloak.org/) - -### Expected Functionality -1. File Synchronization between local host system and docker container -2. Automatic Server Reloading whenever source file is changed - - CRD also reloads on CDS_Library changes -3. Automatic Dependency Installation whenever package.json, package-lock.json, or build.gradle are changed -4. Automatic Data Loader in test-ehr whenever the fhirResourcesToLoad directory is changed - -## Table of Contents -- [Prerequisites](#prerequisites) -- [Install core tools](#install-core-tools) - * [Setting Environment Variables and System Path](#setting-environment-variables-and-system-path) -- [Install core tools](#install-core-tools) - * [Installing core tools on MacOS](#installing-core-tools-on-macos) - + [Install Docker Desktop for Mac](#install-docker-desktop-for-mac) - + [Install Ruby](#install-ruby) - + [Install Docker-sync](#install-docker-sync) -- [Clone DRLS REMS](#clone-drls-rems) - * [Open DRLS REMS as VsCode workspace](#open-drls-rems-as-vscode-workspacey) -- [Configure DRLS REMS](#configure-drls-rems) - * [CRD configs](#crd-configs) - * [test-ehr configs](#test-ehr-configs) - * [crd-request-generator configs](#crd-request-generator-configs) - * [dtr configs](#dtr-configs) - * [rems configs](#rems-configs) - * [pharmacy-information-system configs](#pharmacy-information-system-configs) - * [Add VSAC credentials to your development environment](#add-vsac-credentials-to-your-development-environment) -- [Run DRLS REMS](#run-drls) - * [Start Docker Sync](#start-docker-sync-application) - * [Debugging docker-sync application](#debugging-docker-sync-application) - * [Stop Docker Sync](#stop-docker-sync-application-and-remove-all-containers/volumes) - * [Rebuilding Images and Containers](#rebuilding-images-and-containers) - * [Useful Docker Sync Commands](#useful-docker-sync-commands) -- [Verify DRLS is working](#verify-drls-is-working) - - -## Prerequisites - -Your computer must have these minimum requirements: -- x86_64 (64-bit) or equivalent processor - * Follow these instructions to verify your machine's compliance: https://www.macobserver.com/tips/how-to/mac-32-bit-64-bit/ -- At least 16 GB of RAM (12 GB recommended minimum for Docker Desktop) -- At least 256 GB of storage -- Internet access -- [Chrome browser](https://www.google.com/chrome/) -- [Git installed](https://www.atlassian.com/git/tutorials/install-git) - -Obtain [Value Set Authority Center (VSAC)](https://vsac.nlm.nih.gov/) API key - 1. [Click here](https://www.nlm.nih.gov/research/umls/index.html) to read about UMLS - 2. Click 'request a license' under 'Get Started' - 3. If you already have a key you can click 'Visit Your Profile' in the right hand side-bar. The API key will be listed under your username. - 4. If you do not have a key, click 'Generate an API Key' - 5. Sign in using one of the providers (Login.gov recommended) - 6. Agree to terms of service - 7. Fill out request form for VSAC API Key - you'll need to provide some basic information for the NIH to get your account approved - 8. Generating the key is an automated process, you should be approved via e-mail fairly quickly. If not, use the contact information in the first link to reach out to the office (this is not managed by our team / system). - 9. Once approved, loop back to step 2 - -### Setting Environment Variables and System Path - -How you set environment and path variables may vary depending on your operating system and terminal used. For instance, for zsh on MacOS you typically need to modify .zshrc instead of .bash_profile. To figure out how to set environment variables for your system, consult the guides below or google `how to permanently set environment/path variables on [insert operating system] [insert terminal type]`. - - For more information on how to set environment variables consult these following guides: - - - https://chlee.co/how-to-setup-environment-variables-for-windows-mac-and-linux/ - - https://www3.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html - - https://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables - -## Install core tools - -### Installing core tools - -#### Install Docker Desktop - -1. Download the **stable** version of **[Docker Desktop](https://www.docker.com/products/docker-desktop)** and follow the steps in the installer. Make sure you install version 18.03 or later. -3. Once the installation is complete, verify that **Docker Desktop is running.** -4. Configure Docker to have access to enough resources. To do this, open Docker Desktop and select Settings > Resources. - - **Note: The defaults for memory at 2GB and possibly CPU as well are too low to run the entire DRLS REMS workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 6 CPU Processors on MITRE issued Mac Devices.** - -#### Install Visual Studio Code and Extensions -The recommended IDE for this set up is Visual Studio Code -1. Install Visual Studio Code - https://code.visualstudio.com -2. Install Extensions - The workspace should automatically recommend extensions to install when opening the workspace - -#### Install Ruby -Note: The default ruby that comes with Mac may not install the right package version for docker-sync, it is reccomended to install ruby with a package manager, this guide uses rbenv. - -Reference: https://github.com/rbenv/rbenv - -1. Install rbenv - ```bash - brew install rbenv - ``` - -2. Initialize rbenv and follow instructions (setting system path troubleshooting: https://stackoverflow.com/questions/10940736/rbenv-not-changing-ruby-version) - ```bash - rbenv init - ``` -3. Close Terminal so changes take affect -4. Test rbenv is installed correctly - ```bash - curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash - ``` -5. Install Ruby - ```bash - rbenv install 2.7.2 - ``` -6. Verify that the system is using the correct ruby versions - ```bash - which ruby - /Users/$USER/.rbenv/shims/ruby # Correct - - .... - - which ruby - /usr/bin/ruby # Incorrect, using system default ruby. Path not set correctly, reference step 2 - ``` - -#### Install Docker-sync - -1. Download and Install docker-sync using the following command: - ```bash - gem install docker-sync -v 0.7.0 - ``` -2. Test that the right version is installed - ```bash - docker-sync -v - 0.7.0 # Correct - - ... - - docker-sync -v - 0.1.1 # Incorrect, make sure you have ruby installed and are not using the default system ruby - ``` - - Note: The versioning is important, system default ruby sometimes installs version 0.1.1 if -v tag is not set. The 0.1.1 release will not work for the rest of this guide. - -## Clone DRLS REMS - -1. Create a root directory for the DRLS development work (we will call this `` for the remainder of this setup guide). While this step is not required, having a common root for the DRLS components will make things a lot easier down the line. - ```bash - mkdir - ``` - - `` will be the base directory into which all the other components will be installed. For example, CRD will be cloned to `/crd`. - - Note: If you are using a different project structure from the above description, you will need to change the corresponding repo paths in docker-compose-dev.yml, docker-sync.yml, and docker-compose.yml - -2. Now clone the DRLS component repositories from Github: - ```bash - cd - git clone https://github.com/mcode/test-ehr.git test-ehr - git clone https://github.com/mcode/crd-request-generator.git crd-request-generator - git clone https://github.com/mcode/dtr.git dtr - git clone https://github.com/mcode/REMS.git REMS - git clone https://github.com/mcode/pims.git pims - git clone https://github.com/mcode/rems-smart-on-fhir.git rems-smart-on-fhir - - cd REMS - git submodule update --init - - cd .. - - cd rems-smart-on-fhir - git submodule update --init - - ``` - -# Open DRLS REMS as VsCode workspace - -The REMS repository contains the **REMS.code-workspace** file, which can be used to open the above project structure as a multi-root VS Code workspace. To open this workspace, select *File* > *Open Workspace from File...* and navigate to /REMS/REMS.code-workspace. In this workspace configuration, the CDS-Library embedded within CRD is opened as a separate root for an easier development experience. - -The Debugger Tab has various debugging configurations and can be used to easily debug any errors that come up during development. Simply start one of the debuggers and set a breakpoint anywhere in the code base. For more information on VsCode debugging see: https://code.visualstudio.com/docs/editor/debugging - -The Source Control Tab can be used to easily track changes during the development process and perform git actions, with each root of the workspace having its own source control header. Sor more information source control see: https://code.visualstudio.com/docs/editor/versioncontrol - -The Docker Extension for VsCode has useful functionality to aid in the development process using this set up guide. This extension lets you easily visualize the containers, images, networks, and volumes created by this set up. Clicking on a running container will open up the file structure of the container. Right clicking on a running container will give the option to view container logs (useful to see output from select services), attach a shell instance within the container, and attach a Visual Studio Code IDE to the container using remote-containers. For more information on the docker debugger see: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker - -The MongoDB Extension allows for connecting to the pharmacy information system's backend database by inputting the following connection string: `mongodb://pharmacy-information-root:pharmacy-information-password@localhost:27017/?retryWrites=true&w=majority`. For more information on this extension see: https://marketplace.visualstudio.com/items?itemName=mongodb.mongodb-vscode - - -### Add VSAC credentials to your development environment - -> At this point, you should have credentials to access VSAC. If not, please refer to [Prerequisites](#prerequisites) for how to create these credentials and return here after you have confirmed you can access VSAC. -> To download the full ValueSets, your VSAC account will need to be added to the CMS-DRLS author group on https://vsac.nlm.nih.gov/. You will need to request membership access from an admin. Please reach out to Sahil Malhotra at smalhotra@mitre.org in order to request access to the CMS-DRLS author group. If this is not configured, you will get `org.hl7.davinci.endpoint.vsac.errors.VSACValueSetNotFoundException: ValueSet 2.16.840.1.113762.1.4.1219.62 Not Found` errors. - -> While this step is optional, we **highly recommend** that you do it so that DRLS will have the ability to dynamically load value sets from VSAC. - -You can see a list of your pre-existing environment variables on your machine by running `env` in your Terminal. To add to `env`: -1. Set "VSAC_API_KEY" in the .env file in the REMS Repository - - or - -1. `cd ~/` -2. Open `.bash_profile` and add the following lines at the very bottom: - ```bash - export VSAC_API_KEY=vsac_api_key - ``` -3. Save `.bash_profile` and complete the update to `env`: - ```bash - source .bash_profile - ``` - -> Be aware that if you have chosen to skip this step, you will be required to manually provide your VSAC credentials at http://localhost:8090/data and hit **Reload Data** every time you want DRLS to use new or updated value sets. - -Note: How you set environment and path variables may vary depending on your operating system and terminal used. See [Setting Environment Variables and System Path](#setting-environment-variables-and-system-path) for more information. - -### Add Compose Project Name to your development environment - -You can see a list of your pre-existing environment variables on your machine by running `env` in your Terminal. To add to `env`: -1. Set "COMPOSE_PROJECT_NAME" as "rems_dev" in the .env file in the REMS Repository - - or - -1. `cd ~/` -2. Open `.bash_profile` and add the following lines at the very bottom: - ```bash - export COMPOSE_PROJECT_NAME=rems_dev - ``` -3. Save `.bash_profile` and complete the update to `env`: - ```bash - source .bash_profile - ``` - -Note: How you set environment and path variables may vary depending on your operating system and terminal used. See [Setting Environment Variables and System Path](#setting-environment-variables-and-system-path) for more information. - - -## Run DRLS - -### Start docker-sync application -Note: Initial set up will take several minutes and spin up fans with high resource use, be patient, future boots will be much quicker, quieter, and less resource intensive - -```bash - docker-sync-stack start # This is the equivalent of running docker-sync start followed by docker-compose up -``` - -### Debugging docker-sync application -1. Select the Debugger Tab on the left side panel of VsCode -2. From the drop down menu next to Run and Debug select **Debug All REMS Applications (Docker) (workspace)**. This is a compound debugger that combines all the other docker debuggers for all servers and applications in this workspace. -3. When finished debugging, simply hit the disconnect button to close out all debug sessions -4. **Important**: Make sure to close out the **Launch Chrome in Debug Mode** task that gets open in the VsCode terminal space. This task launches chrome in debug mode in order to debug frontend applications in this workspace. This needs to be closed in order to run the debugger again next time, leaving it open will not properly start the frontend debuggers. - -![Closing Launch Chrome Task](./setup-images/ClosingLaunchChromeTask.png) - -### Stop docker-sync application and remove all containers/volumes/images -```bash - docker-sync-stack clean # This is the equivalent of running docker-sync clean followed by docker-compose down - docker image prune -a #Remove unused images - docker volume prune # Remove unused volumes -``` - -### Rebuilding Images and Containers -```bash - docker-compose -f docker-compose-dev.yml up --build --force-recreate [ ...] -``` -or -```bash - docker-compose -f docker-compose-dev.yml build --no-cache --pull [ ...] - docker-compose -f docker-compose-dev.yml up --force-recreate [ ...] -``` -** Note for Apple M1 Mac developers: ** -Prepend `docker-compose` commands with `COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=linux/arm64`. -```bash - COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=linux/arm64 docker-compose -f docker-compose-dev.yml up -``` - -```bash - # Options: - # --force-recreate Recreate containers even if their configuration and image haven't changed. - # --build Build images before starting containers. - # --pull Pull published images before building images. - # --no-cache Do not use cache when building the image. - # [ ...] Services to recreate, not specifying any service will rebuild and recreate all services -``` -After rebuilding images and containers, start docker-sync normally -```bash - ctrl + c # Stop running "docker-compose up" command (containers running without sync functionality) - docker-sync-stack start # If this command fails to run, running a second time usually fixes the issue -``` - -### Useful docker-sync commands -Reference: https://docker-sync.readthedocs.io/en/latest/getting-started/commands.html - -## Verify DRLS is working - -### The fun part: Generate a test request - -1. Go to http://localhost:3000 and play the role of a prescriber. -2. Click **Patient Select** button in upper left. -3. Find **Jon Snow** in the list of patients and click the dropdown menu next to his name. -4. Select **2183126 - Turalio 200 MG Oral Capsule** in the dropdown menu. -5. Click anywhere in the row to select Jon Snow. -6. Click **Send Rx to PIMS** at the bottom of the page to send a prescription to the Pharmacist. -7. Click **Submit to REMS-Admin** at the bottom of the page. -8. After several seconds you should receive a response in the form of two **CDS cards**: - - **Drug Has REMS: Documentation Required.** -9. Select **Patient Enrollment Form** on the returned CDS card with summary **Drug Has REMS: Documentation Required**. -10. If you are asked for login credentials, use **alice** for username and **alice** for password. -11. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. -12. Fill out questionnaire and hit **Submit REMS Bundle**. -13. A new UI will appear with REMS Admin Status and Pharmacy Status. -14. Go to http://localhost:5050 and play the role of a pharmacist. - - -15. Click **Doctor Orders** in the top hand navigation menu on the screen -16. See the Doctor Order that was sent to the pharmacist from the prescriber. -17. Repeat steps 9-12 for submitting the Prescriber Enrollment and Prescriber Knowledge Assessment Forms and check how ETASU statuses change in both the PIMS prescription UI and the Prescriber status page. - -Congratulations! DRLS is fully installed and ready for you to use! - -## Troubleshooting docker-sync -Reference: https://docker-sync.readthedocs.io/en/latest/troubleshooting/sync-stopping.html - -## Running with SSL -See the documentation [here](SSLSetupGuide.md). \ No newline at end of file diff --git a/EndToEndSetupGuide.md b/EndToEndSetupGuide.md deleted file mode 100644 index 9ab65f73..00000000 --- a/EndToEndSetupGuide.md +++ /dev/null @@ -1,217 +0,0 @@ -# End to End Setup Guide - No Docker -Follow this guide if you would like to start each application without using Docker. Each must be launched separately (in a separate terminal window). - -### Other Guides: - -[Simple Set Up](SimpleSetupGuide.md) - This guide will get you up and running quickly with a demo environment for using the prototype locally. If you want to make changes or contribute to the codebase, see the detailed developer guide below. - -[Developer Environment Set Up](DeveloperSetupGuide.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process and is fully featured. - -[SSL Setup](SSLSetupGuide.md) - Follow this guide to enable SSL on the various REMS applications. - - -## Prerequisites -- Java, gradle - - test-ehr -- node - - REMS, pims, dtr, rems-smart-on-fhir, crd-request-generator -- git - - On Windows 'Git Bash' was used for the command line interface - -## Installation Order -1. Clone each Repo -2. Start Utility Applications -3. Start Test and Core Applications - -## Clone Repos -``` -git clone https://github.com/mcode/test-ehr.git -git clone https://github.com/mcode/crd-request-generator.git -git clone https://github.com/mcode/REMS.git -git clone https://github.com/mcode/pims.git -git clone https://github.com/mcode/dtr.git -git clone https://github.com/mcode/rems-smart-on-fhir.git -git clone https://github.com/mcode/rems-smart-on-fhir.git -``` - -## Utilities - -### keycloak -- Setup and run KeyCloak - - Download KeyCloak 22.0.1 from [www.github.com/keycloak/keycloak/releases/tag/22.0.1](https://github.com/keycloak/keycloak/releases/tag/22.0.1) - - Extract the downloaded file - - `tar -xvf keycloak-22.0.1.tar.gz` - - Navigate into directory - - `cd keycloak-22.0.1` - - Start Keycloak - - `KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=admin ./bin/kc.sh start-dev --http-port=8180 --import-realm --hostname=localhost` - - Place realm file in proper folder - - `mkdir data/import` - - `cp /src/main/resources/ClientFhirServerRealm.json data/import/` - - Log in as admin user (optional) - - Launch the admin page in a web browser [localhost:8180/admin/](http://localhost:8180/admin/) - - Select link for [Administration Console](http://localhost:8180/auth/admin/) - - Log in as admin/admin - -### mongodb -- Setup and Run MongoDB - - Download the latest version for your OS from [www.mongodb.com/try/download/community](https://www.mongodb.com/try/download/community) - - Extract the downloaded package - - Linux and Mac - - `tar -xvf ` - - Windows - - `unzip ` - - Create folder for database - - `mkdir db` - - Run mongo - - `./bin/mongod --dbpath db` -- Setup Mongo Shell `mongosh` to initialize the database - - Download latest version for your OS from [www.mongodb.com/try/download/shell](https://www.mongodb.com/try/download/shell) - - Extract the package - - `unzip ` - - Navigate into directory - - `cd ` - - Initialize the database - - (Database must already be running) - - `./bin/mongosh mongodb://localhost:27017 /mongo-init.js` - - Alternate Install Instructions: [www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install](https://www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install) - -- Restart mongo - - Stop the application - - Start as above - `./bin/mongod --dbpath db` - - Applications should now be able to connect - -## Test Applications - -### test-ehr - -- Navigate into directory already cloned from GitHub [www.github.com/mcode/test-ehr](https://www.github.com/mcode/test-ehr) - - `cd test-ehr` - -- Run - - `gradle bootRun` - -- Load Data (in separate window, also in repo folder) - - `gradle loadData` - -### crd-request-generator - -- Navigate into directory already cloned from GitHub [www.github.com/mcode/crd-request-generator](https://www.github.com/mcode/crd-request-generator) - - `cd crd-request-generator` - -- Setup - - `npm install` - -- Run - - `npm start` - -## Core Applications - -### REMS -- Navigate into directory already cloned from GitHub [www.github.com/mcode/REMS](https://www.github.com/mcode/REMS) - - `cd REMS` - -- Submodule Initialization - - `git submodule update --init` - -- Update env.json - - Add your VSAC key to env.json as the default value for `VSAC_API_KEY` - -- Setup - - `npm install` - -- Run - - `npm start` - -### pims -- Navigate into directory already cloned from GitHub [www.github.com/mcode/pims](https://www.github.com/mcode/pims) - - `cd pims` - -- Backend - - Navigate to the backend directory - - `cd backend` - - Setup - - `npm install` - - Run - - `npm start` - -- Frontend - - Navigate to the frontend directory - - `cd frontend` - - Setup - - `npm install` - - Run - - Linux or Mac - - `npm start` - - Windows - - `PORT=5050 npm start` - -### dtr -- Navigate into directory already cloned from GitHub [www.github.com/mcode/dtr](https://www.github.com/mcode/dtr) - - `cd dtr` - -- Setup - - `npm install` - -- Run - - `npm start` - -### rems-smart-on-fhir -- Navigate into directory already cloned from GitHub [www.github.com/mcode/rems-smart-on-fhir](https://www.github.com/mcode/rems-smart-on-fhir) - - `cd rems-smart-on-fhir` - -- Submodule Initialization - - `git submodule update --init` - -- Setup - - `npm install` - -- Run - - Linux or Mac - - `npm start` - - Windows - - `PORT=4040 npm run start` - - diff --git a/EnvironmentVariables.md b/EnvironmentVariables.md deleted file mode 100644 index cb407924..00000000 --- a/EnvironmentVariables.md +++ /dev/null @@ -1,192 +0,0 @@ -# Repositories and environment variables -## Repositories that define environment variables with default values -- mcode/REMS - * .env.example - + `VSAC_API_KEY`: no default value - + `COMPOSE_PROJECT_NAME`: `rems_dev` - + `PORTER_ALLOW_DOCKER_HOST_ACCESS`: `true` - * docker-compose.yml - + keycloak - - `KEYCLOAK_USER`: `admin` - - `KEYCLOAK_PASSWORD`: `admin` - - `DB_VENDOR`: `h2` - + test-ehr - - `oauth_token`: `http://host.docker.internal:8180/auth/realms/ClientFhirServer/protocol/openid-connect/token` - + crd-request-generator - - `REACT_APP_REMS_CONFIG`: `true` - + rems-administrator - - `VSAC_API_KEY`: taken from host machine's value - - `MONGO_URL`: `mongodb://rems-user:pass@pims_remsadmin_mongo:27017` - + pims_remsadmin_mongo - - `MONGO_INITDB_ROOT_USERNAME`: `rems-admin-pims-root` - - `MONGO_INITDB_ROOT_PASSWORD`: `rems-admin-pims-password` - + pims - - `REMS_ADMIN_BASE`: `http://rems-administrator:8090` - - `MONGO_URL`: `mongodb://pims_remsadmin_mongo:27017/pims` - * docker-compose-dev.yml - + keycloak - - `KEYCLOAK_USER`: `admin` - - `KEYCLOAK_PASSWORD`: `admin` - - `DB_VENDOR`: `h2` - + test-ehr - - `oauth_token`: `http://host.docker.internal:8180/auth/realms/ClientFhirServer/protocol/openid-connect/token` - + crd-request-generator - - `REACT_APP_REMS_CONFIG`: `true` - + rems-administrator - - `VSAC_API_KEY`: taken from host machine's value - - `MONGO_URL`: `mongodb://rems-user:pass@pims_remsadmin_mongo:27017` - + pims_remsadmin_mongo - - `MONGO_INITDB_ROOT_USERNAME`: `rems-admin-pims-root` - - `MONGO_INITDB_ROOT_PASSWORD`: `rems-admin-pims-password` - + pims - - `REMS_ADMIN_BASE`: `http://rems-administrator:8090` - - `MONGO_URL`: `mongodb://pims_remsadmin_mongo:27017/pims` - -- mcode/rems-smart-on-fhir - * .env - + `REACT_APP_REMS_ADMIN_SERVER_BASE`: `http://localhost:8090` - + `REACT_APP_REMS_HOOKS_PATH`: `/cds-services/rems-order-sign` - + `REACT_APP_PHARMACY_SERVER_BASE`: `http://localhost:5051` - + `REACT_APP_ETASU_STATUS_ENABLED`: `true` - + `REACT_APP_PHARMACY_STATUS_ENABLED`: `true` - + `PORT`: `4040` - -- mcode/test-ehr - * src/main/resources/application.yml - + `auth_base`: `http://localhost:8180/auth/realms/ClientFhirServer/protocol/openid-connect` - + `ehr_base`: `http://localhost:8080/test-ehr` - + `client_id`: `app-token` - + `client_secret`: no default value - + `realm`: `ClientFhirServer` - + `use_oauth`: `false` - + `oauth_token`: `${auth_base}/token` - + `oauth_authorize`: `${auth_base}/auth` - + `proxy_authorize`: `${ehr_base}/auth` - + `proxy_token`: `${ehr_base}/token` - + `redirect_post_launch`: `${ehr_base}/_services/smart/Launch` - + `redirect_post_token`: `${ehr_base}/token` - + `introspection_url`: `${auth_base}/token/introspect` - + `redirect_base`: `${ehr_base}/_auth/` - * Dockerfile.keycloak - + `KEYCLOAK_IMPORT`: `/resources/ClientFhirServerRealm.json` - -## Repositories that use environment variables -- mcode/REMS - * src/.env - + `MONGO_URL` : `mongodb://rems-user:pass@127.0.0.1:27017` - + `MONGO_DB_NAME` : `remsadmin` - + `WHITELIST` : `http://localhost, http://localhost:3005` - + `LOGGING_LEVEL` : `debug` - + `PORT` : `8090` - + `RESOURCE_SERVER` : `http://localhost:8090` - + `AUTH_SERVER_URI` : `http://localhost:8090` - + `VSAC_API_KEY` : `changeMe` - + `SMART_ENDPOINT` : `http://localhost:3005/launch` - + `HTTPS_KEY_PATH` : `server.key` - + `HTTPS_CERT_PATH` : `server.cert` - + `USE_HTTPS` : `false` - * src/config.ts - + `WHITELIST` - + `PORT` - + `SERVER_PORT` - + `SMART_ENDPOINT` - + `VSAC_API_KEY` - + `MONGO_URL` - + `MONGO_DB_NAME` - + `RESOURCE_SERVER` - + `LOGGING_LEVEL` - + `AUTH_SERVER_URI` - -- mcode/test-ehr - * src/main/java/ca/uhn/fhir/jpa/starter/EnvironmentHelper.java - + `elasticsearch.required_index_status` - + `elasticsearch.schema_management_strategy` - + `elasticsearch.debug.refresh_after_write` - + `elasticsearch.debug.pretty_print_json_log` - + `elasticsearch.rest_url` - + `elasticsearch.protocol` - + `elasticsearch.username` - + `elasticsearch.password` - + `elasticsearch.enabled` - + `elasticsearch.enabled` - * src/main/java/org/hl7/davinci/ehrserver/ClientAuthorizationInterceptor.java - + `use_oauth` - + `client_secret` - + `client_id` - + `introspect_url` - * src/main/java/org/hl7/davinci/ehrserver/authproxy/AuthProxy.java - + `oauth_authorize` - + `oauth_token` - + `redirect_base` - -- mcode/crd-request-generator - * src/registerServiceWorker.js - + `NODE_ENV` - + `PUBLIC_URL` - * src/containers/RequestBuilder.js - + `REACT_APP_EHR_BASE` - + `REACT_APP_EHR_SERVER` - * src/util/auth.js - + `REACT_APP_AUTH` - + `REACT_APP_REALM` - + `REACT_APP_USER` - + `REACT_APP_PASSWORD` - + `REACT_APP_CLIENT` - + `REACT_APP_PUBLIC_KEYS` - * src/util/data.js - + `REACT_APP_EHR_SERVER` - + `REACT_APP_CDS_SERVICE` - + `REACT_APP_ORDER_SELECT` - + `REACT_APP_ORDER_SIGN` - + `REACT_APP_AUTH` - + `REACT_APP_ALTERNATIVE_THERAPY` - + `LAUNCH_URL` - + `FORM_EXPIRATION_DAYS` - + `PIMS_URL` - * src/util/fhir.js - + `REACT_APP_AUTH` - + `REACT_APP_REALM` - + `REACT_APP_CLIENT` - -- mcode/dtr - * bin/prod - + `REACT_APP_SERVER_PORT` - + `REACT_APP_INITIAL_CLIENT` - * bin/template - + `REACT_APP_SERVER_PORT` - + `REACT_APP_INITIAL_CLIENT` - * src/backend/routes/metadata.js - + `FHIR_VERSION` - * bin/www - + `PORT` - * src/elmExecutor/buildPopulatedResourceBundle.js - + `REACT_APP_EPIC_SUPPORTED_QUERIES` - -- mcode/pims - * src/backend/server.js - + `BACKEND_PORT` - + `ALLOWED_ORIGIN` - + `MONGO_HOSTNAME` - + `AUTH_SOURCE` - + `MONGO_USERNAME` - + `MONGO_PASSWORD` - * src/backend/server.ts - + `PORT` - + `ALLOWED_ORIGIN` - + `MONGO_HOSTNAME` - + `AUTH_SOURCE` - + `MONGO_USERNAME` - + `MONGO_PASSWORD` - * src/backend/routes/doctorOrders.js - + `REMS_ADMIN_BASE` - * frontend/src/App.tsx - + `REACT_APP_PIMS_BACKEND_URL` - + `REACT_APP_PIMS_BACKEND_PORT` - -- mcode/rems-smart-on-fhir - * src/views/Patient/MedReqDropDown/MedReqDropDown.tsx - + `REACT_APP_REMS_ADMIN_SERVER_BASE` - * src/views/Patient/MedReqDropDown/etasuStatus/EtasuStatus.tsx - + `REACT_APP_REMS_ADMIN_SERVER_BASE` - * src/views/Patient/MedReqDropDown/pharmacyStatus/PharmacyStatus.tsx - + `REACT_APP_REMS_ADMIN_SERVER_BASE` diff --git a/PrototypeRepositoriesAndCapabilities.md b/PrototypeRepositoriesAndCapabilities.md deleted file mode 100644 index 4e93415f..00000000 --- a/PrototypeRepositoriesAndCapabilities.md +++ /dev/null @@ -1,76 +0,0 @@ -# Prototype Repositories and Capabilities - -## (As of April 27, 2023. Prototype version 0.9) - -![](./prototype-images/layout.png) - -(Note: Numbers correspond to the numbers in the diagram above) - -### Repositories - -- mcode/REMS - * REMS Administrator (4) - + Node/TypeScript - + (1.1)(3) CDS Hooks (server) end points - + (1.4) FHIR Server to support DTR - + Contains Questionnaire, Library (w/ CQL), ValueSets - + Retrieves and caches ValueSets from VSAC - + (5) Interface to check status of REMS - + Stores data in MongoDB - * Docker scripts to launch the entire stack - -- mcode/test-ehr - * Test EHR (2) - + Java HAPI FHIR Server - + Contains test patient data - + Supports launching DTR SMART on FHIR app - -- mcode/crd-request-generator - * Request Generator (2) - + Node/JavaScript - + Web Application mimicking the EHR frontend - + Requests - + (1.1)(3) Generates CDS Hooks order-sign (client) that is sent to the REMS Admin - + (1.2)(3) Handles CARDS returned from REMS Admin to launch DTR - + Sends Rx to PIMS using NCPDP Script NewRx - -- mcode/dtr - * DTR Server - + Node/JavaScript - + (1.3) SMART on FHIR application - + (1.4) Retrieves Questionnaires and other resources from REMS Admin - + Runs CQL to prepopulate Questionnaire with data from the Test EHR - + Sends completed Questionnaires to REMS Admin - + Saves partially completed Questionnaires to Test EHR - + After submitting completed form to REMS Admin, displays page showing ETASU and Pharmacy status - -- mcode/pims - * Pharmacy Information System (6) - + Node/TypeScript - + Receives Rx from Request Generator - + (5) Provides interface to monitor status of REMS - + Allows pharmacist to mark Rx as dispensed - + Provides interface for querying status of Rx - + Non-standard, created for demo purposes only - * Stores data in MongoDB - -- mcode/rems-smart-on-fhir - * REMS SMART on FHIR Application - + SMART on FHIR application to generate CDS Hooks interaction with REMS Admin for any EHR that does not support CDS Hooks - + Node/TypeScript - -- mcode/rems-cds-hooks - * Git submodule used by REMS SMART on FHIR Application and REMS Admin - + TypeScript - + Prefetch implementation - + Type definitions for CDS Hooks needed by TypeScript - -### Other Components - -- KeyCloak - * Authentication of users - * Docker config hosted in mcode/test-ehr - -- MongoDB - * Stores data for REMS Admin and PIMS in separate databases - * Docker config hosted and stored in mcode/REMS diff --git a/README.md b/README.md index 4f58308e..c6d9cadd 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,4 @@ -# REMS - -## Prototype Organization Overview -[Prototype Repositories and Capabilities](PrototypeRepositoriesAndCapabilities.md) - -## Running the full prototype environment - -You can find complete end-to-end full-stack set up guides for DRLS REMS at the following links: - -[Simple Set Up](SimpleSetupGuide.md) - This guide will get you up and running quickly with a demo environment for using the prototype locally. If you want to make changes or contribute to the codebase, see the detailed developer guide below. - -[Developer Environment Set Up](DeveloperSetupGuide.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process and is fully featured. - -[Developer Environment Set Up (No Docker)](EndToEndSetupGuide.md) - Follow this guide if you are intend on starting every application separately without using docker. +# REMS-admin ## Running only the REMS server project locally 1. Clone the REMS repositories from Github: diff --git a/REMS.code-workspace b/REMS.code-workspace deleted file mode 100644 index 3f7693a8..00000000 --- a/REMS.code-workspace +++ /dev/null @@ -1,115 +0,0 @@ -{ - "folders": [ - { - "path": "../test-ehr" - }, - { - "path": "../crd-request-generator" - }, - { - "path": "../dtr" - }, - { - "path": "." - }, - { - "path": "../pims" - }, - { - "path": "../rems-smart-on-fhir" - } - ], - "launch": { - "version": "0.2.0", - "configurations": [ - { - "postDebugTask": "Terminate All Tasks", - "name": "Post Debug Task - Terminate Chrome (This is not a Debugger)", - "request": "launch", - "type": "node" - }, - ], - "compounds": [ - { - "name": "Debug All REMS Applications (Docker)", - "stopAll": true, - "preLaunchTask": "Launch Chrome in Debug Mode", - "configurations": [ - "Debug DTR Backend (Docker)", - "Debug Test-EHR (Local + Docker)", - "Debug DTR Frontend (Attach Local + Docker)", - "Debug CRD-Request-Generator (Attach Docker)", - // ToDO: Add in PIMS Debugging and REMS debugging in docker - "Post Debug Task - Terminate Chrome (This is not a Debugger)" - ], - } - ] - }, - "tasks": { - "version": "2.0.0", - "tasks": [ - { - "type": "shell", - "label": "Launch Chrome in Debug Mode", - "linux": { - "command": "google-chrome http://localhost:3000 http://localhost:5050 http://localhost:3005/register --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug" - }, - "osx": { - "command": "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome http://localhost:3000 http://localhost:5050 http://localhost:3005/register --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug" - }, - "windows": { - "command": "for /f \"usebackq tokens=1,2,3,4,5\" %a in (`reg query HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ /s /f \\chrome.exe ^| findstr Application`) do set CHROMEPATH=%c%d%e & set CHROMEPATH=%CHROMEPATH:ProgramFiles=Program Files% & \"%CHROMEPATH%\" http://localhost:3000 http://localhost:5050 http://localhost:3005/register --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug" - }, - "presentation": { - "close": true, - }, - "isBackground": true, - "problemMatcher": [ - { - "pattern": [ - { - "regexp": ".", - "file": 1, - "location": 2, - "message": 3 - } - ], - "background": { - "activeOnStart": true, - "beginsPattern": ".", - "endsPattern": ".", - } - } - ] - },{ - "label": "Terminate All Tasks", - "command": "echo ${input:terminate}", - "type": "shell", - "problemMatcher": [] - } - ], - "inputs": [ - { - "id": "terminate", - "type": "command", - "command": "workbench.action.tasks.terminate", - "args": "terminateAll" - } - ] - }, - "settings": { - "debug.onTaskErrors": "debugAnyway" - }, - "extensions": { - "recommendations": [ - "ms-azuretools.vscode-docker", - "vscjava.vscode-java-debug", - "cqframework.cql", - "mitre-health.vscode-language-fsh", - "redhat.java", - "mongodb.mongodb-vscode", - "VisualStudioExptTeam.vscodeintellicode" - ] - }, - -} \ No newline at end of file diff --git a/SSLSetupGuide.md b/SSLSetupGuide.md deleted file mode 100644 index d5953d87..00000000 --- a/SSLSetupGuide.md +++ /dev/null @@ -1,107 +0,0 @@ -# HTTPS / SSL Setup Guide -This document specifies how to launch each application in the prototype workflow with SSL enabled. - -## Keycloak - -### Generate Certs -#### Keycloak documentation -https://www.keycloak.org/server/enabletls - -#### self-signed -` -keytool -genkeypair -alias localhost -keyalg RSA -keysize 2048 -validity 365 -keystore /tmp/certs/server.keystore -dname "cn=Server Administrator,o=Acme,c=GB" -keypass secret -storepass secret` - -### Docker -` -docker run --volume=/tmp/certs:/certs -p 8543:8543 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin codexrems/keycloak:REMSvCurrent start --import-realm --http-enabled=false --hostname=localhost --https-key-store-file=/certs/server.keystore --https-key-store-password=secret --https-port=8543` - -### Docker-compose -``` -keycloak: - container_name: rems_dev_keycloak - command: 'start --import-realm --http-enabled=false --hostname=localhost --https-key-store-file=/certs/server.keystore --https-key-store-password=secret --https-port=8543' - ports: - - '8543:8543' - environment: - - KEYCLOAK_USER=admin - - KEYCLOAK_PASSWORD=admin - - DB_VENDOR=h2 - volumes: - - rems_dev_keycloak-data:/opt/keycloak/data/ - - /tmp/certs:/certs - image: codexrems/keycloak:REMSvCurrent -``` - -### Standalone -` -KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin ./bin/kc.sh start --import-realm --http-enabled=false --hostname=localhost --https-key-store-file=/tmp/certs/server.keystore --https-key-store-password=secret --https-port=8543` - -## mongodb -### Running with MongoD or MongoS -Consult Documentation: https://www.mongodb.com/docs/v2.4/tutorial/configure-ssl/ - -### Running in Docker -Consult Documentation: https://medium.com/@prabhashdilhanakmeemana/how-to-start-a-mongo-db-server-in-docker-with-tls-enabled-da2bdd99caaf - -## test-ehr -To launch the test EHR with ssl enabled, set the following environment variables: - -`EHR_SSL_ENABLED` defaults to false, needs to be true to use https. -`EHR_KEY_STORE_TYPE` defaults to `jks` but can also be `pkcs12` if using a PKCS12 keystore -`EHR_KEY_STORE_PATH` the path to the keystore file -`EHR_KEY_STORE_PASSWORD` the password for the keystore -`EHR_KEY_PASSWORD` the password for the key -`EHR_KEY_ALIAS` the alias of the key - -## crd-request-generator - -### Generate Certs -#### self-signed - -`openssl req -nodes -new -x509 -keyout server.key -out server.cert` - -### Update ENV variable in env.json file -`USE_HTTPS = true` -Ensure the key and cert path are accurate, if not update SSL_KEY_FILE and SSL_CRT_FILE to point to generated certs. - -## REMS - -### Generate Certs -#### self-signed - -`openssl req -nodes -new -x509 -keyout server.key -out server.cert` - -### Update ENV variable in .env file -`USE_HTTPS = true` -Ensure the key and cert path are accurate, if not update HTTPS_KEY_PATH and HTTPS_CERT_PATH to point to generated certs. - -## pims -### Backend -#### Generate Certs -##### self-signed - -`openssl req -nodes -new -x509 -keyout server.key -out server.cert` - -#### Update ENV variable in env.json file -`USE_HTTPS = true` -Ensure the key and cert path are accurate, if not update HTTPS_KEY_PATH and HTTPS_CERT_PATH to point to generated certs. - -### Frontend -#### Generate Certs -##### self-signed - -`openssl req -nodes -new -x509 -keyout server.key -out server.cert` - -#### Update ENV variable in env.json file -`USE_HTTPS = true` -Ensure the key and cert path are accurate, if not update SSL_KEY_FILE and SSL_CRT_FILE to point to generated certs. - -## rems-smart-on-fhir -### Generate Certs -#### self-signed - -`openssl req -nodes -new -x509 -keyout server.key -out server.cert` - -### Update ENV variable in env.json file -`USE_HTTPS = true` -Ensure the key and cert path are accurate, if not update SSL_KEY_FILE and SSL_CRT_FILE to point to generated certs. \ No newline at end of file diff --git a/SimpleSetupGuide.md b/SimpleSetupGuide.md deleted file mode 100644 index 32bd28e4..00000000 --- a/SimpleSetupGuide.md +++ /dev/null @@ -1,211 +0,0 @@ -# DRLS REMS Local Demo Setup Guide - -## Guide Contents -- [Purpose](#purpose-of-this-guide) -- [Components](#components) -- [Quick Setup](#quick-setup) -- [Cleanup and Useful Options](#cleanup-and-useful-options) - * [Setting Environment Variables](#setting-environment-variables) - * [Configurable install](#docker-compose-without-porter) - -## Purpose of this guide - -This document details instructions on how to quickly get up and running with a local demo deployment of the full-stack Documentation Requirements Lookup Service (DRLS) REMS prototype environment. This is primarily meant for non-technical users interested in exploring the prototype on their own machine. - -*Note:* If you are looking to contribute or make code changes, please see the full [Developer Environment Setup](DeveloperSetupGuide.md). - -*Note:* If you are looking to just have more control or configuration options with Docker in your local environment, see [the configurable install](#docker-compose-without-porter). - -## Components - -The following DRLS components will be deployed in Docker locally: - -1. [Coverage Requirements Discovery (CRD)](https://github.com/mcode/CRD) -2. [(Test) EHR FHIR Service](https://github.com/HL7-DaVinci/test-ehr) -3. [Documents, Templates, and Rules (DTR) SMART on FHIR app](https://github.com/mcode/dtr) -4. [Clinical Decision Support (CDS) Library](https://github.com/mcode/CDS-Library) -5. [CRD Request Generator](https://github.com/mcode/crd-request-generator) -6. [REMS](https://github.com/mcode/REMS) -7. [Pharmacy Information System](https://github.com/mcode/pharmacy-information-system) -8. [Keycloak](https://www.keycloak.org/) - -## Quick Setup - -### 1. Verify or Install Prerequisites - -#### System Requirements -Your computer must have these minimum requirements: -- x86_64 (64-bit) or equivalent processor -- At least 12 GB of RAM -- At least 256 GB of storage -- Internet access -- [Chrome browser](https://www.google.com/chrome/) installed -- **[Docker Desktop](https://www.docker.com/products/docker-desktop)** installed - after installing ensure it is running using their setup guide. For resources, the system requires more than the default. Click the settings cog and go to resources. Allocate 8GB+ of RAM (16GB is ideal), and 4+ CPUs. Make sure you install Docker Desktop version 18.03 or later. - -### 2. Obtain [Value Set Authority Center (VSAC)](https://vsac.nlm.nih.gov/) API key - 1. [Click here](https://www.nlm.nih.gov/research/umls/index.html) to read about UMLS - 2. Click 'request a license' under 'Get Started' - 3. If you already have a key you can click 'Visit Your Profile' in the right hand side-bar. The API key will be listed under your username. - 4. If you do not have a key, click 'Generate an API Key' - 5. Sign in using one of the providers (Login.gov recommended) - 6. Generating the key is an automated process, you should be approved via e-mail fairly quickly. If not, use the contact information in the first link to reach out to the office (this is not managed by our team / system). - 7. Once approved, loop back to step 2 - -### 3. Run - -- [Git installed](https://www.atlassian.com/git/tutorials/install-git) -- Use git to clone or download and extract the zip of the [REMS repository](https://github.com/mcode/REMS.git) - in your terminal navigate to the REMS repo folder. -- Before running, setup environment with VSAC credentials (see [setting environment variables section](#setting-environment-variables) for help) - - > At this point, you should have credentials to access VSAC. If not, please refer to [Prerequisites](#prerequisites) for how to create these credentials and return here after you have confirmed you can access VSAC. - > To download the full ValueSets, your VSAC account will need to be added to the CMS-DRLS author group on https://vsac.nlm.nih.gov/. You will need to request membership access from an admin. Please reach out to Sahil Malhotra at smalhotra@mitre.org in order to request access to the CMS-DRLS author group. If this is not configured, you will get `org.hl7.davinci.endpoint.vsac.errors.VSACValueSetNotFoundException: ValueSet 2.16.840.1.113762.1.4.1219.62 Not Found` errors. - - > While this step is optional, we **highly recommend** that you do it so that DRLS will have the ability to dynamically load value sets from VSAC. - - You can see a list of your pre-existing environment variables on your machine by running `env` in your Terminal. To add to `env`: - 1. Set "VSAC_API_KEY" in the .env file in the REMS Repository - - or - - 1. `cd ~/` - 2. Open `.bash_profile` and add the following lines at the very bottom: - ```bash - export VSAC_API_KEY=vsac_api_key - ``` - 3. Save `.bash_profile` and complete the update to `env`: - ```bash - source .bash_profile - ``` - - > Be aware that if you have chosen to skip this step, you will be required to manually provide your VSAC credentials at http://localhost:8090/data and hit **Reload Data** every time you want DRLS to use new or updated value sets. - - Note: How you set environment and path variables may vary depending on your operating system and terminal used. See [setting environment variables section](#setting-environment-variables) for more information. - -- Add Compose Project Name to environment - - You can see a list of your pre-existing environment variables on your machine by running `env` in your Terminal. To add to `env`: - 1. Set "COMPOSE_PROJECT_NAME" as "rems_prod" in the .env file in the REMS Repository - - or - - 1. `cd ~/` - 2. Open `.bash_profile` and add the following lines at the very bottom: - ```bash - export COMPOSE_PROJECT_NAME=rems_prod - ``` - 3. Save `.bash_profile` and complete the update to `env`: - ```bash - source .bash_profile - ``` - - Note: How you set environment and path variables may vary depending on your operating system and terminal used. See [setting environment variables section](#setting-environment-variables) for more information. - - Note: The compose project name is to disambiguate between different set ups on the same machine and can be set to any identifier. If you are following both options mentioned in this guide, it is recommended to change the compose project name for each so that they differ. - - -- Start docker compose application - - ```bash - cd REMS # Need to execute commands in directory with corresponding docker-compose.yml file located in the REMS repository - docker-compose up - ``` - - Note, if you are using an M1/M2 mac, you'll need to prepend `docker-compose` commands with `COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=linux/arm64`. - ```bash - cd REMS # Need to execute commands in directory with corresponding docker-compose.yml file located in the REMS repository - COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=linux/arm64 docker-compose up - ``` - -### 4. Verify everything is working - -#### The fun part: Generate a test request - -1. Go to http://localhost:3000 and play the role of a prescriber. -2. Click **Patient Select** button in upper left. -3. Find **Jon Snow** in the list of patients and click the dropdown menu next to his name. -4. Select **2183126 - Turalio 200 MG Oral Capsule** in the dropdown menu. -5. Click anywhere in the row to select Jon Snow. -6. Click **Send Rx to PIMS** at the bottom of the page to send a prescription to the Pharmacist. -7. Click **Submit to REMS-Admin** at the bottom of the page. -8. After several seconds you should receive a response in the form of two **CDS cards**: - - **Drug Has REMS: Documentation Required.** -9. Select **Patient Enrollment Form** on the returned CDS card with summary **Drug Has REMS: Documentation Required**. -10. If you are asked for login credentials, use **alice** for username and **alice** for password. -11. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. -12. Fill out questionnaire and hit **Submit REMS Bundle**. -13. A new UI will appear with REMS Admin Status and Pharmacy Status. -14. Go to http://localhost:5050 and play the role of a pharmacist. - - -15. Click **Doctor Orders** in the top hand navigation menu on the screen -16. See the Doctor Order that was sent to the pharmacist from the prescriber. -17. Repeat steps 9-12 for submitting the Prescriber Enrollment and Prescriber Knowledge Assessment Forms and check how ETASU statuses change in both the PIMS prescription UI and the Prescriber status page. - -Congratulations! DRLS is fully installed and ready for you to use! - - -## Cleanup and Useful Options - -### Uninstall the docker-compose application -```bash - docker-compose down # Removes application servers -``` -or if on M1/M2 mac use - -```bash - docker-compose -f docker-compose-m1.yml down # Removes application servers -``` - -### Cleanup docker resources - -To remove all images, volumes, and artifacts set up during the install, run the following commands - -```bash - docker image prune -a - docker volume prune - docker network prune -``` - -### Updating docker-compose application images - -```bash - docker-compose build --no-cache --pull [ ...] - docker-compose --force-recreate [ ...] -``` - -```bash - - # Options: - # --force-recreate Recreate containers even if their configuration and image haven't changed. - # --build Build images before starting containers. - # --pull Pull published images before building images. - # --no-cache Do not use cache when building the image. - # [ ...] Services to recreate, not specifying any service will rebuild and recreate all services -``` - - -### Setting Environment Variables - -How you set environment and path variables may vary depending on your operating system and terminal used. For instance, for zsh on MacOS you typically need to modify .zshrc instead of .bash_profile. To figure out how to set environment variables for your system, consult the guides below or google `how to permanently set environment/path variables on [insert operating system] [insert terminal type]`. - - For more information on how to set environment variables consult these following guides: - - - https://chlee.co/how-to-setup-environment-variables-for-windows-mac-and-linux/ - - https://www3.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html - - https://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables - - > At this point, you should have credentials to access VSAC. If not, please refer to step 2 of [quick setup](#quick-setup) for how to create these credentials and return here after you have confirmed you can access VSAC. If this is not configured, you will get `org.hl7.davinci.endpoint.vsac.errors.VSACValueSetNotFoundException: ValueSet 2.16.840.1.113762.1.4.1219.62 Not Found` errors. - - > While this step is optional, we **highly recommend** that you do it so that DRLS will have the ability to dynamically load value sets from VSAC. - -Set `VSAC_API_KEY` in your terminal environment to the API key obtained from your [UMLS profile page](https://uts.nlm.nih.gov/uts/edit-profile) - for more info on getting your VSAC key see [step 2 of quick setup section](#quick-setup). For setting up your environment, see the [Setting Environment Variables](#setting-environment-variables) section. - -Bash example: - ```bash - export VSAC_API_KEY=vsac_api_key - ```` - -### Running with SSL -See the documentation [here](SSLSetupGuide.md). diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml deleted file mode 100644 index 5355e4a9..00000000 --- a/docker-compose-dev.yml +++ /dev/null @@ -1,163 +0,0 @@ -version: '3.6' -services: - keycloak: - container_name: rems_dev_keycloak - command: 'start-dev --import-realm' - ports: - - '8180:8080' - environment: - - KEYCLOAK_USER=admin - - KEYCLOAK_PASSWORD=admin - - DB_VENDOR=h2 - volumes: - - rems_dev_keycloak-data:/opt/keycloak/data/ - - '../test-ehr/src/main/resources/ClientFhirServerRealm.json:/opt/keycloak/data/import/ClientFhirServerRealm.json' - build: - context: ../test-ehr - dockerfile: Dockerfile.keycloak - - test-ehr: - container_name: rems_dev_test-ehr - ports: - - '8080:8080' - - "8081:8081" - build: - context: ../test-ehr - dockerfile: Dockerfile.dev - environment: - - oauth_token=http://host.docker.internal:8180/realms/ClientFhirServer/protocol/openid-connect/token - volumes: - - rems_dev_test-ehr-sync:/test-ehr:nocopy # nocopy is important - - rems_dev_test-ehr-gradle:/test-ehr/.gradle - - rems_dev_test-ehr-bin:/test-ehr/bin - - rems_dev_test-ehr-build:/test-ehr/build - - rems_dev_test-ehr-target:/test-ehr/target - - rems_dev_test-ehr-logs:/test-ehr/logs - extra_hosts: - - "host.docker.internal:host-gateway" - - pims_remsadmin_mongo: - image: mongo - container_name: rems_dev_pims-remsadmin-mongo - ports: - - '27017:27017' - environment: - MONGO_INITDB_ROOT_USERNAME: rems-admin-pims-root - MONGO_INITDB_ROOT_PASSWORD: rems-admin-pims-password - volumes: - - rems_dev_pims_remsadmin_mongo:/data/db - - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js - - crd-request-generator: - build: - context: ../crd-request-generator - dockerfile: Dockerfile.dev - container_name: rems_dev_crd-request-generator - environment: - - REACT_APP_REMS_CONFIG=true - ports: - - "3000:3000" - - "3001:3001" - volumes: - - rems_dev_crd-request-generator-sync:/home/node/app/crd-request-generator:nocopy # nocopy is important - - rems_dev_crd-request-generator-nodeModules:/home/node/app/crd-request-generator/node_modules - - rems_dev_crd-request-generator-databaseData:/home/node/app/crd-request-generator/databaseData - - rems_dev_crd-request-generator-build:/home/node/app/crd-request-generator/build - - rems_dev_crd-request-generator-logs:/home/node/app/crd-request-generator/logs - - dtr: - build: - context: ../dtr - dockerfile: Dockerfile.dev - container_name: rems_dev_dtr - ports: - - "3005:3005" - - "3006:3006" - volumes: - - rems_dev_dtr-sync:/home/node/app/dtr:nocopy # nocopy is important - - rems_dev_dtr-nodeModules:/home/node/app/dtr/node_modules - - rems_dev_dtr-databaseData:/home/node/app/dtr/databaseData - - rems_dev_dtr-logs:/home/node/app/dtr/logs - - rems-smart-on-fhir: - build: - context: ../rems-smart-on-fhir - dockerfile: Dockerfile.dev - container_name: rems_dev_rems-smart-on-fhir - ports: - - "4040:4040" - - "4041:4041" - volumes: - - rems_dev_rems-smart-on-fhir-sync:/home/node/app/rems-smart-on-fhir:nocopy # nocopy is important - - rems_dev_rems-smart-on-fhir-nodeModules:/home/node/app/rems-smart-on-fhir/node_modules - - rems_dev_rems-smart-on-fhir-logs:/home/node/app/rems-smart-on-fhir/logs - - rems-administrator: - build: - context: '.' - dockerfile: Dockerfile.dev - container_name: rems_dev_rems-administrator - ports: - - "8090:8090" - - "8091:8091" - environment: - VSAC_API_KEY: ${VSAC_API_KEY} - MONGO_URL: mongodb://rems-user:pass@pims_remsadmin_mongo:27017 - volumes: - - rems_dev_rems-sync:/REMS:nocopy # nocopy is important - - rems_dev_rems-nodeModules:/REMS/node_modules - - rems_dev_rems-logs:/REMS/logs - - pims: - build: - context: ../pims - dockerfile: Dockerfile.dev - container_name: rems_dev_pims - ports: - - "5050:5050" - - "5051:5051" - environment: - REMS_ADMIN_BASE: http://rems-administrator:8090 - MONGO_URL: mongodb://pims_remsadmin_mongo:27017/pims - volumes: - - rems_dev_pims-sync:/home/node/app/pims:nocopy - - rems_dev_pims-nodeModules:/home/node/app/pims/node_modules - - rems_dev_pims-logs:/home/node/app/pims/logs - -volumes: - rems_dev_test-ehr-sync: - external: true - rems_dev_crd-request-generator-sync: - external: true - rems_dev_dtr-sync: - external: true - rems_dev_rems-sync: - external: true - rems_dev_pims-sync: - external: true - rems_dev_rems-smart-on-fhir-sync: - external: true - - rems_dev_keycloak-data: - rems_dev_pims_remsadmin_mongo: - rems_dev_test-ehr-gradle: - rems_dev_test-ehr-bin: - rems_dev_test-ehr-build: - rems_dev_test-ehr-target: - rems_dev_test-ehr-logs: - rems_dev_crd-resources-build: - rems_dev_crd-request-generator-nodeModules: - rems_dev_crd-request-generator-databaseData: - rems_dev_crd-request-generator-build: - rems_dev_crd-request-generator-logs: - rems_dev_dtr-nodeModules: - rems_dev_dtr-databaseData: - rems_dev_dtr-logs: - rems_dev_pims-logs: - rems_dev_pims-nodeModules: - rems_dev_rems-nodeModules: - rems_dev_rems-logs: - rems_dev_rems-smart-on-fhir-nodeModules: - rems_dev_rems-smart-on-fhir-logs: - - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index e505002b..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,90 +0,0 @@ -version: '3.6' -services: - keycloak: - container_name: rems_prod_keycloak - command: 'start-dev --import-realm' - ports: - - '8180:8080' - environment: - - KEYCLOAK_ADMIN=admin - - KEYCLOAK_ADMIN_PASSWORD=admin - - DB_VENDOR=h2 - volumes: - - rems_prod_keycloak-data:/opt/keycloak/data/ - image: codexrems/keycloak:REMSvCurrent - - # Create test-ehr container - test-ehr: # Name of our service - container_name: rems_prod_test-ehr - ports: # Port binding to host from docker container - - '8080:8080' # Bind port 3000 of host to 3000 of container - image: codexrems/test-ehr:REMSvCurrent - environment: - - oauth_token=http://host.docker.internal:8180/realms/ClientFhirServer/protocol/openid-connect/token - extra_hosts: - - "host.docker.internal:host-gateway" - - # Create crd request generator container - crd-request-generator: # Name of our service - image: codexrems/crd-request-generator:REMSvCurrent - container_name: rems_prod_crd-request-generator - environment: - - REACT_APP_REMS_CONFIG=true - ports: # Port binding to host from docker container - - "3000:3000" # Bind port 3000 of host to 3000 of container - - "3001:3001" - - # Create dtr container - dtr: # Name of our service - image: codexrems/dtr:REMSvCurrent - container_name: rems_prod_dtr - ports: # Port binding to host from docker container - - "3005:3005" # Bind port 3000 of host to 3000 of container - - # Create rems-smart-on-fhir container - rems-smart-on-fhir: - image: codexrems/rems-smart-on-fhir:REMSvCurrent - container_name: rems_prod_rems-smart-on-fhir - ports: - - "4040:4040" - - - # Create rems container - rems-administrator: # Name of our service - image: codexrems/rems-administrator:REMSvCurrent - container_name: rems_prod_rems - ports: # Port binding to host from docker container - - "8090:8090" - environment: - VSAC_API_KEY: ${VSAC_API_KEY} - MONGO_URL: mongodb://rems-user:pass@pims_remsadmin_mongo:27017 - - # Create pims admin container - pims_remsadmin_mongo: - image: mongo - container_name: rems_prod_pims-remsadmin-mongo - ports: - - '27017:27017' - environment: - MONGO_INITDB_ROOT_USERNAME: rems-admin-pims-root - MONGO_INITDB_ROOT_PASSWORD: rems-admin-pims-password - volumes: - - rems_prod_pims_remsadmin_mongo:/data/db - - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js - - # Create pims container - pims: - image: codexrems/pims:REMSvCurrent - container_name: rems_prod_pims - environment: - REMS_ADMIN_BASE: http://rems-administrator:8090 - MONGO_URL: mongodb://pims_remsadmin_mongo:27017/pims - ports: - - "5050:5050" - - "5051:5051" - -volumes: - rems_prod_keycloak-data: - rems_prod_pims_remsadmin_mongo: - - diff --git a/docker-sync.yml b/docker-sync.yml deleted file mode 100644 index 5ea2ce06..00000000 --- a/docker-sync.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: "2" -options: - compose-file-path: './docker-compose-dev.yml' -syncs: - rems_dev_test-ehr-sync: - src: ../test-ehr - sync_excludes: ['.gradle', 'bin', 'build', 'target', 'logs'] - - rems_dev_crd-request-generator-sync: - src: '../crd-request-generator' - sync_excludes: ['node_modules', 'build', 'databaseData', 'logs'] - - rems_dev_dtr-sync: - src: '../dtr' - sync_excludes: ['node_modules', 'databaseData', 'logs'] - - rems_dev_rems-smart-on-fhir-sync: - src: '../rems-smart-on-fhir' - sync_excludes: ['node_modules', 'logs'] - - rems_dev_rems-sync: - src: '.' - sync_excludes: ['node_modules', 'logs'] - - rems_dev_pims-sync: - src: '../pims' - sync_excludes: ['node_modules', 'logs'] \ No newline at end of file diff --git a/mongo-init.js b/mongo-init.js deleted file mode 100644 index d80aab92..00000000 --- a/mongo-init.js +++ /dev/null @@ -1,25 +0,0 @@ -// Create Databases -const dbPims = db.getSiblingDB('pims'); -const dbRemsAdmin = db.getSiblingDB('remsadmin'); -dbRemsAdmin.createUser({ user: "rems-user", - pwd: "pass", - roles: [ - { role: "readWrite", db: "remsadmin" } - ] -}) -// Create Collections -dbPims.createCollection('pims-tmp'); -dbRemsAdmin.createCollection('remsadmin-tmp'); - -// add the administrator user -const dbAdmin = db.getSiblingDB('admin'); -dbAdmin.createUser({ user: "rems-admin-pims-root", - pwd: "rems-admin-pims-password", - roles: [ - { role: "userAdminAnyDatabase", db: "admin" } - ] -}) - -// // Insert document to ensure db/collection is created -// dbPims.pimscollection.insertOne({name: 'Hello World!'}) -// dbRemsAdmin.remsadmincollection.insertOne({name: 'Hello World Again!'}) diff --git a/src/hooks/rems.hook.ts b/src/hooks/rems.hook.ts index 44953d45..883e3c87 100644 --- a/src/hooks/rems.hook.ts +++ b/src/hooks/rems.hook.ts @@ -57,7 +57,8 @@ const codeMap: { [key: string]: CardRule[] } = { type: 'smart', url: new URL(config.smart.endpoint) } - ] + ], + summary: 'Turalio REMS Patient Requirements' }, { links: [ @@ -97,7 +98,7 @@ const codeMap: { [key: string]: CardRule[] } = { url: new URL(config.smart.endpoint) } ], - summary: 'Prescriber Forms' + summary: 'Turalio REMS Prescriber Requirements' } ], '6064': [ @@ -138,7 +139,8 @@ const codeMap: { [key: string]: CardRule[] } = { type: 'smart', url: new URL(config.smart.endpoint) } - ] + ], + summary: 'iPledge/Isotretinoin REMS Patient Requirements' }, { links: [ @@ -164,7 +166,7 @@ const codeMap: { [key: string]: CardRule[] } = { url: new URL(config.smart.endpoint) } ], - summary: 'Prescriber Forms' + summary: 'iPledge/Isotretinoin REMS Provider Requirements' } ], '1237051': [ @@ -198,7 +200,8 @@ const codeMap: { [key: string]: CardRule[] } = { type: 'smart', url: new URL(config.smart.endpoint) } - ] + ], + summary: 'TIRF REMS Patient Requirements' }, { links: [ @@ -231,7 +234,7 @@ const codeMap: { [key: string]: CardRule[] } = { url: new URL(config.smart.endpoint) } ], - summary: 'Prescriber Forms' + summary: 'TIRF REMS Prescriber Requirements' } ] };