Skip to content

Commit

Permalink
(fix) Fix error when clearing the test type field of the lab order fo…
Browse files Browse the repository at this point in the history
…rm (#1460)

Co-authored-by: Dennis Kigen <[email protected]>
  • Loading branch information
makombe and denniskigen authored Nov 10, 2023
1 parent 881258a commit e53014c
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 17 deletions.
1 change: 0 additions & 1 deletion packages/esm-patient-forms-app/translations/am.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"checkFilters": "Check the filters above",
"clinicalForm": "Clinical form",
"editForm": "Edit form",
"form": "Form",
Expand Down
1 change: 0 additions & 1 deletion packages/esm-patient-forms-app/translations/ar.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"checkFilters": "تحقق من الفلاتر أعلاه",
"clinicalForm": "النموذج السريري",
"editForm": "تعديل النموذج",
"form": "نموذج",
Expand Down
1 change: 0 additions & 1 deletion packages/esm-patient-forms-app/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"checkFilters": "Check the filters above",
"clinicalForm": "Clinical form",
"editForm": "Edit form",
"form": "Form",
Expand Down
1 change: 0 additions & 1 deletion packages/esm-patient-forms-app/translations/es.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"checkFilters": "Verifique los filtros arriba",
"clinicalForm": "Formulario clínico",
"editForm": "Editar formulario",
"form": "Formulario",
Expand Down
1 change: 0 additions & 1 deletion packages/esm-patient-forms-app/translations/fr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"checkFilters": "Check the filters above",
"clinicalForm": "Formulaire clinique",
"editForm": "Edit form",
"form": "Formulaire",
Expand Down
1 change: 0 additions & 1 deletion packages/esm-patient-forms-app/translations/he.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"checkFilters": "Check the filters above",
"clinicalForm": "טופס קליני",
"editForm": "Edit form",
"form": "טופס",
Expand Down
1 change: 0 additions & 1 deletion packages/esm-patient-forms-app/translations/km.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"checkFilters": "ពិនិត្យតម្រងខាងលើ",
"clinicalForm": "ទម្រង់គ្លីនិក",
"editForm": "កែទម្រង់",
"form": "ទម្រង់",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-labs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js --color",
"coverage": "yarn test --coverage",
"typescript": "tsc",
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js"
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.workspace.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js"
},
"browserslist": [
"extends browserslist-config-openmrs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import capitalize from 'lodash-es/capitalize';
import { useTranslation } from 'react-i18next';
import { Button } from '@carbon/react';
import { ArrowLeft } from '@carbon/react/icons';
import { age, formatDate, parseDate, useLayoutType, usePatient, useSession } from '@openmrs/esm-framework';
import { age, formatDate, parseDate, useLayoutType, usePatient } from '@openmrs/esm-framework';
import { DefaultWorkspaceProps, launchPatientWorkspace, OrderBasketItem } from '@openmrs/esm-patient-common-lib';
import { LabOrderBasketItem } from '../api';
import { TestTypeSearch } from './test-type-search';
import { LabOrderForm } from './lab-order-form';
import { LabOrderForm } from './lab-order-form.component';
import styles from './add-lab-order.scss';

export interface AddLabOrderWorkspaceAdditionalProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export function LabOrderForm({ initialOrder, closeWorkspace }: LabOrderFormProps
closeWorkspace();
launchPatientWorkspace('order-basket');
},
[orders, setOrders, closeWorkspace, session.currentProvider.uuid, inProgressLabOrder],
[orders, setOrders, closeWorkspace, session?.currentProvider?.uuid, inProgressLabOrder],
);

const cancelOrder = useCallback(() => {
setOrders(orders.filter((order) => order.testType.conceptUuid !== inProgressLabOrder.testType.conceptUuid));
closeWorkspace();
launchPatientWorkspace('order-basket');
}, [closeWorkspace, inProgressLabOrder.testType.conceptUuid, orders, setOrders]);
}, [closeWorkspace, inProgressLabOrder?.testType?.conceptUuid, orders, setOrders]);

