-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from mcode/dev
Dev
- Loading branch information
Showing
12 changed files
with
84 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Router, Request } from 'express'; | ||
import { remsCaseCollection } from '../fhir/models'; | ||
const router = Router(); | ||
|
||
router.post('/ncpdp/script', async (req: Request) => { | ||
try { | ||
const requestBody = req.body; | ||
if (requestBody.message?.body?.rxfill) { | ||
// call to handle rxfill | ||
handleRxFill(requestBody); | ||
} else { | ||
// do nothing for now | ||
} | ||
} catch (error) { | ||
console.log(error); | ||
throw error; | ||
} | ||
}); | ||
|
||
const handleRxFill = async (bundle: any) => { | ||
const rxfill = bundle.message?.body?.rxfill; | ||
|
||
const fillStatus = rxfill?.fillstatus?.dispensed?.note; | ||
const patient = rxfill?.patient; | ||
const code = rxfill?.medicationprescribed?.drugcoded?.drugdbcode?.code; | ||
|
||
await remsCaseCollection.findOneAndUpdate( | ||
{ | ||
patientFirstName: patient?.humanpatient?.name?.firstname, | ||
patientLastName: patient?.humanpatient?.name?.lastname, | ||
patientDOB: patient?.humanpatient?.dateofbirth?.date, | ||
drugCode: code | ||
}, | ||
{ dispenseStatus: fillStatus }, | ||
{ new: true } | ||
); | ||
return fillStatus; | ||
}; | ||
|
||
export default router; |
Submodule rems-cds-hooks
updated
4 files
+13 −3 | README.md | |
+17 −10 | prefetch/PrefetchHydrator.ts | |
+7 −3 | resources/HookTypes.ts | |
+1 −1 | resources/OrderSign.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters