Skip to content

Commit

Permalink
Merge branch 'develop' into Fix-ohcnetwork#7708
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored May 7, 2024
2 parents 1d562b8 + d807434 commit f0e4cfd
Show file tree
Hide file tree
Showing 28 changed files with 378 additions and 109 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/auto-testing-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Auto Add Needs Testing Label

on:
pull_request:
types: [opened, reopened, edited]
issue_comment:
types: [created]
pull_request_review:
types: [submitted]

jobs:
auto_label:
runs-on: ubuntu-latest

steps:
- name: Check PR Conditions and Add Label
id: check_conditions
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = context.payload.pull_request;
const isDraft = pr.draft;
const isReadyForTestingComment = context.payload.comment?.body.includes('ready for testing');
const isChangesRequired = context.payload.review?.state === 'changes_requested';
if ((isReadyForTestingComment && !isDraft) || (!isDraft && pr.draft_changed)) {
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['needs testing']
});
}
if (isChangesRequired) {
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
body: 'Reminder: To add the "needs testing" label, comment "ready for testing" on this PR.'
});
}
45 changes: 40 additions & 5 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Telemedicine");
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.typeAdditionalSymptoms(additionalSymptoms);
patientLogupdate.selectPatientCategory(patientCategory);
Expand All @@ -58,7 +59,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Consultation Updates details created successfully");
cy.verifyNotification(
"Telemedicine Log Updates details created successfully",
);
// verify the copied previous value
cy.closeNotification();
patientLogupdate.clickLogupdate();
Expand All @@ -71,7 +74,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
cy.verifyContentPresence("#rhythm_detail", [patientRhythm]);
cy.submitButton("Continue");
cy.verifyNotification("Consultation Updates details updated successfully");
cy.verifyNotification("Normal Log Updates details updated successfully");
});

it("Create a new log normal update for a domicilary care patient and edit it", () => {
Expand All @@ -96,7 +99,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Consultation Updates details created successfully");
cy.verifyNotification("Normal Log Updates details created successfully");
cy.closeNotification();
// edit the card and verify the data.
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
Expand All @@ -118,7 +121,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickClearButtonInElement("#diastolic");
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Consultation Updates details updated successfully");
cy.verifyNotification("Normal Log Updates details updated successfully");
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
cy.verifyContentPresence("#consultation-preview", [
patientModifiedDiastolic,
Expand Down Expand Up @@ -148,12 +151,44 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.wait(2000);
cy.verifyNotification("Consultation Updates details created successfully");
cy.verifyNotification("Normal Log Updates details created successfully");
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#basic-information", [additionalSymptoms]);
});

it("Create a normal log update to verify MEWS Score Functionality", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientLogupdate.clickLogupdate();
// Verify the MEWS Score reflection
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
patientLogupdate.typeTemperature(patientTemperature);
patientLogupdate.typeRespiratory(patientRespiratory);
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Normal Log Updates details created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["9"]);
// Verify the Incomplete data will give blank info
patientLogupdate.clickLogupdate();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
cy.submitButton("Save");
cy.verifyNotification("Normal Log Updates details created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["-"]);
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
15 changes: 0 additions & 15 deletions cypress/e2e/patient_spec/patient_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientPrescription from "../../pageobject/Patient/PatientPrescription";

describe("Patient", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientConsultationPage = new PatientConsultationPage();
const patientPrescription = new PatientPrescription();

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand Down Expand Up @@ -45,19 +43,6 @@ describe("Patient", () => {
cy.verifyNotification("Note added successfully");
});

it("Edit prescription for an already created patient", () => {
patientPage.visitPatient("Dummy Patient 4");
patientPrescription.visitEditPrescriptionPage();
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.verifyNotification("Medicine prescribed");
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
49 changes: 49 additions & 0 deletions cypress/e2e/patient_spec/patient_prescription.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import PatientPrescription from "../../pageobject/Patient/PatientPrescription";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";

const patientPrescription = new PatientPrescription();
const loginPage = new LoginPage();
const patientPage = new PatientPage();

describe("Patient Medicine Administration", () => {
before(() => {
loginPage.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

beforeEach(() => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/patients");
});

it("Add a new medicine for a patient and verify the duplicate medicine validation", () => {
patientPage.visitPatient("Dummy Patient 4");
patientPrescription.visitMedicineTab();
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
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");
cy.submitButton("Submit");
cy.verifyNotification(
"Medicine - This medicine is already prescribed to this patient. Please discontinue the existing prescription to prescribe again.",
);
});

afterEach(() => {
cy.saveLocalStorage();
});
});
42 changes: 19 additions & 23 deletions cypress/e2e/patient_spec/patient_registration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import {
generatePhoneNumber,
generateEmergencyPhoneNumber,
} from "../../pageobject/utils/constants";
import { generatePhoneNumber } from "../../pageobject/utils/constants";
import PatientTransfer from "../../pageobject/Patient/PatientTransfer";
import PatientExternal from "../../pageobject/Patient/PatientExternal";
import PatientInsurance from "../../pageobject/Patient/PatientInsurance";
Expand All @@ -27,7 +24,6 @@ describe("Patient Creation with consultation", () => {
const patientInsurance = new PatientInsurance();
const patientMedicalHistory = new PatientMedicalHistory();
const phone_number = generatePhoneNumber();
const emergency_phone_number = generateEmergencyPhoneNumber();
const age = calculateAge();
const patientFacility = "Dummy Facility 40";
const patientDateOfBirth = "01012001";
Expand Down Expand Up @@ -79,7 +75,7 @@ describe("Patient Creation with consultation", () => {
patientPage.patientformvisibility();
// Patient Details page
patientPage.typePatientPhoneNumber(phone_number);
patientPage.typePatientEmergencyNumber(emergency_phone_number);
patientPage.checkPhoneNumberIsEmergencyNumber();
patientPage.typePatientAge(age.toString());
patientPage.typePatientName(patientOneName);
patientPage.selectPatientGender(patientOneGender);
Expand All @@ -93,7 +89,7 @@ describe("Patient Creation with consultation", () => {
// Patient Medical History
patientMedicalHistory.typePatientPresentHealth(patientOnePresentHealth);
patientMedicalHistory.typePatientOngoingMedication(
patientOneOngoingMedication
patientOneOngoingMedication,
);
patientMedicalHistory.typeMedicalHistory(2, "Diabetes");
patientMedicalHistory.typeMedicalHistory(3, "Heart Disease");
Expand All @@ -115,10 +111,10 @@ describe("Patient Creation with consultation", () => {
age,
patientOneName,
phone_number,
emergency_phone_number,
phone_number,
yearOfBirth,
patientOneBloodGroup,
patientOccupation
patientOccupation,
);
patientMedicalHistory.verifyPatientMedicalDetails(
patientOnePresentHealth,
Expand All @@ -130,7 +126,7 @@ describe("Patient Creation with consultation", () => {
"Kidney Diseases",
"Lung Diseases/Asthma",
"Cancer",
"Other"
"Other",
);
// verify its presence in the patient detail page
cy.visit("/patients");
Expand All @@ -155,43 +151,43 @@ describe("Patient Creation with consultation", () => {
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"subscriber_id",
patientOneFirstSubscriberId
patientOneFirstSubscriberId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"policy_id",
patientOneFirstPolicyId
patientOneFirstPolicyId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_id",
patientOneFirstInsurerId
patientOneFirstInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_name",
patientOneFirstInsurerName
patientOneFirstInsurerName,
);
patientInsurance.clickAddInsruanceDetails();
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"subscriber_id",
patientOneSecondSubscriberId
patientOneSecondSubscriberId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"policy_id",
patientOneSecondPolicyId
patientOneSecondPolicyId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_id",
patientOneSecondInsurerId
patientOneSecondInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_name",
patientOneSecondInsurerName
patientOneSecondInsurerName,
);
patientPage.clickUpdatePatient();
cy.wait(3000);
Expand All @@ -204,10 +200,10 @@ describe("Patient Creation with consultation", () => {
age,
patientOneName,
phone_number,
emergency_phone_number,
phone_number,
yearOfBirth,
patientOneUpdatedBloodGroup,
patientOccupation
patientOccupation,
);
// Verify No medical history
patientMedicalHistory.verifyNoSymptosPresent("Diabetes");
Expand All @@ -220,21 +216,21 @@ describe("Patient Creation with consultation", () => {
patientOneFirstSubscriberId,
patientOneFirstPolicyId,
patientOneFirstInsurerId,
patientOneFirstInsurerName
patientOneFirstInsurerName,
);
patientInsurance.clickPatientInsuranceViewDetail();
cy.wait(3000);
patientInsurance.verifyPatientPolicyDetails(
patientOneFirstSubscriberId,
patientOneFirstPolicyId,
patientOneFirstInsurerId,
patientOneFirstInsurerName
patientOneFirstInsurerName,
);
patientInsurance.verifyPatientPolicyDetails(
patientOneSecondSubscriberId,
patientOneSecondPolicyId,
patientOneSecondInsurerId,
patientOneSecondInsurerName
patientOneSecondInsurerName,
);
});

Expand Down
Loading

0 comments on commit f0e4cfd

Please sign in to comment.