Class DeidentificationClient

java.lang.Object
com.azure.health.deidentification.DeidentificationClient

public final class DeidentificationClient extends Object
Initializes a new instance of the synchronous DeidentificationClient type.
  • Method Details

    • getJobWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> getJobWithResponse(String jobName, com.azure.core.http.rest.RequestOptions requestOptions)
      Get a de-identification job. Resource read operation template.

      Response Body Schema

       
       {
           name: String (Required)
           operation: String(Redact/Surrogate/Tag) (Optional)
           sourceLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               extensions (Optional): [
                   String (Optional)
               ]
           }
           targetLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               overwrite: Boolean (Optional)
           }
           customizations (Optional): {
               redactionFormat: String (Optional)
               surrogateLocale: String (Optional)
           }
           status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
           error (Optional): {
               code: String (Required)
               message: String (Required)
               target: String (Optional)
               details (Optional): [
                   (recursive schema, see above)
               ]
               innererror (Optional): {
                   code: String (Optional)
                   innererror (Optional): (recursive schema, see innererror above)
               }
           }
           lastUpdatedAt: OffsetDateTime (Required)
           createdAt: OffsetDateTime (Required)
           startedAt: OffsetDateTime (Optional)
           summary (Optional): {
               successful: int (Required)
               failed: int (Required)
               canceled: int (Required)
               total: int (Required)
               bytesProcessed: long (Required)
           }
       }
       
       
      Parameters:
      jobName - The name of a job.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a de-identification job. Resource read operation template along with Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • beginDeidentifyDocuments

      public com.azure.core.util.polling.SyncPoller<com.azure.core.util.BinaryData,com.azure.core.util.BinaryData> beginDeidentifyDocuments(String jobName, com.azure.core.util.BinaryData resource, com.azure.core.http.rest.RequestOptions requestOptions)
      Create a de-identification job. Long-running resource create or replace operation template.

      Request Body Schema

       
       {
           name: String (Required)
           operation: String(Redact/Surrogate/Tag) (Optional)
           sourceLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               extensions (Optional): [
                   String (Optional)
               ]
           }
           targetLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               overwrite: Boolean (Optional)
           }
           customizations (Optional): {
               redactionFormat: String (Optional)
               surrogateLocale: String (Optional)
           }
           status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
           error (Optional): {
               code: String (Required)
               message: String (Required)
               target: String (Optional)
               details (Optional): [
                   (recursive schema, see above)
               ]
               innererror (Optional): {
                   code: String (Optional)
                   innererror (Optional): (recursive schema, see innererror above)
               }
           }
           lastUpdatedAt: OffsetDateTime (Required)
           createdAt: OffsetDateTime (Required)
           startedAt: OffsetDateTime (Optional)
           summary (Optional): {
               successful: int (Required)
               failed: int (Required)
               canceled: int (Required)
               total: int (Required)
               bytesProcessed: long (Required)
           }
       }
       
       

      Response Body Schema

       
       {
           name: String (Required)
           operation: String(Redact/Surrogate/Tag) (Optional)
           sourceLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               extensions (Optional): [
                   String (Optional)
               ]
           }
           targetLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               overwrite: Boolean (Optional)
           }
           customizations (Optional): {
               redactionFormat: String (Optional)
               surrogateLocale: String (Optional)
           }
           status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
           error (Optional): {
               code: String (Required)
               message: String (Required)
               target: String (Optional)
               details (Optional): [
                   (recursive schema, see above)
               ]
               innererror (Optional): {
                   code: String (Optional)
                   innererror (Optional): (recursive schema, see innererror above)
               }
           }
           lastUpdatedAt: OffsetDateTime (Required)
           createdAt: OffsetDateTime (Required)
           startedAt: OffsetDateTime (Optional)
           summary (Optional): {
               successful: int (Required)
               failed: int (Required)
               canceled: int (Required)
               total: int (Required)
               bytesProcessed: long (Required)
           }
       }
       
       
      Parameters:
      jobName - The name of a job.
      resource - The resource instance.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the SyncPoller for polling of a job containing a batch of documents to de-identify.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listJobs

      public com.azure.core.http.rest.PagedIterable<com.azure.core.util.BinaryData> listJobs(com.azure.core.http.rest.RequestOptions requestOptions)
      List de-identification jobs. Resource list operation template.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      maxpagesizeIntegerNoThe maximum number of result items per page.
      continuationTokenStringNoToken to continue a previous query.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

       
       {
           name: String (Required)
           operation: String(Redact/Surrogate/Tag) (Optional)
           sourceLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               extensions (Optional): [
                   String (Optional)
               ]
           }
           targetLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               overwrite: Boolean (Optional)
           }
           customizations (Optional): {
               redactionFormat: String (Optional)
               surrogateLocale: String (Optional)
           }
           status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
           error (Optional): {
               code: String (Required)
               message: String (Required)
               target: String (Optional)
               details (Optional): [
                   (recursive schema, see above)
               ]
               innererror (Optional): {
                   code: String (Optional)
                   innererror (Optional): (recursive schema, see innererror above)
               }
           }
           lastUpdatedAt: OffsetDateTime (Required)
           createdAt: OffsetDateTime (Required)
           startedAt: OffsetDateTime (Optional)
           summary (Optional): {
               successful: int (Required)
               failed: int (Required)
               canceled: int (Required)
               total: int (Required)
               bytesProcessed: long (Required)
           }
       }
       
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      paged collection of DeidentificationJob items as paginated response with PagedIterable.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listJobDocuments

      public com.azure.core.http.rest.PagedIterable<com.azure.core.util.BinaryData> listJobDocuments(String jobName, com.azure.core.http.rest.RequestOptions requestOptions)
      List processed documents within a job. Resource list operation template.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      maxpagesizeIntegerNoThe maximum number of result items per page.
      continuationTokenStringNoToken to continue a previous query.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

       
       {
           id: String (Required)
           input (Required): {
               location: String (Required)
               etag: String (Required)
           }
           output (Optional): (recursive schema, see output above)
           status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
           error (Optional): {
               code: String (Required)
               message: String (Required)
               target: String (Optional)
               details (Optional): [
                   (recursive schema, see above)
               ]
               innererror (Optional): {
                   code: String (Optional)
                   innererror (Optional): (recursive schema, see innererror above)
               }
           }
       }
       
       
      Parameters:
      jobName - The name of a job.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      paged collection of DeidentificationDocumentDetails items as paginated response with PagedIterable.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • cancelJobWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> cancelJobWithResponse(String jobName, com.azure.core.http.rest.RequestOptions requestOptions)
      Cancel a de-identification job. Cancels a job that is in progress. The job will be marked as canceled and the service will stop processing the job. The service will not delete any documents that have already been processed. If the job is already complete, this will have no effect.

      Response Body Schema

       
       {
           name: String (Required)
           operation: String(Redact/Surrogate/Tag) (Optional)
           sourceLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               extensions (Optional): [
                   String (Optional)
               ]
           }
           targetLocation (Required): {
               location: String (Required)
               prefix: String (Required)
               overwrite: Boolean (Optional)
           }
           customizations (Optional): {
               redactionFormat: String (Optional)
               surrogateLocale: String (Optional)
           }
           status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
           error (Optional): {
               code: String (Required)
               message: String (Required)
               target: String (Optional)
               details (Optional): [
                   (recursive schema, see above)
               ]
               innererror (Optional): {
                   code: String (Optional)
                   innererror (Optional): (recursive schema, see innererror above)
               }
           }
           lastUpdatedAt: OffsetDateTime (Required)
           createdAt: OffsetDateTime (Required)
           startedAt: OffsetDateTime (Optional)
           summary (Optional): {
               successful: int (Required)
               failed: int (Required)
               canceled: int (Required)
               total: int (Required)
               bytesProcessed: long (Required)
           }
       }
       
       
      Parameters:
      jobName - The name of a job.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a job containing a batch of documents to de-identify along with Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • deleteJobWithResponse

      public com.azure.core.http.rest.Response<Void> deleteJobWithResponse(String jobName, com.azure.core.http.rest.RequestOptions requestOptions)
      Delete a de-identification job. Removes the record of the job from the service. Does not delete any documents.
      Parameters:
      jobName - The name of a job.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • deidentifyTextWithResponse

      public com.azure.core.http.rest.Response<com.azure.core.util.BinaryData> deidentifyTextWithResponse(com.azure.core.util.BinaryData body, com.azure.core.http.rest.RequestOptions requestOptions)
      De-identify text. A remote procedure call (RPC) operation.

      Request Body Schema

       
       {
           inputText: String (Required)
           operation: String(Redact/Surrogate/Tag) (Optional)
           customizations (Optional): {
               redactionFormat: String (Optional)
               surrogateLocale: String (Optional)
           }
       }
       
       

      Response Body Schema

       
       {
           outputText: String (Optional)
           taggerResult (Optional): {
               entities (Required): [
                    (Required){
                       category: String(Unknown/Account/Age/BioID/City/CountryOrRegion/Date/Device/Doctor/Email/Fax/HealthPlan/Hospital/IDNum/IPAddress/License/LocationOther/MedicalRecord/Organization/Patient/Phone/Profession/SocialSecurity/State/Street/Url/Username/Vehicle/Zip) (Required)
                       offset (Required): {
                           utf8: int (Required)
                           utf16: int (Required)
                           codePoint: int (Required)
                       }
                       length (Required): (recursive schema, see length above)
                       text: String (Optional)
                       confidenceScore: Double (Optional)
                   }
               ]
           }
       }
       
       
      Parameters:
      body - Request body for de-identification operation.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      response body for de-identification operation along with Response.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getJob

      public DeidentificationJob getJob(String jobName)
      Get a de-identification job. Resource read operation template.
      Parameters:
      jobName - The name of a job.
      Returns:
      a de-identification job. Resource read operation template.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • beginDeidentifyDocuments

      public com.azure.core.util.polling.SyncPoller<DeidentificationJob,DeidentificationJob> beginDeidentifyDocuments(String jobName, DeidentificationJob resource)
      Create a de-identification job. Long-running resource create or replace operation template.
      Parameters:
      jobName - The name of a job.
      resource - The resource instance.
      Returns:
      the SyncPoller for polling of a job containing a batch of documents to de-identify.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listJobs

      public com.azure.core.http.rest.PagedIterable<DeidentificationJob> listJobs()
      List de-identification jobs. Resource list operation template.
      Returns:
      paged collection of DeidentificationJob items as paginated response with PagedIterable.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listJobDocuments

      public com.azure.core.http.rest.PagedIterable<DeidentificationDocumentDetails> listJobDocuments(String jobName)
      List processed documents within a job. Resource list operation template.
      Parameters:
      jobName - The name of a job.
      Returns:
      paged collection of DeidentificationDocumentDetails items as paginated response with PagedIterable.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • cancelJob

      public DeidentificationJob cancelJob(String jobName)
      Cancel a de-identification job. Cancels a job that is in progress. The job will be marked as canceled and the service will stop processing the job. The service will not delete any documents that have already been processed. If the job is already complete, this will have no effect.
      Parameters:
      jobName - The name of a job.
      Returns:
      a job containing a batch of documents to de-identify.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • deleteJob

      public void deleteJob(String jobName)
      Delete a de-identification job. Removes the record of the job from the service. Does not delete any documents.
      Parameters:
      jobName - The name of a job.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • deidentifyText

      public DeidentificationResult deidentifyText(DeidentificationContent body)
      De-identify text. A remote procedure call (RPC) operation.
      Parameters:
      body - Request body for de-identification operation.
      Returns:
      response body for de-identification operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.