Skip to content

Commit

Permalink
Merge pull request #7934 from coronasafe/develop
Browse files Browse the repository at this point in the history
Merge Develop To Staging v24.23.0
  • Loading branch information
gigincg authored May 29, 2024
2 parents 5853981 + 8ae85d6 commit dd77079
Show file tree
Hide file tree
Showing 50 changed files with 1,837 additions and 668 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
38 changes: 2 additions & 36 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 @@ -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;
19 changes: 12 additions & 7 deletions src/Components/CameraFeed/AssetBedSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function CameraPresetSelect(props: Props) {
return (
<>
<div className="hidden gap-2 whitespace-nowrap pr-2 md:flex">
{/* Desktop View */}
{props.options
.slice(0, props.options.length > 5 ? 4 : 5)
.map((option) => (
Expand All @@ -31,20 +32,19 @@ export default function CameraPresetSelect(props: Props) {
{label(option)}
</button>
))}
{/* Desktop View */}
{props.options.length > 5 && (
<ShowMoreDropdown {...props} options={props.options.slice(4)} />
<CameraPresetDropdown {...props} options={props.options.slice(4)} />
)}
</div>
<div className="md:hidden">
{/* Mobile View */}
<ShowMoreDropdown {...props} />
<CameraPresetDropdown {...props} />
</div>
</>
);
}

const ShowMoreDropdown = (props: Props) => {
export const CameraPresetDropdown = (props: Props) => {
const selected = props.value;

const options = props.options.filter(({ meta }) => meta.type !== "boundary");
Expand All @@ -54,9 +54,14 @@ const ShowMoreDropdown = (props: Props) => {
return (
<Listbox value={selected} onChange={props.onChange}>
<div className="relative flex-1">
<Listbox.Button className="relative w-full cursor-default pr-6 text-right text-xs text-white focus:outline-none disabled:cursor-not-allowed disabled:bg-transparent disabled:text-zinc-700 sm:text-sm md:pl-2">
<span className="block truncate">
{selected ? label(selected) : "No Preset"}
<Listbox.Button className="relative w-full cursor-default pr-6 text-left text-xs text-white focus:outline-none disabled:cursor-not-allowed disabled:bg-transparent disabled:text-zinc-700 sm:text-sm md:pl-2">
<span
className={classNames(
"block truncate",
!selected && "text-gray-500",
)}
>
{selected ? label(selected) : "Select preset"}
</span>
<span className="pointer-events-none absolute inset-y-0 right-0 mt-1 flex items-center">
<CareIcon icon="l-angle-down" className="text-lg text-zinc-500" />
Expand Down
6 changes: 5 additions & 1 deletion src/Components/CameraFeed/CameraFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import FeedNetworkSignal from "./FeedNetworkSignal";
import NoFeedAvailable from "./NoFeedAvailable";
import FeedControls from "./FeedControls";
import Fullscreen from "../../CAREUI/misc/Fullscreen";
import FeedWatermark from "./FeedWatermark";
import CareIcon from "../../CAREUI/icons/CareIcon";

interface Props {
Expand Down Expand Up @@ -87,7 +88,6 @@ export default function CameraFeed(props: Props) {
setState("loading");
initializeStream();
};

return (
<Fullscreen fullscreen={isFullscreen} onExit={() => setFullscreen(false)}>
<div
Expand Down Expand Up @@ -120,6 +120,7 @@ export default function CameraFeed(props: Props) {
<div className="group relative aspect-video">
{/* Notifications */}
<FeedAlert state={state} />
{player.status === "playing" && <FeedWatermark />}

{/* No Feed informations */}
{state === "host_unreachable" && (
Expand Down Expand Up @@ -150,6 +151,7 @@ export default function CameraFeed(props: Props) {
url={streamUrl}
ref={playerRef.current as LegacyRef<ReactPlayer>}
controls={false}
pip={false}
playsinline
playing
muted
Expand All @@ -167,10 +169,12 @@ export default function CameraFeed(props: Props) {
</div>
) : (
<video
onContextMenu={(e) => e.preventDefault()}
className="absolute inset-0 w-full"
id="mse-video"
autoPlay
muted
disablePictureInPicture
playsInline
onPlay={player.onPlayCB}
onEnded={() => player.setStatus("stop")}
Expand Down
4 changes: 2 additions & 2 deletions src/Components/CameraFeed/CameraFeedWithBedPresets.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState } from "react";
import { AssetBedModel, AssetData } from "../Assets/AssetTypes";
import CameraFeed from "./CameraFeed";
import AssetBedSelect from "./AssetBedSelect";
import useQuery from "../../Utils/request/useQuery";
import routes from "../../Redux/api";
import useSlug from "../../Common/hooks/useSlug";
import { CameraPresetDropdown } from "./AssetBedSelect";

interface Props {
asset: AssetData;
Expand All @@ -29,7 +29,7 @@ export default function LocationFeedTile(props: Props) {
{loading ? (
<span>loading presets...</span>
) : (
<AssetBedSelect
<CameraPresetDropdown
options={data?.results ?? []}
value={preset}
onChange={setPreset}
Expand Down
Loading

0 comments on commit dd77079

Please sign in to comment.