diff --git a/frontend/src/components/addOrder/OrderReferralRequest.js b/frontend/src/components/addOrder/OrderReferralRequest.js index f63cb4b13b..9c2de29dba 100644 --- a/frontend/src/components/addOrder/OrderReferralRequest.js +++ b/frontend/src/components/addOrder/OrderReferralRequest.js @@ -55,21 +55,38 @@ const OrderReferralRequest = ({ function handleSentDatePicker(date, index) { if (date != null) { const update = [...referralRequests]; - update[index].sentDate = date; + if (update[index]) { + update[index].sentDate = date; + } setReferralRequests(update); } } const header = [ - { key: "reason", header: requiredSymbol(intl.formatMessage({ id: "referral.label.reason"})) }, - { key: "referrer", header: intl.formatMessage({ id: "referrer.label" })}, + { + key: "reason", + header: requiredSymbol( + intl.formatMessage({ id: "referral.label.reason" }), + ), + }, + { key: "referrer", header: intl.formatMessage({ id: "referrer.label" }) }, { key: "institute", - header: requiredSymbol(intl.formatMessage({ id: "referral.label.institute"})), + header: requiredSymbol( + intl.formatMessage({ id: "referral.label.institute" }), + ), + }, + { + key: "", + header: + intl.formatMessage({ id: "referral.label.sentdate" }) + + "\n" + + "(dd/mm/yyyy)", + }, + { + key: "name", + header: requiredSymbol(intl.formatMessage({ id: "search.label.test" })), }, - { key: "", header:intl.formatMessage({ id: "referral.label.sentdate"}) + "\n" + "(dd/mm/yyyy)" }, - { key: "name", header: requiredSymbol(intl.formatMessage({ id: "search.label.test" })) }, - ]; const updateUIRender = () => { @@ -105,7 +122,7 @@ const OrderReferralRequest = ({ id={"referralReasonId_" + id} options={referralReasons} value={ - referralRequests[i].reasonForReferral + referralRequests[i]?.reasonForReferral ? referralRequests[i].reasonForReferral : null } @@ -116,7 +133,7 @@ const OrderReferralRequest = ({ { collectionTime: "", }); const [loading, setLoading] = useState(true); + const intl = useIntl(); const defaultSelect = { id: "", value: "Choose Rejection Reason" }; @@ -528,8 +529,12 @@ const SampleType = (props) => { } - placeholder={} + labelText={ + + } + placeholder={intl.formatMessage({ + id: "choose.availablepanel", + })} onChange={handlePanelSearchChange} value={(() => { if (panelSearchTerm) { @@ -612,12 +617,18 @@ const SampleType = (props) => { <> )} - }> + } + > } - placeholder={} + labelText={ + + } + placeholder={intl.formatMessage({ + id: "holder.choose.availabletest", + })} onChange={handleTestSearchChange} value={(() => { if (testSearchTerm) { @@ -650,7 +661,7 @@ const SampleType = (props) => { - + "{testSearchTerm}"{" "} @@ -679,7 +690,7 @@ const SampleType = (props) => {
} + labelText={} onChange={handleReferralRequest} /> {requestTestReferral === true && (