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

A-1208409676255679 | Non Medication & Medication tasks not translated #246

Merged
merged 2 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 17 additions & 1 deletion public/i18n/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,21 @@
"SCHEDULE_TIME_LABEL": "Schedule Time",
"TREATMENTS_WARNING_TEXT": "You will lose the details entered. Do you want to continue?",
"SAVE": "Save",
"CANCEL": "Cancel"
"CANCEL": "Cancel",
"TASK_TILE_MORE": "more",
"NON_MEDICATION_TASK_COMPLETE_NURSING_INITIAL_ASSESSMENT_FORM": "Complete Nursing Initial Assessment Form",
"NON_MEDICATION_TASK_COMPLETE_NURSING_PHYSICAL_ASSESSMENT_FORM": "Complete Nursing Physical Assessment Form",
"NON_MEDICATION_TASK_CHECK_WARD_INSTRUCTIONS": "Check Ward Instructions",
"NON_MEDICATION_TASK_COMPLETE_FALL_RISK_ASSESSMENT_FORM": "Complete Fall Risk Assessment Form",
"NON_MEDICATION_TASK_COMPLETE_MULTIDISCIPLINARY_PATIENT__FAMILY_EDUCATION_RECORD_FORM": "Complete Multi-disciplinary Patient & Family Education Record form",
"NON_MEDICATION_TASK_CAPTURE_PATIENT_WEIGHT_ADMISSION": "Capture patient weight upon admission",
"NON_MEDICATION_TASK_COMPLETE_NURSING_CARE_PLAN": "Complete Nursing Care Plan",
"NON_MEDICATION_TASK_CAPTURE_VITAL_SIGNS": "Capture Vital Signs",
"NON_MEDICATION_TASK_COMPLETE_PATIENT_FEEDING_CHARTS": "Complete Patient Feeding Charts",
"NON_MEDICATION_TASK_CHECK_PROTOCOL_STEPS": "Check Protocol Steps",
"NON_MEDICATION_TASK_CAPTURE_PATIENT_WEIGHT_UPON_ADMISSION": "Capture patient weight upon admission",
"IPD_UNSKIP_TASK": "Unskip Task",
"IPD_SKIP_TASK": "Skip Task",
"IPD_UNSKIP_DRUG": "Unskip Drug",
"IPD_SKIP_DRUG": "Skip Drug"
}
3 changes: 2 additions & 1 deletion public/i18n/locale_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,6 @@
"SCHEDULE_TIME_LABEL": "Schedule Time",
"TREATMENTS_WARNING_TEXT": "You will lose the details entered. Do you want to continue?",
"SAVE": "Save",
"CANCEL": "Cancel"
"CANCEL": "Cancel",
"TASK_TILE_MORE": "más"
}
18 changes: 17 additions & 1 deletion public/i18n/locale_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,21 @@
"SCHEDULE_TIME_LABEL": "Heure programmée",
"TREATMENTS_WARNING_TEXT": "Vous perdrez les informations saisies. Voulez-vous continuer ?",
"SAVE": "Sauvegarder",
"CANCEL": "Annuler"
"CANCEL": "Annuler",
"TASK_TILE_MORE": "plus",
"NON_MEDICATION_TASK_COMPLETE_NURSING_INITIAL_ASSESSMENT_FORM": "Remplir le formulaire d'évaluation initiale des soins infirmiers",
"NON_MEDICATION_TASK_COMPLETE_NURSING_PHYSICAL_ASSESSMENT_FORM": "Remplir le formulaire d'évaluation physique des soins infirmiers",
"NON_MEDICATION_TASK_CHECK_WARD_INSTRUCTIONS": "Vérifier les instructions du service",
"NON_MEDICATION_TASK_COMPLETE_FALL_RISK_ASSESSMENT_FORM": "Remplir le formulaire d'évaluation du risque de chute",
"NON_MEDICATION_TASK_COMPLETE_MULTIDISCIPLINARY_PATIENT__FAMILY_EDUCATION_RECORD_FORM": "Remplir le formulaire de dossier éducatif multidisciplinaire du patient et de la famille",
"NON_MEDICATION_TASK_CAPTURE_PATIENT_WEIGHT_ADMISSION": "Saisir le poids du patient à l'admission",
"NON_MEDICATION_TASK_COMPLETE_NURSING_CARE_PLAN": "Terminé Plan de soins infirmiers",
"NON_MEDICATION_TASK_CAPTURE_VITAL_SIGNS": "Capturer les signes vitaux",
"NON_MEDICATION_TASK_COMPLETE_PATIENT_FEEDING_CHARTS": "Compléter les tableaux d'alimentation des patients",
"NON_MEDICATION_TASK_CHECK_PROTOCOL_STEPS": "Vérifier les étapes du protocole",
"NON_MEDICATION_TASK_CAPTURE_PATIENT_WEIGHT_UPON_ADMISSION": "Capturer le poids du patient à l'admission",
"IPD_UNSKIP_TASK": "Annuler l'ignorement de la tâche",
"IPD_SKIP_TASK": "Ignorer la tâche",
"IPD_UNSKIP_DRUG": "Annuler l'ignorement du médicament",
"IPD_SKIP_DRUG": "Ignorer le médicament"
}
3 changes: 2 additions & 1 deletion public/i18n/locale_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,6 @@
"SCHEDULE_TIME_LABEL": "Schedule Time",
"TREATMENTS_WARNING_TEXT": "You will lose the details entered. Do you want to continue?",
"SAVE": "Save",
"CANCEL": "Cancel"
"CANCEL": "Cancel",
"TASK_TILE_MORE": "more"
}
13 changes: 12 additions & 1 deletion public/i18n/locale_pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,16 @@
"SCHEDULE_TIME_LABEL": "Schedule Time",
"TREATMENTS_WARNING_TEXT": "You will lose the details entered. Do you want to continue?",
"SAVE": "Save",
"CANCEL": "Cancel"
"CANCEL": "Cancel",
"TASK_TILE_MORE": "mais",
"NON_MEDICATION_TASK_COMPLETE_NURSING_INITIAL_ASSESSMENT_FORM": "Formulário de Avaliação Inicial de Enfermagem Completo",
"NON_MEDICATION_TASK_COMPLETE_NURSING_PHYSICAL_ASSESSMENT_FORM": "Formulário de Avaliação Física de Enfermagem Completo",
"NON_MEDICATION_TASK_CHECK_WARD_INSTRUCTIONS": "Verificar Instruções da Enfermaria",
"NON_MEDICATION_TASK_COMPLETE_FALL_RISK_ASSESSMENT_FORM": "Formulário de Avaliação de Risco de Queda Completo",
"NON_MEDICATION_TASK_COMPLETE_MULTIDISCIPLINARY_PATIENT__FAMILY_EDUCATION_RECORD_FORM": "Formulário de Registro de Educação Multidisciplinar de Pacientes e Família Completo",
"NON_MEDICATION_TASK_CAPTURE_PATIENT_WEIGHT_ADMISSION": "Capturar peso do paciente na admissão",
"NON_MEDICATION_TASK_COMPLETE_NURSING_CARE_PLAN": "Plano de Cuidados de Enfermagem Completo",
"NON_MEDICATION_TASK_CAPTURE_VITAL_SIGNS": "Capturar Sinais Vitais",
"NON_MEDICATION_TASK_COMPLETE_PATIENT_FEEDING_CHARTS": "Gráficos Completos de Alimentação do Paciente",
"NON_MEDICATION_TASK_CHECK_PROTOCOL_STEPS": "Verificar Etapas do Protocolo"
}
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const WARD_SUMMARY_HEADER = {
TOTAL_PATIENTS: "TOTAL_PATIENTS",
MY_PATIENTS: "MY_PATIENTS",
};
export const nonMedicationTaskKey = "NON_MEDICATION_TASK";

