diff --git a/frontend/src/components/printBarcode/PrePrint.js b/frontend/src/components/printBarcode/PrePrint.js
index 8645480fa3..b8bcaefc4a 100644
--- a/frontend/src/components/printBarcode/PrePrint.js
+++ b/frontend/src/components/printBarcode/PrePrint.js
@@ -1,4 +1,4 @@
-import { React, useState, useEffect } from "react";
+import { React, useState, useEffect, useRef } from "react";
import { FormattedMessage, useIntl, injectIntl } from "react-intl";
import {
Checkbox,
@@ -12,11 +12,12 @@ import {
} from "@carbon/react";
import { getFromOpenElisServer } from "../utils/Utils";
import { sampleTypeTestsStructure } from "../data/SampleEntryTestsForTypeProvider";
+import AutoComplete from "../common/AutoComplete";
import "../Style.css";
const PrePrint = () => {
const intl = useIntl();
-
+ const componentMounted = useRef(false);
const [sampleTypes, setSampleTypes] = useState([]);
const [selectedSampleTypeId, setSelectedSampleTypeId] = useState(null);
@@ -33,6 +34,21 @@ const PrePrint = () => {
const [source, setSource] = useState("about:blank");
const [renderBarcode, setRenderBarcode] = useState(false);
+ const [siteNames, setSiteNames] = useState([]);
+
+ const getSiteList = (response) => {
+ if (componentMounted.current) {
+ setSiteNames(response);
+ }
+ };
+
+ useEffect(() => {
+ componentMounted.current = true;
+ getFromOpenElisServer("/rest/site-names", getSiteList);
+ return () => {
+ componentMounted.current = false;
+ };
+ }, []);
function findTestById(testId) {
return sampleTypeTests.tests.find((test) => test.id === testId);
@@ -169,7 +185,7 @@ const PrePrint = () => {
<>
-
+
@@ -179,21 +195,30 @@ const PrePrint = () => {
min={1}
max={100}
defaultValue={1}
+ value={labelSets}
onChange={(_, state) => setLabelSets(state.value)}
- label={"Number of label sets"}
+ label={intl.formatMessage({
+ id: "label.barcode.labelsets",
+ })}
id="labelSets"
- className="inputText"
/>
+
+
+ {" "}
+
+
setOrderLabelsPerSet(state.value)}
- label={"Number of order labels per set"}
+ label={intl.formatMessage({
+ id: "label.barcode.orderlabel",
+ })}
id="orderLabelsPerSet"
- className="inputText"
/>
@@ -201,26 +226,46 @@ const PrePrint = () => {
min={1}
max={100}
defaultValue={1}
+ value={specimenLabelsPerSet}
onChange={(_, state) => setSpecimenLabelsPerSet(state.value)}
- label={"Number of specimen labels per set"}
+ label={intl.formatMessage({
+ id: "label.barcode.specimenlabel",
+ })}
id="specimenLabelsPerSet"
- className="inputText"
/>
+
+ {" "}
+
+
+
+ {" "}
+
+
- setFacilityId(e.target.value)}
- labelText={"Facility ID"}
+ setFacilityId(id)}
+ label={
+ <>
+ {" "}
+ >
+ }
+ style={{ width: "!important 100%" }}
+ suggestions={siteNames.length > 0 ? siteNames : []}
/>
@@ -235,7 +280,6 @@ const PrePrint = () => {
+
+ {" "}
+
+
-
-
-
-
-
+
+ {" "}
+
+
+
+
+
{renderBarcode && (
diff --git a/frontend/src/languages/en.json b/frontend/src/languages/en.json
index 23844504a5..758b22b22b 100644
--- a/frontend/src/languages/en.json
+++ b/frontend/src/languages/en.json
@@ -885,5 +885,9 @@
"report.labe.byPatient": "Report By Patient",
"report.labe.byLabNumber": "Report By Lab Number",
"report.labe.site": "Report By Site",
- "report.labe.date": "Report By Date"
+ "report.labe.date": "Report By Date",
+ "label.barcode.labelsets": "Number of label sets",
+ "label.barcode.orderlabel": "Number of order labels per set",
+ "label.barcode.specimenlabel": "Number of specimen labels per set",
+ "label.barcode.totallabel": "Total Labels to Print"
}
diff --git a/frontend/src/languages/fr.json b/frontend/src/languages/fr.json
index 6b03b79bb7..9400840d76 100644
--- a/frontend/src/languages/fr.json
+++ b/frontend/src/languages/fr.json
@@ -817,6 +817,9 @@
"report.labe.byPatient": "Rapport par Patient",
"report.labe.byLabNumber": "Rapport par Numéro de Laboratoire",
"report.labe.site": "Rapport par Site",
- "report.labe.date": "Rapport par Date"
-
+ "report.labe.date": "Rapport par Date",
+ "label.barcode.labelsets": "Nombre d'ensembles d'étiquettes",
+ "label.barcode.orderlabel": "Nombre d'étiquettes de commande par ensemble",
+ "label.barcode.specimenlabel": "Nombre d'étiquettes d'échantillon par ensemble",
+ "label.barcode.totallabel": "Nombre total d'étiquettes à imprimer"
}