Skip to content

Commit 03a9eeb

Browse files
author
awstools
committed
feat(client-medical-imaging): CopyImageSet API adds copying selected instances between image sets, and overriding inconsistent metadata with a force parameter. UpdateImageSetMetadata API enables reverting to prior versions; updates to Study, Series, and SOP Instance UIDs; and updates to private elements, with a force parameter.
1 parent b47a096 commit 03a9eeb

File tree

8 files changed

+243
-12
lines changed

8 files changed

+243
-12
lines changed

clients/client-medical-imaging/src/auth/httpAuthSchemeProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function createAwsAuthSigv4HttpAuthOption(authParameters: MedicalImagingHttpAuth
6060
name: "medical-imaging",
6161
region: authParameters.region,
6262
},
63-
propertiesExtractor: (config: MedicalImagingClientConfig, context) => ({
63+
propertiesExtractor: (config: Partial<MedicalImagingClientConfig>, context) => ({
6464
/**
6565
* @internal
6666
*/

clients/client-medical-imaging/src/commands/CopyImageSetCommand.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { MedicalImagingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MedicalImagingClient";
9-
import { CopyImageSetRequest, CopyImageSetResponse } from "../models/models_0";
9+
import { CopyImageSetRequest, CopyImageSetRequestFilterSensitiveLog, CopyImageSetResponse } from "../models/models_0";
1010
import { de_CopyImageSetCommand, se_CopyImageSetCommand } from "../protocols/Aws_restJson1";
1111

1212
/**
@@ -41,12 +41,16 @@ export interface CopyImageSetCommandOutput extends CopyImageSetResponse, __Metad
4141
* copyImageSetInformation: { // CopyImageSetInformation
4242
* sourceImageSet: { // CopySourceImageSetInformation
4343
* latestVersionId: "STRING_VALUE", // required
44+
* DICOMCopies: { // MetadataCopies
45+
* copiableAttributes: "STRING_VALUE", // required
46+
* },
4447
* },
4548
* destinationImageSet: { // CopyDestinationImageSet
4649
* imageSetId: "STRING_VALUE", // required
4750
* latestVersionId: "STRING_VALUE", // required
4851
* },
4952
* },
53+
* force: true || false,
5054
* };
5155
* const command = new CopyImageSetCommand(input);
5256
* const response = await client.send(command);
@@ -125,7 +129,7 @@ export class CopyImageSetCommand extends $Command
125129
})
126130
.s("AHIGatewayService", "CopyImageSet", {})
127131
.n("MedicalImagingClient", "CopyImageSetCommand")
128-
.f(void 0, void 0)
132+
.f(CopyImageSetRequestFilterSensitiveLog, void 0)
129133
.ser(se_CopyImageSetCommand)
130134
.de(de_CopyImageSetCommand)
131135
.build() {}

clients/client-medical-imaging/src/commands/GetImageSetCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export interface GetImageSetCommandOutput extends GetImageSetResponse, __Metadat
5353
* // deletedAt: new Date("TIMESTAMP"),
5454
* // message: "STRING_VALUE",
5555
* // imageSetArn: "STRING_VALUE",
56+
* // overrides: { // Overrides
57+
* // forced: true || false,
58+
* // },
5659
* // };
5760
*
5861
* ```

clients/client-medical-imaging/src/commands/ListImageSetVersionsCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export interface ListImageSetVersionsCommandOutput extends ListImageSetVersionsR
5454
* // updatedAt: new Date("TIMESTAMP"),
5555
* // deletedAt: new Date("TIMESTAMP"),
5656
* // message: "STRING_VALUE",
57+
* // overrides: { // Overrides
58+
* // forced: true || false,
59+
* // },
5760
* // },
5861
* // ],
5962
* // nextToken: "STRING_VALUE",

clients/client-medical-imaging/src/commands/UpdateImageSetMetadataCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ export interface UpdateImageSetMetadataCommandOutput extends UpdateImageSetMetad
4343
* datastoreId: "STRING_VALUE", // required
4444
* imageSetId: "STRING_VALUE", // required
4545
* latestVersionId: "STRING_VALUE", // required
46+
* force: true || false,
4647
* updateImageSetMetadataUpdates: { // MetadataUpdates Union: only one key present
4748
* DICOMUpdates: { // DICOMUpdates
4849
* removableAttributes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
4950
* updatableAttributes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
5051
* },
52+
* revertToVersionId: "STRING_VALUE",
5153
* },
5254
* };
5355
* const command = new UpdateImageSetMetadataCommand(input);

clients/client-medical-imaging/src/models/models_0.ts

Lines changed: 130 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ export interface CopyDestinationImageSet {
6363
latestVersionId: string | undefined;
6464
}
6565

66+
/**
67+
* <p>Contains copiable <code>Attributes</code> structure and wraps information related to specific copy use cases.
68+
* For example, when copying subsets.</p>
69+
* @public
70+
*/
71+
export interface MetadataCopies {
72+
/**
73+
* <p>The JSON string used to specify a subset of SOP Instances to copy from source to destination image set.</p>
74+
* @public
75+
*/
76+
copiableAttributes: string | undefined;
77+
}
78+
6679
/**
6780
* <p>Copy source image set information.</p>
6881
* @public
@@ -73,6 +86,13 @@ export interface CopySourceImageSetInformation {
7386
* @public
7487
*/
7588
latestVersionId: string | undefined;
89+
90+
/**
91+
* <p>Contains <code>MetadataCopies</code> structure and wraps information related to specific copy use cases.
92+
* For example, when copying subsets.</p>
93+
* @public
94+
*/
95+
DICOMCopies?: MetadataCopies;
7696
}
7797

7898
/**
@@ -114,6 +134,13 @@ export interface CopyImageSetRequest {
114134
* @public
115135
*/
116136
copyImageSetInformation: CopyImageSetInformation | undefined;
137+
138+
/**
139+
* <p>Setting this flag will force the <code>CopyImageSet</code> operation, even if Patient, Study, or Series level
140+
* metadata are mismatched across the <code>sourceImageSet</code> and <code>destinationImageSet</code>.</p>
141+
* @public
142+
*/
143+
force?: boolean;
117144
}
118145

119146
/**
@@ -847,6 +874,20 @@ export interface GetImageSetRequest {
847874
versionId?: string;
848875
}
849876

877+
/**
878+
* <p>Specifies the overrides used in image set modification calls to <code>CopyImageSet</code> and
879+
* <code>UpdateImageSetMetadata</code>.</p>
880+
* @public
881+
*/
882+
export interface Overrides {
883+
/**
884+
* <p>Setting this flag will force the <code>CopyImageSet</code> and <code>UpdateImageSetMetadata</code>
885+
* operations, even if Patient, Study, or Series level metadata are mismatched.</p>
886+
* @public
887+
*/
888+
forced?: boolean;
889+
}
890+
850891
/**
851892
* @public
852893
*/
@@ -910,6 +951,14 @@ export interface GetImageSetResponse {
910951
* @public
911952
*/
912953
imageSetArn?: string;
954+
955+
/**
956+
* <p>This object contains the details of any overrides used while creating a specific image set version.
957+
* If an image set was copied or updated using the <code>force</code> flag, this object will contain the
958+
* <code>forced</code> flag.</p>
959+
* @public
960+
*/
961+
overrides?: Overrides;
913962
}
914963

915964
/**
@@ -1139,6 +1188,14 @@ export interface ImageSetProperties {
11391188
* @public
11401189
*/
11411190
message?: string;
1191+
1192+
/**
1193+
* <p>Contains details on overrides used when creating the returned version of an image set.
1194+
* For example, if <code>forced</code> exists, the <code>forced</code> flag was used when
1195+
* creating the image set.</p>
1196+
* @public
1197+
*/
1198+
overrides?: Overrides;
11421199
}
11431200

11441201
/**
@@ -1817,7 +1874,10 @@ export interface DICOMUpdates {
18171874
* <p>Contains DICOMUpdates.</p>
18181875
* @public
18191876
*/
1820-
export type MetadataUpdates = MetadataUpdates.DICOMUpdatesMember | MetadataUpdates.$UnknownMember;
1877+
export type MetadataUpdates =
1878+
| MetadataUpdates.DICOMUpdatesMember
1879+
| MetadataUpdates.RevertToVersionIdMember
1880+
| MetadataUpdates.$UnknownMember;
18211881

18221882
/**
18231883
* @public
@@ -1829,6 +1889,21 @@ export namespace MetadataUpdates {
18291889
*/
18301890
export interface DICOMUpdatesMember {
18311891
DICOMUpdates: DICOMUpdates;
1892+
revertToVersionId?: never;
1893+
$unknown?: never;
1894+
}
1895+
1896+
/**
1897+
* <p>Specifies the previous image set version ID to revert the current image set back to.</p>
1898+
* <note>
1899+
* <p>You must provide either <code>revertToVersionId</code> or <code>DICOMUpdates</code> in your request. A
1900+
* <code>ValidationException</code> error is thrown if both parameters are provided at the same time.</p>
1901+
* </note>
1902+
* @public
1903+
*/
1904+
export interface RevertToVersionIdMember {
1905+
DICOMUpdates?: never;
1906+
revertToVersionId: string;
18321907
$unknown?: never;
18331908
}
18341909

@@ -1837,16 +1912,19 @@ export namespace MetadataUpdates {
18371912
*/
18381913
export interface $UnknownMember {
18391914
DICOMUpdates?: never;
1915+
revertToVersionId?: never;
18401916
$unknown: [string, any];
18411917
}
18421918

18431919
export interface Visitor<T> {
18441920
DICOMUpdates: (value: DICOMUpdates) => T;
1921+
revertToVersionId: (value: string) => T;
18451922
_: (name: string, value: any) => T;
18461923
}
18471924

18481925
export const visit = <T>(value: MetadataUpdates, visitor: Visitor<T>): T => {
18491926
if (value.DICOMUpdates !== undefined) return visitor.DICOMUpdates(value.DICOMUpdates);
1927+
if (value.revertToVersionId !== undefined) return visitor.revertToVersionId(value.revertToVersionId);
18501928
return visitor._(value.$unknown[0], value.$unknown[1]);
18511929
};
18521930
}
@@ -1873,6 +1951,22 @@ export interface UpdateImageSetMetadataRequest {
18731951
*/
18741952
latestVersionId: string | undefined;
18751953

1954+
/**
1955+
* <p>Setting this flag will force the <code>UpdateImageSetMetadata</code> operation for the following attributes:</p>
1956+
* <ul>
1957+
* <li>
1958+
* <p>
1959+
* <code>Tag.StudyInstanceUID</code>, <code>Tag.SeriesInstanceUID</code>, <code>Tag.SOPInstanceUID</code>, and <code>Tag.StudyID</code>
1960+
* </p>
1961+
* </li>
1962+
* <li>
1963+
* <p>Adding, removing, or updating private tags for an individual SOP Instance</p>
1964+
* </li>
1965+
* </ul>
1966+
* @public
1967+
*/
1968+
force?: boolean;
1969+
18761970
/**
18771971
* <p>Update image set metadata updates.</p>
18781972
* @public
@@ -1933,6 +2027,40 @@ export interface UpdateImageSetMetadataResponse {
19332027
message?: string;
19342028
}
19352029

2030+
/**
2031+
* @internal
2032+
*/
2033+
export const MetadataCopiesFilterSensitiveLog = (obj: MetadataCopies): any => ({
2034+
...obj,
2035+
...(obj.copiableAttributes && { copiableAttributes: SENSITIVE_STRING }),
2036+
});
2037+
2038+
/**
2039+
* @internal
2040+
*/
2041+
export const CopySourceImageSetInformationFilterSensitiveLog = (obj: CopySourceImageSetInformation): any => ({
2042+
...obj,
2043+
...(obj.DICOMCopies && { DICOMCopies: MetadataCopiesFilterSensitiveLog(obj.DICOMCopies) }),
2044+
});
2045+
2046+
/**
2047+
* @internal
2048+
*/
2049+
export const CopyImageSetInformationFilterSensitiveLog = (obj: CopyImageSetInformation): any => ({
2050+
...obj,
2051+
...(obj.sourceImageSet && { sourceImageSet: CopySourceImageSetInformationFilterSensitiveLog(obj.sourceImageSet) }),
2052+
});
2053+
2054+
/**
2055+
* @internal
2056+
*/
2057+
export const CopyImageSetRequestFilterSensitiveLog = (obj: CopyImageSetRequest): any => ({
2058+
...obj,
2059+
...(obj.copyImageSetInformation && {
2060+
copyImageSetInformation: CopyImageSetInformationFilterSensitiveLog(obj.copyImageSetInformation),
2061+
}),
2062+
});
2063+
19362064
/**
19372065
* @internal
19382066
*/
@@ -2051,6 +2179,7 @@ export const DICOMUpdatesFilterSensitiveLog = (obj: DICOMUpdates): any => ({
20512179
*/
20522180
export const MetadataUpdatesFilterSensitiveLog = (obj: MetadataUpdates): any => {
20532181
if (obj.DICOMUpdates !== undefined) return { DICOMUpdates: DICOMUpdatesFilterSensitiveLog(obj.DICOMUpdates) };
2182+
if (obj.revertToVersionId !== undefined) return { revertToVersionId: obj.revertToVersionId };
20542183
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
20552184
};
20562185

clients/client-medical-imaging/src/protocols/Aws_restJson1.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import {
8585
ImageSetProperties,
8686
ImageSetsMetadataSummary,
8787
InternalServerException,
88+
MetadataCopies,
8889
MetadataUpdates,
8990
ResourceNotFoundException,
9091
SearchByAttributeValue,
@@ -110,6 +111,9 @@ export const se_CopyImageSetCommand = async (
110111
b.bp("/datastore/{datastoreId}/imageSet/{sourceImageSetId}/copyImageSet");
111112
b.p("datastoreId", () => input.datastoreId!, "{datastoreId}", false);
112113
b.p("sourceImageSetId", () => input.sourceImageSetId!, "{sourceImageSetId}", false);
114+
const query: any = map({
115+
[_f]: [() => input.force !== void 0, () => input[_f]!.toString()],
116+
});
113117
let body: any;
114118
if (input.copyImageSetInformation !== undefined) {
115119
body = _json(input.copyImageSetInformation);
@@ -126,7 +130,7 @@ export const se_CopyImageSetCommand = async (
126130
}
127131
}
128132
b.hn(resolvedHostname);
129-
b.m("POST").h(headers).b(body);
133+
b.m("POST").h(headers).q(query).b(body);
130134
return b.build();
131135
};
132136

@@ -531,6 +535,7 @@ export const se_UpdateImageSetMetadataCommand = async (
531535
b.p("imageSetId", () => input.imageSetId!, "{imageSetId}", false);
532536
const query: any = map({
533537
[_lV]: [, __expectNonNull(input[_lVI]!, `latestVersionId`)],
538+
[_f]: [() => input.force !== void 0, () => input[_f]!.toString()],
534539
});
535540
let body: any;
536541
if (input.updateImageSetMetadataUpdates !== undefined) {
@@ -728,6 +733,7 @@ export const de_GetImageSetCommand = async (
728733
imageSetState: __expectString,
729734
imageSetWorkflowStatus: __expectString,
730735
message: __expectString,
736+
overrides: _json,
731737
updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
732738
versionId: __expectString,
733739
});
@@ -1145,12 +1151,15 @@ const se_DICOMUpdates = (input: DICOMUpdates, context: __SerdeContext): any => {
11451151

11461152
// se_ImageFrameInformation omitted.
11471153

1154+
// se_MetadataCopies omitted.
1155+
11481156
/**
11491157
* serializeAws_restJson1MetadataUpdates
11501158
*/
11511159
const se_MetadataUpdates = (input: MetadataUpdates, context: __SerdeContext): any => {
11521160
return MetadataUpdates.visit(input, {
11531161
DICOMUpdates: (value) => ({ DICOMUpdates: se_DICOMUpdates(value, context) }),
1162+
revertToVersionId: (value) => ({ revertToVersionId: value }),
11541163
_: (name, value) => ({ name: value } as any),
11551164
});
11561165
};
@@ -1351,6 +1360,7 @@ const de_ImageSetProperties = (output: any, context: __SerdeContext): ImageSetPr
13511360
imageSetId: __expectString,
13521361
imageSetState: __expectString,
13531362
message: __expectString,
1363+
overrides: _json,
13541364
updatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
13551365
versionId: __expectString,
13561366
}) as any;
@@ -1393,6 +1403,8 @@ const de_ImageSetsMetadataSummary = (output: any, context: __SerdeContext): Imag
13931403
}) as any;
13941404
};
13951405

1406+
// de_Overrides omitted.
1407+
13961408
// de_Sort omitted.
13971409

13981410
// de_TagMap omitted.
@@ -1421,6 +1433,7 @@ const _cT = "contentType";
14211433
const _ce = "content-encoding";
14221434
const _ct = "content-type";
14231435
const _dS = "datastoreStatus";
1436+
const _f = "force";
14241437
const _jS = "jobStatus";
14251438
const _lV = "latestVersion";
14261439
const _lVI = "latestVersionId";

0 commit comments

Comments
 (0)