本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
使用 STOW-RS 存储实例
AWS HealthImaging 提供了DICOMweb STOW-RS
APIs 用于导入数据的表示形式。使用它们 APIs 将 DICOM 数据同步存储到您的 HealthImaging 数据存储中。
下表描述了 APIs 可用于导入 HealthImaging 数据的 DICOMweb STOW-RS 表示法。
HealthImaging DICOMweb STOW-RS 的陈述 APIs
名称 |
描述 |
StoreDICOM |
将一个或多个实例存储到 HealthImaging 数据存储中。 |
StoreDICOMStudy |
将与指定研究实例 UID 对应的一个或多个实例存储到 HealthImaging 数据存储中。 |
使用StoreDICOM
和StoreDICOMStudy
操作导入的数据将组织为新的主影像集,或使用与异步导入任务相同的逻辑添加到现有的主影像集中。如果新导入的 DICOM P10 数据的元数据元素与现有的主影像集冲突,则新数据将被添加到非主影像集。
发起 StorediCom 请求
-
收集您的 AWS 区域和 DICOM P10 文件名。 HealthImaging datastoreId
-
为表单的请求构造一个 URL:https://dicom-medical-imaging.region
.amazonaws.com/datastore/datastore-id
/studies
-
例如,使用您的首选命令确定 DICOM P10 文件的内容长度。$(stat -f %z $FILENAME)
-
准备并发送您的请求。 StoreDICOM
使用带有 AWS 签名版本 4 签名协议的 HTTP POST 请求。
例 示例 1:使用操作存储 DICOM P10 文件 StoreDICOM
- Shell
-
curl -X POST -v \
'https://dicom-medical-imaging.us-east-1.amazonaws.com/datastore/d9a2a515ab294163a2d2f4069eed584c/studies' \
--aws-sigv4 "aws:amz:$AWS_REGION:medical-imaging" \
--user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
--header "x-amz-security-token:$AWS_SESSION_TOKEN" \
--header "x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-PAYLOAD" \
--header "x-amz-decoded-content-length: $CONTENT_LENGTH" \
--header 'Accept: application/dicom+json' \
--header "Content-Type: application/dicom" \
--upload-file $FILENAME
例 示例 2:使用操作存储 DICOM P10 文件 StoreDICOMStudy
StorediCom 和 Store 的唯一区别DICOMStudy 是,研究实例 UID 作为参数传递给 StoreDICOMStudy,并且上传的实例必须是指定研究的成员。
- Shell
-
curl -X POST -v \
'https://dicom-medical-imaging.us-east-1.amazonaws.com/datastore/d9a2a515ab294163a2d2f4069eed584c/studies/1.3.6.1.4.1.5962.1.2.4.20040826285059.5457' \
--aws-sigv4 "aws:amz:$AWS_REGION:medical-imaging" \
--user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
--header "x-amz-security-token:$AWS_SESSION_TOKEN" \
--header "x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-PAYLOAD" \
--header "x-amz-decoded-content-length: $CONTENT_LENGTH" \
--header 'Accept: application/dicom+json' \
--header "Content-Type: application/dicom" \
--upload-file $FILENAME
例 示例 3:使用多部分 HTTP 有效负载存储 DICOM P10 文件
通过单个分段上传操作即可上传多个 P10 文件。以下 shell 命令演示了如何组装包含两个 P10 文件的多部分有效负载,并通过操作将其上StoreDICOM
传。
- Shell
-
#!/bin/sh
FILENAME=multipart.payload
BOUNDARY=2a8a02b9-0ed3-c8a7-7ebd-232427531940
boundary_str="--$BOUNDARY\r\n"
mp_header="${boundary_str}Content-Type: application/dicom\r\n\r\n"
##Encapsulate the binary DICOM file 1.
printf '%b' "$mp_header" > $FILENAME
cat file1.dcm >> $FILENAME
##Encapsulate the binary DICOM file 2 (note the additional CRLF before the part header).
printf '%b' "\r\n$mp_header" >> $FILENAME
cat file2.dcm >> $FILENAME
## Add the closing boundary.
printf '%b' "\r\n--$BOUNDARY--" >> $FILENAME
## Obain the payload size in bytes.
multipart_payload_size=$(stat -f%z "$FILENAME")
# Execute CURL POST request with AWS SIGv4
curl -X POST -v \
'https://iad-dicom.external-healthlake-imaging.ai.aws.dev/datastore/b5f34e91ca734b39a54ac11ea42416cf/studies' \
--aws-sigv4 "aws:amz:us-east-1:medical-imaging" \
--user "AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
--header "x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-PAYLOAD" \
--header "x-amz-decoded-content-length: ${multipart_payload_size}" \
--header 'Accept: application/dicom+json' \
--header "Content-Type: multipart/related; type=\"application/dicom\"; boundary=\"${BOUNDARY}\"" \
--data-binary "@$FILENAME"
# Delete the payload file
rm $FILENAME