Skip to content

Commit

Permalink
wired labs flow till results entry
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Dec 11, 2024
1 parent 51b3484 commit 6b813a9
Show file tree
Hide file tree
Showing 16 changed files with 1,292 additions and 1,159 deletions.
4 changes: 3 additions & 1 deletion src/Routers/routes/LabTestRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const LabTestRoutes: AppRoutes = {
"/lab_tests/send_to_lab": () => <SendSpecimen />,
"/lab_tests/receive_at_lab": () => <ReceiveSpecimen />,
"/lab_tests/received_at_lab": () => <LabTest />,
"/lab_tests/:patientId/orders": ({ patientId }) => <CollectSpecimen />,
"/lab_tests/:specimenId/collect": ({ specimenId }) => (
<CollectSpecimen specimenId={specimenId} />
),
};

export default LabTestRoutes;
101 changes: 99 additions & 2 deletions src/Utils/request/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ import {
} from "@/components/Facility/models";
import { InsurerOptionModel } from "@/components/HCX/InsurerAutocomplete";
import { HCXPolicyModel } from "@/components/HCX/models";
import { Annotation, Coding, ServiceRequest } from "@/components/LabTest/types";
import {
Annotation,
Coding,
DiagnosticReport,
Observation,
ServiceRequest,
Specimen,
} from "@/components/LabTest/types";
import { MedibaseMedicine, Prescription } from "@/components/Medicine/models";
import {
NotificationData,
Expand Down Expand Up @@ -1422,7 +1429,7 @@ const routes = {
TRes: Type<ValuesetExpandResponse>(),
},

service_request: {
serviceRequest: {
create: {
method: "POST",
path: "/api/v1/service_request/",
Expand All @@ -1441,6 +1448,96 @@ const routes = {
TRes: Type<PaginatedResponse<ServiceRequest>>(),
},
},

specimen: {
list: {
method: "GET",
path: "/api/v1/specimen/",
TRes: Type<PaginatedResponse<Specimen>>(),
},
get: {
method: "GET",
path: "/api/v1/specimen/{id}/",
TRes: Type<Specimen>(),
},
collect: {
method: "POST",
path: "/api/v1/specimen/{id}/collect/",
TBody: Type<{
identifier?: string;
}>(),
TRes: Type<Specimen>(),
},
sendToLab: {
method: "POST",
path: "/api/v1/specimen/{id}/send_to_lab/",
TBody: Type<{
lab?: string;
}>(),
TRes: Type<Specimen>(),
},
ReceiveAtLab: {
method: "POST",
path: "/api/v1/specimen/{id}/receive_at_lab/",
TBody: Type<{
accession_identifier?: string;
note?: Annotation;
condition?: Coding;
}>(),
TRes: Type<Specimen>(),
},
process: {
method: "POST",
path: "/api/v1/specimen/{id}/process/",
TBody: Type<{
process: {
description?: string;
method?: Coding;
}[];
}>(),
TRes: Type<Specimen>(),
},
},

diagnosticReport: {
create: {
method: "POST",
path: "/api/v1/diagnostic_report/",
TBody: Type<{
based_on: string;
specimen: string[];
}>(),
TRes: Type<DiagnosticReport>(),
},
observations: {
method: "POST",
path: "/api/v1/diagnostic_report/{id}/observations/",
TBody: Type<{
observations: {
id: string;
status: Observation["status"];
main_code: Coding;
value: string;
subject_type: "patient";
effective_datetime: string;
data_entered_by_id: number;
}[];
}>(),
TRes: Type<DiagnosticReport>(),
},
get: {
method: "GET",
path: "/api/v1/diagnostic_report/{id}/",
TRes: Type<DiagnosticReport>(),
},
},

labObservationCodes: {
method: "POST",
path: "/api/v1/valueset/system-lab-order-code/expand/", // TODO: change this to more appropriate path
TBody: Type<ValuesetExpandBody>(),
TRes: Type<ValuesetExpandResponse>(),
},
},
} as const;

Expand Down
Loading

0 comments on commit 6b813a9

Please sign in to comment.