diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 2919244c..00000000 --- a/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -# See https://docs.docker.com/engine/reference/builder/#dockerignore-file -# Put files here that you don't want copied into your bundle's invocation image -.gitignore -Dockerfile.tmpl diff --git a/.env.example b/.env.example deleted file mode 100644 index 0785d4c8..00000000 --- a/.env.example +++ /dev/null @@ -1,3 +0,0 @@ -VSAC_API_KEY=#Replace_me_with_your_api_key -COMPOSE_PROJECT_NAME=pas_dev -PORTER_ALLOW_DOCKER_HOST_ACCESS=true \ No newline at end of file diff --git a/.github/workflows/automated-tests-ci.yml b/.github/workflows/automated-tests-ci.yml deleted file mode 100644 index 26572873..00000000 --- a/.github/workflows/automated-tests-ci.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Automated Tests CI - -on: - pull_request: - branches: [ dev ] - workflow_dispatch: - -jobs: - automated-tests-ci: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Set up Gradle - uses: gradle/gradle-build-action@v2 - with: - gradle-version: 6.9 - - name: Embed CDS Library - run: gradle embedCdsLibrary - - name: Test with gradle - run: gradle clean check \ No newline at end of file diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml deleted file mode 100644 index 47a9e3cc..00000000 --- a/.github/workflows/docker-cd.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Docker Image CD - -on: - push: - branches: [ dev ] - workflow_dispatch: - -jobs: - - docker-cd: - runs-on: ubuntu-latest - steps: - - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Build and push Server Docker image - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: codexrems/prior-auth:latest diff --git a/.github/workflows/docker-ci.yml b/.github/workflows/docker-ci.yml deleted file mode 100644 index cbc4e105..00000000 --- a/.github/workflows/docker-ci.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Docker Image CI - -on: - pull_request: - branches: [ dev ] - workflow_dispatch: - -jobs: - docker-ci: - runs-on: ubuntu-latest - steps: - - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Test Server Docker image Builds - run: docker build . \ No newline at end of file diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..1e8cf04d --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,27 @@ +name: Java CI with Gradle +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] +jobs: + build: + + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt-openj9' + - name: Grant execute permission for gradlew + run: chmod +x gradlew + # - name: Checkout CDSLibrary + - run: sudo chmod +x travis-setup.sh + - run: ./travis-setup.sh + - run: gradle -v + - run: java -version + - run: ls -a + - name: Build with Gradle + run: ./gradlew build diff --git a/.gitignore b/.gitignore index 28828e9f..140d6bb3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ -.cnab -.docker-sync/ -Zscaler_Root_CA.pem -.env - # Ignore Gradle project-specific cache directory .gradle @@ -18,12 +13,12 @@ CDS-Library # Ignore all log files *.log *.log.lck -logs/ # Ignore Eclipse and vscode files .project .classpath .settings/ +.vscode/ bin # Ignore Database files diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 1b5f6637..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "java", - "name": "Debug Prior Auth (Local + Docker)", // gradle bootRun -Pdebug, - "request": "attach", - "hostName": "localhost", - "port": 9016, - } - ] -} \ No newline at end of file diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md deleted file mode 100644 index aa81adf1..00000000 --- a/DockerDevSetupGuideForMacOS.md +++ /dev/null @@ -1,356 +0,0 @@ -# DRLS-PAS-Docker-The Ultimate Guide to Running DRLS PAS for Local Development - -## Purpose of this guide - -This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) PAS 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/HL7-DaVinci/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/HL7-DaVinci/dtr) -4. [Clinical Decision Support (CDS) Library](https://github.com/HL7-DaVinci/CDS-Library) -5. [CRD Request Generator](https://github.com/HL7-DaVinci/crd-request-generator) -6. [PAS](https://github.com/HL7-DaVinci/PAS.git) -7. Keycloak - -### Expected Functionality -1. File Synchronization between local host system and docker container -2. Automatic Server Reloading whenever source file is changed - - CRD and prior-auth also reload on CDS_Library changes -3. Automatic Dependendency Installation whenever package.json, package-lock.json, or build.gradle are changed -4. Automatic Data Loader in test-ehr whenever fhirResourcesToLoad directory is changed - -## Table of Contents -- [Prerequisites](#prerequisites) -- [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 PAS](#clone-drls-PAS) -- [Configure DRLS PAS](#configure-drls-PAS) - * [CRD configs](#crd-configs) - * [test-ehr configs](#test-ehr-configs) - * [crd-request-generator configs](#crd-request-generator-configs) - * [dtr configs](#dtr-configs) - * [PAS configs](#PAS-configs) - - * [Add VSAC credentials to your development environment](#add-vsac-credentials-to-your-development-environment) -- [Run DRLS PAS](#run-drls) - * [Start Docker Sync](#start-docker-sync-application) - * [Stop Docker Sync](#stop-docker-sync-application-and-remove-all-containers/volumes) - * [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 8 GB of RAM -- 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) - -Additionally, you must have credentials (api key) access for the **[Value Set Authority Center (VSAC)](https://vsac.nlm.nih.gov/)**. Later on you will add these credentials to your development environment, as they are required for allowing DRLS to pull down updates to value sets that are housed in VSAC. If you don't already have VSAC credentials, you should [create them using UMLS](https://www.nlm.nih.gov/research/umls/index.html). - -### 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 permentaly 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 on MacOS - - -#### Install Docker Desktop for Mac - -1. Download the **stable** version of **[Docker for Mac](https://www.docker.com/products/docker-desktop)** and follow the steps in the installer. -2. Once the installation is complete, you should see a Docker icon on your Mac's menu bar (top of the screen). Click the icon and verify that **Docker Desktop is running.** -3. 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 PAS 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 7 CPU Processors on MITRE issued Mac Devices.** - -#### Install Visual Studio Code and Extensions - -The recomended IDE for this set up is Visual Studio Code - -1. Install Visual Studio Code - https://code.visualstudio.com -2. Install Docker extension - https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker - -#### 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 verions - ```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 PAS - -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-prior-auth-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/HL7-DaVinci/CRD.git CRD - git clone https://github.com/HL7-DaVinci/test-ehr test-ehr - git clone https://github.com/HL7-DaVinci/crd-request-generator crd-request-generator - git clone https://github.com/HL7-DaVinci/dtr dtr - git clone https://github.com/HL7-DaVinci/prior-auth.git prior-auth - git clone https://github.com/HL7-DaVinci/prior-auth-client.git prior-auth-client - - cd /CRD/server - git clone https://github.com/HL7-DaVinci/CDS-Library.git CDS-Library - - cd /prior-auth - git clone https://github.com/HL7-DaVinci/CDS-Library.git CDS-Library - - # Optional if you have access to the private fhir-x12 converter and fhir-x12-frontend repositories - will require changing docker-compose-prior-auth-dev.yml, docker-sync.yml, and docker-compose.yml in configure steps - - git clone https://github.com/HL7-DaVinci/fhir-x12.git fhir-x12 - git clone https://github.com/HL7-DaVinci/fhir-x12-frontend.git fhir-x12-frontend - ``` - -## Open DRLS PAS as VsCode workspace - -The prior-auth repository contains the **PriorAuth.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 /prior-auth/PriorAuth.code-workspace. In this workspace configuration, the CDS-Library embedded within CRD and prior-auth are opened as seperate roots for an easier development experience. - -The Source Control Tab can be used to easily track changes during the devlopement process and perform git actions, with each root of the workspace having its own source control header. 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 eaily 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, attach a Visual Studio Code IDE to the container using remote-containers. See: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker - -## Configure DRLS PAS - -### CRD configs - -***None*** - - -### test-ehr configs - -***None*** - - -### crd-request-generator configs - -***None*** - -### dtr configs - -***None*** - -### prior-auth-client configs - -***None*** - -### prior-auth configs - -***None*** - -### fhir-x12 (optional) configs - -1. Uncomment out the section for fhir-x12 in docker-compose-prior-auth-dev.yml (service + volume), PriorAuth.code-workspace, and docker-sync.yml in the prior-auth folder - -### fhir-x12-frontend (optional) configs - -1. Uncomment out the section for fhir-x12-frontend in docker-compose-prior-auth-dev.yml (service + volume), PriorAuth.code-workspace, and docker-sync.yml in the prior-auth folder - - -### 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. 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 Mac by running `env` in your Terminal. To add to `env`: -1. Set "VSAC_API_KEY" in the .env file in the PAS 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 - -You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: -1. Set "COMPOSE_PROJECT_NAME" as "pas_dev" in the .env file in the PAS Repository - - or - -1. `cd ~/` -2. Open `.bash_profile` and add the following lines at the very bottom: - ```bash - export COMPOSE_PROJECT_NAME=pas_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 pannel of VsCode -2. From the drop down menu next to Run and Debug select **Debug All REMS Applications (Docker) (workspace)**. This is a compund 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 [ ...] -``` - -```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 imaages 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 - -### Register the test-ehr - -1. Go to http://localhost:3005/register. - - Client Id: **app-login** - - Fhir Server (iss): **http://localhost:8080/test-ehr/r4** -2. Click **Submit** - -### The fun part: Generate a test request - -1. Go to http://localhost:3000/ehr-server/reqgen. -2. Click **Patient Select** button in upper left. -3. Find **William Oster** in the list of patients and click the dropdown menu next to his name. -4. Select **E0470** in the dropdown menu. -5. Click anywhere in the row for William Oster. -6. Click **Submit** at the bottom of the page. -7. After several seconds you should receive a response in the form of two **CDS cards**: - - **Respiratory Assist Device** - - **Positive Airway Pressure Device** -8. Select **Order Form** on one of those CDS cards. -9. If you are asked for login credentials, use **alice** for username and **alice** for password. -10. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. -11. Fill out questionnaire and hit next -12. Submit PAS Request to http://localhost:9015/fhir - -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 diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md deleted file mode 100644 index da234950..00000000 --- a/DockerProdSetupGuideForMacOS.md +++ /dev/null @@ -1,258 +0,0 @@ -# DRLS-PAS-Docker-The Ultimate Guide to Running DRLS PAS locally - -## Purpose of this guide - -This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) PAS Workflow** system for Production. There are two approaches to doing this: - -Option 1 utilizes Docker Compose, which comes with Docker Dektop, and requires the corresponding docker-compose.yml file from the prior-auth repository. This option has minimal technical set up involved and allows for the customization/modification of the dockerized configuration. - -Option 2 utilizes Porter, which requires a seperate installation in addition to Docker Desktop but does not require the use of any local files. This option has the least amount of technical set up involved and is recommended for non-tecnical users of DRLS PAS as it **does not** allow for the customization/modification of the dockerized configuration. - -This document **is designed to take you through the entire set up process for DRLS PAS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS PAS 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/HL7-Davinci/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/HL7-Davinci/dtr) -4. [Clinical Decision Support (CDS) Library](https://github.com/HL7-Davinci/CDS-Library) -5. [CRD Request Generator](https://github.com/HL7-Davinci/crd-request-generator) -6. [PAS](https://github.com/HL7-Davinci/PAS.git) -7. Keycloak - -## Table of Contents -- [Prerequisites](#prerequisites) -- [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 Porter (Option 2 only)](#install-porter-(option-2-only)) -- [Clone PAS repository(Option 1 Only)](#clone-PAS-repository-(option-1-only)) -- [Configure DRLS PAS](#configure-drls-PAS) - * [Add VSAC credentials to environment (Option 1 only)](#add-vsac-credentials-to-environment-(option-1-only)) - * [Add Compose Project Name to environment (Option 1 only)](#add-compose-project-name-to-environment-(option-1-only)) -- [Run DRLS PAS](#run-drls-PAS) - * [Option 1 - Docker Compose](#option-1---docker-compose) - * [Option 2 - Porter Install](#option-2---porter-install) -- [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 8 GB of RAM -- 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) - -Additionally, you must have credentials (api key) access for the **[Value Set Authority Center (VSAC)](https://vsac.nlm.nih.gov/)**. Later on you will add these credentials to your development environment, as they are required for allowing DRLS to pull down updates to value sets that are housed in VSAC. If you don't already have VSAC credentials, you should [create them using UMLS](https://www.nlm.nih.gov/research/umls/index.html). - -### 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 permentaly 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 on MacOS - -#### Install Docker Desktop for Mac - -1. Download the **stable** version of **[Docker for Mac](https://www.docker.com/products/docker-desktop)** and follow the steps in the installer. -2. Once the installation is complete, you should see a Docker icon on your Mac's menu bar (top of the screen). Click the icon and verify that **Docker Desktop is running.** -3. Configure Docker to have access to enough resources. To do this, open Docker Desktop and select Settings > Resources. - - The defaults for memory at 2GB and possibly CPU as well are too low to run the entire DRLS PAS 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 16GB memory and 6 CPU Processors on MITRE issued Mac Devices. - -#### Install Visual Studio Code and Extensions (Option 1 Only) - -The recomended IDE for this set up is Visual Studio Code - -1. Install Visual Studio Code - https://code.visualstudio.com -2. Install Docker extension - https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker - -#### Install Porter (Option 2 Only) - -1. Download and install porter as per https://porter.sh/install/ instructions: - ```bash - curl -L https://cdn.porter.sh/latest/install-mac.sh | bash - ``` -2. Open `.bash_profile` and add the following lines at the very bottom: - ```bash - export PATH=$PATH:~/.porter - ``` -3. Save `.bash_profile` and complete the update to `env`: - ```bash - source .bash_profile - ``` -4. Install required Porter plugins - ```bash - porter mixins install docker - porter mixins install docker-compose - ``` - - Note: The exact command to add to your system path will be mentioned at the bottom of the execution of step 1 and may vary from what's above depending the operating system you installed Porter on. Consult the output in your terminal for how to set your system path. - - 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. - -## Clone PAS repository (Option 1 Only) - -1. clone the PAS repositories from Github: - ```bash - git clone https://github.com/HL7-Davinci/prior-auth.git prior-auth - ``` - - Alternatively, you can download/copy just the docker-compose.yml file from the PAS reposiotry since that is the only file needed for this set up. - -## Open prior-auth in VSCode (Option 1 Only) - -The Docker Extension for VsCode has useful functionality to aid in the development process using this set up guide. This extension lets you eaily 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. See: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker - -## Configure DRLS PAS - -### Add VSAC credentials to environment (Option 1 only) - -> 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. 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 Mac by running `env` in your Terminal. To add to `env`: -1. Set "VSAC_API_KEY" in the .env file in the PAS 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 environment (Option 1 only) - -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 reccomended to change the compose project name for each so that they differ. - -You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: -1. Set "COMPOSE_PROJECT_NAME" as "pas_prod" in the .env file in the PAS Repository - - or - -1. `cd ~/` -2. Open `.bash_profile` and add the following lines at the very bottom: - ```bash - export COMPOSE_PROJECT_NAME=pas_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 and System Path](#setting-environment-variables-and-system-path) for more information. - -## Run DRLS PAS -### Option 1 - Docker Compose -#### Start docker compose application - -```bash - cd prior-auth # Need to execute commands in directory with corresponding docker-compose.yml file located in the PAS repository - docker-compose up -``` - -#### Stop docker-compose application -```bash - docker-compose down # Removes application servers - - docker volume prune # Optional - Removes persisted data -``` -#### 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 -``` - -### Option 2 - Porter Install -#### Install and Run Porter application - -You can set the flag --allow-docker-host-access in the below commands with the PORTER_ALLOW_DOCKER_HOST_ACCESS environment variable so that you don’t have to specify it for every command. - -```bash - porter install fullstack_drls_pas --allow-docker-host-access --reference smalho01234/fullstack_drls_pas:latest # Initial Installation needs to be from remote repository - - or - - porter install fullstack_drls_pas --allow-docker-host-access # Subsequent runs can use the local installation - -``` -Note: The project will keep running in the background when you "ctrl + c" out of the above process. To stop running all together, use the stop command below - -#### Stop Running Porter application and Uninstall -```bash - porter invoke fullstack_drls_pas --action stop --allow-docker-host-access -``` -#### Updating Porter application - -```bash - porter upgrade fullstack_drls_pas --allow-docker-host-access # Pull and Update application images and recreate containers - - or - - porter upgrade fullstack_drls_pas --allow-docker-host-access --reference smalho01234/fullstack_drls_pas:latest # Pull and Update Invocation Image in addition to applicaion images from remote repository and recreate containers -``` - - -## Verify DRLS is working - -### Register the test-ehr - -1. Go to http://localhost:3005/register. - - Client Id: **app-login** - - Fhir Server (iss): **http://localhost:8080/test-ehr/r4** -2. Click **Submit** - - -### The fun part: Generate a test request - -1. Go to http://localhost:3000 -2. Click **Patient Select** button in upper left. -3. Find **William Oster** in the list of patients and click the dropdown menu next to his name. -4. Select **E0470** in the dropdown menu. -5. Click anywhere in the row for William Oster. -6. Click **Submit** at the bottom of the page. -7. After several seconds you should receive a response in the form of two **CDS cards**: - - **Respiratory Assist Device** - - **Positive Airway Pressure Device** -8. Select **Order Form** on one of those CDS cards. -9. If you are asked for login credentials, use **alice** for username and **alice** for password. -10. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. -11. Fill out questionnaire and hit next -12. Submit PAS Request to http://localhost:9015/fhir - -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 diff --git a/Dockerfile b/Dockerfile index f7458ff5..753917d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,9 @@ -# Base image FROM gradle:6.9.0-jdk11 -# Set working directory so that all subsequent command runs in this folder -WORKDIR /prior-auth -# Copy app files to container -COPY --chown=gradle:gradle . . -# Embed CDS Library -RUN gradle embedCdsLibrary +EXPOSE 9000/tcp +COPY --chown=gradle:gradle . /prior-auth/ +RUN apt-get update +RUN apt-get install -y git +WORKDIR /prior-auth/ +RUN git clone https://github.com/HL7-DaVinci/CDS-Library.git RUN gradle installBootDist -# Expose port to access the app -EXPOSE 9015 -# Command to run our app -CMD gradle bootRun \ No newline at end of file +CMD ["gradle", "bootRun"] diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index 3c83922a..00000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,14 +0,0 @@ -# Base image -FROM gradle:6.9.0-jdk11 -# Set working directory so that all subsequent command runs in this folder -WORKDIR /prior-auth -# Copy app files to container -COPY --chown=gradle:gradle . . -# Embed CDS Library -# RUN gradle embedCdsLibrary -RUN gradle installBootDist -# Expose port to access the app -EXPOSE 9015 -EXPOSE 9016 -# Command to run our app -CMD ./dockerRunnerDev.sh \ No newline at end of file diff --git a/Dockerfile.mitre b/Dockerfile.mitre new file mode 100644 index 00000000..ee989828 --- /dev/null +++ b/Dockerfile.mitre @@ -0,0 +1,10 @@ +FROM gradle:6.9.0-jdk11 +EXPOSE 9000/tcp +COPY --chown=gradle:gradle . /prior-auth/ +RUN keytool -import -alias mitre_ba_root -file "/prior-auth/MITRE BA Root.crt" \ + -keystore "$JAVA_HOME/lib/security/cacerts" -storepass changeit -noprompt -trustcacerts +RUN keytool -import -alias mitre_ba_npe_ca3 -file "/prior-auth/MITRE BA NPE CA-3.crt" \ + -keystore "$JAVA_HOME/lib/security/cacerts" -storepass changeit -noprompt -trustcacerts +WORKDIR /prior-auth/ +RUN gradle installBootDist +CMD ["gradle", "bootRun", "--args='debug'"] \ No newline at end of file diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl deleted file mode 100644 index 165109f77..00000000 --- a/Dockerfile.tmpl +++ /dev/null @@ -1,42 +0,0 @@ -# Docker file specifying MITRE SSL certificates for a Full Stack CNAB invocation image -FROM ubuntu:latest - -ARG BUNDLE_DIR -ARG DEBIAN_FRONTEND=noninteractive -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y ca-certificates && apt-get install -y curl - -RUN curl http://pki.mitre.org/MITRE%20BA%20ROOT.crt >> /etc/ssl/certs/ca-certificates.crt && \ - curl http://pki.mitre.org/MITRE%20BA%20NPE%20CA-3.crt >> /etc/ssl/certs/ca-certificates.crt && \ - curl http://pki.mitre.org/MITRE%20BA%20NPE%20CA-4.crt >> /etc/ssl/certs/ca-certificates.crt && \ - update-ca-certificates - -WORKDIR /pki -COPY Zscaler_Root_CA.pem . -RUN cat Zscaler_Root_CA.pem >> /etc/ssl/certs/ca-certificates.crt - - - -# Install Git from Source to get around TLS errors with Zscaler, -# explicitly using openssl instead of gnutls -# RUN cp /etc/apt/sources.list /etc/apt/sources.list~ -RUN sed -i -- 's/# deb-src/deb-src/' /etc/apt/sources.list -RUN apt-get update && \ - apt-get install build-essential fakeroot dpkg-dev -y && \ - apt-get install git-man -y && \ - apt-get -f build-dep git -y && \ - apt-get install libcurl4-openssl-dev -y - -WORKDIR /sourcegit - -RUN apt-get source git && \ - cd git-2.*.*/ && \ - sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control && \ - sed -i -- '/TEST\s*=\s*test/d' ./debian/rules && \ - dpkg-buildpackage -rfakeroot -b -uc -us && \ - dpkg -i ../git_*ubuntu*.deb - -COPY ./.cnab/app/porter.yaml ${BUNDLE_DIR}/porter.yaml -COPY ./docker-compose-porter.yml ${BUNDLE_DIR} -COPY ./.env ${BUNDLE_DIR} diff --git a/PriorAuth.code-workspace b/PriorAuth.code-workspace deleted file mode 100644 index f3fc018d..00000000 --- a/PriorAuth.code-workspace +++ /dev/null @@ -1,133 +0,0 @@ -{ - "folders": [ - { - "path": "../test-ehr" - }, - { - "name": "CRD-CDS-Library", - "path": "../CRD/server/CDS-Library" - }, - { - "path": "../CRD" - }, - { - "path": "../crd-request-generator" - }, - { - "path": "../dtr" - }, - { - "name": "PriorAuth-CDS-Library", - "path": "CDS-Library" - }, - { - "path": "." - }, - { - "path": "../prior-auth-client" - }, - { - "path": "../fhir-x12" - }, - { - "path": "../fhir-x12-frontend" - } - ], - "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 DRLS PAS Applications (Attach Docker)", - "stopAll": true, - "preLaunchTask": "Launch Chrome in Debug Mode", - "configurations": [ - "Debug CRD (Local + Docker)", - "Debug DTR Backend (Docker)", - "Debug Test-EHR (Local + Docker)", - "Debug DTR Frontend (Attach Local + Docker)", - "Debug CRD-Request-Generator (Attach Docker)", - "Debug Prior Auth (Local + Docker)", - "Debug Prior Auth Client (Local + Docker)", - // "Debug FHIR-X12 Backend (Docker)", - // "Debug FHIR-X12 Frontend (Attach 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:3015 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:3015 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:3015 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/README.md b/README.md index 941e5cbc..f93bb6f2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Prior Authorization Reference Implementation The Da Vinci Prior Authorization Reference Implementation (RI) is a software project that conforms to the [Prior Authorization Implementation Guide (IG)](https://build.fhir.org/ig/HL7/davinci-pas/index.html) and the [Prior Authorization IG Proposal](http://wiki.hl7.org/index.php?title=Da_Vinci_Prior_Authorization_FHIR_IG_Proposal) developed by the [Da Vinci Project](http://www.hl7.org/about/davinci/index.cfm?ref=common) within the [HL7 Standards Organization](http://www.hl7.org/). - - ## Requirements @@ -27,10 +25,10 @@ To run the microservice in debug mode (which enables debug log statements, an en Access the microservice: ``` -curl http://localhost:9015/fhir/metadata -curl http://localhost:9015/fhir/Bundle -curl http://localhost:9015/fhir/Claim -curl http://localhost:9015/fhir/ClaimResponse +curl http://localhost:9000/fhir/metadata +curl http://localhost:9000/fhir/Bundle +curl http://localhost:9000/fhir/Claim +curl http://localhost:9000/fhir/ClaimResponse ``` Submit a prior authorization request: @@ -39,18 +37,9 @@ Submit a prior authorization request: curl -X POST -H "Content-Type: application/json" -d @src/test/resources/bundle-prior-auth.json - http://localhost:9015/fhir/Claim/\$submit + http://localhost:9000/fhir/Claim/\$submit ``` -## End-To-End DRLS PAS Docker configuration: - -You can find complete end-to-end fullstack set up guides for DRLS PAS at the following links: - -[Developer Environment Set Up](DockerDevSetupGuideForMacOS.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS PAS project. This guide follows a much more technical set up process. - -[Production Environement Set Up](DockerProdSetupGuideForMacOS.md) - Follow this guide if you are not a developer and do not intend on making code changes to the DRLS PAS project. This guide covers two options for running DRLS PAS, both of which are less techincal than the developer set up. - - ## Configuration Notes The server on the `dev` branch is always configured to run on Logicahealth. If you are running locally or on another cloud server there are a few extra configuration steps: @@ -61,7 +50,7 @@ The server on the `dev` branch is always configured to run on Logicahealth. If y ## FHIR Services -The service endpoints in the table below are relative to `http://localhost:9015/fhir`. `patient` is the first `identifier.value` on the `Patient` referenced in the submitted `Claim`. +The service endpoints in the table below are relative to `http://localhost:9000/fhir`. `patient` is the first `identifier.value` on the `Patient` referenced in the submitted `Claim`. | Service | Methods | Description | | ----------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -90,7 +79,7 @@ The service endpoints in the table below are relative to `http://localhost:9015/ > _Note About DELETE_: A DELETE by `id` to one resource (i.e. `Bundle`, `Claim`, `ClaimResponse`) is a _Cascading Delete_ and it will delete all associated and related resources. -If debug mode is enabled the following endpoints are available for use at `http://localhost:9015/fhir`: +If debug mode is enabled the following endpoints are available for use at `http://localhost:9000/fhir`: | Service | Methods | Description | | --------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -299,7 +288,7 @@ To use WebSocket subscriptions the client must submit a Subscription as well as 1. Start the Prior Auth service 2. Submit a Claim to `/Claim/$submit` 3. Subscribe to a pended or partial ClaimResponse by submitting a WebSocket subscription to `/Subscription`. The response to this submission will contain the logical id of the Subscription used in step 5 -4. The client should connect to the WebSocket `ws://{BASE}/fhir/connect` and subscribe to `/private/notification`. For localhost the `{BASE}` is `localhost:9015`. To connect to the RI on LogicaHealth use `wss://davinci-prior-auth.logicahealth.org/fhir/connect`. +4. The client should connect to the WebSocket `ws://{BASE}/fhir/connect` and subscribe to `/private/notification`. For localhost the `{BASE}` is `localhost:9000`. To connect to the RI on LogicaHealth use `wss://davinci-prior-auth.logicahealth.org/fhir/connect`. 5. The client then binds the Subscription id by sending the message `bind: id` (using the logical id of the Subscription) to `/subscribe` over the WebSocket 6. If the id is bound successfully the client receives the message `bound: id` over `{BASE}/fhir/private/notification` 7. When an update is ready the Prior Auth service will send the message `ping: id` over `{BASE}/fhir/private/notification` @@ -348,7 +337,7 @@ docker build -t hspc/davinci-prior-auth:latest . Run the docker image: ``` -docker run -p 9015:9015 -it --rm --name davinci-prior-auth hspc/davinci-prior-auth:latest +docker run -p 9000:9000 -it --rm --name davinci-prior-auth hspc/davinci-prior-auth:latest ``` If you are building the docker image locally from a MITRE machine you must copy over the BA Certificates to the Docker image. Download the `MITRE BA NPE CA-3` and `MITRE BA ROOT` certs from the [MII](http://www2.mitre.org/tech/mii/pki/). Copy the two files to the root directory of this project. @@ -357,7 +346,7 @@ Build and run using: ``` docker build -f Dockerfile.mitre -t mitre/davinci-prior-auth . -docker run -p 9015:9015 -it --rm --name davinci-prior-auth mitre/davinci-prior-auth +docker run -p 9000:9000 -it --rm --name davinci-prior-auth mitre/davinci-prior-auth ``` ## Questions and Contributions diff --git a/build.gradle b/build.gradle index 3d212f74..f622bef8 100644 --- a/build.gradle +++ b/build.gradle @@ -10,28 +10,15 @@ buildscript { } plugins { - id 'java' - id 'application' - id 'eclipse' - id 'jacoco' + id 'java' + id 'application' + id 'eclipse' + id 'jacoco' } apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' -processResources { - from ('CDS-Library') { - into 'CDS-Library' - } -} - -bootRun { - if (project.hasProperty('debug')) { - jvmArgs=["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:9016"] - } - -} - repositories { mavenLocal() maven { @@ -40,10 +27,10 @@ repositories { maven { url = uri('https://repo.maven.apache.org/maven2/') - }} + } +} dependencies { - developmentOnly("org.springframework.boot:spring-boot-devtools") implementation 'org.springframework.boot:spring-boot-starter-websocket' implementation 'org.webjars:webjars-locator-core' implementation 'org.webjars:sockjs-client:1.1.2' @@ -83,60 +70,6 @@ dependencies { testImplementation 'com.phloc:phloc-commons:4.6.7' } -task embedCdsLibrary() { - doFirst { - exec { - workingDir './' - commandLine 'rm', '-rf', 'CDS-Library' - } - } - - doLast { - if (project.hasProperty('branch')) { - cloneCdsLibraryScript(branch) - } else { - cloneCdsLibraryScript('master') - } - } -} - -task updateCdsLibrary() { - doLast { - if (project.hasProperty('branch')) { - checkoutCdsLibraryScript(branch) - pullCdsLibraryScript() - } else { - pullCdsLibraryScript() - } - } -} - -void cloneCdsLibraryScript(branch) { - println "GIT: clone CDS-Library branch " + branch - exec { - workingDir './' - commandLine 'git', 'clone', 'https://github.com/HL7-DaVinci/CDS-Library.git', 'CDS-Library' - } - checkoutCdsLibraryScript(branch) -} - -void pullCdsLibraryScript() { - println "GIT: pull latest CDS-Library" - exec { - workingDir './CDS-Library' - commandLine 'git', 'pull' - } -} - -void checkoutCdsLibraryScript(branch) { - println "GIT: checkout CDS-Library branch " + branch - exec { - workingDir './CDS-Library' - commandLine 'git', 'checkout', branch - } -} - - jacocoTestReport { reports { xml.enabled true diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml deleted file mode 100644 index af79e492..00000000 --- a/docker-compose-dev.yml +++ /dev/null @@ -1,179 +0,0 @@ -version: '3.6' -services: - keycloak: - container_name: keycloak - # command: ["-Djboss.http.port=8180"] - ports: - - '8180:8080' - environment: - - KEYCLOAK_USER=admin - - KEYCLOAK_PASSWORD=admin - - DB_VENDOR=h2 - - KEYCLOAK_IMPORT=/resources/ClientFhirServerRealm.json - volumes: - - keycloak-data:/opt/jboss/keycloak/standalone/data/ - - '../test-ehr/src/main/resources/ClientFhirServerRealm.json:/resources/ClientFhirServerRealm.json' - image: hkong2/keycloak - - # Create crd container - test-ehr: # Name of our service - container_name: pas_dev_test-ehr - ports: # Port binding to host from docker container - - '8080:8080' # Bind port 3000 of host to 3000 of container - - "8081:8081" - environment: - - DOCKER_PROFILE=true - build: - context: ../test-ehr - dockerfile: Dockerfile.dev - volumes: - - pas_dev_test-ehr-sync:/test-ehr:nocopy # nocopy is important - - pas_dev_test-ehr-gradle:/test-ehr/.gradle - - pas_dev_test-ehr-build:/test-ehr/build - - pas_dev_test-ehr-target:/test-ehr/target - - pas_dev_test-ehr-logs:/test-ehr/logs - - - # Create crd container - crd: # Name of our service - build: - context: ../CRD - dockerfile: Dockerfile.dev - container_name: pas_dev_crd - ports: # Port binding to host from docker container - - "8090:8090" # Bind port 3000 of host to 3000 of container - - "8091:8091" - environment: - VSAC_API_KEY: ${VSAC_API_KEY} - volumes: - - pas_dev_crd-sync:/CRD:nocopy # nocopy is important - - pas_dev_crd-logs:/CRD/logs - - pas_dev_crd-gradle:/CRD/.gradle - - pas_dev_crd-server-gradle:/CRD/server/.gradle - - pas_dev_crd-server-build:/CRD/server/build - - pas_dev_crd-server-ValueSetCache:/CRD/server/ValueSetCache - - pas_dev_crd-operations-build:/CRD/operations/build - - pas_dev_crd-resources-build:/CRD/resources/build - - # Create crd container - crd-request-generator: # Name of our service - build: - context: ../crd-request-generator - dockerfile: Dockerfile.dev - container_name: pas_dev_crd-request-generator - ports: # Port binding to host from docker container - - "3000:3000" # Bind port 3000 of host to 3000 of container - - "3001:3001" - volumes: - - pas_dev_crd-request-generator-sync:/home/node/app/crd-request-generator:nocopy # nocopy is important - - pas_dev_crd-request-generator-node-modules:/home/node/app/crd-request-generator/node_modules - - pas_dev_crd-request-generator-databaseData:/home/node/app/crd-request-generator/databaseData - - pas_dev_crd-request-generator-build:/home/node/app/crd-request-generator/build - - pas_dev_crd-request-generator-logs:/home/node/app/crd-request-generator/logs - - - # Create crd container - dtr: # Name of our service - build: - context: ../dtr - dockerfile: Dockerfile.dev - container_name: pas_dev_dtr - ports: # Port binding to host from docker container - - "3005:3005" # Bind port 3000 of host to 3000 of container - - "3006:3006" - volumes: - - pas_dev_dtr-sync:/home/node/app/dtr:nocopy # nocopy is important - - pas_dev_dtr-node-modules:/home/node/app/dtr/node_modules - - pas_dev_dtr-databaseData:/home/node/app/dtr/databaseData - - pas_dev_dtr-logs:/home/node/app/dtr/logs - - # # Create fhir-x12 converter container - # fhir-x12: # Name of our service - # build: - # context: ../fhir-x12 - # dockerfile: Dockerfile.dev - # container_name: pas_dev_fhir-x12 - # ports: # Port binding to host from docker container - # - "8085:8085" # Bind port 3000 of host to 3000 of container - # - "8086:8086" - # volumes: - # - pas_dev_fhir-x12-sync:/usr/src/app/fhir-x12:nocopy # nocopy is important - # - /usr/src/app/fhir-x12/node_modules - # - /usr/src/app/fhir-x12/build - # - /usr/src/app/fhir-x12/databaseData - # - /usr/src/app/fhir-x12/logs - # environment: - # PORT: 8085 - # ADMIN_TOKEN: fhir-x12-secret - - - # # Create frontend fhir-x12 frontend converter container - # fhir-x12-frontend: # Name of our service - # build: - # context: ../fhir-x12-frontend - # dockerfile: Dockerfile.dev - # container_name: pas_dev_fhir-x12-frontend - # ports: # Port binding to host from docker container - # - "3015:3015" # Bind port 3000 of host to 3000 of container - # volumes: - # - pas_dev_fhir-x12-frontend-sync:/usr/src/app/fhir-x12-frontend:nocopy # nocopy is important - # - /usr/src/app/fhir-x12-frontend/node_modules - # - /usr/src/app/fhir-x12-frontend/build - # - /usr/src/app/fhir-x12-frontend/logs - # environment: - # PORT: 3015 - # ADMIN_TOKEN: fhir-x12-secret - # BACKEND_URL: http://localhost:8085/ - - # Create crd container - prior-auth: # Name of our service - build: - context: '.' - dockerfile: Dockerfile.dev - container_name: pas_dev_prior-auth - environment: - - TOKEN_BASE_URI=http://localhost:9015 - ports: # Port binding to host from docker container - - "9015:9015" # Bind port 3000 of host to 3000 of container - - "9016:9016" - volumes: - - pas_dev_prior-auth-sync:/prior-auth:nocopy # nocopy is important - - /prior-auth/.gradle - - /prior-auth/databaseData - - /prior-auth/build - - /prior-auth/logs - - # Create crd container - prior-auth-client: # Name of our service - build: - context: '../prior-auth-client' - dockerfile: Dockerfile.dev - container_name: pas_dev_prior-auth-client - ports: # Port binding to host from docker container - - "9090:9090" # Bind port 3000 of host to 3000 of container - - "9091:9091" - volumes: - - pas_dev_prior-auth-sync:/prior-auth:nocopy # nocopy is important - - /prior-auth-client/.gradle - - /prior-auth-client/build - - /prior-auth-client/logs - - -volumes: - keycloak-data: - pas_dev_test-ehr-sync: - external: true - pas_dev_crd-sync: - external: true - pas_dev_crd-request-generator-sync: - external: true - pas_dev_dtr-sync: - external: true - pas_dev_prior-auth-sync: - external: true - pas_dev_prior-auth-client-sync: - external: true - # pas_dev_fhir-x12-sync: - # external: true - # pas_dev_fhir-x12-frontend-sync: - # external: true \ No newline at end of file diff --git a/docker-compose-porter.yml b/docker-compose-porter.yml deleted file mode 100644 index 136ef75b..00000000 --- a/docker-compose-porter.yml +++ /dev/null @@ -1,111 +0,0 @@ -version: '3.6' -services: - keycloak: - container_name: pas_porter_keycloak - # command: ["-Djboss.http.port=8180"] - ports: - - '8180:8080' - environment: - - KEYCLOAK_USER=admin - - KEYCLOAK_PASSWORD=admin - - DB_VENDOR=h2 - - KEYCLOAK_IMPORT=/resources/ClientFhirServerRealm.json - volumes: - - keycloak-data:/opt/jboss/keycloak/standalone/data/ - image: smalho01234/keycloak - - - # Create crd container - test-ehr: # Name of our service - container_name: pas_porter_test-ehr - environment: - - DOCKER_PROFILE=true - ports: # Port binding to host from docker container - - '8080:8080' # Bind port 3000 of host to 3000 of container - image: smalho01234/test-ehr - - # Create crd container - crd: # Name of our service - image: smalho01234/crd - container_name: pas_porter_crd - ports: # Port binding to host from docker container - - "8090:8090" # Bind port 3000 of host to 3000 of container - environment: - VSAC_API_KEY: ${VSAC_API_KEY} - volumes: - - crd-value-set-data:/CRD/server/ValueSetCache - - - - # Create crd container - crd-request-generator: # Name of our service - image: smalho01234/crd-request-generator - container_name: pas_porter_crd-request-generator - ports: # Port binding to host from docker container - - "3000:3000" # Bind port 3000 of host to 3000 of container - - "3001:3001" - volumes: - - crd-request-generator-data:/home/node/app/databaseData - - # Create crd container - dtr: # Name of our service - image: smalho01234/dtr - container_name: pas_porter_dtr - ports: # Port binding to host from docker container - - "3005:3005" # Bind port 3000 of host to 3000 of container - volumes: - - dtr-data:/home/node/app/databaseData - - # Create crd container - prior-auth: # Name of our service - image: smalho01234/prior-auth - environment: - - TOKEN_BASE_URI=http://localhost:9015 - container_name: pas_porter_prior-auth - ports: # Port binding to host from docker container - - "9015:9015" # Bind port 3000 of host to 3000 of container - volumes: - - prior-auth-data:/prior-auth/databaseData - - - prior-auth-client: # Name of our service - image: smalho01234/prior-auth-client - container_name: pas_porter_prior-auth-client - ports: # Port binding to host from docker container - - "9090:9090" # Bind port 3000 of host to 3000 of container - - - # Create fhir-x12 converter container - fhir-x12: # Name of our service - image: smalho01234/fhir-x12 - container_name: pas_porter_fhir-x12 - ports: # Port binding to host from docker container - - "8085:8085" # Bind port 3000 of host to 3000 of container - environment: - PORT: 8085 - ADMIN_TOKEN: fhir-x12-secret - volumes: - - fhir-x12-data:/usr/src/app/fhir-x12/databaseData - - - - # Create frontend fhir-x12 frontend converter container - fhir-x12-frontend: # Name of our service - image: smalho01234/fhir-x12-frontend - container_name: pas_porter_fhir-x12-frontend - ports: # Port binding to host from docker container - - "3015:3015" # Bind port 3000 of host to 3000 of container - environment: - PORT: 3015 - ADMIN_TOKEN: fhir-x12-secret - BACKEND_URL: http://localhost:8085/ - -volumes: - keycloak-data: - crd-value-set-data: - crd-request-generator-data: - dtr-data: - prior-auth-data: - fhir-x12-data: - - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index fdbcece3..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,111 +0,0 @@ -version: '3.6' -services: - keycloak: - container_name: pas_prod_keycloak - # command: ["-Djboss.http.port=8180"] - ports: - - '8180:8080' - environment: - - KEYCLOAK_USER=admin - - KEYCLOAK_PASSWORD=admin - - DB_VENDOR=h2 - - KEYCLOAK_IMPORT=/resources/ClientFhirServerRealm.json - volumes: - - keycloak-data:/opt/jboss/keycloak/standalone/data/ - image: smalho01234/keycloak - - - # Create crd container - test-ehr: # Name of our service - container_name: pas_prod_test-ehr - environment: - - DOCKER_PROFILE=true - ports: # Port binding to host from docker container - - '8080:8080' # Bind port 3000 of host to 3000 of container - image: smalho01234/test-ehr - - # Create crd container - crd: # Name of our service - image: smalho01234/crd - container_name: pas_prod_crd - ports: # Port binding to host from docker container - - "8090:8090" # Bind port 3000 of host to 3000 of container - environment: - VSAC_API_KEY: ${VSAC_API_KEY} - volumes: - - crd-value-set-data:/CRD/server/ValueSetCache - - - - # Create crd container - crd-request-generator: # Name of our service - image: smalho01234/crd-request-generator - container_name: pas_prod_crd-request-generator - ports: # Port binding to host from docker containerdockerß - - "3000:3000" # Bind port 3000 of host to 3000 of container - - "3001:3001" - volumes: - - crd-request-generator-data:/home/node/app/databaseData - - # Create crd container - dtr: # Name of our service - image: smalho01234/dtr - container_name: pas_prod_dtr - ports: # Port binding to host from docker container - - "3005:3005" # Bind port 3000 of host to 3000 of container - volumes: - - dtr-data:/home/node/app/databaseData - - # Create crd container - prior-auth: # Name of our service - image: smalho01234/prior-auth - container_name: pas_prod_prior-auth - environment: - - TOKEN_BASE_URI=http://localhost:9015 - ports: # Port binding to host from docker container - - "9015:9015" # Bind port 3000 of host to 3000 of container - volumes: - - prior-auth-data:/prior-auth/databaseData - - - prior-auth-client: # Name of our service - image: smalho01234/prior-auth-client - container_name: pas_prod_prior-auth-client - ports: # Port binding to host from docker container - - "9090:9090" # Bind port 3000 of host to 3000 of container - - - # Create fhir-x12 converter container - fhir-x12: # Name of our service - image: smalho01234/fhir-x12 - container_name: pas_prod_fhir-x12 - ports: # Port binding to host from docker container - - "8085:8085" # Bind port 3000 of host to 3000 of container - environment: - PORT: 8085 - ADMIN_TOKEN: fhir-x12-secret - volumes: - - fhir-x12-data:/usr/src/app/fhir-x12/databaseData - - - - # Create frontend fhir-x12 frontend converter container - fhir-x12-frontend: # Name of our service - image: smalho01234/fhir-x12-frontend - container_name: pas_prod_fhir-x12-frontend - ports: # Port binding to host from docker container - - "3015:3015" # Bind port 3000 of host to 3000 of container - environment: - PORT: 3015 - ADMIN_TOKEN: fhir-x12-secret - BACKEND_URL: http://localhost:8085/ - -volumes: - keycloak-data: - crd-value-set-data: - crd-request-generator-data: - dtr-data: - prior-auth-data: - fhir-x12-data: - - diff --git a/docker-sync.yml b/docker-sync.yml deleted file mode 100644 index 9f93c6f1..00000000 --- a/docker-sync.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: "2" -options: - compose-file-path: './docker-compose-dev.yml' -syncs: - pas_dev_test-ehr-sync: - src: ../test-ehr - sync_excludes: ['.gradle', 'build', 'target', 'logs'] - - pas_dev_crd-sync: - src: '../CRD' - sync_excludes: ['.gradle', 'server/.gradle', 'logs', 'server/build', 'server/ValueSetCache', 'resources/build', 'operations/build'] - - pas_dev_crd-request-generator-sync: - src: '../crd-request-generator' - sync_excludes: ['node_modules', 'build', 'databaseData', 'logs'] - - pas_dev_dtr-sync: - src: '../dtr' - sync_excludes: ['node_modules', 'databaseData', 'logs'] - - pas_dev_prior-auth-sync: - src: '.' - sync_excludes: ['.gradle', 'build', 'logs', 'databaseData'] - - pas_dev_prior-auth-client-sync: - src: '../prior-auth-client' - sync_excludes: ['.gradle', 'build', 'logs'] - - # pas_dev_fhir-x12-sync: - # src: '../fhir-x12' - # sync_excludes: ['node_modules', 'databaseData', 'build', 'logs'] - - # pas_dev_fhir-x12-frontend-sync: - # src: '../fhir-x12-frontend' - # sync_excludes: ['node_modules', "build", "logs"] \ No newline at end of file diff --git a/dockerRunnerDev.sh b/dockerRunnerDev.sh deleted file mode 100755 index 5b17a28b..00000000 --- a/dockerRunnerDev.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Handle closing application on signal interrupt (ctrl + c) -trap 'kill $CONTINUOUS_BUILD_PID $SERVER_PID; gradle --stop; exit' INT - -export TOKEN_BASE_URI=http://localhost:9015 - -mkdir logs -# Reset log file content for new application boot -echo "*** Logs for 'gradle installBootDist --continuous' ***" > ./logs/builder.log -echo "*** Logs for 'gradle bootRun' ***" > ./logs/runner.log - -# Print that the application is starting in watch mode -echo "starting application in watch mode..." - -# Start the continious build listener process -echo "starting continuous build listener..." -gradle installBootDist --continuous 2>&1 | tee ./logs/builder.log & CONTINUOUS_BUILD_PID=$! - -# Start server process once initial build finishes -( while ! grep -m1 'BUILD SUCCESSFUL' < ./logs/builder.log; do - sleep 1 -done -echo "starting application server in debug mode..." -gradle bootRun -Pdebug --args='debug' 2>&1 | tee ./logs/runner.log ) & SERVER_PID=$! - -# Handle application background process exiting -wait $CONTINUOUS_BUILD_PID $SERVER_PID -EXIT_CODE=$? -echo "application exited with exit code $EXIT_CODE..." - - diff --git a/porter.yaml b/porter.yaml deleted file mode 100644 index e1e83eec..00000000 --- a/porter.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: fullstack_drls_pas -version: 0.0.1 -description: Fullstack DRLS Prior Authorization Workflow -registry: smalho01234 - -dockerfile: Dockerfile.tmpl - - -required: - - docker - -mixins: - - docker - - docker-compose - -build: - - docker: - description: "Docker build" - outputs: - - name: invocationImage - -install: - - docker-compose: - description: docker-compose up - arguments: - - -f - - docker-compose-porter.yml - - up - - -upgrade: - - docker-compose: - description: docker-compose pull - arguments: - - -f - - docker-compose-porter.yml - - pull - - docker-compose: - description: docker-compose build - arguments: - - -f - - docker-compose-porter.yml - - build - - --pull - - --no-cache - - docker-compose: - description: docker-compose up - arguments: - - -f - - docker-compose-porter.yml - - up - - --force-recreate - -ps: - - docker-compose: - description: Docker Compose ps - arguments: - - -f - - docker-compose-porter.yml - - ps - -uninstall: - - docker-compose: - description: Docker Compose down - arguments: - - -f - - docker-compose-porter.yml - - down - - --remove-orphans - -customActions: -stop: - - docker-compose: - description: Stop Running Application Images - arguments: - - -f - - docker-compose-porter.yml - - stop \ No newline at end of file diff --git a/setup-images/ClosingLaunchChromeTask.png b/setup-images/ClosingLaunchChromeTask.png deleted file mode 100644 index ce0cb60b..00000000 Binary files a/setup-images/ClosingLaunchChromeTask.png and /dev/null differ diff --git a/src/main/java/org/hl7/davinci/priorauth/App.java b/src/main/java/org/hl7/davinci/priorauth/App.java index 1af6379b..12107289 100644 --- a/src/main/java/org/hl7/davinci/priorauth/App.java +++ b/src/main/java/org/hl7/davinci/priorauth/App.java @@ -44,12 +44,13 @@ public static void main(String[] args) { (System.getenv("debug") != null && System.getenv("debug").equalsIgnoreCase("true"))) { debugMode = true; } + // Set the DB initializeAppDB(); + // Assemble the microservice SpringApplication server = new SpringApplication(App.class); - server.run(args); - + server.run(); } public static void initializeAppDB() { diff --git a/src/main/java/org/hl7/davinci/priorauth/Database.java b/src/main/java/org/hl7/davinci/priorauth/Database.java index 5aae74ef..acd01a87 100644 --- a/src/main/java/org/hl7/davinci/priorauth/Database.java +++ b/src/main/java/org/hl7/davinci/priorauth/Database.java @@ -60,7 +60,7 @@ public String value() { // (so that we don't lose everything between a connection closing and the next // being opened) private static final String JDBC_TYPE = "jdbc:h2:"; - private static final String JDBC_FILE = "databaseData/database"; + private static final String JDBC_FILE = "database"; private static final String JDBC_OPTIONS = ";DB_CLOSE_DELAY=-1"; private String JDBC_STRING; @@ -80,7 +80,6 @@ private Connection getConnection() throws SQLException { public Database() { this("./"); - } public Database(String relativePath) { diff --git a/src/main/java/org/hl7/davinci/priorauth/PALogger.java b/src/main/java/org/hl7/davinci/priorauth/PALogger.java index e15dceb3..8554fbfd 100644 --- a/src/main/java/org/hl7/davinci/priorauth/PALogger.java +++ b/src/main/java/org/hl7/davinci/priorauth/PALogger.java @@ -16,7 +16,7 @@ public class PALogger { private static PALogger singletonPALogger; private Logger logger; - private static String LOG_FILE = "logs/priorauth.log"; + private static String LOG_FILE = "priorauth.log"; private PALogger() { this.logger = Logger.getLogger("PriorAuth"); diff --git a/src/main/java/org/hl7/davinci/priorauth/endpoint/Metadata.java b/src/main/java/org/hl7/davinci/priorauth/endpoint/Metadata.java index 0e7c58f4..08db41fc 100644 --- a/src/main/java/org/hl7/davinci/priorauth/endpoint/Metadata.java +++ b/src/main/java/org/hl7/davinci/priorauth/endpoint/Metadata.java @@ -102,11 +102,8 @@ private CapabilityStatement buildCapabilityStatement() { CapabilityStatementRestSecurityComponent security = new CapabilityStatementRestSecurityComponent(); security.setCors(true); Extension oauthUris = new Extension("http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris"); - String tokenUriBase = "https://davinci-prior-auth.logicahealth.org"; - if (System.getenv("TOKEN_BASE_URI") != null && !System.getenv("TOKEN_BASE_URI").isBlank()) { - tokenUriBase = System.getenv("TOKEN_BASE_URI"); - } - Extension tokenUri = new Extension("token", new UriType(tokenUriBase + "/fhir/auth/token")); + // Extension tokenUri = new Extension("token", new UriType("https://localhost:9000/fhir/auth/token")); + Extension tokenUri = new Extension("token", new UriType("https://davinci-prior-auth.logicahealth.org/fhir/auth/token")); oauthUris.addExtension(tokenUri); security.addExtension(oauthUris); rest.setSecurity(security); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index de90521e..ac91e43d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,4 @@ -server.port=9015 +server.port=9000 server.servlet.contextPath= /fhir # server.ssl.key-store=pas_keystore.p12 # server.ssl.key-store-password=password