Skip to content

AWS.MedicalImaging reference

Source: src/AWS/MedicalImaging/CopyImageSet.ts

Runtime binding for the CopyImageSet operation (IAM action medical-imaging:CopyImageSet), scoped to one Datastore.

Copies an image set into a new one (omit destinationImageSet) or merges it into an existing destination image set within the same data store. Provide the implementation with Effect.provide(AWS.MedicalImaging.CopyImageSetHttp).

const copyImageSet = yield* MedicalImaging.CopyImageSet(datastore);
const copy = yield* copyImageSet({
sourceImageSetId,
copyImageSetInformation: {
sourceImageSet: { latestVersionId: "1" },
},
});
// copy.destinationImageSetProperties.imageSetId

Source: src/AWS/MedicalImaging/Datastore.ts

An AWS HealthImaging data store — a HIPAA-eligible store for DICOM P10 medical images with sub-second image-frame retrieval.

Data stores provision asynchronously (CREATING → ACTIVE, typically a few minutes) and must be empty (no image sets) before they can be deleted. HealthImaging has no update API, so every property except tags triggers a replacement.

Basic Data Store

const datastore = yield* Datastore("Imaging", {});

Data Store with a Customer-Managed KMS Key

const datastore = yield* Datastore("Imaging", {
kmsKeyArn: key.keyArn,
tags: { team: "radiology" },
});
const datastore = yield* Datastore("Imaging", {});
// startDICOMImportJob and image-set APIs address the store by id
const id = datastore.datastoreId;

Source: src/AWS/MedicalImaging/DeleteImageSet.ts

Runtime binding for the DeleteImageSet operation (IAM action medical-imaging:DeleteImageSet), scoped to one Datastore.

Deletes an image set (asynchronously — the response reports imageSetWorkflowStatus: "DELETING"). A data store must contain no image sets before it can be deleted. Provide the implementation with Effect.provide(AWS.MedicalImaging.DeleteImageSetHttp).

const deleteImageSet = yield* MedicalImaging.DeleteImageSet(datastore);
const deleted = yield* deleteImageSet({ imageSetId });
// deleted.imageSetWorkflowStatus === "DELETING"

Source: src/AWS/MedicalImaging/GetDICOMImportJob.ts

Runtime binding for the GetDICOMImportJob operation (IAM action medical-imaging:GetDICOMImportJob), scoped to one Datastore.

Reads the properties of a DICOM import job started with StartDICOMImportJob — poll jobProperties.jobStatus until COMPLETED (or FAILED), then review the output manifests at outputS3Uri for per-object results. Provide the implementation with Effect.provide(AWS.MedicalImaging.GetDICOMImportJobHttp).

const getImportJob = yield* MedicalImaging.GetDICOMImportJob(datastore);
const job = yield* getImportJob({ jobId }).pipe(
Effect.map((r) => r.jobProperties),
Effect.repeat({
schedule: Schedule.spaced("10 seconds"),
until: (j) => j.jobStatus !== "SUBMITTED" && j.jobStatus !== "IN_PROGRESS",
times: 30,
}),
);

Source: src/AWS/MedicalImaging/GetImageFrame.ts

Runtime binding for the GetImageFrame operation (IAM action medical-imaging:GetImageFrame), scoped to one Datastore.

Streams the pixel data of a single image frame (HTJ2K- or JPEG2000-encoded, per the data store’s losslessStorageFormat). Image frame ids come from the image set metadata blob read with GetImageSetMetadata. Provide the implementation with Effect.provide(AWS.MedicalImaging.GetImageFrameHttp).

const getImageFrame = yield* MedicalImaging.GetImageFrame(datastore);
const frame = yield* getImageFrame({
imageSetId,
imageFrameInformation: { imageFrameId },
});
// frame.imageFrameBlob (streaming body), frame.contentType

Source: src/AWS/MedicalImaging/GetImageSet.ts

Runtime binding for the GetImageSet operation (IAM action medical-imaging:GetImageSet), scoped to one Datastore.

Reads an image set’s properties — state, workflow status, version and ARN. Pass versionId to read a specific version; omit it for the latest. Provide the implementation with Effect.provide(AWS.MedicalImaging.GetImageSetHttp).

const getImageSet = yield* MedicalImaging.GetImageSet(datastore);
const imageSet = yield* getImageSet({ imageSetId });
// imageSet.imageSetState === "ACTIVE", imageSet.versionId, imageSet.imageSetArn

Source: src/AWS/MedicalImaging/GetImageSetMetadata.ts

Runtime binding for the GetImageSetMetadata operation (IAM action medical-imaging:GetImageSetMetadata), scoped to one Datastore.

