|
| 1 | +import { |
| 2 | + FORM_DATA_SELECT, |
| 3 | + FORM_DATA_SEARCHBOX, |
| 4 | + Disease, |
| 5 | + FORM_DATA_DATE, |
| 6 | + DateFilterOptions, |
| 7 | +} from '../../app.constants'; |
| 8 | +import { FormGroupStyleType } from '../../_models/common'; |
| 9 | + |
| 10 | +import { EnumToKeyValuePipe } from '../../_pipes/enum-to-key-value/enum-to-key-value.pipe'; |
| 11 | + |
| 12 | +const pipe = new EnumToKeyValuePipe(); |
| 13 | + |
| 14 | +const diseaseOptions = pipe.transform(Disease); |
| 15 | +const dateFilterOptions = pipe.transform(DateFilterOptions); |
| 16 | + |
| 17 | +export const FORM_DATA_IMMUNIZATION_FILTERS = [ |
| 18 | + { |
| 19 | + id: 'search', |
| 20 | + title: '', |
| 21 | + appearance: FormGroupStyleType.BASIC, |
| 22 | + fields: [ |
| 23 | + { |
| 24 | + ...FORM_DATA_SEARCHBOX, |
| 25 | + key: 'immunizationLike', |
| 26 | + placeholder: 'strings.promptCampaignSearch', |
| 27 | + className: 'fullwidth', |
| 28 | + }, |
| 29 | + ], |
| 30 | + }, |
| 31 | + { |
| 32 | + id: 'birthdate', |
| 33 | + title: 'headingBirthdate', |
| 34 | + appearance: FormGroupStyleType.COLLAPSABLE, |
| 35 | + fields: [ |
| 36 | + { |
| 37 | + ...FORM_DATA_SELECT, |
| 38 | + key: 'birthdateYYYY', |
| 39 | + options: [], |
| 40 | + placeholder: 'captions.Person.birthdateYYYY', |
| 41 | + className: 'fullwidth', |
| 42 | + }, |
| 43 | + { |
| 44 | + ...FORM_DATA_SELECT, |
| 45 | + key: 'birthdateMM', |
| 46 | + options: [], |
| 47 | + placeholder: 'captions.Person.birthdateMM', |
| 48 | + className: 'fullwidth', |
| 49 | + }, |
| 50 | + { |
| 51 | + ...FORM_DATA_SELECT, |
| 52 | + key: 'birthdateDD', |
| 53 | + options: [], |
| 54 | + placeholder: 'captions.Person.birthdateDD', |
| 55 | + className: 'fullwidth', |
| 56 | + }, |
| 57 | + ], |
| 58 | + }, |
| 59 | + { |
| 60 | + id: 'medicalAspect', |
| 61 | + title: 'headingMedicalAspects', |
| 62 | + appearance: FormGroupStyleType.COLLAPSABLE, |
| 63 | + fields: [ |
| 64 | + { |
| 65 | + ...FORM_DATA_SELECT, |
| 66 | + key: 'disease', |
| 67 | + placeholder: 'captions.disease', |
| 68 | + options: diseaseOptions, |
| 69 | + className: 'fullwidth', |
| 70 | + }, |
| 71 | + ], |
| 72 | + }, |
| 73 | + { |
| 74 | + id: 'adminAspect', |
| 75 | + title: 'headingAdminAspect', |
| 76 | + appearance: FormGroupStyleType.COLLAPSABLE, |
| 77 | + fields: [ |
| 78 | + { |
| 79 | + ...FORM_DATA_SELECT, |
| 80 | + key: 'region.uuid', |
| 81 | + options: [], |
| 82 | + service: 'regionService', |
| 83 | + placeholder: 'strings.entityRegion', |
| 84 | + className: 'fullwidth', |
| 85 | + }, |
| 86 | + { |
| 87 | + ...FORM_DATA_SELECT, |
| 88 | + key: 'district.uuid', |
| 89 | + options: [], |
| 90 | + service: 'districtService', |
| 91 | + determinedBy: 'region.uuid', |
| 92 | + placeholder: 'strings.entityDistricts', |
| 93 | + className: 'fullwidth', |
| 94 | + }, |
| 95 | + { |
| 96 | + ...FORM_DATA_SELECT, |
| 97 | + key: 'community.uuid', |
| 98 | + options: [], |
| 99 | + service: 'communityService', |
| 100 | + determinedBy: 'district.uuid', |
| 101 | + placeholder: 'strings.entityCommunities', |
| 102 | + className: 'fullwidth', |
| 103 | + }, |
| 104 | + ], |
| 105 | + }, |
| 106 | + { |
| 107 | + id: 'facility', |
| 108 | + title: 'captions.facility', |
| 109 | + appearance: FormGroupStyleType.COLLAPSABLE, |
| 110 | + fields: [ |
| 111 | + { |
| 112 | + ...FORM_DATA_SELECT, |
| 113 | + key: 'facilityTypeGroup', |
| 114 | + placeholder: 'captions.facilityTypeGroup', |
| 115 | + options: [], |
| 116 | + className: 'fullwidth', |
| 117 | + }, |
| 118 | + { |
| 119 | + ...FORM_DATA_SELECT, |
| 120 | + key: 'facilityType', |
| 121 | + placeholder: 'captions.CaseData.facilityType', |
| 122 | + options: [], |
| 123 | + className: 'fullwidth', |
| 124 | + }, |
| 125 | + { |
| 126 | + ...FORM_DATA_SELECT, |
| 127 | + key: 'healthFacility', |
| 128 | + placeholder: 'captions.facility', |
| 129 | + options: [], |
| 130 | + className: 'fullwidth', |
| 131 | + }, |
| 132 | + ], |
| 133 | + }, |
| 134 | + { |
| 135 | + id: 'date', |
| 136 | + title: 'headingDateFilter', |
| 137 | + appearance: FormGroupStyleType.COLLAPSABLE, |
| 138 | + fields: [ |
| 139 | + { |
| 140 | + ...FORM_DATA_SELECT, |
| 141 | + key: 'dateFilterOption', |
| 142 | + options: dateFilterOptions, |
| 143 | + value: 'DATE', |
| 144 | + className: 'fullwidth', |
| 145 | + }, |
| 146 | + { |
| 147 | + ...FORM_DATA_DATE, |
| 148 | + key: 'newImmunizationDateFrom', |
| 149 | + hint: 'strings.date', |
| 150 | + className: 'fullwidth', |
| 151 | + }, |
| 152 | + { |
| 153 | + ...FORM_DATA_DATE, |
| 154 | + key: 'newImmunizationDateTo', |
| 155 | + hint: 'strings.date.to', |
| 156 | + className: 'fullwidth', |
| 157 | + }, |
| 158 | + ], |
| 159 | + }, |
| 160 | +]; |
0 commit comments