return (
<>
Expand Down
11 changes: 11 additions & 0 deletions packages/esm-patient-labs-app/translations/am.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"additionalInstructions": "Additional instructions",
"backToOrderBasket": "Back to order basket",
"backToTimeline": "Back to timeline",
"date": "Date",
"dateCollected": "Displaying date collected",
"discard": "Discard",
"error": "Error",
"errorLoadingTestTypes": "Error occured when loading test types",
"labReferenceNumber": "Lab reference number",
"loading": "Loading",
"moreResultsAvailable": "More results available",
"observationsDisplayText": "observations",
"orderActionNew": "New",
"ordered": "Ordered",
"priority": "Priority",
"recentResults": "Recent Results",
"recentTestResults": "recent test results",
"referenceRange": "Reference range",
Expand All @@ -15,12 +22,15 @@
"resulted": "Resulted",
"resultsText": "results",
"returnToTimeline": "Return to timeline",
"saveOrder": "Save order",
"seeAllResults": "See all results",
"showTree": "Show tree",
"Test Results": "Test Results",
"testName": "Test name",
"testResults": "test results",
"testResults_title": "Test Results",
"testType": "Test type",
"testTypePlaceholder": "Select one",
"timeline": "Timeline",
"timeOfTest": "Time of Test",
"tree": "Tree",
Expand All @@ -32,6 +42,7 @@
"trendlineRangeSelector5Years": "5 years",
"trendlineRangeSelectorAll": "All",
"trendlineRangeSelectorMonths": "6 months",
"tryReopeningTheForm": "Please try launching the form again",
"value": "Value",
"view": "View"
}
13 changes: 12 additions & 1 deletion packages/esm-patient-labs-app/translations/ar.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"additionalInstructions": "تعليمات إضافية",
"backToOrderBasket": "العودة إلى سلة الطلب",
"backToTimeline": "العودة إلى الجدول الزمني",
"date": "تاريخ",
"dateCollected": "عرض تاريخ الجمع",
"discard": "تجاهل",
"error": "خطأ",
"errorLoadingTestTypes": "حدث خطأ أثناء تحميل أنواع الاختبارات",
"labReferenceNumber": "رقم المرجع المخبري",
"loading": "جار التحميل",
"moreResultsAvailable": "المزيد من النتائج متاحة",
"observationsDisplayText": "ملاحظات",
"orderActionNew": "جديد",
"ordered": "مُطلوب",
"priority": "الأولوية",
"recentResults": "النتائج الأخيرة",
"recentTestResults": "نتائج الاختبار الأخيرة",
"referenceRange": "نطاق المرجع",
Expand All @@ -15,12 +22,15 @@
"resulted": "أُظهرت",
"resultsText": "نتائج",
"returnToTimeline": "العودة إلى الجدول الزمني",
"saveOrder": "حفظ الطلب",
"seeAllResults": "عرض جميع النتائج",
"showTree": "عرض الشجرة",
"Test Results": "نتائج الاختبار",
"testName": "اسم الاختبار",
"testResults": "نتائج الاختبار",
"testResults_title": "نتائج الاختبار",
"testType": "نوع الاختبار",
"testTypePlaceholder": "اختر واحدة",
"timeline": "الجدول الزمني",
"timeOfTest": "وقت الاختبار",
"tree": "شجرة",
Expand All @@ -32,6 +42,7 @@
"trendlineRangeSelector5Years": "5 سنوات",
"trendlineRangeSelectorAll": "الكل",
"trendlineRangeSelectorMonths": "6 أشهر",
"value": "قيمة",
"tryReopeningTheForm": "يرجى محاولة فتح النموذج مرة أخرى",
"value": "القيمة",
"view": "عرض"
}
11 changes: 11 additions & 0 deletions packages/esm-patient-labs-app/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"additionalInstructions": "Additional instructions",
"backToOrderBasket": "Back to order basket",
"backToTimeline": "Back to timeline",
"date": "Date",
"dateCollected": "Displaying date collected",
"discard": "Discard",
"error": "Error",
"errorLoadingTestTypes": "Error occured when loading test types",
"labReferenceNumber": "Lab reference number",
"loading": "Loading",
"moreResultsAvailable": "More results available",
"observationsDisplayText": "observations",
"orderActionNew": "New",
"ordered": "Ordered",
"priority": "Priority",
"recentResults": "Recent Results",
"recentTestResults": "recent test results",
"referenceRange": "Reference range",
Expand All @@ -15,12 +22,15 @@
"resulted": "Resulted",
"resultsText": "results",
"returnToTimeline": "Return to timeline",
"saveOrder": "Save order",
"seeAllResults": "See all results",
"showTree": "Show tree",
"Test Results": "Test Results",
"testName": "Test name",
"testResults": "test results",
"testResults_title": "Test Results",
"testType": "Test type",
"testTypePlaceholder": "Select one",
"timeline": "Timeline",
"timeOfTest": "Time of Test",
"tree": "Tree",
Expand All @@ -32,6 +42,7 @@
"trendlineRangeSelector5Years": "5 years",
"trendlineRangeSelectorAll": "All",
"trendlineRangeSelectorMonths": "6 months",
"tryReopeningTheForm": "Please try launching the form again",
"value": "Value",
"view": "View"
}
11 changes: 11 additions & 0 deletions packages/esm-patient-labs-app/translations/es.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"additionalInstructions": "Instrucciones adicionales",
"backToOrderBasket": "Back to order basket",
"backToTimeline": "Volver al calendario",
"date": "Fecha",
"dateCollected": "Mostrando fecha de recogida",
"discard": "Descartar",
"error": "Error",
"errorLoadingTestTypes": "Error al cargar los tipos de pruebas",
"labReferenceNumber": "Número de referencia del laboratorio",
"loading": "Cargando",
"moreResultsAvailable": "Más resultados disponibles",
"observationsDisplayText": "observaciones",
"orderActionNew": "Nuevo",
"ordered": "Pedido",
"priority": "Priority",
"recentResults": "Resultados Recientes",
"recentTestResults": "Resultados de Pruebas Recientes",
"referenceRange": "Rango de Referencia",
Expand All @@ -15,12 +22,15 @@
"resulted": "Resultados",
"resultsText": "resultados",
"returnToTimeline": "Volver al calendario",
"saveOrder": "Guardar orden",
"seeAllResults": "Ver Todos los Resultados",
"showTree": "Mostrar Árbol",
"Test Results": "Resultados de Pruebas",
"testName": "Nombre de la Prueba",
"testResults": "Resultados de la Prueba",
"testResults_title": "Resultados de Pruebas",
"testType": "Tipo de prueba",
"testTypePlaceholder": "Selecciona uno",
"timeline": "Calendario",
"timeOfTest": "Hora de la Prueba",
"tree": "Árbol",
Expand All @@ -32,6 +42,7 @@
"trendlineRangeSelector5Years": "5 años",
"trendlineRangeSelectorAll": "Todo",
"trendlineRangeSelectorMonths": "6 meses",
"tryReopeningTheForm": "Por favor, intenta lanzar el formulario de nuevo",
"value": "Valor",
"view": "Ver"
}
11 changes: 11 additions & 0 deletions packages/esm-patient-labs-app/translations/fr.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"additionalInstructions": "Instructions supplémentaires",
"backToOrderBasket": "Retour au panier de commande",
"backToTimeline": "Retour à la chronologie",
"date": "Date",
"dateCollected": "Affichage de la date collectée",
"discard": "Jeter",
"error": "Error",
"errorLoadingTestTypes": "Une erreur s'est produite lors du chargement des types de tests",
"labReferenceNumber": "Numéro de référence du laboratoire",
"loading": "Chargement",
"moreResultsAvailable": "Plus de résultats disponibles",
"observationsDisplayText": "observations",
"orderActionNew": "New",
"ordered": "Commandé",
"priority": "Priorité",
"recentResults": "Résultats récents",
"recentTestResults": "Résultats de test récents",
"referenceRange": "Plage de référence",
Expand All @@ -15,12 +22,15 @@
"resulted": "Qui en résulte",
"resultsText": "résultats",
"returnToTimeline": "Retour à la chronologie",
"saveOrder": "Enregistrer la commande",
"seeAllResults": "Voir tous les résultats",
"showTree": "Voir l'arborescence",
"Test Results": "Test Results",
"testName": "Nom de test",
"testResults": "Résultats de tests",
"testResults_title": "Test Results",
"testType": "Type de test",
"testTypePlaceholder": "Sélectionnez-en un",
"timeline": "Chronologie",
"timeOfTest": "Heure du test",
"tree": "Arborescence",
Expand All @@ -32,6 +42,7 @@
"trendlineRangeSelector5Years": "5 années",
"trendlineRangeSelectorAll": "Tout",
"trendlineRangeSelectorMonths": "6 mois",
"tryReopeningTheForm": "Veuillez essayer de relancer le formulaire",
"value": "Valeur",
"view": "Vue"
}
19 changes: 15 additions & 4 deletions packages/esm-patient-labs-app/translations/he.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
{
"additionalInstructions": "הוראות נוספות",
"backToOrderBasket": "חזור לסל ההזמנות",
"backToTimeline": "חזור לציר הזמן",
"date": "תאריך",
"dateCollected": "מציג תאריך איסוף",
"error": "Error",
"discard": "לבטל",
"error": "שגיאה",
"errorLoadingTestTypes": "אירעה שגיאה בעת טעינת סוגי הבדיקות",
"labReferenceNumber": "מספר התייחסות של המעבדה",
"loading": "טוען",
"moreResultsAvailable": "קיימים עוד תוצאות זמינות",
"observationsDisplayText": "תצוגת מדדים",
"orderActionNew": "New",
"orderActionNew": "חדש",
"ordered": "הוזמן",
"priority": "עדיפות",
"recentResults": "תוצאות חדשות",
"recentTestResults": "תוצאות בדיקות חדשות",
"referenceRange": "טווח התייחסות",
"removeFromBasket": "Remove from basket",
"removeFromBasket": "הסר מהסל",
"resetTreeText": "איפוס עץ",
"resulted": "נמצא",
"resultsText": "תוצאות",
"returnToTimeline": "חזור לציר הזמן",
"saveOrder": "שמור הזמנה",
"seeAllResults": "ראה את כל התוצאות",
"showTree": "הצג עץ",
"Test Results": "תוצאות בדיקות",
"testName": "שם הבדיקה",
"testResults": "תוצאות הבדיקה",
"testResults_title": "Test Results",
"testResults_title": "תוצאות הבדיקה",
"testType": "סוג הבדיקה",
"testTypePlaceholder": "בחר אחד",
"timeline": "ציר זמן",
"timeOfTest": "שעת הבדיקה",
"tree": "עץ",
Expand All @@ -32,6 +42,7 @@
"trendlineRangeSelector5Years": "5 שנים",
"trendlineRangeSelectorAll": "הכל",
"trendlineRangeSelectorMonths": "6 חודשים",
"tryReopeningTheForm": "אנא נסה להפעיל מחדש את הטופס",
"value": "ערך",
"view": "תצוגה"
}
11 changes: 11 additions & 0 deletions packages/esm-patient-labs-app/translations/km.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"additionalInstructions": "សេចក្តីណែនាំបន្ថែម",
"backToOrderBasket": "ត្រឡប់ទៅកន្ត្រកបញ្ជាទិញ",
"backToTimeline": "ត្រលប់ទៅបន្ទាត់ពេលវេលា",
"date": "កាលបរិច្ឆេទ",
"dateCollected": "បង្ហាញកាលបរិច្ឆេទដែលប្រមូលទិន្នន័យបាន",
"discard": "បោះបង់",
"error": "មានបញ្ហាបច្ចេកទេស",
"errorLoadingTestTypes": "មានបញ្ហាក្នុងការផ្ទុកប្រភេទតេស្ត",
"labReferenceNumber": "លេខយោងប្រតិបត្តិការប្រតិបត្តិការ",
"loading": "កំពុងផ្ទុក",
"moreResultsAvailable": "អាចរកបានលទ្ធផលច្រើនទៀត",
"observationsDisplayText": "ការសង្កេត",
"orderActionNew": "ថ្មី",
"ordered": "បានតម្រៀបតាមលំដាប់លំដោយ",
"priority": "អាទិភាព",
"recentResults": "លទ្ធផលថ្មីៗ",
"recentTestResults": "លទ្ធផលតេស្តថ្មីៗ",
"referenceRange": "ចន្លោះតម្លៃយោង",
Expand All @@ -15,12 +22,15 @@
"resulted": "លទ្ធផល",
"resultsText": "លទ្ធផល",
"returnToTimeline": "ត្រឡប់ទៅបន្ទាត់ពេលវេលា",
"saveOrder": "រក្សាទុកលំដាប់",
"seeAllResults": "មើលលទ្ធផលទាំងអស់",
"showTree": "Sបង្ហាញមែកធាងទិន្នន័យ(Tree)",
"Test Results": "លទ្ធផលតេស្ត",
"testName": "ធ្វើតេស្តលើឈ្មោះ",
"testResults": "លទ្ធផលតេស្ត",
"testResults_title": "លទ្ធផលតេស្ត",
"testType": "ប្រភេទតេស្ត",
"testTypePlaceholder": "ជ្រើសរើសមួយ",
"timeline": "បន្ទាត់ពេលវេលា",
"timeOfTest": "ពេលវេលានៃការធ្វើតេស្ត",
"tree": "មែកធាងទិន្នន័យ(Tree)",
Expand All @@ -32,6 +42,7 @@
"trendlineRangeSelector5Years": "5 ឆ្នាំ",
"trendlineRangeSelectorAll": "ទាំងអស់",
"trendlineRangeSelectorMonths": "6 ខែ",
"tryReopeningTheForm": "សូមព្យាយាមបើកទម្រង់ឡើងវិញ",
"value": "តម្លៃ",
"view": "មើល"
}

0 comments on commit e53014c

Please sign in to comment.