Skip to content

Commit

Permalink
Merge branch 'develop' into issue/9132/Yob_Field_Validation_Condition…
Browse files Browse the repository at this point in the history
…_in_Patient_transfer
  • Loading branch information
AdityaJ2305 authored Nov 18, 2024
2 parents b798481 + 2dc5923 commit c7d0e5a
Show file tree
Hide file tree
Showing 33 changed files with 307 additions and 233 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ jobs:
group: "UI-Chrome"
env:
CYPRESS_SPLIT_TESTS: "true"
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max_old_space_size=4096
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
Expand All @@ -133,7 +132,7 @@ jobs:

- name: Upload cypress videos 📹
uses: actions/upload-artifact@v3
if: steps.pr_origin.outputs.is_forked == 'true'
if: ${{ failure() && steps.pr_origin.outputs.is_forked == 'true' }}
with:
name: cypress-videos
path: cypress/videos
24 changes: 12 additions & 12 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand Down Expand Up @@ -180,9 +180,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.submitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
Expand All @@ -195,9 +195,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
// Go back and edit the data on a third section
patientLogupdate.clickGoBackConsultation();
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateUpdateLog(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
patientLogupdate.selectCriticalCareSection("Dialysis");
Expand All @@ -210,9 +210,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
//Reverify the editted and newly added data
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
Expand Down Expand Up @@ -285,9 +285,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// edit the card and verify the data.
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand All @@ -309,9 +309,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Brief Update updated successfully");
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand Down
9 changes: 2 additions & 7 deletions cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,9 @@ describe("Manage User", () => {
manageUserPage.clicklinkedskillbutton();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.clickAddSkillButton();
manageUserPage.clickCloseSlideOver();
cy.wait(5000); // temporary hack to fix the failure
manageUserPage.clicklinkedskillbutton();
cy.verifyNotification("Skill added successfully");
cy.closeNotification();
manageUserPage.assertSkillInAddedUserSkills(linkedskill);
manageUserPage.clickUnlinkSkill();
manageUserPage.clickSubmit();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.clickAddSkillButton();
manageUserPage.clickCloseSlideOver();
// verifying the doctor connect
manageUserPage.navigateToFacility();
Expand Down
3 changes: 3 additions & 0 deletions cypress/pageobject/Hcx/HcxClaims.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export class HcxClaims {
selectEligiblePolicy(policy: string) {
cy.get("#select-insurance-policy", { timeout: 10000 })
.should("be.visible")
.and("not.be.disabled");
cy.clickAndSelectOption("#select-insurance-policy", policy);
}

Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export class PatientConsultationPage {

clickViewConsultationButton() {
cy.verifyAndClickElement(
"#view_consultation_updates",
"View Consultation / Consultation Updates",
"#view_consultation_and_log_updates",
"View Consultation / Log Updates",
);
}

Expand Down
9 changes: 9 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"APPETITE__NO_TASTE_FOR_FOOD": "No taste for food",
"APPETITE__REDUCED": "Reduced",
"APPETITE__SATISFACTORY": "Satisfactory",
"APPROVED": "Approved",
"AUTOMATED": "Automated",
"BED_WITH_OXYGEN_SUPPORT": "Bed with Oxygen Support",
"BLADDER_DRAINAGE__CONDOM_CATHETER": "Condom Catheter",
Expand Down Expand Up @@ -140,6 +141,7 @@
"OXYGEN_MODALITY__NON_REBREATHING_MASK_short": "NRM",
"OXYGEN_MODALITY__SIMPLE_FACE_MASK": "Simple Face Mask",
"OXYGEN_MODALITY__SIMPLE_FACE_MASK_short": "SFM",
"PENDING": "Pending",
"PRESCRIPTION_FREQUENCY_BD": "Twice daily",
"PRESCRIPTION_FREQUENCY_HS": "Night only",
"PRESCRIPTION_FREQUENCY_OD": "Once daily",
Expand Down Expand Up @@ -205,6 +207,7 @@
"SORT_OPTIONS__taken_at": "Oldest taken date first",
"Submit": "Submit",
"TELEMEDICINE": "Telemedicine",
"TRANSPORTATION TO BE ARRANGED": "Transportation",
"URINATION_FREQUENCY__DECREASED": "Decreased",
"URINATION_FREQUENCY__INCREASED": "Increased",
"URINATION_FREQUENCY__NORMAL": "Normal",
Expand Down Expand Up @@ -828,6 +831,8 @@
"location_management": "Location Management",
"log_lab_results": "Log Lab Results",
"log_report": "Log Report",
"log_update": "Log Update",
"log_updates": "Log Updates",
"login": "Login",
"longitude_invalid": "Longitude must be between -180 and 180",
"lsg": "Lsg",
Expand Down Expand Up @@ -901,7 +906,9 @@
"no_investigation_suggestions": "No Investigation Suggestions",
"no_linked_facilities": "No Linked Facilities",
"no_log_update_delta": "No changes since previous log update",
"no_log_updates": "No log updates found",
"no_notices_for_you": "No notices for you.",
"no_patients_found": "No Patients Found",
"no_patients_to_show": "No patients to show.",
"no_policy_added": "No Insurance Policy Added",
"no_policy_found": "No Insurance Policy Found for this Patient",
Expand Down Expand Up @@ -1099,6 +1106,7 @@
"resource_approving_facility": "Resource approving facility",
"resource_origin_facility": "Origin Facility",
"resource_request": "Resource Request",
"resource_status": "Resource Status",
"result": "Result",
"result_date": "Result Date",
"result_details": "Result details",
Expand Down Expand Up @@ -1309,6 +1317,7 @@
"view_abdm_records": "View ABDM Records",
"view_asset": "View Assets",
"view_cns": "View CNS",
"view_consultation_and_log_updates": "View Consultation / Log Updates",
"view_details": "View Details",
"view_faciliy": "View Facility",
"view_patients": "View Patients",
Expand Down
10 changes: 5 additions & 5 deletions src/Routers/routes/ConsultationRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const consultationRoutes: AppRoutes = {
sessionId={sessionId}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:id/daily-rounds": ({
"/facility/:facilityId/patient/:patientId/consultation/:id/log_updates": ({
facilityId,
patientId,
id,
Expand All @@ -92,7 +92,7 @@ const consultationRoutes: AppRoutes = {
consultationId={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id/update":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/update":
({ facilityId, patientId, consultationId, id }) => (
<DailyRounds
facilityId={facilityId}
Expand All @@ -101,7 +101,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id":
({ facilityId, patientId, consultationId, id }) => (
<DailyRoundListDetails
facilityId={facilityId}
Expand All @@ -110,7 +110,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care":
({ facilityId, patientId, consultationId, id }) => (
<CriticalCarePreview
facilityId={facilityId}
Expand All @@ -119,7 +119,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id/update":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care/update":
({ facilityId, patientId, consultationId, id }) => (
<CriticalCareEditor
facilityId={facilityId}
Expand Down
4 changes: 2 additions & 2 deletions src/common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,12 @@ export const NOTIFICATION_EVENTS: NotificationEvent[] = [
},
{
id: "PATIENT_CONSULTATION_UPDATE_CREATED",
text: "Patient Consultation Update Created",
text: "Patient Log Update Created",
icon: "l-heart",
},
{
id: "PATIENT_CONSULTATION_UPDATE_UPDATED",
text: "Patient Consultation Update Updated",
text: "Patient Log Update Updated",
icon: "l-heart-medical",
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/AvatarEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const AvatarEditModal = ({
<ButtonV2
id="save-cover-image"
onClick={uploadAvatar}
disabled={isProcessing}
disabled={isProcessing || !selectedFile}
>
{isProcessing ? (
<CareIcon
Expand Down
50 changes: 27 additions & 23 deletions src/components/Facility/CentralNursingStation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ import HL7PatientVitalsMonitor from "@/components/VitalsMonitor/HL7PatientVitals
import useVitalsAspectRatioConfig from "@/components/VitalsMonitor/useVitalsAspectRatioConfig";
import { getVitalsMonitorSocketUrl } from "@/components/VitalsMonitor/utils";

import useBreakpoints from "@/hooks/useBreakpoints";
import useFilters from "@/hooks/useFilters";
import useFullscreen from "@/hooks/useFullscreen";

import routes from "@/Utils/request/api";
import useQuery from "@/Utils/request/useQuery";

const PER_PAGE_LIMIT = 6;

const SORT_OPTIONS: SortOption[] = [
{ isAscending: true, value: "bed__name" },
{ isAscending: false, value: "-bed__name" },
Expand All @@ -41,31 +40,34 @@ interface Props {
}

export default function CentralNursingStation({ facilityId }: Props) {
const perPageLimit = useBreakpoints({
default: 6,
"4xl": 9,
"4k": 24,
});
const { t } = useTranslation();
const [isFullscreen, setFullscreen] = useFullscreen();
const { qParams, updateQuery, removeFilter, updatePage } = useFilters({
limit: PER_PAGE_LIMIT,
limit: perPageLimit,
});
const query = useQuery(routes.listPatientAssetBeds, {
pathParams: { facility_external_id: facilityId },
query: {
...qParams,
page: qParams.page || 1,
limit: PER_PAGE_LIMIT,
offset: (qParams.page ? qParams.page - 1 : 0) * PER_PAGE_LIMIT,
limit: perPageLimit,
offset: (qParams.page ? qParams.page - 1 : 0) * perPageLimit,
asset_class: "HL7MONITOR",
ordering: qParams.ordering || "bed__name",
bed_is_occupied:
qParams.monitors_without_patient === "true" ? undefined : "true",
},
});

const totalCount = query.data?.count ?? 0;
const data = query.data?.results.map((obj) => ({
patientAssetBed: obj,
socketUrl: getVitalsMonitorSocketUrl(obj.asset),
}));

const { config, hash } = useVitalsAspectRatioConfig({
default: 6 / 11,
sm: 17 / 11,
Expand All @@ -88,7 +90,7 @@ export default function CentralNursingStation({ facilityId }: Props) {
<Pagination
className=""
cPage={qParams.page}
defaultPerPage={PER_PAGE_LIMIT}
defaultPerPage={perPageLimit}
data={{ totalCount }}
onChange={(page) => updatePage(page)}
/>
Expand Down Expand Up @@ -216,21 +218,23 @@ export default function CentralNursingStation({ facilityId }: Props) {
{t("no_vitals_present")}
</div>
) : (
<div className="3xl:grid-cols-3 mt-1 grid grid-cols-1 gap-1 lg:grid-cols-2">
{data.map((props, i) => (
<div className="overflow-hidden text-clip" key={i}>
<HL7PatientVitalsMonitor
patientCurrentBedAssignmentDate={
props.patientAssetBed?.patient?.last_consultation?.current_bed
?.start_date
}
key={`${props.patientAssetBed?.bed.id}-${hash}`}
patientAssetBed={props.patientAssetBed}
socketUrl={props.socketUrl || ""}
config={config}
/>
</div>
))}
<div className="@container">
<div className="mt-1 grid grid-cols-1 gap-1 @5xl:grid-cols-2 @7xl:grid-cols-3 @[140rem]:grid-cols-4 @[180rem]:grid-cols-5 @[240rem]:grid-cols-6">
{data.map((props, i) => (
<div className="overflow-hidden text-clip" key={i}>
<HL7PatientVitalsMonitor
patientCurrentBedAssignmentDate={
props.patientAssetBed?.patient?.last_consultation
?.current_bed?.start_date
}
key={`${props.patientAssetBed?.bed.id}-${hash}`}
patientAssetBed={props.patientAssetBed}
socketUrl={props.socketUrl || ""}
config={config}
/>
</div>
))}
</div>
</div>
)}
</Page>
Expand Down
9 changes: 5 additions & 4 deletions src/components/Facility/ConsultationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import careConfig from "@careConfig";
import { t } from "i18next";
import { navigate } from "raviger";
import { useState } from "react";

Expand Down Expand Up @@ -169,15 +170,15 @@ export const ConsultationCard = (props: ConsultationProps) => {
</div>
<div className="mt-4 flex w-full flex-col justify-between gap-1 md:flex-row">
<ButtonV2
id="view_consultation_updates"
id="view_consultation_and_log_updates"
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
onClick={() =>
navigate(
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}`,
)
}
>
View Consultation / Consultation Updates
{t("view_consultation_and_log_updates")}
</ButtonV2>
<ButtonV2
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
Expand All @@ -200,14 +201,14 @@ export const ConsultationCard = (props: ConsultationProps) => {
setOpen(true);
} else {
navigate(
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/daily-rounds`,
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/log_updates/`,
);
}
}}
disabled={!!itemData.discharge_date}
authorizeFor={NonReadOnlyUsers}
>
Add Consultation Updates
{t("add") + " " + t("log_update")}
</ButtonV2>
)}
</div>
Expand Down
Loading

0 comments on commit c7d0e5a

Please sign in to comment.