From 63ae301e98f7e592448ada6cccc1c7c976f282ba Mon Sep 17 00:00:00 2001 From: Himabindu T Date: Sun, 9 Jun 2024 19:49:18 +0530 Subject: [PATCH] BAH-3802 | Add. Provider Notification Tab In Clinical View * BAH-3802 | Arjun | setup notifications page * add. components for provider notifications * Abi | update. bahmni-carbon-ui version * Srini | BAH-3802 |Provider Acknowledgement workflow for the Emergency medication administered by Ward Nurse * [Sri] - fix styling issue for provider acknowledgement flow * Srini | BAH-3802 | Refactor the patient list view in the provider acknowledgement flow * Bindu | Fix build issue * [Rahul] | BAH-3802 | Refactor. Provider Notification State Management --------- Co-authored-by: Arjun-Go Co-authored-by: srinithishg Co-authored-by: Rahul Ramesh <121226043+rahu1ramesh@users.noreply.github.com> Co-authored-by: Rahul Ramesh --- micro-frontends/package.json | 8 +- micro-frontends/public/i18n/locale_en.json | 5 +- .../PatientListContent.jsx | 60 ++++++ .../PatientListContent.scss | 37 ++++ .../PatientListContent.spec.jsx | 110 ++++++++++ .../PatientListMockData.js | 69 +++++++ .../PatientListTitle.jsx | 34 +++ .../PatientListTitle.scss | 31 +++ .../PatientListTitle.spec.jsx | 66 ++++++ .../PatientsList.jsx | 67 ++++++ .../PatientsList.scss | 20 ++ .../PatientsList.spec.jsx | 68 ++++++ .../PatientListContent.spec.jsx.snap | 67 ++++++ .../PatientListTitle.spec.jsx.snap | 48 +++++ .../__snapshots__/PatientsList.spec.jsx.snap | 150 ++++++++++++++ .../ProviderNotifications.jsx | 97 +++++++++ .../ProviderNotifications.scss | 17 ++ .../ProviderNotifications.spec.jsx | 177 ++++++++++++++++ .../ProviderNotifications.spec.jsx.snap | 164 +++++++++++++++ micro-frontends/src/next-ui/constants.js | 2 +- micro-frontends/src/next-ui/index.js | 10 +- .../ProviderNotificationUtils.js | 68 ++++++ .../ProviderNotificationUtils.spec.js | 194 ++++++++++++++++++ micro-frontends/src/next-ui/utils/utils.js | 44 ++++ .../src/next-ui/utils/utils.spec.js | 107 +++++++--- micro-frontends/yarn.lock | 8 +- ui/app/common/patient-search/constants.js | 1 + .../controllers/patientsListController.js | 3 +- ui/app/common/patient-search/models/search.js | 4 + .../patient-search/views/patientsList.html | 7 +- .../registration/services/patientService.js | 2 +- .../patientsListController.spec.js | 2 +- 32 files changed, 1705 insertions(+), 42 deletions(-) create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListContent.jsx create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListContent.scss create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListContent.spec.jsx create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListMockData.js create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListTitle.jsx create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListTitle.scss create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListTitle.spec.jsx create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientsList.jsx create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientsList.scss create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientsList.spec.jsx create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/__snapshots__/PatientListContent.spec.jsx.snap create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/__snapshots__/PatientListTitle.spec.jsx.snap create mode 100644 micro-frontends/src/next-ui/Components/ProviderNotificationPatients/__snapshots__/PatientsList.spec.jsx.snap create mode 100644 micro-frontends/src/next-ui/Containers/providerNotifications/ProviderNotifications.jsx create mode 100644 micro-frontends/src/next-ui/Containers/providerNotifications/ProviderNotifications.scss create mode 100644 micro-frontends/src/next-ui/Containers/providerNotifications/ProviderNotifications.spec.jsx create mode 100644 micro-frontends/src/next-ui/Containers/providerNotifications/__snapshots__/ProviderNotifications.spec.jsx.snap create mode 100644 micro-frontends/src/next-ui/utils/providerNotifications/ProviderNotificationUtils.js create mode 100644 micro-frontends/src/next-ui/utils/providerNotifications/ProviderNotificationUtils.spec.js diff --git a/micro-frontends/package.json b/micro-frontends/package.json index a39a778daa..32167f3260 100644 --- a/micro-frontends/package.json +++ b/micro-frontends/package.json @@ -9,12 +9,13 @@ "@babel/core": "^7.15.5", "@babel/plugin-transform-runtime": "^7.22.4", "@babel/preset-env": "^7.22.4", - "bahmni-form-controls": "^0.93.12", "@babel/preset-react": "^7.22.3", "@testing-library/react": "12.1.5", "axios": "1.4.0", "babel-jest": "^29.5.0", "babel-loader": "^9.1.2", + "bahmni-form-controls": "^0.93.12", + "copy-webpack-plugin": "^11.0.0", "css-loader": "5.2.6", "eslint": "^8.42.0", "eslint-config-prettier": "^8.8.0", @@ -29,13 +30,12 @@ "sass": "^1.63.4", "sass-loader": "10.1.0", "webpack": "^5.86.0", - "webpack-cli": "^5.1.4", - "copy-webpack-plugin": "^11.0.0" + "webpack-cli": "^5.1.4" }, "dependencies": { "@carbon/icons-react": "^10.18.0", "angular-component": "^0.1.3", - "bahmni-carbon-ui": "0.1.3", + "bahmni-carbon-ui": "0.1.6", "carbon-components": "^10.19.0", "carbon-components-react": "^7.25.0", "classnames": "2.3.1", diff --git a/micro-frontends/public/i18n/locale_en.json b/micro-frontends/public/i18n/locale_en.json index 5e3e8ef006..19673cb2bb 100644 --- a/micro-frontends/public/i18n/locale_en.json +++ b/micro-frontends/public/i18n/locale_en.json @@ -30,5 +30,8 @@ "UPDATE_NOTE_TITLE": "Update Note", "ADD_NOTE_TITLE": "Add Note", "LOADING": "Loading...", - "UPDATE": "Update" + "UPDATE": "Update", + "AKNOWLEDGE_BUTTON": "Acknowledge", + "AKNOWLEDGEMENT_REQUIRED_TEXT": "Acknowledgement required", + "NO_DRUGS_TO_BE_AKNOWLEDGED_TEXT": "You have no new drugs to be acknowledged" } \ No newline at end of file diff --git a/micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListContent.jsx b/micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListContent.jsx new file mode 100644 index 0000000000..f4876b9d80 --- /dev/null +++ b/micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListContent.jsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; +import { Button, TextArea } from "carbon-components-react"; +import { FormattedMessage } from 'react-intl'; +import "./PatientListContent.scss"; +import { Title } from "bahmni-carbon-ui"; +import { formatArrayDateToDefaultDateFormat } from "../../utils/utils"; +import PropTypes from "prop-types"; + +const PatientListContent = ({ patientMedicationDetails, handleOnClick }) => { + const { administered_date_time, administered_drug_name, medication_administration_performer_uuid, medication_administration_uuid } = patientMedicationDetails; + const acknowledgementRequiredText = (); + const [providerNotes, setProviderNotes] = useState(""); + + function acknowledgeMedication() { + handleOnClick(medication_administration_performer_uuid, medication_administration_uuid, providerNotes); + setProviderNotes(""); + } + + const handleNotesChange = (e) => { + setProviderNotes(e.target.value); + }; + + return ( +
+ {formatArrayDateToDefaultDateFormat(administered_date_time)} +
+ {administered_drug_name} +
+