-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into rithviknishad/improve-live-feed
- Loading branch information
Showing
25 changed files
with
575 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
District,srf id,name,age,age in,gender,mobile number,address,ward,local body,local body type,source,Sample Collection Date,result date,test type,lab name,sample type,patient status,Is Repeat,patient category,result | ||
Ernakulam,00/EKM/0000,Bodhi CSN,24,years,m,8888888888,"CSN HQ | ||
Kochi, Kerala ",7,Poothrikka,grama panchayath,Secondary contact aparna,2020-10-14,2020-10-14,Antigen,Karothukuzhi Laboratory,Ag-SD_Biosensor_Standard_Q_COVID-19_Ag_detection_kit,Asymptomatic,NO,Cat 17: All individuals who wish to get themselves tested,Negative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
src/Components/Facility/Consultations/DailyRoundsFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import { Popover, Transition } from "@headlessui/react"; | ||
import ButtonV2 from "../../Common/components/ButtonV2"; | ||
import { Fragment } from "react"; | ||
import { SelectFormField } from "../../Form/FormFields/SelectFormField"; | ||
import TextFormField from "../../Form/FormFields/TextFormField"; | ||
import CareIcon from "../../../CAREUI/icons/CareIcon"; | ||
import dayjs from "dayjs"; | ||
import { useState } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { DailyRoundTypes, DailyRoundsModel } from "../../Patient/models"; | ||
import { FieldChangeEvent } from "../../Form/FormFields/Utils"; | ||
|
||
type FilterState = { | ||
rounds_type?: DailyRoundsModel["rounds_type"]; | ||
taken_at_after?: string; | ||
taken_at_before?: string; | ||
}; | ||
|
||
interface Props { | ||
onApply: (filter: FilterState) => void; | ||
} | ||
|
||
export default function DailyRoundsFilter(props: Props) { | ||
const { t } = useTranslation(); | ||
const [filter, setFilter] = useState<FilterState>({}); | ||
|
||
const field = (name: keyof FilterState) => ({ | ||
name, | ||
value: filter[name], | ||
onChange: (e: FieldChangeEvent<unknown>) => | ||
setFilter({ ...filter, [e.name]: e.value }), | ||
labelClassName: "text-sm", | ||
errorClassName: "hidden", | ||
}); | ||
|
||
return ( | ||
<div className="flex flex-row-reverse items-center gap-4 md:flex-row"> | ||
<Popover className="relative "> | ||
<Popover.Button> | ||
<ButtonV2 variant="secondary" className="mr-5 border"> | ||
<CareIcon className="care-l-filter" /> | ||
{t("filter")} | ||
</ButtonV2> | ||
</Popover.Button> | ||
<Transition | ||
as={Fragment} | ||
enter="transition ease-out duration-200" | ||
enterFrom="opacity-0 translate-y-1" | ||
enterTo="opacity-100 translate-y-0" | ||
leave="transition ease-in duration-150" | ||
leaveFrom="opacity-100 translate-y-0" | ||
leaveTo="opacity-0 translate-y-1" | ||
> | ||
<Popover.Panel className="absolute right-0 z-30 mt-1 w-80 px-4 sm:px-0 md:w-96 lg:max-w-3xl"> | ||
<div className="rounded-lg shadow-lg ring-1 ring-gray-400"> | ||
<div className="rounded-t-lg bg-gray-100 px-6 py-4"> | ||
<div className="flow-root rounded-md"> | ||
<span className="block text-sm text-gray-800"> | ||
{t("filter_by")} | ||
</span> | ||
</div> | ||
</div> | ||
<div className="relative flex flex-col gap-4 rounded-b-lg bg-white p-6"> | ||
<SelectFormField | ||
{...field("rounds_type")} | ||
label={t("Round Type")} | ||
options={DailyRoundTypes} | ||
placeholder={t("show_all")} | ||
optionLabel={(o) => t(o)} | ||
optionValue={(o) => o} | ||
/> | ||
<TextFormField | ||
{...field("taken_at_after")} | ||
label="Measured after" | ||
type="datetime-local" | ||
max={dayjs().format("YYYY-MM-DDTHH:mm")} | ||
/> | ||
<TextFormField | ||
{...field("taken_at_before")} | ||
label="Measured before" | ||
type="datetime-local" | ||
max={dayjs().format("YYYY-MM-DDTHH:mm")} | ||
/> | ||
|
||
<Popover.Button> | ||
<ButtonV2 | ||
variant="secondary" | ||
onClick={() => { | ||
setFilter({}); | ||
props.onApply({}); | ||
}} | ||
border | ||
className="w-full" | ||
> | ||
{t("clear")} | ||
</ButtonV2> | ||
</Popover.Button> | ||
<Popover.Button> | ||
<ButtonV2 | ||
variant="primary" | ||
onClick={() => props.onApply(filter)} | ||
border | ||
className="w-full" | ||
> | ||
{t("apply")} | ||
</ButtonV2> | ||
</Popover.Button> | ||
</div> | ||
</div> | ||
</Popover.Panel> | ||
</Transition> | ||
</Popover> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.