Skip to content

Commit

Permalink
Merge pull request #1147 from mozzy11/develop
Browse files Browse the repository at this point in the history
update Routine Export report permision
  • Loading branch information
mozzy11 committed Jun 27, 2024
2 parents 64d2fa0 + c70a1ae commit b44e2ce
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ src/main/resources/adminPassword.txt
/bin/
/.apt_generated/
*/plugins/*.jar
Patient/*
2 changes: 1 addition & 1 deletion frontend/src/components/reports/Routine.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const RoutineReportsMenu = {
icon: IbmWatsonNaturalLanguageUnderstanding,
SideNavMenuItem: [
{
link: "/RoutineReport?type=patient&report=CISampleRoutineExport",
link: "/RoutineReport?type=routine&report=CISampleRoutineExport",
label: <FormattedMessage id="sideNav.label.exportcsvfile" />,
},
],
Expand Down
28 changes: 11 additions & 17 deletions frontend/src/components/reports/common/PatientStatusReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function PatientStatusReport(props) {
const handleReportPrint = () => {
let barcodesPdf =
config.serverBaseUrl +
`/ReportPrint?report=${props.report}&type=patient&accessionDirect=${reportFormValues.form}&highAccessionDirect=${reportFormValues.to}&dateOfBirthSearchValue=&selPatient=${reportFormValues.selectedPatientId}&referringSiteId=${reportFormValues.referringSiteId}&referringSiteDepartmentId=${reportFormValues.referringSiteName}&onlyResults=${result}&_onlyResults=${checkbox}&dateType=${items}&lowerDateRange=${reportFormValues.startDate}&upperDateRange=${reportFormValues.endDate}`;
`/ReportPrint?report=${props.report}&type=patient&accessionDirect=${reportFormValues.form}&highAccessionDirect=${reportFormValues.to}&dateOfBirthSearchValue=&selPatient=${reportFormValues.selectedPatientId}&referringSiteId=${reportFormValues.referringSiteId}&referringSiteDepartmentId=${reportFormValues.referringSiteDepartmentId ? reportFormValues.referringSiteDepartmentId : ""}&onlyResults=${result}&_onlyResults=${checkbox}&dateType=${items}&lowerDateRange=${reportFormValues.startDate}&upperDateRange=${reportFormValues.endDate}`;
window.open(barcodesPdf);
};

Expand Down Expand Up @@ -343,22 +343,16 @@ function PatientStatusReport(props) {
</Select>
</Column>
</Grid>
</AccordionItem>
</Accordion>
<Grid fullWidth={true}>
<Column lg={16} md={8} sm={4}>
<br />
</Column>
<Column lg={16} md={8} sm={4}>
<h5>
<FormattedMessage id="report.patient.site.description" />
</h5>
</Column>
</Grid>
<Accordion>
<AccordionItem
title={intl.formatMessage({ id: "report.labe.date" })}
>
<Grid fullWidth={true}>
<Column lg={16} md={8} sm={4}>
<br />
</Column>
<Column lg={16} md={8} sm={4}>
<h6>
<FormattedMessage id="report.patient.site.description" />
</h6>
</Column>
</Grid>
<Grid fullWidth={true}>
<Column lg={4} md={8} sm={4}>
<Checkbox
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/reports/common/ReportByDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ const ReportByDate = (props) => {
props.report === "activityReportByTestSection"
) {
baseParams = `type=indicator&report=${props.report}&selectList.selection=${reportFormValues.value}`;
} else if (props.report === "CISampleRoutineExport") {
baseParams = `report=${props.report}&type=routine`;
} else {
baseParams = `report=${props.report}&type=patient`;
}
const baseUrl = `${config.serverBaseUrl}/ReportPrint`;

const url = `${baseUrl}?${baseParams}&upperDateRange=${reportFormValues.endDate}&lowerDateRange=${reportFormValues.startDate}`;

window.open(url, "_blank");
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/reports/routine/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const RoutineReports = (props) => {
/>
)}

{type === "patient" && report === "CISampleRoutineExport" && (
{type === "routine" && report === "CISampleRoutineExport" && (
<ReportByDate
report={"CISampleRoutineExport"}
id={"sideNav.label.exportcsvfile"}
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/components/resultPage/SearchResultForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1428,12 +1428,22 @@ export function SearchResults(props) {
"testResult[" + rowId + "].referralItem.referredTestId",
testId,
);
jp.value(
form,
"testResult[" + rowId + "].referralItem.referredSendDate",
configurationProperties.currentDateAsText,
);
} else {
jp.value(
form,
"testResult[" + rowId + "].referralItem.referredTestId",
"",
);
jp.value(
form,
"testResult[" + rowId + "].referralItem.referredSendDate",
"",
);
}
var isModified = "testResult[" + rowId + "].isModified";
jp.value(form, isModified, "true");
Expand Down
60 changes: 60 additions & 0 deletions src/main/resources/liquibase/2.8.x.x/update_default_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,65 @@
<where>name = 'restrictFreeTextProviderEntry' AND description = 'should national ID be required on the patient entry screen'</where>
</update>
</changeSet>
<changeSet author="mozzymutesa" id="3">
<preConditions onFail="MARK_RAN">
<tableExists tableName="system_module"
schemaName="clinlims" />
<sqlCheck expectedResult="0">
SELECT COUNT(*) FROM clinlims.system_module WHERE name = 'Report:RoutineExport'
</sqlCheck>
</preConditions>
<comment>Create AdminReportPrint Module </comment>

<insert schemaName="clinlims" tableName="system_module">
<column name="id" valueSequenceNext="system_module_seq" />
<column name="name" value="Report:RoutineExport" />
<column name="description" value="Report => Routine => Eport Routine" />
</insert>
<insert tableName="system_role_module" schemaName="clinlims">
<column name="id" valueSequenceNext="system_role_module_seq" />
<column name="has_select" value="Y" />
<column name="has_add" value="Y" />
<column name="has_update" value="Y" />
<column name="system_role_id"
valueComputed="(SELECT id FROM clinlims.system_role WHERE name = 'Global Administrator')" />
<column name="system_module_id"
valueComputed="(SELECT id FROM clinlims.system_module WHERE name = 'Report:RoutineExport')" />
</insert>
<insert schemaName="clinlims"
tableName="system_module_param">
<column name="id" valueSequenceNext="system_module_param_seq" />
<column name="name" value="report"/>
<column name="value" value="CISampleRoutineExport"/>
</insert>
<insert tableName="system_module_url" schemaName="clinlims">
<column name="id" valueSequenceNext="system_module_url_seq" />
<column name="url_path" value="/ReportPrint" />
<column name="system_module_id"
valueComputed="(SELECT id FROM clinlims.system_module WHERE name = 'Report:RoutineExport')" />
<column name="system_module_param_id" valueComputed="(SELECT id FROM system_module_param WHERE value = 'CISampleRoutineExport')"/>
</insert>
<insert tableName="system_module_url" schemaName="clinlims">
<column name="id" valueSequenceNext="system_module_url_seq" />
<column name="url_path" value="/Report" />
<column name="system_module_id"
valueComputed="(SELECT id FROM clinlims.system_module WHERE name = 'Report:RoutineExport')" />
<column name="system_module_param_id" valueComputed="(SELECT id FROM system_module_param WHERE value = 'CISampleRoutineExport')"/>
</insert>
</changeSet>
<changeSet author="mozzymutesa" id="4">
<preConditions onFail="MARK_RAN">
<tableExists tableName="menu"
schemaName="clinlims" />
<sqlCheck expectedResult="0">
SELECT COUNT(*) FROM clinlims.menu WHERE action_url = '/Report?type=routine&amp;report=CISampleRoutineExport' AND element_id = 'menu_reports_export_routine' ;
</sqlCheck>
</preConditions>
<comment>update action url of Routine Export report</comment>
<update tableName="menu" schemaName="clinlims">
<column name="action_url" value="/Report?type=routine&amp;report=CISampleRoutineExport" />
<where>element_id='menu_reports_export_routine'</where>
</update>
</changeSet>

</databaseChangeLog>

0 comments on commit b44e2ce

Please sign in to comment.