Skip to content

Commit

Permalink
update: Align with develop and update laboratory filter
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Sep 25, 2023
2 parents 7e7ba45 + d45ab80 commit 410ece0
Show file tree
Hide file tree
Showing 211 changed files with 4,654 additions and 10,226 deletions.
266 changes: 129 additions & 137 deletions api/oh.yaml

Large diffs are not rendered by default.

Binary file removed cypress/downloads/downloads.htm
Binary file not shown.
9 changes: 5 additions & 4 deletions cypress/integration/edit_patient_activity.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("EditPatientActivity spec", () => {
cy.get("[class=editPatient]");
});

it.skip("should have access to the user credentials", () => { });
it.skip("should have access to the user credentials", () => {});

it("should have a PatientDataForm as a child component", () => {
cy.get("[class=patientDataForm]");
Expand Down Expand Up @@ -44,6 +44,8 @@ describe("EditPatientActivity spec", () => {
{ force: true }
);

cy.get("[class=MuiDialogContent-root]").contains("Confirm").click();

cy.wait(1000);
cy.get("[class=profilePicture]")
.find("img")
Expand Down Expand Up @@ -79,11 +81,10 @@ describe("EditPatientActivity spec", () => {
it("should not leave on the Cancel button click, if the Cancel button of the Cancel Dialog is click", () => {
cy.get("[id=firstName]").clear().type("Marcelo");
cy.get("[class=patientDataForm]").contains("Cancel").click();
cy.url().then(url => {
cy.url().then((url) => {
cy.get("div.dialog__buttonSet").contains("Keep").click();
cy.url().should('eq', url);
cy.url().should("eq", url);
});
//cy.get("[id=firstName]").should("have.value", "Antonio Carlos");
});

});
4 changes: 3 additions & 1 deletion cypress/integration/new_patient_activity.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("NewPatientActivity spec", () => {
cy.get("[class=newPatient]");
});

it.skip("should have access to the user credentials", () => { });
it.skip("should have access to the user credentials", () => {});

it("should have a PatientDataForm as a child component", () => {
cy.get("[class=patientDataForm]");
Expand Down Expand Up @@ -44,6 +44,8 @@ describe("NewPatientActivity spec", () => {
{ force: true }
);

cy.get("[class=MuiDialogContent-root]").contains("Confirm").click();

cy.wait(1000);
cy.get("[class=profilePicture]")
.find("img")
Expand Down
54 changes: 33 additions & 21 deletions cypress/integration/patient_details_activity/exams.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,45 @@ describe("Patient Details / Exams", () => {
.click();
});

it("should make it possible for the user to fill out the form to create a new exam", () => {
cy.get("[id='date']").focus().type("02022022").blur();
cy.get("[id='exam']").focus().type("1.3 Differential").blur();
cy.get("[id='result']").focus().type("POSITIVE").blur();
cy.get("[id='note']").focus().type("note").blur();
// Exam request test
it("should make it possible for the user to fill out the form to request an exam", () => {
cy.get("[id='exam']").eq(0).focus().type("1.3 Differential").blur();
});

it("should display an error info box if the exam creation call fails", () => {
cy.get("[id='note']").focus().clear().type("ERROR").blur();
it("should display an success info box if the exam creation call succeed", () => {
cy.get("[class='submit_button']").eq(0).click();
cy.get("div.dialog__title").contains("Request an exam");
cy.get("div.return_button").click();
});
//End Exam request test

cy.get("[class='submit_button']").click();
// it("should make it possible for the user to fill out the form to create a new exam", () => {
// cy.get("[id='date']").focus().type("02022022").blur();
// cy.get("[id='exam']").eq(1).focus().type("1.3 Differential").blur();
// cy.get("[id='result']").focus().type("POSITIVE").blur();
// cy.get("[id='note']").focus().type("note").blur();
// });

cy.get("div.infoBox").should("have.class", "error");
});
// it("should display an error info box if the exam creation call fails", () => {
// cy.get("[id='note']").focus().clear().type("ERROR").blur();

it("should display a dialog confirming the exam creation when the call is successful", () => {
cy.get("[id='note']")
.focus()
.clear()
.type("This is the note of a valid form")
.blur();
// cy.get("[class='submit_button']").eq(1).click();

cy.get("[class='submit_button']").click();
// cy.get("div.infoBox").should("have.class", "error");
// });

cy.get("div.infoBox").should("not.exist");
// it("should display a dialog confirming the exam creation when the call is successful", () => {
// cy.get("[id='note']")
// .focus()
// .clear()
// .type("This is the note of a valid form")
// .blur();

cy.get("div.dialog__title").contains("Patient exam added");
cy.get("div.return_button").click();
});
// cy.get("[class='submit_button']").eq(1).click();

// cy.get("div.infoBox").should("not.exist");

// cy.get("div.dialog__title").contains("Patient exam added");
// cy.get("div.return_button").click();
// });
});
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("Patient Details / Visit - Outpatient", () => {
});

it("Should make it possible for the user to fill out the form to add a new visit for an outpatient", () => {
cy.get("[id=visitDate]").focus().type("01012021").blur();
cy.get("[id=date]").focus().type("01012021").blur();
cy.get("[id=disease]").focus().type("Abortions").blur();
cy.get("[id=note]").focus().type("fail").blur();
});
Expand Down
73 changes: 60 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@types/react-router": "^5.1.19",
"@types/react-router-dom": "^5.3.3",
"@types/yup": "^0.29.0",
"browser-image-compression": "^2.0.2",
"chart.js": "^3.9.1",
"classnames": "^2.2.6",
"date-fns": "^2.16.1",
Expand All @@ -55,6 +56,7 @@
"react-dom": "^16.13.1",
"react-draggable": "^4.4.4",
"react-grid-layout": "^1.3.4",
"react-hotkeys-hook": "^4.4.1",
"react-i18next": "^11.8.8",
"react-image-crop": "^9.1.1",
"react-number-format": "^4.8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ i18n
.init({
resources,
fallbackLng: I18N_FALLBACK_LNG,
supportedLngs: ["en", "fr", "it"],
supportedLngs: ["en", "fr", "it", "sq", "de"],
interpolation: {
escapeValue: false,
},
Expand Down
16 changes: 13 additions & 3 deletions src/components/accessories/admission/PatientAdmission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { scrollToElement } from "../../../libraries/uiUtils/scrollToElement";
import { useDispatch, useSelector } from "react-redux";
import { IState } from "../../../types";
import { AdmissionTransitionState } from "./types";
import { AdmissionDTO, OpdDTO } from "../../../generated";
import { AdmissionDTO, OpdDTO, PatientDTOStatusEnum } from "../../../generated";
import InfoBox from "../infoBox/InfoBox";
import ConfirmationDialog from "../confirmationDialog/ConfirmationDialog";
import checkIcon from "../../../assets/check-icon.png";
Expand All @@ -23,6 +23,7 @@ import PatientAdmissionTable from "./admissionTable/AdmissionTable";
import { isEmpty } from "lodash";
import { usePermission } from "../../../libraries/permissionUtils/usePermission";
import { getLastOpd } from "../../../state/opds/actions";
import { CurrentAdmission } from "../currentAdmission/CurrentAdmission";

const PatientAdmission: FC = () => {
const { t } = useTranslation();
Expand All @@ -31,6 +32,7 @@ const PatientAdmission: FC = () => {
const infoBoxRef = useRef<HTMLDivElement>(null);
const [shouldResetForm, setShouldResetForm] = useState(false);
const [creationMode, setCreationMode] = useState(true);
const [isEditingCurrent, setIsEditingCurrent] = useState(false);
const [showForm, setShowForm] = useState(false);
const [admissionToEdit, setAdmissionToEdit] =
useState<AdmissionDTO | undefined>();
Expand Down Expand Up @@ -188,11 +190,16 @@ const PatientAdmission: FC = () => {
scrollToElement(null);
};

const onCurrentAdmissionChange = (value: boolean) => {
setIsEditingCurrent(value);
};

return (
<div className="patientAdmission">
{!showForm && (
{patient?.status === PatientDTOStatusEnum.I && (
<InfoBox type="info" message={t("admission.patientalreadyadmitted")} />
)}
{!open && <CurrentAdmission onEditChange={onCurrentAdmissionChange} />}
{open && (
<AdmissionForm
fields={fields}
Expand Down Expand Up @@ -224,7 +231,10 @@ const PatientAdmission: FC = () => {
/>

<ConfirmationDialog
isOpen={createStatus === "SUCCESS" || updateStatus === "SUCCESS"}
isOpen={
(createStatus === "SUCCESS" || updateStatus === "SUCCESS") &&
!isEditingCurrent
}
title={creationMode ? t("admission.created") : t("admission.updated")}
icon={checkIcon}
info={
Expand Down
Loading

0 comments on commit 410ece0

Please sign in to comment.