Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
Various documentation is available to help you get started
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-health-deidentification</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
Azure Identity package provides the default implementation for authenticating the client.
[name]
My name is John Smith
My name is Tom Jones
The following sections provide several code snippets covering some of the most common Azure Deidentification client use cases, including:
DeidentificationClient
Create a DeidentificationClient
using the DEID_SERVICE_ENDPOINT
environment variable.
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 the realtime endpoint with an input.
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 a Deidentification Job using STORAGE_ACCOUNT_NAME
and STORAGE_CONTAINER_NAME
environment variables.
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);
Create and poll job until it is completed.
DeidentificationJob result = deidentificationClient.beginCreateJob(jobName, job)
.waitForCompletion()
.getValue();
System.out.println(jobName + " - " + result.getStatus());
// MyJob-1719953889301 - Succeeded
List and process deidentification jobs
PagedIterable<DeidentificationJob> jobs = deidentificationClient.listJobs();
for (DeidentificationJob currentJob : jobs) {
System.out.println(currentJob.getName() + " - " + currentJob.getStatus());
// MyJob-1719953889301 - Succeeded
}
List the files which are completed by a job.
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
}
For details on contributing to this repository, see the contributing guide.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Azure SDK for Java feedback
Azure SDK for Java is an open source project. Select a link to provide feedback:
Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn more