Skip to content

Commit

Permalink
changes according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
rash-27 committed Mar 23, 2024
1 parent c891f40 commit 56f4e11
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 66 deletions.
60 changes: 0 additions & 60 deletions cypress/e2e/patient_spec/patient_registration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,66 +72,6 @@ describe("Patient Creation with consultation", () => {
cy.awaitUrl("/patients");
});

it("Create a new patient with all field in registration form with age and verify", () => {
// patient details with all the available fields except covid
patientPage.createPatient();
patientPage.selectFacility(patientFacility);
patientPage.patientformvisibility();
// Patient Details page
patientPage.typePatientPhoneNumber(phone_number);
patientPage.typePatientEmergencyNumber(emergency_phone_number);
patientPage.typePatientAge(age.toString());
patientPage.typePatientName(patientOneName);
patientPage.selectPatientGender(patientOneGender);
patientPage.typePatientAddress(patientOneAddress);
facilityPage.fillPincode(patientOnePincode);
facilityPage.selectStateOnPincode(patientOneState);
facilityPage.selectDistrictOnPincode(patientOneDistrict);
facilityPage.selectLocalBody(patientOneLocalbody);
facilityPage.selectWard(patientOneWard);
// Patient Medical History
patientMedicalHistory.typePatientPresentHealth(patientOnePresentHealth);
patientMedicalHistory.typePatientOngoingMedication(
patientOneOngoingMedication
);
patientMedicalHistory.typeMedicalHistory(2, "Diabetes");
patientMedicalHistory.typeMedicalHistory(3, "Heart Disease");
patientMedicalHistory.typeMedicalHistory(4, "HyperTension");
patientMedicalHistory.typeMedicalHistory(5, "Kidney Diseases");
patientMedicalHistory.typeMedicalHistory(6, "Lung Diseases/Asthma");
patientMedicalHistory.typeMedicalHistory(7, "Cancer");
patientMedicalHistory.typeMedicalHistory(8, "Other");
patientMedicalHistory.typePatientAllergies(patientOneAllergies);
patientPage.selectPatientBloodGroup(patientOneBloodGroup);
patientPage.clickCreatePatient();
patientPage.verifyPatientIsCreated();
// Verify the patient details
patientPage.clickCancelButton();
cy.wait(3000);
patientPage.savePatientUrl();
patientPage.verifyPatientDashboardDetails(
patientOneGender,
age,
patientOneName,
phone_number,
emergency_phone_number,
yearOfBirth,
patientOneBloodGroup,
"-" //Occupation
);
patientMedicalHistory.verifyPatientMedicalDetails(
patientOnePresentHealth,
patientOneOngoingMedication,
patientOneAllergies,
"Diabetes",
"Heart Disease",
"HyperTension",
"Kidney Diseases",
"Lung Diseases/Asthma",
"Cancer",
"Other"
);
});
it("Create a new patient with all field in registration form and no consultation", () => {
// patient details with all the available fields except covid
phone_number = generatePhoneNumber();
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class PatientPage {
cy.get("#date-input").click().type(dateOfBirth);
}
typePatientAge(age: string) {
cy.clickAndSelectOption("#age-input-type-selector", "Age");
cy.clickAndSelectOption("#ageOrDob-selector", "Age");
cy.submitButton("Confirm");
cy.get("#age-div").click().type(age);
}
Expand Down
12 changes: 7 additions & 5 deletions src/Components/Patient/PatientRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
</FieldLabel>
<div className="flex w-full items-center gap-2">
<SelectMenuV2
id="age-input-type-selector"
id="ageOrDob-selector"
className="w-44 lg:w-32"
options={
[
Expand Down Expand Up @@ -1416,12 +1416,14 @@ export const PatientRegister = (props: PatientRegisterProps) => {
description={
<div>
<div>
If you enter age, system will consider
only the year of birth as per the age
While entering a patient's age is an
option, please note that only the year of
birth will be captured from this
information.
</div>
<b>
Recomended only if you date of birth is
not known
Recommended only when the patient's date
of birth is unknown
</b>
</div>
}
Expand Down

0 comments on commit 56f4e11

Please sign in to comment.