Skip to content

Commit 5d2f804

Browse files
committed
fix comments and refactor apiUrl
1 parent 197f806 commit 5d2f804

19 files changed

+152
-519
lines changed

src/completed-list/completed-list.component.tsx

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ interface CompletedListProps {
3737
const CompletedList: React.FC<CompletedListProps> = ({ fulfillerStatus }) => {
3838
const { t } = useTranslation();
3939

40-
const [activatedOnOrAfterDate, setActivatedOnOrAfterDate] = useState("");
41-
42-
const { workListEntries, isLoading } = useGetOrdersWorklist(
43-
activatedOnOrAfterDate,
44-
fulfillerStatus
45-
);
40+
const { workListEntries, isLoading } = useGetOrdersWorklist(fulfillerStatus);
4641

4742
const pageSizes = [10, 20, 30, 40, 50];
4843
const [currentPageSize, setPageSize] = useState(10);
@@ -79,38 +74,30 @@ const CompletedList: React.FC<CompletedListProps> = ({ fulfillerStatus }) => {
7974
.map((entry) => ({
8075
...entry,
8176
id: entry?.uuid,
82-
date: <span>{formatDate(parseDate(entry?.dateActivated))}</span>,
77+
date: formatDate(parseDate(entry?.dateActivated)),
8378

84-
patient: {
85-
content: (
86-
<ConfigurableLink
87-
to={`\${openmrsSpaBase}/patient/${entry?.patient?.uuid}/chart/laboratory-orders`}
88-
>
89-
{entry?.patient?.display.split("-")[1]}
90-
</ConfigurableLink>
91-
),
92-
},
93-
orderNumber: <span>{entry?.orderNumber}</span>,
94-
accessionNumber: <span>{entry?.accessionNumber}</span>,
95-
test: <span>{entry?.concept?.display}</span>,
96-
action: <span>{entry?.action}</span>,
97-
status: {
98-
content: (
99-
<>
100-
<Tag>
101-
<span
102-
className={styles.statusContainer}
103-
style={{ color: `${getStatusColor(entry?.fulfillerStatus)}` }}
104-
>
105-
<span>{entry?.fulfillerStatus}</span>
106-
</span>
107-
</Tag>
108-
</>
109-
),
110-
},
111-
orderer: <span>{entry?.orderer?.display}</span>,
112-
orderType: <span>{entry?.orderType.display}</span>,
113-
urgency: <span>{entry?.urgency}</span>,
79+
patient: (
80+
<ConfigurableLink
81+
to={`\${openmrsSpaBase}/patient/${entry?.patient?.uuid}/chart/laboratory-orders`}
82+
>
83+
{entry?.patient?.display.split("-")[1]}
84+
</ConfigurableLink>
85+
),
86+
orderNumber: entry?.orderNumber,
87+
accessionNumber: entry?.accessionNumber,
88+
test: entry?.concept?.display,
89+
action: entry?.action,
90+
status: (
91+
<span
92+
className={styles.statusContainer}
93+
style={{ color: `${getStatusColor(entry?.fulfillerStatus)}` }}
94+
>
95+
{entry?.fulfillerStatus}
96+
</span>
97+
),
98+
orderer: entry?.orderer?.display,
99+
orderType: entry?.orderType.display,
100+
urgency: entry?.urgency,
114101
}));
115102
}, [fulfillerStatus, paginatedWorkListEntries]);
116103

@@ -136,20 +123,6 @@ const CompletedList: React.FC<CompletedListProps> = ({ fulfillerStatus }) => {
136123
}}
137124
>
138125
<TableToolbarContent>
139-
<Layer style={{ margin: "5px" }}>
140-
<DatePicker dateFormat="Y-m-d" datePickerType="single">
141-
<DatePickerInput
142-
labelText={""}
143-
id="activatedOnOrAfterDate"
144-
placeholder="YYYY-MM-DD"
145-
onChange={(event) => {
146-
setActivatedOnOrAfterDate(event.target.value);
147-
}}
148-
type="date"
149-
value={activatedOnOrAfterDate}
150-
/>
151-
</DatePicker>
152-
</Layer>
153126
<Layer style={{ margin: "5px" }}>
154127
<TableToolbarSearch
155128
expanded

src/config-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const configSchema = {
2323
},
2424
laboratoryOrderTypeUuid: {
2525
_type: Type.String,
26-
_default: "52a447d3-a64a-11e3-9aeb-50e549534c5e",
26+
_default: "",
2727
_description: "Uuid for orderType",
2828
},
2929
laboratoryReferalDestinationUuid: {

src/patient-chart/laboratory-active-test-order/laboratory-active-test-order-results.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ import {
5454
import TestsResults from "../results-summary/test-results-table.component";
5555
import { useReactToPrint } from "react-to-print";
5656
import PrintResultsSummary from "../results-summary/print-results-summary.component";
57-
import { EncounterResponse } from "../laboratory-item/view-laboratory-item.resource";
5857
import { useGetPatientByUuid } from "../../utils/functions";
5958
import {
6059
ResourceRepresentation,
60+
Result,
6161
getOrderColor,
6262
} from "../patient-laboratory-order-results.resource";
6363
import { useLaboratoryOrderResultsPages } from "../patient-laboratory-order-results-table.resource";
@@ -71,7 +71,7 @@ interface LaboratoryActiveTestOrderResultsProps {
7171
}
7272

7373
interface PrintProps {
74-
encounter: EncounterResponse;
74+
encounter: Result;
7575
}
7676

7777
const LaboratoryActiveTestOrderResults: React.FC<

src/patient-chart/laboratory-item/view-laboratory-item.component.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)