Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e4e1919
Initialize with generated files
danielszaniszlo Jun 19, 2024
9b6225b
Adding initial test cases and module setup
danielszaniszlo Jun 25, 2024
54fd91d
adding test cases
danielszaniszlo Jun 28, 2024
d9c0dbc
add async tests
danielszaniszlo Jul 1, 2024
8b3f38d
adding post processing for generated files
danielszaniszlo Jul 1, 2024
a885013
Adding readme and samples
danielszaniszlo Jul 2, 2024
b4a6efb
regenerated README
danielszaniszlo Jul 2, 2024
34618a6
adding playback
danielszaniszlo Jul 10, 2024
55a6c45
fixing test cases for playback mode
danielszaniszlo Jul 10, 2024
c8c9c22
adding module-info
danielszaniszlo Jul 11, 2024
0ab3088
add assets.json with recordings location
scbedd Jul 12, 2024
079d8c9
fixing comment + adding ci.yml
danielszaniszlo Jul 12, 2024
644e173
Update ci.yml
samvaity Jul 15, 2024
ba60eea
Update ci.yml
samvaity Jul 15, 2024
d68eacf
Merge remote-tracking branch 'upstream/main' into daszanis/feature/sd…
danielszaniszlo Jul 16, 2024
0ccf306
regenerated SDK and new test cases recorded and published
danielszaniszlo Jul 16, 2024
9c2db0a
removed local setup
danielszaniszlo Jul 16, 2024
c4937fd
adding groupId
danielszaniszlo Jul 16, 2024
31f0c83
fix versions
danielszaniszlo Jul 16, 2024
5540386
fix linting issues
danielszaniszlo Jul 16, 2024
10c714e
use base util test base + resourcenamer
samvaity Jul 17, 2024
f415c8d
regenerated SDK with commit hash
danielszaniszlo Jul 18, 2024
5b9e2f2
new recordings removed sas uri
danielszaniszlo Jul 19, 2024
4d5dad5
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
danielszaniszlo Jul 19, 2024
5cd4628
fixed pipeline errors
danielszaniszlo Jul 19, 2024
0958015
regenerate client from the latest
danielszaniszlo Jul 19, 2024
1bfc67e
fix cspell errors
danielszaniszlo Jul 19, 2024
4c4b4d9
fix comments
danielszaniszlo Jul 22, 2024
468dd9d
Remove unused customization package
danielszaniszlo Jul 22, 2024
8634a73
removed extra line
danielszaniszlo Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@
"databind",
"databricks",
"DAZURE",
"deidentification",
"deidentificationclient",
"deidentified",
"deid",
"deidservices",
"deidentify",
"ddos",
"dcis",
"deallocate",
Expand All @@ -301,6 +307,7 @@
"Entra",
"Esto",
"etag",
"euap",
"eventhub",
"eventhubs",
"failondeprecatedstatus",
Expand All @@ -316,10 +323,12 @@
"hanaonazure",
"hdfs",
"hdinsight",
"healthdataaiservices",
"hudha",
"hvac",
"hybridkubernetes",
"hyunwoongko",
"idnum",
"insights",
"intellij",
"Intellij",
Expand Down
1 change: 1 addition & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ com.azure:azure-developer-devcenter;1.0.1;1.1.0-beta.1
com.azure:azure-developer-loadtesting;1.0.14;1.1.0-beta.1
com.azure:azure-digitaltwins-core;1.3.21;1.4.0-beta.1
com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-health-deidentification;1.0.0;1.0.0-beta.1
com.azure:azure-health-insights-clinicalmatching;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-health-insights-cancerprofiling;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-health-insights-radiologyinsights;1.0.0-beta.1;1.0.0-beta.2
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<module>sdk/hdinsight</module>
<module>sdk/healthbot</module>
<module>sdk/healthcareapis</module>
<module>sdk/healthdataaiservices</module>
<module>sdk/healthinsights</module>
<module>sdk/hybridcompute</module>
<module>sdk/hybridconnectivity</module>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

- Azure Deidentification client library for Java. This package contains Microsoft Azure Deidentification client library.

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
161 changes: 161 additions & 0 deletions sdk/healthdataaiservices/azure-health-deidentification/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Azure Deidentification client library for Java

Azure Deidentification client library for Java.

This package contains Microsoft Azure Deidentification client library which is a managed service that enables users to tag, redact, or surrogate health data.

## Documentation

Various documentation is available to help you get started

- [API reference documentation][docs]
- [Product documentation][product_documentation]

## Getting started

### Prerequisites

- [Java Development Kit (JDK)][jdk] with version 8 or above
- [Azure Subscription][azure_subscription]

### Adding the package to your product

[//]: # ({x-version-update-start;com.azure:azure-health-deidentification;current})
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-health-deidentification</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})

### Authentication

[Azure Identity][azure_identity] package provides the default implementation for authenticating the client.

## Key concepts
### Operation Modes:

- Tag: Will return a structure of offset and length with the PHI category of the related text spans.
- Redact: Will return output text with placeholder stubbed text. ex. `[name]`
- Surrogate: Will return output text with synthetic replacements.
- `My name is John Smith`
- `My name is Tom Jones`

## Examples

The following sections provide several code snippets covering some of the most common Azure Deidentification client use cases, including:

