Skip to content

Commit

Permalink
update medical-image examples
Browse files Browse the repository at this point in the history
Add a search-image-set example to demonstrate new parameters.

Add update-image-set-metadata examples in response to customer feedback.
  • Loading branch information
meyertst-aws committed Apr 8, 2024
1 parent dfcecc7 commit 149fc98
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 3 deletions.
58 changes: 58 additions & 0 deletions awscli/examples/medical-imaging/search-image-sets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,62 @@ Output::
}]
}

**Example 4: To search image sets with an EQUAL operator on DICOMSeriesInstanceUID and BETWEEN on updatedAt and sort response in ASC order on updatedAt field**

The following ``search-image-sets`` code example searches for image sets with an EQUAL operator on DICOMSeriesInstanceUID and BETWEEN on updatedAt and sort response in ASC order on updatedAt field.

Note:
Provide updatedAt in example format ("1985-04-12T23:20:50.52Z"). ::

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


Contents of ``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"
}
}

Output::

{
"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"
}]
}

For more information, see `Searching image sets <https://docs.aws.amazon.com/healthimaging/latest/devguide/search-image-sets.html>`__ in the *AWS HealthImaging Developer Guide*.
74 changes: 71 additions & 3 deletions awscli/examples/medical-imaging/update-image-set-metadata.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**To update image set metadata**
**To insert or update an attribute in image set metadata**

The following ``update-image-set-metadata`` code example updates image set metadata. ::
The following ``update-image-set-metadata`` code example inserts or updates an attribute in image set metadata. ::

aws medical-imaging update-image-set-metadata \
--datastore-id 12345678901234567890123456789012 \
Expand All @@ -23,7 +23,75 @@ Note: ``updatableAttributes`` is a Base64 encoded JSON string. Here is the unenc
Output::

{
"latestVersionId": "5",
"latestVersionId": "2",
"imageSetWorkflowStatus": "UPDATING",
"updatedAt": 1680042257.908,
"imageSetId": "ea92b0d8838c72a3f25d00d13616f87e",
"imageSetState": "LOCKED",
"createdAt": 1680027126.436,
"datastoreId": "12345678901234567890123456789012"
}

**To remove an attribute from image set metadata**

The following ``update-image-set-metadata`` code example removes an attribute from image set metadata. ::

aws medical-imaging update-image-set-metadata \
--datastore-id 12345678901234567890123456789012 \
--image-set-id ea92b0d8838c72a3f25d00d13616f87e \
--latest-version-id 1 \
--update-image-set-metadata-updates file://metadata-updates.json

Contents of ``metadata-updates.json`` ::

{
"DICOMUpdates": {
"removableAttributes": "e1NjaGVtYVZlcnNpb246MS4xLFN0dWR5OntESUNPTTp7U3R1ZHlEZXNjcmlwdGlvbjpDSEVTVH19fQo="
}
}

Note: ``removableAttributes`` is a Base64 encoded JSON string. Here is the unencoded JSON string. The key and value must match the attribute to be removed.

{"SchemaVersion":1.1,"Study":{"DICOM":{"StudyDescription":"CHEST"}}}

Output::

{
"latestVersionId": "2",
"imageSetWorkflowStatus": "UPDATING",
"updatedAt": 1680042257.908,
"imageSetId": "ea92b0d8838c72a3f25d00d13616f87e",
"imageSetState": "LOCKED",
"createdAt": 1680027126.436,
"datastoreId": "12345678901234567890123456789012"
}

**To remove an instance in image set metadata**

The following ``update-image-set-metadata`` code example removes an instance from image set metadata. ::

aws medical-imaging update-image-set-metadata \
--datastore-id 12345678901234567890123456789012 \
--image-set-id ea92b0d8838c72a3f25d00d13616f87e \
--latest-version-id 1 \
--update-image-set-metadata-updates file://metadata-updates.json

Contents of ``metadata-updates.json`` ::

{
"DICOMUpdates": {
"removableAttributes": "eezEuMS4xLjEuMS4xLjEyMzQ1LjEyMzQ1Njc4OTAxMi4xMjMuMTIzNDU2Nzg5MDEyMzQuMTp7SW5zdGFuY2VzOnsxLjEuMS4xLjEuMS4xMjM0NS4xMjM0NTY3ODkwMTIuMTIzLjEyMzQ1Njc4OTAxMjM0LjE6e319fX19fQo="
}
}

Note: ``removableAttributes`` is a Base64 encoded JSON string. Here is the unencoded JSON string.

{"1.1.1.1.1.1.12345.123456789012.123.12345678901234.1":{"Instances":{"1.1.1.1.1.1.12345.123456789012.123.12345678901234.1":{}}}}}}

Output::

{
"latestVersionId": "2",
"imageSetWorkflowStatus": "UPDATING",
"updatedAt": 1680042257.908,
"imageSetId": "ea92b0d8838c72a3f25d00d13616f87e",
Expand Down

0 comments on commit 149fc98

Please sign in to comment.