Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consultation update page form UI updated #9074

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2be148b
Consultation update page form UI updated
modamaan Nov 10, 2024
d78ddf9
Lint issues solved
modamaan Nov 10, 2024
5cfc314
Badge component coderabbitai suggestion
modamaan Nov 10, 2024
6ac3d93
card component coderabbitai suggestion
modamaan Nov 10, 2024
f713b4f
lint issue again solved
modamaan Nov 10, 2024
860cd70
CriticalCarePreview updated
modamaan Nov 12, 2024
6e7a497
lucid-react icon removed deploy issue
modamaan Nov 12, 2024
ab7ff27
npm lucid-react uninstalled
modamaan Nov 12, 2024
3c5fcc9
Merge branch 'develop' into issues/9067/edit-form_ui
modamaan Nov 23, 2024
bfd8451
failing iisue solved
modamaan Nov 24, 2024
64f99af
Save local changes to ShiftDetails.tsx
modamaan Nov 24, 2024
1f27622
Merge branch 'issues/9067/edit-form_ui' of https://github.com/modamaa…
modamaan Nov 24, 2024
3dbc4f6
Save local changes to ShiftDetails.tsx
modamaan Nov 24, 2024
87d1cc6
Merge remote-tracking branch 'upstream/develop' into issues/9067/edit…
modamaan Nov 30, 2024
c1a0abe
merge conflict
modamaan Nov 30, 2024
4705c41
merge conflict
modamaan Dec 6, 2024
dfcca36
code corrected
modamaan Dec 6, 2024
d2bb301
custom separator removed
modamaan Dec 6, 2024
d4c350c
Lint issue solved
modamaan Dec 6, 2024
075c4bf
custom component src/components/ui/separator.tsx removed
modamaan Dec 6, 2024
bfac22a
Ensure the box is not displayed when there is no data
modamaan Dec 6, 2024
fc3cbc8
Cypress issue
modamaan Dec 7, 2024
b1f9151
Cypress (3) issue
modamaan Dec 7, 2024
c39ba72
Cypress (3) issue again
modamaan Dec 7, 2024
7838528
Merge remote-tracking branch 'upstream/develop' into issues/9067/edit…
modamaan Dec 11, 2024
ae15064
Card component
modamaan Dec 11, 2024
e27d9c1
Tessting deploy
modamaan Dec 11, 2024
bb36216
cypress testing
modamaan Dec 13, 2024
37d2f26
Merge remote-tracking branch 'upstream/develop' into issues/9067/edit…
modamaan Dec 13, 2024
46e982e
Merge branch 'develop' into issues/9067/edit-form_ui
modamaan Dec 13, 2024
5334d0b
Badge component issue
modamaan Dec 13, 2024
df8150e
Merge remote-tracking branch 'upstream/develop' into issues/9067/edit…
modamaan Dec 13, 2024
264de3e
Merge branch 'issues/9067/edit-form_ui' of https://github.com/modamaa…
modamaan Dec 13, 2024
31e6ab7
Cypress timeout issue
modamaan Dec 13, 2024
7149c93
Cypress timeout issue try
modamaan Dec 13, 2024
318e688
removed changes causes cypress test issue
modamaan Dec 15, 2024
5da968e
patientLogupdate changes removed
modamaan Dec 15, 2024
94728f1
changes removed
modamaan Dec 15, 2024
7ac0e8d
Merge remote-tracking branch 'upstream/develop' into issues/9067/edit…
modamaan Dec 15, 2024
a60f993
Merge branch 'develop' into issues/9067/edit-form_ui
modamaan Dec 15, 2024
d146152
Merge branch 'issues/9067/edit-form_ui' of https://github.com/modamaa…
modamaan Dec 15, 2024
5734e2e
Merge remote-tracking branch 'upstream/develop' into issues/9067/edit…
modamaan Dec 17, 2024
82a7a69
badge ui component corrected
modamaan Dec 17, 2024
66a8b0b
cypress timeout
modamaan Dec 17, 2024
933632c
cypress timeout increased
modamaan Dec 17, 2024
2e4ad9c
cypress timeout issue
modamaan Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cypress/pageobject/Patient/PatientLogupdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,17 @@ class PatientLogupdate {
cy.wait(3000);
}

// clickUpdateDetail() {
// cy.verifyAndClickElement("#consultation-preview", "Update Log");
// cy.wait(3000);
// }
modamaan marked this conversation as resolved.
Show resolved Hide resolved

