Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download Discharge Summary, Medicine Administration Records and upgraded Prescriptions #5458

Merged
merged 55 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
fd0e29f
Adds new prescription API routes and actions
rithviknishad May 3, 2023
225056d
Copy most of the diffs from #5317
rithviknishad May 3, 2023
ddaf7ca
fix issues when creating new consultation
rithviknishad May 3, 2023
0ac9978
Merge branch 'develop' into med-admin-record-v2
rithviknishad May 3, 2023
1211b78
Merge branch 'develop' into med-admin-record-v2
rithviknishad May 5, 2023
3ebf2fb
update API and actions
rithviknishad May 5, 2023
d0f8321
revert changes in critical care IO Balance Editor
rithviknishad May 5, 2023
59aeb5a
define types
rithviknishad May 5, 2023
98131e9
fix typo
rithviknishad May 8, 2023
d3108a4
minor patches to `Form` HOC
rithviknishad May 9, 2023
fe84da8
revert changes in critical care
rithviknishad May 9, 2023
aa91674
so we no longer need upsert
rithviknishad May 9, 2023
ecfd7b7
`ResponsiveMedicineTable` to support custom actions
rithviknishad May 9, 2023
538b606
Adds `PrescriptionForm` component
rithviknishad May 9, 2023
67d2da5
Adds `PrescriptionDetailCard` component
rithviknishad May 9, 2023
4836c04
Adds `PrescriptionBuilder` component
rithviknishad May 9, 2023
3e14cd0
Adds `ManagePrescriptions` page route
rithviknishad May 9, 2023
0149cc5
Consultation Form: onSave navigate to manage prescriptions page if new
rithviknishad May 9, 2023
6fefd4e
this is not an atomic commit :/
rithviknishad May 9, 2023
1856a38
so now there's Administration History Table
rithviknishad May 9, 2023
fca5b5a
Merge branch 'develop' into med-admin-record-v2
rithviknishad May 9, 2023
8a80e76
lots of diff :/
rithviknishad May 9, 2023
dfd6705
so fixed the issue that caused not to work during weekly demo
rithviknishad May 9, 2023
407ff43
add units to dosage
rithviknishad May 10, 2023
d689ab4
Adds `NumericWithUnitsFormField`
rithviknishad May 10, 2023
d95a437
chore
rithviknishad May 10, 2023
9d7cfb8
discharge flow
rithviknishad May 10, 2023
9bb75be
disable buttons if discharged
rithviknishad May 10, 2023
203cae2
highlight if selected for discharge
rithviknishad May 10, 2023
42111c9
administer medicines per row
rithviknishad May 10, 2023
97e97a5
detailed view for row onclick
rithviknishad May 10, 2023
eaf811d
fix deploy fail
rithviknishad May 10, 2023
33c0356
fix numeric input alignment
rithviknishad May 10, 2023
97f536e
fix onrow click propogration
rithviknishad May 10, 2023
2b74091
fix responsiveness issue
rithviknishad May 10, 2023
6ba4332
fix responsiveness for medicine administrations
rithviknishad May 10, 2023
43586eb
fix table heading actions responsiveness
rithviknishad May 10, 2023
af81a5a
remove id from success notif
rithviknishad May 10, 2023
ce43c3d
add back button
rithviknishad May 10, 2023
f451f24
ux: warning and all changes saved
rithviknishad May 10, 2023
a166135
minor fix
rithviknishad May 10, 2023
950670f
minor responsive fix
rithviknishad May 10, 2023
898dca7
adds translations
rithviknishad May 11, 2023
81be01a
fix responsiveness issues
rithviknishad May 11, 2023
276f255
minor fix: translation key and notes col. missing
rithviknishad May 11, 2023
cfe0a2a
fix responsiveness and filter regular prescriptions
rithviknishad May 12, 2023
f1a8043
fix table obj keys order
rithviknishad May 12, 2023
3f71f29
remove medicines from critical care
rithviknishad May 13, 2023
c6ff970
unmess
rithviknishad May 16, 2023
1b65d1a
reflact discharge prescriptions in sicharge summary
rithviknishad May 16, 2023
d97ca8f
some fixes during testing
rithviknishad May 17, 2023
df53be5
translations and other fixes
rithviknishad May 17, 2023
55082b1
Merge branch 'develop' into prescriptions-v2
rithviknishad May 17, 2023
45cccf4
Merge branch 'develop' into prescriptions-v2
nihal467 May 24, 2023
4a5bab4
fix casing for prescription frequency
rithviknishad May 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletions src/Components/Common/ConfirmDialogV2.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import DialogModal from "./Dialog";
import ButtonV2, { ButtonVariant, Cancel } from "./components/ButtonV2";
import { ButtonVariant, Cancel, Submit } from "./components/ButtonV2";