export const ForbiddenErrorMessage = "User doesn't have required privilege(s)";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import {
} from "../../DrugChart/utils/DrugChartUtils";
import { displayShiftTimingsFormat } from "../../../../constants";
import WarningIcon from "../../../../icons/warning.svg";
import { IntlProvider } from "react-intl";
export default function NursingTasks(props) {
const { patientId } = props;
const { config, isReadMode, visitSummary, visit } = useContext(IPDContext);
Expand Down Expand Up @@ -287,20 +286,20 @@ export default function NursingTasks(props) {
isReadMode
);
const filteredData = extractedData
.map((extract) =>
extract.filter((data) => {
return !(
data.serviceType == asNeededPlaceholderConceptName &&
data.endTimeInEpochSeconds <= startEndDates.endDate
);
})
)
.filter((innerArray) => innerArray.length > 0);
setMedicationNursingTasks(
extractedNonMedicationTasks.length > 0
? [...filteredData, ...extractedNonMedicationTasks]
: filteredData
);
.map((extract) =>
extract.filter((data) => {
return !(
data.serviceType == asNeededPlaceholderConceptName &&
data.endTimeInEpochSeconds <= startEndDates.endDate
);
})
)
.filter((innerArray) => innerArray.length > 0);
setMedicationNursingTasks(
extractedNonMedicationTasks.length > 0
? [...filteredData, ...extractedNonMedicationTasks]
: filteredData
);
}
setIsLoading(false);
setIsShiftsButtonsDisabled({
Expand Down
56 changes: 48 additions & 8 deletions src/features/DisplayControls/NursingTasks/components/TaskTile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ import {
asNeededPlaceholderConceptName,
timeFormatFor12Hr,
timeFormatFor24Hr,
nonMedicationTaskKey,
} from "../../../../constants";
import { FormattedMessage, useIntl } from "react-intl";
import {
getLocalizedLabel,
getTranslationKey,
} from "../../../../utils/CommonUtils";

export default function TaskTile(props) {
const { medicationNursingTask } = props;
Expand Down Expand Up @@ -46,6 +52,9 @@ export default function TaskTile(props) {
creator,
taskType,
} = newMedicationNursingTask;
const intl = useIntl();

const more = <FormattedMessage id="TASK_TILE_MORE" defaultMessage="more" />;

const isRelevantTask = getRelevantTaskStatus(
startTimeInEpochSeconds,
Expand All @@ -67,7 +76,13 @@ export default function TaskTile(props) {
fontWeight: !isANonMedicationTask && isRelevantTask ? 500 : 400,
}}
>
{drugName}
{isSystemGeneratedTask
? getLocalizedLabel(
intl,
getTranslationKey(drugName, nonMedicationTaskKey),
drugName
)
: drugName}
</div>
);
const statusIcon = iconType(newMedicationNursingTask, nursingTasks);
Expand Down Expand Up @@ -99,12 +114,33 @@ export default function TaskTile(props) {
>
<SVGIcon iconType={statusIcon} />
</div>
<TooltipDefinition
tooltipText={drugName}
className={isDisabled ? "cursor-not-allowed" : "cursor-pointer"}
>
{drugNameText}
</TooltipDefinition>
{isANonMedicationTask ? (
<TooltipDefinition
tooltipText={
isSystemGeneratedTask
? getLocalizedLabel(
intl,
getTranslationKey(drugName, nonMedicationTaskKey),
drugName
)
: drugName
}
className={
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
}
>
{drugNameText}
</TooltipDefinition>
) : (
<TooltipDefinition
tooltipText={drugName}
className={
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
}
>
{drugNameText}
</TooltipDefinition>
)}
</div>
</div>
{!isANonMedicationTask && (
Expand Down Expand Up @@ -152,7 +188,11 @@ export default function TaskTile(props) {
</div>
</div>
)}
{isGroupedTask && <div className="more-info">({taskCount} more)</div>}
{isGroupedTask && (
<div className="more-info">
({taskCount} {more})
</div>
)}
</div>
</div>
{isGroupedTask && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext, useEffect, useState } from "react";
import { FormattedMessage } from "react-intl";
import { FormattedMessage, useIntl } from "react-intl";
import PropTypes from "prop-types";
import "../styles/UpdateNursingTasks.scss";
import SideBarPanel from "../../../SideBarPanel/components/SideBarPanel";
Expand Down Expand Up @@ -29,6 +29,7 @@ import {
timeText24,
timeFormatFor12Hr,
timeFormatFor24Hr,
nonMedicationTaskKey,
} from "../../../../constants";
import DisplayTags from "../../../../components/DisplayTags/DisplayTags";
import { IPDContext } from "../../../../context/IPDContext";
Expand All @@ -37,6 +38,10 @@ import {
formatTime,
isTimeInFuture,
} from "../../../../utils/DateTimeUtils";
import {
getLocalizedLabel,
getTranslationKey,
} from "../../../../utils/CommonUtils";

const UpdateNursingTasks = (props) => {
const {
Expand Down Expand Up @@ -65,6 +70,7 @@ const UpdateNursingTasks = (props) => {
const [showWarningNotification, setShowWarningNotification] = useState(false);
const [isInvalidTime, setIsInvalidTime] = useState(false);
const [invalidText, setInvalidText] = useState();
const intl = useIntl();

const invalidTimeText = (
<FormattedMessage
Expand Down Expand Up @@ -94,7 +100,9 @@ const UpdateNursingTasks = (props) => {
setOpenConfirmationModal(false);
updateNursingTasksSlider(false);
updateIsPRNMedication(false);
task.status === 'not-done' ? handleAuditEvent("SKIP_SCHEDULED_MEDICATION_TASK") : handleAuditEvent("ADMINISTER_MEDICATION_TASK");
task.status === "not-done"
? handleAuditEvent("SKIP_SCHEDULED_MEDICATION_TASK")
: handleAuditEvent("ADMINISTER_MEDICATION_TASK");
};

const saveAdministeredNonMedicationTasks = () => {
Expand All @@ -109,7 +117,9 @@ const UpdateNursingTasks = (props) => {
const response = isPRNMedication
? await saveEmergencyMedication(administeredTasks[0])
: await saveAdministeredMedication(administeredTasks);
response.status === 200 ? saveAdministeredTasks(administeredTasks[0]) : null;
response.status === 200
? saveAdministeredTasks(administeredTasks[0])
: null;
};

const createAdministeredTasksPayload = () => {
Expand Down Expand Up @@ -505,22 +515,32 @@ const UpdateNursingTasks = (props) => {
tasks[medicationTask.uuid]?.skipped && "red-text"
}`}
>
{medicationTask.drugName}
{!isNonMedication ?
(<><FormattedMessage id={"AT"} defaultMessage={" at "} />
{enable24HourTime
? formatTime(
medicationTasks[0].startTime,
timeFormatFor24Hr,
timeFormatFor24Hr
)
: formatTime(
medicationTasks[0].startTime,
timeFormatFor24Hr,
timeFormatFor12Hr
)}
{getLocalizedLabel(
intl,
getTranslationKey(
medicationTask.drugName,
nonMedicationTaskKey
),
medicationTask.drugName
)}
{!isNonMedication ? (
<>
<FormattedMessage id={"AT"} defaultMessage={" at "} />
{enable24HourTime
? formatTime(
medicationTasks[0].startTime,
timeFormatFor24Hr,
timeFormatFor24Hr
)
: formatTime(
medicationTasks[0].startTime,
timeFormatFor24Hr,
timeFormatFor12Hr
)}
</>
) : (<></>)}
) : (
<></>
)}
</div>
)}
{!isNonMedication ? (
Expand Down Expand Up @@ -634,15 +654,37 @@ const UpdateNursingTasks = (props) => {
{tasks[medicationTask.uuid]?.skipped ? (
<OverflowMenuItem
itemText={
!isNonMedication ? "Un-Skip Drug" : "Un-Skip Task"
!isNonMedication
? getLocalizedLabel(
intl,
getTranslationKey("Un-Skip Drug"),
"Un-Skip Drug"
)
: getLocalizedLabel(
intl,
getTranslationKey("Un-Skip Task"),
"Un-Skip Task"
)
}
onClick={() => {
handleSkipDrug(medicationTask, false);
}}
/>
) : (
<OverflowMenuItem
itemText={!isNonMedication ? "Skip Drug" : "Skip Task"}
itemText={
!isNonMedication
? getLocalizedLabel(
intl,
getTranslationKey("Skip Drug"),
"Skip Drug"
)
: getLocalizedLabel(
intl,
getTranslationKey("Skip Task"),
"Skip Task"
)
}
onClick={() => {
handleSkipDrug(medicationTask, true);
}}
Expand Down
Loading
Loading