搜尋映像集 - AWS HealthImaging

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

搜尋映像集

使用 SearchImageSets動作針對ACTIVE HealthImaging 資料存放區中的所有映像集執行搜尋查詢。下列功能表提供 AWS Management Console 和 的 AWS CLI 和 程式碼範例程序 AWS SDKs。如需詳細資訊,請參閱 參考 SearchImageSetsAWS HealthImaging API中的

注意

搜尋影像集時,請記住下列幾點。

  • SearchImageSets 接受單一搜尋查詢參數,並傳回具有相符條件之所有影像集的分頁回應。所有日期範圍查詢都必須輸入為 (lowerBound, upperBound)

  • 根據預設, SearchImageSets會使用 updatedAt 欄位,依從最新到最舊的順序排序。

  • 如果您使用客戶擁有的 AWS KMS 金鑰建立資料存放區,您必須先更新 AWS KMS 金鑰政策,才能與映像集互動。如需詳細資訊,請參閱建立客戶受管金鑰。

搜尋影像集

根據您對 的存取偏好設定選擇選單AWS HealthImaging。

注意

下列程序說明如何使用 Series Instance UIDUpdated at 屬性篩選條件搜尋影像集。

Series Instance UID
使用 Series Instance UID 屬性篩選條件搜尋映像集
  1. 開啟 HealthImaging 主控台資料存放區頁面

  2. 選擇資料存放區。

    資料存放區詳細資訊頁面會開啟,且影像索引標籤預設為選取。

  3. 選擇屬性篩選條件選單,然後選擇 Series Instance UID

  4. 輸入要搜尋的值欄位中,輸入 (貼上) UID 感興趣的系列執行個體。

    注意

    系列執行個體UID值必須與DICOM唯一識別碼登錄檔 (UIDs) 中列出的值相同。請注意,要求包括一系列數字,這些數字之間至少包含一個句點。系列執行個體 的開頭或結尾不允許使用期間UIDs。不允許使用字母和空格,因此複製和貼上 時請務必小心UIDs。

  5. 選擇日期範圍選單,選擇系列執行個體 的日期範圍UID,然後選擇套用

  6. 選擇 Search (搜尋)。

    根據預設,屬於所選日期範圍UIDs的系列執行個體會以最新順序傳回。

Updated at
使用 Updated at 屬性篩選條件搜尋映像集
  1. 開啟 HealthImaging 主控台資料存放區頁面

  2. 選擇資料存放區。

    資料存放區詳細資訊頁面會開啟,且影像索引標籤預設為選取狀態。

  3. 選擇屬性篩選條件選單,然後選擇 Updated at

  4. 選擇日期範圍選單,選擇影像集日期範圍,然後選擇套用

  5. 選擇 Search (搜尋)。

    根據預設,屬於所選日期範圍的影像集會以最新順序傳回。

C++
SDK 適用於 C++

用於搜尋映像集的公用程式函數。

//! Routine which searches for image sets based on defined input attributes. /*! \param dataStoreID: The HealthImaging data store ID. \param searchCriteria: A search criteria instance. \param imageSetResults: Vector to receive the image set IDs. \param clientConfig: Aws client configuration. \return bool: Function succeeded. */ bool AwsDoc::Medical_Imaging::searchImageSets(const Aws::String &dataStoreID, const Aws::MedicalImaging::Model::SearchCriteria &searchCriteria, Aws::Vector<Aws::String> &imageSetResults, const Aws::Client::ClientConfiguration &clientConfig) { Aws::MedicalImaging::MedicalImagingClient client(clientConfig); Aws::MedicalImaging::Model::SearchImageSetsRequest request; request.SetDatastoreId(dataStoreID); request.SetSearchCriteria(searchCriteria); Aws::String nextToken; // Used for paginated results. bool result = true; do { if (!nextToken.empty()) { request.SetNextToken(nextToken); } Aws::MedicalImaging::Model::SearchImageSetsOutcome outcome = client.SearchImageSets( request); if (outcome.IsSuccess()) { for (auto &imageSetMetadataSummary: outcome.GetResult().GetImageSetsMetadataSummaries()) { imageSetResults.push_back(imageSetMetadataSummary.GetImageSetId()); } nextToken = outcome.GetResult().GetNextToken(); } else { std::cout << "Error: " << outcome.GetError().GetMessage() << std::endl; result = false; } } while (!nextToken.empty()); return result; }

