Skip to content

Commit

Permalink
Merge branch 'develop' into user-filter-district
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 authored Mar 11, 2024
2 parents 4a2e86f + 83dc92f commit 2a579fc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 23 deletions.
16 changes: 14 additions & 2 deletions cypress/e2e/facility_spec/facility_creation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// FacilityCreation
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";
import {
cy,
describe,
before,
beforeEach,
it,
afterEach,
expect,
} from "local-cypress";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
Expand Down Expand Up @@ -38,6 +46,7 @@ describe("Facility Creation", () => {
const initialTriageValue = "60";
const modifiedTriageValue = "50";
const facilityErrorMessage = [
"Required",
"Required",
"Invalid Pincode",
"Required",
Expand Down Expand Up @@ -115,6 +124,7 @@ describe("Facility Creation", () => {
facilityPage.submitForm();
userCreationPage.verifyErrorMessages(facilityErrorMessage);
facilityPage.fillFacilityName(facilityName);
facilityPage.clickUpdateFacilityType("Primary Health Centres");
facilityPage.clickfacilityfeatureoption();
facilityFeature.forEach((featureText) => {
cy.get("[role='option']").contains(featureText).click();
Expand Down Expand Up @@ -202,6 +212,7 @@ describe("Facility Creation", () => {
it("Create a new facility with single bed and doctor capacity", () => {
facilityPage.visitCreateFacilityPage();
facilityPage.fillFacilityName(facilityName);
facilityPage.clickUpdateFacilityType("Primary Health Centres");
facilityPage.fillPincode("682001");
facilityPage.selectStateOnPincode("Kerala");
facilityPage.selectDistrictOnPincode("Ernakulam");
Expand Down Expand Up @@ -241,6 +252,7 @@ describe("Facility Creation", () => {
it("Create a new facility with no bed and doctor capacity", () => {
facilityPage.visitCreateFacilityPage();
facilityPage.fillFacilityName(facilityName);
facilityPage.clickUpdateFacilityType("Primary Health Centres");
facilityPage.fillPincode("682001");
facilityPage.selectStateOnPincode("Kerala");
facilityPage.selectDistrictOnPincode("Ernakulam");
Expand Down Expand Up @@ -279,7 +291,7 @@ describe("Facility Creation", () => {
facilityPage.visitUpdateFacilityPage(facilityUrl1);
facilityPage.clickManageFacilityDropdown();
facilityPage.clickUpdateFacilityOption();
facilityPage.clickUpdateFacilityType("Govt Hospital");
facilityPage.clickUpdateFacilityType("Primary Health Centres");
facilityPage.fillAddress(facilityUpdateAddress);
facilityPage.fillOxygenCapacity(oxygenCapacity);
facilityPage.fillExpectedOxygenRequirement(oxygenExpected);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/patient_consultation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("Patient Consultation in multiple combination", () => {
const patientWeight = "70";
const patientHeight = "170";
const medicineOne = "DOLO";
const patientIpNumber = "192.168";
const patientIpNumber = Math.random().toString(36).substring(7);

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand Down
37 changes: 20 additions & 17 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,38 +106,41 @@ export const VEHICLE_TYPES: Array<OptionsType> = [

export const FACILITY_TYPES: Array<OptionsType> = [
// { id: 1, text: "Educational Inst" },
{ id: 2, text: "Private Hospital" },
{ id: 3, text: "Other" },
// { id: 4, text: "Hostel" },
// { id: 5, text: "Hotel" },
// { id: 6, text: "Lodge" },
{ id: 7, text: "TeleMedicine" },
{ id: 8, text: "Govt Hospital" },
{ id: 9, text: "Labs" },
{ id: 800, text: "Primary Health Centres" },
{ id: 801, text: "24x7 Public Health Centres" },
{ id: 802, text: "Family Health Centres" },
{ id: 803, text: "Community Health Centres" },
{ id: 820, text: "Urban Primary Health Center" },
{ id: 830, text: "Taluk Hospitals" },
{ id: 831, text: "Taluk Headquarters Hospitals" },
{ id: 840, text: "Women and Child Health Centres" },
{ id: 850, text: "General hospitals" },
{ id: 830, text: "Taluk Hospitals" },
{ id: 860, text: "District Hospitals" },
{ id: 870, text: "Govt Medical College Hospitals" },

{ id: 900, text: "Co-operative hospitals" },
{ id: 9, text: "Govt Labs" },
{ id: 10, text: "Private Labs" },
{ id: 7, text: "TeleMedicine" },
{ id: 2, text: "Private Hospital" },
{ id: 910, text: "Autonomous healthcare facility" },
{ id: 1300, text: "Shifting Centre" },
{ id: 1500, text: "Request Approving Center" },
{ id: 1510, text: "Request Fulfilment Center" },
{ id: 3, text: "Other" },

// { id: 8, text: "Govt Hospital" },
// { id: 801, text: "24x7 Public Health Centres" },
// { id: 820, text: "Urban Primary Health Center" },
// { id: 831, text: "Taluk Headquarters Hospitals" },
// { id: 850, text: "General hospitals" },

// { id: 900, text: "Co-operative hospitals" },

// { id: 950, text: "Corona Testing Labs" },
// { id: 1000, text: "Corona Care Centre" },

{ id: 950, text: "Corona Testing Labs" },
{ id: 1000, text: "Corona Care Centre" },
// { id: 1010, text: "COVID-19 Domiciliary Care Center" },
// { id: 1100, text: "First Line Treatment Centre" },
// { id: 1200, text: "Second Line Treatment Center" },
{ id: 1300, text: "Shifting Centre" },
// { id: 1400, text: "Covid Management Center" },
{ id: 1500, text: "Request Approving Center" },
{ id: 1510, text: "Request Fulfilment Center" },
// { id: 1600, text: "District War Room" },
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export function PrescriptionDropdown(props: {
onFocus?: () => void;
onBlur?: () => void;
}) {
props.tips = [];
const { options, tips, value, setValue } = props;
const [open, setOpen] = useState(false);

Expand Down
5 changes: 3 additions & 2 deletions src/Components/Facility/FacilityCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ interface FacilityProps {
}

type FacilityForm = {
facility_type: string;
facility_type?: string;
name: string;
state: number;
district: number;
Expand All @@ -89,7 +89,7 @@ type FacilityForm = {
};

const initForm: FacilityForm = {
facility_type: "Private Hospital",
facility_type: undefined,
name: "",
state: 0,
district: 0,
Expand Down Expand Up @@ -366,6 +366,7 @@ export const FacilityCreate = (props: FacilityProps) => {
let invalidForm = false;
Object.keys(state.form).forEach((field) => {
switch (field) {
case "facility_type":
case "name":
case "address":
if (!state.form[field]) {
Expand Down

0 comments on commit 2a579fc

Please sign in to comment.