From 4e17af78fdfe97c2291650edb4cd94e346b6d609 Mon Sep 17 00:00:00 2001 From: Joyce Quach Date: Thu, 27 Jun 2024 14:57:16 -0400 Subject: [PATCH 1/3] Update README and fix typo in comment --- README.md | 21 ++++++++++++++++++++- backend/src/routes/doctorOrders.js | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c07a75f..e91f9ab 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,27 @@ # Pharmacy Information Management System +## Overview of repository + +The Pharmacy Information Management System (PIMS) is a mock pharmacy system written in TypeScript/JavaScript/MongoDB that handles FHIR R4 (4.0.1), NCPDP Script, and proprietary data exchanges between the [request-generator](https://github.com/mcode/request-generator/), [test-ehr](https://github.com/mcode/test-ehr/), and [rems-admin](https://github.com/mcode/rems-admin/). This repository consists of a frontend service and a backend service. + +### Backend overview + +The backend consists of multiple HTTP GET, POST, PATCH, or DELETE routes, most of which are used to internally update the backend's database of proprietary doctor orders and NewRx's (based off NCPDP Script 2017071 NewRx), display doctor orders on the frontend, or handle converting FHIR and NCPDP Script. + +- `/api/getRx/pending`, `/api/getRx/approved`, and `/api/getRx/pickedUp` are called by the PIMS frontend via GET. Each endpoint returns doctor orders with a "pending", "approved", or "picked up" dispense status. +- `/api/addRx` is called by the request-generator via POST. The endpoint parses an incoming NCPDP Script 2017071 XML NewRx, stores it, and returns an NCPDP Script 2017071 Status in XML. +- `/api/updateRx/:id` is called by the PIMS frontend via PATCH. The endpoint triggers a the rems-admin's FHIR R4 GuidanceResponse POST Operation with a FHIR R4 Parameters to update a doctor order's dispense status. +- `/api/updateRx/:id/metRequirements` is called by the PIMS frontend to display a list of fulfilled and unfulfilled Elements to Assure Safe Use (ETASU). +- `/api/updateRx/:id/pickedUp` is called by the PIMS frontend to update a doctor order's dispense status to "picked up" and POST an NCPDP Script 2017071 RxFill created from the stored NCPDP Script 2017071 NewRx to the test-ehr to update the associated FHIR R4 MedicationDispense. +- `/api/deleteAll` is called by the PIMS frontend and request-generator via DELETE to delete all doctor orders (for development purposes). + +### Frontend overview + +The frontend displays pending, approved, and picked up proprietary doctor orders at [http://localhost:5050/DoctorOrders](http://localhost:5050/DoctorOrders). While there is a login page at [http://localhost:5050](http://localhost:5050/DoctorOrders) for a dummy user, there is no user authentication or authorization system. + ## Setup -The application is divided into a frontend and backend service. For an initial setup run `npm install` in both the frontend and backend subdirectories. This will install the dependencies required for each of the services. +For an initial setup run `npm install` in both the frontend and backend subdirectories. This will install the dependencies required for each of the services. ## Running backend and frontend diff --git a/backend/src/routes/doctorOrders.js b/backend/src/routes/doctorOrders.js index b332151..1dc8171 100644 --- a/backend/src/routes/doctorOrders.js +++ b/backend/src/routes/doctorOrders.js @@ -42,7 +42,7 @@ router.get('/api/getRx/approved', async (_req, res) => { }); /** - * Route: 'doctorOrders/api/getRx/picked up' + * Route: 'doctorOrders/api/getRx/pickedUp' * Description: 'Returns all picked up documents in database for PIMS' */ router.get('/api/getRx/pickedUp', async (_req, res) => { From a30a5dd7890ef827831b9672594f7d45db3e957b Mon Sep 17 00:00:00 2001 From: Joyce Quach Date: Fri, 28 Jun 2024 12:18:15 -0400 Subject: [PATCH 2/3] Fix typo and tweak README based on review --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e91f9ab..6b26684 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The backend consists of multiple HTTP GET, POST, PATCH, or DELETE routes, most o - `/api/getRx/pending`, `/api/getRx/approved`, and `/api/getRx/pickedUp` are called by the PIMS frontend via GET. Each endpoint returns doctor orders with a "pending", "approved", or "picked up" dispense status. - `/api/addRx` is called by the request-generator via POST. The endpoint parses an incoming NCPDP Script 2017071 XML NewRx, stores it, and returns an NCPDP Script 2017071 Status in XML. -- `/api/updateRx/:id` is called by the PIMS frontend via PATCH. The endpoint triggers a the rems-admin's FHIR R4 GuidanceResponse POST Operation with a FHIR R4 Parameters to update a doctor order's dispense status. +- `/api/updateRx/:id` is called by the PIMS frontend via PATCH. The endpoint triggers the rems-admin's FHIR R4 GuidanceResponse POST Operation with a FHIR R4 Parameters to update a doctor order's dispense status to "approved". - `/api/updateRx/:id/metRequirements` is called by the PIMS frontend to display a list of fulfilled and unfulfilled Elements to Assure Safe Use (ETASU). - `/api/updateRx/:id/pickedUp` is called by the PIMS frontend to update a doctor order's dispense status to "picked up" and POST an NCPDP Script 2017071 RxFill created from the stored NCPDP Script 2017071 NewRx to the test-ehr to update the associated FHIR R4 MedicationDispense. - `/api/deleteAll` is called by the PIMS frontend and request-generator via DELETE to delete all doctor orders (for development purposes). From 3e1fbfe778298c6ddb3b58e58bc6c0977470d34c Mon Sep 17 00:00:00 2001 From: Joyce Quach Date: Fri, 28 Jun 2024 12:19:43 -0400 Subject: [PATCH 3/3] update url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b26684..2a2989c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The backend consists of multiple HTTP GET, POST, PATCH, or DELETE routes, most o ### Frontend overview -The frontend displays pending, approved, and picked up proprietary doctor orders at [http://localhost:5050/DoctorOrders](http://localhost:5050/DoctorOrders). While there is a login page at [http://localhost:5050](http://localhost:5050/DoctorOrders) for a dummy user, there is no user authentication or authorization system. +The frontend displays pending, approved, and picked up proprietary doctor orders at [http://localhost:5050/DoctorOrders](http://localhost:5050/DoctorOrders). While there is a login page at [http://localhost:5050](http://localhost:5050) for a dummy user, there is no user authentication or authorization system. ## Setup