使用案例 #1:EQUAL運算子。

Aws::Vector<Aws::String> imageIDsForPatientID; Aws::MedicalImaging::Model::SearchCriteria searchCriteriaEqualsPatientID; Aws::Vector<Aws::MedicalImaging::Model::SearchFilter> patientIDSearchFilters = { Aws::MedicalImaging::Model::SearchFilter().WithOperator(Aws::MedicalImaging::Model::Operator::EQUAL) .WithValues({Aws::MedicalImaging::Model::SearchByAttributeValue().WithDICOMPatientId(patientID)}) }; searchCriteriaEqualsPatientID.SetFilters(patientIDSearchFilters); bool result = AwsDoc::Medical_Imaging::searchImageSets(dataStoreID, searchCriteriaEqualsPatientID, imageIDsForPatientID, clientConfig); if (result) { std::cout << imageIDsForPatientID.size() << " image sets found for the patient with ID '" << patientID << "'." << std::endl; for (auto &imageSetResult : imageIDsForPatientID) { std::cout << " Image set with ID '" << imageSetResult << std::endl; } }

使用案例 #2:使用 DICOMStudyDate和 的BETWEEN運算子DICOMStudyTime。

Aws::MedicalImaging::Model::SearchByAttributeValue useCase2StartDate; useCase2StartDate.SetDICOMStudyDateAndTime(Aws::MedicalImaging::Model::DICOMStudyDateAndTime() .WithDICOMStudyDate("19990101") .WithDICOMStudyTime("000000.000")); Aws::MedicalImaging::Model::SearchByAttributeValue useCase2EndDate; useCase2EndDate.SetDICOMStudyDateAndTime(Aws::MedicalImaging::Model::DICOMStudyDateAndTime() .WithDICOMStudyDate(Aws::Utils::DateTime(std::chrono::system_clock::now()).ToLocalTimeString("%Y%m%d")) .WithDICOMStudyTime("000000.000")); Aws::MedicalImaging::Model::SearchFilter useCase2SearchFilter; useCase2SearchFilter.SetValues({useCase2StartDate, useCase2EndDate}); useCase2SearchFilter.SetOperator(Aws::MedicalImaging::Model::Operator::BETWEEN); Aws::MedicalImaging::Model::SearchCriteria useCase2SearchCriteria; useCase2SearchCriteria.SetFilters({useCase2SearchFilter}); Aws::Vector<Aws::String> usesCase2Results; result = AwsDoc::Medical_Imaging::searchImageSets(dataStoreID, useCase2SearchCriteria, usesCase2Results, clientConfig); if (result) { std::cout << usesCase2Results.size() << " image sets found for between 1999/01/01 and present." << std::endl; for (auto &imageSetResult : usesCase2Results) { std::cout << " Image set with ID '" << imageSetResult << std::endl; } }

使用案例 #3:使用 的BETWEEN運算子createdAt。先前持續進行檢查的時間。