- [Create a `DeidentificationClient`](#create-a-deidentificationclient)
- [Calling deidentification endpoint](#calling-deidentification-endpoint)
- [Creating deidentification Job](#creating-deidentification-job)
- [Process deidentification Job](#process-deidentification-job)
- [List deidentification Jobs](#list-deidentification-jobs)
- [List completed files](#list-completed-files)

### Create a `DeidentificationClient`

Create a `DeidentificationClient` using the `DEID_SERVICE_ENDPOINT` environment variable.

```java com.azure.health.deidentification.readme
DeidentificationClientBuilder deidentificationClientbuilder = new DeidentificationClientBuilder()
.endpoint(Configuration.getGlobalConfiguration().get("DEID_SERVICE_ENDPOINT", "endpoint"))
.httpClient(HttpClient.createDefault())
.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));

DeidentificationClient deidentificationClient = deidentificationClientbuilder.buildClient();
```

### Calling `Deidentification` endpoint

Calling the realtime endpoint with an input.

```java com.azure.health.deidentification.sync.helloworld
String inputText = "Hello, my name is John Smith.";

DeidentificationContent content = new DeidentificationContent(inputText);

DeidentificationResult result = deidentificationClient.deidentify(content);

System.out.println("Deidentified output: " + result.getOutputText());
// Deidentified output: Hello, my name is Harley Billiard.
```
### Creating Deidentification Job

Creating a Deidentification Job using `STORAGE_ACCOUNT_NAME` and `STORAGE_CONTAINER_NAME` environment variables.

```java com.azure.health.deidentification.sync.createjob.create
String storageLocation = "https://" + Configuration.getGlobalConfiguration().get("STORAGE_ACCOUNT_NAME") + ".blob.core.windows.net/" + Configuration.getGlobalConfiguration().get("STORAGE_CONTAINER_NAME");
String jobName = "MyJob-" + Instant.now().toEpochMilli();
String outputFolder = "_output";
String inputPrefix = "example_patient_1";
SourceStorageLocation sourceStorageLocation = new SourceStorageLocation(storageLocation, inputPrefix);

DeidentificationJob job = new DeidentificationJob(sourceStorageLocation, new TargetStorageLocation(storageLocation, outputFolder));
job.setOperation(OperationType.SURROGATE);
job.setDataType(DocumentDataType.PLAINTEXT);

```
### Process Deidentification Job

Create and poll job until it is completed.

```java com.azure.health.deidentification.sync.createjob.process
DeidentificationJob result = deidentificationClient.beginCreateJob(jobName, job)
.waitForCompletion()
.getValue();
System.out.println(jobName + " - " + result.getStatus());
// MyJob-1719953889301 - Succeeded
```

### List Deidentification Jobs

List and process deidentification jobs

```java com.azure.health.deidentification.sync.listjobs
PagedIterable<DeidentificationJob> jobs = deidentificationClient.listJobs();
for (DeidentificationJob currentJob : jobs) {
System.out.println(currentJob.getName() + " - " + currentJob.getStatus());
// MyJob-1719953889301 - Succeeded
}
```

### List completed files

List the files which are completed by a job.

```java com.azure.health.deidentification.sync.listcompletedfiles
PagedIterable<DocumentDetails> reports = deidentificationClient.listJobDocuments(jobName);

for (DocumentDetails currentFile : reports) {
System.out.println(currentFile.getId() + " - " + currentFile.getOutput().getPath());
// c45dcd5e-e3ce-4ff2-80b6-a8bbeb47f878 - _output/MyJob-1719954393623/example_patient_1/visit_summary.txt
// e55a1aa2-8eba-4515-b070-1fd3d005008b - _output/MyJob-1719954393623/example_patient_1/doctor_dictation.txt
}
```



## Troubleshooting

## Next steps

## Contributing

For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).

1. Fork it
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Commit your changes (`git commit -am 'Add some feature'`)
1. Push to the branch (`git push origin my-new-feature`)
1. Create new Pull Request

<!-- LINKS -->
[product_documentation]: https://azure.microsoft.com/services/
[docs]: https://azure.github.io/azure-sdk-for-java/
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fhealthdataaiservices%2Fazure-health-deidentification%2FREADME.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/healthdataaiservices/azure-health-deidentification",
"Tag": "java/healthdataaiservices/azure-health-deidentification_aca7da2fcc"
}
96 changes: 96 additions & 0 deletions sdk/healthdataaiservices/azure-health-deidentification/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!--
~ Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
Code generated by Microsoft (R) TypeSpec Code Generator.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
</parent>

<groupId>com.azure</groupId>
<artifactId>azure-health-deidentification</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-health-deidentification;current} -->
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Deidentification</name>
<description>This package contains Microsoft Azure Deidentification client library.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>https://github.com/Azure/azure-sdk-for-java</url>
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection>
<developerConnection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</developerConnection>
<tag>HEAD</tag>
</scm>
<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-json</artifactId>
<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-xml</artifactId>
<version>1.0.0</version> <!-- {x-version-update;com.azure:azure-xml;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.50.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.15.2</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.26.1</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.13.1</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version> <!-- {x-version-update;org.slf4j:slf4j-simple;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.health.deidentification;

import com.azure.core.util.ServiceVersion;

/**
* Service version of DeidServicesClient.
*/
public enum DeidServicesServiceVersion implements ServiceVersion {
/**
* Enum value 2024-07-12-preview.
*/
V2024_07_12_PREVIEW("2024-07-12-preview");

private final String version;

DeidServicesServiceVersion(String version) {
this.version = version;
}

/**
* {@inheritDoc}
*/
@Override
public String getVersion() {
return this.version;
}

/**
* Gets the latest service version supported by this client library.
*
* @return The latest {@link DeidServicesServiceVersion}.
*/
public static DeidServicesServiceVersion getLatest() {
return V2024_07_12_PREVIEW;
}
}
Loading