Skip to content

Commit

Permalink
Merge pull request #7863 from coronasafe/staging
Browse files Browse the repository at this point in the history
Production release v24.21.0
  • Loading branch information
gigincg authored May 20, 2024
2 parents fb5ed25 + 7366dab commit 4ebebeb
Show file tree
Hide file tree
Showing 82 changed files with 4,681 additions and 2,452 deletions.
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then apt-ge

COPY package.json package-lock.json ./

RUN npm install --legacy-peer-deps
RUN npm install

COPY . .

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#### Install the required dependencies

```sh
npm install --legacy-peer-deps
npm install
```

#### 🏃 Run the app in development mode
Expand Down
10 changes: 6 additions & 4 deletions cypress/e2e/facility_spec/facility_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe("Facility Manage Functions", () => {
facilityManage.clickButtonWithText(facilityHfridUpdateButton);
facilityManage.verifySuccessMessageVisibilityAndContent(
facilityHfridToastNotificationText,
true,
);
// update the existing middleware
facilityPage.clickManageFacilityDropdown();
Expand All @@ -98,6 +99,7 @@ describe("Facility Manage Functions", () => {
facilityManage.clickButtonWithText(facilityHfridUpdateButton);
facilityManage.verifySuccessMessageVisibilityAndContent(
facilityHfridToastNotificationText,
true,
);
// verify its reflection
facilityPage.clickManageFacilityDropdown();
Expand All @@ -108,26 +110,26 @@ describe("Facility Manage Functions", () => {
it("Modify doctor capacity in Facility detail page", () => {
// Add a doctor capacity
facilityManage.clickFacilityAddDoctorTypeButton();
facilityPage.selectAreaOfSpecialization("General Medicine");
facilityPage.selectAreaOfSpecialization("Pulmonology");
facilityPage.fillDoctorCount(doctorCapacity);
facilityPage.saveAndExitDoctorForm();
facilityManage.verifySuccessMessageVisibilityAndContent(
"Doctor count added successfully",
"Staff count added successfully",
);
facilityManage.verifyTotalDoctorCapacity(doctorCapacity);
// edit a existing doctor
facilityManage.clickEditFacilityDoctorCapacity();
facilityPage.fillDoctorCount(doctorModifiedCapacity);
facilityPage.clickdoctorcapacityaddmore();
facilityManage.verifySuccessMessageVisibilityAndContent(
"Doctor count updated successfully",
"Staff count updated successfully",
);
facilityManage.verifyTotalDoctorCapacity(doctorModifiedCapacity);
// delete a bed
facilityManage.clickDeleteFacilityDoctorCapacity();
facilityManage.clickButtonWithText("Delete");
facilityManage.verifySuccessMessageVisibilityAndContent(
"Doctor specialization type deleted successfully",
"Staff specialization type deleted successfully",
);
});

Expand Down
15 changes: 2 additions & 13 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification(
"Telemedicine Log Updates details created successfully",
);
// verify the copied previous value
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.clickCopyPreviousValue();
patientLogupdate.selectPatientCategory(patientCategory);
cy.submitButton("Save");
cy.closeNotification();
cy.verifyContentPresence("#physical_examination_info", [
physicalExamination,
]);
cy.verifyContentPresence("#rhythm_detail", [patientRhythm]);
cy.submitButton("Continue");
cy.verifyNotification("Normal Log Updates details updated successfully");
});

it("Create a new log normal update for a domicilary care patient and edit it", () => {
Expand Down Expand Up @@ -102,6 +89,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Normal Log Updates details created successfully");
cy.closeNotification();
// edit the card and verify the data.
cy.contains("Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
Expand All @@ -122,6 +110,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Normal Log Updates details updated successfully");
cy.contains("Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
cy.verifyContentPresence("#consultation-preview", [
patientModifiedDiastolic,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/patient_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("Patient", () => {
// });
// commented out the shifting request, as logic need to be re-visited

it("Post doctor notes for an already created patient", () => {
it("Post discussion notes for an already created patient", () => {
patientPage.visitPatient("Dummy Patient 3");
patientConsultationPage.visitDoctorNotesPage();
patientConsultationPage.addDoctorsNotes("Test Doctor Notes");
Expand Down
56 changes: 50 additions & 6 deletions cypress/e2e/patient_spec/patient_prescription.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { PatientPage } from "../../pageobject/Patient/PatientCreation";
const patientPrescription = new PatientPrescription();
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const medicineName = "DOLO";
const medicineBaseDosage = "4";
const medicineTargetDosage = "9";
const medicineFrequency = "Twice daily";
const medicineAdministerNote = "Medicine Administration Note";

describe("Patient Medicine Administration", () => {
before(() => {
Expand All @@ -18,25 +23,64 @@ describe("Patient Medicine Administration", () => {
cy.awaitUrl("/patients");
});

it("Add a new titrated medicine for a patient | Individual Administeration |", () => {
patientPage.visitPatient("Dummy Patient 5");
patientPrescription.visitMedicineTab();
patientPrescription.visitEditPrescription();
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine(medicineName);
patientPrescription.clickTitratedDosage();
patientPrescription.enterDosage(medicineBaseDosage);
patientPrescription.enterTargetDosage(medicineTargetDosage);
patientPrescription.selectDosageFrequency(medicineFrequency);
cy.submitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Administer the medicine in edit form
patientPrescription.clickAdministerButton();
patientPrescription.enterAdministerDosage(medicineBaseDosage);
patientPrescription.enterAdministerNotes(medicineAdministerNote);
cy.submitButton("Administer Medicine");
cy.verifyNotification("Medicine(s) administered");
cy.closeNotification();
// Verify the Reflection on the Medicine
cy.verifyContentPresence("#medicine-preview", [
medicineName,
medicineBaseDosage,
medicineTargetDosage,
]);
patientPrescription.clickReturnToDashboard();
// Go to medicine tab and administer it again
patientPrescription.visitMedicineTab();
cy.verifyAndClickElement("#0", medicineName);
cy.submitButton("Administer");
patientPrescription.enterAdministerDosage(medicineBaseDosage);
cy.submitButton("Administer Medicine");
cy.verifyNotification("Medicine(s) administered");
});

it("Add a new medicine for a patient and verify the duplicate medicine validation", () => {
patientPage.visitPatient("Dummy Patient 4");
patientPrescription.visitMedicineTab();
patientPrescription.visitEditPrescription();
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
patientPrescription.selectMedicine(medicineName);
patientPrescription.enterDosage(medicineBaseDosage);
patientPrescription.selectDosageFrequency(medicineFrequency);
cy.submitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// verify the duplicate medicine error message
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
patientPrescription.selectMedicine(medicineName);
patientPrescription.enterDosage(medicineBaseDosage);
patientPrescription.selectDosageFrequency(medicineFrequency);
cy.submitButton("Submit");
cy.verifyNotification(
"Medicine - This medicine is already prescribed to this patient. Please discontinue the existing prescription to prescribe again.",
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/resource_spec/resources.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ describe("Resource Page", () => {
"Dummy",
"Test title",
"10",
"Test description"
"Test description",
);
facilityPage.clickSubmitRequestButton();
facilityPage.verifySuccessNotification(
"Resource request created successfully"
"Resource request created successfully",
);
facilityPage.verifyresourcenewurl();
cy.url().then((url) => {
Expand All @@ -71,7 +71,7 @@ describe("Resource Page", () => {
resourcePage.updateStatus("APPROVED");
resourcePage.clickSubmitButton();
resourcePage.verifySuccessNotification(
"Resource request updated successfully"
"Resource request updated successfully",
);
});

Expand Down
8 changes: 6 additions & 2 deletions cypress/pageobject/Facility/FacilityManage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ class FacilityManage {
cy.get("#hf_id").click().clear().click().type(address);
}

verifySuccessMessageVisibilityAndContent(text) {
cy.get(".pnotify-text").should("be.visible").contains(text);
verifySuccessMessageVisibilityAndContent(text, isRegex = false) {
if (isRegex) {
cy.get(".pnotify-text").should("be.visible").contains(text);
} else {
cy.get(".pnotify-text").should("be.visible").and("contain.text", text);
}
}

verifyMiddlewareAddressValue(expectedValue) {
Expand Down
4 changes: 0 additions & 4 deletions cypress/pageobject/Patient/PatientLogupdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,5 @@ class PatientLogupdate {
cy.get("#consultation_tab_nav").scrollIntoView();
cy.verifyAndClickElement("#consultation_tab_nav", "Vitals");
}

clickCopyPreviousValue() {
cy.get("#clone_last").click();
}
}
export default PatientLogupdate;
34 changes: 30 additions & 4 deletions cypress/pageobject/Patient/PatientPrescription.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export class PatientPrescription {
clickAddPrescription() {
cy.contains("button", "Add Prescription Medication")
.should("be.visible")
.click();
cy.get("#add-prescription").scrollIntoView();
cy.verifyAndClickElement(
"#add-prescription",
"Add Prescription Medication",
);
}

interceptMedibase() {
Expand All @@ -16,6 +18,15 @@ export class PatientPrescription {
);
}

clickTitratedDosage() {
cy.get("#titrated-dosage").click();
}

clickAdministerButton() {
cy.get("#administer-medicine").should("be.visible");
cy.verifyAndClickElement("#administer-medicine", "Administer");
}

selectMedicinebox() {
cy.get(
"div#medicine_object input[placeholder='Select'][role='combobox']",
Expand All @@ -30,6 +41,18 @@ export class PatientPrescription {
cy.get("#base_dosage").type(doseAmount, { force: true });
}

enterAdministerDosage(dosage: string) {
cy.get("#dosage").type(dosage);
}

enterAdministerNotes(notes: string) {
cy.get("#administration_notes").type(notes);
}

enterTargetDosage(targetDosage: string) {
cy.get("#target_dosage").type(targetDosage, { force: true });
}

selectDosageFrequency(frequency: string) {
cy.clickAndSelectOption("#frequency", frequency);
}
Expand All @@ -54,7 +77,10 @@ export class PatientPrescription {
visitMedicineTab() {
cy.get("#consultation_tab_nav").scrollIntoView();
cy.get("#consultation_tab_nav").contains("Medicines").click();
cy.get("a[href='prescriptions']").first().click();
}

visitEditPrescription() {
cy.get("#edit-prescription").click();
}
}
export default PatientPrescription;
Loading

0 comments on commit 4ebebeb

Please sign in to comment.