diff --git a/.gitignore b/.gitignore index e104c9d495..00238874ba 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ src/main/resources/adminPassword.txt /.apt_generated/ */plugins/*.jar Patient/* -volume/database/data/ +volume/* diff --git a/frontend/src/App.js b/frontend/src/App.js index fb4752152b..5d4f6629a2 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -221,6 +221,12 @@ export default function App() { component={() => } role="" /> + } + role="" + /> ({ + ...prevOrgInfoPost, + streetAddress: e.target.value, + })); + setOrgInfo((prevOrgInfo) => ({ + ...prevOrgInfo, + streetAddress: e.target.value, + })); + } + + function handleCityChange(e) { + setSaveButton(false); + setOrgInfoPost((prevOrgInfoPost) => ({ + ...prevOrgInfoPost, + city: e.target.value, + })); + setOrgInfo((prevOrgInfo) => ({ + ...prevOrgInfo, + city: e.target.value, + })); + } + + function handleCliaNumberChange(e) { + setSaveButton(false); + setOrgInfoPost((prevOrgInfoPost) => ({ + ...prevOrgInfoPost, + cliaNum: e.target.value, + })); + setOrgInfo((prevOrgInfo) => ({ + ...prevOrgInfo, + cliaNum: e.target.value, + })); + } + function handleIsActiveChange(e) { setSaveButton(false); setOrgInfoPost((prevOrgInfoPost) => ({ @@ -501,7 +543,7 @@ function OrganizationAddModify() { + + + <> + : + + + + handleStreetAddressChange(e)} + /> + + + + + <> + : + + + + handleCityChange(e)} + /> + + + + + <> + : + + + + handleCliaNumberChange(e)} + /> + + <> @@ -623,16 +739,10 @@ function OrganizationAddModify() { - !row.disabled && - selectedRowIds.includes(row.id), - ).length === pageSize - } + checked={typeOfActivityShow + .slice((page - 1) * pageSize, page * pageSize) + .filter((row) => !row.disabled) + .every((row) => selectedRowIds.includes(row.id))} indeterminate={ selectedRowIds.length > 0 && selectedRowIds.length < diff --git a/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js b/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js index 9cb0d76c23..23f2775200 100644 --- a/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js +++ b/frontend/src/components/admin/OrganizationManagement/OrganizationManagement.js @@ -180,9 +180,10 @@ function OrganizationManagement() { : "", orgPrefix: item.shortName || "", active: item.isActive || "", - streetAddress: item.internetAddress || "", - city: item.state || "", - cliaNumber: item.cliaNumber || "", + internetAddress: item.internetAddress || "", + streetAddress: item.streetAddress || "", + city: item.city || "", + cliaNumber: item.cliaNum || "", }; }); const newOrganizationsManagementListArray = Object.values( @@ -212,9 +213,10 @@ function OrganizationManagement() { : "", orgPrefix: item.shortName || "", active: item.isActive || "", - streetAddress: item.internetAddress || "", - city: item.state || "", - cliaNumber: item.cliaNumber || "", + internetAddress: item.internetAddress || "", + streetAddress: item.streetAddress || "", + city: item.city || "", + cliaNumber: item.cliaNum || "", }; }, ); @@ -393,6 +395,12 @@ function OrganizationManagement() { id: "organization.isActive", }), }, + { + key: "internetAddress", + header: intl.formatMessage({ + id: "organization.internetaddress", + }), + }, { key: "streetAddress", header: intl.formatMessage({ @@ -612,6 +620,12 @@ function OrganizationManagement() { id: "organization.isActive", }), }, + { + key: "internetAddress", + header: intl.formatMessage({ + id: "organization.internetaddress", + }), + }, { key: "streetAddress", header: intl.formatMessage({ diff --git a/frontend/src/components/common/AutoComplete.js b/frontend/src/components/common/AutoComplete.js index 1cb61892d2..90ff473abe 100644 --- a/frontend/src/components/common/AutoComplete.js +++ b/frontend/src/components/common/AutoComplete.js @@ -67,17 +67,31 @@ function AutoComplete(props) { }; const onKeyDown = (e) => { + // Handeling enter key + const { onSelect } = props; if (e.keyCode === 13) { - setActiveSuggestion(0); - setUserInput(filteredSuggestions[activeSuggestion]); - setShowSuggestions(false); - } else if (e.keyCode === 38) { + if (filteredSuggestions[activeSuggestion]) { + const selectedValue = filteredSuggestions[activeSuggestion].value; + setUserInput(selectedValue); + setTextValue(selectedValue); + setShowSuggestions(false); + setInvalid(false); + + if (typeof onSelect === "function") { + onSelect(filteredSuggestions[activeSuggestion].id); + } + } + } + // Handeling up arrow + else if (e.keyCode === 38) { if (activeSuggestion === 0) { return; } setActiveSuggestion(activeSuggestion - 1); - } else if (e.keyCode === 40) { - if (activeSuggestion - 1 === filteredSuggestions.length) { + } + // Handeling down arrow + else if (e.keyCode === 40) { + if (activeSuggestion === filteredSuggestions.length - 1) { return; } setActiveSuggestion(activeSuggestion + 1); diff --git a/frontend/src/components/layout/Header.js b/frontend/src/components/layout/Header.js index b1692ad196..a345dc8f43 100644 --- a/frontend/src/components/layout/Header.js +++ b/frontend/src/components/layout/Header.js @@ -580,15 +580,12 @@ function OEHeader(props) { > {menus["menu"].map((childMenuItem, index) => { - // ignore the Home Menu in the new UI - if (childMenuItem.menu.elementId != "menu_home") { - return generateMenuItems( - childMenuItem, - index, - 0, - "$.menu[" + index + "]", - ); - } + return generateMenuItems( + childMenuItem, + index, + 0, + "$.menu[" + index + "]", + ); })} diff --git a/frontend/src/components/reports/common/ReportByDate.js b/frontend/src/components/reports/common/ReportByDate.js index 0cd3c81d2d..43d3617bd1 100644 --- a/frontend/src/components/reports/common/ReportByDate.js +++ b/frontend/src/components/reports/common/ReportByDate.js @@ -94,7 +94,7 @@ const ReportByDate = (props) => { ) { baseParams = `type=indicator&report=${props.report}&selectList.selection=${reportFormValues.value}`; } else if (props.report === "CISampleRoutineExport") { - baseParams = `report=${props.report}&type=routine`; + baseParams = `report=${props.report}&type=routine${reportFormValues.value ? `&selectList.selection=${reportFormValues.value}` : ""}`; } else { baseParams = `report=${props.report}&type=patient`; } @@ -112,6 +112,19 @@ const ReportByDate = (props) => { setLoading(false); }; + const getSelectLabel = () => { + switch (props.report) { + case "activityReportByTest": + return "input.placeholder.selectTest"; + case "activityReportByPanel": + return "input.placeholder.selectPanel"; + case "activityReportByTestSection": + return "input.placeholder.selectTestSection"; + case "CISampleRoutineExport": + return "input.placeholder.selectTestSection"; + } + }; + useEffect(() => { const fetchData = async () => { switch (props.report) { @@ -127,6 +140,9 @@ const ReportByDate = (props) => { setTempData, ); break; + case "CISampleRoutineExport": + getFromOpenElisServer("/rest/user-test-sections/ALL", setTempData); + break; default: break; } @@ -136,7 +152,8 @@ const ReportByDate = (props) => { if ( props.report === "activityReportByTest" || props.report === "activityReportByPanel" || - props.report === "activityReportByTestSection" + props.report === "activityReportByTestSection" || + props.report === "CISampleRoutineExport" ) { fetchData(); } @@ -226,7 +243,10 @@ const ReportByDate = (props) => { {list.map((statusOption) => ( reportItems; protected int iReportItem = -1; diff --git a/src/main/java/org/openelisglobal/reports/action/implementation/ExportRoutineByDate.java b/src/main/java/org/openelisglobal/reports/action/implementation/ExportRoutineByDate.java index 4c20de0a8e..2e08b9a885 100644 --- a/src/main/java/org/openelisglobal/reports/action/implementation/ExportRoutineByDate.java +++ b/src/main/java/org/openelisglobal/reports/action/implementation/ExportRoutineByDate.java @@ -72,6 +72,10 @@ public void initializeReport(ReportForm form) { lowDateStr = form.getLowerDateRange(); highDateStr = form.getUpperDateRange(); + if (form.getSelectList() != null && form.getSelectList().getSelection() != null) { + selectedLabUnit = form.getSelectList().getSelection(); + } + // projectStr = form.getProjectCode(); dateRange = new DateRange(lowDateStr, highDateStr); @@ -112,6 +116,9 @@ private boolean validateSubmitParameters() { private void createReportItems() { try { csvRoutineColumnBuilder = getColumnBuilder(); + if (selectedLabUnit != null) { + csvRoutineColumnBuilder.setSelectedLabUnit(selectedLabUnit); + } csvRoutineColumnBuilder.buildDataSource(); } catch (SQLException e) { Log.error("Error in " + this.getClass().getSimpleName() + ".createReportItems: ", e); diff --git a/src/main/java/org/openelisglobal/reports/action/implementation/reportBeans/CSVRoutineColumnBuilder.java b/src/main/java/org/openelisglobal/reports/action/implementation/reportBeans/CSVRoutineColumnBuilder.java index a4884985ea..3383de1076 100644 --- a/src/main/java/org/openelisglobal/reports/action/implementation/reportBeans/CSVRoutineColumnBuilder.java +++ b/src/main/java/org/openelisglobal/reports/action/implementation/reportBeans/CSVRoutineColumnBuilder.java @@ -59,6 +59,15 @@ * @since Mar 18, 2011 */ public abstract class CSVRoutineColumnBuilder { + protected String selectedLabUnit; + + public String getSelectedLabUnit() { + return selectedLabUnit; + } + + public void setSelectedLabUnit(String selectedLabUnit) { + this.selectedLabUnit = selectedLabUnit; + } // these are used so we are not passing around strings in the methods that are // appended to sql @@ -530,6 +539,10 @@ protected void appendResultCrosstab(java.sql.Date lowDate, java.sql.Date highDat SQLConstant listName = SQLConstant.RESULT; query.append(", \n\n ( SELECT si.samp_id, si.id AS sampleItem_id, si.sort_order AS sampleItemNo, " + listName + ".* " + " FROM sample_item AS si JOIN \n "); + String labUnitFilter = ""; + if (selectedLabUnit != null && !selectedLabUnit.isEmpty()) { + labUnitFilter = " AND ts.id = " + selectedLabUnit; + } // Begin cross tab / pivot table query.append(" crosstab( \n" + " 'SELECT si.id, t.description, replace(replace(replace(replace(r.value ,E''\\n" @@ -548,7 +561,7 @@ protected void appendResultCrosstab(java.sql.Date lowDate, java.sql.Date highDat // + (( excludeAnalytes == null)?"": // " AND r.analyte_id NOT IN ( " + excludeAnalytes) + ")" // + " AND a.test_id = t.id " - + "\n ORDER BY 1, 2 " + + labUnitFilter + "\n ORDER BY 1, 2 " + "\n ', 'SELECT t.description FROM test t where t.is_active = ''Y'' ORDER BY 1' ) "); // end of cross tab @@ -725,4 +738,4 @@ protected String getGendCD4CountAnalyteId() { } return gendCD4CountAnalyteId; } -} +} \ No newline at end of file