Aws::MedicalImaging::Model::SearchByAttributeValue useCase3StartDate; useCase3StartDate.SetCreatedAt(Aws::Utils::DateTime("20231130T000000000Z",Aws::Utils::DateFormat::ISO_8601_BASIC)); Aws::MedicalImaging::Model::SearchByAttributeValue useCase3EndDate; useCase3EndDate.SetCreatedAt(Aws::Utils::DateTime(std::chrono::system_clock::now())); Aws::MedicalImaging::Model::SearchFilter useCase3SearchFilter; useCase3SearchFilter.SetValues({useCase3StartDate, useCase3EndDate}); useCase3SearchFilter.SetOperator(Aws::MedicalImaging::Model::Operator::BETWEEN); Aws::MedicalImaging::Model::SearchCriteria useCase3SearchCriteria; useCase3SearchCriteria.SetFilters({useCase3SearchFilter}); Aws::Vector<Aws::String> usesCase3Results; result = AwsDoc::Medical_Imaging::searchImageSets(dataStoreID, useCase3SearchCriteria, usesCase3Results, clientConfig); if (result) { std::cout << usesCase3Results.size() << " image sets found for created between 2023/11/30 and present." << std::endl; for (auto &imageSetResult : usesCase3Results) { std::cout << " Image set with ID '" << imageSetResult << std::endl; } }

使用案例 #4:運算EQUAL子開啟DICOMSeriesInstanceUID和BETWEEN開啟, updatedAt 並依 updatedAt 欄位ASC順序排序回應。

Aws::MedicalImaging::Model::SearchByAttributeValue useCase4StartDate; useCase4StartDate.SetUpdatedAt(Aws::Utils::DateTime("20231130T000000000Z",Aws::Utils::DateFormat::ISO_8601_BASIC)); Aws::MedicalImaging::Model::SearchByAttributeValue useCase4EndDate; useCase4EndDate.SetUpdatedAt(Aws::Utils::DateTime(std::chrono::system_clock::now())); Aws::MedicalImaging::Model::SearchFilter useCase4SearchFilterBetween; useCase4SearchFilterBetween.SetValues({useCase4StartDate, useCase4EndDate}); useCase4SearchFilterBetween.SetOperator(Aws::MedicalImaging::Model::Operator::BETWEEN); Aws::MedicalImaging::Model::SearchByAttributeValue seriesInstanceUID; seriesInstanceUID.SetDICOMSeriesInstanceUID(dicomSeriesInstanceUID); Aws::MedicalImaging::Model::SearchFilter useCase4SearchFilterEqual; useCase4SearchFilterEqual.SetValues({seriesInstanceUID}); useCase4SearchFilterEqual.SetOperator(Aws::MedicalImaging::Model::Operator::EQUAL); Aws::MedicalImaging::Model::SearchCriteria useCase4SearchCriteria; useCase4SearchCriteria.SetFilters({useCase4SearchFilterBetween, useCase4SearchFilterEqual}); Aws::MedicalImaging::Model::Sort useCase4Sort; useCase4Sort.SetSortField(Aws::MedicalImaging::Model::SortField::updatedAt); useCase4Sort.SetSortOrder(Aws::MedicalImaging::Model::SortOrder::ASC); useCase4SearchCriteria.SetSort(useCase4Sort); Aws::Vector<Aws::String> usesCase4Results; result = AwsDoc::Medical_Imaging::searchImageSets(dataStoreID, useCase4SearchCriteria, usesCase4Results, clientConfig); if (result) { std::cout << usesCase4Results.size() << " image sets found for EQUAL operator " << "on DICOMSeriesInstanceUID and BETWEEN on updatedAt and sort response\n" << "in ASC order on updatedAt field." << std::endl; for (auto &imageSetResult : usesCase4Results) { std::cout << " Image set with ID '" << imageSetResult << std::endl; } }
  • 如需API詳細資訊,請參閱 參考 SearchImageSets中的 。 AWS SDK for C++ API

注意

還有更多 。 GitHub尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫中設定和執行。

CLI
AWS CLI

範例 1:使用EQUAL運算子搜尋映像集

下列search-image-sets程式碼範例使用EQUAL運算子根據特定值搜尋映像集。

aws medical-imaging search-image-sets \ --datastore-id 12345678901234567890123456789012 \ --search-criteria file://search-criteria.json

search-criteria.json 的內容

{ "filters": [{ "values": [{"DICOMPatientId" : "SUBJECT08701"}], "operator": "EQUAL" }] }

