Skip to content

Commit

Permalink
Add consultation_filed filter to Patients list
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 committed Dec 28, 2023
1 parent 988e383 commit 3f46bef
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const PatientManager = () => {
const [districtName, setDistrictName] = useState("");
const [localbodyName, setLocalbodyName] = useState("");
const [facilityBadgeName, setFacilityBadge] = useState("");
const [consultationFiledBadgeName, setConsultationFiledBadge] = useState("");
const [locationBadgeName, setLocationBadge] = useState("");
const [phone_number, setPhoneNumber] = useState("");
const [phoneNumberError, setPhoneNumberError] = useState("");
Expand Down Expand Up @@ -194,6 +195,7 @@ export const PatientManager = () => {
date_of_result_after: qParams.date_of_result_after || undefined,
last_consultation_medico_legal_case:
qParams.last_consultation_medico_legal_case || undefined,
consultation_filed: qParams.consultation_filed || undefined,
last_consultation_encounter_date_before:
qParams.last_consultation_encounter_date_before || undefined,
last_consultation_encounter_date_after:
Expand Down Expand Up @@ -386,10 +388,21 @@ export const PatientManager = () => {
qParams.last_vaccinated_date_before,
qParams.last_vaccinated_date_after,
qParams.last_consultation_is_telemedicine,
qParams.consultation_filed,
qParams.is_antenatal,
qParams.ventilator_interface,
]);

useEffect(() => {
if (qParams.consultation_filed != null) {
setConsultationFiledBadge(
qParams.consultation_filed === "true" ? "Filed" : "Not Filed"
);
} else {
setConsultationFiledBadge("");
}
}, [qParams.consultation_filed]);

const getTheCategoryFromId = () => {
let category_name;
if (qParams.category) {
Expand Down Expand Up @@ -978,6 +991,11 @@ export const PatientManager = () => {
"Is Medico-Legal Case",
"last_consultation_medico_legal_case"
),
value(
"Consultation Status",
"consultation_filed",
consultationFiledBadgeName
),
value("Facility", "facility", facilityBadgeName),
value(
"Location",
Expand Down
21 changes: 21 additions & 0 deletions src/Components/Patient/PatientFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default function PatientFilter(props: any) {
last_vaccinated_date_after: filter.last_vaccinated_date_after || null,
last_consultation_is_telemedicine:
filter.last_consultation_is_telemedicine || null,
consultation_filed: filter.consultation_filed || null,
is_antenatal: filter.is_antenatal || null,
ventilator_interface: filter.ventilator_interface || null,
});
Expand Down Expand Up @@ -131,6 +132,7 @@ export default function PatientFilter(props: any) {
last_consultation_discharge_date_after: "",
last_consultation_admitted_to_list: [],
last_consultation_current_bed__location: "",
consultation_filed: null,
srf_id: "",
number_of_doses: null,
covin_id: "",
Expand Down Expand Up @@ -253,6 +255,7 @@ export default function PatientFilter(props: any) {
last_vaccinated_date_before,
last_vaccinated_date_after,
last_consultation_is_telemedicine,
consultation_filed,
is_antenatal,
ventilator_interface,
} = filterState;
Expand Down Expand Up @@ -315,6 +318,7 @@ export default function PatientFilter(props: any) {
last_vaccinated_date_after: dateQueryString(last_vaccinated_date_after),
last_consultation_is_telemedicine:
last_consultation_is_telemedicine || "",
consultation_filed: consultation_filed || "",
is_antenatal: is_antenatal || "",
ventilator_interface: ventilator_interface || "",
};
Expand Down Expand Up @@ -501,6 +505,23 @@ export default function PatientFilter(props: any) {
}
/>
</div>
<div className="w-full flex-none">
<FieldLabel className="text-sm">Consultation Status</FieldLabel>
<SelectMenuV2
placeholder="Show all"
options={["true", "false"]}
optionLabel={(o) =>
o === "true" ? "Consultation Filed" : "No Consultation Filed"
}
value={filterState.consultation_filed}
onChange={(v) =>
setFilterState({
...filterState,
consultation_filed: v,
})
}
/>
</div>
</div>
</AccordionV2>
<AccordionV2
Expand Down

0 comments on commit 3f46bef

Please sign in to comment.