From 9a8d5ad3fb5fa69b05ca37647eef330095d805ba Mon Sep 17 00:00:00 2001 From: Mutesasira Moses Date: Mon, 25 Sep 2023 15:26:11 +0300 Subject: [PATCH 1/3] fix edit pade display --- .../src/components/modifyOrder/EditSample.js | 47 +++++++++++++++---- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/modifyOrder/EditSample.js b/frontend/src/components/modifyOrder/EditSample.js index f81a37a8a2..5590f42ad6 100644 --- a/frontend/src/components/modifyOrder/EditSample.js +++ b/frontend/src/components/modifyOrder/EditSample.js @@ -28,6 +28,8 @@ const EditSample = (props) => { const [elementsCounter, setElementsCounter] = useState(0); const [page, setPage] = useState(1); const [pageSize, setPageSize] = useState(5); + const [page2, setPage2] = useState(1); + const [pageSize2, setPageSize2] = useState(5); const [rejectSampleReasons, setRejectSampleReasons] = useState([]); @@ -48,6 +50,22 @@ const EditSample = (props) => { setSamples(updateSamples); setElementsCounter(count); }; + const formatTestsObject = (tests) => { + return tests.map((test) => { + test.id = test.testId; + test.collectionTime = ""; + if (!test.accessionNumber) { + test.accessionNumber = ""; + } + if (!test.sampleType) { + test.sampleType = ""; + } + if (!test.collectionDate) { + test.collectionDate = ""; + } + return test; + }); + }; const sampleTypeObject = (object) => { let newState = [...samples]; @@ -97,6 +115,17 @@ const EditSample = (props) => { setPageSize(pageInfo.pageSize); } }; + + const handlePageChange2 = (pageInfo) => { + if (page2 != pageInfo.page) { + setPage2(pageInfo.page); + } + + if (pageSize2 != pageInfo.pageSize) { + setPageSize2(pageInfo.pageSize); + } + }; + const removeSample = (index) => { let updateSamples = samples.splice(index, 1); setSamples(updateSamples); @@ -205,7 +234,7 @@ const EditSample = (props) => {
@@ -229,7 +258,7 @@ const EditSample = (props) => { {rows .slice((page - 1) * pageSize) .slice(0, pageSize) - .map((row ) => ( + .map((row) => ( {row.cells.map((cell) => renderCell(cell, row))} @@ -252,7 +281,7 @@ const EditSample = (props) => {
@@ -274,8 +303,8 @@ const EditSample = (props) => { <> {rows - .slice((page - 1) * pageSize) - .slice(0, pageSize) + .slice((page2 - 1) * pageSize2) + .slice(0, pageSize2) .map((row) => ( {row.cells.map((cell) => renderCell(cell, row))} @@ -288,11 +317,11 @@ const EditSample = (props) => { )}
From e616becb206b11dc6c4246530b11b3336eb9972b Mon Sep 17 00:00:00 2001 From: Mutesasira Moses Date: Mon, 25 Sep 2023 23:50:12 +0300 Subject: [PATCH 2/3] more work on modify order --- frontend/src/components/addOrder/Index.js | 2 +- .../data/orderCurrentTestsHeaders.js | 20 + .../src/components/modifyOrder/EditOrder.js | 680 ++++++++++++++++++ .../EditOrderEntryAdditionalQuestions.js | 1 + .../src/components/modifyOrder/EditSample.js | 92 ++- .../src/components/modifyOrder/ModifyOrder.js | 29 +- frontend/src/languages/en.json | 3 +- frontend/src/languages/fr.json | 3 +- .../sample/bean/SampleEditItem.java | 12 + .../rest/SampleEditRestController.java | 47 +- 10 files changed, 864 insertions(+), 25 deletions(-) create mode 100644 frontend/src/components/modifyOrder/EditOrder.js diff --git a/frontend/src/components/addOrder/Index.js b/frontend/src/components/addOrder/Index.js index ca78684d76..2a9659b450 100755 --- a/frontend/src/components/addOrder/Index.js +++ b/frontend/src/components/addOrder/Index.js @@ -78,7 +78,7 @@ const Index = () => { }, [page]); const attacheSamplesToFormValues = () => { - let sampleXmlString = null; + let sampleXmlString = ""; let referralItems = []; if (samples.length > 0) { if (samples[0].tests.length > 0) { diff --git a/frontend/src/components/data/orderCurrentTestsHeaders.js b/frontend/src/components/data/orderCurrentTestsHeaders.js index 6eebeff7cf..e048799c57 100644 --- a/frontend/src/components/data/orderCurrentTestsHeaders.js +++ b/frontend/src/components/data/orderCurrentTestsHeaders.js @@ -32,3 +32,23 @@ export const OrderCurrentTestsHeaders = [ header: "Cancel Test", }, ]; + +export const OrderPossibleTestsHeaders = [ + { + key: "accessionNumber", + header: "Lab No.", + }, + { + key: "sampleType", + header: "Sample Type", + }, + { + key: "testName", + header: "Test Name", + }, + { + key: "add", + header: "Assign", + }, +]; + diff --git a/frontend/src/components/modifyOrder/EditOrder.js b/frontend/src/components/modifyOrder/EditOrder.js new file mode 100644 index 0000000000..8de492f3d3 --- /dev/null +++ b/frontend/src/components/modifyOrder/EditOrder.js @@ -0,0 +1,680 @@ +import React, { useContext, useEffect, useRef, useState } from "react"; +import { + Checkbox, + Link, + Select, + SelectItem, + Stack, + TextInput, + TimePicker, +} from "@carbon/react"; +import CustomDatePicker from "../common/CustomDatePicker"; +import { getFromOpenElisServer } from "../utils/Utils"; +import { NotificationContext } from "../layout/Layout"; +import { priorities } from "../data/orderOptions"; +import { NotificationKinds } from "../common/CustomNotification"; +import AutoComplete from "../common/AutoComplete"; +import OrderResultReporting from "../addOrder/OrderResultReporting"; +import { FormattedMessage } from "react-intl"; +import { ConfigurationContext } from "../layout/Layout"; +const AddOrder = (props) => { + const { orderFormValues, setOrderFormValues, samples } = props; + const componentMounted = useRef(true); + const [otherSamplingVisible, setOtherSamplingVisible] = useState(false); + const [providers, setProviders] = useState([]); + const [paymentOptions, setPaymentOptions] = useState([]); + const [samplingPerformed, setSamplingPerformed] = useState([]); + const [allowSiteNameOptions, setAllowSiteNameOptions] = useState("false"); + const [allowRequesterOptions, setAllowRequesterOptions] = useState("false"); + const { setNotificationVisible, setNotificationBody } = + useContext(NotificationContext); + const [siteNames, setSiteNames] = useState([]); + const [innitialized, setInnitialized] = useState(false); + const [phoneFormat, setPhoneFormat] = useState(""); + const configurationProperties = useContext(ConfigurationContext); + const [departments, setDepartments] = useState([]); + + + const handleDatePickerChange = (datePicker, date) => { + let obj = null; + switch (datePicker) { + case "requestDate": + obj = { ...orderFormValues.sampleOrderItems, requestDate: date }; + break; + case "receivedDate": + obj = { + ...orderFormValues.sampleOrderItems, + receivedDateForDisplay: date, + }; + break; + case "nextVisitDate": + obj = { ...orderFormValues.sampleOrderItems, nextVisitDate: date }; + break; + default: + } + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: obj, + }); + }; + + function handlePaymentStatus(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + paymentOptionSelection: e.target.value, + }, + }); + } + + function handleBillReferenceNo(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + billingReferenceNumber: e.target.value, + }, + }); + } + + function handleRequesterFax(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + providerFax: e.target.value, + }, + }); + } + + function handleRequesterEmail(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + providerEmail: e.target.value, + }, + }); + } + + function handleRequesterWorkPhone(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + providerWorkPhone: e.target.value, + }, + }); + setNotificationVisible(false); + } + + function handleRequesterFirstName(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + providerFirstName: e.target.value, + }, + }); + } + + function handleRequesterLastName(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + providerLastName: e.target.value, + }, + }); + } + + const handleSamplingPerformed = (e) => { + const { value } = e.target; + if (value === "1310") { + setOtherSamplingVisible(!otherSamplingVisible); + } else { + setOtherSamplingVisible(false); + } + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + testLocationCode: value, + }, + }); + }; + + function handleOtherLocationCode(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + otherLocationCode: e.target.value, + }, + }); + } + + function handleReceivedTime(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + receivedTime: e.target.value, + }, + }); + } + + const handleLabNoGeneration = (e) => { + e.preventDefault(); + getFromOpenElisServer( + "/rest/SampleEntryGenerateScanProvider", + fetchGeneratedAccessionNo, + ); + }; + + function accessionNumberValidationResults(res) { + if (res.status === false) { + setNotificationVisible(true); + setNotificationBody({ + kind: NotificationKinds.error, + title: , + message: res.body, + }); + } + } + + function handleProviderSelectOptions(providerId) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + providerId: providerId, + }, + }); + + getFromOpenElisServer( + "/rest/practitioner?providerId=" + providerId, + fetchPractitioner, + ); + } + + function fetchPractitioner(data) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + providerFirstName: data.person.firstName, + providerLastName: data.person.lastName, + providerWorkPhone: data.person.workPhone, + providerEmail: data.person.email, + providerFax: data.person.fax, + }, + }); + } + + function handleRequesterDept(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + referringSiteDepartmentId: e.target.value, + }, + }); + } + + function handleSiteName(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + referringSiteName: e.target.value, + }, + }); + } + + function handleAutoCompleteSiteName(siteId) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + referringSiteId: siteId, + }, + }); + getFromOpenElisServer( + "/rest/departments-for-site?refferingSiteId=" + siteId, + loadDepartments, + ); + } + const loadDepartments =(data) => { + setDepartments(data); + } + + function handleLabNo(e) { + setOrderFormValues({ + ...orderFormValues, + newAccessionNumber: e.target.value, + }); + setNotificationVisible(false); + } + + const handleLabNoValidation = () => { + if (orderFormValues.sampleOrderItems.labNo !== "") { + getFromOpenElisServer( + "/rest/SampleEntryAccessionNumberValidation?ignoreYear=false&ignoreUsage=false&field=labNo&accessionNumber=" + + orderFormValues.sampleOrderItems.labNo, + accessionNumberValidationResults, + ); + } + }; + + function fetchPhoneNoValidation(res) { + if (res.status === false) { + setNotificationBody({ + title: , + message: res.body, + kind: NotificationKinds.error, + }); + setNotificationVisible(true); + } + } + + const handlePhoneNoValidation = () => { + if (orderFormValues.sampleOrderItems.providerWorkPhone !== "") { + const providerPhoneNo = + orderFormValues.sampleOrderItems.providerWorkPhone.replace( + /\+/g, + "%2B", + ); + getFromOpenElisServer( + "/rest/PhoneNumberValidationProvider?fieldId=providerWorkPhoneID&value=" + + providerPhoneNo, + fetchPhoneNoValidation, + ); + } + }; + + function handleRememberCheckBox(e) { + let checked = false; + if (e.currentTarget.checked) { + checked = true; + } + setOrderFormValues({ + ...orderFormValues, + rememberSiteAndRequester: checked, + }); + } + + + useEffect(() => { + if (!innitialized) { + setPhoneFormat(configurationProperties.phoneFormat); + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + requestDate: configurationProperties.currentDateAsText, + receivedDateForDisplay: configurationProperties.currentDateAsText, + nextVisitDate: configurationProperties.currentDateAsText, + receivedTime: configurationProperties.currentTimeAsText, + }, + }); + setAllowSiteNameOptions( + configurationProperties.restrictFreeTextRefSiteEntry, + ); + setAllowRequesterOptions( + configurationProperties.restrictFreeTextProviderEntry, + ); + } + if (orderFormValues.sampleOrderItems.requestDate != "") { + setInnitialized(true); + } + + }, [orderFormValues]); + + function handlePriority(e) { + setOrderFormValues({ + ...orderFormValues, + sampleOrderItems: { + ...orderFormValues.sampleOrderItems, + priority: e.target.value, + }, + }); + } + + function fetchGeneratedAccessionNo(res) { + if (res.status) { + setOrderFormValues({ + ...orderFormValues, + newAccessionNumber: res.body, + }); + setNotificationVisible(false); + } + } + + const reportingNotifications = (object) => { + setOrderFormValues({ + ...orderFormValues, + customNotificationLogic: true, + patientSMSNotificationTestIds: object.patientSMSNotificationTestIds, + patientEmailNotificationTestIds: object.patientEmailNotificationTestIds, + providerSMSNotificationTestIds: object.providerSMSNotificationTestIds, + providerEmailNotificationTestIds: object.providerEmailNotificationTestIds, + }); + }; + + const getSampleEntryPreform = (response) => { + if (componentMounted.current) { + setSiteNames(response.sampleOrderItems.referringSiteList); + setPaymentOptions(response.sampleOrderItems.paymentOptions); + setSamplingPerformed(response.sampleOrderItems.testLocationCodeList); + setProviders(response.sampleOrderItems.providersList); + } + }; + + useEffect(() => { + getFromOpenElisServer("/rest/SamplePatientEntry", getSampleEntryPreform); + window.scrollTo(0, 0); + return () => { + componentMounted.current = false; + }; + }, []); + + return ( + <> + +
+

+ +

+
: { orderFormValues.accessionNumber}
+
+
+ handleLabNo(e)} + labelText={} + id="labNo" + className="inputText" + /> +
+ {" "} + handleLabNoGeneration(e)}> + + +
+
+ +
+
+ handleDatePickerChange("requestDate", date)} + /> + + } + className="inputDate" + autofillDate={true} + value={orderFormValues.sampleOrderItems.receivedDateForDisplay} + onChange={(date) => handleDatePickerChange("receivedDate", date)} + /> +
+
+ } + onChange={handleReceivedTime} + value={ + orderFormValues.sampleOrderItems.receivedTime + ? orderFormValues.sampleOrderItems.receivedTime + : configurationProperties.receivedTime + } + /> + + } + value={orderFormValues.sampleOrderItems.nextVisitDate} + autofillDate={false} + onChange={(date) => handleDatePickerChange("nextVisitDate", date)} + /> +
+
+ {allowSiteNameOptions === "false" ? ( + } + onChange={handleSiteName} + value={ + orderFormValues.sampleOrderItems.referringSiteName == null + ? "" + : orderFormValues.sampleOrderItems.referringSiteName + } + id="siteName" + className="inputText" + /> + ) : ( + } + class="inputText" + invalidText={} + style={{ width: "!important 100%" }} + suggestions={siteNames.length > 0 ? siteNames : []} + required + /> + )} + + +
+ {allowRequesterOptions === "false" ? ( + "" + ) : ( +
+ } + class="inputText" + style={{ width: "!important 100%" }} + invalidText={ + + } + suggestions={providers.length > 0 ? providers : []} + required + /> +
+ )} +
+ + } + disabled={allowRequesterOptions !== "false"} + onChange={handleRequesterFirstName} + value={orderFormValues.sampleOrderItems.providerFirstName} + id="requesterFirstName" + className="inputText" + /> + + + } + disabled={allowRequesterOptions !== "false"} + value={orderFormValues.sampleOrderItems.providerLastName} + onChange={handleRequesterLastName} + id="requesterLastName" + className="inputText" + /> +
+
+ } + id="providerWorkPhoneId" + className="inputText" + /> + + } + disabled={allowRequesterOptions !== "false"} + onChange={handleRequesterFax} + value={orderFormValues.sampleOrderItems.providerFax} + id="providerFaxId" + className="inputText" + /> +
+
+ } + disabled={allowRequesterOptions !== "false"} + onChange={handleRequesterEmail} + value={orderFormValues.sampleOrderItems.providerEmail} + id="providerEmailId" + className="inputText" + /> + + +
+
+ + } + onChange={handleOtherLocationCode} + className="inputText" + value={orderFormValues.sampleOrderItems.otherLocationCode} + disabled={!otherSamplingVisible} + id="testLocationCodeOtherId" + /> +
+
+ + } + className="inputText" + id="rememberSiteAndRequester" + onChange={handleRememberCheckBox} + /> +
+
+
+