Streams the DICOM JSON metadata blob of an image set (gzip-encoded — check contentEncoding). The metadata carries the patient/study/series DICOM attributes plus the image frame ids used with GetImageFrame. Provide the implementation with Effect.provide(AWS.MedicalImaging.GetImageSetMetadataHttp).

const getMetadata = yield* MedicalImaging.GetImageSetMetadata(datastore);
const metadata = yield* getMetadata({ imageSetId });
// metadata.imageSetMetadataBlob (streaming body), metadata.contentEncoding === "gzip"

Source: src/AWS/MedicalImaging/ListDICOMImportJobs.ts

Runtime binding for the ListDICOMImportJobs operation (IAM action medical-imaging:ListDICOMImportJobs), scoped to one Datastore.

Lists the data store’s DICOM import jobs, optionally filtered by jobStatus. Provide the implementation with Effect.provide(AWS.MedicalImaging.ListDICOMImportJobsHttp).

const listImportJobs = yield* MedicalImaging.ListDICOMImportJobs(datastore);
const jobs = yield* listImportJobs({ jobStatus: "IN_PROGRESS" });
// jobs.jobSummaries[i].jobId

Source: src/AWS/MedicalImaging/ListImageSetVersions.ts

Runtime binding for the ListImageSetVersions operation (IAM action medical-imaging:ListImageSetVersions), scoped to one Datastore.

Lists every version of an image set — each UpdateImageSetMetadata call produces a new version, and older versions remain readable and revertible. Provide the implementation with Effect.provide(AWS.MedicalImaging.ListImageSetVersionsHttp).

const listVersions = yield* MedicalImaging.ListImageSetVersions(datastore);
const versions = yield* listVersions({ imageSetId });
// versions.imageSetPropertiesList[i].versionId

Source: src/AWS/MedicalImaging/SearchImageSets.ts

Runtime binding for the SearchImageSets operation (IAM action medical-imaging:SearchImageSets), scoped to one Datastore.

Searches the data store’s image sets by DICOM attributes (patient id, accession number, study/series instance UID, study date/time) or by created/updated timestamps. Omit searchCriteria to page through every image set. Provide the implementation with Effect.provide(AWS.MedicalImaging.SearchImageSetsHttp).

Search by Patient Id

const searchImageSets = yield* MedicalImaging.SearchImageSets(datastore);
const results = yield* searchImageSets({
searchCriteria: {
filters: [{ operator: "EQUAL", values: [{ DICOMPatientId: patientId }] }],
},
});
// results.imageSetsMetadataSummaries[i].imageSetId

List Every Image Set

const results = yield* searchImageSets();

Source: src/AWS/MedicalImaging/StartDICOMImportJob.ts

Runtime binding for the StartDICOMImportJob operation (IAM action medical-imaging:StartDICOMImportJob), scoped to one Datastore.

Starts a bulk import of DICOM P10 files from S3 into the bound data store. The binding is constructed with the data store and the data-access role (the IAM role HealthImaging assumes to read inputS3Uri and write the outputS3Uri manifests; its trust policy must allow medical-imaging.amazonaws.com). The role’s ARN is injected as dataAccessRoleArn on every runtime request and the host is granted iam:PassRole on it alongside medical-imaging:StartDICOMImportJob on the data store. Track the job with GetDICOMImportJob. Provide the implementation with Effect.provide(AWS.MedicalImaging.StartDICOMImportJobHttp).

// deploy time — bind the data store and the HealthImaging data-access role
const startImport = yield* MedicalImaging.StartDICOMImportJob(datastore, dataAccessRole);
// runtime
const job = yield* startImport({
clientToken: crypto.randomUUID(),
inputS3Uri: "s3://my-bucket/dicom-input/",
outputS3Uri: "s3://my-bucket/dicom-output/",
});
// job.jobId, job.jobStatus === "SUBMITTED"

Source: src/AWS/MedicalImaging/UpdateImageSetMetadata.ts

Runtime binding for the UpdateImageSetMetadata operation (IAM action medical-imaging:UpdateImageSetMetadata), scoped to one Datastore.

Adds, updates, or removes DICOM attributes on an image set (each update produces a new version), or reverts the image set to a previous version via revertToVersionId. Provide the implementation with Effect.provide(AWS.MedicalImaging.UpdateImageSetMetadataHttp).

UpdateImageSetMetadata: Updating Image Sets

Section titled “UpdateImageSetMetadata: Updating Image Sets”
const updateMetadata = yield* MedicalImaging.UpdateImageSetMetadata(datastore);
const updated = yield* updateMetadata({
imageSetId,
latestVersionId,
updateImageSetMetadataUpdates: { revertToVersionId: "1" },
});
// updated.latestVersionId