Skip to content

Commit

Permalink
added facility_type filter in Patients (#1759)
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar authored Aug 23, 2021
1 parent 726064d commit 4514368
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const PatientManager = (props: any) => {
: undefined,
local_body: qParams.lsgBody || undefined,
facility: facilityId || qParams.facility,
facility_type: qParams.facility_type || undefined,
district: qParams.district || undefined,
offset: (qParams.page ? qParams.page - 1 : 0) * RESULT_LIMIT,
created_date_before: qParams.created_date_before || undefined,
Expand Down Expand Up @@ -226,6 +227,7 @@ export const PatientManager = (props: any) => {
qParams.age_min,
qParams.last_consultation_admitted_to_list,
qParams.facility,
qParams.facility_type,
qParams.district,
qParams.category,
qParams.gender,
Expand Down Expand Up @@ -746,6 +748,7 @@ export const PatientManager = (props: any) => {
{badge("COWIN ID", qParams.covin_id, "covin_id")}

{badge("Facility", facilityName, "facility")}
{badge("Facility Type", qParams.facility_type, "facility_type")}
{badge("District", districtName, "district")}
{badge("Ordering", qParams.ordering, "ordering")}
{badge("Category", qParams.category, "category")}
Expand Down
20 changes: 20 additions & 0 deletions src/Components/Patient/PatientFilterV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import {
PATIENT_FILTER_ORDER,
GENDER_TYPES,
FACILITY_TYPES,
DISEASE_STATUS,
PATIENT_FILTER_CATEGORY,
PATIENT_FILTER_ADMITTED_TO,
Expand Down Expand Up @@ -51,6 +52,7 @@ export default function PatientFilterV2(props: any) {
const [filterState, setFilterState] = useMergeState({
district: filter.district || "",
facility: filter.facility || "",
facility_type: filter.facility_type || "",
lsgBody: filter.lsgBody || "",
facility_ref: null,
lsgBody_ref: null,
Expand Down Expand Up @@ -102,6 +104,7 @@ export default function PatientFilterV2(props: any) {
const clearFilterState = {
district: "",
facility: "",
facility_type: "",
lsgBody: "",
facility_ref: null,
lsgBody_ref: null,
Expand Down Expand Up @@ -248,6 +251,7 @@ export default function PatientFilterV2(props: any) {
const {
district,
facility,
facility_type,
lsgBody,
date_declared_positive_before,
date_declared_positive_after,
Expand Down Expand Up @@ -284,6 +288,7 @@ export default function PatientFilterV2(props: any) {
district: district || "",
lsgBody: lsgBody || "",
facility: facility || "",
facility_type: facility_type || "",
date_declared_positive_before:
date_declared_positive_before &&
moment(date_declared_positive_before).isValid()
Expand Down Expand Up @@ -489,6 +494,21 @@ export default function PatientFilterV2(props: any) {
errors={""}
/>
</div>

<div className="w-64 flex-none">
<span className="text-sm font-semibold">Facility type</span>
<SelectField
name="facility_type"
variant="outlined"
margin="dense"
value={filterState.facility_type}
options={[{ id: "", text: "Show All" }, ...FACILITY_TYPES]}
optionKey="text"
onChange={handleChange}
className="bg-white h-10 shadow-sm md:text-sm md:leading-5 md:h-9"
/>
</div>

<div className="w-64 flex-none">
<span className="text-sm font-semibold">Gender</span>
<SelectField
Expand Down

0 comments on commit 4514368

Please sign in to comment.