Skip to content

Commit

Permalink
Improve Results and Validation Routing
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzy11 committed Mar 8, 2024
1 parent c72a339 commit 2bff70c
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 59 deletions.
59 changes: 9 additions & 50 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,66 +345,31 @@ export default function App() {
<SecureRoute
path="/LogbookResults"
exact
component={() => (
<>
{
(window.location.href =
"/result?type=unit&doRange=false")
}
</>
)}
component={() => <ResultSearch />}
role="Results"
/>
<SecureRoute
path="/PatientResults"
exact
component={() => (
<>
{
(window.location.href =
"/result?type=patient&doRange=false")
}
</>
)}
component={() => <ResultSearch />}
role="Results"
/>
<SecureRoute
path="/AccessionResults"
exact
component={() => (
<>
{
(window.location.href =
"/result?type=order&doRange=false")
}
</>
)}
component={() => <ResultSearch />}
role="Results"
/>
<SecureRoute
path="/StatusResults"
exact
component={() => (
<>
{
(window.location.href =
"result?type=date&doRange=false")
}
</>
)}
component={() => <ResultSearch />}
role="Results"
/>
<SecureRoute
path="/RangeResults"
exact
component={() => (
<>
{
(window.location.href =
"/result?type=range&doRange=true")
}
</>
)}
component={() => <ResultSearch />}
role="Results"
/>
<SecureRoute
Expand All @@ -414,7 +379,7 @@ export default function App() {
role="Reports"
/>
<SecureRoute
path="/AggregateReports"
path="/RoutineReport"
exact
component={() => <RoutineIndex />}
role="Reports"
Expand All @@ -434,25 +399,19 @@ export default function App() {
<SecureRoute
path="/ResultValidation"
exact
component={() => (
<>{(window.location.href = "/validation?type=routine")}</>
)}
component={() => <StudyValidation />}
role="Validation"
/>
<SecureRoute
path="/AccessionValidation"
exact
component={() => (
<>{(window.location.href = "/validation?type=order")}</>
)}
component={() => <StudyValidation />}
role="Validation"
/>
<SecureRoute
path="/AccessionValidationRange"
exact
component={() => (
<>{(window.location.href = "/validation?type=range")}</>
)}
component={() => <StudyValidation />}
role="Validation"
/>
<SecureRoute
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Reports/Routine.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export const RoutineReportsMenu = {
icon: Microscope,
SideNavMenuItem: [
{
link: "/AggregateReports?type=indicator&report=statisticsReport",
link: "/RoutineReport?type=indicator&report=statisticsReport",
label: <FormattedMessage id= "sidenav.label.statisticsreport"/>,
},
{
link: "/AggregateReports?type=indicator&report=indicatorHaitiLNSPAllTests",
link: "/RoutineReport?type=indicator&report=indicatorHaitiLNSPAllTests",
label: <FormattedMessage id= "sidenav.label.testsummary"/>
},
{
link:"/AggregateReports?type=indicator&report=indicatorCDILNSPHIV",
link:"/RoutineReport?type=indicator&report=indicatorCDILNSPHIV",
label: <FormattedMessage id="sideNav.label.hivtestsummary"/>,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const statisticsReport = () => {
const [selectedLabUnits, setSelectedLabUnits] = useState([]);
const [selectedPriorities, setSelectedPriorities] = useState([]);
const [selectedTimeFrames, setSelectedTimeFrames] = useState([]);
const [selectedYear, setSelectedYear] = useState(new Date().getFullYear());
const [selectedYear, setSelectedYear] = useState({ value: new Date().getFullYear(), label: new Date().getFullYear()});

const [loading, setLoading] = useState(false);
const [notificationVisible, setNotificationVisible] = useState(false);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/pathology/PathologyDashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 50px;
padding: 50px;
}

.dashboard-tile {
Expand Down
29 changes: 25 additions & 4 deletions frontend/src/components/resultPage/SearchResultForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,38 @@ export function SearchResultForm(props) {
querySearch(values);
}

let displayFormType = new URLSearchParams(window.location.search).get(
"type",
);
let doRange = new URLSearchParams(window.location.search).get("doRange");

var displayFormType = "";
var doRange = "";
if(window.location.pathname == "/result"){
displayFormType = new URLSearchParams(window.location.search).get(
"type",
);
doRange = new URLSearchParams(window.location.search).get("doRange");
} else if(window.location.pathname == "/LogbookResults"){
displayFormType = "unit" ;
doRange = "false";
} else if(window.location.pathname == "/PatientResults"){
displayFormType = "patient" ;
doRange = "false";
}else if(window.location.pathname == "/AccessionResults"){
displayFormType = "order" ;
doRange = "false";
}else if(window.location.pathname == "/StatusResults"){
displayFormType = "date" ;
doRange = "false";
} else if(window.location.pathname == "/RangeResults"){
displayFormType = "range" ;
doRange = "true";
}
setSearchBy({
type: displayFormType,
doRange: doRange,
});
}, []);

useEffect(() => {

let accessionNumber = new URLSearchParams(window.location.search).get(
"accessionNumber",
);
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/components/validation/SearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,18 @@ const SearchForm = (props) => {
}

useEffect(() => {
let param = new URLSearchParams(window.location.search).get("type");
var param = "";
if(window.location.pathname == "/validation"){
param = new URLSearchParams(window.location.search).get("type");
} else if(window.location.pathname == "/ResultValidation"){
param = "routine" ;
} else if(window.location.pathname == "/AccessionValidation"){
param = "order" ;
}else if(window.location.pathname == "/AccessionValidationRange"){
param = "range" ;
}else if(window.location.pathname == "/ResultValidationByTestDate"){
param = "testDate";
}
setSearchBy(param);
if (param === "order") {
setDoRagnge(false);
Expand Down

0 comments on commit 2bff70c

Please sign in to comment.