clickUpdateDetail() {
cy.verifyAndClickElement("#consultation-preview", "Update Log");
cy.wait(3000);

// Wait dynamically for the desired element or state to confirm success
cy.get("#consultation-preview", { timeout: 30000 }) // Adjust timeout as needed
.should("be.visible"); // Ensure the element remains visible after the action
}

clearIntoElementById(elementId) {
Expand Down
13 changes: 12 additions & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,19 @@ Cypress.Commands.add(
},
);

// Cypress.Commands.add("verifyNotification", (text) => {
// return cy.get(".pnotify-container").should("exist").contains(text);
// });
Cypress.Commands.add("verifyNotification", (text) => {
return cy.get(".pnotify-container").should("exist").contains(text);
cy.log(`Verifying notification with text: "${text}"`);

// Ensure the notification container exists and contains the text
cy.get(".pnotify-container", { timeout: 30000 }) // Increased timeout for slower loads
.should("be.visible")
.and("contain.text", text)
.then(() => {
cy.log(`Notification verified: "${text}"`);
});
});

Cypress.Commands.add("clearAllFilters", () => {
Expand Down
250 changes: 157 additions & 93 deletions src/components/LogUpdate/CriticalCarePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,32 +82,82 @@ export default function CriticalCarePreview(props: Props) {
<span>{t(`ROUNDS_TYPE__${data.rounds_type}`)}</span>
</div>
</h2>

<Section title="General">
<Detail label="Patient Category" value={data.patient_category} />
<Detail
label="Physical Examination Info"
value={data.physical_examination_info}
/>
<Detail label="Other Details" value={data.other_details} />
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
{data?.patient_category && (
<div className="flex items-center rounded-lg border p-4">
<div>
<Detail
label="Patient Category"
value={data.patient_category}
/>
</div>
</div>
)}

{data?.physical_examination_info && (
<div className="flex items-center rounded-lg border p-4">
<div>
<Detail
label="Physical Examination Info"
value={data.physical_examination_info}
/>
</div>
</div>
)}

{data?.other_details && (
<div className="flex items-center rounded-lg border p-4">
<div>
<Detail label="Other Details" value={data.other_details} />
</div>
</div>
)}
</div>
</Section>

<Section title="Routine">
<ChoiceDetail data={data} name="sleep" />
<ChoiceDetail data={data} name="bowel_issue" />
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
<div className="flex items-center rounded-lg border p-4">
<ChoiceDetail data={data} name="sleep" />
</div>
<div className="flex items-center rounded-lg border p-4">
<ChoiceDetail data={data} name="bowel_issue" />
</div>
</div>

<Section subSection title="Bladder">
<ChoiceDetail data={data} name="bladder_drainage" />
<ChoiceDetail data={data} name="bladder_issue" />
<Detail
label={t("LOG_UPDATE_FIELD_LABEL__is_experiencing_dysuria")}
value={data.is_experiencing_dysuria}
/>
<ChoiceDetail data={data} name="urination_frequency" />
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
<div className="flex items-center rounded-lg border p-4">
<ChoiceDetail data={data} name="bladder_drainage" />
</div>
<div className="flex items-center rounded-lg border p-4">
<ChoiceDetail data={data} name="bladder_issue" />
</div>
</div>
<div className="mb-2 max-w-96 space-y-1 rounded border border-secondary-300 bg-secondary-100 p-3 my-4">
<Detail
label={t("LOG_UPDATE_FIELD_LABEL__is_experiencing_dysuria")}
value={data.is_experiencing_dysuria}
/>
<ChoiceDetail data={data} name="urination_frequency" />
</div>
</Section>

<Section subSection title="Nutrition">
<ChoiceDetail data={data} name="nutrition_route" />
<ChoiceDetail data={data} name="oral_issue" />
<ChoiceDetail data={data} name="appetite" />
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
<div className="flex items-center rounded-lg border p-4">
<ChoiceDetail data={data} name="nutrition_route" />
</div>
{data.oral_issue && (
<div className="flex items-center rounded-lg border p-4">
<ChoiceDetail data={data} name="oral_issue" />
</div>
)}
<div className="flex items-center rounded-lg border p-4">
<ChoiceDetail data={data} name="appetite" />
</div>
</div>
</Section>
</Section>

Expand Down Expand Up @@ -202,8 +252,8 @@ export default function CriticalCarePreview(props: Props) {
</div>
</Section>

<Section title="Arterial Blood Gas Analaysis">
<ul className="grid grid-cols-1 gap-3 lg:grid-cols-3">
<Section title="Arterial Blood Gas Analysis">
<ul className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
{ABGAnalysisFields.map((field) => {
const value = data[field.key];
return (
Expand All @@ -222,34 +272,51 @@ export default function CriticalCarePreview(props: Props) {
</Section>

<Section title="Blood Sugar">
<RangeDetail
label="Blood Sugar Level"
value={data.blood_sugar_level}
valueDescriptions={rangeValueDescription({ low: 69, high: 110 })}
max={700}
unit="mg/dL"
/>
<Detail label="Dosage" value={data.insulin_intake_dose} />
<Detail
label="Frequency"
value={tOption(
"INSULIN_INTAKE_FREQUENCY",
"insulin_intake_frequency",
)}
/>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
<div className="mb-2 max-w-96 space-y-1 rounded border border-secondary-300 bg-secondary-100 p-3">
<RangeDetail
label="Blood Sugar Level"
value={data.blood_sugar_level}
valueDescriptions={rangeValueDescription({
low: 69,
high: 110,
})}
max={700}
unit="mg/dL"
/>
</div>
<div>
<Detail label="Dosage" value={data.insulin_intake_dose} />
</div>
<div>
<Detail
label="Frequency"
value={tOption(
"INSULIN_INTAKE_FREQUENCY",
"insulin_intake_frequency",
)}
/>
</div>
</div>
</Section>

<Section title="Dialysis">
<Detail
label="Fluid Balance"
value={data.dialysis_fluid_balance}
suffix="ml/h"
/>
<Detail
label="Net Balance"
value={data.dialysis_net_balance}
suffix="ml/h"
/>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-2">
<div>
<Detail
label="Fluid Balance"
value={data.dialysis_fluid_balance}
suffix="ml/h"
/>
</div>
<div>
<Detail
label="Net Balance"
value={data.dialysis_net_balance}
suffix="ml/h"
/>
</div>
</div>
</Section>

<Section title="Vitals" show={!!data.pain_scale_enhanced?.length}>
Expand Down Expand Up @@ -279,53 +346,49 @@ export default function CriticalCarePreview(props: Props) {
/>
</div>
)}
<RangeDetail
label={
<span>
SpO<sub>2</sub>
</span>
}
value={data.ventilator_spo2}
max={100}
unit="%"
valueDescriptions={rangeValueDescription({ low: 89 })}
/>
<RangeDetail
label="Temperature"
value={data.temperature}
max={106}
unit="°F"
valueDescriptions={rangeValueDescription({ low: 97.4, high: 99.6 })}
/>
<RangeDetail
label="Respiratory Rate"
value={data.resp}
max={150}
unit="bpm"
valueDescriptions={rangeValueDescription({ low: 11, high: 16 })}
/>
<RangeDetail
label="Pulse"
value={data.pulse}
unit="bpm"
max={200}
valueDescriptions={[
{
till: 40,
className: "text-red-500",
text: "Bradycardia",
},
{
till: 100,
className: "text-green-500",
text: "Normal",
},
{
className: "text-red-500",
text: "Tachycardia",
},
]}
/>

<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
<RangeDetail
label={
<span>
SpO<sub>2</sub>
</span>
}
value={data.ventilator_spo2}
max={100}
unit="%"
valueDescriptions={rangeValueDescription({ low: 89 })}
/>
<RangeDetail
label="Temperature"
value={data.temperature}
max={106}
unit="°F"
valueDescriptions={rangeValueDescription({
low: 97.4,
high: 99.6,
})}
/>
<RangeDetail
label="Respiratory Rate"
value={data.resp}
max={150}
unit="bpm"
valueDescriptions={rangeValueDescription({ low: 11, high: 16 })}
/>
<RangeDetail
label="Pulse"
value={data.pulse}
unit="bpm"
max={200}
valueDescriptions={[
{ till: 40, className: "text-red-500", text: "Bradycardia" },
{ till: 100, className: "text-green-500", text: "Normal" },
{ className: "text-red-500", text: "Tachycardia" },
]}
/>
</div>

<Detail
label={t("LOG_UPDATE_FIELD_LABEL__rhythm")}
value={data.rhythm && t(`HEARTBEAT_RHYTHM__${data.rhythm}`)}
Expand All @@ -334,6 +397,7 @@ export default function CriticalCarePreview(props: Props) {
label={t("LOG_UPDATE_FIELD_LABEL__rhythm_detail")}
value={data.rhythm_detail}
/>

{!!data.pain_scale_enhanced?.length && (
<>
<h4 className="py-4">Pain Scale</h4>
Expand Down
Loading
Loading