diff --git a/EndToEndSetupGuide.md b/EndToEndSetupGuide.md index 5184c104..13eac6a6 100644 --- a/EndToEndSetupGuide.md +++ b/EndToEndSetupGuide.md @@ -13,6 +13,8 @@ Follow this guide if you would like to start each application without using Dock - 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 @@ -21,12 +23,13 @@ Follow this guide if you would like to start each application without using Dock ## Clone Repos ``` -git clone git@github.com:mcode/test-ehr.git -git clone git@github.com:mcode/crd-request-generator.git -git clone git@github.com:mcode/REMS.git -git clone git@github.com:mcode/pims.git -git clone git@github.com:mcode/dtr.git -git clone git@github.com:mcode/rems-smart-on-fhir.git +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 @@ -159,14 +162,32 @@ git clone git@github.com:mcode/rems-smart-on-fhir.git `cd pims` -- Setup +- Backend + - Navigate to the backend directory + + `cd backend` + - Setup - `npm install` + `npm install` + - Run -- Run + `npm start` + +- Frontend + - Navigate to the frontend directory - `npm start` + `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) @@ -194,7 +215,11 @@ git clone git@github.com:mcode/rems-smart-on-fhir.git `npm install` - Run + - Linux or Mac - `npm start` + `npm start` + - Windows + + `PORT=4040 npm run start` diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 869ad4f0..5c3e748b 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -40,7 +40,7 @@ services: image: mongo container_name: rems_dev_pims-remsadmin-mongo ports: - - '27017:27017' + - '27017:27017' environment: MONGO_INITDB_ROOT_USERNAME: rems-admin-pims-root MONGO_INITDB_ROOT_PASSWORD: rems-admin-pims-password @@ -56,7 +56,7 @@ services: environment: - REACT_APP_REMS_CONFIG=true ports: - - "3000:3000" + - "3000:3000" - "3001:3001" volumes: - rems_dev_crd-request-generator-sync:/home/node/app/crd-request-generator:nocopy # nocopy is important @@ -114,16 +114,15 @@ services: dockerfile: Dockerfile.dev container_name: rems_dev_pims ports: - - "5050:5050" + - "5050:5050" - "5051:5051" environment: REMS_ADMIN_BASE: http://rems-administrator:8090 - MONGO_HOSTNAME: mongodb://pims_remsadmin_mongo:27017/pims + 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: @@ -139,7 +138,6 @@ volumes: rems_dev_rems-smart-on-fhir-sync: external: true - rems_dev_keycloak-data: rems_dev_pims_remsadmin_mongo: rems_dev_test-ehr-gradle: @@ -155,10 +153,11 @@ volumes: rems_dev_dtr-nodeModules: rems_dev_dtr-databaseData: rems_dev_dtr-logs: - rems_dev_pims-logs: - rems_dev_pims-nodeModules: + 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 index 70d7ded7..e46f129a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.6' services: keycloak: - container_name: rems_prod_keycloak + container_name: rems_prod_keycloak # command: ["-Djboss.http.port=8180"] ports: - '8180:8080' @@ -24,7 +24,6 @@ services: 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 @@ -42,6 +41,7 @@ services: 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 @@ -49,7 +49,7 @@ services: - "4040:4040" - # # Create rems container + # Create rems container rems-administrator: # Name of our service image: codexrems/rems-administrator:REMSvCurrent container_name: rems_prod_rems @@ -59,11 +59,12 @@ services: 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' + - '27017:27017' environment: MONGO_INITDB_ROOT_USERNAME: rems-admin-pims-root MONGO_INITDB_ROOT_PASSWORD: rems-admin-pims-password @@ -71,19 +72,17 @@ services: - 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_HOSTNAME: mongodb://pims_remsadmin_mongo:27017/pims + MONGO_URL: mongodb://pims_remsadmin_mongo:27017/pims ports: - - "5050:5050" + - "5050:5050" - "5051:5051" - - - volumes: rems_prod_keycloak-data: rems_prod_pims_remsadmin_mongo: diff --git a/src/hooks/rems.hook.ts b/src/hooks/rems.hook.ts index c056d6c4..44953d45 100644 --- a/src/hooks/rems.hook.ts +++ b/src/hooks/rems.hook.ts @@ -361,10 +361,15 @@ const handler = (req: TypedRequestBody, res: any) => { } else { // link is SMART // TODO: smart links should be built with discovered questionnaires, not hard coded ones - e.appContext = `${e.appContext}&order=${JSON.stringify(contextRequest)}&coverage=${ - contextRequest.insurance?.[0].reference - }`; - card.addLink(e); + const newLink: Link = { + label: e.label, + url: e.url, + type: e.type, + appContext: `${e.appContext}&order=${JSON.stringify(contextRequest)}&coverage=${ + contextRequest.insurance?.[0].reference + }` + }; + card.addLink(newLink); } }); cardArray.push(card); diff --git a/src/lib/etasu.ts b/src/lib/etasu.ts index 6f18b807..d09053da 100644 --- a/src/lib/etasu.ts +++ b/src/lib/etasu.ts @@ -18,12 +18,47 @@ router.get('/:drug', async (req: Request, res: Response) => { }); router.get('/met/:caseId', async (req: Request, res: Response) => { + console.log('get etasu by caseId'); res.send(await remsCaseCollection.findOne({ case_number: req.params.caseId })); }); +router.get( + '/met/patient/:patientFirstName/:patientLastName/:patientDOB/drugCode/:drugCode', + async (req: Request, res: Response) => { + console.log( + 'get etasu by drug code and patient: ' + + req.params.patientFirstName + + ' ' + + req.params.patientLastName + + ' ' + + req.params.patientDOB + + ' - ' + + req.params.drugCode + ); + const searchDict = { + patientFirstName: req.params.patientFirstName, + patientLastName: req.params.patientLastName, + patientDOB: req.params.patientDOB, + drugCode: req.params.drugCode + }; + + res.send(await remsCaseCollection.findOne(searchDict)); + } +); + router.get( '/met/patient/:patientFirstName/:patientLastName/:patientDOB/drug/:drugName', async (req: Request, res: Response) => { + console.log( + 'get etasu by drug name and patient: ' + + req.params.patientFirstName + + ' ' + + req.params.patientLastName + + ' ' + + req.params.patientDOB + + ' - ' + + req.params.drugName + ); const searchDict = { patientFirstName: req.params.patientFirstName, patientLastName: req.params.patientLastName,