輸出:

{ "imageSetsMetadataSummaries": [{ "imageSetId": "09876543210987654321098765432109", "createdAt": "2022-12-06T21:40:59.429000+00:00", "version": 1, "DICOMTags": { "DICOMStudyId": "2011201407", "DICOMStudyDate": "19991122", "DICOMPatientSex": "F", "DICOMStudyInstanceUID": "1.2.840.99999999.84710745.943275268089", "DICOMPatientBirthDate": "19201120", "DICOMStudyDescription": "UNKNOWN", "DICOMPatientId": "SUBJECT08701", "DICOMPatientName": "Melissa844 Huel628", "DICOMNumberOfStudyRelatedInstances": 1, "DICOMStudyTime": "140728", "DICOMNumberOfStudyRelatedSeries": 1 }, "updatedAt": "2022-12-06T21:40:59.429000+00:00" }] }

範例 2:使用 DICOMStudyDate和 向BETWEEN運算子搜尋映像集 DICOMStudyTime

下列search-image-sets程式碼範例會搜尋 1990 年 1 月 1 日至 2023 年 1 月 1 日 (12:00 AM) 之間產生DICOM檢查的影像集。

注意: DICOMStudyTime 為選用。如果不存在,則上午 12:00 (一天的開始) 是提供篩選日期的時間值。

aws medical-imaging search-image-sets \ --datastore-id 12345678901234567890123456789012 \ --search-criteria file://search-criteria.json

search-criteria.json 的內容

{ "filters": [{ "values": [{ "DICOMStudyDateAndTime": { "DICOMStudyDate": "19900101", "DICOMStudyTime": "000000" } }, { "DICOMStudyDateAndTime": { "DICOMStudyDate": "20230101", "DICOMStudyTime": "000000" } }], "operator": "BETWEEN" }] }

輸出:

{ "imageSetsMetadataSummaries": [{ "imageSetId": "09876543210987654321098765432109", "createdAt": "2022-12-06T21:40:59.429000+00:00", "version": 1, "DICOMTags": { "DICOMStudyId": "2011201407", "DICOMStudyDate": "19991122", "DICOMPatientSex": "F", "DICOMStudyInstanceUID": "1.2.840.99999999.84710745.943275268089", "DICOMPatientBirthDate": "19201120", "DICOMStudyDescription": "UNKNOWN", "DICOMPatientId": "SUBJECT08701", "DICOMPatientName": "Melissa844 Huel628", "DICOMNumberOfStudyRelatedInstances": 1, "DICOMStudyTime": "140728", "DICOMNumberOfStudyRelatedSeries": 1 }, "updatedAt": "2022-12-06T21:40:59.429000+00:00" }] }

範例 3:使用 搜尋運算BETWEEN子的影像集 createdAt (先前保留檢查的時間)

下列search-image-sets程式碼範例會搜尋在UTC時區的時間範圍 HealthImaging 之間保留DICOM檢查的影像集。

注意: createdAt 以範例格式 ("1985-04-12T23:20:50.52Z") 提供。

aws medical-imaging search-image-sets \ --datastore-id 12345678901234567890123456789012 \ --search-criteria file://search-criteria.json

search-criteria.json 的內容

{ "filters": [{ "values": [{ "createdAt": "1985-04-12T23:20:50.52Z" }, { "createdAt": "2022-04-12T23:20:50.52Z" }], "operator": "BETWEEN" }] }

輸出:

{ "imageSetsMetadataSummaries": [{ "imageSetId": "09876543210987654321098765432109", "createdAt": "2022-12-06T21:40:59.429000+00:00", "version": 1, "DICOMTags": { "DICOMStudyId": "2011201407", "DICOMStudyDate": "19991122", "DICOMPatientSex": "F", "DICOMStudyInstanceUID": "1.2.840.99999999.84710745.943275268089", "DICOMPatientBirthDate": "19201120", "DICOMStudyDescription": "UNKNOWN", "DICOMPatientId": "SUBJECT08701", "DICOMPatientName": "Melissa844 Huel628", "DICOMNumberOfStudyRelatedInstances": 1, "DICOMStudyTime": "140728", "DICOMNumberOfStudyRelatedSeries": 1 }, "lastUpdatedAt": "2022-12-06T21:40:59.429000+00:00" }] }