type ConfirmDialogV2Props = {
className?: string;
title: React.ReactNode;
description?: React.ReactNode;
disabled?: boolean;
show: boolean;
action: string;
action: React.ReactNode;
variant?: ButtonVariant;
onClose: () => void;
onConfirm: () => void;
Expand All @@ -15,34 +16,22 @@ type ConfirmDialogV2Props = {
};

const ConfirmDialogV2 = ({
title,
description,
show,
disabled,
variant,
action,
onClose,
onConfirm,
cancelLabel,
children,
...props
}: ConfirmDialogV2Props) => {
return (
<DialogModal
onClose={onClose}
title={title}
description={
<span className={`font-medium text-${variant || "secondary"}-600`}>
{description}
</span>
}
show={show}
>
<DialogModal {...props}>
{children}
<div className="mt-6 flex justify-end gap-2 w-full flex-col md:flex-row">
<Cancel onClick={onClose} label={cancelLabel} />
<ButtonV2 onClick={onConfirm} variant={variant} disabled={disabled}>
<Cancel onClick={props.onClose} label={cancelLabel} />
<Submit onClick={onConfirm} variant={variant} disabled={disabled}>
{action}
</ButtonV2>
</Submit>
</div>
</DialogModal>
);
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Common/PrescriptionBuilder.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let select = (setPrescription, prescription) => setPrescription(_ => prescription)

@react.component
export make = (~prescriptions, ~setPrescriptions) =>
@genType @react.component
let make = (~prescriptions, ~setPrescriptions) =>
<div> <Prescription__Builder prescriptions selectCB={select(setPrescriptions)} /> </div>
44 changes: 34 additions & 10 deletions src/Components/Common/components/ResponsiveMedicineTables.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useState } from "react";
import AccordionV2 from "./AccordionV2";
import { classNames } from "../../../Utils/utils";

function getWindowSize() {
const { innerWidth, innerHeight } = window;
Expand All @@ -11,6 +12,10 @@ export default function ResponsiveMedicineTable(props: {
list: Array<any>;
objectKeys: Array<string>;
fieldsToDisplay: Array<number>;
actions?: (item: any) => JSX.Element;
actionLabel?: string;
maxWidthColumn?: number;
onClick?: (item: any) => void;
}) {
const [windowSize, setWindowSize] = useState(getWindowSize());
useEffect(() => {
Expand All @@ -32,30 +37,49 @@ export default function ResponsiveMedicineTable(props: {
<tr>
{props.theads.map((item) => {
return (
<th className="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-800 uppercase tracking-wider">
<th className="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-800 uppercase tracking-wider whitespace-nowrap">
{item}
</th>
);
})}
{props.actions && (
<th className="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-800 uppercase tracking-wider">
{props.actionLabel || ""}
</th>
)}
</tr>
</thead>
<tbody>
{props.list?.map?.((med: any, index: number) => (
<tr className="bg-white" key={index}>
<tr
className={classNames(
"bg-white",
props.onClick && "hover:bg-gray-200 cursor-pointer"
)}
key={index}
onClick={() => props.onClick && props.onClick(med)}
>
{props.objectKeys.map((key, idx) => {
if (idx === 0)
if (
props.maxWidthColumn !== undefined &&
idx === props.maxWidthColumn
) {
return (
<td className="px-6 py-4 w-[450px] text-sm leading-5 font-medium text-gray-900">
{med[key]}
</td>
);
else
return (
<td className="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-900">
<td className="px-6 py-4 w-full text-sm leading-5 font-medium text-gray-900">
{med[key]}
</td>
);
}

return (
<td className="px-6 py-4 text-sm leading-5 text-gray-900">
{med[key]}
</td>
);
})}
{props.actions && (
<td className="px-6">{props.actions(med)}</td>
)}
</tr>
))}
</tbody>
Expand Down
Loading