From af014a1e83bea5f367133690414fab425b7c9011 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 19 Sep 2024 11:28:46 +0530 Subject: [PATCH 1/9] Adds new set of nursing care procedures (#8568) * Add new set of procedures * adds missing border when procedures are selected * update labels --- src/Common/constants.tsx | 15 +++++++++++++++ .../FormFields/AutocompleteMultiselect.tsx | 4 ++-- .../LogUpdate/Sections/NursingCare.tsx | 10 +++++----- src/Locale/en/LogUpdate.json | 19 +++++++++++++++++-- 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 74150a53e4f..9998762cc05 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -735,10 +735,23 @@ export const HEARTBEAT_RHYTHM_CHOICES = [ ] as const; export const NURSING_CARE_PROCEDURES = [ + "oral_care", + "hair_care", + "bed_bath", + "eye_care", + "perineal_care", + "skin_care", + "pre_enema", + "wound_dressing", + "lymphedema_care", + "ascitic_tapping", + "colostomy_care", + "colostomy_change", "personal_hygiene", "positioning", "suctioning", "ryles_tube_care", + "ryles_tube_change", "iv_sitecare", "nubulisation", "dressing", @@ -746,8 +759,10 @@ export const NURSING_CARE_PROCEDURES = [ "restrain", "chest_tube_care", "tracheostomy_care", + "tracheostomy_change", "stoma_care", "catheter_care", + "catheter_change", ] as const; export const EYE_OPEN_SCALE = [ diff --git a/src/Components/Form/FormFields/AutocompleteMultiselect.tsx b/src/Components/Form/FormFields/AutocompleteMultiselect.tsx index 4e9386afeba..a727db8b749 100644 --- a/src/Components/Form/FormFields/AutocompleteMultiselect.tsx +++ b/src/Components/Form/FormFields/AutocompleteMultiselect.tsx @@ -21,7 +21,7 @@ type OptionCallback = (option: T) => R; type AutocompleteMultiSelectFormFieldProps = FormFieldBaseProps & { placeholder?: string; - options: T[]; + options: readonly T[]; optionLabel: OptionCallback; optionValue?: OptionCallback; optionDisabled?: OptionCallback; @@ -52,7 +52,7 @@ export default AutocompleteMultiSelectFormField; type AutocompleteMutliSelectProps = { id?: string; - options: T[]; + options: readonly T[]; disabled?: boolean | undefined; value: V[]; placeholder?: string; diff --git a/src/Components/LogUpdate/Sections/NursingCare.tsx b/src/Components/LogUpdate/Sections/NursingCare.tsx index 48037d6c842..b1dd7c09c3a 100644 --- a/src/Components/LogUpdate/Sections/NursingCare.tsx +++ b/src/Components/LogUpdate/Sections/NursingCare.tsx @@ -1,8 +1,8 @@ import { useTranslation } from "react-i18next"; import { NURSING_CARE_PROCEDURES } from "../../../Common/constants"; import { LogUpdateSectionMeta, LogUpdateSectionProps } from "../utils"; -import { MultiSelectFormField } from "../../Form/FormFields/SelectFormField"; import AutoExpandingTextInputFormField from "../../Form/FormFields/AutoExpandingTextInputFormField"; +import AutocompleteMultiSelectFormField from "../../Form/FormFields/AutocompleteMultiselect"; const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { const { t } = useTranslation(); @@ -10,7 +10,7 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { return (
- p.procedure)} @@ -30,14 +30,14 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { errorClassName="hidden" /> {!!nursing.length && ( - +
{nursing.map((obj) => ( - -
+ {t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)} + Date: Thu, 19 Sep 2024 19:19:14 +0530 Subject: [PATCH 2/9] Patient Registration: Adds social profile section (#8570) --- .../patient_spec/PatientRegistration.cy.ts | 4 + cypress/e2e/users_spec/user_manage.cy.ts | 149 ------------------ cypress/e2e/users_spec/user_profile.cy.ts | 82 ---------- cypress/pageobject/Patient/PatientCreation.ts | 13 ++ cypress/support/commands.ts | 4 + cypress/support/index.ts | 1 + src/Common/constants.tsx | 14 ++ src/Components/Patient/PatientHome.tsx | 54 +++++-- src/Components/Patient/PatientRegister.tsx | 114 +++++++++++--- src/Components/Patient/models.tsx | 15 +- src/Locale/en/Patient.json | 14 ++ src/Locale/en/index.js | 2 + 12 files changed, 196 insertions(+), 270 deletions(-) delete mode 100644 cypress/e2e/users_spec/user_manage.cy.ts delete mode 100644 cypress/e2e/users_spec/user_profile.cy.ts create mode 100644 src/Locale/en/Patient.json diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts index 2e7ce853fc5..ef92c2e9bd1 100644 --- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts +++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts @@ -101,6 +101,8 @@ describe("Patient Creation with consultation", () => { facilityPage.selectLocalBody(patientOneLocalbody); facilityPage.selectWard(patientOneWard); patientPage.selectPatientOccupation(patientOccupation); + patientPage.selectSocioeconomicStatus("MIDDLE_CLASS"); + patientPage.selectDomesticHealthcareSupport("FAMILY_MEMBER"); // Patient Medical History patientMedicalHistory.typePatientPresentHealth(patientOnePresentHealth); patientMedicalHistory.typePatientOngoingMedication( @@ -130,6 +132,8 @@ describe("Patient Creation with consultation", () => { yearOfBirth, patientOneBloodGroup, patientOccupation, + "Middle Class", + "Family member", ); patientMedicalHistory.verifyPatientMedicalDetails( patientOnePresentHealth, diff --git a/cypress/e2e/users_spec/user_manage.cy.ts b/cypress/e2e/users_spec/user_manage.cy.ts deleted file mode 100644 index c2116954354..00000000000 --- a/cypress/e2e/users_spec/user_manage.cy.ts +++ /dev/null @@ -1,149 +0,0 @@ -import LoginPage from "../../pageobject/Login/LoginPage"; -import { UserPage } from "../../pageobject/Users/UserSearch"; -import ManageUserPage from "../../pageobject/Users/ManageUserPage"; -import { UserCreationPage } from "../../pageobject/Users/UserCreation"; - -describe("Manage User", () => { - const loginPage = new LoginPage(); - const userPage = new UserPage(); - const manageUserPage = new ManageUserPage(); - const usernametolinkfacilitydoc1 = "dummydoctor4"; - const usernametolinkfacilitydoc2 = "dummydoctor5"; - const usernametolinkfacilitydoc3 = "dummydoctor6"; - const usernametolinkskill = "devdoctor"; - const userCreationPage = new UserCreationPage(); - const usernameforworkinghour = "devdistrictadmin"; - const usernamerealname = "Dummy Doctor"; - const facilitytolinkusername = "Dummy Shifting Center"; - const facilitytolinkskill = "Dummy Facility 40"; - const workinghour = "23"; - const linkedskill = "General Medicine"; - - before(() => { - loginPage.loginAsDisctrictAdmin(); - cy.saveLocalStorage(); - }); - - beforeEach(() => { - cy.restoreLocalStorage(); - cy.clearLocalStorage(/filters--.+/); - cy.awaitUrl("/users"); - }); - - it("linking skills for users and verify its reflection in profile", () => { - // select the district user and select one skill link and verify its profile reflection - userPage.typeInSearchInput(usernameforworkinghour); - userPage.checkUsernameText(usernameforworkinghour); - manageUserPage.clicklinkedskillbutton(); - manageUserPage.selectSkillFromDropdown(linkedskill); - manageUserPage.clickAddSkillButton(); - manageUserPage.clickCloseSlideOver(); - cy.wait(5000); - manageUserPage.clicklinkedskillbutton(); - manageUserPage.assertSkillInAddedUserSkills(linkedskill); - manageUserPage.clickCloseSlideOver(); - cy.wait(5000); - manageUserPage.navigateToProfile(); - userCreationPage.verifyElementContainsText( - "username-profile-details", - usernameforworkinghour, - ); - manageUserPage.assertSkillInAlreadyLinkedSkills(linkedskill); - }); - - it("linking skills for a doctor users and verify its reflection in doctor connect", () => { - // select a doctor user and link and unlink same skill twice and verify the badge is only shown once in doctor connect - userPage.typeInSearchInput(usernametolinkskill); - userPage.checkUsernameText(usernametolinkskill); - manageUserPage.clicklinkedskillbutton(); - manageUserPage.selectSkillFromDropdown(linkedskill); - manageUserPage.clickAddSkillButton(); - manageUserPage.clickCloseSlideOver(); - cy.wait(5000); // temporary hack to fix the failure - manageUserPage.clicklinkedskillbutton(); - manageUserPage.assertSkillInAddedUserSkills(linkedskill); - manageUserPage.clickUnlinkSkill(); - manageUserPage.clickSubmit(); - manageUserPage.selectSkillFromDropdown(linkedskill); - manageUserPage.clickAddSkillButton(); - manageUserPage.clickCloseSlideOver(); - // verifying the doctor connect - manageUserPage.navigateToFacility(); - manageUserPage.typeFacilitySearch(facilitytolinkskill); - manageUserPage.assertFacilityInCard(facilitytolinkskill); - manageUserPage.clickFacilityPatients(); - manageUserPage.clickDoctorConnectButton(); - manageUserPage.assertSkillIndoctorconnect(linkedskill); - }); - - it("add working hour for a user and verify its reflection in card and user profile", () => { - // verify mandatory field error and select working hour for a user - userPage.typeInSearchInput(usernameforworkinghour); - userPage.checkUsernameText(usernameforworkinghour); - manageUserPage.clicksetaveragehourbutton(); - manageUserPage.clearweeklyhourfield(); - manageUserPage.clickSubmit(); - manageUserPage.verifyErrorText("Value should be between 0 and 168"); - // verify the data is reflected in user card and profile page - manageUserPage.typeInWeeklyWorkingHours(workinghour); - manageUserPage.clickSubmit(); - manageUserPage.verifyWorkingHours(workinghour); - manageUserPage.navigateToProfile(); - manageUserPage.verifyProfileWorkingHours(workinghour); - }); - - it("linking and unlinking facility for multiple users, and confirm reflection in user cards and doctor connect", () => { - // verify the user doesn't have any home facility - userPage.typeInSearchInput(usernametolinkfacilitydoc1); - userPage.checkUsernameText(usernametolinkfacilitydoc1); - manageUserPage.assertHomeFacility("No Home Facility"); - // Link a new facility and ensure it is under linked facility - doctor username (1) - manageUserPage.clickFacilitiesTab(); - manageUserPage.selectFacilityFromDropdown(facilitytolinkusername); - manageUserPage.clickLinkFacility(); - manageUserPage.assertLinkedFacility(facilitytolinkusername); - // Verify in the already linked facility are not present in droplist - manageUserPage.assertFacilityNotInDropdown(facilitytolinkusername); - manageUserPage.clickCloseSlideOver(); - // Link a new facility and ensure it is under home facility - doctor username (2) - userPage.clearSearchInput(); - userPage.typeInSearchInput(usernametolinkfacilitydoc2); - userPage.checkUsernameText(usernametolinkfacilitydoc2); - manageUserPage.clickFacilitiesTab(); - manageUserPage.selectFacilityFromDropdown(facilitytolinkusername); - manageUserPage.clickLinkFacility(); - manageUserPage.clickHomeFacilityIcon(); - manageUserPage.assertnotLinkedFacility(facilitytolinkusername); - manageUserPage.assertHomeFacilitylink(facilitytolinkusername); - manageUserPage.clickCloseSlideOver(); - // verify the home facility doctor id have reflection in user card - userPage.clearSearchInput(); - userPage.typeInSearchInput(usernametolinkfacilitydoc2); - userPage.checkUsernameText(usernametolinkfacilitydoc2); - manageUserPage.assertHomeFacility(facilitytolinkusername); - // Link a new facility and unlink the facility from the doctor username (3) - userPage.clearSearchInput(); - userPage.typeInSearchInput(usernametolinkfacilitydoc3); - userPage.checkUsernameText(usernametolinkfacilitydoc3); - manageUserPage.clickFacilitiesTab(); - manageUserPage.selectFacilityFromDropdown(facilitytolinkusername); - manageUserPage.clickLinkFacility(); - manageUserPage.clickUnlinkFacilityButton(); - manageUserPage.clickSubmit(); - manageUserPage.assertnotLinkedFacility; - manageUserPage.linkedfacilitylistnotvisible(); - manageUserPage.clickCloseSlideOver(); - // Go to particular facility doctor connect and all user-id are reflected based on there access - // Path will be facility page to patient page then doctor connect button - manageUserPage.navigateToFacility(); - manageUserPage.typeFacilitySearch(facilitytolinkusername); - manageUserPage.assertFacilityInCard(facilitytolinkusername); - manageUserPage.clickFacilityPatients(); - manageUserPage.clickDoctorConnectButton(); - manageUserPage.assertDoctorConnectVisibility(usernamerealname); - }); - - afterEach(() => { - cy.saveLocalStorage(); - }); -}); diff --git a/cypress/e2e/users_spec/user_profile.cy.ts b/cypress/e2e/users_spec/user_profile.cy.ts deleted file mode 100644 index 40880d95edb..00000000000 --- a/cypress/e2e/users_spec/user_profile.cy.ts +++ /dev/null @@ -1,82 +0,0 @@ -import LoginPage from "../../pageobject/Login/LoginPage"; -import UserProfilePage from "../../pageobject/Users/UserProfilePage"; -import ManageUserPage from "../../pageobject/Users/ManageUserPage"; - -describe("Manage User Profile", () => { - const loginPage = new LoginPage(); - const userProfilePage = new UserProfilePage(); - const manageUserPage = new ManageUserPage(); - - const date_of_birth = "01011999"; - const gender = "Male"; - const email = "test@example.com"; - const phone = "+918899887788"; - const workinghours = "8"; - const doctorQualification = "MBBS"; - const doctorYoE = "10"; - const medicalCouncilRegistration = "1234567890"; - - const facilitySearch = "Dummy Facility 40"; - - before(() => { - loginPage.loginAsDevDoctor(); - cy.saveLocalStorage(); - }); - - beforeEach(() => { - cy.restoreLocalStorage(); - cy.clearLocalStorage(/filters--.+/); - cy.awaitUrl("/user/profile"); - }); - - it("Set Dob, Gender, Email, Phone and Working Hours for a user and verify its reflection in user profile", () => { - userProfilePage.clickEditProfileButton(); - - userProfilePage.typedate_of_birth(date_of_birth); - userProfilePage.selectGender(gender); - userProfilePage.typeEmail(email); - userProfilePage.typePhone(phone); - userProfilePage.typeWhatsApp(phone); - userProfilePage.typeWorkingHours(workinghours); - userProfilePage.typeDoctorQualification(doctorQualification); - userProfilePage.typeDoctorYoE(doctorYoE); - userProfilePage.typeMedicalCouncilRegistration(medicalCouncilRegistration); - - userProfilePage.clickUpdateButton(); - - cy.verifyNotification("Details updated successfully"); - - userProfilePage.assertdate_of_birth("01/01/1999"); - userProfilePage.assertGender(gender); - userProfilePage.assertEmail(email); - userProfilePage.assertPhone(phone); - userProfilePage.assertWhatsApp(phone); - userProfilePage.assertWorkingHours(workinghours); - }); - - it("Adding video connect link for a user and verify its reflection in user profile and doctor connect", () => { - // verify the user doesn't have any video connect link - userProfilePage.assertVideoConnectLink("-"); - // Link a new video connect link and ensure it is under video connect link - userProfilePage.clickEditProfileButton(); - userProfilePage.typeVideoConnectLink("https://www.example.com"); - userProfilePage.clickUpdateButton(); - userProfilePage.assertVideoConnectLink("https://www.example.com"); - // Edit the video connect link and ensure it is updated - userProfilePage.clickEditProfileButton(); - userProfilePage.typeVideoConnectLink("https://www.test.com"); - userProfilePage.clickUpdateButton(); - userProfilePage.assertVideoConnectLink("https://www.test.com"); - // Go to particular facility doctor connect and verify the video connect link is present - manageUserPage.navigateToFacility(); - manageUserPage.typeFacilitySearch(facilitySearch); - manageUserPage.assertFacilityInCard(facilitySearch); - manageUserPage.clickFacilityPatients(); - manageUserPage.clickDoctorConnectButton(); - manageUserPage.assertVideoConnectLink("Dev Doctor", "https://www.test.com"); - }); - - afterEach(() => { - cy.saveLocalStorage(); - }); -}); diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index db3c10fdcb5..e037f0888f0 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -117,6 +117,14 @@ export class PatientPage { cy.searchAndSelectOption("#occupation", occupation); } + selectSocioeconomicStatus(value: string) { + cy.selectRadioOption("socioeconomic_status", value); + } + + selectDomesticHealthcareSupport(value: string) { + cy.selectRadioOption("domestic_healthcare_support", value); + } + clickCreatePatient() { cy.intercept("POST", "**/api/v1/patient/").as("createPatient"); cy.get("button[data-testid='submit-button']").click(); @@ -165,6 +173,8 @@ export class PatientPage { yearOfBirth, bloodGroup, occupation, + socioeconomicStatus = null, + domesticHealthcareSupport = null, isAntenatal = false, isPostPartum = false, ) { @@ -178,6 +188,9 @@ export class PatientPage { expect($dashboard).to.contain(yearOfBirth); expect($dashboard).to.contain(bloodGroup); expect($dashboard).to.contain(occupation); + socioeconomicStatus && expect($dashboard).to.contain(socioeconomicStatus); + domesticHealthcareSupport && + expect($dashboard).to.contain(domesticHealthcareSupport); if (isAntenatal) { expect($dashboard).to.contain("Antenatal"); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index c6437505349..86d048e5f41 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -169,6 +169,10 @@ Cypress.Commands.add( }, ); +Cypress.Commands.add("selectRadioOption", (name: string, value: string) => { + cy.get(`input[type='radio'][name='${name}'][value=${value}]`).click(); +}); + Cypress.Commands.add("clickAndTypeDate", (selector: string, date: string) => { cy.get(selector).scrollIntoView(); cy.get(selector).click(); diff --git a/cypress/support/index.ts b/cypress/support/index.ts index 9ddfd0c819a..d660246324f 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -23,6 +23,7 @@ declare global { selector: string, symptoms: string | string[], ): Chainable; + selectRadioOption(name: string, value: string): Chainable; typeAndMultiSelectOption( selector: string, input: string, diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 9998762cc05..8149a144ed9 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -1415,6 +1415,20 @@ export const CONSENT_PATIENT_CODE_STATUS_CHOICES = [ { id: 3, text: "Comfort Care Only" }, { id: 4, text: "Active treatment" }, ]; + +export const SOCIOECONOMIC_STATUS_CHOICES = [ + "MIDDLE_CLASS", + "POOR", + "VERY_POOR", + "WELL_OFF", +] as const; + +export const DOMESTIC_HEALTHCARE_SUPPORT_CHOICES = [ + "FAMILY_MEMBER", + "PAID_CAREGIVER", + "NO_SUPPORT", +] as const; + export const OCCUPATION_TYPES = [ { id: 27, diff --git a/src/Components/Patient/PatientHome.tsx b/src/Components/Patient/PatientHome.tsx index fc173f26213..6fe6ba8c3ce 100644 --- a/src/Components/Patient/PatientHome.tsx +++ b/src/Components/Patient/PatientHome.tsx @@ -515,24 +515,50 @@ export const PatientHome = (props: any) => { )} -
-
- Occupation + {patientData.meta_info?.occupation && ( +
+
+ {t("occupation")} +
+
+ {parseOccupation(patientData.meta_info.occupation)} +
-
- {parseOccupation(patientData.meta_info?.occupation) || "-"} + )} + {patientData.ration_card_category && ( +
+
+ {t("ration_card_category")} +
+
+ {t(`ration_card__${patientData.ration_card_category}`)} +
-
-
-
- Ration Card Category + )} + {patientData.meta_info?.socioeconomic_status && ( +
+
+ {t("socioeconomic_status")} +
+
+ {t( + `SOCIOECONOMIC_STATUS__${patientData.meta_info.socioeconomic_status}`, + )} +
-
- {patientData.ration_card_category - ? t(`ration_card__${patientData.ration_card_category}`) - : "-"} + )} + {patientData.meta_info?.domestic_healthcare_support && ( +
+
+ {t("domestic_healthcare_support")} +
+
+ {t( + `DOMESTIC_HEALTHCARE_SUPPORT__${patientData.meta_info.domestic_healthcare_support}`, + )} +
-
+ )}
diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index 17eb745496b..033d0187649 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -2,10 +2,12 @@ import * as Notification from "../../Utils/Notifications.js"; import { BLOOD_GROUPS, + DOMESTIC_HEALTHCARE_SUPPORT_CHOICES, GENDER_TYPES, MEDICAL_HISTORY_CHOICES, OCCUPATION_TYPES, RATION_CARD_CATEGORY, + SOCIOECONOMIC_STATUS_CHOICES, VACCINES, } from "../../Common/constants"; import { @@ -48,7 +50,7 @@ import { HCXPolicyModel } from "../HCX/models"; import HCXPolicyValidator from "../HCX/validators"; import InsuranceDetailsBuilder from "../HCX/InsuranceDetailsBuilder"; import LinkABHANumberModal from "../ABDM/LinkABHANumberModal"; -import { PatientModel, Occupation } from "./models"; +import { PatientModel, Occupation, PatientMeta } from "./models"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; import RadioFormField from "../Form/FormFields/RadioFormField"; import { SelectFormField } from "../Form/FormFields/SelectFormField"; @@ -77,6 +79,9 @@ import careConfig from "@careConfig"; const Loading = lazy(() => import("../Common/Loading")); const PageTitle = lazy(() => import("../Common/PageTitle")); +type PatientForm = PatientModel & + PatientMeta & { age?: number; is_postpartum?: boolean }; + interface PatientRegisterProps extends PatientModel { facilityId: string; } @@ -191,7 +196,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { const [isLoading, setIsLoading] = useState(false); const [showImport, setShowImport] = useState<{ show?: boolean; - field?: FormContextValue | null; + field?: FormContextValue | null; }>({ show: false, field: null, @@ -430,6 +435,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { occupation: data.meta_info?.occupation ? parseOccupationFromExt(data.meta_info.occupation) : null, + is_vaccinated: String(data.is_vaccinated), number_of_doses: data.number_of_doses ? String(data.number_of_doses) @@ -749,7 +755,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { formData.nationality === "India" ? formData.local_body : undefined, ward: formData.ward, meta_info: { - ...state.form?.meta_info, + ...formData.meta_info, occupation: formData.occupation ?? null, }, village: formData.village, @@ -1161,7 +1167,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { )} <>
- + defaults={id ? state.form : initForm} validate={validateForm} onSubmit={handleSubmit} @@ -1754,22 +1760,6 @@ export const PatientRegister = (props: PatientRegisterProps) => { /> )}
- o.text} - optionValue={(o) => o.id} - /> - t(`ration_card__${o}`)} - optionValue={(o) => o} - /> ) : (
@@ -1782,6 +1772,90 @@ export const PatientRegister = (props: PatientRegisterProps) => { )}
+ {field("nationality").value === "India" && ( +
+ + } + title={ +

+ Social Profile +

+ } + expanded + > +
+
+ o.text} + optionValue={(o) => o.id} + /> + t(`ration_card__${o}`)} + optionValue={(o) => o} + /> + + t(`SOCIOECONOMIC_STATUS__${o}`) + } + optionValue={(o) => o} + value={ + field("meta_info").value + ?.socioeconomic_status + } + onChange={({ name, value }) => + field("meta_info").onChange({ + name: "meta_info", + value: { + ...(field("meta_info").value ?? {}), + [name]: value, + }, + }) + } + /> + + t(`DOMESTIC_HEALTHCARE_SUPPORT__${o}`) + } + optionValue={(o) => o} + value={ + field("meta_info").value + ?.domestic_healthcare_support + } + onChange={({ name, value }) => + field("meta_info").onChange({ + name: "meta_info", + value: { + ...(field("meta_info").value ?? {}), + [name]: value, + }, + }) + } + /> +
+
+
+
+ )}
Date: Thu, 19 Sep 2024 19:20:01 +0530 Subject: [PATCH 3/9] Convert supported browsers command to a script (#8564) --- package.json | 4 ++-- scripts/generate-supported-browsers.mjs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 scripts/generate-supported-browsers.mjs diff --git a/package.json b/package.json index cfc0b3389a2..cc2c7b955c2 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "scripts": { "build:react": "cross-env NODE_ENV=production vite build", "build": "npm run generate-build-meta && npm run supported-browsers && npm run build:react", - "dev": "vite", + "dev": "npm run supported-browsers && vite", "preview": "cross-env NODE_ENV=production vite preview", "generate-build-meta": "node ./scripts/generate-build-version.js", "test": "snyk test", @@ -41,7 +41,7 @@ "lint": "eslint ./src", "lint-fix": "eslint ./src --fix", "format": "prettier ./src --write", - "supported-browsers": "echo \"export default $(browserslist-useragent-regexp --allowHigherVersions --ignorePatch --ignoreMinor);\" | sed 's/\\x1b\\[[0-9;]*m//g' > src/supportedBrowsers.ts" + "supported-browsers": "node ./scripts/generate-supported-browsers.mjs" }, "dependencies": { "@fontsource/inter": "^5.0.21", diff --git a/scripts/generate-supported-browsers.mjs b/scripts/generate-supported-browsers.mjs new file mode 100644 index 00000000000..2f8b627c57d --- /dev/null +++ b/scripts/generate-supported-browsers.mjs @@ -0,0 +1,17 @@ +import { getUserAgentRegex } from 'browserslist-useragent-regexp'; +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const regex = getUserAgentRegex({ + ignoreMinor: true, + ignorePatch: true, + allowZeroSubversions: false, + allowHigherVersions: true, +}); + +const supportedBrowsersPath = path.resolve(__dirname, '../src/supportedBrowsers.ts'); +fs.writeFileSync(supportedBrowsersPath, `export default ${regex};`); From 4337752e2ae982c55b9be4f3c2aa494d781700a0 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 19 Sep 2024 19:55:53 +0530 Subject: [PATCH 4/9] Remove supported browsers instruction from README (#8574) --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 9fed52b00c0..fd5328150f2 100644 --- a/README.md +++ b/README.md @@ -35,12 +35,6 @@ ```sh npm install ``` -#### Run the following command to generate the `supportedBrowsers.ts` file: - -```bash -npm run supported-browsers -``` -This script just generates regex expression for matching the list of compatible browsers, so that we can show a warning notification for unsupported browsers. #### 🏃 Run the app in development mode From 5027d5b013776850107fe5f5fb1de9842687f16d Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Fri, 20 Sep 2024 17:13:21 +0530 Subject: [PATCH 5/9] Rename procedure `Tracheostomy Tube Change` and fix oral issue not getting unselected (#8576) --- src/Common/constants.tsx | 2 +- src/Components/Patient/DailyRounds.tsx | 4 ++++ src/Locale/en/LogUpdate.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 8149a144ed9..c2ddf842665 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -759,7 +759,7 @@ export const NURSING_CARE_PROCEDURES = [ "restrain", "chest_tube_care", "tracheostomy_care", - "tracheostomy_change", + "tracheostomy_tube_change", "stoma_care", "catheter_care", "catheter_change", diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index f949bd9e404..ff5ddf43fdf 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -444,6 +444,10 @@ export const DailyRounds = (props: any) => { form["investigations_dirty"] = true; } + if (event.name === "nutrition_route" && event.value !== "ORAL") { + form["oral_issue"] = undefined; + } + dispatch({ type: "set_form", form }); }; diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index ec5dfe8521e..2e94643fd91 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -131,7 +131,7 @@ "NURSING_CARE_PROCEDURE__restrain": "Restrain", "NURSING_CARE_PROCEDURE__chest_tube_care": "Chest Tube Care", "NURSING_CARE_PROCEDURE__tracheostomy_care": "Tracheostomy Care", - "NURSING_CARE_PROCEDURE__tracheostomy_change": "Tracheostomy change ", + "NURSING_CARE_PROCEDURE__tracheostomy_tube_change": "Tracheostomy Tube Change", "NURSING_CARE_PROCEDURE__stoma_care": "Stoma Care", "NURSING_CARE_PROCEDURE__catheter_care": "Catheter Care", "NURSING_CARE_PROCEDURE__catheter_change": "Catheter Change", From 71637463023834a6da71cc4f4cc86a38603eba52 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Sat, 21 Sep 2024 09:53:20 +0530 Subject: [PATCH 6/9] Updated blood pressure range and remove hyphen for infusion "nor-adrenaline" (#8498) --- .../Common/BloodPressureFormField.tsx | 41 ++++------ .../DailyRounds/LogUpdateCardAttribute.tsx | 10 +-- .../Facility/Consultations/Mews.tsx | 2 +- .../Consultations/PrimaryParametersPlot.tsx | 18 +---- src/Components/Facility/models.tsx | 7 +- .../Form/FormFields/RangeFormField.tsx | 48 ++++++++---- .../LogUpdate/CriticalCarePreview.tsx | 3 +- .../LogUpdate/Sections/IOBalance.tsx | 2 +- src/Components/LogUpdate/Sections/Vitals.tsx | 77 ++++++++++--------- src/Components/Patient/DailyRounds.tsx | 11 +-- src/Components/Patient/models.tsx | 7 +- src/Components/Scribe/formDetails.ts | 4 +- src/Locale/en/Common.json | 1 - src/Locale/en/LogUpdate.json | 5 +- src/Locale/hi/LogUpdate.json | 1 - src/Locale/kn/LogUpdate.json | 1 - src/Locale/ml/LogUpdate.json | 1 - src/Locale/ta/LogUpdate.json | 1 - 18 files changed, 112 insertions(+), 128 deletions(-) diff --git a/src/Components/Common/BloodPressureFormField.tsx b/src/Components/Common/BloodPressureFormField.tsx index 53c4adf2194..205bc9a4905 100644 --- a/src/Components/Common/BloodPressureFormField.tsx +++ b/src/Components/Common/BloodPressureFormField.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from "react-i18next"; import { FieldValidator } from "../Form/FieldValidators"; import FormField from "../Form/FormFields/FormField"; import RangeAutocompleteFormField from "../Form/FormFields/RangeAutocompleteFormField"; @@ -8,42 +9,34 @@ import { } from "../Form/FormFields/Utils"; import { BloodPressure } from "../Patient/models"; -type Props = FormFieldBaseProps; +type Props = FormFieldBaseProps; export default function BloodPressureFormField(props: Props) { + const { t } = useTranslation(); const field = useFormFieldPropsResolver(props); + const map = meanArterialPressure(props.value)?.toFixed(); const handleChange = (event: FieldChangeEvent) => { - const value: BloodPressure = { - ...field.value, - [event.name]: event.value, - }; - value.mean = meanArterialPressure(value); - field.onChange({ name: field.name, value }); + const bp = field.value ?? {}; + bp[event.name as keyof BloodPressure] = event.value; + field.handleChange(Object.values(bp).filter(Boolean).length ? bp : null); }; - const map = - !!props.value?.diastolic && - !!props.value.systolic && - meanArterialPressure(props.value); - return ( MAP: {map.toFixed(1)} - ) : undefined, + labelSuffix: map && MAP: {map}, }} >
/ { - if (diastolic != null && systolic != null) { - return (2 * diastolic + systolic) / 3; +export const meanArterialPressure = (bp?: BloodPressure | null) => { + if (bp?.diastolic == null || bp?.systolic == null) { + return; } + return (2 * bp.diastolic + bp.systolic) / 3; }; export const BloodPressureValidator: FieldValidator = (bp) => { diff --git a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx index cc6f467b186..c1b5fec3c8c 100644 --- a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx +++ b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx @@ -1,10 +1,6 @@ import { useTranslation } from "react-i18next"; import PatientCategoryBadge from "../../../Common/PatientCategoryBadge"; -import { - BloodPressure, - DailyRoundsModel, - NameQuantity, -} from "../../../Patient/models"; +import { DailyRoundsModel, NameQuantity } from "../../../Patient/models"; import { PatientCategory } from "../../models"; interface Props { @@ -45,8 +41,8 @@ const LogUpdateCardAttribute = ({
- {(attributeValue as BloodPressure).systolic}/ - {(attributeValue as BloodPressure).diastolic} mmHg + {(attributeValue as DailyRoundsModel["bp"])?.systolic || "--"}/ + {(attributeValue as DailyRoundsModel["bp"])?.diastolic || "--"} mmHg
); diff --git a/src/Components/Facility/Consultations/Mews.tsx b/src/Components/Facility/Consultations/Mews.tsx index df54b83972f..91473a9a4ce 100644 --- a/src/Components/Facility/Consultations/Mews.tsx +++ b/src/Components/Facility/Consultations/Mews.tsx @@ -23,7 +23,7 @@ const getHeartRateScore = (value?: number) => { return 3; }; -const getSystolicBPScore = (value?: number) => { +const getSystolicBPScore = (value?: number | null) => { if (typeof value !== "number") return; if (value <= 70) return 3; diff --git a/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx b/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx index 0fb0844c576..271c39709ad 100644 --- a/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx +++ b/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx @@ -10,6 +10,7 @@ import CareIcon from "../../../CAREUI/icons/CareIcon"; import { PainDiagrams } from "./PainDiagrams"; import PageTitle from "../../Common/PageTitle"; import dayjs from "../../../Utils/dayjs"; +import { meanArterialPressure } from "../../Common/BloodPressureFormField"; import { PrimaryParametersPlotFields } from "../models"; interface PrimaryParametersPlotProps { @@ -18,17 +19,6 @@ interface PrimaryParametersPlotProps { consultationId: string; } -const sanitizeBPAttribute = (value: number | undefined) => { - // Temp. hack until the cleaning of daily rounds as a db migration is done. - // TODO: remove once migration is merged. - - if (value == null || value < 0) { - return; - } - - return value; -}; - export const PrimaryParametersPlot = ({ consultationId, }: PrimaryParametersPlotProps) => { @@ -77,19 +67,19 @@ export const PrimaryParametersPlot = ({ { name: "diastolic", data: Object.values(results) - .map((p: any) => p.bp && sanitizeBPAttribute(p.bp.diastolic)) + .map((p: any) => p.bp?.diastolic) .reverse(), }, { name: "systolic", data: Object.values(results) - .map((p: any) => p.bp && sanitizeBPAttribute(p.bp.systolic)) + .map((p: any) => p.bp?.systolic) .reverse(), }, { name: "mean", data: Object.values(results) - .map((p: any) => p.bp && sanitizeBPAttribute(p.bp.mean)) + .map((p: any) => meanArterialPressure(p.bp)) .reverse(), }, ]; diff --git a/src/Components/Facility/models.tsx b/src/Components/Facility/models.tsx index 92a55ae6ae7..a5455cb29bd 100644 --- a/src/Components/Facility/models.tsx +++ b/src/Components/Facility/models.tsx @@ -14,6 +14,7 @@ import { ConsultationDiagnosis, CreateDiagnosis } from "../Diagnosis/types"; import { NormalPrescription, PRNPrescription } from "../Medicine/models"; import { AssignedToObjectModel, + BloodPressure, DailyRoundsModel, FileUploadModel, } from "../Patient/models"; @@ -427,11 +428,7 @@ export const PrimaryParametersPlotFields = [ ] as const satisfies (keyof DailyRoundsModel)[]; export type PrimaryParametersPlotRes = { - bp: { - mean?: number; - systolic?: number; - diastolic?: number; - }; + bp: BloodPressure; pulse: number; temperature: string; resp: number; diff --git a/src/Components/Form/FormFields/RangeFormField.tsx b/src/Components/Form/FormFields/RangeFormField.tsx index aeda58ac0fd..e7e9b1e9a53 100644 --- a/src/Components/Form/FormFields/RangeFormField.tsx +++ b/src/Components/Form/FormFields/RangeFormField.tsx @@ -12,9 +12,12 @@ import { SelectFormField } from "./SelectFormField"; type BaseProps = FormFieldBaseProps & { min: number; max: number; + sliderMin?: number; + sliderMax?: number; step?: number; valueDescriptions?: ValueDescription[]; hideInput?: boolean; + hideUnitInLabel?: boolean; }; type PropsWithUnit = BaseProps & { @@ -75,18 +78,20 @@ export default function RangeFormField(props: Props) { ? props.valueDescriptions?.find((vd) => (vd.till || props.max) >= value) : undefined; - const roundedValue = - Math.round(((value || min) + Number.EPSILON) * 100) / 100; - const allValueColors = props.valueDescriptions?.every((vd) => vd.color); - const trailPercent = ((roundedValue - min) / ((max || 0) - (min || 0))) * 100; + const [sliderMin, sliderMax] = [ + props.sliderMin ?? props.min, + props.sliderMax ?? props.max, + ].map(unit.conversionFn); - const snapStopLength = Math.min( - (props.max - props.min) / (props.step || 1), - props.max - props.min, - 20, - ); + const sliderDelta = sliderMax - sliderMin; + + const trailPercent = + ((Math.round(((value || sliderMin) + Number.EPSILON) * 100) / 100 - + sliderMin) / + sliderDelta) * + 100; const handleChange = (v: number) => field.handleChange(unit.inversionFn(v)); @@ -98,7 +103,10 @@ export default function RangeFormField(props: Props) { ...field, label: ( <> - {field.label} {unit.label && ({unit.label})} + {field.label}{" "} + {!props.hideUnitInLabel && unit.label && ( + ({unit.label}) + )} ), labelSuffix: ( @@ -124,6 +132,7 @@ export default function RangeFormField(props: Props) { max={max} errorClassName="hidden" inputClassName="py-1.5 mr-4" + disabled={props.disabled} /> {props.units?.length ? ( handleChange(e.target.valueAsNumber)} />
- {Array.from({ length: snapStopLength + 1 }).map((_, index) => ( + {Array.from({ + length: + 1 + Math.min(sliderDelta / (props.step || 1), sliderDelta, 20), + }).map((_, index) => (
))}
- {properRoundOf(min)} - {properRoundOf(max)} + {properRoundOf(sliderMin)} + {properRoundOf(sliderMax)}
); diff --git a/src/Components/LogUpdate/CriticalCarePreview.tsx b/src/Components/LogUpdate/CriticalCarePreview.tsx index 838887decf9..a458b1e245c 100644 --- a/src/Components/LogUpdate/CriticalCarePreview.tsx +++ b/src/Components/LogUpdate/CriticalCarePreview.tsx @@ -16,6 +16,7 @@ import { VentilatorFields } from "./Sections/RespiratorySupport/Ventilator"; import PressureSore from "./Sections/PressureSore/PressureSore"; import { IOBalanceSections } from "./Sections/IOBalance"; import PainChart from "./components/PainChart"; +import { meanArterialPressure } from "../Common/BloodPressureFormField"; import { DailyRoundsModel } from "../Patient/models"; type Props = { @@ -255,7 +256,7 @@ export default function CriticalCarePreview(props: Props) { />
)} diff --git a/src/Components/LogUpdate/Sections/IOBalance.tsx b/src/Components/LogUpdate/Sections/IOBalance.tsx index ca0bd4867d2..10f76581a46 100644 --- a/src/Components/LogUpdate/Sections/IOBalance.tsx +++ b/src/Components/LogUpdate/Sections/IOBalance.tsx @@ -14,7 +14,7 @@ export const IOBalanceSections = [ name: "Infusions", options: [ "Adrenalin", - "Nor-adrenalin", + "Noradrenalin", "Vasopressin", "Dopamine", "Dobutamine", diff --git a/src/Components/LogUpdate/Sections/Vitals.tsx b/src/Components/LogUpdate/Sections/Vitals.tsx index 0561debc88c..44902bbf0b8 100644 --- a/src/Components/LogUpdate/Sections/Vitals.tsx +++ b/src/Components/LogUpdate/Sections/Vitals.tsx @@ -2,61 +2,31 @@ import { useTranslation } from "react-i18next"; import { celsiusToFahrenheit, fahrenheitToCelsius, - properRoundOf, rangeValueDescription, } from "../../../Utils/utils"; import { meanArterialPressure } from "../../Common/BloodPressureFormField"; - import RadioFormField from "../../Form/FormFields/RadioFormField"; import RangeFormField from "../../Form/FormFields/RangeFormField"; import TextAreaFormField from "../../Form/FormFields/TextAreaFormField"; -import { FieldChangeEvent } from "../../Form/FormFields/Utils"; import PainChart from "../components/PainChart"; import { LogUpdateSectionMeta, LogUpdateSectionProps } from "../utils"; import { HEARTBEAT_RHYTHM_CHOICES } from "../../../Common/constants"; +import { BloodPressure } from "../../Patient/models"; const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { const { t } = useTranslation(); - const handleBloodPressureChange = (event: FieldChangeEvent) => { - const bp = { - ...(log.bp ?? {}), - [event.name]: event.value, - }; - bp.mean = meanArterialPressure(bp); - onChange({ bp }); - }; return (
-

{t("blood_pressure")}

+

{t("LOG_UPDATE_FIELD_LABEL__bp")}

- {t("map_acronym")}:{" "} - {(log.bp?.mean && properRoundOf(log.bp.mean)) || "--"} + {t("map_acronym")}: {meanArterialPressure(log.bp)?.toFixed() ?? "--"}{" "} + mmHg
- - + +
{ ); }; +const BPAttributeEditor = ({ + attribute, + log, + onChange, +}: LogUpdateSectionProps & { attribute: "systolic" | "diastolic" }) => { + const { t } = useTranslation(); + + return ( + { + const bp = log.bp ?? {}; + bp[event.name as keyof BloodPressure] = event.value; + onChange({ + bp: Object.values(bp).filter(Boolean).length ? bp : undefined, + }); + }} + value={log.bp?.[attribute] ?? undefined} + min={0} + max={400} + sliderMin={30} + sliderMax={270} + step={1} + unit="mmHg" + valueDescriptions={rangeValueDescription( + attribute === "systolic" + ? { low: 99, high: 139 } + : { low: 49, high: 89 }, + )} + hideUnitInLabel + /> + ); +}; + Vitals.meta = { title: "Vitals", icon: "l-heartbeat", diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index ff5ddf43fdf..c0cd7fe803c 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -92,12 +92,7 @@ export const DailyRounds = (props: any) => { rhythm_detail: "", ventilator_spo2: null, consciousness_level: undefined, - bp: { - systolic: undefined, - diastolic: undefined, - mean: undefined, - }, - // bed: null, + bp: undefined, }; const initError = Object.assign( @@ -255,7 +250,7 @@ export const DailyRounds = (props: any) => { } return; case "bp": { - const error = BloodPressureValidator(state.form.bp); + const error = state.form.bp && BloodPressureValidator(state.form.bp); if (error) { errors.bp = error; invalidForm = true; @@ -351,7 +346,7 @@ export const DailyRounds = (props: any) => { if (state.form.rounds_type !== "VENTILATOR") { data = { ...data, - bp: state.form.bp ?? {}, + bp: state.form.bp, pulse: state.form.pulse ?? null, resp: state.form.resp ?? null, temperature: state.form.temperature ?? null, diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index b1098dcbbc0..48b01eeed3f 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -277,11 +277,10 @@ export const DailyRoundTypes = [ "TELEMEDICINE", ] as const; -export interface BloodPressure { - diastolic?: number; - mean?: number; +export type BloodPressure = { systolic?: number; -} + diastolic?: number; +}; export interface IPainScale { description: string; diff --git a/src/Components/Scribe/formDetails.ts b/src/Components/Scribe/formDetails.ts index 6300ac7e3c2..c889dcf2558 100644 --- a/src/Components/Scribe/formDetails.ts +++ b/src/Components/Scribe/formDetails.ts @@ -129,9 +129,9 @@ const DAILY_ROUND_FORM_SCRIBE_DATA: Field[] = [ { friendlyName: "bp", id: "bp", - default: { systolic: null, diastolic: null, mean: null }, + default: { systolic: null, diastolic: null }, type: "{ systolic?: number, diastolic?: number }", - example: "{ systolic: 120 }", + example: "{ systolic: 120, diastolic: 90 }", description: "An object to store the blood pressure of the patient. It may contain two integers, systolic and diastolic.", validator: (value) => { diff --git a/src/Locale/en/Common.json b/src/Locale/en/Common.json index b0316e4d98c..fb36e6a07f8 100644 --- a/src/Locale/en/Common.json +++ b/src/Locale/en/Common.json @@ -71,7 +71,6 @@ "date_of_positive_covid_19_swab": "Date of Positive Covid 19 Swab", "patient_no": "OP/IP No", "date_of_admission": "Date of Admission", - "india_1": "India", "unique_id": "Unique Id", "date_and_time": "Date and Time", "facility_type": "Facility type", diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index 2e94643fd91..386415d173e 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -32,7 +32,7 @@ "ROUNDS_TYPE__AUTOMATED": "Virtual Nursing Assistant", "ROUNDS_TYPE__TELEMEDICINE": "Tele-medicine Log", "RESPIRATORY_SUPPORT_SHORT__UNKNOWN": "None", - "RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O2 Support", + "RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O₂ Support", "RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE": "NIV", "RESPIRATORY_SUPPORT_SHORT__INVASIVE": "IV", "RESPIRATORY_SUPPORT__UNKNOWN": "None", @@ -138,7 +138,6 @@ "HEARTBEAT_RHYTHM__REGULAR": "Regular", "HEARTBEAT_RHYTHM__IRREGULAR": "Irregular", "HEARTBEAT_RHYTHM__UNKNOWN": "Unknown", - "blood_pressure": "Blood Pressure", "map_acronym": "M.A.P.", "systolic": "Systolic", "diastolic": "Diastolic", @@ -146,11 +145,11 @@ "pain_chart_description": "Mark region and intensity of pain", "bradycardia": "Bradycardia", "tachycardia": "Tachycardia", + "vitals": "Vitals", "procedures_select_placeholder": "Select procedures to add details", "oral_issue_for_non_oral_nutrition_route_error": "Can be specified only if nutrition route is set to Oral", "routine": "Routine", "bladder": "Bladder", "nutrition": "Nutrition", - "vitals": "Vitals", "nursing_care": "Nursing Care" } \ No newline at end of file diff --git a/src/Locale/hi/LogUpdate.json b/src/Locale/hi/LogUpdate.json index 176886c855b..9adc6a1e093 100644 --- a/src/Locale/hi/LogUpdate.json +++ b/src/Locale/hi/LogUpdate.json @@ -56,7 +56,6 @@ "HEARTBEAT_RHYTHM__REGULAR": "नियमित", "HEARTBEAT_RHYTHM__IRREGULAR": "अनियमित", "HEARTBEAT_RHYTHM__UNKNOWN": "अज्ञात", - "blood_pressure": "रक्तचाप", "map_acronym": "मानचित्र", "systolic": "सिस्टोलिक", "diastolic": "डायस्टोलिक", diff --git a/src/Locale/kn/LogUpdate.json b/src/Locale/kn/LogUpdate.json index 25e4ee4623e..188b02c3925 100644 --- a/src/Locale/kn/LogUpdate.json +++ b/src/Locale/kn/LogUpdate.json @@ -56,7 +56,6 @@ "HEARTBEAT_RHYTHM__REGULAR": "ನಿಯಮಿತ", "HEARTBEAT_RHYTHM__IRREGULAR": "ಅನಿಯಮಿತ", "HEARTBEAT_RHYTHM__UNKNOWN": "ಅಜ್ಞಾತ", - "blood_pressure": "ರಕ್ತದೊತ್ತಡ", "map_acronym": "ನಕ್ಷೆ", "systolic": "ಸಿಸ್ಟೊಲಿಕ್", "diastolic": "ಡಯಾಸ್ಟೊಲಿಕ್", diff --git a/src/Locale/ml/LogUpdate.json b/src/Locale/ml/LogUpdate.json index d2503cd8d34..f327199d509 100644 --- a/src/Locale/ml/LogUpdate.json +++ b/src/Locale/ml/LogUpdate.json @@ -56,7 +56,6 @@ "HEARTBEAT_RHYTHM__REGULAR": "പതിവ്", "HEARTBEAT_RHYTHM__IRREGULAR": "ക്രമരഹിതം", "HEARTBEAT_RHYTHM__UNKNOWN": "അജ്ഞാതം", - "blood_pressure": "രക്തസമ്മർദ്ദം", "map_acronym": "മാപ്പ്", "systolic": "സിസ്റ്റോളിക്", "diastolic": "ഡയസ്റ്റോളിക്", diff --git a/src/Locale/ta/LogUpdate.json b/src/Locale/ta/LogUpdate.json index 61a52f69d48..668dbd54a46 100644 --- a/src/Locale/ta/LogUpdate.json +++ b/src/Locale/ta/LogUpdate.json @@ -56,7 +56,6 @@ "HEARTBEAT_RHYTHM__REGULAR": "வழக்கமான", "HEARTBEAT_RHYTHM__IRREGULAR": "ஒழுங்கற்ற", "HEARTBEAT_RHYTHM__UNKNOWN": "தெரியவில்லை", - "blood_pressure": "இரத்த அழுத்தம்", "map_acronym": "வரைபடம்", "systolic": "சிஸ்டாலிக்", "diastolic": "டயஸ்டாலிக்", From 7a8241629a93ecad57a75d87e5f1b8c06b8db8a6 Mon Sep 17 00:00:00 2001 From: Nithin Date: Sat, 21 Sep 2024 10:10:00 +0530 Subject: [PATCH 7/9] Removed hacks for loading investigations in Consultation Form, updated type definitions (#8416) --------- Co-authored-by: rithviknishad --- src/Components/Facility/ConsultationForm.tsx | 4 +--- .../DailyRounds/LogUpdateCardAttribute.tsx | 2 +- src/Components/Facility/models.tsx | 3 --- src/Components/Patient/DailyRoundListDetails.tsx | 10 +++------- src/Components/Patient/models.tsx | 1 - 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 2cfe9c8f4df..06b50d69912 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -404,9 +404,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { cause_of_death: data?.discharge_notes || "", death_datetime: data?.death_datetime || "", death_confirmed_doctor: data?.death_confirmed_doctor || "", - InvestigationAdvice: Array.isArray(data.investigation) - ? data.investigation - : [], + InvestigationAdvice: data.investigation ?? [], diagnoses: data.diagnoses?.sort( (a: ConsultationDiagnosis, b: ConsultationDiagnosis) => ConditionVerificationStatuses.indexOf(a.verification_status) - diff --git a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx index c1b5fec3c8c..7e58f96069c 100644 --- a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx +++ b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx @@ -66,7 +66,7 @@ const LogUpdateCardAttribute = ({
- {t(attributeValue)} + {t(attributeValue as string)}
); diff --git a/src/Components/Facility/models.tsx b/src/Components/Facility/models.tsx index a5455cb29bd..723f0af1946 100644 --- a/src/Components/Facility/models.tsx +++ b/src/Components/Facility/models.tsx @@ -11,7 +11,6 @@ import { RouteToFacility } from "../Common/RouteToFacilitySelect"; import { InvestigationType } from "../Common/prescription-builder/InvestigationBuilder"; import { ProcedureType } from "../Common/prescription-builder/ProcedureBuilder"; import { ConsultationDiagnosis, CreateDiagnosis } from "../Diagnosis/types"; -import { NormalPrescription, PRNPrescription } from "../Medicine/models"; import { AssignedToObjectModel, BloodPressure, @@ -133,8 +132,6 @@ export interface ConsultationModel { created_date?: string; discharge_date?: string; new_discharge_reason?: (typeof DISCHARGE_REASONS)[number]["id"]; - discharge_prescription?: NormalPrescription; - discharge_prn_prescription?: PRNPrescription; discharge_notes?: string; examination_details?: string; history_of_present_illness?: string; diff --git a/src/Components/Patient/DailyRoundListDetails.tsx b/src/Components/Patient/DailyRoundListDetails.tsx index fbf001427dd..eb7eda62064 100644 --- a/src/Components/Patient/DailyRoundListDetails.tsx +++ b/src/Components/Patient/DailyRoundListDetails.tsx @@ -16,13 +16,9 @@ export const DailyRoundListDetails = (props: any) => { const { loading: isLoading } = useQuery(routes.getDailyReport, { pathParams: { consultationId, id }, - onResponse: ({ res, data }) => { - if (res && data) { - const tdata: DailyRoundsModel = { - ...data, - medication_given: data.medication_given ?? [], - }; - setDailyRoundListDetails(tdata); + onResponse: ({ data }) => { + if (data) { + setDailyRoundListDetails(data); } }, }); diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 48b01eeed3f..cf35680de11 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -310,7 +310,6 @@ export interface DailyRoundsModel { physical_examination_info?: string; other_details?: string; consultation?: number; - medication_given?: Array; action?: string; review_interval?: number; id?: string; From e14183bebc1f1dacd6057ed6a831457f75886ac6 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Mon, 23 Sep 2024 13:03:52 +0530 Subject: [PATCH 8/9] add JWKS_BASE64 for cypress workflow (#8589) --- .github/workflows/cypress.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 14a15d30ee8..42a39a6c3b7 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -45,9 +45,12 @@ jobs: cd care echo DISABLE_RATELIMIT=True >> docker/.prebuilt.env echo "CORS_ALLOWED_ORIGINS=\"[\\\"http://localhost:4000\\\"]\"" >> docker/.prebuilt.env + echo JWKS_BASE64=\"$JWKS_BASE64\" >> docker/.prebuilt.env make docker_config_file=docker-compose.pre-built.yaml up make docker_config_file=docker-compose.pre-built.yaml load-dummy-data cd .. + env: + JWKS_BASE64: ${{ secrets.JWKS_BASE64 }} - name: Wait for care to be up ♻ uses: nick-fields/retry@v2 From 53ed1623380f70d57ad5bf3c7303e9d7f32f1a92 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Mon, 23 Sep 2024 14:04:28 +0530 Subject: [PATCH 9/9] fix cypress workflow on forked prs (#8591) --- .github/runner-files/jwks.b64.txt | 1 + .github/workflows/cypress.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .github/runner-files/jwks.b64.txt diff --git a/.github/runner-files/jwks.b64.txt b/.github/runner-files/jwks.b64.txt new file mode 100644 index 00000000000..189ca3ec08e --- /dev/null +++ b/.github/runner-files/jwks.b64.txt @@ -0,0 +1 @@ +eyJrZXlzIjogW3sibiI6ICJ4X21fNGNKQ3NHTHN4WkFIa2VCbFZQa2ZqNFNSckdHN3UySERFM3VLX3dFNERhTWhHQ2lxTXFsaTFDM2pxSE5JTVhuWV9ab1M5R3pHbnJpdGg1UUZGVDlLMGtBdF9YaXBJNnV1djcwOWtOV2FFNXZrYks4VlFRcFd2UFp4NUJSeTBGay0wU2lxZG1xOTNJRXdUTnNTLUpETnRXQm5VX0F1cjU0UXptQmI3SmhfOGttRDAtaHhROVZVejRpSUU3QTlySU5vQXNHSHhfdGtuNXd6YmpPR3F2Q3JqRi1RWXo0OGJXVkZzVVliNkFqUlFrZER2RWVwQlpNSHZsNVUxQlZxOVdRTTJGTmRUR0tJb3ZYeDRuTDFybUVONHpxbEpqWmc2bEZiODVuOUhkc01VblFiSXhkUjVlVl8wWmNVaHBrQWc0NldrejRZWkxMNm5NaGR0RmFTMXciLCAiZSI6ICJBUUFCIiwgImQiOiAiRXo4T3dDZ2xxZnREWlhwSXVEbjhGck1KWGhNNHZfb0NDdlZNUko1QjBPd3BuR3BrWDRKZWF4VFJYYkZ5OVQzdkowX2VXZjRQcl9XZUloMk5HZnpkaGw5NmtJUzd5R2JxQkhSY0U3a2ZhVWFkbHlDTVdnZDV5TEk1aWVOQUw5N2w4X1o2N0w5NHRIX3VlUF80Q1pXV0hGVTNieXJ4bHVzSld6NmZ5SFVPczlVSDFxV284V1RNOVp0RndqV0cxOWpkUXZ1RkQ0Z0x4UEJYZEk5ZV9zdTNwbmZHR0ZkN0xfMDFwcEFkQ2Y5eHhNTWFEel8wZ0xXM0NENFhnWU1rS2d3eDdKWlVlN0VaWFhyU0lETzFZN202MmF4NEpZRU5pSDFiaVlwQk15dmVfM3FzdnRQOWR4eVg2VkFROGZFNVdnOTBCcThsd1F0NzROWmgzMHhDY0dDNHFRIiwgInAiOiAiOXhXeXNjbVExT1FRcEptWmkzZDR5Tk5qT29Ja3lQVDRyZVRBNlJJdW5PSjVDUVFiVE1BVlpzUmsxa05rQ2R1cGVQU1ZnNWVXNktpOXZIV1M3b2NnclVEYzJTRkw0RWtNY21UR2lHRnh1YVIzNHRMTXpUQlJEVVFxZnR6WGxraGRJWmdKenJCT2h4NEEyZ1FQTnRrNkNVSEJWRGRncng0RmR3c21SaElSOU9rIiwgInEiOiAienpEb2FvclpqZ2ZPeDVHckFJZ3R3SGVhM29vQTlqbkFSeDdvM1V2bHprY3p1eC1DY1JORGppS3duaGxzVEROWFFWRTBXUlpWa0ZTQ0JVU3JSS1dLd0JGcnFVQzhlMkxwQVpBb0ZTQ0dqdllIMi1hdGUxeEhxc0NGY09OVlVYM1JXcFd4OFQ4RGhSNGpfaTRKN3g0d2VHc1hkRHRpelY2eHlZMmNHSjltY2I4IiwgImRwIjogInpUV3FLZHA4ZlRQRlZzOXpKTV9lOHZ3TnA2UTdKT1BBUGJ5Rk00MjBSUHdiQmdfeEZIZGJ6dlJCdzJwSkJaNzRTOHJtLWxuR0xna25QQVJ5T2NUa3NMXzBMQ2xwT1NleVBMZlI0NmI2cXZJYjE3aTMtNXFyVmxkTTZfeEMyVF9VaVhnYWZSMFV1MGVCOFlfNWl0WXpTMGpmWmpCd0RrRGl6UkhuZ2I2MFJ6RSIsICJkcSI6ICJYZHdoSGNyaV9ZV3A5aHlXWV9wTkI2am5Qck16OWxkNU5IN2JMUTBxQVFXZWVNR3dmUHNtR21pNnJCU0dUQXJpRjFQckxBU0RKSXcwRHFEcUdZSUkxalBPR3ZHWnNTZkF1SldPb3V1R0taTnBRZ1JCU09Zb0RVR0Q4Zno2ZEoxVHp2NkxpdWRwOTg4TXJTUThHZGdLU3pMd2dCWTdEeUE3MkR2UG9CUHQtODgiLCAicWkiOiAiSlF0UUJERXdnQVVMcWJFRWoybmdyXy02aV9pUmdRWmJTQ0hXNGdpZG5fdHlwdUJWS2R0ZW1jT3J6M3NnTnk0ekZrZElTbUZfbmdnbFlJb080TjNza1NNUXdGY1B0S1kzWUVlT2ZGNzMzRDZaTVJtSTFTby12QU54YVBDUkREbnUwTWk1TnUzbS02SkhGSFF5RDU2ZTFsQUlwUS1lakpuTWR6MXQ0aUplbEFzIiwgImt0eSI6ICJSU0EiLCAia2lkIjogIlhjckcyVS0tR3B4SVhORXpKOWNWREdRaEUzeXlIamREMDN1aDZmYXpRX2siLCAiYWxnIjogIlJTMjU2In1dfQ== \ No newline at end of file diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 42a39a6c3b7..500dbd92be0 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -45,7 +45,7 @@ jobs: cd care echo DISABLE_RATELIMIT=True >> docker/.prebuilt.env echo "CORS_ALLOWED_ORIGINS=\"[\\\"http://localhost:4000\\\"]\"" >> docker/.prebuilt.env - echo JWKS_BASE64=\"$JWKS_BASE64\" >> docker/.prebuilt.env + echo JWKS_BASE64=\"$(cat ../.github/runner-files/jwks.b64.txt)\" >> docker/.prebuilt.env make docker_config_file=docker-compose.pre-built.yaml up make docker_config_file=docker-compose.pre-built.yaml load-dummy-data cd ..