Skip to content

Commit

Permalink
Merge pull request #92 from mcode/dev
Browse files Browse the repository at this point in the history
Merge dev for v0.11
  • Loading branch information
zacharyrobin committed Jun 19, 2023
2 parents 615c7bf + 00879b0 commit 1a5d26f
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 32 deletions.
47 changes: 36 additions & 11 deletions EndToEndSetupGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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`


15 changes: 7 additions & 8 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:


17 changes: 8 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand All @@ -42,14 +41,15 @@ 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
ports:
- "4040:4040"


# # Create rems container
# Create rems container
rems-administrator: # Name of our service
image: codexrems/rems-administrator:REMSvCurrent
container_name: rems_prod_rems
Expand All @@ -59,31 +59,30 @@ 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
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_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:
Expand Down
13 changes: 9 additions & 4 deletions src/hooks/rems.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
35 changes: 35 additions & 0 deletions src/lib/etasu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1a5d26f

Please sign in to comment.