1import type * as medicalimaging from "@distilled.cloud/aws/medical-imaging";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Datastore } from "./Datastore.ts";
5
6/**
7 * `GetDICOMImportJob` request with `datastoreId` injected from the bound
8 * data store.
9 */
10export interface GetDICOMImportJobRequest extends Omit<
11 medicalimaging.GetDICOMImportJobRequest,
12 "datastoreId"
13> {}
14
15/**
16 * Runtime binding for the `GetDICOMImportJob` operation (IAM action
17 * `medical-imaging:GetDICOMImportJob`), scoped to one {@link Datastore}.
18 *
19 * Reads the properties of a DICOM import job started with
20 * {@link StartDICOMImportJob} — poll `jobProperties.jobStatus` until
21 * `COMPLETED` (or `FAILED`), then review the output manifests at
22 * `outputS3Uri` for per-object results. Provide the implementation with
23 * `Effect.provide(AWS.MedicalImaging.GetDICOMImportJobHttp)`.
24 *
25 * ### Importing DICOM Data
26 * **Example:** Poll an Import Job Until It Completes
27 * ```typescript
28 * const getImportJob = yield* MedicalImaging.GetDICOMImportJob(datastore);
29 *
30 * const job = yield* getImportJob({ jobId }).pipe(
31 * Effect.map((r) => r.jobProperties),
32 * Effect.repeat({
33 * schedule: Schedule.spaced("10 seconds"),
34 * until: (j) => j.jobStatus !== "SUBMITTED" && j.jobStatus !== "IN_PROGRESS",
35 * times: 30,
36 * }),
37 * );
38 * ```
39 *
40 * @binding
41 */
42export interface GetDICOMImportJob extends Binding.Service<
43 GetDICOMImportJob,
44 "AWS.MedicalImaging.GetDICOMImportJob",
45 (
46 datastore: Datastore,
47 ) => Effect.Effect<
48 (
49 request: GetDICOMImportJobRequest,
50 ) => Effect.Effect<
51 medicalimaging.GetDICOMImportJobResponse,
52 medicalimaging.GetDICOMImportJobError
53 >
54 >
55> {}
56export const GetDICOMImportJob = Binding.Service<GetDICOMImportJob>(
57 "AWS.MedicalImaging.GetDICOMImportJob",
58);