Skip to content

Commit 22f3fde

Browse files
authored
Merge pull request #1336 from chhsiao1981/add-config
Add config
2 parents 8172816 + 7f65fcf commit 22f3fde

File tree

5 files changed

+136
-3
lines changed

5 files changed

+136
-3
lines changed

config.build/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
export default {
2-
API_ROOT: "b87f4fda-012a-4564-8c36-096e496cbedf"
2+
API_ROOT: "b87f4fda-012a-4564-8c36-096e496cbedf",
3+
PFDCM_ROOT: "700e747e-619f-4007-ad8d-47677c0d0b46",
4+
PUBLIC_USER: "fnndsc",
5+
6+
STORE_ROOT: "79e63221-ccf9-43c3-bf0d-45d05db72c48",
7+
8+
OHIF_ROOT: "ea1cf042-73f0-43a1-93da-86ff93e5ac19",
9+
10+
ACKEE_SERVER: "79a96963-2e17-405e-94bd-4f2433e5cce8",
11+
ACKEE_DOMAIN_ID: "e8fe722b-986c-4aaf-ba04-c10d21e4aca1",
12+
13+
CUBE_POLL_INTERVAL_MS: "ca4bef0b-95c9-4a02-abda-590b51b9b07e"
314
}

config.tmpl/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
export default {
2-
API_ROOT: "http://localhost:8000/api/v1"
2+
API_ROOT: "http://localhost:8000/api/v1",
3+
PFDCM_ROOT: "http://localhost:4005/api/v1",
4+
PUBLIC_USER: "chris",
5+
6+
STORE_ROOT: "",
7+
8+
OHIF_ROOT: "",
9+
10+
ACKEE_SERVER: "",
11+
ACKEE_DOMAIN_ID: "",
12+
13+
CUBE_POLL_INTERVAL_MS: ""
314
}

src/api/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface CallAPI<T> {
1616
headers?: any;
1717
filename?: string;
1818
filetext?: string;
19+
apiroot?: string;
1920
}
2021

2122
interface ApiParams {
@@ -26,6 +27,7 @@ interface ApiParams {
2627
headers?: any;
2728
filename?: string;
2829
filetext?: string;
30+
apiroot?: string;
2931
}
3032

3133
export interface ApiResult<T> {
@@ -81,13 +83,14 @@ const callApi = async <T>(
8183
headers: paramsHeaders,
8284
filename,
8385
filetext: paramsFiletext,
86+
apiroot: paramsAPIRoot,
8487
}: ApiParams,
8588
): Promise<ApiResult<T>> => {
8689
const { API_ROOT: CONFIG_API_ROOT } = config;
8790

8891
const default_api_root = window.location.origin;
8992

90-
let API_ROOT = CONFIG_API_ROOT || default_api_root;
93+
let API_ROOT = paramsAPIRoot || CONFIG_API_ROOT || default_api_root;
9194
if (API_ROOT.length >= 1 && API_ROOT[API_ROOT.length - 1] === "/") {
9295
API_ROOT = API_ROOT.slice(0, API_ROOT.length - 1);
9396
}

src/api/serverApi.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import config from "config";
12
import api, { type ApiResult } from "./api";
3+
import type { PACSqueryCore } from "./pfdcm";
24
import type {
35
Feed,
46
PluginInstance,
57
Plugin,
68
NodeInfo,
79
UploadPipeline,
810
PACSSeries,
11+
PFDCMResult,
912
} from "./types";
1013

1114
import YAML from "yaml";
@@ -149,3 +152,15 @@ export const getPACSSeriesListBySeriesUID = (seriesUID: string) =>
149152
SeriesInstanceUID: seriesUID,
150153
},
151154
});
155+
156+
export const queryPFDCMServices = (service: string, query: PACSqueryCore) =>
157+
api<PFDCMResult>({
158+
endpoint: "/PACS/sync/pypx/",
159+
method: "get",
160+
query: {
161+
PACSdirective: query,
162+
PACSservice: { value: service },
163+
listenerService: { value: "default" },
164+
},
165+
apiroot: config.PFDCM_ROOT,
166+
});

src/api/types.ts

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,96 @@ export interface PACSSeries {
119119
SeriesDescription: string;
120120
pacs_identifier: string;
121121
}
122+
123+
export interface PFDCMSeries {
124+
AccessionNumber: string;
125+
AcquisitionProtocolDescription: string;
126+
AcquisitionProtocolName: string;
127+
InstanceNumber: string;
128+
ModalitiesInStudy: string;
129+
Modality: string;
130+
NumberOfSeriesRelatedInstances: string;
131+
PatientAge: string;
132+
PatientBirthDate: string;
133+
PatientID: string;
134+
PatientName: string;
135+
PatientSex: string;
136+
PerformedStationAETitle: string;
137+
ProtocolName: string;
138+
SeriesDate: string;
139+
SeriesDescription: string;
140+
SeriesInstanceUID: string;
141+
StudyDate: string;
142+
StudyDescription: string;
143+
StudyInstanceUID: string;
144+
dblogbasepath: string;
145+
json_response: boolean;
146+
then: string;
147+
thenArgs: string;
148+
withFeedBack: boolean;
149+
}
150+
151+
export interface PYPXArgs {
152+
AccessionNumber: string;
153+
AcquisitionProtocolDescription: string;
154+
155+
AcquisitionProtocolName: string;
156+
InstanceNumber: string;
157+
ModalitiesInStudy: string;
158+
Modality: string;
159+
NumberOfSeriesRelatedInstances: string;
160+
PatientAge: string;
161+
PatientBirthDate: string;
162+
PatientID: string;
163+
PatientName: string;
164+
PatientSex: string;
165+
PerformedStationAETitle: string;
166+
ProtocolName: string;
167+
QueryRetrieveLevel: string;
168+
SeriesDate: string;
169+
SeriesDescription: string;
170+
SeriesInstanceUID: string;
171+
StudyDate: string;
172+
StudyDescription: string;
173+
StudyInstanceUID: string;
174+
aec: string;
175+
aet: string;
176+
aet_listener: string;
177+
dblogbasepath: string;
178+
json: boolean;
179+
json_response: boolean;
180+
serverIP: string;
181+
serverPort: string;
182+
then: string;
183+
thenArgs: string;
184+
withFeedBack: boolean;
185+
}
186+
187+
export interface PYPXCoreData {
188+
tag: number | string;
189+
value: number | string;
190+
label: string;
191+
}
192+
193+
export interface PYPXSeriesData {
194+
[key: string]: PYPXCoreData;
195+
}
196+
197+
export interface PYPXData extends PYPXSeriesData {
198+
// @ts-expect-error
199+
series: PYPXSeriesData[];
200+
}
201+
202+
export interface PYPXResult {
203+
args: PYPXArgs;
204+
command: string;
205+
data: PYPXData[];
206+
status: string;
207+
}
208+
209+
export interface PFDCMResult {
210+
PACSDirective: PFDCMSeries;
211+
message: string;
212+
pypx: PYPXResult;
213+
status: string;
214+
}

0 commit comments

Comments
 (0)