Skip to content
Merged

Dev #75

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5b6a431
Bump follow-redirects from 1.15.2 to 1.15.6 in /frontend
dependabot[bot] Mar 16, 2024
d6fad4a
Bump follow-redirects from 1.15.5 to 1.15.6 in /backend
dependabot[bot] Mar 17, 2024
d4dfbda
Bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /frontend
dependabot[bot] Mar 23, 2024
16ac374
Merge pull request #70 from mcode/dependabot/npm_and_yarn/frontend/we…
plarocque4 Mar 27, 2024
3356bf2
Bump express from 4.18.2 to 4.19.2 in /backend
dependabot[bot] Mar 29, 2024
790a4b2
Bump express from 4.18.2 to 4.19.2 in /frontend
dependabot[bot] Mar 29, 2024
d81be0f
Merge pull request #72 from mcode/dependabot/npm_and_yarn/frontend/ex…
smalho01 Apr 5, 2024
67dc5a8
Merge branch 'dev' into dependabot/npm_and_yarn/backend/express-4.19.2
smalho01 Apr 5, 2024
a2226ff
Merge branch 'dev' into dependabot/npm_and_yarn/backend/follow-redire…
smalho01 Apr 5, 2024
a8bf6d0
Merge branch 'dev' into dependabot/npm_and_yarn/frontend/follow-redir…
smalho01 Apr 5, 2024
fad5db5
Merge pull request #71 from mcode/dependabot/npm_and_yarn/backend/exp…
smalho01 Apr 5, 2024
a973663
Merge branch 'dev' into dependabot/npm_and_yarn/backend/follow-redire…
smalho01 Apr 5, 2024
29cde36
Merge branch 'dev' into dependabot/npm_and_yarn/frontend/follow-redir…
smalho01 Apr 5, 2024
bffc01d
Calls new etasu endpoint for pims
Apr 8, 2024
ffc9e14
Merge branch 'dev' into 667-etasu-pims-update
avirgulto Apr 8, 2024
50592a5
prettier updates
Apr 8, 2024
39a855d
Update env variable
Apr 8, 2024
9c8733c
Merge pull request #73 from mcode/667-etasu-pims-update
plarocque4 Apr 8, 2024
90400d1
Fix typos and remove unused imports while updating VS Code Workspace …
jtquach1 Apr 2, 2024
70b42ce
Merge pull request #69 from mcode/dependabot/npm_and_yarn/backend/fol…
smalho01 Apr 8, 2024
ddf1e30
Merge branch 'dev' into dependabot/npm_and_yarn/frontend/follow-redir…
smalho01 Apr 8, 2024
8a5b98a
Merge pull request #68 from mcode/dependabot/npm_and_yarn/frontend/fo…
smalho01 Apr 8, 2024
8cdce3a
Merge pull request #74 from mcode/fix_typos_found_during_rems_526
smalho01 Apr 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions backend/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@
"default": "admin"
},

