Skip to content

Commit

Permalink
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
Browse files Browse the repository at this point in the history
  • Loading branch information
adityadeshlahre authored Jan 16, 2025
2 parents 38d867a + 5fd5349 commit a635f03
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ src/main/resources/adminPassword.txt
/.apt_generated/
*/plugins/*.jar
Patient/*
volume/database/data/
volume/*
6 changes: 6 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ export default function App() {
component={() => <Home />}
role=""
/>
<SecureRoute
path="/Dashboard"
exact
component={() => <Home />}
role=""
/>
<SecureRoute
path="/admin"
exact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ function OrganizationAddModify() {
isActive: typeOfActivity.isActive,
internetAddress: typeOfActivity.internetAddress,
selectedTypes: typeOfActivity.selectedTypes,
cliaNum: typeOfActivity.cliaNum,
streetAddress: typeOfActivity.streetAddress,
city: typeOfActivity.city,
};

const organizationsManagementIdInfoPost = {
Expand All @@ -169,6 +172,9 @@ function OrganizationAddModify() {
internetAddress: typeOfActivity.internetAddress,
selectedTypes: typeOfActivity.selectedTypes,
organization: typeOfActivity.organization,
cliaNum: typeOfActivity.cliaNum,
streetAddress: typeOfActivity.streetAddress,
city: typeOfActivity.city,
};
setOrgInfo(organizationsManagementIdInfo);
setOrgInfoPost(organizationsManagementIdInfoPost);
Expand Down Expand Up @@ -230,6 +236,42 @@ function OrganizationAddModify() {
}));
}

function handleStreetAddressChange(e) {
setSaveButton(false);
setOrgInfoPost((prevOrgInfoPost) => ({
...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) => ({
Expand Down Expand Up @@ -501,7 +543,7 @@ function OrganizationAddModify() {
</Column>
<Column lg={8} md={4} sm={4}>
<TextInput
id="internet-address"
id="org-internet-address"
className="defalut"
type="text"
labelText=""
Expand All @@ -519,6 +561,80 @@ function OrganizationAddModify() {
/>
</Column>
</Grid>
<Grid fullWidth={true}>
<Column lg={8} md={4} sm={4}>
<>
<FormattedMessage id="organization.streetAddress" /> :
</>
</Column>
<Column lg={8} md={4} sm={4}>
<TextInput
id="org-street-address"
className="defalut"
type="text"
labelText=""
maxLength={15}
placeholder={intl.formatMessage({
id: "organization.add.placeholder",
})}
// invalid={errors.order && touched.order}
// invalidText={errors.order}
// required={true}
value={
orgInfo && orgInfo.streetAddress
? orgInfo.streetAddress
: ""
}
onChange={(e) => handleStreetAddressChange(e)}
/>
</Column>
</Grid>
<Grid fullWidth={true}>
<Column lg={8} md={4} sm={4}>
<>
<FormattedMessage id="organization.city" /> :
</>
</Column>
<Column lg={8} md={4} sm={4}>
<TextInput
id="org-city"
className="defalut"
type="text"
labelText=""
maxLength={15}
placeholder={intl.formatMessage({
id: "organization.add.placeholder",
})}
// invalid={errors.order && touched.order}
// invalidText={errors.order}
// required={true}
value={orgInfo && orgInfo.city ? orgInfo.city : ""}
onChange={(e) => handleCityChange(e)}
/>
</Column>
</Grid>
<Grid fullWidth={true}>
<Column lg={8} md={4} sm={4}>
<>
<FormattedMessage id="organization.clia.number" /> :
</>
</Column>
<Column lg={8} md={4} sm={4}>
<TextInput
id="org-clia-number"
className="defalut"
type="text"
placeholder={intl.formatMessage({
id: "organization.add.placeholder",
})}
// invalid={errors.order && touched.order}
// invalidText={errors.order}
// required={true}
value={orgInfo && orgInfo.cliaNum ? orgInfo.cliaNum : ""}
onChange={(e) => handleCliaNumberChange(e)}
/>
</Column>
</Grid>
<Grid fullWidth={true}>
<Column lg={8} md={4} sm={4}>
<>
Expand Down Expand Up @@ -623,16 +739,10 @@ function OrganizationAddModify() {
<TableSelectAll
id="table-select-all"
{...getSelectionProps()}
checked={
selectedRowIds.length === pageSize &&
typeOfActivityShow
.slice((page - 1) * pageSize, page * pageSize)
.filter(
(row) =>
!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 <
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 || "",
};
},
);
Expand Down Expand Up @@ -393,6 +395,12 @@ function OrganizationManagement() {
id: "organization.isActive",
}),
},
{
key: "internetAddress",
header: intl.formatMessage({
id: "organization.internetaddress",
}),
},
{
key: "streetAddress",
header: intl.formatMessage({
Expand Down Expand Up @@ -612,6 +620,12 @@ function OrganizationManagement() {
id: "organization.isActive",
}),
},
{
key: "internetAddress",
header: intl.formatMessage({
id: "organization.internetaddress",
}),
},
{
key: "streetAddress",
header: intl.formatMessage({
Expand Down
26 changes: 20 additions & 6 deletions frontend/src/components/common/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 6 additions & 9 deletions frontend/src/components/layout/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,12 @@ function OEHeader(props) {
>
<SideNavItems>
{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 + "]",
);
})}
</SideNavItems>
</SideNav>
Expand Down
26 changes: 23 additions & 3 deletions frontend/src/components/reports/common/ReportByDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}
Expand All @@ -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) {
Expand All @@ -127,6 +140,9 @@ const ReportByDate = (props) => {
setTempData,
);
break;
case "CISampleRoutineExport":
getFromOpenElisServer("/rest/user-test-sections/ALL", setTempData);
break;
default:
break;
}
Expand All @@ -136,7 +152,8 @@ const ReportByDate = (props) => {
if (
props.report === "activityReportByTest" ||
props.report === "activityReportByPanel" ||
props.report === "activityReportByTestSection"
props.report === "activityReportByTestSection" ||
props.report === "CISampleRoutineExport"
) {
fetchData();
}
Expand Down Expand Up @@ -226,7 +243,10 @@ const ReportByDate = (props) => {
<SelectItem
key={"emptyselect"}
value={""}
text="Select Test Type"
text={intl.formatMessage({
id: getSelectLabel(),
defaultMessage: "Seelect Test",
})}
/>
{list.map((statusOption) => (
<SelectItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public abstract class CSVRoutineSampleExportReport extends CSVRoutineExportRepor

protected String lowDateStr;
protected String highDateStr;
protected String selectedLabUnit;
protected List<Object> reportItems;
protected int iReportItem = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
Loading

0 comments on commit a635f03

Please sign in to comment.