Skip to content

Commit

Permalink
Occupation dropdown frontend (#7541)
Browse files Browse the repository at this point in the history
* Occupation dropdown frontend

* Update src/Components/Form/FormFields/Autocomplete.tsx

Co-authored-by: Rithvik Nishad <[email protected]>

* Update src/Components/Patient/PatientRegister.tsx

Co-authored-by: Rithvik Nishad <[email protected]>

* constants changed

* changed

* final fix ocupations

* fix cypress

* changed dropdown

---------

Co-authored-by: Rithvik Nishad <[email protected]>
Co-authored-by: Mohammed Nihal <[email protected]>
  • Loading branch information
3 people authored Apr 24, 2024
1 parent 782a77d commit 66e5ff4
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class PatientPage {
}

selectPatientOccupation(occupation: string) {
cy.clickAndSelectOption("#occupation", occupation);
cy.searchAndSelectOption("#occupation", occupation);
}

clickCreatePatient() {
Expand Down
46 changes: 46 additions & 0 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1274,4 +1274,50 @@ export const OCCUPATION_TYPES = [
{ id: 4, text: "Healthcare Lab Worker", value: "HEALTH_CARE_LAB_WORKER" },
{ id: 5, text: "Animal Handler", value: "ANIMAL_HANDLER" },
{ id: 6, text: "Others", value: "OTHERS" },
{ id: 7, text: "Healthcare Practitioner", value: "HEALTHCARE_PRACTITIONER" },
{ id: 8, text: "Paramedics", value: "PARADEMICS" },
{
id: 9,
text: "Business or Finance related Occupations",
value: "BUSINESS_RELATED",
},
{ id: 10, text: "Engineer", value: "ENGINEER" },
{ id: 11, text: "Teacher", value: "TEACHER" },
{
id: 12,
text: "Other Professional Occupations",
value: "OTHER_PROFESSIONAL_OCCUPATIONS",
},
{
id: 13,
text: "Office and Administrative Support Occupations",
value: "OFFICE_ADMINISTRATIVE",
},
{ id: 14, text: "Chef or Head Cook", value: "CHEF" },
{
id: 15,
text: "Protective Service Occupations",
value: "PROTECTIVE_SERVICE",
},
{ id: 16, text: "Hospitality Service Occupations", value: "HOSPITALITY" },
{ id: 17, text: "Custodial Occupations", value: "CUSTODIAL" },
{ id: 18, text: "Customer Service Occupations", value: "CUSTOMER_SERVICE" },
{ id: 19, text: "Sales Supervisor", value: "SALES_SUPERVISOR" },
{ id: 20, text: "Retail Sales Worker", value: "RETAIL_SALES_WORKER" },
{ id: 21, text: "Insurance Sales Agent", value: "INSURANCE_SALES_AGENT" },
{ id: 22, text: "Sales Representative", value: "SALES_REPRESENTATIVE" },
{ id: 23, text: "Real Estate Sales Agent", value: "REAL_ESTATE" },
{
id: 24,
text: "Construction and Extraction Worker",
value: "CONSTRUCTION_EXTRACTION",
},
{ id: 25, text: "Farming, Fishing and Forestry", value: "AGRI_NATURAL" },
{ id: 26, text: "Production Occupations", value: "PRODUCTION_OCCUPATION" },
{ id: 27, text: "Aircraft Pilot or Flight Engineer", value: "PILOT_FLIGHT" },
{ id: 28, text: "Vehicle Driver", value: "VEHICLE_DRIVER" },
{ id: 29, text: "Military", value: "MILITARY" },
{ id: 30, text: "Homemaker", value: "HOMEMAKER" },
{ id: 31, text: "Don't Know", value: "UNKNOWN" },
{ id: 32, text: "Not Applicable", value: "NOT_APPLICABLE" },
];
3 changes: 2 additions & 1 deletion src/Components/Patient/PatientRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { PatientModel, Occupation } from "./models";
import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField";
import RadioFormField from "../Form/FormFields/RadioFormField";
import { SelectFormField } from "../Form/FormFields/SelectFormField";
import AutocompleteFormField from "../Form/FormFields/Autocomplete.js";
import Spinner from "../Common/Spinner";
import TextAreaFormField from "../Form/FormFields/TextAreaFormField";
import TextFormField from "../Form/FormFields/TextFormField";
Expand Down Expand Up @@ -1673,7 +1674,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
/>
)}
</div>
<SelectFormField
<AutocompleteFormField
{...field("occupation")}
label="Occupation"
placeholder="Select Occupation"
Expand Down

0 comments on commit 66e5ff4

Please sign in to comment.