範例 4:在EQUAL運算子開啟DICOMSeriesInstanceUID和BETWEEN開啟的情況下搜尋映像集, updatedAt 並依 updatedAt 欄位ASC順序排序回應

下列search-image-sets程式碼範例會搜尋開啟DICOMSeriesInstanceUID和BETWEEN開啟EQUAL運算子的影像集, updatedAt 並依 updatedAt 欄位ASC順序排序回應。

注意: updatedAt 以範例格式 ("1985-04-12T23:20:50.52Z") 提供。

aws medical-imaging search-image-sets \ --datastore-id 12345678901234567890123456789012 \ --search-criteria file://search-criteria.json

search-criteria.json 的內容

{ "filters": [{ "values": [{ "updatedAt": "2024-03-11T15:00:05.074000-07:00" }, { "updatedAt": "2024-03-11T16:00:05.074000-07:00" }], "operator": "BETWEEN" }, { "values": [{ "DICOMSeriesInstanceUID": "1.2.840.99999999.84710745.943275268089" }], "operator": "EQUAL" }], "sort": { "sortField": "updatedAt", "sortOrder": "ASC" } }

輸出:

{ "imageSetsMetadataSummaries": [{ "imageSetId": "09876543210987654321098765432109", "createdAt": "2022-12-06T21:40:59.429000+00:00", "version": 1, "DICOMTags": { "DICOMStudyId": "2011201407", "DICOMStudyDate": "19991122", "DICOMPatientSex": "F", "DICOMStudyInstanceUID": "1.2.840.99999999.84710745.943275268089", "DICOMPatientBirthDate": "19201120", "DICOMStudyDescription": "UNKNOWN", "DICOMPatientId": "SUBJECT08701", "DICOMPatientName": "Melissa844 Huel628", "DICOMNumberOfStudyRelatedInstances": 1, "DICOMStudyTime": "140728", "DICOMNumberOfStudyRelatedSeries": 1 }, "lastUpdatedAt": "2022-12-06T21:40:59.429000+00:00" }] }

如需詳細資訊,請參閱 AWS HealthImaging 開發人員指南 中的搜尋映像集

  • 如需API詳細資訊,請參閱 命令參考 SearchImageSets中的 。 AWS CLI

Java
SDK 適用於 Java 2.x

用於搜尋映像集的公用程式函數。

public static List<ImageSetsMetadataSummary> searchMedicalImagingImageSets( MedicalImagingClient medicalImagingClient, String datastoreId, SearchCriteria searchCriteria) { try { SearchImageSetsRequest datastoreRequest = SearchImageSetsRequest.builder() .datastoreId(datastoreId) .searchCriteria(searchCriteria) .build(); SearchImageSetsIterable responses = medicalImagingClient .searchImageSetsPaginator(datastoreRequest); List<ImageSetsMetadataSummary> imageSetsMetadataSummaries = new ArrayList<>(); responses.stream().forEach(response -> imageSetsMetadataSummaries .addAll(response.imageSetsMetadataSummaries())); return imageSetsMetadataSummaries; } catch (MedicalImagingException e) { System.err.println(e.awsErrorDetails().errorMessage()); System.exit(1); } return null; }

使用案例 #1:EQUAL運算子。

