Skip to content

Commit 9c91d94

Browse files
Deid GA Cleanup (Azure#44994)
* Pull in TypeSpec changes, update tests, samples, and changelog * update tsp --------- Co-authored-by: Josiah Vinson <jovinson@microsoft.com>
1 parent f3f68e5 commit 9c91d94

16 files changed

Lines changed: 117 additions & 144 deletions

File tree

sdk/healthdataaiservices/azure-health-deidentification/CHANGELOG.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@
1111

1212
### Breaking Changes
1313

14-
- Changed the name of model `OperationState` to `OperationStatus`.
15-
- Changed the property `DeidentificationJob.name` to `DeidentificationJob.jobName`, and corresponding parameters in client methods.
16-
- Changed the property `DeidentificationJob.type` to `DeidentificationJob.operationType`.
1714
- Changed method names in `DeidentificationClient` to match functionality:
18-
- Changed the `deidentify` method name to `deidentifyText`.
19-
- Changed the `beginCreateJob` method name to `beginDeidentifyDocuments`.
20-
- Changed `outputPrefix` behavior to no longer include `jobName` by default.
21-
- Changed `Path` field to `Location` in `SourceStorageLocation` and `TargetStorageLocation`.
15+
- Changed the `deidentify` method name to `deidentifyText`.
16+
- Changed the `beginCreateJob` method name to `beginDeidentifyDocuments`.
17+
- Renamed the property `DeidentificationContent.operation` to `operationType`.
2218
- Deprecated `DocumentDataType`.
19+
- Changed the model `DeidentificationDocumentDetails`:
20+
- Renamed `input` to `inputLocation`.
21+
- Renamed `output` to `outputLocation`.
22+
- Changed the model `DeidentificationJob`
23+
- Renamed `name` to `jobName`.
24+
- Renamed `operation` to `operationType`.
25+
- Renamed the model `OperationState` to `OperationStatus`.
26+
- Changed the model `PhiCategory`:
27+
- Renamed `IDNUM` to `ID_NUM`.
28+
- Renamed `IPADDRESS` to `IP_ADDRESS`.
29+
- Changed `Path` field to `Location` in `SourceStorageLocation` and `TargetStorageLocation`.
30+
- Changed `outputPrefix` behavior to no longer include `jobName` by default.
2331
- Deprecated `Path` and `Location` from `TaggerResult` model.
2432

2533
## 1.0.0-beta.1 (2024-08-15)

sdk/healthdataaiservices/azure-health-deidentification/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ You can de-identify text directly using the `DeidentificationClient`:
6464
String inputText = "Hello, my name is John Smith.";
6565

6666
DeidentificationContent content = new DeidentificationContent(inputText);
67-
content.setOperation(DeidentificationOperationType.SURROGATE);
67+
content.setOperationType(DeidentificationOperationType.SURROGATE);
6868

6969
DeidentificationResult result = deidentificationClient.deidentifyText(content);
7070
System.out.println("De-identified output: " + (result != null ? result.getOutputText() : null));
@@ -122,7 +122,7 @@ DeidentificationClient deidentificationClient = new DeidentificationClientBuilde
122122
String inputText = "Hello, my name is John Smith.";
123123

124124
DeidentificationContent content = new DeidentificationContent(inputText);
125-
content.setOperation(DeidentificationOperationType.SURROGATE);
125+
content.setOperationType(DeidentificationOperationType.SURROGATE);
126126

127127
DeidentificationResult result = deidentificationClient.deidentifyText(content);
128128
System.out.println("De-identified output: " + (result != null ? result.getOutputText() : null));
@@ -171,7 +171,7 @@ for (DeidentificationJob job : result) {
171171
String jobName = Configuration.getGlobalConfiguration().get("DEID_JOB_NAME");
172172
PagedIterable<DeidentificationDocumentDetails> result = deidentificationClient.listJobDocuments(jobName);
173173
for (DeidentificationDocumentDetails documentDetails : result) {
174-
System.out.println(documentDetails.getInput().getLocation() + " - " + documentDetails.getStatus());
174+
System.out.println(documentDetails.getInputLocation().getLocation() + " - " + documentDetails.getStatus());
175175
}
176176
```
177177

sdk/healthdataaiservices/azure-health-deidentification/customization/pom.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

sdk/healthdataaiservices/azure-health-deidentification/customization/src/main/java/ListJobsCustomization.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/models/DeidentificationContent.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ public final class DeidentificationContent implements JsonSerializable<Deidentif
2323
@Generated
2424
private final String inputText;
2525

26-
/*
27-
* Operation to perform on the input documents.
28-
*/
29-
@Generated
30-
private DeidentificationOperationType operation;
31-
3226
/*
3327
* Customization parameters to override default service behaviors.
3428
*/
@@ -55,28 +49,6 @@ public String getInputText() {
5549
return this.inputText;
5650
}
5751

58-
/**
59-
* Get the operation property: Operation to perform on the input documents.
60-
*
61-
* @return the operation value.
62-
*/
63-
@Generated
64-
public DeidentificationOperationType getOperation() {
65-
return this.operation;
66-
}
67-
68-
/**
69-
* Set the operation property: Operation to perform on the input documents.
70-
*
71-
* @param operation the operation value to set.
72-
* @return the DeidentificationContent object itself.
73-
*/
74-
@Generated
75-
public DeidentificationContent setOperation(DeidentificationOperationType operation) {
76-
this.operation = operation;
77-
return this;
78-
}
79-
8052
/**
8153
* Get the customizations property: Customization parameters to override default service behaviors.
8254
*
@@ -107,7 +79,7 @@ public DeidentificationContent setCustomizations(DeidentificationCustomizationOp
10779
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
10880
jsonWriter.writeStartObject();
10981
jsonWriter.writeStringField("inputText", this.inputText);
110-
jsonWriter.writeStringField("operation", this.operation == null ? null : this.operation.toString());
82+
jsonWriter.writeStringField("operation", this.operationType == null ? null : this.operationType.toString());
11183
jsonWriter.writeJsonField("customizations", this.customizations);
11284
return jsonWriter.writeEndObject();
11385
}
@@ -125,25 +97,53 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
12597
public static DeidentificationContent fromJson(JsonReader jsonReader) throws IOException {
12698
return jsonReader.readObject(reader -> {
12799
String inputText = null;
128-
DeidentificationOperationType operation = null;
100+
DeidentificationOperationType operationType = null;
129101
DeidentificationCustomizationOptions customizations = null;
130102
while (reader.nextToken() != JsonToken.END_OBJECT) {
131103
String fieldName = reader.getFieldName();
132104
reader.nextToken();
133105
if ("inputText".equals(fieldName)) {
134106
inputText = reader.getString();
135107
} else if ("operation".equals(fieldName)) {
136-
operation = DeidentificationOperationType.fromString(reader.getString());
108+
operationType = DeidentificationOperationType.fromString(reader.getString());
137109
} else if ("customizations".equals(fieldName)) {
138110
customizations = DeidentificationCustomizationOptions.fromJson(reader);
139111
} else {
140112
reader.skipChildren();
141113
}
142114
}
143115
DeidentificationContent deserializedDeidentificationContent = new DeidentificationContent(inputText);
144-
deserializedDeidentificationContent.operation = operation;
116+
deserializedDeidentificationContent.operationType = operationType;
145117
deserializedDeidentificationContent.customizations = customizations;
146118
return deserializedDeidentificationContent;
147119
});
148120
}
121+
122+
/*
123+
* Operation to perform on the input documents.
124+
*/
125+
@Generated
126+
private DeidentificationOperationType operationType;
127+
128+
/**
129+
* Get the operationType property: Operation to perform on the input documents.
130+
*
131+
* @return the operationType value.
132+
*/
133+
@Generated
134+
public DeidentificationOperationType getOperationType() {
135+
return this.operationType;
136+
}
137+
138+
/**
139+
* Set the operationType property: Operation to perform on the input documents.
140+
*
141+
* @param operationType the operationType value to set.
142+
* @return the DeidentificationContent object itself.
143+
*/
144+
@Generated
145+
public DeidentificationContent setOperationType(DeidentificationOperationType operationType) {
146+
this.operationType = operationType;
147+
return this;
148+
}
149149
}

sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/models/DeidentificationDocumentDetails.java

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@ public final class DeidentificationDocumentDetails implements JsonSerializable<D
2424
@Generated
2525
private String id;
2626

27-
/*
28-
* Location for the input.
29-
*/
30-
@Generated
31-
private final DeidentificationDocumentLocation input;
32-
33-
/*
34-
* Location for the output.
35-
*/
36-
@Generated
37-
private DeidentificationDocumentLocation output;
38-
3927
/*
4028
* Status of the document.
4129
*/
@@ -58,26 +46,6 @@ public String getId() {
5846
return this.id;
5947
}
6048

61-
/**
62-
* Get the input property: Location for the input.
63-
*
64-
* @return the input value.
65-
*/
66-
@Generated
67-
public DeidentificationDocumentLocation getInput() {
68-
return this.input;
69-
}
70-
71-
/**
72-
* Get the output property: Location for the output.
73-
*
74-
* @return the output value.
75-
*/
76-
@Generated
77-
public DeidentificationDocumentLocation getOutput() {
78-
return this.output;
79-
}
80-
8149
/**
8250
* Get the status property: Status of the document.
8351
*
@@ -105,9 +73,9 @@ public ResponseError getError() {
10573
@Override
10674
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
10775
jsonWriter.writeStartObject();
108-
jsonWriter.writeJsonField("input", this.input);
76+
jsonWriter.writeJsonField("input", this.inputLocation);
10977
jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString());
110-
jsonWriter.writeJsonField("output", this.output);
78+
jsonWriter.writeJsonField("output", this.outputLocation);
11179
jsonWriter.writeJsonField("error", this.error);
11280
return jsonWriter.writeEndObject();
11381
}
@@ -125,31 +93,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
12593
public static DeidentificationDocumentDetails fromJson(JsonReader jsonReader) throws IOException {
12694
return jsonReader.readObject(reader -> {
12795
String id = null;
128-
DeidentificationDocumentLocation input = null;
96+
DeidentificationDocumentLocation inputLocation = null;
12997
OperationStatus status = null;
130-
DeidentificationDocumentLocation output = null;
98+
DeidentificationDocumentLocation outputLocation = null;
13199
ResponseError error = null;
132100
while (reader.nextToken() != JsonToken.END_OBJECT) {
133101
String fieldName = reader.getFieldName();
134102
reader.nextToken();
135103
if ("id".equals(fieldName)) {
136104
id = reader.getString();
137105
} else if ("input".equals(fieldName)) {
138-
input = DeidentificationDocumentLocation.fromJson(reader);
106+
inputLocation = DeidentificationDocumentLocation.fromJson(reader);
139107
} else if ("status".equals(fieldName)) {
140108
status = OperationStatus.fromString(reader.getString());
141109
} else if ("output".equals(fieldName)) {
142-
output = DeidentificationDocumentLocation.fromJson(reader);
110+
outputLocation = DeidentificationDocumentLocation.fromJson(reader);
143111
} else if ("error".equals(fieldName)) {
144112
error = ResponseError.fromJson(reader);
145113
} else {
146114
reader.skipChildren();
147115
}
148116
}
149117
DeidentificationDocumentDetails deserializedDeidentificationDocumentDetails
150-
= new DeidentificationDocumentDetails(input, status);
118+
= new DeidentificationDocumentDetails(inputLocation, status);
151119
deserializedDeidentificationDocumentDetails.id = id;
152-
deserializedDeidentificationDocumentDetails.output = output;
120+
deserializedDeidentificationDocumentDetails.outputLocation = outputLocation;
153121
deserializedDeidentificationDocumentDetails.error = error;
154122
return deserializedDeidentificationDocumentDetails;
155123
});
@@ -158,12 +126,44 @@ public static DeidentificationDocumentDetails fromJson(JsonReader jsonReader) th
158126
/**
159127
* Creates an instance of DeidentificationDocumentDetails class.
160128
*
161-
* @param input the input value to set.
129+
* @param inputLocation the inputLocation value to set.
162130
* @param status the status value to set.
163131
*/
164132
@Generated
165-
private DeidentificationDocumentDetails(DeidentificationDocumentLocation input, OperationStatus status) {
166-
this.input = input;
133+
private DeidentificationDocumentDetails(DeidentificationDocumentLocation inputLocation, OperationStatus status) {
134+
this.inputLocation = inputLocation;
167135
this.status = status;
168136
}
137+
138+
/*
139+
* Location for the input.
140+
*/
141+
@Generated
142+
private final DeidentificationDocumentLocation inputLocation;
143+
144+
/*
145+
* Location for the output.
146+
*/
147+
@Generated
148+
private DeidentificationDocumentLocation outputLocation;
149+
150+
/**
151+
* Get the inputLocation property: Location for the input.
152+
*
153+
* @return the inputLocation value.
154+
*/
155+
@Generated
156+
public DeidentificationDocumentLocation getInputLocation() {
157+
return this.inputLocation;
158+
}
159+
160+
/**
161+
* Get the outputLocation property: Location for the output.
162+
*
163+
* @return the outputLocation value.
164+
*/
165+
@Generated
166+
public DeidentificationDocumentLocation getOutputLocation() {
167+
return this.outputLocation;
168+
}
169169
}

sdk/healthdataaiservices/azure-health-deidentification/src/main/java/com/azure/health/deidentification/models/PhiCategory.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,6 @@ public final class PhiCategory extends ExpandableStringEnum<PhiCategory> {
9090
@Generated
9191
public static final PhiCategory HOSPITAL = fromString("Hospital");
9292

93-
/**
94-
* Id Number, eg. passport number.
95-
*/
96-
@Generated
97-
public static final PhiCategory IDNUM = fromString("IDNum");
98-
99-
/**
100-
* IP Address.
101-
*/
102-
@Generated
103-
public static final PhiCategory IPADDRESS = fromString("IPAddress");
104-
10593
/**
10694
* License, eg. Driver's license or medical license.
10795
*/
@@ -216,4 +204,16 @@ public static PhiCategory fromString(String name) {
216204
public static Collection<PhiCategory> values() {
217205
return values(PhiCategory.class);
218206
}
207+
208+
/**
209+
* Id Number, eg. passport number.
210+
*/
211+
@Generated
212+
public static final PhiCategory ID_NUM = fromString("IDNum");
213+
214+
/**
215+
* IP Address.
216+
*/
217+
@Generated
218+
public static final PhiCategory IP_ADDRESS = fromString("IPAddress");
219219
}

sdk/healthdataaiservices/azure-health-deidentification/src/samples/java/com/azure/health/deidentification/DeidentifyText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static void main(String[] args) {
2020
String inputText = "Hello, my name is John Smith.";
2121

2222
DeidentificationContent content = new DeidentificationContent(inputText);
23-
content.setOperation(DeidentificationOperationType.SURROGATE);
23+
content.setOperationType(DeidentificationOperationType.SURROGATE);
2424

2525
DeidentificationResult result = deidentificationClient.deidentifyText(content);
2626
System.out.println("De-identified output: " + (result != null ? result.getOutputText() : null));

0 commit comments

Comments
 (0)