Skip to content

Commit

Permalink
Merge branch 'I-TECH-UW:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pascagihozo authored Oct 18, 2024
2 parents 1bf698f + b8259d8 commit c04bc4c
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 45 deletions.
3 changes: 2 additions & 1 deletion frontend/cypress/e2e/report.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,9 @@ describe("Study Reports", function () {
reportPage.visitAuditTrailReport();
reportPage.verifyHeaderText("section > h3", "Audit Trail");
cy.fixture("EnteredOrder").then((order) => {
console.log("******** generated Lab No. " + order.labNo)
reportPage.typeInField("labNo", order.labNo);
});
reportPage.validateAudit();
//reportPage.validateAudit();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const PatientStatusReportFormValues = {
referringSiteName: "",
startDate: "",
endDate: "",
form: "",
from: "",
to: "",
dateType: "",
checkbox: "",
Expand Down
50 changes: 34 additions & 16 deletions frontend/src/components/home/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from "@carbon/react";
import "./Dashboard.css";
import { Minimize, Maximize } from "@carbon/react/icons";
import { Copy } from "@carbon/icons-react";
import { useState, useEffect, useRef, useContext } from "react";
import {
getFromOpenElisServer,
Expand Down Expand Up @@ -407,22 +408,39 @@ const HomeDashBoard: React.FC<DashBoardProps> = () => {
return (
<TableCell key={cell.id}>
<>
{selectedTile.type == "ORDERS_IN_PROGRESS" ||
selectedTile.type == "ORDERS_READY_FOR_VALIDATION" ? (
<Link
style={{ color: "blue" }}
href={
selectedTile.type == "ORDERS_IN_PROGRESS"
? "/result?type=order&doRange=false&accessionNumber=" +
cell.value
: "validation?type=order&accessionNumber=" + cell.value
}
>
<u>{convertAlphaNumLabNumForDisplay(cell.value)}</u>
</Link>
) : (
<> {convertAlphaNumLabNumForDisplay(cell.value)}</>
)}
<div style={{ display: "flex", alignItems: "center" }}>
<Button
onClick={async () => {
if ("clipboard" in navigator) {
return await navigator.clipboard.writeText(cell.value);
} else {
return document.execCommand("copy", true, cell.value);
}
}}
kind="ghost"
iconDescription={intl.formatMessage({
id: "instructions.copy.labnum",
})}
hasIconOnly
renderIcon={Copy}
/>
{selectedTile.type == "ORDERS_IN_PROGRESS" ||
selectedTile.type == "ORDERS_READY_FOR_VALIDATION" ? (
<Link
style={{ color: "blue" }}
href={
selectedTile.type == "ORDERS_IN_PROGRESS"
? "/result?type=order&doRange=false&accessionNumber=" +
cell.value
: "validation?type=order&accessionNumber=" + cell.value
}
>
<u>{convertAlphaNumLabNumForDisplay(cell.value)}</u>
</Link>
) : (
<> {convertAlphaNumLabNumForDisplay(cell.value)}</>
)}
</div>
</>
</TableCell>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const AuditTrailReport = ({ id }) => {
const [isLoading, setIsLoading] = useState(false);
const [showNotification, setShowNotification] = useState(false);
const [page, setPage] = useState(1);
const [pageSize, setPageSize] = useState(5);
const [pageSize, setPageSize] = useState(30);
const [auditTrailItems, setAuditTrailItems] = useState([]);
const [data, setData] = useState(null);

Expand Down Expand Up @@ -117,7 +117,7 @@ const AuditTrailReport = ({ id }) => {
defaultMessage: "Lab No",
})}
value={labNo}
onChange={(event) => setLabNo(event.target.value)}
onChange={(event, rowValue) => setLabNo(rowValue)}
invalid={
isLabNoError
? intl.formatMessage({
Expand Down Expand Up @@ -308,7 +308,7 @@ const AuditTrailReport = ({ id }) => {
onChange={handlePageChange}
page={page}
pageSize={pageSize}
pageSizes={[5, 10, 20, 30]}
pageSizes={[10, 30, 50, 100]}
totalItems={auditTrailItems.length}
forwardText={intl.formatMessage({ id: "pagination.forward" })}
backwardText={intl.formatMessage({ id: "pagination.backward" })}
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/reports/common/PatientStatusReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@ 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.referringSiteDepartmentId ? reportFormValues.referringSiteDepartmentId : ""}&onlyResults=${result}&_onlyResults=${checkbox}&dateType=${items}&lowerDateRange=${reportFormValues.startDate}&upperDateRange=${reportFormValues.endDate}`;
`/ReportPrint?report=${props.report}&type=patient&accessionDirect=${reportFormValues.from}&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);
};

function handlePatientIdFrom(e) {
function handlePatientIdFrom(value) {
setReportFormValues({
...reportFormValues,
form: e.target.value,
from: value,
});
}

function handlePatientIdTo(e) {
function handlePatientIdTo(value) {
setReportFormValues({
...reportFormValues,
to: e.target.value,
to: value,
});
}

Expand Down Expand Up @@ -250,7 +250,7 @@ function PatientStatusReport(props) {
id={field.name}
onChange={(e, rawValue) => {
setFieldValue(field.name, rawValue);
handlePatientIdFrom(e);
handlePatientIdFrom(rawValue);
}}
/>
)}
Expand All @@ -269,7 +269,7 @@ function PatientStatusReport(props) {
id={field.name}
onChange={(e, rawValue) => {
setFieldValue(field.name, rawValue);
handlePatientIdTo(e);
handlePatientIdTo(rawValue);
}}
/>
)}
Expand Down
18 changes: 12 additions & 6 deletions frontend/src/components/resultPage/SearchResultForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,29 +481,35 @@ export function SearchResultForm(props) {
<Column lg={6} sm={4}>
<Field name="startLabNo">
{({ field }) => (
<TextInput
placeholder={"Enter LabNo"}
<CustomLabNumberInput
placeholder="Enter Accession No."
name={field.name}
id={field.name}
defaultValue={values["accessionNumber"]}
value={values[field.name]}
labelText={
<FormattedMessage id="search.label.fromaccession" />
}
onChange={(e, rawValue) => {
setFieldValue(field.name, rawValue);
}}
/>
)}
</Field>
</Column>
<Column lg={6} sm={4}>
<Field name="endLabNo">
{({ field }) => (
<TextInput
placeholder={"Enter LabNo"}
<CustomLabNumberInput
placeholder="Enter Accession No."
name={field.name}
id={field.name}
defaultValue={values["endLabNo"]}
value={values[field.name]}
labelText={
<FormattedMessage id="search.label.toaccession" />
}
onChange={(e, rawValue) => {
setFieldValue(field.name, rawValue);
}}
/>
)}
</Field>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<minor.version>0</minor.version>
<state.version>3</state.version>
<!-- 0 = alpha, 1 = beta, 2 = rc, 3 = deployable -->
<fix.version>2</fix.version>
<fix.version>3</fix.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<liquibase.propertyFile>${project.basedir}/liquibase/liquibase.properties</liquibase.propertyFile>
<castor.version>1.4.1</castor.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.openelisglobal.patient.util.PatientUtil;
import org.openelisglobal.patient.valueholder.Patient;
import org.openelisglobal.program.service.ProgramSampleService;
import org.openelisglobal.program.valueholder.ProgramSample;
import org.openelisglobal.result.service.ResultService;
import org.openelisglobal.result.valueholder.Result;
import org.openelisglobal.sample.bean.SampleOrderItem;
Expand Down Expand Up @@ -94,7 +95,10 @@ public List<AuditTrailItem> getAuditTrail() throws IllegalStateException {
items.addAll(addPatientHistory());
items.addAll(addNotes());
items.addAll(addQAEvents());
items.addAll(addProgram());
if (!addProgram().isEmpty()) {
items.addAll(addProgram());
}

}

sortItemsByTime(items);
Expand Down Expand Up @@ -291,8 +295,12 @@ private Collection<AuditTrailItem> addProgram() {
if (sample != null) {
String programName = observationHistoryService.getRawValueForSample(ObservationType.PROGRAM,
sample.getId());
AbstractHistoryService historyService = new ProgramSampleHistoryService(
programSampleService.getProgrammeSampleBySample(Integer.valueOf(sample.getId()), programName));
ProgramSample programSample = programSampleService
.getProgrammeSampleBySample(Integer.valueOf(sample.getId()), programName);
if (programSample == null) {
return programs;
}
AbstractHistoryService historyService = new ProgramSampleHistoryService(programSample);
programs.addAll(historyService.getAuditTrailItems());

// sortItems(notes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,16 @@ private List<Sample> findReportSamplesForSite(String referringSiteId, String ref

if (onlyResults) {
Set<Integer> analysisStatusIds = new HashSet<>();
analysisStatusIds.add(Integer.parseInt(
SpringContext.getBean(IStatusService.class).getStatusID(AnalysisStatus.BiologistRejected)));
analysisStatusIds.add(Integer
.parseInt(SpringContext.getBean(IStatusService.class).getStatusID(AnalysisStatus.Finalized)));
analysisStatusIds.add(Integer.parseInt(
SpringContext.getBean(IStatusService.class).getStatusID(AnalysisStatus.TechnicalAcceptance)));
analysisStatusIds.add(Integer.parseInt(
SpringContext.getBean(IStatusService.class).getStatusID(AnalysisStatus.TechnicalRejected)));
/**
* analysisStatusIds.add(Integer.parseInt(
* SpringContext.getBean(IStatusService.class).getStatusID(AnalysisStatus.BiologistRejected)));
* analysisStatusIds.add(Integer.parseInt(
* SpringContext.getBean(IStatusService.class).getStatusID(AnalysisStatus.TechnicalAcceptance)));
* analysisStatusIds.add(Integer.parseInt(
* SpringContext.getBean(IStatusService.class).getStatusID(AnalysisStatus.TechnicalRejected)));
**/
sampleList = sampleList.stream().filter(
e -> (analysisService.getAnalysesBySampleIdAndStatusId(e.getId(), analysisStatusIds).size() > 0))
.collect(Collectors.toList());
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/pages/patient/patientManagement.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function /*void*/ updatePatientAge( DOB )
{
var date = String( DOB.value );
var datePattern = '<%=LocaleConfiguraiton.getInstance().getPatternForDateLocale() %>';
var datePattern = '<%=DateUtil.getDateFormat() %>';
var splitPattern = datePattern.split("/");
var dayIndex = 0;
var monthIndex = 1;
Expand Down

0 comments on commit c04bc4c

Please sign in to comment.