"REMS_ADMIN_BASE": {
"REMS_ADMIN_FHIR_URL": {
"type": "string",
"default": "http://localhost:8090"
"default": "http://localhost:8090/4_0_0"
},

"HTTPS_KEY_PATH": {
"type": "string",
"default": "server.key"
Expand Down
60 changes: 15 additions & 45 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"body-parser": "^1.20.1",
"body-parser-xml": "^2.0.3",
"cors": "^2.8.5",
"express": "^4.18.2",
"express": "^4.19.2",
"fast-xml-parser": "^4.3.2",
"mongoose": "^6.11.4",
"var": "^0.4.0",
Expand Down
16 changes: 11 additions & 5 deletions backend/src/database/schemas/doctorOrderSchemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@ export const orderSchema = new mongoose.Schema({
rxDate: String,
drugPrice: Number,
drugNdcCode: String,
drugRxnormCode: String,
quantities: String,
total: Number,
pickupDate: String,
dispenseStatus: String,
metRequirements: [
{
stakeholderId: String,
completed: Boolean,
metRequirementId: String,
requirementName: String,
requirementDescription: String
name: String,
resource: {
status: String,
moduleUri: String,
resourceType: String,
note: [{ text: String }],
subject: {
reference: String
}
}
}
]
});
Expand Down
80 changes: 61 additions & 19 deletions backend/src/routes/doctorOrders.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,37 +72,78 @@ router.post('/api/addRx', async (req, res) => {
*/
router.patch('/api/updateRx/:id', async (req, res) => {
try {
const dontUpdateStatusBool = req.query.dontUpdateStatus;
const doNotUpdateStatusBool = req.query.doNotUpdateStatus;
// Finding by id
const order = await doctorOrder.findById(req.params.id).exec();
console.log('Found doctor order by id!');
console.log('Found doctor order by id! --- ', order);

const body = {
resourceType: 'Parameters',
parameter: [
{
name: 'patient',
resource: {
resourceType: 'Patient',
id: order.prescriberOrderNumber,
name: [
{
family: order.patientLastName,
given: order.patientName.split(' '),
use: 'official'
}
],
birthDate: order.patientDOB
}
},
{
name: 'medication',
resource: {
resourceType: 'Medication',
id: order.prescriberOrderNumber,
code: {
coding: [
{
system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
code: order.drugRxnormCode,
display: order.drugNames
}
]
}
}
}
]
};

// Reaching out to REMS Admin finding by pt name and drug name
// '/etasu/met/patient/:patientFirstName/:patientLastName/:patientDOB/drug/:drugName',

const remsBase = env.REMS_ADMIN_BASE;
const url =
remsBase +
'/etasu/met/patient/' +
order.patientFirstName +
'/' +
order.patientLastName +
'/' +
order.patientDOB +
'/drug/' +
order.simpleDrugName;
const response = await axios.get(url);
const remsBase = env.REMS_ADMIN_FHIR_URL;

const newUrl = remsBase + '/GuidanceResponse/$rems-etasu';

const response = await axios.post(newUrl, body, {
headers: {
'content-type': 'application/json'
}
});
console.log('Retrieved order');
const responseResource = response.data.parameter[0].resource;
const params = [];
if (responseResource.contained && responseResource.contained[0]) {
for (const param of responseResource.contained[0]['parameter']) {
params.push(param);
}
}

const status = responseResource.status === 'success' ? 'Approved' : 'Pending';

// Saving and updating
const newOrder = await doctorOrder.findOneAndUpdate(
{ _id: req.params.id },
{
dispenseStatus:
dontUpdateStatusBool || order.dispenseStatus === 'Picked Up'
doNotUpdateStatusBool || order.dispenseStatus === 'Picked Up'
? order.dispenseStatus
: response.data.status,
metRequirements: response.data.metRequirements
: status,
metRequirements: params
},
{
new: true
Expand Down Expand Up @@ -233,6 +274,7 @@ function parseNCPDPScript(newRx) {
drugNames: newRx.Message.Body.NewRx.MedicationPrescribed.DrugDescription,
simpleDrugName: newRx.Message.Body.NewRx.MedicationPrescribed.DrugDescription.split(' ')[0],
drugNdcCode: newRx.Message.Body.NewRx.MedicationPrescribed.DrugCoded.ProductCode.Code,
drugRxnormCode: newRx.Message.Body.NewRx.MedicationPrescribed.DrugCoded.DrugDBCode.Code,
rxDate: newRx.Message.Body.NewRx.MedicationPrescribed.WrittenDate.Date,
drugPrice: 200, // Add later?
quantities: newRx.Message.Body.NewRx.MedicationPrescribed.Quantity.Value,
Expand Down
7 changes: 0 additions & 7 deletions backend/test/simple.test.ts

This file was deleted.

44 changes: 22 additions & 22 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
You can add web fonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
Expand Down
Loading