List<SearchFilter> searchFilters = Collections.singletonList(SearchFilter.builder() .operator(Operator.EQUAL) .values(SearchByAttributeValue.builder() .dicomPatientId(patientId) .build()) .build()); SearchCriteria searchCriteria = SearchCriteria.builder() .filters(searchFilters) .build(); List<ImageSetsMetadataSummary> imageSetsMetadataSummaries = searchMedicalImagingImageSets( medicalImagingClient, datastoreId, searchCriteria); if (imageSetsMetadataSummaries != null) { System.out.println("The image sets for patient " + patientId + " are:\n" + imageSetsMetadataSummaries); System.out.println(); }

使用案例 #2:使用 DICOMStudyDate和 的BETWEEN運算子DICOMStudyTime。

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); searchFilters = Collections.singletonList(SearchFilter.builder() .operator(Operator.BETWEEN) .values(SearchByAttributeValue.builder() .dicomStudyDateAndTime(DICOMStudyDateAndTime.builder() .dicomStudyDate("19990101") .dicomStudyTime("000000.000") .build()) .build(), SearchByAttributeValue.builder() .dicomStudyDateAndTime(DICOMStudyDateAndTime.builder() .dicomStudyDate((LocalDate.now() .format(formatter))) .dicomStudyTime("000000.000") .build()) .build()) .build()); searchCriteria = SearchCriteria.builder() .filters(searchFilters) .build(); imageSetsMetadataSummaries = searchMedicalImagingImageSets(medicalImagingClient, datastoreId, searchCriteria); if (imageSetsMetadataSummaries != null) { System.out.println( "The image sets searched with BETWEEN operator using DICOMStudyDate and DICOMStudyTime are:\n" + imageSetsMetadataSummaries); System.out.println(); }

使用案例 #3:使用 的BETWEEN運算子createdAt。先前持續進行檢查的時間。

searchFilters = Collections.singletonList(SearchFilter.builder() .operator(Operator.BETWEEN) .values(SearchByAttributeValue.builder() .createdAt(Instant.parse("1985-04-12T23:20:50.52Z")) .build(), SearchByAttributeValue.builder() .createdAt(Instant.now()) .build()) .build()); searchCriteria = SearchCriteria.builder() .filters(searchFilters) .build(); imageSetsMetadataSummaries = searchMedicalImagingImageSets(medicalImagingClient, datastoreId, searchCriteria); if (imageSetsMetadataSummaries != null) { System.out.println("The image sets searched with BETWEEN operator using createdAt are:\n " + imageSetsMetadataSummaries); System.out.println(); }

使用案例 #4:運算EQUAL子開啟DICOMSeriesInstanceUID和BETWEEN開啟, updatedAt 並依 updatedAt 欄位ASC順序排序回應。

Instant startDate = Instant.parse("1985-04-12T23:20:50.52Z"); Instant endDate = Instant.now(); searchFilters = Arrays.asList( SearchFilter.builder() .operator(Operator.EQUAL) .values(SearchByAttributeValue.builder() .dicomSeriesInstanceUID(seriesInstanceUID) .build()) .build(), SearchFilter.builder() .operator(Operator.BETWEEN) .values( SearchByAttributeValue.builder().updatedAt(startDate).build(), SearchByAttributeValue.builder().updatedAt(endDate).build() ).build()); Sort sort = Sort.builder().sortOrder(SortOrder.ASC).sortField(SortField.UPDATED_AT).build(); searchCriteria = SearchCriteria.builder() .filters(searchFilters) .sort(sort) .build(); imageSetsMetadataSummaries = searchMedicalImagingImageSets(medicalImagingClient, datastoreId, searchCriteria); if (imageSetsMetadataSummaries != null) { System.out.println("The image sets searched with EQUAL operator on DICOMSeriesInstanceUID and BETWEEN on updatedAt and sort response\n" + "in ASC order on updatedAt field are:\n " + imageSetsMetadataSummaries); System.out.println(); }
  • 如需API詳細資訊,請參閱 參考 SearchImageSets中的 。 AWS SDK for Java 2.x API

注意

還有更多 。 GitHub尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫中設定和執行。

JavaScript
SDK 適用於 JavaScript (v3)

用於搜尋映像集的公用程式函數。

