diff --git a/.env b/.env index da48755037b..528b49e2b8d 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ # Whitelabelling envs REACT_APP_TITLE=CARE -REACT_APP_META_DESCRIPTION=CoronaSafe Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. CoronaSafe Care is a Digital Public Good recognised by United Nations. +REACT_APP_META_DESCRIPTION=Revolutionizing EMR with AI: Open Healthcare Network develops free, open-source tools to enhance efficiency in global healthcare delivery. Our EMR system is recognized as a Digital Public Good by the United Nations. REACT_APP_COVER_IMAGE=https://cdn.coronasafe.network/care_logo.svg REACT_APP_COVER_IMAGE_ALT=https://cdn.coronasafe.network/care_logo.svg REACT_PUBLIC_URL=https://care.coronasafe.in diff --git a/.eslintrc.json b/.eslintrc.json index a2f7b667856..0fc2f64ddaf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,7 +12,6 @@ "extends": [ "eslint:recommended", "plugin:react-hooks/recommended", - "plugin:prettier/recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:i18next/recommended", diff --git a/cypress/e2e/patient_spec/patient_registration.cy.ts b/cypress/e2e/patient_spec/patient_registration.cy.ts index 17c9b0b3679..f94dbbe46cd 100644 --- a/cypress/e2e/patient_spec/patient_registration.cy.ts +++ b/cypress/e2e/patient_spec/patient_registration.cy.ts @@ -254,7 +254,7 @@ describe("Patient Creation with consultation", () => { }); it("Patient Registration using the transfer with no consultation", () => { - // transfer the patient and no consulation + // transfer the patient with no consulation and verify the transfer to a new facility patientPage.createPatient(); patientPage.selectFacility(patientTransferFacility); patientPage.patientformvisibility(); @@ -264,9 +264,10 @@ describe("Patient Creation with consultation", () => { patientTransfer.clickTransferPatientNameList(patientTransferName); patientTransfer.clickTransferPatientYOB(yearOfBirth); patientTransfer.clickTransferSubmitButton(); - patientTransfer.verifyFacilitySuccessfullMessage(); + cy.verifyNotification( + "Patient Dummy Patient 10 (Male) transferred successfully", + ); patientTransfer.clickConsultationCancelButton(); - cy.wait(3000); // allow the transfer button of a patient patientTransfer.clickAllowPatientTransferButton(); // Verify the patient error message for the same facility @@ -280,7 +281,9 @@ describe("Patient Creation with consultation", () => { patientTransfer.clickTransferPatientNameList(patientTransferName); patientTransfer.clickTransferPatientYOB(yearOfBirth); patientTransfer.clickTransferSubmitButton(); - patientTransfer.verifyFacilityErrorMessage(); + cy.verifyNotification( + "Patient - Patient transfer cannot be completed because the patient has an active consultation in the same facility", + ); }); it("Patient Registration using External Result Import", () => { diff --git a/cypress/pageobject/Patient/PatientPrescription.ts b/cypress/pageobject/Patient/PatientPrescription.ts index 8e006465e08..108fedbd676 100644 --- a/cypress/pageobject/Patient/PatientPrescription.ts +++ b/cypress/pageobject/Patient/PatientPrescription.ts @@ -28,7 +28,7 @@ export class PatientPrescription { } clickAdministerButton() { - cy.get("#administer-medicine").should("be.visible"); + cy.get("#administer-medicine").scrollIntoView().should("be.visible"); cy.verifyAndClickElement("#administer-medicine", "Administer"); } diff --git a/cypress/pageobject/Patient/PatientTransfer.ts b/cypress/pageobject/Patient/PatientTransfer.ts index 4c884ee2427..0bdd55e9880 100644 --- a/cypress/pageobject/Patient/PatientTransfer.ts +++ b/cypress/pageobject/Patient/PatientTransfer.ts @@ -19,44 +19,18 @@ class PatientTransfer { clickTransferSubmitButton() { cy.get("#submit-transferpatient").click(); + cy.wait(2000); } clickConsultationCancelButton() { cy.get("#cancel").scrollIntoView(); cy.get("#cancel").click(); + cy.wait(2000); } clickAllowPatientTransferButton() { cy.get("#patient-allow-transfer").click(); } - - verifyFacilitySuccessfullMessage() { - cy.get(".pnotify") - .should("exist") - .within(() => { - cy.get(".pnotify-text") - .invoke("text") - .then((text) => { - expect(text.trim()).to.match( - /^Patient Dummy Patient 10 \(Male\) transferred successfully$/i, - ); - }); - }); - } - - verifyFacilityErrorMessage() { - cy.get(".pnotify") - .should("exist") - .within(() => { - cy.get(".pnotify-text") - .invoke("text") - .then((text) => { - expect(text).to.match( - /Patient - Patient transfer cannot be completed because the patient has an active consultation in the same facility/, - ); - }); - }); - } } export default PatientTransfer; diff --git a/cypress/support/index.ts b/cypress/support/index.ts index 9ddfd0c819a..c9af6a02c96 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -1,3 +1,4 @@ +/// import "./commands"; declare global { diff --git a/package-lock.json b/package-lock.json index a049f0727cf..7edab217325 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,7 @@ "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.13", + "@types/cypress": "^1.1.3", "@types/echarts": "^4.9.22", "@types/google.maps": "^3.55.8", "@types/lodash-es": "^4.17.12", @@ -89,7 +90,7 @@ "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react-swc": "^3.6.0", "autoprefixer": "^10.4.19", - "cypress": "^13.9.0", + "cypress": "^13.13.1", "cypress-localstorage-commands": "^2.2.5", "cypress-split": "^1.23.2", "eslint": "^8.44.0", @@ -6229,6 +6230,16 @@ "@types/node": "*" } }, + "node_modules/@types/cypress": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/cypress/-/cypress-1.1.3.tgz", + "integrity": "sha512-OXe0Gw8LeCflkG1oPgFpyrYWJmEKqYncBsD/J0r17r0ETx/TnIGDNLwXt/pFYSYuYTpzcq1q3g62M9DrfsBL4g==", + "deprecated": "This is a stub types definition for cypress (https://cypress.io). cypress provides its own type definitions, so you don't need @types/cypress installed!", + "dev": true, + "dependencies": { + "cypress": "*" + } + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -9142,9 +9153,9 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/cypress": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.9.0.tgz", - "integrity": "sha512-atNjmYfHsvTuCaxTxLZr9xGoHz53LLui3266WWxXJHY7+N6OdwJdg/feEa3T+buez9dmUXHT1izCOklqG82uCQ==", + "version": "13.13.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.13.1.tgz", + "integrity": "sha512-8F9UjL5MDUdgC/S5hr8CGLHbS5gGht5UOV184qc2pFny43fnkoaKxlzH/U6//zmGu/xRTaKimNfjknLT8+UDFg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -9187,7 +9198,7 @@ "request-progress": "^3.0.0", "semver": "^7.5.3", "supports-color": "^8.1.1", - "tmp": "~0.2.1", + "tmp": "~0.2.3", "untildify": "^4.0.0", "yauzl": "^2.10.0" }, diff --git a/package.json b/package.json index 5a658d6d510..4d3feedc920 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,7 @@ "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.13", + "@types/cypress": "^1.1.3", "@types/echarts": "^4.9.22", "@types/google.maps": "^3.55.8", "@types/lodash-es": "^4.17.12", @@ -129,7 +130,7 @@ "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react-swc": "^3.6.0", "autoprefixer": "^10.4.19", - "cypress": "^13.9.0", + "cypress": "^13.13.1", "cypress-localstorage-commands": "^2.2.5", "cypress-split": "^1.23.2", "eslint": "^8.44.0", diff --git a/src/CAREUI/display/Count.tsx b/src/CAREUI/display/Count.tsx index 3b889b10e9b..997b58794eb 100644 --- a/src/CAREUI/display/Count.tsx +++ b/src/CAREUI/display/Count.tsx @@ -19,11 +19,11 @@ export default function CountBlock(props: Props) {
+
{props.event.by && ( - + {props.event.by.username.startsWith("asset") ? t("virtual_nursing_assistant") : `${formatName(props.event.by)} ${ @@ -101,7 +101,7 @@ export const TimelineNode = (props: TimelineNodeProps) => { {props.actions} )}
({consent.patient_abha})
({consent.requester.username})
View
created {dayjs(artefact.created_date).fromNow()}
expires in {dayjs(artefact.expiry).fromNow()}
expires in {dayjs(consent.expiry).fromNow()}
created {dayjs(consent.created_date).fromNow()}
modified {dayjs(consent.modified_date).fromNow()}
{consent.status === "REQUESTED" ? "Waiting for the Patient to approve the consent request" : "Patient has rejected the consent request"}
No Records found
Raise a consent request to fetch patient records over ABDM
- Gender: - - {abha?.gender} - -
- DOB: - - {abha?.date_of_birth} - -
- Email: - - {abha?.email} - -
{t("update_record_for_asset")} {props.asset?.name}
{isLast ? "Created" : "Edited"} On
{formatDateTime(edit.edited_on)}
{isLast ? "Created" : "Edited"} By
{edit.edited_by.username}
{t("edited_on")}
{formatDateTime(editRecord.edited_on)}
{t("edited_by")}
{editRecord.edited_by.username}
{t("serviced_on")}
{formatDate(editRecord.serviced_on)}
{t("notes")}
{editRecord.note || "-"}
No Assets Found
{type == "year" @@ -350,7 +350,7 @@ const DateInputV2: React.FC = ({ year.getFullYear()) || !isDateWithinConstraints(getLastDay()) } - className="inline-flex aspect-square cursor-pointer items-center justify-center rounded p-2 transition duration-100 ease-in-out hover:bg-gray-300" + className="inline-flex aspect-square cursor-pointer items-center justify-center rounded p-2 transition duration-100 ease-in-out hover:bg-secondary-300" onClick={increment} > = ({ id={`day-${i}`} className="aspect-square w-[14.26%]" > - + {day} @@ -397,11 +397,11 @@ const DateInputV2: React.FC = ({ "bg-primary-500 font-bold text-white"; } else { conditionalClasses = - "hover:bg-gray-300 cursor-pointer"; + "hover:bg-secondary-300 cursor-pointer"; } } else { conditionalClasses = - "!cursor-not-allowed !text-gray-400"; + "!cursor-not-allowed !text-secondary-400"; } return ( = ({ "w-1/4 cursor-pointer rounded-lg px-2 py-4 text-center text-sm font-semibold", value && isSelectedMonth(i) ? "bg-primary-500 text-white" - : "text-gray-700 hover:bg-gray-300", + : "text-secondary-700 hover:bg-secondary-300", )} onClick={setMonthValue(i)} > @@ -462,7 +462,7 @@ const DateInputV2: React.FC = ({ "w-1/4 cursor-pointer rounded-lg px-2 py-4 text-center text-sm font-semibold", value && isSelectedYear(y) ? "bg-primary-500 text-white" - : "text-gray-700 hover:bg-gray-300", + : "text-secondary-700 hover:bg-secondary-300", )} onClick={setYearValue(y)} > diff --git a/src/Components/Common/Dialog.tsx b/src/Components/Common/Dialog.tsx index ed52920fb13..68f6d0900b9 100644 --- a/src/Components/Common/Dialog.tsx +++ b/src/Components/Common/Dialog.tsx @@ -59,11 +59,11 @@ const DialogModal = (props: DialogProps) => { > {title} - + {description} diff --git a/src/Components/Common/ExcelFIleDragAndDrop.tsx b/src/Components/Common/ExcelFIleDragAndDrop.tsx index 750d4785279..e7e3f0e71d2 100644 --- a/src/Components/Common/ExcelFIleDragAndDrop.tsx +++ b/src/Components/Common/ExcelFIleDragAndDrop.tsx @@ -144,7 +144,7 @@ export default function ExcelFileDragAndDrop({ onDrop={onDrop} onClick={() => !selectedFile && fileInputRef.current?.click()} className={`mb-8 mt-5 flex flex-1 flex-col items-center justify-center rounded-lg border-[3px] border-dashed px-3 py-6 ${ - dragProps.dragOver ? "border-primary-500" : "border-gray-500" + dragProps.dragOver ? "border-primary-500" : "border-secondary-500" } ${dragProps.fileDropError !== "" ? "border-red-500" : ""}`} > {dragProps.fileDropError !== "" && dragProps.fileDropError} @@ -181,7 +185,7 @@ export default function ExcelFileDragAndDrop({ /> {selectedFile && ( - + {selectedFile.name} - {(selectedFile.size / 1024).toFixed(2)} KB setPreview(true)} > ) : ( <> - + {selectedFile.name} @@ -87,11 +87,11 @@ const ExcelViewer = ({ - + {fileData && fileData[0] ? ( - - + + {showCheckbox && ( @@ -133,7 +133,7 @@ const ExcelViewer = ({ {showCheckbox && ( @@ -218,12 +218,12 @@ const ExcelViewer = ({ ) : ( - No data found + No data found )} {fileData && fileData.length > 5 && ( - + Showing {currentPage * rowsPerPage - rowsPerPage + 1} to{" "} {currentPage * rowsPerPage > fileData.length ? fileData.length @@ -242,7 +242,7 @@ const ExcelViewer = ({ /> )} { setRowsPerPage(+e.target.value); diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx index 2b820b40d6a..526bf6d68ac 100644 --- a/src/Components/Common/FacilitySelect.tsx +++ b/src/Components/Common/FacilitySelect.tsx @@ -17,7 +17,7 @@ interface FacilitySelectProps { district?: string; state?: string; showAll?: boolean; - showNOptions?: number; + showNOptions?: number | undefined; freeText?: boolean; selected?: FacilityModel | FacilityModel[] | null; setSelected: (selected: FacilityModel | FacilityModel[] | null) => void; @@ -34,7 +34,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => { searchAll, disabled = false, showAll = true, - showNOptions = 10, + showNOptions, className = "", facilityType, district, @@ -65,6 +65,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => { data?.results?.push({ name: text, }); + return data?.results; }, [searchAll, showAll, facilityType, district, exclude_user, freeText], diff --git a/src/Components/Common/FilePreviewDialog.tsx b/src/Components/Common/FilePreviewDialog.tsx index a8f455bc070..9098c8fa5f3 100644 --- a/src/Components/Common/FilePreviewDialog.tsx +++ b/src/Components/Common/FilePreviewDialog.tsx @@ -106,7 +106,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => { {fileUrl ? ( <> - + {file_state.name}.{file_state.extension} @@ -126,7 +126,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => { - + {file_state.isImage ? ( { Can't preview this file. Try downloading it. diff --git a/src/Components/Common/GLocationPicker.tsx b/src/Components/Common/GLocationPicker.tsx index f71583c2322..bfe95735127 100644 --- a/src/Components/Common/GLocationPicker.tsx +++ b/src/Components/Common/GLocationPicker.tsx @@ -222,7 +222,7 @@ const Map: React.FC = ({ > @@ -240,7 +240,7 @@ const Map: React.FC = ({ > )} diff --git a/src/Components/Common/HeadedTabs.tsx b/src/Components/Common/HeadedTabs.tsx index 38765431d94..33e8c96a239 100644 --- a/src/Components/Common/HeadedTabs.tsx +++ b/src/Components/Common/HeadedTabs.tsx @@ -20,7 +20,7 @@ export default function HeadedTabs(props: headedTabsProps) { { handleChange( @@ -34,7 +34,7 @@ export default function HeadedTabs(props: headedTabsProps) { - + { handleChange(tab.value); diff --git a/src/Components/Common/LanguageSelectorLogin.tsx b/src/Components/Common/LanguageSelectorLogin.tsx index 1f4e8593d2a..1fc4cf4ac77 100644 --- a/src/Components/Common/LanguageSelectorLogin.tsx +++ b/src/Components/Common/LanguageSelectorLogin.tsx @@ -18,7 +18,7 @@ export const LanguageSelectorLogin = () => { }; return ( - + {t("available_in")} diff --git a/src/Components/Common/PageTitle.tsx b/src/Components/Common/PageTitle.tsx index 990dc7b72cc..3af4c873872 100644 --- a/src/Components/Common/PageTitle.tsx +++ b/src/Components/Common/PageTitle.tsx @@ -70,7 +70,7 @@ export default function PageTitle({ > {" "} )} diff --git a/src/Components/Common/Sidebar/Sidebar.tsx b/src/Components/Common/Sidebar/Sidebar.tsx index abd158b2da7..9c26de9a051 100644 --- a/src/Components/Common/Sidebar/Sidebar.tsx +++ b/src/Components/Common/Sidebar/Sidebar.tsx @@ -223,7 +223,7 @@ interface ToggleShrinkProps { const ToggleShrink = ({ shrinked, toggle }: ToggleShrinkProps) => ( { @@ -53,9 +53,9 @@ const SidebarUserCard = ({ shrinked }: { shrinked: boolean }) => { > - {t("sign_out")} + {t("sign_out")} diff --git a/src/Components/Common/SlideOver.res b/src/Components/Common/SlideOver.res index dbcacbe1bad..75f1c963c6e 100644 --- a/src/Components/Common/SlideOver.res +++ b/src/Components/Common/SlideOver.res @@ -13,7 +13,7 @@ let make = (~show, ~setShow, ~children) => leaveFrom="opacity-100" leaveTo="opacity-0"> setShow(false)} /> diff --git a/src/Components/Common/Steps.tsx b/src/Components/Common/Steps.tsx index e0b1e03af3f..31c5145835f 100644 --- a/src/Components/Common/Steps.tsx +++ b/src/Components/Common/Steps.tsx @@ -13,7 +13,7 @@ export default function Steps(props: { steps: Step[] }) { {props.steps.map((step, stepIdx) => ( @@ -34,7 +34,7 @@ export default function Steps(props: { steps: Step[] }) { aria-hidden="true" /> - + {step.name} @@ -66,12 +66,12 @@ export default function Steps(props: { steps: Step[] }) { }`} > - - + + {step.id} - + {step.name} @@ -85,7 +85,7 @@ export default function Steps(props: { steps: Step[] }) { aria-hidden="true" > + - + {date} - + {incidents.length === 0 ? ( <> No status for the day @@ -119,7 +119,7 @@ function UptimeInfo({ ); })} - + Total downtime @@ -372,7 +372,7 @@ export default function Uptime( {props.header} - + {getUptimePercent(numDays)}% uptime @@ -425,7 +425,7 @@ export default function Uptime( })} diff --git a/src/Components/Common/UserAutocompleteFormField.tsx b/src/Components/Common/UserAutocompleteFormField.tsx index 9e94c5e4e68..c7694b74e4e 100644 --- a/src/Components/Common/UserAutocompleteFormField.tsx +++ b/src/Components/Common/UserAutocompleteFormField.tsx @@ -48,7 +48,7 @@ export default function UserAutocompleteFormField(props: Props) { - + {props.title}: {props.children} diff --git a/src/Components/Common/components/ButtonV2.tsx b/src/Components/Common/components/ButtonV2.tsx index 3bc5a41e799..2c9579873b1 100644 --- a/src/Components/Common/components/ButtonV2.tsx +++ b/src/Components/Common/components/ButtonV2.tsx @@ -102,7 +102,7 @@ const ButtonV2 = ({ }: ButtonProps) => { const className = classNames( props.className, - "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-gray-200 disabled:text-gray-500", + "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500", `button-size-${size}`, `button-shape-${circle ? "circle" : "square"}`, ghost ? `button-${variant}-ghost` : `button-${variant}-default`, diff --git a/src/Components/Common/components/ContactLink.tsx b/src/Components/Common/components/ContactLink.tsx index 762558f5bb2..ff13433cc3b 100644 --- a/src/Components/Common/components/ContactLink.tsx +++ b/src/Components/Common/components/ContactLink.tsx @@ -13,7 +13,7 @@ export default function ContactLink(props: ContactLinkProps) { > {props.tel ? props.tel : props.mailto} diff --git a/src/Components/Common/components/Menu.tsx b/src/Components/Common/components/Menu.tsx index 1caac9edc12..a6f66ff9d2f 100644 --- a/src/Components/Common/components/Menu.tsx +++ b/src/Components/Common/components/Menu.tsx @@ -34,7 +34,7 @@ export default function DropdownMenu({ - + @@ -57,7 +57,7 @@ let profileCard = () => - + diff --git a/src/Components/Common/components/Switch.tsx b/src/Components/Common/components/Switch.tsx index 2253e95d155..7be7490f7b1 100644 --- a/src/Components/Common/components/Switch.tsx +++ b/src/Components/Common/components/Switch.tsx @@ -29,7 +29,7 @@ export default function SwitchV2(props: SwitchProps) { const additionalClassNames = selected ? (props.optionClassName && props.optionClassName(option)) || "bg-primary-500 hover:bg-primary-600 text-white border-primary-500 focus:ring-primary-500 focus:border-primary-500" - : "bg-gray-50 hover:bg-gray-200 border-gray-400 focus:ring-primary-500 focus:border-primary-500"; + : "bg-secondary-50 hover:bg-secondary-200 border-secondary-400 focus:ring-primary-500 focus:border-primary-500"; return ( + <>{item}> ); diff --git a/src/Components/Common/prescription-builder/InvestigationBuilder.tsx b/src/Components/Common/prescription-builder/InvestigationBuilder.tsx index 6de2a83f1cb..ef99a7f1acc 100644 --- a/src/Components/Common/prescription-builder/InvestigationBuilder.tsx +++ b/src/Components/Common/prescription-builder/InvestigationBuilder.tsx @@ -4,6 +4,7 @@ import { PrescriptionMultiDropdown } from "./PrescriptionMultiselect"; import CareIcon from "../../../CAREUI/icons/CareIcon"; import request from "../../../Utils/request/request"; import routes from "../../../Redux/api"; +import { humanizeStrings } from "../../../Utils/utils"; export type InvestigationType = { type?: string[]; @@ -86,9 +87,9 @@ export default function InvestigationBuilder( return ( data?.results.map( (investigation) => - `${investigation.name} -- ${investigation.groups - .map((group) => ` ( ${group.name} ) `) - .join(", ")}`, + `${investigation.name} -- ${humanizeStrings( + investigation.groups.map((group) => ` ( ${group.name} ) `), + )}`, ) ?? [] ); }; @@ -125,16 +126,16 @@ export default function InvestigationBuilder( - + Investigation No. {i + 1} setInvestigations( investigations.filter((investigation, index) => i != index), @@ -210,7 +211,7 @@ export default function InvestigationBuilder( Time{" *"} { setItem( @@ -257,7 +258,7 @@ export default function InvestigationBuilder( onClick={() => { setInvestigations([...investigations, { repetitive: false }]); }} - className="mt-4 block w-full bg-gray-200 px-4 py-2 text-left text-sm font-bold leading-5 text-gray-700 shadow-sm hover:bg-gray-300 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900 focus:outline-none" + className="mt-4 block w-full bg-secondary-200 px-4 py-2 text-left text-sm font-bold leading-5 text-secondary-700 shadow-sm hover:bg-secondary-300 hover:text-secondary-900 focus:bg-secondary-100 focus:text-secondary-900 focus:outline-none" > + Add Investigation diff --git a/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx b/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx index dbfa0749ef1..6d122d00a5a 100644 --- a/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx +++ b/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx @@ -62,7 +62,7 @@ export function PrescriptionDropdown(props: { id="frequency-interval" type="button" key={i} - className="block w-full px-4 py-2 text-left text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900 focus:outline-none" + className="block w-full px-4 py-2 text-left text-sm leading-5 text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:bg-secondary-100 focus:text-secondary-900 focus:outline-none" onClick={() => { setValue(option); setOpen(false); diff --git a/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx b/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx index 79ae3356ee4..4f744bcbae7 100644 --- a/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx +++ b/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx @@ -84,10 +84,10 @@ export function PrescriptionMultiDropdown(props: { id="investigation-group" key={i} className={classNames( - "block w-full px-4 py-2 text-left text-sm leading-5 text-gray-700 hover:text-gray-900 focus:text-gray-900 focus:outline-none", + "block w-full px-4 py-2 text-left text-sm leading-5 text-secondary-700 hover:text-secondary-900 focus:text-secondary-900 focus:outline-none", selectedValues.includes(option) ? "bg-primary-100 hover:bg-primary-200" - : "hover:bg-gray-100 focus:bg-gray-100", + : "hover:bg-secondary-100 focus:bg-secondary-100", )} onClick={() => { setSelectedValues( diff --git a/src/Components/Common/prescription-builder/ProcedureBuilder.tsx b/src/Components/Common/prescription-builder/ProcedureBuilder.tsx index 5eca95354bf..fe7ec3cda3c 100644 --- a/src/Components/Common/prescription-builder/ProcedureBuilder.tsx +++ b/src/Components/Common/prescription-builder/ProcedureBuilder.tsx @@ -41,18 +41,18 @@ export default function ProcedureBuilder(props: Props) { - + Procedure No. {i + 1} setProcedures( procedures.filter((procedure, index) => i != index), @@ -69,7 +69,7 @@ export default function ProcedureBuilder(props: Props) { ) { setActiveIdx(i)} onBlur={() => setActiveIdx(null)} @@ -160,7 +160,7 @@ export default function ProcedureBuilder(props: Props) { Notes setActiveIdx(i)} @@ -186,7 +186,7 @@ export default function ProcedureBuilder(props: Props) { onClick={() => { setProcedures([...procedures, { repetitive: false }]); }} - className="mt-4 block w-full bg-gray-200 px-4 py-2 text-left text-sm font-bold leading-5 text-gray-700 shadow-sm hover:bg-gray-300 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900 focus:outline-none" + className="mt-4 block w-full bg-secondary-200 px-4 py-2 text-left text-sm font-bold leading-5 text-secondary-700 shadow-sm hover:bg-secondary-300 hover:text-secondary-900 focus:bg-secondary-100 focus:text-secondary-900 focus:outline-none" > + Add Procedures diff --git a/src/Components/CriticalCareRecording/CriticalCare__Index.res b/src/Components/CriticalCareRecording/CriticalCare__Index.res index 56bc5623264..0290728fd82 100644 --- a/src/Components/CriticalCareRecording/CriticalCare__Index.res +++ b/src/Components/CriticalCareRecording/CriticalCare__Index.res @@ -11,17 +11,20 @@ let renderLine = (title, value) => { let renderIndicators = (title, value, isMin, isMax, minText, maxText) => { let indicator = if isMax { - {str(maxText)} + + {str(maxText)} } else if isMin { - {str(minText)} + + {str(minText)} } else { - {str("Normal")} + + {str("Normal")} } @@ -109,25 +112,25 @@ let make = ( + className="bg-white px-2 md:px-6 py-5 border-b border-secondary-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg"> {str("Consultation Update")} - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/Components/CriticalCareRecording/DailyRound__Medicines.res b/src/Components/CriticalCareRecording/DailyRound__Medicines.res index 4ecca39a4f5..ce143c24d29 100644 --- a/src/Components/CriticalCareRecording/DailyRound__Medicines.res +++ b/src/Components/CriticalCareRecording/DailyRound__Medicines.res @@ -8,20 +8,20 @@ let make = (~prescriptions) => { : + className="align-middle inline-block min-w-full shadow overflow-hidden sm:rounded-lg border-b border-secondary-200"> + className="px-6 py-3 border-b border-secondary-200 bg-secondary-50 text-left text-xs leading-4 font-medium text-secondary-500 uppercase tracking-wider"> {str("Medicine")} + className="px-6 py-3 border-b border-secondary-200 bg-secondary-50 text-left text-xs leading-4 font-medium text-secondary-500 uppercase tracking-wider"> {str("Dosage")} + className="px-6 py-3 border-b border-secondary-200 bg-secondary-50 text-left text-xs leading-4 font-medium text-secondary-500 uppercase tracking-wider"> {str("Days")} @@ -29,13 +29,15 @@ let make = (~prescriptions) => { {Js.Array.mapi((p, index) => { + className="px-6 py-4 whitespace-nowrap text-sm leading-5 font-medium text-secondary-900"> {str(Prescription__Prescription.medicine(p))} - + {str(Prescription__Prescription.dosage(p))} - + {str(string_of_int(Prescription__Prescription.days(p)))} diff --git a/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res b/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res index 829df2aa078..47cc040440e 100644 --- a/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res +++ b/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res @@ -53,7 +53,7 @@ let reducer = (state, action) => { switch action { | SetPain(pain) => { ...state, - pain: pain, + pain, dirty: true, } | SetSystolic(systolic) => { @@ -85,10 +85,10 @@ let reducer = (state, action) => { resp: Some(resp), dirty: true, } - | SetRhythm(rhythm) => {...state, rhythm: rhythm, dirty: true} + | SetRhythm(rhythm) => {...state, rhythm, dirty: true} | SetRhythmDetails(rhythmDetails) => { ...state, - rhythmDetails: rhythmDetails, + rhythmDetails, dirty: true, } | SetSaving => {...state, saving: true} @@ -143,7 +143,11 @@ let makePayload = state => { Js.Dict.set(payload, "bp", Js.Json.object_(makeBpPayload(systolic, diastolic))) | (_, _) => () } - Js.Dict.set(payload, "pain_scale_enhanced", Js.Json.objectArray(Js.Array.map(makePainField, state.pain))) + Js.Dict.set( + payload, + "pain_scale_enhanced", + Js.Json.objectArray(Js.Array.map(makePainField, state.pain)), + ) DictUtils.setOptionalNumber("pulse", state.pulse, payload) DictUtils.setOptionalNumber("ventilator_spo2", state.spo2, payload) DictUtils.setOptionalFloat( @@ -256,11 +260,11 @@ let make = (~hemodynamicParameter, ~updateCB, ~id, ~consultationId) => { hasError={ValidationUtils.isInputInRangeInt(0, 100, state.spo2)} /> - + ToggleTemperatureUnit->send}> {state.tempInCelcius ? "C"->str : "F"->str} } @@ -291,19 +295,19 @@ let make = (~hemodynamicParameter, ~updateCB, ~id, ~consultationId) => { {str("Pain")} - {str("Mark region and intensity of pain")} + {str("Mark region and intensity of pain")} { - send(SetPain(data)); + send(SetPain(data)) }} id={id} consultationId={consultationId} /> - + { send(SetRhythmDetails(ReactEvent.Form.target(e)["value"]))} diff --git a/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res b/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res index 0c285cd9714..94f68240720 100644 --- a/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res +++ b/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res @@ -17,7 +17,7 @@ let make = ( {switch HemodynamicParameters.bp(hemodynamicParameter) { | Some(data) => - + {title("Blood Pressure: ")} {renderIntWithIndicators("Systolic", data.systolic, 100, 140, "Low", "High")} {renderIntWithIndicators("Diastolic", data.diastolic, 50, 90, "Low", "High")} @@ -53,12 +53,12 @@ let make = ( )} {str("Pain Scale")} ()} - id={""} - consultationId={""} - /> + previewMode={true} + painParameter={HemodynamicParameters.pain(hemodynamicParameter)} + updateCB={_ => ()} + id={""} + consultationId={""} + /> {renderLine( "Rhythm", HemodynamicParameters.rhythmToString(HemodynamicParameters.rhythm(hemodynamicParameter)), diff --git a/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res b/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res index 97d1001fc61..17f6f3c34dd 100644 --- a/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res +++ b/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res @@ -7,81 +7,73 @@ let make = (~ioBalance, ~title, ~renderOptionalDescription) => { {title("Infusions")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.infusions(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.infusions(ioBalance))->React.array} {title("IV Fluid")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.ivFluid(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.ivFluid(ioBalance))->React.array} {title("Feed")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.feed(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.feed(ioBalance))->React.array} {title("Output")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.output(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.output(ioBalance))->React.array} {renderOptionalDescription( diff --git a/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res b/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res index 9c59996964b..b858c19f61a 100644 --- a/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res +++ b/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res @@ -3,7 +3,7 @@ let str = React.string @react.component let make = (~leftMain, ~rightMain, ~rightSub, ~noBorder=false) => { - {str(leftMain)} + {str(leftMain)} {str(rightSub)} {str(rightMain)} diff --git a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res index 780e5abd751..448b74cf726 100644 --- a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res +++ b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res @@ -27,7 +27,7 @@ let renderSelectables = (selections, updateCB) => type_="button" key={index |> string_of_int} onClick={_ => updateCB(selection)} - className="w-full block px-4 py-2 text-sm leading-5 text-left text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"> + className="w-full block px-4 py-2 text-sm leading-5 text-left text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:outline-none focus:bg-secondary-100 focus:text-secondary-900"> {selection |> str} ) @@ -76,9 +76,12 @@ let make = (~id, ~value, ~updateCB, ~placeholder, ~selectables) => { id value autoComplete="off" - onClick={e => {ReactEvent.Mouse.stopPropagation(e);setShowDropdown(_ => !showDropdown)}} + onClick={e => { + ReactEvent.Mouse.stopPropagation(e) + setShowDropdown(_ => !showDropdown) + }} onChange={e => updateCB(ReactEvent.Form.target(e)["value"])} - className="appearance-none h-10 mt-1 block w-full border border-gray-400 rounded py-2 px-4 text-sm bg-gray-100 hover:bg-gray-200 focus:outline-none focus:bg-white focus:ring-primary-500" + className="appearance-none h-10 mt-1 block w-full border border-secondary-400 rounded py-2 px-4 text-sm bg-secondary-100 hover:bg-secondary-200 focus:outline-none focus:bg-white focus:ring-primary-500" placeholder required=true /> diff --git a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res index be062f539a4..73d07909555 100644 --- a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res +++ b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res @@ -34,7 +34,7 @@ let showUnit = (name, item, params, index, send) => { string_of_int} - className="appearance-none h-10 mt-1 block w-full border border-gray-400 rounded py-2 px-4 text-sm bg-gray-100 hover:bg-gray-200 focus:outline-none focus:bg-white focus:ring-primary-500" + className="appearance-none h-10 mt-1 block w-full border border-secondary-400 rounded py-2 px-4 text-sm bg-secondary-100 hover:bg-secondary-200 focus:outline-none focus:bg-white focus:ring-primary-500" placeholder="Value" onChange={e => UpdateValue(ReactEvent.Form.target(e)["value"]->Js.Float.fromString, index)->send} @@ -46,7 +46,7 @@ let showUnit = (name, item, params, index, send) => { index->DeleteUnit->send} - className="appearance-none h-10 mt-1 block border border-gray-400 rounded py-2 px-4 text-sm bg-gray-100 hover:bg-gray-200 focus:outline-none focus:bg-white focus:border-gray-600 text-gray-600 font-bold"> + className="appearance-none h-10 mt-1 block border border-secondary-400 rounded py-2 px-4 text-sm bg-secondary-100 hover:bg-secondary-200 focus:outline-none focus:bg-white focus:border-secondary-600 text-secondary-600 font-bold"> {"x"->str} @@ -60,17 +60,17 @@ let make = (~name, ~items, ~collection, ~updateCB) => { collection, ) - + {name->str} - + {"Field"->str} - + {"Value (ml)"->str} @@ -79,11 +79,11 @@ let make = (~name, ~items, ~collection, ~updateCB) => { (item, index) => showUnit(name, item, selectables, index, send), items, )->React.array} - + AddUnit->send} - className="w-full font-bold block px-4 py-2 text-sm leading-5 text-left text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"> + className="w-full font-bold block px-4 py-2 text-sm leading-5 text-left text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:outline-none focus:bg-secondary-100 focus:text-secondary-900"> {"+ Add a field"->str} diff --git a/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res b/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res index a2e12214329..0123f5088d6 100644 --- a/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res +++ b/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res @@ -11,7 +11,7 @@ let make = (~name, ~text, ~onChange, ~label=name) => { {str(label)} { ~name="consciousness_level", )} {ReactUtils.nullIf(renderPupil(state, send), state.inPronePosition)} - + {str("Glasgow Coma Scale")} @@ -541,7 +541,7 @@ let make = (~updateCB, ~neurologicalMonitoring, ~id, ~consultationId) => { - + {str("Limb Response")} @@ -568,7 +568,7 @@ let make = (~updateCB, ~neurologicalMonitoring, ~id, ~consultationId) => { )} - + { + className="flex flex-row font-semibold leading-relaxed items-center justify-between px-4 py-2 border rounded border-secondary-500"> {str("The patient is on prone position")} - onChange(!checked)} > + onChange(!checked)}> { /> - + } diff --git a/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res b/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res index 7dd295ecb51..74b6147de59 100644 --- a/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res +++ b/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res @@ -17,7 +17,7 @@ let make = ( ), )} - + {title("Left Pupil")} {renderOptionalInt("Size", NeurologicalMonitoring.leftPupilSize(neurologicalMonitoring))} {renderOptionalDescription( @@ -35,7 +35,7 @@ let make = ( NeurologicalMonitoring.leftPupilLightReactionDetails(neurologicalMonitoring), )} - + {title("Right Pupil")} {renderOptionalInt("Size", NeurologicalMonitoring.rightPupilSize(neurologicalMonitoring))} {renderOptionalDescription( @@ -73,7 +73,8 @@ let make = ( {title("Limb Response")} - + {renderLine( "Upper Left", NeurologicalMonitoring.limpResponseToString( @@ -81,7 +82,8 @@ let make = ( ), )} - + {renderLine( "Upper Right", NeurologicalMonitoring.limpResponseToString( @@ -91,7 +93,8 @@ let make = ( - + {renderLine( "Lower Left", NeurologicalMonitoring.limpResponseToString( @@ -99,7 +102,8 @@ let make = ( ), )} - + {renderLine( "Lower Right", NeurologicalMonitoring.limpResponseToString( diff --git a/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res b/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res index f6dc3f5ab73..d24d60a4614 100644 --- a/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res +++ b/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res @@ -124,7 +124,7 @@ let make = (~nursingCare, ~updateCB, ~id, ~consultationId) => { | Some(s) => diff --git a/src/Components/CriticalCareRecording/Others/DailyRound__General.res b/src/Components/CriticalCareRecording/Others/DailyRound__General.res index 22c5051083e..138eb7d2241 100644 --- a/src/Components/CriticalCareRecording/Others/DailyRound__General.res +++ b/src/Components/CriticalCareRecording/Others/DailyRound__General.res @@ -41,7 +41,7 @@ let make = (~others, ~renderOptionalDescription, ~title) => { {switch additionalSymptoms { | Some(symptomsArray) => Js.Array.map(id => { - + {str(symptoms[id - 1])} }, symptomsArray)->React.array diff --git a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res index da041231265..1401d465558 100644 --- a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res +++ b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res @@ -105,7 +105,7 @@ let reducer = (state, action) => { | ClearSaving => {...state, saving: false} | Update(parts) => { ...state, - parts: parts, + parts, } | SetPreviewMode => {...state, previewMode: true} | ClearPreviewMode => {...state, previewMode: false} @@ -151,7 +151,7 @@ let initialState = (psp, previewMode) => { selectedRegion: Pain.Other, saving: false, dirty: false, - previewMode: previewMode, + previewMode, } } @@ -160,7 +160,7 @@ let selectedClass = (part: option) => { | Some(p) => let score = p.scale if score <= 0 { - "text-gray-400 hover:bg-red-400 tooltip" + "text-secondary-400 hover:bg-red-400 tooltip" } else if score <= 3 { "text-red-200 hover:bg-red-400 tooltip" } else if score <= 6 { @@ -172,7 +172,7 @@ let selectedClass = (part: option) => { } else { "text-red-700 hover:bg-red-800 tooltip" } - | None => "text-gray-400 hover:text-red-200 tooltip" + | None => "text-secondary-400 hover:text-red-200 tooltip" } } // UI for each Label @@ -181,7 +181,7 @@ let selectedLabelClass = (part: option) => { | Some(p) => let score = p.scale if score <= 0 { - "bg-gray-300 text-black hover:bg-gray-400" + "bg-secondary-300 text-black hover:bg-secondary-400" } else if score <= 3 { "bg-red-200 text-red-700 hover:bg-red-400" } else if score <= 6 { @@ -193,7 +193,7 @@ let selectedLabelClass = (part: option) => { } else { "bg-red-700 text-white hover:bg-red-200" } - | None => "bg-gray-300 text-black hover:bg-red-200" + | None => "bg-secondary-300 text-black hover:bg-red-200" } } @@ -366,7 +366,8 @@ let make = (~painParameter, ~updateCB, ~id, ~consultationId, ~previewMode) => { // Toggle //Toggle Button - + {str(state.previewMode ? "Preview Mode" : "Edit Mode")} @@ -378,7 +379,7 @@ let make = (~painParameter, ~updateCB, ~id, ~consultationId, ~previewMode) => { /> - {str("Pain Scale")} + {str("Pain Scale")} {state.description !== "" ? - + {str("Description")} {str(state.description)} @@ -169,7 +169,7 @@ let make = ( + className="bg-secondary-50 px-4 py-3 sm:px-6 flex flex-col sm:flex-row items-center justify-between gap-2"> {!previewMode ? + className="mt-3 inline-flex w-full justify-center rounded-md border border-secondary-300 bg-white px-4 py-2 text-base font-medium text-secondary-700 shadow-sm hover:bg-secondary-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> {str(!previewMode ? "Cancel" : "Close")} diff --git a/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res b/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res index 2b3923f89d6..4695cafcbf1 100644 --- a/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res +++ b/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res @@ -3,9 +3,11 @@ open CriticalCare__Types @react.component let make = (~painParameter) => { - + - {str("Part")} {str("Scale")} + {str("Part")} + {str("Scale")} {Js.Array.map(pain => { diff --git a/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res b/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res index de3062edeb0..c6e7bffdb14 100644 --- a/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res +++ b/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res @@ -74,20 +74,20 @@ let reducer = (state, action) => { | AddSelectedPart(region) => { ...state, parts: Js.Array.concat( - Js.Array.filter(p => PressureSore.region(p) !== region, state.parts), + Js.Array.filter(p => PressureSore.region(p) !== region, state.parts), [ Belt.Option.getWithDefault( - Js.Array.find(p => PressureSore.region(p) === region, state.parts), - PressureSore.makeDefault(region) - ) - ] + Js.Array.find(p => PressureSore.region(p) === region, state.parts), + PressureSore.makeDefault(region), + ), + ], ), dirty: true, } | UpdateSelectedPart(part) => { ...state, parts: Js.Array.concat( - Js.Array.filter((item: PressureSore.part) => item.region != part.region, state.parts), + Js.Array.filter((item: PressureSore.part) => item.region != part.region, state.parts), [part], ), dirty: true, @@ -109,7 +109,7 @@ let reducer = (state, action) => { | ClearSaving => {...state, saving: false} | Update(parts) => { ...state, - parts: parts, + parts, } | SetPreviewMode => {...state, previewMode: true} | ClearPreviewMode => {...state, previewMode: false} @@ -122,8 +122,16 @@ let makeField = p => { Js.Dict.set(payload, "scale", Js.Json.number(float_of_int(PressureSore.scale(p)))) Js.Dict.set(payload, "width", Js.Json.number(p.width)) Js.Dict.set(payload, "length", Js.Json.number(p.length)) - Js.Dict.set(payload, "tissue_type", Js.Json.string(PressureSore.tissueTypeToString(p.tissue_type))) - Js.Dict.set(payload, "exudate_amount", Js.Json.string(PressureSore.extrudateAmountToString(p.exudate_amount))) + Js.Dict.set( + payload, + "tissue_type", + Js.Json.string(PressureSore.tissueTypeToString(p.tissue_type)), + ) + Js.Dict.set( + payload, + "exudate_amount", + Js.Json.string(PressureSore.extrudateAmountToString(p.exudate_amount)), + ) Js.Dict.set(payload, "description", Js.Json.string(p.description)) payload } @@ -159,35 +167,49 @@ let initialState = (psp, previewMode) => { selectedRegion: PressureSore.Other, saving: false, dirty: false, - previewMode: previewMode, + previewMode, } } let selectedClass = (part: option) => { switch part { | Some(p) => - let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) - if score <= 0.0 { "text-gray-400 hover:bg-red-400 tooltip" } - else if score <= 3.0 { "text-red-200 hover:bg-red-400 tooltip" } - else if score <= 6.0 { "text-red-400 hover:bg-red-500 tooltip" } - else if score <= 10.0 { "text-red-500 hover:bg-red-600 tooltip" } - else if score <= 15.0 { "text-red-600 hover:bg-red-700 tooltip" } - else { "text-red-700 hover:bg-red-800 tooltip" } - | None => "text-gray-400 hover:text-red-200 tooltip" + let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) + if score <= 0.0 { + "text-secondary-400 hover:bg-red-400 tooltip" + } else if score <= 3.0 { + "text-red-200 hover:bg-red-400 tooltip" + } else if score <= 6.0 { + "text-red-400 hover:bg-red-500 tooltip" + } else if score <= 10.0 { + "text-red-500 hover:bg-red-600 tooltip" + } else if score <= 15.0 { + "text-red-600 hover:bg-red-700 tooltip" + } else { + "text-red-700 hover:bg-red-800 tooltip" + } + | None => "text-secondary-400 hover:text-red-200 tooltip" } } // UI for each Label let selectedLabelClass = (part: option) => { switch part { | Some(p) => - let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) - if score <= 0.0 { "bg-gray-300 text-black hover:bg-gray-400" } - else if score <= 3.0 { "bg-red-200 text-red-700 hover:bg-red-400" } - else if score <= 6.0 { "bg-red-400 text-white hover:bg-red-500" } - else if score <= 10.0 { "bg-red-500 text-white hover:bg-red-600" } - else if score <= 15.0 { "bg-red-600 text-white hover:bg-red-700" } - else { "bg-red-700 text-white hover:bg-red-200" } - | None => "bg-gray-300 text-black hover:bg-red-200" + let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) + if score <= 0.0 { + "bg-secondary-300 text-black hover:bg-secondary-400" + } else if score <= 3.0 { + "bg-red-200 text-red-700 hover:bg-red-400" + } else if score <= 6.0 { + "bg-red-400 text-white hover:bg-red-500" + } else if score <= 10.0 { + "bg-red-500 text-white hover:bg-red-600" + } else if score <= 15.0 { + "bg-red-600 text-white hover:bg-red-700" + } else { + "bg-red-700 text-white hover:bg-red-200" + } + | None => "bg-secondary-300 text-black hover:bg-red-200" } } @@ -229,8 +251,9 @@ let getIntoView = (region: string, isPart: bool) => { } let renderBody = (state, send, title, partPaths, substr) => { - - let show = state.selectedRegion !== PressureSore.Other && partPaths->Belt.Array.some(p => PressureSore.regionForPath(p) === state.selectedRegion) + let show = + state.selectedRegion !== PressureSore.Other && + partPaths->Belt.Array.some(p => PressureSore.regionForPath(p) === state.selectedRegion) let inputModal = React.useRef(Js.Nullable.null) let isMouseOverInputModal = %raw(` @@ -260,30 +283,35 @@ let renderBody = (state, send, title, partPaths, substr) => { className={"p-1 col-auto text-sm rounded m-1 cursor-pointer " ++ selectedLabelClass(selectedPart)} id={PressureSore.regionToString(regionType)} - onClick={_ => getIntoView(PressureSore.regionToString(regionType), false)} - > + onClick={_ => getIntoView(PressureSore.regionToString(regionType), false)}> {str( Js.String.sliceToEnd( ~from=substr, - PressureSore.regionToString(regionType) ++ (pushScoreValue(selectedPart) === "0" ? "" : " : " ++ pushScoreValue(selectedPart)), + PressureSore.regionToString(regionType) ++ ( + pushScoreValue(selectedPart) === "0" + ? "" + : " : " ++ pushScoreValue(selectedPart) + ), ), )} - {state.previewMode ? React.null : - {switch selectedPart { - | Some(p) => - getIntoView(PressureSore.regionToString(regionType), false) - : _ => send(RemoveFromSelectedParts(p))} - /> - | None => React.null - }} - } + {state.previewMode + ? React.null + : + {switch selectedPart { + | Some(p) => + getIntoView(PressureSore.regionToString(regionType), false) + : _ => send(RemoveFromSelectedParts(p))} + /> + | None => React.null + }} + } }, partPaths)->React.array} @@ -297,17 +325,18 @@ let renderBody = (state, send, title, partPaths, substr) => { modalRef={ReactDOM.Ref.domRef(inputModal)} hideModal={_ => send(SetSelectedRegion(PressureSore.Other))} position={state.modalPosition} - part={ - Belt.Option.getWithDefault( - Js.Array.find(p => PressureSore.region(p) === state.selectedRegion, state.parts), - PressureSore.makeDefault(state.selectedRegion) - ) - } + part={Belt.Option.getWithDefault( + Js.Array.find(p => PressureSore.region(p) === state.selectedRegion, state.parts), + PressureSore.makeDefault(state.selectedRegion), + )} updatePart={part => send(UpdateSelectedPart(part))} previewMode={state.previewMode} /> - + {Js.Array.mapi((part, renderIndex) => { let regionType = PressureSore.regionForPath(part) let selectedPart = Js.Array.find(p => PressureSore.region(p) === regionType, state.parts) @@ -319,9 +348,13 @@ let renderBody = (state, send, title, partPaths, substr) => { fill="currentColor" id={"part" ++ PressureSore.regionToString(regionType)} onClick={e => { - send(ShowInputModal(part.region, {"x": e->ReactEvent.Mouse.clientX, "y": e->ReactEvent.Mouse.clientY})) - }} - > + send( + ShowInputModal( + part.region, + {"x": e->ReactEvent.Mouse.clientX, "y": e->ReactEvent.Mouse.clientY}, + ), + ) + }}> {str(PressureSore.regionToString(regionType))} }, partPaths)->React.array} @@ -348,7 +381,8 @@ let make = (~pressureSoreParameter, ~updateCB, ~id, ~consultationId, ~previewMod // Toggle //Toggle Button - + {str(state.previewMode ? "Preview Mode" : "Edit Mode")} @@ -360,7 +394,7 @@ let make = (~pressureSoreParameter, ~updateCB, ~id, ~consultationId, ~previewMod /> { let region = PressureSore.regionToString(state.region) - if (state.length === 0.0 && state.width === 0.0) { + if state.length === 0.0 && state.width === 0.0 { hideModal(e) } else if ( (state.length > 0.0 && state.width == 0.0) || (state.length == 0.0 && state.width > 0.0) @@ -198,31 +198,33 @@ let make = ( {str(state.width->Belt.Float.toString)} - {str("Width")} + {str("Width")} {str(state.length->Belt.Float.toString)} - {str("Length")} + {str("Length")} {str(state.exudate_amount->PressureSore.encodeExudateAmount)} - {str("Exudate Amount")} + + {str("Exudate Amount")} + {str(state.tissue_type->PressureSore.encodeTissueType)} - {str("Tissue Type")} + {str("Tissue Type")} {state.description !== "" ? - + {str("Description")} {str(state.description)} @@ -233,7 +235,7 @@ let make = ( + className="bg-secondary-50 px-4 py-3 sm:px-6 flex flex-col sm:flex-row items-center justify-between gap-2"> {str("Push Score: ")} {str(pushScore->Belt.Float.toString)} @@ -250,7 +252,7 @@ let make = ( + className="mt-3 inline-flex w-full justify-center rounded-md border border-secondary-300 bg-white px-4 py-2 text-base font-medium text-secondary-700 shadow-sm hover:bg-secondary-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> {str(!previewMode ? "Cancel" : "Close")} diff --git a/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res b/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res index 997e5447e70..cd24b26d37e 100644 --- a/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res +++ b/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res @@ -3,9 +3,11 @@ open CriticalCare__Types @react.component let make = (~pressureSoreParameter) => { - + - {str("Part")} {str("Push Score")} + {str("Part")} + {str("Push Score")} {Js.Array.map(pressure => { diff --git a/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res b/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res index d919215071e..a3729277e12 100644 --- a/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res +++ b/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res @@ -36,10 +36,11 @@ let basicEditor = (~facilityId, ~patientId, ~consultationId, ~id) => { href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds/${id}/update`}> - {str("Basic Editor")} - + + + } let editorNameToString = editor => { @@ -71,19 +72,19 @@ let editorToggle = (editorName, state, send) => { {str(editorNameToString(editorName))} {Belt.Option.isNone(editorUpdated) - ? + ? : } @@ -94,7 +95,7 @@ let reducer = (state, action) => { | ShowEditor(editor) => {...state, visibleEditor: Some(editor)} | CloseEditor => {...state, visibleEditor: None} | UpdateDailyRound(dailyRound, editor) => { - dailyRound: dailyRound, + dailyRound, visibleEditor: None, updatedEditors: Js.Array.concat([editor], state.updatedEditors), } @@ -103,7 +104,7 @@ let reducer = (state, action) => { let initialState = dailyRound => { visibleEditor: None, - dailyRound: dailyRound, + dailyRound, updatedEditors: [], } @@ -115,6 +116,21 @@ let updateDailyRound = (send, editor, dailyRound) => { let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => { let (state, send) = React.useReducer(reducer, initialState(dailyRound)) + let sections = + dailyRound.roundsType == VentilatorRound + ? [ + HemodynamicParametersEditor, + NeurologicalMonitoringEditor, + VentilatorParametersEditor, + ArterialBloodGasAnalysisEditor, + BloodSugarEditor, + IOBalanceEditor, + DialysisEditor, + PressureSoreEditor, + NursingCareEditor, + ] + : [NeurologicalMonitoringEditor, VentilatorParametersEditor] + {ReactUtils.nullUnless( @@ -135,7 +151,7 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => { {str("Back")} + className="bg-white px-2 md:px-6 py-5 border-b border-secondary-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg"> {switch editor { | NeurologicalMonitoringEditor => { | None => + className="bg-white px-2 md:px-6 py-5 border-b border-secondary-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg"> {str("Record Updates")} - {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)} {Js.Array.map(editor => { + {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)} + {Js.Array.map(editor => { editorToggle(editor, state, send) - }, [ - HemodynamicParametersEditor, - NeurologicalMonitoringEditor, - VentilatorParametersEditor, - ArterialBloodGasAnalysisEditor, - BloodSugarEditor, - IOBalanceEditor, - DialysisEditor, - PressureSoreEditor, - NursingCareEditor, - ])->React.array} + }, sections)->React.array} - Notifications.success({msg: "Detailed Update filed successfully"})} + onClick={_ => Notifications.success({msg: "Detailed Update filed successfully"})} className="btn btn-primary w-full mt-6"> {str("Complete")} diff --git a/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res b/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res index 0933f46bf1a..cd3010b1c1d 100644 --- a/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res +++ b/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res @@ -115,7 +115,7 @@ let makePayload = (state: VentilatorParameters.state) => { DictUtils.setOptionalNumber("ventilator_tidal_volume", state.ventilator_tidal_volume, payload) DictUtils.setOptionalNumber( "ventilator_oxygen_modality_oxygen_rate", - state.ventilator_interface === UNKNOWN && + state.ventilator_interface === OXYGEN_SUPPORT && state.ventilator_oxygen_modality !== HIGH_FLOW_NASAL_CANNULA ? state.ventilator_oxygen_modality_oxygen_rate : None, diff --git a/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res b/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res index a0196a9baa9..76908972723 100644 --- a/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res +++ b/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res @@ -27,7 +27,7 @@ let renderSelectables = (selections, updateCB) => type_="button" key={index |> string_of_int} onClick={_ => updateCB(selection)} - className="w-full block px-4 py-2 text-sm leading-5 text-left text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"> + className="w-full block px-4 py-2 text-sm leading-5 text-left text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:outline-none focus:bg-secondary-100 focus:text-secondary-900"> {selection |> str} ) @@ -77,7 +77,10 @@ let make = (~id, ~value, ~updateCB, ~placeholder, ~selectables, ~label="", ~disa id value autoComplete="off" - onClick={e => {ReactEvent.Mouse.stopPropagation(e); setShowDropdown(_ => !showDropdown)}} + onClick={e => { + ReactEvent.Mouse.stopPropagation(e) + setShowDropdown(_ => !showDropdown) + }} onChange={e => updateCB(ReactEvent.Form.target(e)["value"])} className="cui-input-base appearance-none h-10 mt-1 block py-2 px-4" disabled diff --git a/src/Components/CriticalCareRecording/components/CriticalCare__Home.res b/src/Components/CriticalCareRecording/components/CriticalCare__Home.res index 13bfa2f9cfb..35f543f4c16 100644 --- a/src/Components/CriticalCareRecording/components/CriticalCare__Home.res +++ b/src/Components/CriticalCareRecording/components/CriticalCare__Home.res @@ -236,7 +236,7 @@ // // // // -// +// // // {str("Glasgow Coma Scale")} // @@ -257,7 +257,7 @@ // // -// +// // // {str("Limb Response")} @@ -272,13 +272,13 @@ // // -// +// // // // -// +// // // {str("Ventillator Parameters")} @@ -291,14 +291,14 @@ // // -// +// // // {str("Infusions")} // // -// +// // // {str("Feed")} @@ -309,7 +309,7 @@ // // -// +// // // {str("Output")} @@ -324,3 +324,4 @@ // // } + diff --git a/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res b/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res index 445d0874066..d133348e4d6 100644 --- a/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res +++ b/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res @@ -2,17 +2,21 @@ let str = React.string @react.component let make = (~labels) => { - - {labels|>Array.map((x) => { - - - {str(x)} - - - - - - }) - |> React.array } - + + {labels + |> Array.map(x => { + + {str(x)} + + + + + }) + |> React.array} + } diff --git a/src/Components/CriticalCareRecording/components/PressureSore.js b/src/Components/CriticalCareRecording/components/PressureSore.js index 1aa32607546..b03dbf4de19 100644 --- a/src/Components/CriticalCareRecording/components/PressureSore.js +++ b/src/Components/CriticalCareRecording/components/PressureSore.js @@ -203,7 +203,7 @@ export default function PressureSore() { className={ selected === renderIndex ? "text-blue-500" - : "text-gray-300 hover:text-blue-400" + : "text-secondary-300 hover:text-blue-400" } fill="currentColor" onClick={(_) => setSelected(renderIndex)} diff --git a/src/Components/DeathReport/DeathReport.tsx b/src/Components/DeathReport/DeathReport.tsx index e25a59c8732..6ed8652d22d 100644 --- a/src/Components/DeathReport/DeathReport.tsx +++ b/src/Components/DeathReport/DeathReport.tsx @@ -6,7 +6,11 @@ import TextFormField from "../Form/FormFields/TextFormField"; import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; import DateFormField from "../Form/FormFields/DateFormField"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; -import { formatDateTime, patientAgeInYears } from "../../Utils/utils"; +import { + formatDateTime, + humanizeStrings, + patientAgeInYears, +} from "../../Utils/utils"; import Page from "../Common/components/Page"; import Form from "../Form/Form"; import { useTranslation } from "react-i18next"; @@ -89,8 +93,9 @@ export default function PrintDeathReport(props: { id: string }) { patientData.medical_history && patientData.medical_history.length ) { - const medHis = patientData.medical_history; - return medHis.map((item: any) => item.disease).join(", "); + return humanizeStrings( + patientData.medical_history.map((item: any) => item.disease), + ); } else { return "None"; } diff --git a/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx b/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx index 4f3b102acc9..71f6e2888a0 100644 --- a/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx +++ b/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx @@ -30,7 +30,8 @@ export default function ConditionVerificationStatusMenu< className={classNames( props.className, props.value && StatusStyle[props.value].colors, - props.value && "border !border-gray-400 bg-white hover:bg-gray-300", + props.value && + "border !border-secondary-400 bg-white hover:bg-secondary-300", )} id="condition-verification-status-menu" title={props.value ? t(props.value) : props.placeholder ?? t("add_as")} @@ -49,7 +50,9 @@ export default function ConditionVerificationStatusMenu< icon="l-coronavirus" className={classNames( "hidden text-lg transition-all duration-200 ease-in-out group-hover:rotate-90 group-hover:text-inherit md:block", - props.value === status ? "text-inherit-500" : "text-gray-500", + props.value === status + ? "text-inherit-500" + : "text-secondary-500", )} /> } @@ -65,7 +68,7 @@ export default function ConditionVerificationStatusMenu< : ""} {t(status)} - + {t(`help_${status}`)} diff --git a/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx b/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx index b2bab809813..0391748c929 100644 --- a/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx +++ b/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx @@ -21,7 +21,7 @@ interface CreateDiagnosesProps { export const CreateDiagnosesBuilder = (props: CreateDiagnosesProps) => { return ( - + {props.value.map((diagnosis, index) => ( @@ -45,7 +45,7 @@ export const CreateDiagnosesBuilder = (props: CreateDiagnosesProps) => { {props.value.length === 0 && } - + obj.diagnosis_object as ICD11DiagnosisModel, @@ -85,7 +85,7 @@ export const EditDiagnosesBuilder = (props: EditDiagnosesProps) => { const [diagnoses, setDiagnoses] = useState(props.value); return ( - +
{description}
{dragProps.fileDropError !== "" && dragProps.fileDropError} @@ -181,7 +185,7 @@ export default function ExcelFileDragAndDrop({ /> {selectedFile && (
{selectedFile.name} - {(selectedFile.size / 1024).toFixed(2)} KB
{selectedFile.name}
Showing {currentPage * rowsPerPage - rowsPerPage + 1} to{" "} {currentPage * rowsPerPage > fileData.length ? fileData.length @@ -242,7 +242,7 @@ const ExcelViewer = ({ /> )} { setRowsPerPage(+e.target.value); diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx index 2b820b40d6a..526bf6d68ac 100644 --- a/src/Components/Common/FacilitySelect.tsx +++ b/src/Components/Common/FacilitySelect.tsx @@ -17,7 +17,7 @@ interface FacilitySelectProps { district?: string; state?: string; showAll?: boolean; - showNOptions?: number; + showNOptions?: number | undefined; freeText?: boolean; selected?: FacilityModel | FacilityModel[] | null; setSelected: (selected: FacilityModel | FacilityModel[] | null) => void; @@ -34,7 +34,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => { searchAll, disabled = false, showAll = true, - showNOptions = 10, + showNOptions, className = "", facilityType, district, @@ -65,6 +65,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => { data?.results?.push({ name: text, }); + return data?.results; }, [searchAll, showAll, facilityType, district, exclude_user, freeText], diff --git a/src/Components/Common/FilePreviewDialog.tsx b/src/Components/Common/FilePreviewDialog.tsx index a8f455bc070..9098c8fa5f3 100644 --- a/src/Components/Common/FilePreviewDialog.tsx +++ b/src/Components/Common/FilePreviewDialog.tsx @@ -106,7 +106,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => { {fileUrl ? ( <> - + {file_state.name}.{file_state.extension} @@ -126,7 +126,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => { - + {file_state.isImage ? ( { Can't preview this file. Try downloading it. diff --git a/src/Components/Common/GLocationPicker.tsx b/src/Components/Common/GLocationPicker.tsx index f71583c2322..bfe95735127 100644 --- a/src/Components/Common/GLocationPicker.tsx +++ b/src/Components/Common/GLocationPicker.tsx @@ -222,7 +222,7 @@ const Map: React.FC = ({ > @@ -240,7 +240,7 @@ const Map: React.FC = ({ > )} diff --git a/src/Components/Common/HeadedTabs.tsx b/src/Components/Common/HeadedTabs.tsx index 38765431d94..33e8c96a239 100644 --- a/src/Components/Common/HeadedTabs.tsx +++ b/src/Components/Common/HeadedTabs.tsx @@ -20,7 +20,7 @@ export default function HeadedTabs(props: headedTabsProps) { { handleChange( @@ -34,7 +34,7 @@ export default function HeadedTabs(props: headedTabsProps) { - + { handleChange(tab.value); diff --git a/src/Components/Common/LanguageSelectorLogin.tsx b/src/Components/Common/LanguageSelectorLogin.tsx index 1f4e8593d2a..1fc4cf4ac77 100644 --- a/src/Components/Common/LanguageSelectorLogin.tsx +++ b/src/Components/Common/LanguageSelectorLogin.tsx @@ -18,7 +18,7 @@ export const LanguageSelectorLogin = () => { }; return ( - + {t("available_in")} diff --git a/src/Components/Common/PageTitle.tsx b/src/Components/Common/PageTitle.tsx index 990dc7b72cc..3af4c873872 100644 --- a/src/Components/Common/PageTitle.tsx +++ b/src/Components/Common/PageTitle.tsx @@ -70,7 +70,7 @@ export default function PageTitle({ > {" "} )} diff --git a/src/Components/Common/Sidebar/Sidebar.tsx b/src/Components/Common/Sidebar/Sidebar.tsx index abd158b2da7..9c26de9a051 100644 --- a/src/Components/Common/Sidebar/Sidebar.tsx +++ b/src/Components/Common/Sidebar/Sidebar.tsx @@ -223,7 +223,7 @@ interface ToggleShrinkProps { const ToggleShrink = ({ shrinked, toggle }: ToggleShrinkProps) => ( { @@ -53,9 +53,9 @@ const SidebarUserCard = ({ shrinked }: { shrinked: boolean }) => { > - {t("sign_out")} + {t("sign_out")} diff --git a/src/Components/Common/SlideOver.res b/src/Components/Common/SlideOver.res index dbcacbe1bad..75f1c963c6e 100644 --- a/src/Components/Common/SlideOver.res +++ b/src/Components/Common/SlideOver.res @@ -13,7 +13,7 @@ let make = (~show, ~setShow, ~children) => leaveFrom="opacity-100" leaveTo="opacity-0"> setShow(false)} /> diff --git a/src/Components/Common/Steps.tsx b/src/Components/Common/Steps.tsx index e0b1e03af3f..31c5145835f 100644 --- a/src/Components/Common/Steps.tsx +++ b/src/Components/Common/Steps.tsx @@ -13,7 +13,7 @@ export default function Steps(props: { steps: Step[] }) { {props.steps.map((step, stepIdx) => ( @@ -34,7 +34,7 @@ export default function Steps(props: { steps: Step[] }) { aria-hidden="true" /> - + {step.name} @@ -66,12 +66,12 @@ export default function Steps(props: { steps: Step[] }) { }`} > - - + + {step.id} - + {step.name} @@ -85,7 +85,7 @@ export default function Steps(props: { steps: Step[] }) { aria-hidden="true" > + - + {date} - + {incidents.length === 0 ? ( <> No status for the day @@ -119,7 +119,7 @@ function UptimeInfo({ ); })} - + Total downtime @@ -372,7 +372,7 @@ export default function Uptime( {props.header} - + {getUptimePercent(numDays)}% uptime @@ -425,7 +425,7 @@ export default function Uptime( })} diff --git a/src/Components/Common/UserAutocompleteFormField.tsx b/src/Components/Common/UserAutocompleteFormField.tsx index 9e94c5e4e68..c7694b74e4e 100644 --- a/src/Components/Common/UserAutocompleteFormField.tsx +++ b/src/Components/Common/UserAutocompleteFormField.tsx @@ -48,7 +48,7 @@ export default function UserAutocompleteFormField(props: Props) { - + {props.title}: {props.children} diff --git a/src/Components/Common/components/ButtonV2.tsx b/src/Components/Common/components/ButtonV2.tsx index 3bc5a41e799..2c9579873b1 100644 --- a/src/Components/Common/components/ButtonV2.tsx +++ b/src/Components/Common/components/ButtonV2.tsx @@ -102,7 +102,7 @@ const ButtonV2 = ({ }: ButtonProps) => { const className = classNames( props.className, - "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-gray-200 disabled:text-gray-500", + "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500", `button-size-${size}`, `button-shape-${circle ? "circle" : "square"}`, ghost ? `button-${variant}-ghost` : `button-${variant}-default`, diff --git a/src/Components/Common/components/ContactLink.tsx b/src/Components/Common/components/ContactLink.tsx index 762558f5bb2..ff13433cc3b 100644 --- a/src/Components/Common/components/ContactLink.tsx +++ b/src/Components/Common/components/ContactLink.tsx @@ -13,7 +13,7 @@ export default function ContactLink(props: ContactLinkProps) { > {props.tel ? props.tel : props.mailto} diff --git a/src/Components/Common/components/Menu.tsx b/src/Components/Common/components/Menu.tsx index 1caac9edc12..a6f66ff9d2f 100644 --- a/src/Components/Common/components/Menu.tsx +++ b/src/Components/Common/components/Menu.tsx @@ -34,7 +34,7 @@ export default function DropdownMenu({ - + @@ -57,7 +57,7 @@ let profileCard = () => - + diff --git a/src/Components/Common/components/Switch.tsx b/src/Components/Common/components/Switch.tsx index 2253e95d155..7be7490f7b1 100644 --- a/src/Components/Common/components/Switch.tsx +++ b/src/Components/Common/components/Switch.tsx @@ -29,7 +29,7 @@ export default function SwitchV2(props: SwitchProps) { const additionalClassNames = selected ? (props.optionClassName && props.optionClassName(option)) || "bg-primary-500 hover:bg-primary-600 text-white border-primary-500 focus:ring-primary-500 focus:border-primary-500" - : "bg-gray-50 hover:bg-gray-200 border-gray-400 focus:ring-primary-500 focus:border-primary-500"; + : "bg-secondary-50 hover:bg-secondary-200 border-secondary-400 focus:ring-primary-500 focus:border-primary-500"; return ( + <>{item}> ); diff --git a/src/Components/Common/prescription-builder/InvestigationBuilder.tsx b/src/Components/Common/prescription-builder/InvestigationBuilder.tsx index 6de2a83f1cb..ef99a7f1acc 100644 --- a/src/Components/Common/prescription-builder/InvestigationBuilder.tsx +++ b/src/Components/Common/prescription-builder/InvestigationBuilder.tsx @@ -4,6 +4,7 @@ import { PrescriptionMultiDropdown } from "./PrescriptionMultiselect"; import CareIcon from "../../../CAREUI/icons/CareIcon"; import request from "../../../Utils/request/request"; import routes from "../../../Redux/api"; +import { humanizeStrings } from "../../../Utils/utils"; export type InvestigationType = { type?: string[]; @@ -86,9 +87,9 @@ export default function InvestigationBuilder( return ( data?.results.map( (investigation) => - `${investigation.name} -- ${investigation.groups - .map((group) => ` ( ${group.name} ) `) - .join(", ")}`, + `${investigation.name} -- ${humanizeStrings( + investigation.groups.map((group) => ` ( ${group.name} ) `), + )}`, ) ?? [] ); }; @@ -125,16 +126,16 @@ export default function InvestigationBuilder( - + Investigation No. {i + 1} setInvestigations( investigations.filter((investigation, index) => i != index), @@ -210,7 +211,7 @@ export default function InvestigationBuilder( Time{" *"} { setItem( @@ -257,7 +258,7 @@ export default function InvestigationBuilder( onClick={() => { setInvestigations([...investigations, { repetitive: false }]); }} - className="mt-4 block w-full bg-gray-200 px-4 py-2 text-left text-sm font-bold leading-5 text-gray-700 shadow-sm hover:bg-gray-300 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900 focus:outline-none" + className="mt-4 block w-full bg-secondary-200 px-4 py-2 text-left text-sm font-bold leading-5 text-secondary-700 shadow-sm hover:bg-secondary-300 hover:text-secondary-900 focus:bg-secondary-100 focus:text-secondary-900 focus:outline-none" > + Add Investigation diff --git a/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx b/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx index dbfa0749ef1..6d122d00a5a 100644 --- a/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx +++ b/src/Components/Common/prescription-builder/PrescriptionDropdown.tsx @@ -62,7 +62,7 @@ export function PrescriptionDropdown(props: { id="frequency-interval" type="button" key={i} - className="block w-full px-4 py-2 text-left text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900 focus:outline-none" + className="block w-full px-4 py-2 text-left text-sm leading-5 text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:bg-secondary-100 focus:text-secondary-900 focus:outline-none" onClick={() => { setValue(option); setOpen(false); diff --git a/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx b/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx index 79ae3356ee4..4f744bcbae7 100644 --- a/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx +++ b/src/Components/Common/prescription-builder/PrescriptionMultiselect.tsx @@ -84,10 +84,10 @@ export function PrescriptionMultiDropdown(props: { id="investigation-group" key={i} className={classNames( - "block w-full px-4 py-2 text-left text-sm leading-5 text-gray-700 hover:text-gray-900 focus:text-gray-900 focus:outline-none", + "block w-full px-4 py-2 text-left text-sm leading-5 text-secondary-700 hover:text-secondary-900 focus:text-secondary-900 focus:outline-none", selectedValues.includes(option) ? "bg-primary-100 hover:bg-primary-200" - : "hover:bg-gray-100 focus:bg-gray-100", + : "hover:bg-secondary-100 focus:bg-secondary-100", )} onClick={() => { setSelectedValues( diff --git a/src/Components/Common/prescription-builder/ProcedureBuilder.tsx b/src/Components/Common/prescription-builder/ProcedureBuilder.tsx index 5eca95354bf..fe7ec3cda3c 100644 --- a/src/Components/Common/prescription-builder/ProcedureBuilder.tsx +++ b/src/Components/Common/prescription-builder/ProcedureBuilder.tsx @@ -41,18 +41,18 @@ export default function ProcedureBuilder(props: Props) { - + Procedure No. {i + 1} setProcedures( procedures.filter((procedure, index) => i != index), @@ -69,7 +69,7 @@ export default function ProcedureBuilder(props: Props) { ) { setActiveIdx(i)} onBlur={() => setActiveIdx(null)} @@ -160,7 +160,7 @@ export default function ProcedureBuilder(props: Props) { Notes setActiveIdx(i)} @@ -186,7 +186,7 @@ export default function ProcedureBuilder(props: Props) { onClick={() => { setProcedures([...procedures, { repetitive: false }]); }} - className="mt-4 block w-full bg-gray-200 px-4 py-2 text-left text-sm font-bold leading-5 text-gray-700 shadow-sm hover:bg-gray-300 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900 focus:outline-none" + className="mt-4 block w-full bg-secondary-200 px-4 py-2 text-left text-sm font-bold leading-5 text-secondary-700 shadow-sm hover:bg-secondary-300 hover:text-secondary-900 focus:bg-secondary-100 focus:text-secondary-900 focus:outline-none" > + Add Procedures diff --git a/src/Components/CriticalCareRecording/CriticalCare__Index.res b/src/Components/CriticalCareRecording/CriticalCare__Index.res index 56bc5623264..0290728fd82 100644 --- a/src/Components/CriticalCareRecording/CriticalCare__Index.res +++ b/src/Components/CriticalCareRecording/CriticalCare__Index.res @@ -11,17 +11,20 @@ let renderLine = (title, value) => { let renderIndicators = (title, value, isMin, isMax, minText, maxText) => { let indicator = if isMax { - {str(maxText)} + + {str(maxText)} } else if isMin { - {str(minText)} + + {str(minText)} } else { - {str("Normal")} + + {str("Normal")} } @@ -109,25 +112,25 @@ let make = ( + className="bg-white px-2 md:px-6 py-5 border-b border-secondary-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg"> {str("Consultation Update")} - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/Components/CriticalCareRecording/DailyRound__Medicines.res b/src/Components/CriticalCareRecording/DailyRound__Medicines.res index 4ecca39a4f5..ce143c24d29 100644 --- a/src/Components/CriticalCareRecording/DailyRound__Medicines.res +++ b/src/Components/CriticalCareRecording/DailyRound__Medicines.res @@ -8,20 +8,20 @@ let make = (~prescriptions) => { : + className="align-middle inline-block min-w-full shadow overflow-hidden sm:rounded-lg border-b border-secondary-200"> + className="px-6 py-3 border-b border-secondary-200 bg-secondary-50 text-left text-xs leading-4 font-medium text-secondary-500 uppercase tracking-wider"> {str("Medicine")} + className="px-6 py-3 border-b border-secondary-200 bg-secondary-50 text-left text-xs leading-4 font-medium text-secondary-500 uppercase tracking-wider"> {str("Dosage")} + className="px-6 py-3 border-b border-secondary-200 bg-secondary-50 text-left text-xs leading-4 font-medium text-secondary-500 uppercase tracking-wider"> {str("Days")} @@ -29,13 +29,15 @@ let make = (~prescriptions) => { {Js.Array.mapi((p, index) => { + className="px-6 py-4 whitespace-nowrap text-sm leading-5 font-medium text-secondary-900"> {str(Prescription__Prescription.medicine(p))} - + {str(Prescription__Prescription.dosage(p))} - + {str(string_of_int(Prescription__Prescription.days(p)))} diff --git a/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res b/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res index 829df2aa078..47cc040440e 100644 --- a/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res +++ b/src/Components/CriticalCareRecording/HemodynamicParameters/CriticalCare__HemodynamicParametersEditor.res @@ -53,7 +53,7 @@ let reducer = (state, action) => { switch action { | SetPain(pain) => { ...state, - pain: pain, + pain, dirty: true, } | SetSystolic(systolic) => { @@ -85,10 +85,10 @@ let reducer = (state, action) => { resp: Some(resp), dirty: true, } - | SetRhythm(rhythm) => {...state, rhythm: rhythm, dirty: true} + | SetRhythm(rhythm) => {...state, rhythm, dirty: true} | SetRhythmDetails(rhythmDetails) => { ...state, - rhythmDetails: rhythmDetails, + rhythmDetails, dirty: true, } | SetSaving => {...state, saving: true} @@ -143,7 +143,11 @@ let makePayload = state => { Js.Dict.set(payload, "bp", Js.Json.object_(makeBpPayload(systolic, diastolic))) | (_, _) => () } - Js.Dict.set(payload, "pain_scale_enhanced", Js.Json.objectArray(Js.Array.map(makePainField, state.pain))) + Js.Dict.set( + payload, + "pain_scale_enhanced", + Js.Json.objectArray(Js.Array.map(makePainField, state.pain)), + ) DictUtils.setOptionalNumber("pulse", state.pulse, payload) DictUtils.setOptionalNumber("ventilator_spo2", state.spo2, payload) DictUtils.setOptionalFloat( @@ -256,11 +260,11 @@ let make = (~hemodynamicParameter, ~updateCB, ~id, ~consultationId) => { hasError={ValidationUtils.isInputInRangeInt(0, 100, state.spo2)} /> - + ToggleTemperatureUnit->send}> {state.tempInCelcius ? "C"->str : "F"->str} } @@ -291,19 +295,19 @@ let make = (~hemodynamicParameter, ~updateCB, ~id, ~consultationId) => { {str("Pain")} - {str("Mark region and intensity of pain")} + {str("Mark region and intensity of pain")} { - send(SetPain(data)); + send(SetPain(data)) }} id={id} consultationId={consultationId} /> - + { send(SetRhythmDetails(ReactEvent.Form.target(e)["value"]))} diff --git a/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res b/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res index 0c285cd9714..94f68240720 100644 --- a/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res +++ b/src/Components/CriticalCareRecording/HemodynamicParameters/DailyRound__HemodynamicParameters.res @@ -17,7 +17,7 @@ let make = ( {switch HemodynamicParameters.bp(hemodynamicParameter) { | Some(data) => - + {title("Blood Pressure: ")} {renderIntWithIndicators("Systolic", data.systolic, 100, 140, "Low", "High")} {renderIntWithIndicators("Diastolic", data.diastolic, 50, 90, "Low", "High")} @@ -53,12 +53,12 @@ let make = ( )} {str("Pain Scale")} ()} - id={""} - consultationId={""} - /> + previewMode={true} + painParameter={HemodynamicParameters.pain(hemodynamicParameter)} + updateCB={_ => ()} + id={""} + consultationId={""} + /> {renderLine( "Rhythm", HemodynamicParameters.rhythmToString(HemodynamicParameters.rhythm(hemodynamicParameter)), diff --git a/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res b/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res index 97d1001fc61..17f6f3c34dd 100644 --- a/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res +++ b/src/Components/CriticalCareRecording/IOBalance/DailyRound__IOBalance.res @@ -7,81 +7,73 @@ let make = (~ioBalance, ~title, ~renderOptionalDescription) => { {title("Infusions")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.infusions(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.infusions(ioBalance))->React.array} {title("IV Fluid")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.ivFluid(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.ivFluid(ioBalance))->React.array} {title("Feed")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.feed(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.feed(ioBalance))->React.array} {title("Output")} + className="text-left px-4 py-2 border bg-secondary-100 m-1 rounded-lg shadow md:w-1/2 w-full"> {str("Name")} {str("Quantity")} - {Js.Array.map( - item => - - {str(IOBalance.name(item))} - - {React.float(IOBalance.quantity(item))} - - , - IOBalance.output(ioBalance), - )->React.array} + {Js.Array.map(item => + + {str(IOBalance.name(item))} + + {React.float(IOBalance.quantity(item))} + + + , IOBalance.output(ioBalance))->React.array} {renderOptionalDescription( diff --git a/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res b/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res index 9c59996964b..b858c19f61a 100644 --- a/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res +++ b/src/Components/CriticalCareRecording/IOBalance/IOBalance__Summary.res @@ -3,7 +3,7 @@ let str = React.string @react.component let make = (~leftMain, ~rightMain, ~rightSub, ~noBorder=false) => { - {str(leftMain)} + {str(leftMain)} {str(rightSub)} {str(rightMain)} diff --git a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res index 780e5abd751..448b74cf726 100644 --- a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res +++ b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitPicker.res @@ -27,7 +27,7 @@ let renderSelectables = (selections, updateCB) => type_="button" key={index |> string_of_int} onClick={_ => updateCB(selection)} - className="w-full block px-4 py-2 text-sm leading-5 text-left text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"> + className="w-full block px-4 py-2 text-sm leading-5 text-left text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:outline-none focus:bg-secondary-100 focus:text-secondary-900"> {selection |> str} ) @@ -76,9 +76,12 @@ let make = (~id, ~value, ~updateCB, ~placeholder, ~selectables) => { id value autoComplete="off" - onClick={e => {ReactEvent.Mouse.stopPropagation(e);setShowDropdown(_ => !showDropdown)}} + onClick={e => { + ReactEvent.Mouse.stopPropagation(e) + setShowDropdown(_ => !showDropdown) + }} onChange={e => updateCB(ReactEvent.Form.target(e)["value"])} - className="appearance-none h-10 mt-1 block w-full border border-gray-400 rounded py-2 px-4 text-sm bg-gray-100 hover:bg-gray-200 focus:outline-none focus:bg-white focus:ring-primary-500" + className="appearance-none h-10 mt-1 block w-full border border-secondary-400 rounded py-2 px-4 text-sm bg-secondary-100 hover:bg-secondary-200 focus:outline-none focus:bg-white focus:ring-primary-500" placeholder required=true /> diff --git a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res index be062f539a4..73d07909555 100644 --- a/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res +++ b/src/Components/CriticalCareRecording/IOBalance/IOBalance__UnitSection.res @@ -34,7 +34,7 @@ let showUnit = (name, item, params, index, send) => { string_of_int} - className="appearance-none h-10 mt-1 block w-full border border-gray-400 rounded py-2 px-4 text-sm bg-gray-100 hover:bg-gray-200 focus:outline-none focus:bg-white focus:ring-primary-500" + className="appearance-none h-10 mt-1 block w-full border border-secondary-400 rounded py-2 px-4 text-sm bg-secondary-100 hover:bg-secondary-200 focus:outline-none focus:bg-white focus:ring-primary-500" placeholder="Value" onChange={e => UpdateValue(ReactEvent.Form.target(e)["value"]->Js.Float.fromString, index)->send} @@ -46,7 +46,7 @@ let showUnit = (name, item, params, index, send) => { index->DeleteUnit->send} - className="appearance-none h-10 mt-1 block border border-gray-400 rounded py-2 px-4 text-sm bg-gray-100 hover:bg-gray-200 focus:outline-none focus:bg-white focus:border-gray-600 text-gray-600 font-bold"> + className="appearance-none h-10 mt-1 block border border-secondary-400 rounded py-2 px-4 text-sm bg-secondary-100 hover:bg-secondary-200 focus:outline-none focus:bg-white focus:border-secondary-600 text-secondary-600 font-bold"> {"x"->str} @@ -60,17 +60,17 @@ let make = (~name, ~items, ~collection, ~updateCB) => { collection, ) - + {name->str} - + {"Field"->str} - + {"Value (ml)"->str} @@ -79,11 +79,11 @@ let make = (~name, ~items, ~collection, ~updateCB) => { (item, index) => showUnit(name, item, selectables, index, send), items, )->React.array} - + AddUnit->send} - className="w-full font-bold block px-4 py-2 text-sm leading-5 text-left text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"> + className="w-full font-bold block px-4 py-2 text-sm leading-5 text-left text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:outline-none focus:bg-secondary-100 focus:text-secondary-900"> {"+ Add a field"->str} diff --git a/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res b/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res index a2e12214329..0123f5088d6 100644 --- a/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res +++ b/src/Components/CriticalCareRecording/NeurologicalMonitoring/CriticalCare__Description.res @@ -11,7 +11,7 @@ let make = (~name, ~text, ~onChange, ~label=name) => { {str(label)} { ~name="consciousness_level", )} {ReactUtils.nullIf(renderPupil(state, send), state.inPronePosition)} - + {str("Glasgow Coma Scale")} @@ -541,7 +541,7 @@ let make = (~updateCB, ~neurologicalMonitoring, ~id, ~consultationId) => { - + {str("Limb Response")} @@ -568,7 +568,7 @@ let make = (~updateCB, ~neurologicalMonitoring, ~id, ~consultationId) => { )} - + { + className="flex flex-row font-semibold leading-relaxed items-center justify-between px-4 py-2 border rounded border-secondary-500"> {str("The patient is on prone position")} - onChange(!checked)} > + onChange(!checked)}> { /> - + } diff --git a/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res b/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res index 7dd295ecb51..74b6147de59 100644 --- a/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res +++ b/src/Components/CriticalCareRecording/NeurologicalMonitoring/DailyRound__NeurologicalMonitoring.res @@ -17,7 +17,7 @@ let make = ( ), )} - + {title("Left Pupil")} {renderOptionalInt("Size", NeurologicalMonitoring.leftPupilSize(neurologicalMonitoring))} {renderOptionalDescription( @@ -35,7 +35,7 @@ let make = ( NeurologicalMonitoring.leftPupilLightReactionDetails(neurologicalMonitoring), )} - + {title("Right Pupil")} {renderOptionalInt("Size", NeurologicalMonitoring.rightPupilSize(neurologicalMonitoring))} {renderOptionalDescription( @@ -73,7 +73,8 @@ let make = ( {title("Limb Response")} - + {renderLine( "Upper Left", NeurologicalMonitoring.limpResponseToString( @@ -81,7 +82,8 @@ let make = ( ), )} - + {renderLine( "Upper Right", NeurologicalMonitoring.limpResponseToString( @@ -91,7 +93,8 @@ let make = ( - + {renderLine( "Lower Left", NeurologicalMonitoring.limpResponseToString( @@ -99,7 +102,8 @@ let make = ( ), )} - + {renderLine( "Lower Right", NeurologicalMonitoring.limpResponseToString( diff --git a/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res b/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res index f6dc3f5ab73..d24d60a4614 100644 --- a/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res +++ b/src/Components/CriticalCareRecording/NursingCare/CriticalCare__NursingCareEditor.res @@ -124,7 +124,7 @@ let make = (~nursingCare, ~updateCB, ~id, ~consultationId) => { | Some(s) => diff --git a/src/Components/CriticalCareRecording/Others/DailyRound__General.res b/src/Components/CriticalCareRecording/Others/DailyRound__General.res index 22c5051083e..138eb7d2241 100644 --- a/src/Components/CriticalCareRecording/Others/DailyRound__General.res +++ b/src/Components/CriticalCareRecording/Others/DailyRound__General.res @@ -41,7 +41,7 @@ let make = (~others, ~renderOptionalDescription, ~title) => { {switch additionalSymptoms { | Some(symptomsArray) => Js.Array.map(id => { - + {str(symptoms[id - 1])} }, symptomsArray)->React.array diff --git a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res index da041231265..1401d465558 100644 --- a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res +++ b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainEditor.res @@ -105,7 +105,7 @@ let reducer = (state, action) => { | ClearSaving => {...state, saving: false} | Update(parts) => { ...state, - parts: parts, + parts, } | SetPreviewMode => {...state, previewMode: true} | ClearPreviewMode => {...state, previewMode: false} @@ -151,7 +151,7 @@ let initialState = (psp, previewMode) => { selectedRegion: Pain.Other, saving: false, dirty: false, - previewMode: previewMode, + previewMode, } } @@ -160,7 +160,7 @@ let selectedClass = (part: option) => { | Some(p) => let score = p.scale if score <= 0 { - "text-gray-400 hover:bg-red-400 tooltip" + "text-secondary-400 hover:bg-red-400 tooltip" } else if score <= 3 { "text-red-200 hover:bg-red-400 tooltip" } else if score <= 6 { @@ -172,7 +172,7 @@ let selectedClass = (part: option) => { } else { "text-red-700 hover:bg-red-800 tooltip" } - | None => "text-gray-400 hover:text-red-200 tooltip" + | None => "text-secondary-400 hover:text-red-200 tooltip" } } // UI for each Label @@ -181,7 +181,7 @@ let selectedLabelClass = (part: option) => { | Some(p) => let score = p.scale if score <= 0 { - "bg-gray-300 text-black hover:bg-gray-400" + "bg-secondary-300 text-black hover:bg-secondary-400" } else if score <= 3 { "bg-red-200 text-red-700 hover:bg-red-400" } else if score <= 6 { @@ -193,7 +193,7 @@ let selectedLabelClass = (part: option) => { } else { "bg-red-700 text-white hover:bg-red-200" } - | None => "bg-gray-300 text-black hover:bg-red-200" + | None => "bg-secondary-300 text-black hover:bg-red-200" } } @@ -366,7 +366,8 @@ let make = (~painParameter, ~updateCB, ~id, ~consultationId, ~previewMode) => { // Toggle //Toggle Button - + {str(state.previewMode ? "Preview Mode" : "Edit Mode")} @@ -378,7 +379,7 @@ let make = (~painParameter, ~updateCB, ~id, ~consultationId, ~previewMode) => { /> - {str("Pain Scale")} + {str("Pain Scale")} {state.description !== "" ? - + {str("Description")} {str(state.description)} @@ -169,7 +169,7 @@ let make = ( + className="bg-secondary-50 px-4 py-3 sm:px-6 flex flex-col sm:flex-row items-center justify-between gap-2"> {!previewMode ? + className="mt-3 inline-flex w-full justify-center rounded-md border border-secondary-300 bg-white px-4 py-2 text-base font-medium text-secondary-700 shadow-sm hover:bg-secondary-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> {str(!previewMode ? "Cancel" : "Close")} diff --git a/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res b/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res index 2b3923f89d6..4695cafcbf1 100644 --- a/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res +++ b/src/Components/CriticalCareRecording/Pain/DailyRound__Pain.res @@ -3,9 +3,11 @@ open CriticalCare__Types @react.component let make = (~painParameter) => { - + - {str("Part")} {str("Scale")} + {str("Part")} + {str("Scale")} {Js.Array.map(pain => { diff --git a/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res b/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res index de3062edeb0..c6e7bffdb14 100644 --- a/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res +++ b/src/Components/CriticalCareRecording/PressureSore/CriticalCare__PressureSoreEditor.res @@ -74,20 +74,20 @@ let reducer = (state, action) => { | AddSelectedPart(region) => { ...state, parts: Js.Array.concat( - Js.Array.filter(p => PressureSore.region(p) !== region, state.parts), + Js.Array.filter(p => PressureSore.region(p) !== region, state.parts), [ Belt.Option.getWithDefault( - Js.Array.find(p => PressureSore.region(p) === region, state.parts), - PressureSore.makeDefault(region) - ) - ] + Js.Array.find(p => PressureSore.region(p) === region, state.parts), + PressureSore.makeDefault(region), + ), + ], ), dirty: true, } | UpdateSelectedPart(part) => { ...state, parts: Js.Array.concat( - Js.Array.filter((item: PressureSore.part) => item.region != part.region, state.parts), + Js.Array.filter((item: PressureSore.part) => item.region != part.region, state.parts), [part], ), dirty: true, @@ -109,7 +109,7 @@ let reducer = (state, action) => { | ClearSaving => {...state, saving: false} | Update(parts) => { ...state, - parts: parts, + parts, } | SetPreviewMode => {...state, previewMode: true} | ClearPreviewMode => {...state, previewMode: false} @@ -122,8 +122,16 @@ let makeField = p => { Js.Dict.set(payload, "scale", Js.Json.number(float_of_int(PressureSore.scale(p)))) Js.Dict.set(payload, "width", Js.Json.number(p.width)) Js.Dict.set(payload, "length", Js.Json.number(p.length)) - Js.Dict.set(payload, "tissue_type", Js.Json.string(PressureSore.tissueTypeToString(p.tissue_type))) - Js.Dict.set(payload, "exudate_amount", Js.Json.string(PressureSore.extrudateAmountToString(p.exudate_amount))) + Js.Dict.set( + payload, + "tissue_type", + Js.Json.string(PressureSore.tissueTypeToString(p.tissue_type)), + ) + Js.Dict.set( + payload, + "exudate_amount", + Js.Json.string(PressureSore.extrudateAmountToString(p.exudate_amount)), + ) Js.Dict.set(payload, "description", Js.Json.string(p.description)) payload } @@ -159,35 +167,49 @@ let initialState = (psp, previewMode) => { selectedRegion: PressureSore.Other, saving: false, dirty: false, - previewMode: previewMode, + previewMode, } } let selectedClass = (part: option) => { switch part { | Some(p) => - let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) - if score <= 0.0 { "text-gray-400 hover:bg-red-400 tooltip" } - else if score <= 3.0 { "text-red-200 hover:bg-red-400 tooltip" } - else if score <= 6.0 { "text-red-400 hover:bg-red-500 tooltip" } - else if score <= 10.0 { "text-red-500 hover:bg-red-600 tooltip" } - else if score <= 15.0 { "text-red-600 hover:bg-red-700 tooltip" } - else { "text-red-700 hover:bg-red-800 tooltip" } - | None => "text-gray-400 hover:text-red-200 tooltip" + let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) + if score <= 0.0 { + "text-secondary-400 hover:bg-red-400 tooltip" + } else if score <= 3.0 { + "text-red-200 hover:bg-red-400 tooltip" + } else if score <= 6.0 { + "text-red-400 hover:bg-red-500 tooltip" + } else if score <= 10.0 { + "text-red-500 hover:bg-red-600 tooltip" + } else if score <= 15.0 { + "text-red-600 hover:bg-red-700 tooltip" + } else { + "text-red-700 hover:bg-red-800 tooltip" + } + | None => "text-secondary-400 hover:text-red-200 tooltip" } } // UI for each Label let selectedLabelClass = (part: option) => { switch part { | Some(p) => - let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) - if score <= 0.0 { "bg-gray-300 text-black hover:bg-gray-400" } - else if score <= 3.0 { "bg-red-200 text-red-700 hover:bg-red-400" } - else if score <= 6.0 { "bg-red-400 text-white hover:bg-red-500" } - else if score <= 10.0 { "bg-red-500 text-white hover:bg-red-600" } - else if score <= 15.0 { "bg-red-600 text-white hover:bg-red-700" } - else { "bg-red-700 text-white hover:bg-red-200" } - | None => "bg-gray-300 text-black hover:bg-red-200" + let score = PressureSore.calculatePushScore(p.length, p.width, p.exudate_amount, p.tissue_type) + if score <= 0.0 { + "bg-secondary-300 text-black hover:bg-secondary-400" + } else if score <= 3.0 { + "bg-red-200 text-red-700 hover:bg-red-400" + } else if score <= 6.0 { + "bg-red-400 text-white hover:bg-red-500" + } else if score <= 10.0 { + "bg-red-500 text-white hover:bg-red-600" + } else if score <= 15.0 { + "bg-red-600 text-white hover:bg-red-700" + } else { + "bg-red-700 text-white hover:bg-red-200" + } + | None => "bg-secondary-300 text-black hover:bg-red-200" } } @@ -229,8 +251,9 @@ let getIntoView = (region: string, isPart: bool) => { } let renderBody = (state, send, title, partPaths, substr) => { - - let show = state.selectedRegion !== PressureSore.Other && partPaths->Belt.Array.some(p => PressureSore.regionForPath(p) === state.selectedRegion) + let show = + state.selectedRegion !== PressureSore.Other && + partPaths->Belt.Array.some(p => PressureSore.regionForPath(p) === state.selectedRegion) let inputModal = React.useRef(Js.Nullable.null) let isMouseOverInputModal = %raw(` @@ -260,30 +283,35 @@ let renderBody = (state, send, title, partPaths, substr) => { className={"p-1 col-auto text-sm rounded m-1 cursor-pointer " ++ selectedLabelClass(selectedPart)} id={PressureSore.regionToString(regionType)} - onClick={_ => getIntoView(PressureSore.regionToString(regionType), false)} - > + onClick={_ => getIntoView(PressureSore.regionToString(regionType), false)}> {str( Js.String.sliceToEnd( ~from=substr, - PressureSore.regionToString(regionType) ++ (pushScoreValue(selectedPart) === "0" ? "" : " : " ++ pushScoreValue(selectedPart)), + PressureSore.regionToString(regionType) ++ ( + pushScoreValue(selectedPart) === "0" + ? "" + : " : " ++ pushScoreValue(selectedPart) + ), ), )} - {state.previewMode ? React.null : - {switch selectedPart { - | Some(p) => - getIntoView(PressureSore.regionToString(regionType), false) - : _ => send(RemoveFromSelectedParts(p))} - /> - | None => React.null - }} - } + {state.previewMode + ? React.null + : + {switch selectedPart { + | Some(p) => + getIntoView(PressureSore.regionToString(regionType), false) + : _ => send(RemoveFromSelectedParts(p))} + /> + | None => React.null + }} + } }, partPaths)->React.array} @@ -297,17 +325,18 @@ let renderBody = (state, send, title, partPaths, substr) => { modalRef={ReactDOM.Ref.domRef(inputModal)} hideModal={_ => send(SetSelectedRegion(PressureSore.Other))} position={state.modalPosition} - part={ - Belt.Option.getWithDefault( - Js.Array.find(p => PressureSore.region(p) === state.selectedRegion, state.parts), - PressureSore.makeDefault(state.selectedRegion) - ) - } + part={Belt.Option.getWithDefault( + Js.Array.find(p => PressureSore.region(p) === state.selectedRegion, state.parts), + PressureSore.makeDefault(state.selectedRegion), + )} updatePart={part => send(UpdateSelectedPart(part))} previewMode={state.previewMode} /> - + {Js.Array.mapi((part, renderIndex) => { let regionType = PressureSore.regionForPath(part) let selectedPart = Js.Array.find(p => PressureSore.region(p) === regionType, state.parts) @@ -319,9 +348,13 @@ let renderBody = (state, send, title, partPaths, substr) => { fill="currentColor" id={"part" ++ PressureSore.regionToString(regionType)} onClick={e => { - send(ShowInputModal(part.region, {"x": e->ReactEvent.Mouse.clientX, "y": e->ReactEvent.Mouse.clientY})) - }} - > + send( + ShowInputModal( + part.region, + {"x": e->ReactEvent.Mouse.clientX, "y": e->ReactEvent.Mouse.clientY}, + ), + ) + }}> {str(PressureSore.regionToString(regionType))} }, partPaths)->React.array} @@ -348,7 +381,8 @@ let make = (~pressureSoreParameter, ~updateCB, ~id, ~consultationId, ~previewMod // Toggle //Toggle Button - + {str(state.previewMode ? "Preview Mode" : "Edit Mode")} @@ -360,7 +394,7 @@ let make = (~pressureSoreParameter, ~updateCB, ~id, ~consultationId, ~previewMod /> { let region = PressureSore.regionToString(state.region) - if (state.length === 0.0 && state.width === 0.0) { + if state.length === 0.0 && state.width === 0.0 { hideModal(e) } else if ( (state.length > 0.0 && state.width == 0.0) || (state.length == 0.0 && state.width > 0.0) @@ -198,31 +198,33 @@ let make = ( {str(state.width->Belt.Float.toString)} - {str("Width")} + {str("Width")} {str(state.length->Belt.Float.toString)} - {str("Length")} + {str("Length")} {str(state.exudate_amount->PressureSore.encodeExudateAmount)} - {str("Exudate Amount")} + + {str("Exudate Amount")} + {str(state.tissue_type->PressureSore.encodeTissueType)} - {str("Tissue Type")} + {str("Tissue Type")} {state.description !== "" ? - + {str("Description")} {str(state.description)} @@ -233,7 +235,7 @@ let make = ( + className="bg-secondary-50 px-4 py-3 sm:px-6 flex flex-col sm:flex-row items-center justify-between gap-2"> {str("Push Score: ")} {str(pushScore->Belt.Float.toString)} @@ -250,7 +252,7 @@ let make = ( + className="mt-3 inline-flex w-full justify-center rounded-md border border-secondary-300 bg-white px-4 py-2 text-base font-medium text-secondary-700 shadow-sm hover:bg-secondary-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> {str(!previewMode ? "Cancel" : "Close")} diff --git a/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res b/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res index 997e5447e70..cd24b26d37e 100644 --- a/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res +++ b/src/Components/CriticalCareRecording/PressureSore/DailyRound__PressureSore.res @@ -3,9 +3,11 @@ open CriticalCare__Types @react.component let make = (~pressureSoreParameter) => { - + - {str("Part")} {str("Push Score")} + {str("Part")} + {str("Push Score")} {Js.Array.map(pressure => { diff --git a/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res b/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res index d919215071e..a3729277e12 100644 --- a/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res +++ b/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res @@ -36,10 +36,11 @@ let basicEditor = (~facilityId, ~patientId, ~consultationId, ~id) => { href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds/${id}/update`}> - {str("Basic Editor")} - + + + } let editorNameToString = editor => { @@ -71,19 +72,19 @@ let editorToggle = (editorName, state, send) => { {str(editorNameToString(editorName))} {Belt.Option.isNone(editorUpdated) - ? + ? : } @@ -94,7 +95,7 @@ let reducer = (state, action) => { | ShowEditor(editor) => {...state, visibleEditor: Some(editor)} | CloseEditor => {...state, visibleEditor: None} | UpdateDailyRound(dailyRound, editor) => { - dailyRound: dailyRound, + dailyRound, visibleEditor: None, updatedEditors: Js.Array.concat([editor], state.updatedEditors), } @@ -103,7 +104,7 @@ let reducer = (state, action) => { let initialState = dailyRound => { visibleEditor: None, - dailyRound: dailyRound, + dailyRound, updatedEditors: [], } @@ -115,6 +116,21 @@ let updateDailyRound = (send, editor, dailyRound) => { let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => { let (state, send) = React.useReducer(reducer, initialState(dailyRound)) + let sections = + dailyRound.roundsType == VentilatorRound + ? [ + HemodynamicParametersEditor, + NeurologicalMonitoringEditor, + VentilatorParametersEditor, + ArterialBloodGasAnalysisEditor, + BloodSugarEditor, + IOBalanceEditor, + DialysisEditor, + PressureSoreEditor, + NursingCareEditor, + ] + : [NeurologicalMonitoringEditor, VentilatorParametersEditor] + {ReactUtils.nullUnless( @@ -135,7 +151,7 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => { {str("Back")} + className="bg-white px-2 md:px-6 py-5 border-b border-secondary-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg"> {switch editor { | NeurologicalMonitoringEditor => { | None => + className="bg-white px-2 md:px-6 py-5 border-b border-secondary-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg"> {str("Record Updates")} - {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)} {Js.Array.map(editor => { + {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)} + {Js.Array.map(editor => { editorToggle(editor, state, send) - }, [ - HemodynamicParametersEditor, - NeurologicalMonitoringEditor, - VentilatorParametersEditor, - ArterialBloodGasAnalysisEditor, - BloodSugarEditor, - IOBalanceEditor, - DialysisEditor, - PressureSoreEditor, - NursingCareEditor, - ])->React.array} + }, sections)->React.array} - Notifications.success({msg: "Detailed Update filed successfully"})} + onClick={_ => Notifications.success({msg: "Detailed Update filed successfully"})} className="btn btn-primary w-full mt-6"> {str("Complete")} diff --git a/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res b/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res index 0933f46bf1a..cd3010b1c1d 100644 --- a/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res +++ b/src/Components/CriticalCareRecording/VentilatorParametersEditor/CriticalCare__VentilatorParametersEditor.res @@ -115,7 +115,7 @@ let makePayload = (state: VentilatorParameters.state) => { DictUtils.setOptionalNumber("ventilator_tidal_volume", state.ventilator_tidal_volume, payload) DictUtils.setOptionalNumber( "ventilator_oxygen_modality_oxygen_rate", - state.ventilator_interface === UNKNOWN && + state.ventilator_interface === OXYGEN_SUPPORT && state.ventilator_oxygen_modality !== HIGH_FLOW_NASAL_CANNULA ? state.ventilator_oxygen_modality_oxygen_rate : None, diff --git a/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res b/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res index a0196a9baa9..76908972723 100644 --- a/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res +++ b/src/Components/CriticalCareRecording/components/CriticalCare__Dropdown.res @@ -27,7 +27,7 @@ let renderSelectables = (selections, updateCB) => type_="button" key={index |> string_of_int} onClick={_ => updateCB(selection)} - className="w-full block px-4 py-2 text-sm leading-5 text-left text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"> + className="w-full block px-4 py-2 text-sm leading-5 text-left text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:outline-none focus:bg-secondary-100 focus:text-secondary-900"> {selection |> str} ) @@ -77,7 +77,10 @@ let make = (~id, ~value, ~updateCB, ~placeholder, ~selectables, ~label="", ~disa id value autoComplete="off" - onClick={e => {ReactEvent.Mouse.stopPropagation(e); setShowDropdown(_ => !showDropdown)}} + onClick={e => { + ReactEvent.Mouse.stopPropagation(e) + setShowDropdown(_ => !showDropdown) + }} onChange={e => updateCB(ReactEvent.Form.target(e)["value"])} className="cui-input-base appearance-none h-10 mt-1 block py-2 px-4" disabled diff --git a/src/Components/CriticalCareRecording/components/CriticalCare__Home.res b/src/Components/CriticalCareRecording/components/CriticalCare__Home.res index 13bfa2f9cfb..35f543f4c16 100644 --- a/src/Components/CriticalCareRecording/components/CriticalCare__Home.res +++ b/src/Components/CriticalCareRecording/components/CriticalCare__Home.res @@ -236,7 +236,7 @@ // // // // -// +// // // {str("Glasgow Coma Scale")} // @@ -257,7 +257,7 @@ // // -// +// // // {str("Limb Response")} @@ -272,13 +272,13 @@ // // -// +// // // // -// +// // // {str("Ventillator Parameters")} @@ -291,14 +291,14 @@ // // -// +// // // {str("Infusions")} // // -// +// // // {str("Feed")} @@ -309,7 +309,7 @@ // // -// +// // // {str("Output")} @@ -324,3 +324,4 @@ // // } + diff --git a/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res b/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res index 445d0874066..d133348e4d6 100644 --- a/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res +++ b/src/Components/CriticalCareRecording/components/CriticalCare__NumberInput.res @@ -2,17 +2,21 @@ let str = React.string @react.component let make = (~labels) => { - - {labels|>Array.map((x) => { - - - {str(x)} - - - - - - }) - |> React.array } - + + {labels + |> Array.map(x => { + + {str(x)} + + + + + }) + |> React.array} + } diff --git a/src/Components/CriticalCareRecording/components/PressureSore.js b/src/Components/CriticalCareRecording/components/PressureSore.js index 1aa32607546..b03dbf4de19 100644 --- a/src/Components/CriticalCareRecording/components/PressureSore.js +++ b/src/Components/CriticalCareRecording/components/PressureSore.js @@ -203,7 +203,7 @@ export default function PressureSore() { className={ selected === renderIndex ? "text-blue-500" - : "text-gray-300 hover:text-blue-400" + : "text-secondary-300 hover:text-blue-400" } fill="currentColor" onClick={(_) => setSelected(renderIndex)} diff --git a/src/Components/DeathReport/DeathReport.tsx b/src/Components/DeathReport/DeathReport.tsx index e25a59c8732..6ed8652d22d 100644 --- a/src/Components/DeathReport/DeathReport.tsx +++ b/src/Components/DeathReport/DeathReport.tsx @@ -6,7 +6,11 @@ import TextFormField from "../Form/FormFields/TextFormField"; import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; import DateFormField from "../Form/FormFields/DateFormField"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; -import { formatDateTime, patientAgeInYears } from "../../Utils/utils"; +import { + formatDateTime, + humanizeStrings, + patientAgeInYears, +} from "../../Utils/utils"; import Page from "../Common/components/Page"; import Form from "../Form/Form"; import { useTranslation } from "react-i18next"; @@ -89,8 +93,9 @@ export default function PrintDeathReport(props: { id: string }) { patientData.medical_history && patientData.medical_history.length ) { - const medHis = patientData.medical_history; - return medHis.map((item: any) => item.disease).join(", "); + return humanizeStrings( + patientData.medical_history.map((item: any) => item.disease), + ); } else { return "None"; } diff --git a/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx b/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx index 4f3b102acc9..71f6e2888a0 100644 --- a/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx +++ b/src/Components/Diagnosis/ConditionVerificationStatusMenu.tsx @@ -30,7 +30,8 @@ export default function ConditionVerificationStatusMenu< className={classNames( props.className, props.value && StatusStyle[props.value].colors, - props.value && "border !border-gray-400 bg-white hover:bg-gray-300", + props.value && + "border !border-secondary-400 bg-white hover:bg-secondary-300", )} id="condition-verification-status-menu" title={props.value ? t(props.value) : props.placeholder ?? t("add_as")} @@ -49,7 +50,9 @@ export default function ConditionVerificationStatusMenu< icon="l-coronavirus" className={classNames( "hidden text-lg transition-all duration-200 ease-in-out group-hover:rotate-90 group-hover:text-inherit md:block", - props.value === status ? "text-inherit-500" : "text-gray-500", + props.value === status + ? "text-inherit-500" + : "text-secondary-500", )} /> } @@ -65,7 +68,7 @@ export default function ConditionVerificationStatusMenu< : ""} {t(status)} - + {t(`help_${status}`)} diff --git a/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx b/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx index b2bab809813..0391748c929 100644 --- a/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx +++ b/src/Components/Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.tsx @@ -21,7 +21,7 @@ interface CreateDiagnosesProps { export const CreateDiagnosesBuilder = (props: CreateDiagnosesProps) => { return ( - + {props.value.map((diagnosis, index) => ( @@ -45,7 +45,7 @@ export const CreateDiagnosesBuilder = (props: CreateDiagnosesProps) => { {props.value.length === 0 && } - + obj.diagnosis_object as ICD11DiagnosisModel, @@ -85,7 +85,7 @@ export const EditDiagnosesBuilder = (props: EditDiagnosesProps) => { const [diagnoses, setDiagnoses] = useState(props.value); return ( - +
{file_state.name}.{file_state.extension}
{t("sign_out")}
{str("Mark region and intensity of pain")}