Skip to content

Commit

Permalink
Merge pull request #7967 from coronasafe/staging
Browse files Browse the repository at this point in the history
Production Release v24.23.0
  • Loading branch information
gigincg authored Jun 3, 2024
2 parents 92de223 + 3cf5e4a commit 4c9d500
Show file tree
Hide file tree
Showing 62 changed files with 2,075 additions and 784 deletions.
30 changes: 12 additions & 18 deletions cypress/e2e/patient_spec/patient_consultation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("Patient Consultation in multiple combination", () => {
patientConsultationPage.selectConsultationStatus(
"Outpatient/Emergency Room",
);
cy.searchAndSelectOption("#symptoms", "ASYMPTOMATIC");
cy.get("#is_asymptomatic").click();
patientConsultationPage.typePatientIllnessHistory(patientIllnessHistory);
patientConsultationPage.typePatientExaminationHistory(
patientExaminationHistory,
Expand Down Expand Up @@ -175,7 +175,7 @@ describe("Patient Consultation in multiple combination", () => {
"Outpatient/Emergency Room",
);
// Asymptomatic
cy.searchAndSelectOption("#symptoms", "ASYMPTOMATIC");
cy.get("#is_asymptomatic").click();
// CRITICAL category
patientConsultationPage.selectPatientCategory("Critical");
patientConsultationPage.selectPatientSuggestion("Declare Death");
Expand Down Expand Up @@ -234,7 +234,7 @@ describe("Patient Consultation in multiple combination", () => {
);
patientConsultationPage.selectPatientWard("Dummy Location 1");
// Asymptomatic
cy.searchAndSelectOption("#symptoms", "ASYMPTOMATIC");
cy.get("#is_asymptomatic").click();
// Abnormal category
patientConsultationPage.selectPatientCategory("Moderate");
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
Expand Down Expand Up @@ -293,18 +293,14 @@ describe("Patient Consultation in multiple combination", () => {
);
// verify the free text in referring facility name
patientConsultationPage.typeReferringFacility("Life Care Hospital");
// Vomiting and Nausea symptoms
patientConsultationPage.selectSymptomsDate("01012024");
patientConsultationPage.typeAndMultiSelectSymptoms("s", [
"SPUTUM",
"SORE THROAT",
"Sore throat",
"Sputum",
]);
patientConsultationPage.clickAddSymptom();
// Stable category
patientConsultationPage.selectPatientCategory("Mild");
// Date of symptoms
patientConsultationPage.selectSymptomsDate(
"#symptoms_onset_date",
"01012024",
);
// OP Consultation
patientConsultationPage.selectPatientSuggestion("OP Consultation");
// one ICD-11 and no principal
Expand Down Expand Up @@ -341,18 +337,16 @@ describe("Patient Consultation in multiple combination", () => {
patientConsultationPage.selectConsultationStatus(
"Outpatient/Emergency Room",
);
// Select the Symptoms - Sore throat and fever symptoms
// Select the Symptoms - Breathlessness and Bleeding symptoms
patientConsultationPage.selectSymptomsDate("01012024");
patientConsultationPage.typeAndMultiSelectSymptoms("b", [
"BREATHLESSNESS",
"BLEEDING",
"Breathlessness",
"Bleeding",
]);
patientConsultationPage.clickAddSymptom();
// Comfort Care category
patientConsultationPage.selectPatientCategory("Comfort Care");
// Date of symptoms
patientConsultationPage.selectSymptomsDate(
"#symptoms_onset_date",
"01012024",
);
// Decision after consultation - Referred to Facility
patientConsultationPage.selectPatientSuggestion(
"Refer to another Hospital",
Expand Down
22 changes: 11 additions & 11 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientLogupdate = new PatientLogupdate();
const domicilaryPatient = "Dummy Patient 11";
const patientCategory = "Moderate";
const additionalSymptoms = "ASYMPTOMATIC";
const additionalSymptoms = "Fever";
const physicalExamination = "physical examination details";
const otherExamination = "Other";
const patientSystolic = "119";
Expand Down Expand Up @@ -59,9 +59,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification(
"Telemedicine Log Updates details created successfully",
);
cy.verifyNotification("Tele-medicine log update created successfully");
});

it("Create a new log normal update for a domicilary care patient and edit it", () => {
Expand All @@ -86,7 +84,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Normal Log Updates details created successfully");
cy.verifyNotification("Normal log update created successfully");
cy.closeNotification();
// edit the card and verify the data.
cy.contains("Daily Rounds").click();
Expand All @@ -109,7 +107,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickClearButtonInElement("#diastolic");
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Normal Log Updates details updated successfully");
cy.verifyNotification("Normal log update details updated successfully");
cy.contains("Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
cy.verifyContentPresence("#consultation-preview", [
Expand All @@ -127,7 +125,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.typeAdditionalSymptoms(additionalSymptoms);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.clickAddSymptom();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
Expand All @@ -140,10 +140,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.wait(2000);
cy.verifyNotification("Normal Log Updates details created successfully");
cy.verifyNotification("Normal log update created successfully");
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#basic-information", [additionalSymptoms]);
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
});

it("Create a normal log update to verify MEWS Score Functionality", () => {
Expand All @@ -163,7 +163,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRespiratory(patientRespiratory);
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Normal Log Updates details created successfully");
cy.verifyNotification("Normal log update created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["9"]);
// Verify the Incomplete data will give blank info
Expand All @@ -173,7 +173,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
cy.submitButton("Save");
cy.verifyNotification("Normal Log Updates details created successfully");
cy.verifyNotification("Normal log update created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["-"]);
});
Expand Down
6 changes: 6 additions & 0 deletions cypress/e2e/users_spec/user_homepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe("User Homepage", () => {
userPage.selectDistrict("Ernakulam");
userPage.typeInPhoneNumber(phone_number);
userPage.typeInAltPhoneNumber(alt_phone_number);
userPage.selectHomeFacility("Dummy Facility 40");
userPage.applyFilter();
userPage.verifyUrlafteradvancefilter();
userPage.checkUsernameText(usernameToTest);
Expand All @@ -46,13 +47,18 @@ describe("User Homepage", () => {
"WhatsApp no.: +919876543219",
);
userPage.verifyDataTestIdText("Role", "Role: Doctor");
userPage.verifyDataTestIdText(
"Home Facility",
"Home Facility: Dummy Facility 40",
);
userPage.verifyDataTestIdText("District", "District: Ernakulam");
userPage.clearFilters();
userPage.verifyDataTestIdNotVisible("First Name");
userPage.verifyDataTestIdNotVisible("Last Name");
userPage.verifyDataTestIdNotVisible("Phone Number");
userPage.verifyDataTestIdNotVisible("WhatsApp no.");
userPage.verifyDataTestIdNotVisible("Role");
userPage.verifyDataTestIdNotVisible("Home Facility");
userPage.verifyDataTestIdNotVisible("District");
});

Expand Down
12 changes: 6 additions & 6 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export class PatientConsultationPage {
cy.clickAndSelectOption("#route_to_facility", status);
}

selectSymptoms(symptoms) {
cy.clickAndMultiSelectOption("#symptoms", symptoms);
}
typeAndMultiSelectSymptoms(input, symptoms) {
cy.typeAndMultiSelectOption("#symptoms", input, symptoms);
cy.typeAndMultiSelectOption("#additional_symptoms", input, symptoms);
}
selectSymptomsDate(date: string) {
cy.clickAndTypeDate("#symptoms_onset_date", date);
}
selectSymptomsDate(selector: string, date: string) {
cy.clickAndTypeDate(selector, date);
clickAddSymptom() {
cy.get("#add-symptom").click();
}

verifyConsultationPatientName(patientName: string) {
Expand Down
10 changes: 10 additions & 0 deletions cypress/pageobject/Patient/PatientLogupdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ class PatientLogupdate {
cy.searchAndSelectOption("#additional_symptoms", symptoms);
}

typeAndMultiSelectSymptoms(input, symptoms) {
cy.typeAndMultiSelectOption("#additional_symptoms", input, symptoms);
}
selectSymptomsDate(date: string) {
cy.clickAndTypeDate("#symptoms_onset_date", date);
}
clickAddSymptom() {
cy.get("#add-symptom").click();
}

typeSystolic(systolic: string) {
cy.searchAndSelectOption("#systolic", systolic);
}
Expand Down
4 changes: 4 additions & 0 deletions cypress/pageobject/Users/UserSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export class UserPage {
cy.get("#alt_phone_number").click().type(altPhone);
}

selectHomeFacility(facility: string) {
cy.searchAndSelectOption("input[name='home_facility']", facility);
}

applyFilter() {
cy.get("#apply-filter").click();
}
Expand Down
8 changes: 7 additions & 1 deletion src/CAREUI/display/NetworkSignal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function NetworkSignal({ strength, children }: Props) {
return (
<div
className={classNames(
"flex items-center", // Strength colors
"relative flex items-center", // Strength colors
strength === 0 && "text-danger-500",
strength === 1 && "text-danger-500",
strength === 2 && "text-warning-500",
Expand Down Expand Up @@ -50,6 +50,12 @@ export default function NetworkSignal({ strength, children }: Props) {
/>
))
)}
{!!strength && strength < 2 && (
<CareIcon
icon="l-exclamation-circle"
className="absolute left-0.5 top-0 animate-pulse text-sm text-danger-500"
/>
)}
</div>
{children}
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/CAREUI/display/RecordMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import CareIcon from "../icons/CareIcon";
import {
formatDate,
formatDateTime,
formatName,
formatTime,
isUserOnline,
relativeTime,
} from "../../Utils/utils";
Expand Down Expand Up @@ -39,8 +38,9 @@ const RecordMeta = ({
<div className="tooltip">
<span className="underline">{relativeTime(time)}</span>
<span className="tooltip-text tooltip-bottom flex -translate-x-1/2 gap-1 text-xs font-medium tracking-wider">
{formatTime(time)} <br />
{formatDate(time)}
<span className="whitespace-break-spaces">
{formatDateTime(time).replace(";", "")}
</span>
{user && !inlineUser && (
<span className="flex items-center gap-1">
by
Expand Down
15 changes: 12 additions & 3 deletions src/CAREUI/misc/Fullscreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@ interface Props {
fullscreenClassName?: string;
children: React.ReactNode;
fullscreen: boolean;
onExit: () => void;
onExit: (reason?: "DEVICE_UNSUPPORTED") => void;
}

export default function Fullscreen(props: Props) {
const ref = useRef<HTMLDivElement>(null);

useEffect(() => {
if (!ref.current) {
return;
}

if (props.fullscreen) {
ref.current?.requestFullscreen();
if (ref.current.requestFullscreen) {
ref.current.requestFullscreen();
} else {
props.onExit("DEVICE_UNSUPPORTED");
}
} else {
document.exitFullscreen();
document.exitFullscreen?.();
}
}, [props.fullscreen]);

Expand All @@ -27,6 +35,7 @@ export default function Fullscreen(props: Props) {
};

document.addEventListener("fullscreenchange", listener);

return () => {
document.removeEventListener("fullscreenchange", listener);
};
Expand Down
42 changes: 4 additions & 38 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,42 +318,6 @@ export const REVIEW_AT_CHOICES: Array<OptionsType> = [
{ id: 30 * 24 * 60, text: "1 month" },
];

export const SYMPTOM_CHOICES = [
{ id: 1, text: "ASYMPTOMATIC", isSingleSelect: true },
{ id: 2, text: "FEVER" },
{ id: 3, text: "SORE THROAT" },
{ id: 4, text: "COUGH" },
{ id: 5, text: "BREATHLESSNESS" },
{ id: 6, text: "MYALGIA" },
{ id: 7, text: "ABDOMINAL DISCOMFORT" },
{ id: 8, text: "VOMITING" },
{ id: 11, text: "SPUTUM" },
{ id: 12, text: "NAUSEA" },
{ id: 13, text: "CHEST PAIN" },
{ id: 14, text: "HEMOPTYSIS" },
{ id: 15, text: "NASAL DISCHARGE" },
{ id: 16, text: "BODY ACHE" },
{ id: 17, text: "DIARRHOEA" },
{ id: 18, text: "PAIN" },
{ id: 19, text: "PEDAL EDEMA" },
{ id: 20, text: "WOUND" },
{ id: 21, text: "CONSTIPATION" },
{ id: 22, text: "HEAD ACHE" },
{ id: 23, text: "BLEEDING" },
{ id: 24, text: "DIZZINESS" },
{ id: 25, text: "CHILLS" },
{ id: 26, text: "GENERAL WEAKNESS" },
{ id: 27, text: "IRRITABILITY" },
{ id: 28, text: "CONFUSION" },
{ id: 29, text: "ABDOMINAL PAIN" },
{ id: 30, text: "JOINT PAIN" },
{ id: 31, text: "REDNESS OF EYES" },
{ id: 32, text: "ANOREXIA" },
{ id: 33, text: "NEW LOSS OF TASTE" },
{ id: 34, text: "NEW LOSS OF SMELL" },
{ id: 9, text: "OTHERS" },
];

export const DISCHARGE_REASONS = [
{ id: 1, text: "Recovered" },
{ id: 2, text: "Referred" },
Expand Down Expand Up @@ -399,10 +363,10 @@ export const SAMPLE_TEST_RESULT = [
export const CONSULTATION_SUGGESTION = [
{ id: "HI", text: "Home Isolation", deprecated: true }, // # Deprecated. Preserving option for backward compatibility (use only for readonly operations)
{ id: "A", text: "Admission" },
{ id: "R", text: "Refer to another Hospital" },
{ id: "R", text: "Refer to another Hospital", editDisabled: true },
{ id: "OP", text: "OP Consultation" },
{ id: "DC", text: "Domiciliary Care" },
{ id: "DD", text: "Declare Death" },
{ id: "DD", text: "Declare Death", editDisabled: true },
] as const;

export type ConsultationSuggestionValue =
Expand Down Expand Up @@ -1404,3 +1368,5 @@ export const PATIENT_NOTES_THREADS = {
Doctors: 10,
Nurses: 20,
} as const;

export const RATION_CARD_CATEGORY = ["BPL", "APL", "NO_CARD"] as const;
9 changes: 8 additions & 1 deletion src/Components/Assets/configure/CameraConfigure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getCameraConfig } from "../../../Utils/transformUtils";
import { Submit } from "../../Common/components/ButtonV2";
import TextFormField from "../../Form/FormFields/TextFormField";
import Card from "../../../CAREUI/display/Card";
import { FieldErrorText } from "../../Form/FormFields/FormField";

interface CameraConfigureProps {
asset: AssetData;
Expand Down Expand Up @@ -59,8 +60,14 @@ export default function CameraConfigure(props: CameraConfigureProps) {
value={newPreset}
className="mt-1"
onChange={(e) => setNewPreset(e.value)}
error=""
errorClassName="hidden"
/>
{newPreset.length > 12 && (
<FieldErrorText
error="It is advisable to keep preset name below 12 characters"
className="!text-warning-500"
/>
)}
</div>
</div>
<div className="mt-4 flex justify-end">
Expand Down
Loading

0 comments on commit 4c9d500

Please sign in to comment.