From 529dc1e70f4659ae8836791a428787a2939bdb97 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:53:20 +0530 Subject: [PATCH 1/4] added bed number selection to the consultation test --- cypress/e2e/patient_spec/patient_consultation.cy.ts | 1 + cypress/pageobject/Patient/PatientConsultation.ts | 4 ++++ src/Components/Common/BedSelect.tsx | 1 + src/Components/Facility/ConsultationForm.tsx | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/patient_spec/patient_consultation.cy.ts b/cypress/e2e/patient_spec/patient_consultation.cy.ts index eef98a5e3ce..9c9256e11ef 100644 --- a/cypress/e2e/patient_spec/patient_consultation.cy.ts +++ b/cypress/e2e/patient_spec/patient_consultation.cy.ts @@ -95,6 +95,7 @@ describe("Patient Consultation in multiple combination", () => { cy.submitButton("Create Consultation"); // the above submit should fail as IP number is missing patientConsultationPage.typePatientNumber(patientIpNumber); + patientConsultationPage.selectBed("Dummy Bed 1"); cy.submitButton("Create Consultation"); cy.verifyNotification("Consultation created successfully"); // Below code for the prescription module only present while creating a new consultation diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index 31b1fd6cb68..dc5d9e2b2bb 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -28,6 +28,10 @@ export class PatientConsultationPage { cy.searchAndSelectOption("#referred_to", referance); } + selectBed(bedNo: string) { + cy.searchAndSelectOption("#bed", bedNo); + } + selectPatientWard(ward: string) { cy.searchAndSelectOption("#transferred_from_location", ward); } diff --git a/src/Components/Common/BedSelect.tsx b/src/Components/Common/BedSelect.tsx index 5c31055a3a4..7ed741061ee 100644 --- a/src/Components/Common/BedSelect.tsx +++ b/src/Components/Common/BedSelect.tsx @@ -65,6 +65,7 @@ export const BedSelect = (props: BedSelectProps) => { return ( { admitted: data.admitted ? String(data.admitted) : "false", admitted_to: data.admitted_to ? data.admitted_to : "", category: data.category - ? (PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ?? - "") + ? PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ?? + "" : "", patient_no: data.patient_no ?? "", OPconsultation: data.consultation_notes, From 28b8701859e9fab0b48b619ecb5f511eedd7f0f6 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:23:24 +0530 Subject: [PATCH 2/4] fix the lint error --- src/Components/Facility/ConsultationForm.tsx | 4 ++-- vite.config.mts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 10af5bec23a..355d4ce745e 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -387,8 +387,8 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { admitted: data.admitted ? String(data.admitted) : "false", admitted_to: data.admitted_to ? data.admitted_to : "", category: data.category - ? PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ?? - "" + ? (PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ?? + "") : "", patient_no: data.patient_no ?? "", OPconsultation: data.consultation_notes, diff --git a/vite.config.mts b/vite.config.mts index 5a8dcbae044..1b80321b004 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -83,7 +83,7 @@ export default { port: 4000, proxy: { "/api": { - target: process.env.CARE_API ?? "https://careapi.ohc.network", + target: process.env.CARE_API ?? "http://localhost:9000/", changeOrigin: true, }, }, @@ -100,7 +100,7 @@ export default { port: 4000, proxy: { "/api": { - target: process.env.CARE_API ?? "https://careapi.ohc.network", + target: process.env.CARE_API ?? "http://localhost:9000/", changeOrigin: true, }, }, From d5ae81d3816fc8a3631128bfdf5db7e8e17e5b3c Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:24:57 +0530 Subject: [PATCH 3/4] revert vite --- vite.config.mts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vite.config.mts b/vite.config.mts index 1b80321b004..3a02574c776 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -83,7 +83,7 @@ export default { port: 4000, proxy: { "/api": { - target: process.env.CARE_API ?? "http://localhost:9000/", + target: process.env.CARE_API ?? "https://careapi.ohc.network", changeOrigin: true, }, }, @@ -100,7 +100,7 @@ export default { port: 4000, proxy: { "/api": { - target: process.env.CARE_API ?? "http://localhost:9000/", + target: process.env.CARE_API ?? "https://careapi.ohc.network/", changeOrigin: true, }, }, From 01abeffb55fb4fb3a82c7853acdb44ba7b11064e Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:25:39 +0530 Subject: [PATCH 4/4] revert vite --- vite.config.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.mts b/vite.config.mts index 3a02574c776..5a8dcbae044 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -100,7 +100,7 @@ export default { port: 4000, proxy: { "/api": { - target: process.env.CARE_API ?? "https://careapi.ohc.network/", + target: process.env.CARE_API ?? "https://careapi.ohc.network", changeOrigin: true, }, },