Skip to content

Commit 85d86d3

Browse files
authored
Merge pull request #1370 from chhsiao1981/createFeedWithFilepath
simplify createFeedWithFilepath
2 parents 6bcd17b + 581c209 commit 85d86d3

File tree

2 files changed

+9
-36
lines changed

2 files changed

+9
-36
lines changed

src/api/serverApi.ts

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import config from "config";
22
import type { ReadonlyNonEmptyArray } from "fp-ts/lib/ReadonlyNonEmptyArray";
33
import YAML from "yaml";
4-
import api, { type ApiResult } from "./api";
4+
import api from "./api";
55
import type { PACSqueryCore } from "./pfdcm";
66
import { PACSqueryCoreToJSON } from "./pfdcm/generated";
77
import type {
@@ -90,24 +90,13 @@ export const createWorkflow = (
9090
},
9191
});
9292

93-
type createFeedWithFilepathProp = {
94-
filepath: string;
95-
theName: string;
96-
tags: string[];
97-
patientID?: string;
98-
modality?: string;
99-
studyDate?: string;
100-
isPublic?: boolean;
101-
};
102-
export const createFeedWithFilepath = async ({
103-
filepath,
104-
theName,
105-
tags,
106-
patientID,
107-
modality,
108-
studyDate,
109-
isPublic,
110-
}: createFeedWithFilepathProp): Promise<ApiResult<Feed>> => {
93+
export const createFeedWithFilepath = async (
94+
filepath: string,
95+
theName: string,
96+
// biome-ignore lint/correctness/noUnusedFunctionParameters: not using tags for now.
97+
tags?: string[],
98+
isPublic: boolean = false,
99+
) => {
111100
const pluginInstanceResult = await createPluginInstance(1, [filepath]);
112101
if (!pluginInstanceResult.data) {
113102
return {

src/components/Pacs/utils.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,14 @@ export const createFeedWithPACSSeries = async (series: PACSSeries) => {
2626
StudyDate: studyDate,
2727
StudyDescription: studyDescription,
2828
SeriesDescription: seriesDescription,
29-
Modality: modality,
3029
} = series;
3130

3231
const studyDateStr = studyDate.replace(/[^0-9]/g, "");
3332

3433
const theName = `PACS-${patientID}-${studyDateStr}-${studyDescription}-${seriesDescription}`;
3534

36-
console.info(
37-
"PacsController.createFeedWithPACSSeries: to createFeedWithFilepath: folderPath:",
38-
thePath,
39-
"theName:",
40-
theName,
41-
);
42-
4335
const tags = ["pacs"];
44-
return await createFeedWithFilepath({
45-
filepath: thePath,
46-
theName,
47-
tags,
48-
patientID,
49-
modality,
50-
studyDate,
51-
isPublic: false,
52-
});
36+
return await createFeedWithFilepath(thePath, theName, tags);
5337
};
5438

5539
export const errorCodeIs4xx = (e: { code: number }) => {

0 commit comments

Comments
 (0)