import { paginateSearchImageSets } from "@aws-sdk/client-medical-imaging"; import { medicalImagingClient } from "../libs/medicalImagingClient.js"; /** * @param {string} datastoreId - The data store's ID. * @param { import('@aws-sdk/client-medical-imaging').SearchFilter[] } filters - The search criteria filters. * @param { import('@aws-sdk/client-medical-imaging').Sort } sort - The search criteria sort. */ export const searchImageSets = async ( datastoreId = "xxxxxxxx", searchCriteria = {}, ) => { const paginatorConfig = { client: medicalImagingClient, pageSize: 50, }; const commandParams = { datastoreId: datastoreId, searchCriteria: searchCriteria, }; const paginator = paginateSearchImageSets(paginatorConfig, commandParams); const imageSetsMetadataSummaries = []; for await (const page of paginator) { // Each page contains a list of `jobSummaries`. The list is truncated if is larger than `pageSize`. imageSetsMetadataSummaries.push(...page.imageSetsMetadataSummaries); console.log(page); } // { // '$metadata': { // httpStatusCode: 200, // requestId: 'f009ea9c-84ca-4749-b5b6-7164f00a5ada', // extendedRequestId: undefined, // cfId: undefined, // attempts: 1, // totalRetryDelay: 0 // }, // imageSetsMetadataSummaries: [ // { // DICOMTags: [Object], // createdAt: "2023-09-19T16:59:40.551Z", // imageSetId: '7f75e1b5c0f40eac2b24cf712f485f50', // updatedAt: "2023-09-19T16:59:40.551Z", // version: 1 // }] // } return imageSetsMetadataSummaries; };

使用案例 #1:EQUAL運算子。

const datastoreId = "12345678901234567890123456789012"; try { const searchCriteria = { filters: [ { values: [{ DICOMPatientId: "1234567" }], operator: "EQUAL", }, ], }; await searchImageSets(datastoreId, searchCriteria); } catch (err) { console.error(err); }

使用案例 #2:使用 DICOMStudyDate和 的BETWEEN運算子DICOMStudyTime。

const datastoreId = "12345678901234567890123456789012"; try { const searchCriteria = { filters: [ { values: [ { DICOMStudyDateAndTime: { DICOMStudyDate: "19900101", DICOMStudyTime: "000000", }, }, { DICOMStudyDateAndTime: { DICOMStudyDate: "20230901", DICOMStudyTime: "000000", }, }, ], operator: "BETWEEN", }, ], }; await searchImageSets(datastoreId, searchCriteria); } catch (err) { console.error(err); }

使用案例 #3:使用 的BETWEEN運算子createdAt。先前持續進行檢查的時間。

const datastoreId = "12345678901234567890123456789012"; try { const searchCriteria = { filters: [ { values: [ { createdAt: new Date("1985-04-12T23:20:50.52Z") }, { createdAt: new Date() }, ], operator: "BETWEEN", }, ], }; await searchImageSets(datastoreId, searchCriteria); } catch (err) { console.error(err); }

使用案例 #4:運算EQUAL子開啟DICOMSeriesInstanceUID和BETWEEN開啟, updatedAt 並依 updatedAt 欄位ASC順序排序回應。

const datastoreId = "12345678901234567890123456789012"; try { const searchCriteria = { filters: [ { values: [ { updatedAt: new Date("1985-04-12T23:20:50.52Z") }, { updatedAt: new Date() }, ], operator: "BETWEEN", }, { values: [ { DICOMSeriesInstanceUID: "1.1.123.123456.1.12.1.1234567890.1234.12345678.123", }, ], operator: "EQUAL", }, ], sort: { sortOrder: "ASC", sortField: "updatedAt", }, }; await searchImageSets(datastoreId, searchCriteria); } catch (err) { console.error(err); }
  • 如需API詳細資訊,請參閱 參考 SearchImageSets中的 。 AWS SDK for JavaScript API

注意

還有更多 。 GitHub尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫中設定和執行。

Python
SDK for Python (Boto3)

用於搜尋映像集的公用程式函數。

class MedicalImagingWrapper: def __init__(self, health_imaging_client): self.health_imaging_client = health_imaging_client def search_image_sets(self, datastore_id, search_filter): """ Search for image sets. :param datastore_id: The ID of the data store. :param search_filter: The search filter. For example: {"filters" : [{ "operator": "EQUAL", "values": [{"DICOMPatientId": "3524578"}]}]}. :return: The list of image sets. """ try: paginator = self.health_imaging_client.get_paginator("search_image_sets") page_iterator = paginator.paginate( datastoreId=datastore_id, searchCriteria=search_filter ) metadata_summaries = [] for page in page_iterator: metadata_summaries.extend(page["imageSetsMetadataSummaries"]) except ClientError as err: logger.error( "Couldn't search image sets. Here's why: %s: %s", err.response["Error"]["Code"], err.response["Error"]["Message"], ) raise else: return metadata_summaries

使用案例 #1:EQUAL運算子。

search_filter = { "filters": [ {"operator": "EQUAL", "values": [{"DICOMPatientId": patient_id}]} ] } image_sets = self.search_image_sets(data_store_id, search_filter) print(f"Image sets found with EQUAL operator\n{image_sets}")

使用案例 #2:使用 DICOMStudyDate和 的BETWEEN運算子DICOMStudyTime。

search_filter = { "filters": [ { "operator": "BETWEEN", "values": [ { "DICOMStudyDateAndTime": { "DICOMStudyDate": "19900101", "DICOMStudyTime": "000000", } }, { "DICOMStudyDateAndTime": { "DICOMStudyDate": "20230101", "DICOMStudyTime": "000000", } }, ], } ] } image_sets = self.search_image_sets(data_store_id, search_filter) print( f"Image sets found with BETWEEN operator using DICOMStudyDate and DICOMStudyTime\n{image_sets}" )

使用案例 #3:使用 的BETWEEN運算子createdAt。先前持續進行檢查的時間。

search_filter = { "filters": [ { "values": [ { "createdAt": datetime.datetime( 2021, 8, 4, 14, 49, 54, 429000 ) }, { "createdAt": datetime.datetime.now() + datetime.timedelta(days=1) }, ], "operator": "BETWEEN", } ] } recent_image_sets = self.search_image_sets(data_store_id, search_filter) print( f"Image sets found with with BETWEEN operator using createdAt\n{recent_image_sets}" )

使用案例 #4:運算EQUAL子開啟DICOMSeriesInstanceUID和BETWEEN開啟, updatedAt 並依 updatedAt 欄位ASC順序排序回應。

search_filter = { "filters": [ { "values": [ { "updatedAt": datetime.datetime( 2021, 8, 4, 14, 49, 54, 429000 ) }, { "updatedAt": datetime.datetime.now() + datetime.timedelta(days=1) }, ], "operator": "BETWEEN", }, { "values": [{"DICOMSeriesInstanceUID": series_instance_uid}], "operator": "EQUAL", }, ], "sort": { "sortOrder": "ASC", "sortField": "updatedAt", }, } image_sets = self.search_image_sets(data_store_id, search_filter) print( "Image sets found with EQUAL operator on DICOMSeriesInstanceUID and BETWEEN on updatedAt and" ) print(f"sort response in ASC order on updatedAt field\n{image_sets}")

下列程式碼會實例化 MedicalImagingWrapper 物件。

client = boto3.client("medical-imaging") medical_imaging_wrapper = MedicalImagingWrapper(client)
  • 如需API詳細資訊,請參閱 SearchImageSets 中的 AWS SDK for Python (Boto3) API參考

注意

還有更多 。 GitHub尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫中設定和執行。

可用性範例

找不到所需的內容嗎? 使用此頁面底部的提供意見回饋連結來請求程式碼範例。