{}

+ {samples.map((sample, index) => { + if (sample.tests.length > 0) { + return ( +
+

{index + 1}

+ +
+ ); + } + })} +
+
+ + ); +}; + +export default AddOrder; diff --git a/frontend/src/components/modifyOrder/EditOrderEntryAdditionalQuestions.js b/frontend/src/components/modifyOrder/EditOrderEntryAdditionalQuestions.js index d2e37be30a..7aa3fb12e7 100644 --- a/frontend/src/components/modifyOrder/EditOrderEntryAdditionalQuestions.js +++ b/frontend/src/components/modifyOrder/EditOrderEntryAdditionalQuestions.js @@ -275,6 +275,7 @@ export const ProgramSelect = ({ })?.id } value={orderFormValues?.sampleOrderItems?.programId} + disabled={true} > {programs.map((program) => { diff --git a/frontend/src/components/modifyOrder/EditSample.js b/frontend/src/components/modifyOrder/EditSample.js index 5590f42ad6..a5d330911b 100644 --- a/frontend/src/components/modifyOrder/EditSample.js +++ b/frontend/src/components/modifyOrder/EditSample.js @@ -21,9 +21,12 @@ import { Add } from "@carbon/react/icons"; import { getFromOpenElisServer } from "../utils/Utils"; import EditSampleType from "./EditSampleType"; import { FormattedMessage } from "react-intl"; -import { OrderCurrentTestsHeaders } from "../data/orderCurrentTestsHeaders"; +import { + OrderCurrentTestsHeaders, + OrderPossibleTestsHeaders, +} from "../data/orderCurrentTestsHeaders"; const EditSample = (props) => { - const { samples, setSamples, orderFormValues } = props; + const { samples, setSamples, orderFormValues, setOrderFormValues } = props; const componentMounted = useRef(true); const [elementsCounter, setElementsCounter] = useState(0); const [page, setPage] = useState(1); @@ -66,6 +69,52 @@ const EditSample = (props) => { return test; }); }; + const handleChecked = (e, testId) => { + var tests = []; + var updatedTests = []; + if (e.currentTarget.name === "add") { + tests = orderFormValues.possibleTests; + updatedTests = tests.map((test) => { + if (test.testId === testId) { + return { ...test, add: e.currentTarget.checked }; + } else { + return test; + } + }); + setOrderFormValues({ + ...orderFormValues, + possibleTests: updatedTests, + }); + } else if (e.currentTarget.name === "removeSample") { + tests = orderFormValues.existingTests; + updatedTests = tests.map((test) => { + if (test.testId === testId) { + return { ...test, removeSample: e.currentTarget.checked }; + } + { + return test; + } + }); + setOrderFormValues({ + ...orderFormValues, + existingTests: updatedTests, + }); + } else if (e.currentTarget.name === "canceled") { + tests = orderFormValues.existingTests; + updatedTests = tests.map((test) => { + if (test.testId === testId) { + return { ...test, canceled: e.currentTarget.checked }; + } + { + return test; + } + }); + setOrderFormValues({ + ...orderFormValues, + existingTests: updatedTests, + }); + } + }; const sampleTypeObject = (object) => { let newState = [...samples]; @@ -167,7 +216,10 @@ const EditSample = (props) => { }; }, []); - const renderCell = (cell) => { + const renderCell = (cell, row) => { + var accession = row.cells.find( + (e) => e.info.header === "accessionNumber", + ).value; if (cell.info.header === "accessionNumber") { return {cell.value}; } else if (cell.info.header === "sampleType") { @@ -193,6 +245,26 @@ const EditSample = (props) => { ); } else if (cell.info.header === "removeSample") { + return ( + <> + {accession !== "" ? ( + + handleChecked(e, row.id)} + > + + ) : ( + + )} + + ); + } else if (cell.info.header === "testName") { + return {cell.value}; + } else if (cell.info.header === "hasResults") { return ( { > ); - } else if (cell.info.header === "testName") { - return {cell.value}; - } else if (cell.info.header === "hasResults") { + } else if (cell.info.header === "canceled") { return ( handleChecked(e, row.id)} > ); - } else if (cell.info.header === "canceled") { + } else if (cell.info.header === "add") { return ( handleChecked(e, row.id)} > ); @@ -282,7 +356,7 @@ const EditSample = (props) => { {({ rows, headers, getHeaderProps, getTableProps }) => ( @@ -328,7 +402,7 @@ const EditSample = (props) => {

- +

{samples.map((sample, i) => { return ( diff --git a/frontend/src/components/modifyOrder/ModifyOrder.js b/frontend/src/components/modifyOrder/ModifyOrder.js index c83b2ef571..ee0e69339d 100644 --- a/frontend/src/components/modifyOrder/ModifyOrder.js +++ b/frontend/src/components/modifyOrder/ModifyOrder.js @@ -13,7 +13,7 @@ import { Tag, } from "@carbon/react"; import EditSample from "./EditSample"; -import AddOrder from "../addOrder/AddOrder"; +import EditOrder from "./EditOrder"; import "../addOrder/add-order.scss"; import { ModifyOrderFormValues } from "../formModel/innitialValues/OrderEntryFormValues"; import { NotificationContext } from "../layout/Layout"; @@ -59,7 +59,7 @@ const ModifyOrder = () => { accessionNumber = accessionNumber ? accessionNumber : ""; patientId = patientId ? patientId : ""; getFromOpenElisServer( - "/rest/SampleEdit?patientId=" + + "/rest/sample-edit?patientId=" + patientId + "&accessionNumber=" + accessionNumber, @@ -105,11 +105,11 @@ const ModifyOrder = () => { e.preventDefault(); setPage(page + 1); console.log(JSON.stringify(orderFormValues)); - // postToOpenElisServer( - // "/rest/SamplePatientEntry", - // JSON.stringify(orderFormValues), - // handlePost, - // ); + postToOpenElisServer( + "/rest/sample-edit", + JSON.stringify(orderFormValues), + handlePost, + ); }; useEffect(() => { if (page === samplePageNumber + 1) { @@ -118,7 +118,7 @@ const ModifyOrder = () => { }, [page]); const attacheSamplesToFormValues = () => { - let sampleXmlString = null; + let sampleXmlString = ""; let referralItems = []; if (samples.length > 0) { if (samples[0].tests.length > 0) { @@ -172,9 +172,9 @@ const ModifyOrder = () => { } setOrderFormValues({ ...orderFormValues, - useReferral: true, + // useReferral: true, sampleXML: sampleXmlString, - referralItems: referralItems, + // referralItems: referralItems, }); }; @@ -292,10 +292,15 @@ const ModifyOrder = () => { /> )} {page === samplePageNumber && ( - + )} {page === orderPageNumber && ( - Date: Tue, 26 Sep 2023 00:05:47 +0300 Subject: [PATCH 3/3] fix search order translation --- .../src/components/modifyOrder/ModifyOrder.js | 2 +- .../src/components/modifyOrder/SearchOrder.js | 26 +++++++++++++------ .../pathology/PathologyDashboard.js | 6 ++--- frontend/src/languages/en.json | 6 ++++- frontend/src/languages/fr.json | 5 +++- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/modifyOrder/ModifyOrder.js b/frontend/src/components/modifyOrder/ModifyOrder.js index ee0e69339d..dbf4acef6a 100644 --- a/frontend/src/components/modifyOrder/ModifyOrder.js +++ b/frontend/src/components/modifyOrder/ModifyOrder.js @@ -201,7 +201,7 @@ const ModifyOrder = () => { {intl.formatMessage({ id: "home.label" })} - {intl.formatMessage({ id: "label.search.patient" })} + {intl.formatMessage({ id: "sample.label.search.Order" })} diff --git a/frontend/src/components/modifyOrder/SearchOrder.js b/frontend/src/components/modifyOrder/SearchOrder.js index e37bfc1f17..51ea5c0bac 100644 --- a/frontend/src/components/modifyOrder/SearchOrder.js +++ b/frontend/src/components/modifyOrder/SearchOrder.js @@ -1,6 +1,7 @@ import React, { useState, useEffect, useRef } from "react"; import SearchPatientForm from "../patient/SearchPatientForm"; -import { Button, Column, TextInput ,Grid ,Form} from "@carbon/react"; +import { Button, Column, TextInput, Grid, Form } from "@carbon/react"; +import { FormattedMessage } from "react-intl"; function SearchOrder() { const [selectedPatient, setSelectedPatient] = useState({}); @@ -37,8 +38,8 @@ function SearchOrder() {
- -

Search By Accesion

+ +

- +
-

Search By Patient

- + + +

+ {" "} + +

+
+ + + +
); diff --git a/frontend/src/components/pathology/PathologyDashboard.js b/frontend/src/components/pathology/PathologyDashboard.js index dacf2a3b13..5f81f6121d 100644 --- a/frontend/src/components/pathology/PathologyDashboard.js +++ b/frontend/src/components/pathology/PathologyDashboard.js @@ -87,7 +87,7 @@ function PathologyDashboard() { assignCurrentUserAsTechnician(e, pathologySampleId); }} > - + ); @@ -105,8 +105,8 @@ function PathologyDashboard() { onClick={(e) => { assignCurrentUserAsPathologist(e, pathologySampleId); }} - > - + > + ); diff --git a/frontend/src/languages/en.json b/frontend/src/languages/en.json index f37bdbeed0..a0dac69ab9 100644 --- a/frontend/src/languages/en.json +++ b/frontend/src/languages/en.json @@ -294,5 +294,9 @@ "patient.natioanalid":"National ID", "sample.label.orderpanel":"Order Panels", "sample.label.noorder":"Order Doesnt Exist", - "sample.label.labnumber.new" : "New Lab Number" + "sample.label.labnumber.new" : "New Lab Number" , + "sample.label.search.labnumber" : "Search By Accesion Number" , + "sample.label.search.patient" : "Search By Patient" , + "sample.label.search.Order" : "Search Order" + } diff --git a/frontend/src/languages/fr.json b/frontend/src/languages/fr.json index 4e42d79ccb..cb541dc92a 100644 --- a/frontend/src/languages/fr.json +++ b/frontend/src/languages/fr.json @@ -292,5 +292,8 @@ "patient.nationalid": "Identifiant National", "sample.label.orderpanel": "Panels de commande", "sample.label.noorder": "La commande n'existe pas" , - "sample.label.labnumber.new": "Nouveau numéro de laboratoire" + "sample.label.labnumber.new": "Nouveau numéro de laboratoire" , + "sample.label.search.labnumber": "Rechercher par numéro d'accès", + "sample.label.search.patient": "Rechercher par patient", + "sample.label.search.Order": "Rechercher une commande" }