Skip to content

Commit

Permalink
Merge pull request #714 from adityadeshlahre/fix-705-rewriting-patien…
Browse files Browse the repository at this point in the history
…t-report-screen

Fix 705 rewriting patient report screen
  • Loading branch information
mozzy11 committed Mar 18, 2024
2 parents a5645fc + fedfa1f commit 902157d
Show file tree
Hide file tree
Showing 7 changed files with 890 additions and 23 deletions.
1 change: 0 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import RoutineIndex from "./components/Reports/routine/Index.js";
import StudyIndex from "./components/Reports/study/index.js";
import PrintBarcode from "./components/printBarcode/Index";


export default function App() {
let i18nConfig = {
locale: navigator.language.split(/[-_]/)[0],
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/components/Reports/Routine.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ export const RoutineReportsMenu = {
icon: IbmWatsonDiscovery,
SideNavMenuItem: [
{
link:
config.serverBaseUrl +
"/Report?type=patient&report=patientCILNSP_vreduit",

link: "/RoutineReport?type=patient&report=patientCILNSP_vreduit",
label: <FormattedMessage id="sidenav.label.statusreport"/>,
},
],
Expand Down
16 changes: 3 additions & 13 deletions frontend/src/components/Reports/routine/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Loading,
} from "@carbon/react";
import { injectIntl, FormattedMessage, useIntl } from "react-intl";
import config from "../../../config.json";
import PatientStatusReport from "./PatientStatusReport";
import StatisticsReport from "./StatisticsReport";
import SummaryOfAllTest from "./SummaryOfAllTest";
import HIVTestSummary from "./HivTestSummary";
Expand All @@ -23,22 +23,14 @@ const RoutineIndex = () => {

const [type, setType] = useState("");
const [report, setReport] = useState("");
const [source, setSource] = useState("");
const [isLoading, setIsLoading] = useState(true);


useEffect(() => {


const params = new URLSearchParams(window.location.search);
const paramType = params.get("type");
const paramReport = params.get("report");

setType(paramType);
setReport(paramReport);



if (paramType && paramReport) {
setIsLoading(false);
} else {
Expand All @@ -54,7 +46,6 @@ const RoutineIndex = () => {
<BreadcrumbItem href="/">
{intl.formatMessage({ id: "home.label" })}
</BreadcrumbItem>

</Breadcrumb>
</Column>
</Grid>
Expand All @@ -74,7 +65,8 @@ const RoutineIndex = () => {
{isLoading && <Loading />}
{!isLoading && (
<>

{type === "patient" && report === "patientCILNSP_vreduit" &&
(<PatientStatusReport />)}

{type === "indicator" &&
report === "statisticsReport" &&
Expand All @@ -84,11 +76,9 @@ const RoutineIndex = () => {
report === "indicatorHaitiLNSPAllTests" &&
( <SummaryOfAllTest /> )}


{type === "indicator" &&
report === "indicatorCDILNSPHIV" &&
(<HIVTestSummary/>)}

</>
)}
</div>
Expand Down
Loading

0 comments on commit 902157d

Please sign in to comment.