Skip to content

Commit

Permalink
fix error: no key for repeating elements; fix i18n's; fix missing val…
Browse files Browse the repository at this point in the history
…ues in handleSubmit
  • Loading branch information
rithviknishad committed Sep 13, 2024
1 parent dcce340 commit ba1cc23
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Components/LogUpdate/Sections/NursingCare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => {
<table className="mb-8 w-full border-collapse">
<tbody>
{nursing.map((obj) => (
<tr>
<tr key={obj.procedure}>
<td className="whitespace-nowrap border border-secondary-400 p-2 pr-16 text-left text-sm font-semibold">
{t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)}
</td>
Expand Down
40 changes: 25 additions & 15 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,17 @@ export const DailyRounds = (props: any) => {
rhythm_detail: state.form.rhythm_detail,
ventilator_spo2: state.form.ventilator_spo2 ?? null,
consciousness_level: state.form.consciousness_level || undefined,
bowel_difficulty: state.form.bowel_difficulty ?? null,
bladder_drainage: state.form.bladder_drainage ?? null,
bladder_issue: state.form.bladder_issue ?? null,
is_experiencing_dysuria: state.form.is_experiencing_dysuria ?? null,
urination_frequency: state.form.urination_frequency ?? null,
sleep: state.form.sleep ?? null,
nutrition_route: state.form.nutrition_route ?? null,
oral_issue: state.form.oral_issue ?? null,
appetite: state.form.appetite ?? null,
bowel_difficulty: state.form.bowel_difficulty,
bladder_drainage: state.form.bladder_drainage,
bladder_issue: state.form.bladder_issue,
is_experiencing_dysuria: state.form.is_experiencing_dysuria,
urination_frequency: state.form.urination_frequency,
sleep: state.form.sleep,
nutrition_route: state.form.nutrition_route,
oral_issue: state.form.oral_issue,
appetite: state.form.appetite,
blood_sugar_level: state.form.blood_sugar_level,
nursing: state.form.nursing,
};
}

Expand Down Expand Up @@ -403,10 +405,16 @@ export const DailyRounds = (props: any) => {
if (obj) {
dispatch({ type: "set_form", form: initForm });
Notification.Success({
msg: `${t(state.form.rounds_type)} log created successfully`,
msg: t("LOG_UPDATE_CREATED_NOTIFICATION", {
roundType: t(`ROUNDS_TYPE__${state.form.rounds_type}`),
}),
});

if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
if (
["NORMAL", "TELEMEDICINE", "COMMUNITY_NURSES_LOG"].includes(
state.form.rounds_type,
)
) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
Expand Down Expand Up @@ -489,7 +497,11 @@ export const DailyRounds = (props: any) => {
return false;
}

if (["VENTILATOR", "DOCTORS_LOG"].includes(state.form.rounds_type)) {
if (
["VENTILATOR", "DOCTORS_LOG", "COMMUNITY_NURSES_LOG"].includes(
state.form.rounds_type,
)
) {
return false;
}

Expand Down Expand Up @@ -672,9 +684,7 @@ export const DailyRounds = (props: any) => {
{...selectField("bladder_issue", BLADDER_ISSUE_CHOICES)}
/>
<SelectFormField
name="is_experiencing_dysuria"
label="Experiences Dysuria?"
onChange={handleFormFieldChange}
{...field("is_experiencing_dysuria")}
options={[true, false]}
optionLabel={(c) => (c ? "Yes" : "No")}
/>
Expand Down
8 changes: 5 additions & 3 deletions src/Locale/en/LogUpdate.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"LOG_UPDATE_CREATED_NOTIFICATION": "{{ roundType }} created successfully",
"LOG_UPDATE_FIELD_LABEL__rounds_type": "Rounds Type",
"LOG_UPDATE_FIELD_LABEL__consciousness_level": "Level Of Consciousness",
"LOG_UPDATE_FIELD_LABEL__consciousness_level": "Level of Consciousness",
"LOG_UPDATE_FIELD_LABEL__sleep": "Sleep",
"LOG_UPDATE_FIELD_LABEL__bowel_difficulty": "Bowel",
"LOG_UPDATE_FIELD_LABEL__bladder_drainage": "Bladder Drainage",
"LOG_UPDATE_FIELD_LABEL__bladder_issue": "Bladder Issues",
"LOG_UPDATE_FIELD_LABEL__is_experiencing_dysuria": "Experiences Dysuria?",
"LOG_UPDATE_FIELD_LABEL__urination_frequency": "Frequency of Urination",
"LOG_UPDATE_FIELD_LABEL__nutrition_route": "Nutrition Route",
"LOG_UPDATE_FIELD_LABEL__oral_issue": "Oral issues",
Expand All @@ -13,7 +15,7 @@
"ROUNDS_TYPE__COMMUNITY_NURSES_LOG": "Community Nurse's Log",
"ROUNDS_TYPE__VENTILATOR": "Detailed Update",
"ROUNDS_TYPE__DOCTORS_LOG": "Progress Note",
"ROUNDS_TYPE__AUTOMATED": "Automated",
"ROUNDS_TYPE__AUTOMATED": "Virtual Nursing Assistant",
"RESPIRATORY_SUPPORT_SHORT__UNKNOWN": "None",
"RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O2 Support",
"RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE": "NIV",
Expand Down Expand Up @@ -61,7 +63,7 @@
"NUTRITION_ROUTE__GASTROSTOMY_OR_JEJUNOSTOMY": "Gastrostomy/Jejunostomy",
"NUTRITION_ROUTE__PEG": "PEG",
"NUTRITION_ROUTE__PARENTERAL_TUBING_FLUID": "Parenteral Tubing (Fluid)",
"NUTRITION_ROUTE___TPN": "Parenteral Tubing (TPN)",
"NUTRITION_ROUTE__PARENTERAL_TUBING_TPN": "Parenteral Tubing (TPN)",
"ORAL_ISSUE__NO_ISSUE": "No issues",
"ORAL_ISSUE__DYSPHAGIA": "Dysphagia",
"ORAL_ISSUE__ODYNOPHAGIA": "Odynophagia",
Expand Down

0 comments on commit ba1cc23

Please sign in to comment.