Skip to content

Commit

Permalink
Adds new set of nursing care procedures (#8568)
Browse files Browse the repository at this point in the history
* Add new set of procedures

* adds missing border when procedures are selected

* update labels
  • Loading branch information
rithviknishad authored Sep 19, 2024
1 parent b9afa4a commit af014a1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
15 changes: 15 additions & 0 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -735,19 +735,34 @@ export const HEARTBEAT_RHYTHM_CHOICES = [
] as const;

export const NURSING_CARE_PROCEDURES = [
"oral_care",
"hair_care",
"bed_bath",
"eye_care",
"perineal_care",
"skin_care",
"pre_enema",
"wound_dressing",
"lymphedema_care",
"ascitic_tapping",
"colostomy_care",
"colostomy_change",
"personal_hygiene",
"positioning",
"suctioning",
"ryles_tube_care",
"ryles_tube_change",
"iv_sitecare",
"nubulisation",
"dressing",
"dvt_pump_stocking",
"restrain",
"chest_tube_care",
"tracheostomy_care",
"tracheostomy_change",
"stoma_care",
"catheter_care",
"catheter_change",
] as const;

export const EYE_OPEN_SCALE = [
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Form/FormFields/AutocompleteMultiselect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type OptionCallback<T, R> = (option: T) => R;

type AutocompleteMultiSelectFormFieldProps<T, V> = FormFieldBaseProps<V[]> & {
placeholder?: string;
options: T[];
options: readonly T[];
optionLabel: OptionCallback<T, string>;
optionValue?: OptionCallback<T, V>;
optionDisabled?: OptionCallback<T, boolean>;
Expand Down Expand Up @@ -52,7 +52,7 @@ export default AutocompleteMultiSelectFormField;

type AutocompleteMutliSelectProps<T, V = T> = {
id?: string;
options: T[];
options: readonly T[];
disabled?: boolean | undefined;
value: V[];
placeholder?: string;
Expand Down
10 changes: 5 additions & 5 deletions src/Components/LogUpdate/Sections/NursingCare.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useTranslation } from "react-i18next";
import { NURSING_CARE_PROCEDURES } from "../../../Common/constants";
import { LogUpdateSectionMeta, LogUpdateSectionProps } from "../utils";
import { MultiSelectFormField } from "../../Form/FormFields/SelectFormField";
import AutoExpandingTextInputFormField from "../../Form/FormFields/AutoExpandingTextInputFormField";
import AutocompleteMultiSelectFormField from "../../Form/FormFields/AutocompleteMultiselect";

const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => {
const { t } = useTranslation();
const nursing = log.nursing || [];

return (
<div className="flex flex-col">
<MultiSelectFormField
<AutocompleteMultiSelectFormField
name="procedures"
placeholder={t("procedures_select_placeholder")}
value={nursing.map((p) => p.procedure)}
Expand All @@ -30,14 +30,14 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => {
errorClassName="hidden"
/>
{!!nursing.length && (
<table className="mb-8 w-full border-collapse">
<table className="mb-8 mt-2 w-full border-collapse">
<tbody>
{nursing.map((obj) => (
<tr key={obj.procedure}>
<td className="whitespace-nowrap border border-r-2 border-t-0 border-secondary-400 border-r-secondary-300 bg-secondary-50 p-2 pr-4 text-left text-sm font-semibold md:pr-16">
<td className="whitespace-nowrap border border-r-2 border-secondary-400 border-r-secondary-300 bg-secondary-50 p-2 pr-4 text-left text-sm font-semibold md:pr-16">
{t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)}
</td>
<td className="w-full border border-t-0 border-secondary-400">
<td className="w-full border border-secondary-400">
<AutoExpandingTextInputFormField
innerClassName="border-none rounded-none"
name={`${obj.procedure}__description`}
Expand Down
19 changes: 17 additions & 2 deletions src/Locale/en/LogUpdate.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,34 @@
"INSULIN_INTAKE_FREQUENCY__OD": "Once a day (OD)",
"INSULIN_INTAKE_FREQUENCY__BD": "Twice a day (BD)",
"INSULIN_INTAKE_FREQUENCY__TD": "Thrice a day (TD)",
"NURSING_CARE_PROCEDURE__personal_hygiene": "Personal Hygiene",
"NURSING_CARE_PROCEDURE__oral_care": "Oral Care",
"NURSING_CARE_PROCEDURE__hair_care": "Hair Care",
"NURSING_CARE_PROCEDURE__bed_bath": "Bed Bath",
"NURSING_CARE_PROCEDURE__eye_care": "Eye Care",
"NURSING_CARE_PROCEDURE__perineal_care": "Perineal Care",
"NURSING_CARE_PROCEDURE__skin_care": "Skin Care",
"NURSING_CARE_PROCEDURE__pre_enema": "P.R.E. Enema",
"NURSING_CARE_PROCEDURE__wound_dressing": "Wound Dressing",
"NURSING_CARE_PROCEDURE__lymphedema_care": "Lymphedema Care",
"NURSING_CARE_PROCEDURE__ascitic_tapping": "Ascitic Tapping",
"NURSING_CARE_PROCEDURE__colostomy_care": "Colostomy Care",
"NURSING_CARE_PROCEDURE__colostomy_change": "Colostomy Change",
"NURSING_CARE_PROCEDURE__personal_hygiene": "Other Personal Hygiene",
"NURSING_CARE_PROCEDURE__positioning": "Positioning",
"NURSING_CARE_PROCEDURE__suctioning": "Suctioning",
"NURSING_CARE_PROCEDURE__ryles_tube_care": "Ryles Tube Care",
"NURSING_CARE_PROCEDURE__ryles_tube_care": "Ryle’s Tube Care",
"NURSING_CARE_PROCEDURE__ryles_tube_change": "Ryle’s Tube Change",
"NURSING_CARE_PROCEDURE__iv_sitecare": "IV Site Care",
"NURSING_CARE_PROCEDURE__nubulisation": "Nubulisation",
"NURSING_CARE_PROCEDURE__dressing": "Dressing",
"NURSING_CARE_PROCEDURE__dvt_pump_stocking": "DVT Pump Stocking",
"NURSING_CARE_PROCEDURE__restrain": "Restrain",
"NURSING_CARE_PROCEDURE__chest_tube_care": "Chest Tube Care",
"NURSING_CARE_PROCEDURE__tracheostomy_care": "Tracheostomy Care",
"NURSING_CARE_PROCEDURE__tracheostomy_change": "Tracheostomy change ",
"NURSING_CARE_PROCEDURE__stoma_care": "Stoma Care",
"NURSING_CARE_PROCEDURE__catheter_care": "Catheter Care",
"NURSING_CARE_PROCEDURE__catheter_change": "Catheter Change",
"HEARTBEAT_RHYTHM__REGULAR": "Regular",
"HEARTBEAT_RHYTHM__IRREGULAR": "Irregular",
"HEARTBEAT_RHYTHM__UNKNOWN": "Unknown",
Expand Down

0 comments on commit af014a1

Please sign in to comment.