diff --git a/packages/esm-patient-registration-app/src/patient-registration/field/person-attributes/custom-person-attribute-field.component.tsx b/packages/esm-patient-registration-app/src/patient-registration/field/person-attributes/custom-person-attribute-field.component.tsx index 729d4f04b5..63db707000 100644 --- a/packages/esm-patient-registration-app/src/patient-registration/field/person-attributes/custom-person-attribute-field.component.tsx +++ b/packages/esm-patient-registration-app/src/patient-registration/field/person-attributes/custom-person-attribute-field.component.tsx @@ -3,7 +3,6 @@ import { Field, type FieldProps } from 'formik'; import { Layer, Select, SelectItem } from '@carbon/react'; import { useTranslation } from 'react-i18next'; import classNames from 'classnames'; -import { evaluateAsBoolean } from '@openmrs/esm-framework'; import { PatientRegistrationContext } from '../../patient-registration-context'; import styles from './../field.scss'; @@ -47,7 +46,8 @@ const CustomPersonAttributeField: React.FC = ({ }) => { const { t } = useTranslation(); const fieldName = `attributes.${personAttributeType.uuid}`; - const { setFieldValue, values } = useContext(PatientRegistrationContext) as PatientRegistrationContextType; + const context = useContext(PatientRegistrationContext) as PatientRegistrationContextType; + const { setFieldValue, values } = context; // TODO: Improve this logic const filteredCustomConceptAnswers = customConceptAnswers.filter((answer) => { diff --git a/packages/esm-patient-registration-app/src/patient-registration/field/person-attributes/military.ts b/packages/esm-patient-registration-app/src/patient-registration/field/person-attributes/military.ts deleted file mode 100644 index d605ecb621..0000000000 --- a/packages/esm-patient-registration-app/src/patient-registration/field/person-attributes/military.ts +++ /dev/null @@ -1,133 +0,0 @@ -const militaryData = { - cadres: [ - { id: 1, name: 'Kenya Army' }, - { id: 2, name: 'Kenya Air Force' }, - { id: 3, name: 'Kenya Navy' }, - ], - units: [ - // Brigade Headquarters - { id: 1, name: '2 BDE HQS', cadreId: 1 }, - { id: 2, name: '4 BDE HQS', cadreId: 1 }, - { id: 3, name: '6 BDE HQS', cadreId: 1 }, - { id: 4, name: '8 BDE HQS', cadreId: 1 }, - { id: 5, name: '110 BDE HQS', cadreId: 1 }, - - // Infantry Units - { id: 7, name: '3 KR', cadreId: 1 }, - { id: 8, name: '5 KR', cadreId: 1 }, - { id: 9, name: '7 KR', cadreId: 1 }, - { id: 10, name: '9 KR', cadreId: 1 }, - { id: 11, name: '15 KR', cadreId: 1 }, - { id: 12, name: '17 KR', cadreId: 1 }, - { id: 13, name: '19 KR', cadreId: 1 }, - { id: 14, name: '21 KR', cadreId: 1 }, - - // Mechanized Infantry Battalions - { id: 15, name: '23 MIB', cadreId: 1 }, - { id: 16, name: '25 MIB', cadreId: 1 }, - { id: 17, name: '27 MIB', cadreId: 1 }, - { id: 18, name: '31 MIB', cadreId: 1 }, - { id: 19, name: '33 MIB', cadreId: 1 }, - { id: 20, name: '35 MIB', cadreId: 1 }, - - // Special Units - { id: 21, name: 'SOB FIELD WKSP', cadreId: 1 }, - { id: 22, name: '60 ASB', cadreId: 1 }, - { id: 23, name: '20 PARA BN', cadreId: 1 }, - { id: 24, name: '40 RBN', cadreId: 1 }, - { id: 25, name: 'SOTS', cadreId: 1 }, - - // Armored Units - { id: 26, name: 'ARMD BDE HQS', cadreId: 1 }, - { id: 27, name: '76 ARB', cadreId: 1 }, - { id: 28, name: '76 ARB WKSP', cadreId: 1 }, - { id: 29, name: '78 TK BN', cadreId: 1 }, - { id: 30, name: '78 TK BN WKSP', cadreId: 1 }, - { id: 31, name: '81 TK BN', cadreId: 1 }, - { id: 32, name: '81 TK BN WKSP', cadreId: 1 }, - { id: 33, name: '86 ARB', cadreId: 1 }, - { id: 34, name: '86 ARB WKSP', cadreId: 1 }, - - // Artillery Units - { id: 35, name: 'ARTY BDE HQS', cadreId: 1 }, - { id: 36, name: '66 ARTY BN', cadreId: 1 }, - { id: 37, name: '66 ARTY BN WKSP', cadreId: 1 }, - { id: 38, name: '75 ARTY BN', cadreId: 1 }, - { id: 39, name: '75 ARTY BN WKSP', cadreId: 1 }, - { id: 40, name: '77 ARTY BN', cadreId: 1 }, - { id: 41, name: '77 ARTY BN WKSP', cadreId: 1 }, - { id: 42, name: '55 ARTY BN', cadreId: 1 }, - { id: 43, name: '88 ARTY BN', cadreId: 1 }, - - // Engineer Units - { id: 44, name: 'COMBAT ENGR BDE', cadreId: 1 }, - { id: 45, name: '10 ENGR BN', cadreId: 1 }, - { id: 46, name: '10 ENGR LAD', cadreId: 1 }, - { id: 47, name: '12 ENGR BN', cadreId: 1 }, - { id: 48, name: '12 ENGR LAD', cadreId: 1 }, - { id: 49, name: '14 ENGR BN', cadreId: 1 }, - - // Construction Units - { id: 50, name: 'ENGR CONSTR BDE', cadreId: 1 }, - { id: 51, name: '18 CONSTR ENGR BN', cadreId: 1 }, - - // Workshop and Maintenance Units - { id: 52, name: 'KACEME HQS', cadreId: 1 }, - { id: 53, name: 'WKSP BN', cadreId: 1 }, - { id: 54, name: '22 FLD WKSP', cadreId: 1 }, - { id: 55, name: '42 FLD WKSP', cadreId: 1 }, - { id: 56, name: '62 FLD WKSP', cadreId: 1 }, - { id: 57, name: '82 FLD WKSP', cadreId: 1 }, - - // Supply and Ordnance Units - { id: 58, name: 'DEFOD', cadreId: 1 }, - { id: 59, name: '2ND ORD BN', cadreId: 1 }, - { id: 60, name: 'AMMO SUPPLY BN', cadreId: 1 }, - { id: 61, name: '23 OCC', cadreId: 1 }, - { id: 62, name: '43 OCC', cadreId: 1 }, - { id: 63, name: '63 OCC', cadreId: 1 }, - { id: 64, name: '83 OCC', cadreId: 1 }, - - // Transport Units - { id: 65, name: 'KACT HQS', cadreId: 1 }, - { id: 66, name: 'TPT BN', cadreId: 1 }, - { id: 67, name: 'H/LIFT BN', cadreId: 1 }, - - // Signal Units - { id: 68, name: 'KACS HQS', cadreId: 1 }, - { id: 69, name: 'AHQ SIG BN', cadreId: 1 }, - { id: 70, name: 'AHQ SIG BN LAD', cadreId: 1 }, - - // Medical Units - { id: 71, name: 'KAMC HQS', cadreId: 1 }, - { id: 72, name: 'NRB LEV IV HOSP', cadreId: 1 }, - { id: 73, name: 'LANET LEV IV HOSP', cadreId: 1 }, - { id: 74, name: 'ISIOLO LEV IV HOSP', cadreId: 1 }, - { id: 75, name: 'ELD LEV IV HOSP', cadreId: 1 }, - { id: 76, name: '1ST MED BN', cadreId: 1 }, - { id: 77, name: '2ND MED BN', cadreId: 1 }, - - // Military Police Units - { id: 78, name: 'MPC HQS', cadreId: 1 }, - { id: 79, name: '1 MP BN', cadreId: 1 }, - { id: 80, name: '2 MP BN', cadreId: 1 }, - { id: 81, name: 'MPSIU', cadreId: 1 }, - { id: 82, name: 'PPU', cadreId: 1 }, - - // Training Units - { id: 83, name: 'KACA', cadreId: 1 }, - { id: 84, name: 'KMA', cadreId: 1 }, - { id: 85, name: 'RTS', cadreId: 1 }, - { id: 86, name: 'SOI', cadreId: 1 }, - - // Headquarters and Command Units - { id: 87, name: 'HQ KA', cadreId: 1 }, - { id: 88, name: 'BORDER SEC COMD', cadreId: 1 }, - { id: 89, name: 'KOFC HQS', cadreId: 1 }, - { id: 90, name: 'NDC', cadreId: 1 }, - { id: 91, name: 'IPSTC', cadreId: 1 }, - { id: 92, name: 'JWC', cadreId: 1 }, - ], -}; - -export default militaryData; diff --git a/yarn.lock b/yarn.lock index 569300c58a..4242e0d9b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2853,23 +2853,6 @@ __metadata: languageName: node linkType: hard -"@openmrs/esm-active-visits-app@workspace:packages/esm-active-visits-app": - version: 0.0.0-use.local - resolution: "@openmrs/esm-active-visits-app@workspace:packages/esm-active-visits-app" - dependencies: - "@carbon/react": "npm:~1.37.0" - lodash-es: "npm:^4.17.15" - webpack: "npm:^5.74.0" - peerDependencies: - "@openmrs/esm-framework": 5.x - dayjs: 1.x - react: ^18.1.0 - react-dom: ^18.1.0 - react-i18next: 11.x - swr: 2.x - languageName: unknown - linkType: soft - "@openmrs/esm-api@npm:5.8.2-pre.2420": version: 5.8.2-pre.2420 resolution: "@openmrs/esm-api@npm:5.8.2-pre.2420" @@ -2920,42 +2903,6 @@ __metadata: languageName: node linkType: hard -"@openmrs/esm-appointments-app@workspace:packages/esm-appointments-app": - version: 0.0.0-use.local - resolution: "@openmrs/esm-appointments-app@workspace:packages/esm-appointments-app" - dependencies: - "@carbon/react": "npm:~1.37.0" - formik: "npm:^2.2.9" - lodash-es: "npm:^4.17.15" - webpack: "npm:^5.74.0" - yup: "npm:^0.32.11" - peerDependencies: - "@openmrs/esm-framework": 5.x - "@openmrs/esm-patient-common-lib": 8.x - react: 18.x - react-i18next: 11.x - react-router-dom: 6.x - swr: 2.x - languageName: unknown - linkType: soft - -"@openmrs/esm-bed-management-app@workspace:packages/esm-bed-management-app": - version: 0.0.0-use.local - resolution: "@openmrs/esm-bed-management-app@workspace:packages/esm-bed-management-app" - dependencies: - "@carbon/react": "npm:~1.37.0" - lodash-es: "npm:^4.17.15" - webpack: "npm:^5.74.0" - peerDependencies: - "@openmrs/esm-framework": 5.x - dayjs: 1.x - react: 18.x - react-i18next: 11.x - react-router-dom: 6.x - swr: 2.x - languageName: unknown - linkType: soft - "@openmrs/esm-config@npm:5.8.2-pre.2420": version: 5.8.2-pre.2420 resolution: "@openmrs/esm-config@npm:5.8.2-pre.2420" @@ -3203,22 +3150,6 @@ __metadata: languageName: unknown linkType: soft -"@openmrs/esm-patient-search-app@workspace:packages/esm-patient-search-app": - version: 0.0.0-use.local - resolution: "@openmrs/esm-patient-search-app@workspace:packages/esm-patient-search-app" - dependencies: - "@carbon/react": "npm:~1.37.0" - lodash-es: "npm:^4.17.15" - webpack: "npm:^5.74.0" - peerDependencies: - "@openmrs/esm-framework": 5.x - react: ^18.1.0 - react-i18next: 11.x - react-router-dom: 6.x - swr: 2.x - languageName: unknown - linkType: soft - "@openmrs/esm-react-utils@npm:5.8.2-pre.2420": version: 5.8.2-pre.2420 resolution: "@openmrs/esm-react-utils@npm:5.8.2-pre.2420" @@ -3261,22 +3192,6 @@ __metadata: languageName: node linkType: hard -"@openmrs/esm-service-queues-app@workspace:packages/esm-service-queues-app": - version: 0.0.0-use.local - resolution: "@openmrs/esm-service-queues-app@workspace:packages/esm-service-queues-app" - dependencies: - "@carbon/react": "npm:~1.37.0" - lodash-es: "npm:^4.17.15" - webpack: "npm:^5.74.0" - peerDependencies: - "@openmrs/esm-framework": 5.x - react: ^18.1.0 - react-i18next: 11.x - react-router-dom: 6.x - swr: 2.x - languageName: unknown - linkType: soft - "@openmrs/esm-state@npm:5.8.2-pre.2420": version: 5.8.2-pre.2420 resolution: "@openmrs/esm-state@npm:5.8.2-pre.2420" @@ -3346,22 +3261,6 @@ __metadata: languageName: node linkType: hard -"@openmrs/esm-ward-app@workspace:packages/esm-ward-app": - version: 0.0.0-use.local - resolution: "@openmrs/esm-ward-app@workspace:packages/esm-ward-app" - dependencies: - "@carbon/react": "npm:~1.37.0" - lodash-es: "npm:^4.17.15" - webpack: "npm:^5.74.0" - peerDependencies: - "@openmrs/esm-framework": 5.x - react: ^18.1.0 - react-i18next: 11.x - react-router-dom: 6.x - swr: 2.x - languageName: unknown - linkType: soft - "@openmrs/webpack-config@npm:5.8.2-pre.2420": version: 5.8.2-pre.2420 resolution: "@openmrs/webpack-config@npm:5.8.2-pre.2420"