Skip to content

Commit

Permalink
Merge branch 'develop' into issues/6503/displayCNSon4k
Browse files Browse the repository at this point in the history
  • Loading branch information
i0am0arunava authored Nov 18, 2024
2 parents 21a5bd9 + c4f54a8 commit ecd0871
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 54 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
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
60 changes: 22 additions & 38 deletions src/components/Facility/Consultations/VentilatorPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,63 +110,47 @@ export const VentilatorPlot = ({
case "ventilator_tidal_volume":
case "ventilator_peep":
condition =
(currentRound.ventilator_interface === "INVASIVE" ||
currentRound.ventilator_interface === "NON_INVASIVE") &&
!!currentRound.ventilator_mode;
currentRound.ventilator_interface === "INVASIVE" ||
currentRound.ventilator_interface === "NON_INVASIVE";
break;
case "ventilator_fio2":
condition =
currentRound.ventilator_interface === "OXYGEN_SUPPORT" &&
currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA";
break;
case "ventilator_spo2":
condition =
currentRound.ventilator_interface === "OXYGEN_SUPPORT" &&
(currentRound.ventilator_oxygen_modality === "NASAL_PRONGS" ||
currentRound.ventilator_oxygen_modality === "SIMPLE_FACE_MASK" ||
currentRound.ventilator_oxygen_modality ===
"NON_REBREATHING_MASK" ||
currentRound.ventilator_interface === "INVASIVE" ||
currentRound.ventilator_interface === "NON_INVASIVE" ||
(currentRound.ventilator_interface === "OXYGEN_SUPPORT" &&
currentRound.ventilator_oxygen_modality ===
"HIGH_FLOW_NASAL_CANNULA");
break;
case "ventilator_spo2":
condition = currentRound.ventilator_interface !== "UNKNOWN";
break;
case "etco2":
case "ventilator_oxygen_modality_flow_rate":
condition =
!!currentRound.ventilator_mode ||
!!currentRound.ventilator_oxygen_modality ||
false;
currentRound.ventilator_interface === "OXYGEN_SUPPORT" &&
currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA";
break;
case "ventilator_oxygen_modality_oxygen_rate":
condition =
currentRound.ventilator_interface === "OXYGEN_SUPPORT" &&
(currentRound.ventilator_oxygen_modality === "NASAL_PRONGS" ||
currentRound.ventilator_oxygen_modality === "SIMPLE_FACE_MASK" ||
currentRound.ventilator_oxygen_modality === "NON_REBREATHING_MASK");
currentRound.ventilator_oxygen_modality !== "HIGH_FLOW_NASAL_CANNULA";
break;
}
switch (currentRound.ventilator_interface) {
case "OXYGEN_SUPPORT":
legend =
t(
`OXYGEN_MODALITY__${currentRound.ventilator_oxygen_modality}_short`,
) +
" (" +
t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT") +
")";
legend = currentRound.ventilator_oxygen_modality
? `${t(`OXYGEN_MODALITY__${currentRound.ventilator_oxygen_modality}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT")})`
: t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT");
break;
case "INVASIVE":
legend =
t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`) +
" (" +
t("RESPIRATORY_SUPPORT_SHORT__INVASIVE") +
")";
legend = currentRound.ventilator_mode
? `${t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__INVASIVE")})`
: t("RESPIRATORY_SUPPORT_SHORT__INVASIVE");
break;
case "NON_INVASIVE":
legend =
t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`) +
" (" +
t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE") +
")";
legend = currentRound.ventilator_mode
? `${t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE")})`
: t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE");
break;
}
return { condition, legend };
Expand All @@ -178,9 +162,9 @@ export const VentilatorPlot = ({
switch (ventilatorInterface) {
case "INVASIVE":
case "NON_INVASIVE":
return round.ventilator_mode;
return round.ventilator_mode ?? "None";
case "OXYGEN_SUPPORT":
return round.ventilator_oxygen_modality;
return round.ventilator_oxygen_modality ?? "None";
default:
return null;
}
Expand Down
21 changes: 14 additions & 7 deletions src/components/Facility/Consultations/VentilatorTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ export default function VentilatorTable(props: VentilatorTableProps) {
switch (ventilator_interface) {
case "INVASIVE":
case "NON_INVASIVE":
return t(`VENTILATOR_MODE__${ventilator_mode}`);
return ventilator_mode
? t(`VENTILATOR_MODE__${ventilator_mode}`)
: "None";
case "OXYGEN_SUPPORT":
return t(`OXYGEN_MODALITY__${ventilator_oxygen_modality}`);
return ventilator_oxygen_modality
? t(`OXYGEN_MODALITY__${ventilator_oxygen_modality}`)
: "None";
default:
return null;
}
Expand All @@ -55,9 +59,9 @@ export default function VentilatorTable(props: VentilatorTableProps) {
switch (ventilatorInterface) {
case "INVASIVE":
case "NON_INVASIVE":
return round.ventilator_mode;
return round.ventilator_mode ?? "None";
case "OXYGEN_SUPPORT":
return round.ventilator_oxygen_modality;
return round.ventilator_oxygen_modality ?? "None";
default:
return null;
}
Expand All @@ -74,8 +78,9 @@ export default function VentilatorTable(props: VentilatorTableProps) {
const nextInterfaceOrModality = getModeOrModality(nextRound);
if (
nextInterfaceOrModality &&
currentRound.ventilator_interface == nextRound.ventilator_interface &&
currentInterfaceOrModality == nextInterfaceOrModality
currentRound.ventilator_interface ===
nextRound.ventilator_interface &&
currentInterfaceOrModality === nextInterfaceOrModality
) {
index += 1;
} else {
Expand Down Expand Up @@ -105,6 +110,8 @@ export default function VentilatorTable(props: VentilatorTableProps) {
const sortedData: DailyRoundsModel[] = dailyRoundsList.sort(
compareByDateString("taken_at"),
);
const tableBody = VentilatorTableBody(sortedData);
if (!tableBody.length) return null;

return (
<div className="my-3 w-full overflow-x-scroll rounded-lg border bg-white px-4 pt-3 shadow">
Expand All @@ -122,7 +129,7 @@ export default function VentilatorTable(props: VentilatorTableProps) {
</th>
</tr>
</thead>
<tbody>{VentilatorTableBody(sortedData)}</tbody>
<tbody>{tableBody}</tbody>
</table>
</div>
);
Expand Down

0 comments on commit ecd0871

Please sign in to comment.