diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts index 2e7ce853fc5..ef92c2e9bd1 100644 --- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts +++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts @@ -101,6 +101,8 @@ describe("Patient Creation with consultation", () => { facilityPage.selectLocalBody(patientOneLocalbody); facilityPage.selectWard(patientOneWard); patientPage.selectPatientOccupation(patientOccupation); + patientPage.selectSocioeconomicStatus("MIDDLE_CLASS"); + patientPage.selectDomesticHealthcareSupport("FAMILY_MEMBER"); // Patient Medical History patientMedicalHistory.typePatientPresentHealth(patientOnePresentHealth); patientMedicalHistory.typePatientOngoingMedication( @@ -130,6 +132,8 @@ describe("Patient Creation with consultation", () => { yearOfBirth, patientOneBloodGroup, patientOccupation, + "Middle Class", + "Family member", ); patientMedicalHistory.verifyPatientMedicalDetails( patientOnePresentHealth, diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index db3c10fdcb5..e037f0888f0 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -117,6 +117,14 @@ export class PatientPage { cy.searchAndSelectOption("#occupation", occupation); } + selectSocioeconomicStatus(value: string) { + cy.selectRadioOption("socioeconomic_status", value); + } + + selectDomesticHealthcareSupport(value: string) { + cy.selectRadioOption("domestic_healthcare_support", value); + } + clickCreatePatient() { cy.intercept("POST", "**/api/v1/patient/").as("createPatient"); cy.get("button[data-testid='submit-button']").click(); @@ -165,6 +173,8 @@ export class PatientPage { yearOfBirth, bloodGroup, occupation, + socioeconomicStatus = null, + domesticHealthcareSupport = null, isAntenatal = false, isPostPartum = false, ) { @@ -178,6 +188,9 @@ export class PatientPage { expect($dashboard).to.contain(yearOfBirth); expect($dashboard).to.contain(bloodGroup); expect($dashboard).to.contain(occupation); + socioeconomicStatus && expect($dashboard).to.contain(socioeconomicStatus); + domesticHealthcareSupport && + expect($dashboard).to.contain(domesticHealthcareSupport); if (isAntenatal) { expect($dashboard).to.contain("Antenatal"); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index c6437505349..86d048e5f41 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -169,6 +169,10 @@ Cypress.Commands.add( }, ); +Cypress.Commands.add("selectRadioOption", (name: string, value: string) => { + cy.get(`input[type='radio'][name='${name}'][value=${value}]`).click(); +}); + Cypress.Commands.add("clickAndTypeDate", (selector: string, date: string) => { cy.get(selector).scrollIntoView(); cy.get(selector).click(); diff --git a/cypress/support/index.ts b/cypress/support/index.ts index 9ddfd0c819a..d660246324f 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -23,6 +23,7 @@ declare global { selector: string, symptoms: string | string[], ): Chainable; + selectRadioOption(name: string, value: string): Chainable; typeAndMultiSelectOption( selector: string, input: string, diff --git a/src/Components/Patient/PatientHome.tsx b/src/Components/Patient/PatientHome.tsx index fc173f26213..3d79e305e39 100644 --- a/src/Components/Patient/PatientHome.tsx +++ b/src/Components/Patient/PatientHome.tsx @@ -533,6 +533,30 @@ export const PatientHome = (props: any) => { : "-"} +
+
+ {t("socioeconomic_status")} +
+
+ {patientData.meta_info?.socioeconomic_status + ? t( + `SOCIOECONOMIC_STATUS__${patientData.meta_info.socioeconomic_status}`, + ) + : "-"} +
+
+
+
+ {t("domestic_healthcare_support")} +
+
+ {patientData.meta_info?.domestic_healthcare_support + ? t( + `DOMESTIC_HEALTHCARE_SUPPORT__${patientData.meta_info.domestic_healthcare_support}`, + ) + : "-"} +
+
diff --git a/src/Locale/en/Patient.json b/src/Locale/en/Patient.json index cd71b0bb1e5..3b183bd226d 100644 --- a/src/Locale/en/Patient.json +++ b/src/Locale/en/Patient.json @@ -1,5 +1,6 @@ { - "socioeconomic_status": "Socioeconomic Status", + "socioeconomic_status": "Socioeconomic status", + "domestic_healthcare_support": "Domestic healthcare support", "has_domestic_healthcare_support": "Has domestic healthcare support?", "SOCIOECONOMIC_STATUS__MIDDLE_CLASS": "Middle Class", "SOCIOECONOMIC_STATUS__POOR": "Poor",