Introduction

The IBM Watson Annotator for Clinical Data service is a medical domain NLP service featuring a variety of annotators for detecting meta-data such as entities, concepts, concept values, negated spans, hypothetical spans, and a collection of annotators that detect, normalize, and code medical and social findings from unstructured clinical data. Multiple annotators can be employed to analyze unstructured data from a single request.

For details about using Annotator for Clinical Data, see the IBM Cloud docs.

The code examples on this tab use the client library that is provided for Java.

Maven

<dependency>
  <groupId>com.ibm.watson.health.cognitive-services</groupId>
  <artifactId>annotator-for-clinical-data</artifactId>
  <version>1.4.0</version>
</dependency>

GitHub

https://github.com/IBM/whcs-java-sdk

The code examples on this tab use the client library that is provided for Python.

Installation

pip install --upgrade ibm-whcs-sdk==1.11.2

GitHub

https://github.com/IBM/whcs-python-sdk

The code examples on this tab use the client library that is provided for Node.js.

Installation

npm install ibm-whcs-sdk

GitHub

https://github.com/IBM/whcs-node-sdk

The code examples on this tab use the client library that is provided for Go.

Installation

go get -u github.com/IBM/whcs-go-sdk@v0.3.0

GitHub

https://github.com/IBM/whcs-go-sdk

Authentication

The Annotator for Clinical Data service uses Identity and Access Management (IAM) for authentication. You can pass either a bearer token in an Authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication; i.e., use apikey for the username and the value of the API key as the password. Learn more about IAM.

IAM authentication. Replace {apikey} and {url} with your service credentials.

curl -u "apikey:{apikey}" "{url}/v1/{method}?version={version}"

SDK managing the IAM token. Replace {apikey}, {url} and {version}.

import com.ibm.cloud.sdk.core.security.Authenticator;
import com.ibm.cloud.sdk.core.security.BasicAuthenticator;
import com.ibm.watson.health.acd.v1.AnnotatorForClinicalData;

Authenticator authenticator = new BasicAuthenticator("apikey", "{apikey}");
AnnotatorForClinicalData acd = new AnnotatorForClinicalData(
  "{version}",
  AnnotatorForClinicalData.DEFAULT_SERVICE_NAME,
  authenticator);

acd.setServiceUrl("{url}");

SDK managing the IAM token. Replace {version}, {apikey} and {url}.

from ibm_whcs_sdk import annotator_for_clinical_data as acd
from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator

# Instantiate service instance
# Replace {version}, {apikey}, and {url} below
service = acd.AnnotatorForClinicalDataV1(
    authenticator=IAMAuthenticator(apikey="{apikey}"),
    version="{version}"
)
service.set_service_url("{url}")

SDK managing the IAM token. Replace {version}, {apikey} and {url}.

const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
const core = require('ibm-cloud-sdk-core');
const { IamAuthenticator } = core;

const ACD = new AnnotatorForClinicalDataAcdV1({
  version: '{version}',
  authenticator: new IamAuthenticator({
    apikey: '{apikey}'
    }),
  serviceUrl: '{url}'
});

SDK managing the IAM token. Replace {version}, {apikey} and {url}.

import (
  "github.com/IBM/go-sdk-core/core"
  "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
)

func main() {
  ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
				URL:     "{url}",
				Version: core.StringPtr("{version}"),
				Authenticator: &core.IamAuthenticator{
					ApiKey:                 "{apikey}",
        },
	})
  if err != nil {
    panic(err)
  }
}

Versioning

Annotator for Clinical Data API requests require a version parameter that takes a date in the format version=YYYY-MM-DD. When we change the API in a backwards-incompatible way, we release a new version date.

Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

This documentation describes the current version of Annotator for Clinical Data. If differences exist in earlier versions, these differences are noted in the descriptions of parameters and response models.

Endpoint URLs

Identify the base URL for your Annotator for Clinical Data service instance.

The base URLs come from the service instance. To find the URL, view the service credentials by clicking the name of the service in the Resource list. Use the value of the URL. Add the method to form the complete API endpoint for your request. This following example URL represents a Annotator for Clinical Data instance that is hosted in Dallas:

https://us-south.wh-acd.cloud.ibm.com/wh-acd/api

Dallas API endpoint example

curl -X {request_method} -u "apikey:{apikey}" "https://us-south.wh-acd.cloud.ibm.com/wh-acd/api/v1/{method}?version={version}"

Dallas API endpoint example

from ibm_whcs_sdk import annotator_for_clinical_data as acd
from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
service = acd.AnnotatorForClinicalDataV1(
   authenticator=IAMAuthenticator(apikey="{apikey}"),
   version="{version}"
)
service.set_service_url('https://us-south.wh-acd.cloud.ibm.com/wh-acd/api')

Dallas API endpoint example

Authenticator authenticator = new BasicAuthenticator("apikey":"{apikey}");
AnnotatorForClinicalData acd = new AnnotatorForClinicalData("{version}", authenticator);
acd.setServiceUrl("https://us-south.wh-acd.cloud.ibm.com/wh-acd/api");

Dallas API endpoint example

const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
const core = require('ibm-cloud-sdk-core');
const { IamAuthenticator } = core;
const ACD = new AnnotatorForClinicalDataAcdV1({
   version='{version}',
   authenticator: new IamAuthenticator({
     apikey: '{apikey}'
   }),
   serviceUrl: 'https://us-south.wh-acd.cloud.ibm.com/wh-acd/api'
});

Dallas API endpoint example

options := new(annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options)
option.Version = "{version}"
options.Authenticator = &core.IamAuthenticator{
  ApiKey: "{apikey}",
  }
ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(options)
if err != nil {
  panic(err)
}

ACD.SetServiceURL("https://us-south.wh-acd.cloud.ibm.com/wh-acd/api")

Additional headers

Some Watson services accept special parameters in headers that are passed with the request.

To pass a header parameter, use the --header (-H) option with a curl request.

Some Watson services accept special parameters in headers that are passed with the request. You can pass request header parameters in all requests or in a single request to the service.

To pass header parameters with every request, use the setDefaultHeaders method of the service object.

To pass header parameters in a single request, use the addHeader method as a modifier on the request before you execute the request.

Some Watson services accept special parameters in headers that are passed with the request. You can pass request header parameters in all requests or in a single request to the service.

To pass header parameters with every request, specify the set_default_headers method of the service object.

To pass header parameters in a single request, include headers as a dict in the request.

Some Watson services accept special parameters in headers that are passed with the request. You can pass request header parameters in all requests or in a single request to the service.

To pass header parameters with every request, specify the headers parameter when you create the service object.

To pass header parameters in a single request, use the headers method as a modifier on the request before you execute it.

Some Watson services accept special parameters in headers that are passed with the request. You can pass request header parameters in all requests or in a single request to the service.

To pass header parameters with every request, specify the SetDefaultHeaders method of the service object.

To pass header parameters in a single request, specify the Headers as a map in the request.

Example header parameter in a request

curl -X {request_method} --header "Custom-Header: {header_value}" "{url}/v1/{method}?version={version}"

Example header parameter in a request

ReturnType returnValue = acd.methodName(parameters)
  .addHeader("Custom-Header", "{header_value}")
  .execute();

Example header parameter in a request

response = service.methodName(
    parameters,
    headers = {
        'Custom-Header': '{header_value}'
    })

Example header parameter in a request

const parameters = {
  {parameters}
};

ACD.methodName(
  parameters,
  headers: {
    'Custom-Header': '{header_value}'
  })
   .then(result => {
    console.log(response);
  })
  .catch(err => {
    console.log('error:', err);
  });

Example header parameter in a request

result, response, responseErr := ACD.methodName(
  &methodOptions{
    Headers: map[string]string{
      "Custom-Header": "{header_value}",
    },
  },
)

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 type response indicates success. A 400 type response indicates a failure, and a 500 type response indicates an internal system error.

HTTP Error Code Description Recovery
200 Success The request was successful.
201 Created The resource was successfully created.
202 Accepted The request is accepted.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to access '{namespace}'.
404 Not Found The requested resource could not be found.
408 Request Timeout The connection to the server timed out. Wait a few minutes, then try again.
409 Conflict The entity is already in the requested state.
500 Internal Server Error Service is currently unavailable. Your request could not be processed. Wait a few minutes and try again.

ErrorResponse

Name Description
code

integer
HTTP error code.
message

string
A description of the error code.
level

string
The error level (INFO, WARNING, or ERROR).
description

string
A general description of the error.
moreInfo

string
More information about the error.
correlationId

string
The correlation identifier.

The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException.

Exception Description
IllegalArgumentException An invalid argument was passed to the method.

When the Java SDK receives an error response from the Annotator for Clinical Data service, it generates an exception from the com.ibm.cloud.sdk.core.service.exception package. All service exceptions contain the following fields:

Field Description
statusCode The HTTP status code returned
message A message describing the error

The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the Annotator for Clinical Data service, it generates an ACDException containing the following fields:

Field Description
code The HTTP status code returned
message A message describing the error
info A dictionary of additional information about the error

When the Node SDK receives an error response from the Annotator for Clinical Data service, it creates an Error object with information that describes the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table:

Field Description
code The HTTP status code returned
message A message describing the error

The Go SDK generates an error for any unsuccessful service instantiation and method invocation. You can check for the error immediately. The contents of the error object are as shown in the following table:

Field Description
code The HTTP status code returned
message A message describing the error

Example error handling

import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException;

try {
  // Invoke a method
} catch (ServiceResponseException e) {
  System.out.println("Service returned status code "
    + e.getStatusCode() + ": " + e.getMessage());
}

Example error handling

from ibm_whcs_sdk import annotator_for_clinical_data as acd
try:
    # Invoke an IBM Watson Annotator for Clinical Data API
except acd.ACDException as ex:
    print ("Error Occurred - Code: ",ex.code," Message: ",ex.message," CorrelationId: ",ex.correlation_id)

Example error handling

ACD.method(params)
  .catch(err => {
    console.log('error:', err);
  });

Example error handling

result, response, responseErr := ACD.methodName(&methodOptions)
if responseErr != nil {
  panic(responseErr)
}

Rate limiting

Rate limits for API requests are enforced for each instance of the service. If the number of concurrent requests for a particular method and endpoint reaches the limit within the specified time window no additional requests will be honored until the timer expires. After the timer expires a new timer window begins and the service instance will accept new requests. The configured rate limit is 30 calls per second per client.

HTTP status code 429 indicates that the rate limit has been exceeded.

There is a 50K limit on text being analyzed per request. For json requests, the json metadata does not count towards the 50K threshold. The analyze APIs will return a 413 error if the input text exceeds the 50K threshold.

Methods

List profiles

List the available profiles

List the available profiles.

List the available profiles.

List the available profiles.

List the available profiles.

GET /v1/profiles
ServiceCall<Void> getProfiles(GetProfilesOptions getProfilesOptions)
get_profiles(self, **kwargs) -> DetailedResponse
getProfiles(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) GetProfiles(getProfilesOptions *GetProfilesOptions) (response *core.DetailedResponse, err error)

Request

Use the GetProfilesOptions.Builder to create a GetProfilesOptions object that contains the parameter values for the getProfiles method.

Instantiate the GetProfilesOptions struct and set the fields to provide parameter values for the GetProfiles method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/profiles?version=2021-04-20"
  • // GET /profiles example
    GetProfilesOptions options = new GetProfilesOptions.Builder().build();
    ServiceCall<Map<String, AcdProfile>> sc = acd.getProfiles(options);
    Response<Map<String, AcdProfile>> resp = sc.execute();
    Map<String, AcdProfile> profileMap = resp.getResult();
    
    for (String id:profileMap.keySet())
       System.out.println("Profile Id: " + id + " Desc: " + profileMap.get(id).description());
  • # Get list of available profiles
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.get_profiles()
       rslt = resp.result
    
       for id, profile in rslt.items():
           print("Profile:",id)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • # Get list of available profiles
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {};
    ACD.getProfiles(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get list of available profiles
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/core"
      "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    )
    
    func main() {
      ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
        URL:     "{url}"
        Version: core.StringPtr("{version}")
        Authenticator: &core.IamAuthenticator{
           ApiKey:                 "{apikey}",
        },
      })
    
      getProfilesOptions := ACD.NewGetProfilesOptions()
      result, detailedResponse, err := ACD.GetProfiles(getProfilesOptions)
      if err != nil {
        panic(err)
      }
      for profileId, _ := range result {
         fmt.Println(profileId)
      }
    }

Response

Profiles available for incorporating into an annotator flow

Status Code

  • List profiles results

Example responses
  • {
      "wh_acd.ibm_clinical_insights_v1.0_profile": {
        "publishedDate": "2020-03-04T13:30:15.318Z"
      }
    }
  • {
      "wh_acd.ibm_clinical_insights_v1.0_profile": {
        "publishedDate": "2020-03-04T13:30:15.318Z"
      }
    }

Create profile

Create a new profile

Create a new profile.

Create a new profile.

Create a new profile.

Create a new profile.

POST /v1/profiles
ServiceCall<Void> createProfile(CreateProfileOptions createProfileOptions)
create_profile(self, *, id: str = None, name: str = None, description: str = None, annotators: List['Annotator'] = None, **kwargs) -> DetailedResponse
createProfile(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) CreateProfile(createProfileOptions *CreateProfileOptions) (response *core.DetailedResponse, err error)

Request

Use the CreateProfileOptions.Builder to create a CreateProfileOptions object that contains the parameter values for the createProfile method.

Instantiate the CreateProfileOptions struct and set the fields to provide parameter values for the CreateProfile method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

Input request data in JSON format containing a profile definition.

The createProfile options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile unique ID.

  • Profile user friendly name.

  • Profile description.

  • Applicable annotators for the designated configurations.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile unique ID.

  • Profile user friendly name.

  • Profile description.

  • Applicable annotators for the designated configurations.

The CreateProfile options.

  • curl -X POST -u "apikey":"{apikey}" --header "Accept: application/json" --header "Content-Type: application/json" -d @parameters.json   "{url}/v1/profiles?version=2021-04-20"
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
             "libraries": ["umls.latest"]
           }
        }
      ]
    }
  • # Create new configuration profile
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       prof_anno = acd.Annotator(
       name="concept_detection",
       parameters = {"libraries": ["umls.latest"]})
    
       prof_anno_arr = [ prof_anno ]
    
       resp = service.create_profile (
           new_id="my_profile",
           new_name="my profile",
           new_description="my profile description",
           new_annotators=prof_anno_arr)
    
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • // POST /profiles example
    Map<String, Set<String>> conceptDetectionParams
       = new HashMap<String,Set<String>>(){{put("libraries",
          new HashSet<String>() {{ add("umls.latest"); }} ); }};
    
    Annotator conceptDetection = new Annotator.Builder()
       .name(Annotator.Name.CONCEPT_DETECTION)
       .parameters(conceptDetectionParams)
       .build();
    
    Builder bldr = new CreateProfileOptions.Builder()
    bldr.id("my_profile");
    bldr.name("My profile");
    bldr.description("My profile desc");
    bldr.addAnnotators(conceptDetection);
    
    ServiceCall<Void> call = acd.createProfile(bldr.build());
    Response<Void> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode()); // should be 201
  • # Create new configuration profile
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const annotator = {
       name: 'concept_detection',
    };
    const annotators = [annotator];
    const params = {
       newId: 'my-profile',
       newName: 'My Profile',
       newDescription: 'Test create profile',
       newVersion: '1.0',
       newAnnotators: annotators,
    };
    ACD.createProfile(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Create new configuration profile
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/core"
      "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    )
    
    func main() {
      ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
        URL:     "{url}"
        Version: core.StringPtr("{version}")
        Authenticator: &core.IamAuthenticator{
           ApiKey:                 "{apikey}",
        },
      })
    
      createProfilesOptions := ACD.NewCreateProfileOptions()
      createProfilesOptions.SetID("testProfile")
      createProfilesOptions.SetName("testProfile")
      createProfilesOptions.SetDescription("testProfile")
      createProfilesOptions.SetPublishedDate("2020-01-01")
      createProfilesOptions.SetPublish(false)
      createProfilesOptions.SetVersion("1.0")
      createProfilesOptions.SetCartridgeID("testCartridge")
      annotator, err := ACD.NewAnnotator("concept_detection")
      createProfilesOptions.SetAnnotators([]annotatorforclinicaldataacdv1.Annotator{*annotator})
      detailedResponse, err := ACD.CreateProfile(createProfilesOptions)
      if err != nil {
        panic(err)
      }
      fmt.Println(detailedResponse.StatusCode)
    }

Response

Persisted profile

Status Code

  • Profile result

  • Invalid annotator ID, invalid (missing) annotatorFlow object, or invalid request for the annotator.

  • Forbidden use of reserved prefix.

  • Profile ID conflict.

Example responses
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }

Get profile

Get a profile by ID

Get a profile by ID.

Get a profile by ID.

Get a profile by ID.

Get a profile by ID.

GET /v1/profiles/{id}
ServiceCall<Void> getProfile(GetProfileOptions getProfileOptions)
get_profile(self, id: str, **kwargs) -> DetailedResponse
getProfile(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) GetProfile(getProfileOptions *GetProfileOptions) (response *core.DetailedResponse, err error)

Request

Use the GetProfileOptions.Builder to create a GetProfileOptions object that contains the parameter values for the getProfile method.

Instantiate the GetProfileOptions struct and set the fields to provide parameter values for the GetProfile method.

Path Parameters

  • Profile ID

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The getProfile options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile ID.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile ID.

The GetProfile options.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/profiles/{id}?version=2021-04-20"
  • // GET /profiles/{id} example
    GetProfileOptions options = new GetProfileOptions.Builder()
       .id("my_profile").build();
    ServiceCall<AcdProfile> call = acd.getProfile(options);
    Response<AcdProfile> resp = call.execute();
    AcdProfile profile = resp.getResult();
    
    System.out.println("Id: " + profile.id());
    System.out.println("Name: " + profile.name());
    System.out.println("Annotators: ");
    List<Annotator> annos = profile.annotators();
    for (Annotator anno:annos)
       System.out.println('	' + anno.name());
  • # Get a specific profile by ID
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.get_profile("wh_acd.ibm_clinical_insights_v1.0_profile")
       rslt = resp.result
       print("Id:", rslt['id'])
       print("Name:", rslt['name'])
       print("Description:", rslt['description'])
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • # Get a specific profile by ID
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {
       id: 'wh_acd.ibm_clinical_insights_v1.0_profile'
    };
    ACD.getProfile(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get a profile by ID
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/core"
      "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    )
    
    func main() {
      ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
        URL:     "{url}"
        Version: core.StringPtr("{version}")
        Authenticator: &core.IamAuthenticator{
           ApiKey:                 "{apikey}",
        },
      })
    
      getProfilesByIdOptions := ACD.NewGetProfilesByIdOptions("wh_acd.ibm_clinical_insights_v1.0_profile")
      result, detailedResponse, err := ACD.GetProfilesByID(getProfilesByIdOptions)
      if err != nil {
        panic(err)
      }
      fmt.Println(detailedResponse.StatusCode)
      fmt.Println(result.ID)
      fmt.Println(result.Name)
    }

Response

Persisted profile

Status Code

  • Profile result

  • Profile ID not found.

Example responses
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }

Update profile

Using the specified Profile ID, updates the profile definition. This is a complete replacement of the existing profile definition using the JSON object provided in the request body.

Using the specified Profile ID, updates the profile definition. This is a complete replacement of the existing profile definition using the JSON object provided in the request body.

Using the specified Profile ID, updates the profile definition. This is a complete replacement of the existing profile definition using the JSON object provided in the request body.

Using the specified Profile ID, updates the profile definition. This is a complete replacement of the existing profile definition using the JSON object provided in the request body.

Using the specified Profile ID, updates the profile definition. This is a complete replacement of the existing profile definition using the JSON object provided in the request body.

PUT /v1/profiles/{id}
ServiceCall<Void> updateProfile(UpdateProfileOptions updateProfileOptions)
update_profile(self, id: str, *, new_id: str = None, new_name: str = None, new_description: str = None, new_annotators: List['Annotator'] = None, **kwargs) -> DetailedResponse
updateProfile(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) UpdateProfile(updateProfileOptions *UpdateProfileOptions) (response *core.DetailedResponse, err error)

Request

Use the UpdateProfileOptions.Builder to create a UpdateProfileOptions object that contains the parameter values for the updateProfile method.

Instantiate the UpdateProfileOptions struct and set the fields to provide parameter values for the UpdateProfile method.

Path Parameters

  • Profile ID

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The new profile definition

The updateProfile options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile ID.

  • Profile unique ID.

  • Profile user friendly name.

  • Profile description.

  • Applicable annotators for the designated configurations.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile ID.

  • Profile unique ID.

  • Profile user friendly name.

  • Profile description.

  • Applicable annotators for the designated configurations.

The UpdateProfile options.

  • curl -X PUT -u "apikey":"{apikey}" --header "Accept: application/json" --header "Content-Type: application/json" -d @parameters.json   "{url}/v1/profiles/{id}?version=2021-04-20"
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
             "libraries": ["umls.latest"]
           }
        }
      ]
    }
  • # Update existing configuration profile
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       anno_cd = acd.Annotator("concept_detection", parameters = {"libraries": ["umls.latest"]})
       anno_attr = acd.Annotator("attribute_detection")
    
       prof_annos = [ anno_cd, anno_attr ]
    
       resp = service.update_profile(
          "my_profile",
          new_id="my_profile",
          new_name="my profile",
          new_description="my profile description - UPDATE",
          new_annotators=prof_annos)
    
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • // PUT /profiles/{id}
    Map<String, Set<String>> conceptDetectionParams
       = new HashMap<String,Set<String>>(){{put("libraries",
          new HashSet<String>() {{ add("umls.2021AA"); }} ); }};
    
    Annotator conceptDetection = new Annotator.Builder()
       .name(Annotator.Name.CONCEPT_DETECTION)
       .parameters(conceptDetectionParams)
       .build();
    
    UpdateProfileOptions.Builder bldr
       = new UpdateProfileOptions.Builder();
    
    bldr.id("my_profile");
    bldr.newId("my_profile");
    bldr.newName("My profile - updated");
    bldr.newDescription("My profile desc - updated");
    bldr.newAnnotators(Arrays.asList(new Annotator[] {conceptDetection}));
    
    ServiceCall<Void> call = acd.updateProfile(bldr.build());
    Response<Void> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode()); // should be 200
  • # Update existing configuration profile
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const annotator = {
       name: 'concept_detection',
    };
    const annotators = [annotator];
    const params = {
       newId: 'my-profile',
       newName: 'My Profile',
       newDescription: 'Test update profile',
       newVersion: '1.0',
       newAnnotators: annotators,
    };
    ACD.updateProfile(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Update existing configuration profile
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/core"
      "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    )
    
    func main() {
      ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
        URL:     "{url}"
        Version: core.StringPtr("{version}")
        Authenticator: &core.IamAuthenticator{
           ApiKey:                 "{apikey}",
        },
      })
    
      updateProfilesOptions := ACD.NewUpdateProfileOptions("testProfile")
      updateProfilesOptions.SetNewID("testProfile")
      updateProfilesOptions.SetNewDescription("testProfile updated")
      updateProfilesOptions.SetNewPublishedDate("2020-01-01")
      updateProfilesOptions.SetNewPublish(false)
      updateProfilesOptions.SetNewVersion("1.1")
      annotator, err := ACD.NewAnnotator("concept_value")
      updateProfilesOptions.SetNewAnnotators([]annotatorforclinicaldataacdv1.Annotator{*annotator})
      detailedResponse, err := ACD.UpdateProfile(updateProfilesOptions)
      if err != nil {
        panic(err)
      }
      fmt.Println(detailedResponse.StatusCode)
    }

Response

Persisted profile

Status Code

  • Profile result

  • Invalid profile definition.

  • Forbidden update of shared artifact

  • Profile ID not found.

Example responses
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }

Delete profile

Using the specified profile ID, deletes the profile from the list of persisted profiles.

Using the specified profile ID, deletes the profile from the list of persisted profiles.

Using the specified profile ID, deletes the profile from the list of persisted profiles.

Using the specified profile ID, deletes the profile from the list of persisted profiles.

Using the specified profile ID, deletes the profile from the list of persisted profiles.

DELETE /v1/profiles/{id}
ServiceCall<Void> deleteProfile(DeleteProfileOptions deleteProfileOptions)
delete_profile(self, id: str, **kwargs) -> DetailedResponse
deleteProfile(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) DeleteProfile(deleteProfileOptions *DeleteProfileOptions) (response *core.DetailedResponse, err error)

Request

Use the DeleteProfileOptions.Builder to create a DeleteProfileOptions object that contains the parameter values for the deleteProfile method.

Instantiate the DeleteProfileOptions struct and set the fields to provide parameter values for the DeleteProfile method.

Path Parameters

  • Profile ID

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The deleteProfile options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile ID.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Profile ID.

The DeleteProfile options.

  • curl -X DELETE -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/profiles/{id}?version=2021-04-20"
  • # Delete profile
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.delete_profile("my_profile")
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • // DELETE /profiles/{id}
    DeleteProfileOptions options = new DeleteProfileOptions
       .Builder().id("my_profile").build();
    
    ServiceCall<Void> call = acd.deleteProfile(options);
    Response<Void> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode());
  • # Delete a specific profile
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {
       id: 'my-profile'
    };
    ACD.deleteProfile(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Delete a specific profile
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/core"
      "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    )
    
    func main() {
      ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
        URL:     "{url}"
        Version: core.StringPtr("{version}")
        Authenticator: &core.IamAuthenticator{
           ApiKey:                 "{apikey}",
        },
      })
    
      deleteProfileOptions := ACD.NewDeleteProfileOptions("testProfile")
      detailedResponse, err := ACD.DeleteProfile(deleteProfileOptions)
      if err != nil {
        panic(err)
      }
      fmt.Println(detailedResponse.StatusCode)
    }

Response

Persisted profile

Status Code

  • Profile result

  • Profile ID not found.

Example responses
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }
  • {
      "id": "acd_profile_cd_umls_latest",
      "name": "Profile for the latest Concept Detection UMLS Library",
      "description": "Provides configurations for running Concept Detection with the latest UMLS library",
      "annotators": [
        {
          "name": "concept_detection",
          "parameters": {
            "libraries": [
              "umls.latest"
            ]
          }
        }
      ]
    }

List flows

Returns a summary including ID and description of the available persisted flows.

Returns a summary including ID and description of the available persisted flows.

Returns a summary including ID and description of the available persisted flows.

Returns a summary including ID and description of the available persisted flows.

Returns a summary including ID and description of the available persisted flows.

GET /v1/flows
ServiceCall<Void> getFlows(GetFlowsOptions getFlowsOptions)
get_flows(self, **kwargs) -> DetailedResponse
getFlows(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) GetFlows(getFlowsOptions *GetFlowsOptions) (response *core.DetailedResponse, err error)

Request

Use the GetFlowsOptions.Builder to create a GetFlowsOptions object that contains the parameter values for the getFlows method.

Instantiate the GetFlowsOptions struct and set the fields to provide parameter values for the GetFlows method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/flows?version=2021-04-20"
  • // GET /flows example
    GetFlowsOptions options = new GetFlowsOptions.Builder().build();
    ServiceCall<Map<String, AcdFlow>> call = acd.getFlows(options);
    Response<Map<String, AcdFlow>> resp = call.execute();
    Map<String, AcdFlow> mapStrAcdFlow = resp.getResult();
    for( String id:mapStrAcdFlow.keySet() )
       System.out.println("Flow: " + id + " Desc: " + mapStrAcdFlow.get(id).description());
  • # Get list of available annotator flows
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.get_flows()
       rslt = resp.result
       for flow in rslt:
         print("Flow ID:",flow)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • # Get flows
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {};
    ACD.getFlows(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get flows
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       getFlowsOptions := ACD.NewGetFlowsOptions()
       result, detailedResponse, err := ACD.GetFlows(getFlowsOptions)
       if err != nil {
          panic(err)
       }
       for flowId, _ := range result { 
          fmt.Println(flowId)
       }
    }

Response

Flows available for analyzing text

Status Code

  • List flows results

Example responses
  • {
      "wh_acd.ibm_clinical_insights_v1.0_standard_flow": {
        "description": "Default annotator flow for the insight cartridge",
        "publishedDate": "2020-03-04T13:30:15.318Z"
      }
    }
  • {
      "wh_acd.ibm_clinical_insights_v1.0_standard_flow": {
        "description": "Default annotator flow for the insight cartridge",
        "publishedDate": "2020-03-04T13:30:15.318Z"
      }
    }

Create flow

Create a new annotator flow

Create a new annotator flow.

Create a new annotator flow.

Create a new annotator flow.

Create a new annotator flow.

POST /v1/flows
ServiceCall<Void> createPersistedFlow(CreatePersistedFlowOptions createPersistedFlowOptions)
create_persisted_flow(self, *, id: str = None, name: str = None, description: str = None, annotator_flows: List['AnnotatorFlow'] = None, **kwargs) -> DetailedResponse
createPersistedFlow(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) CreatePersistedFlow(createPersistedFlowOptions *CreatePersistedFlowOptions) (response *core.DetailedResponse, err error)

Request

Use the CreatePersistedFlowOptions.Builder to create a CreatePersistedFlowOptions object that contains the parameter values for the createPersistedFlow method.

Instantiate the CreatePersistedFlowOptions struct and set the fields to provide parameter values for the CreatePersistedFlow method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

Input request data in JSON format containing a flow definition.

The createPersistedFlow options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

  • Flow name.

  • Flow description.

  • Flow array.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

  • Flow name.

  • Flow description.

  • Flow array.

The CreatePersistedFlow options.

  • curl -X POST -u "apikey":"{apikey}" --header "Content-Type: application/json" --header "Accept: application/json" -d @parameters.json   "{url}/v1/flows?version=2021-04-20"
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
          {
           "flow": {
              "elements": [
                 {
                   "annotator": {
                       "name": "concept_detection"
                    }
                 },
                 {
                   "annotator": {
                       "name": "symptom_disease"
                    }
                 }
               ],
           "async": false
            }
          }
       ]
    }
  • # Create annotator flow
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       anno_cd = acd.Annotator("concept_detection")
       anno_neg = acd.Annotator("negation")
       flow_entry_cd = acd.FlowEntry(annotator=anno_cd)
       flow_entry_neg = acd.FlowEntry(annotator=anno_neg)
       flow_entries = [ flow_entry_cd, flow_entry_neg ]
       flow = acd.Flow(elements=flow_entries, async_=False)
       anno_flow = acd.AnnotatorFlow(flow=flow)
       anno_flows = [anno_flow]
       resp = service.create_flows(
           new_id="my_flow1",
           new_name="my flow",
           new_description="my flow description",
           new_annotator_flows=anno_flows)
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • // POST /flows example
    Annotator conceptDetection = new Annotator.Builder()
       .name(Annotator.Name.CONCEPT_DETECTION).build();
    
    Annotator negation = new Annotator.Builder()
       .name(Annotator.Name.NEGATION).build();
    
    FlowEntry cdFlowEntry = new FlowEntry
       .Builder().annotator(conceptDetection).build();
    
    FlowEntry negFlowEntry = new FlowEntry
       .Builder().annotator(negation).build();
    
    Flow flow = new Flow.Builder()
       .elements(Arrays.asList(cdFlowEntry, negFlowEntry))
       .async(true)
       .build();
    
    AnnotatorFlow annotatorFlow = new AnnotatorFlow.Builder()
       .flow(flow)
       .build();
    
    AcdFlow acdFlow = new AcdFlow.Builder()
       .id("my_flow")
       .name("My flow name")
       .description("My flow desc")
       .annotatorFlows(Arrays.asList(annotatorFlow))
       .build();
    
    CreateFlowsOptions options = new CreateFlowsOptions
       .Builder()
       .acdFlow(acdFlow)
       .build();
    
    ServiceCall<Void> call = acd.createFlows(options);
    Response<Void> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode()); // should be 201
  • # Create new flow
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const annotator = {
       name: 'concept_detection',
    };
    const flowEntry = {
       annotator: annotator,
    };
    const flowEntries = [flowEntry];
    const flow = {
       elements: flowEntries,
       async: false,
    };
    const annotatorFlow = {
       flow: flow,
    };
    const flows = [annotatorFlow];
    const params = {
       newId: 'my_flow',
       newName: 'My Flow',
       newDescription: 'Test create flow',
       version: '1.0',
       newAnnotatorFlows: flows,
    };
    ACD.createFlows(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Create new flow
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       createFlowsOptions := ACD.NewCreateFlowsOptions()
       createFlowsOptions.SetID("testFlow")
       createFlowsOptions.SetName("testFlow")
       createFlowsOptions.SetDescription("testFlow")
       createFlowsOptions.SetPublishedDate("2020-01-01")
       createFlowsOptions.SetPublish(false)
       createFlowsOptions.SetVersion("1.0")
       createFlowsOptions.SetCartridgeID("testCartridge")
       annotator, err := ACD.NewAnnotator("concept_detection")
       flowEntry, err := ACD.NewFlowEntry(annotator)
       flowEntry.Annotator = annotator
       async := false
       flow, err := ACD.NewFlow([]annotatorforclinicaldataacdv1.FlowEntry{*flowEntry}, core.BoolPtr(async))
       annotatorFlow, err := ACD.NewAnnotatorFlow(flow)
       createFlowsOptions.SetAnnotatorFlows([]annotatorforclinicaldataacdv1.AnnotatorFlow{*annotatorFlow})
       detailedResponse, err := ACD.CreateFlows(createFlowsOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
    }

Response

Persisted flow

Status Code

  • Flow result

  • Invalid Flow ID, invalid (missing) flow object, or invalid request for persisting a flow

  • Forbidden use of reserved prefix.

  • Flow ID conflict.

Example responses
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }

Get flow

Using the specified Flow ID, retrieves the flow definition.

Using the specified Flow ID, retrieves the flow definition.

Using the specified Flow ID, retrieves the flow definition.

Using the specified Flow ID, retrieves the flow definition.

Using the specified Flow ID, retrieves the flow definition.

GET /v1/flows/{id}
ServiceCall<Void> getFlow(GetFlowOptions getFlowOptions)
get_flow(self, id: str, **kwargs) -> DetailedResponse
getFlow(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) GetFlow(getFlowOptions *GetFlowOptions) (response *core.DetailedResponse, err error)

Request

Use the GetFlowOptions.Builder to create a GetFlowOptions object that contains the parameter values for the getFlow method.

Instantiate the GetFlowOptions struct and set the fields to provide parameter values for the GetFlow method.

Path Parameters

  • Flow ID

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The getFlow options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

The GetFlow options.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/flows/wh_acd.ibm_clinical_insights_v1.0_standard_flow?version=2021-04-20"
  • # Get flow by id
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.get_flows_by_id("wh_acd.ibm_clinical_insights_v1.0_standard_flow")
       rslt = resp.result
       print("Id:", rslt['id'])
       print("Name:", rslt['name'])
       print("Desc:", rslt['description'])
    
       for anno_flow in rslt['annotatorFlows']:
           flow = anno_flow['flow']
           flow_entries = flow['elements']
           for flow_entry in flow_entries:
           print("Annotator:", flow_entry['annotator']['name'])
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
    
  • // GET /flows/{id} example
    GetFlowsByIdOptions options = new GetFlowsByIdOptions.Builder()
       .id("wh_acd.ibm_clinical_insights_v1.0_standard_flow")
       .build();
    ServiceCall<AcdFlow> sc = acd.getFlowsById(options);
    Response<AcdFlow> resp = sc.execute();
    AcdFlow flow = resp.getResult();
    
    System.out.println("Id: " + flow.id());
    System.out.println("Name: " + flow.name());
    System.out.println("Description: " + flow.description());
    
    System.out.println("Annotators:");
    List<AnnotatorFlow> annotatorFlowList = flow.annotatorFlows();
    for ( AnnotatorFlow annotatorFlow : annotatorFlowList ) {
       Flow annotatorFlowFlow = annotatorFlow.flow();
       List<FlowEntry> flowEntryList = annotatorFlowFlow.elements();
       for( FlowEntry flowEntry : flowEntryList ) {
          Annotator annotator =  flowEntry.annotator();
          System.out.println('	' + annotator.name());
       }
    }
  • # Get a flow by ID
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {
       id: 'wh_acd.ibm_clinical_insights_v1.0_standard_flow',
    };
    ACD.getFlowsById(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get a flow by ID
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       getFlowsByIdOptions := ACD.NewGetFlowsByIdOptions("wh_acd.ibm_clinical_insights_v1.0_standard_flow")
       result, detailedResponse, err := ACD.GetFlowsByID(getFlowsByIdOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
       fmt.Println(result.ID)
       fmt.Println(result.Name)
    }

Response

Persisted flow

Status Code

  • Flow result

  • Flow ID not found.

Example responses
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }

Update flow

Using the specified Flow ID, updates the persisted flow definition. This is a complete replacement of the existing flow definition using the JSON object provided in the request body.

Using the specified Flow ID, updates the persisted flow definition. This is a complete replacement of the existing flow definition using the JSON object provided in the request body.

Using the specified Flow ID, updates the persisted flow definition. This is a complete replacement of the existing flow definition using the JSON object provided in the request body.

Using the specified Flow ID, updates the persisted flow definition. This is a complete replacement of the existing flow definition using the JSON object provided in the request body.

Using the specified Flow ID, updates the persisted flow definition. This is a complete replacement of the existing flow definition using the JSON object provided in the request body.

PUT /v1/flows/{id}
ServiceCall<Void> updatePersistedFlow(UpdatePersistedFlowOptions updatePersistedFlowOptions)
update_persisted_flow(self, id: str, *, new_id: str = None, new_name: str = None, new_description: str = None, new_annotator_flows: List['AnnotatorFlow'] = None, **kwargs) -> DetailedResponse
updatePersistedFlow(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) UpdatePersistedFlow(updatePersistedFlowOptions *UpdatePersistedFlowOptions) (response *core.DetailedResponse, err error)

Request

Use the UpdatePersistedFlowOptions.Builder to create a UpdatePersistedFlowOptions object that contains the parameter values for the updatePersistedFlow method.

Instantiate the UpdatePersistedFlowOptions struct and set the fields to provide parameter values for the UpdatePersistedFlow method.

Path Parameters

  • Flow ID

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The new flow definition

The updatePersistedFlow options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

  • Flow ID.

  • Flow name.

  • Flow description.

  • Flow array.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

  • Flow ID.

  • Flow name.

  • Flow description.

  • Flow array.

The UpdatePersistedFlow options.

  • curl -X PUT -u "apikey":"{apikey}" --header "Accept: application/json" --header "Content-Type: application/json" -d @parameters   "{url}/v1/flows/{id}?version=2021-04-20"
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
          {
           "flow": {
              "elements": [
                 {
                   "annotator": {
                       "name": "concept_detection"
                    }
                 },
                 {
                   "annotator": {
                       "name": "symptom_disease"
                    }
                 }
               ],
           "async": false
            }
          }
       ]
    }
  • # Update a previously created annotator flow
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       anno_med = acd.Annotator(name="medication")
       anno_neg = acd.Annotator(name="negation")
       flow_entry_med = acd.FlowEntry(annotator=anno_med)
       flow_entry_neg = acd.FlowEntry(annotator=anno_neg)
       flow_entries = [ flow_entry_med, flow_entry_neg ]
       flow = acd.Flow(elements=flow_entries, async_=False)
       anno_flow = acd.AnnotatorFlow(flow=flow)
       anno_flows = [anno_flow]
    
       service.update_flows(
           "my_flow",
           new_id="my_flow",
           new_name="my flow name",
           new_description="my flow name - UPDATE",
           new_annotator_flows=anno_flows)
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
    
  • // PUT /flows/{id} example
    Annotator conceptDetection = new Annotator.Builder()
       .name(Annotator.Name.CONCEPT_DETECTION).build();
    
    Annotator hypothetical = new Annotator.Builder()
       .name(Annotator.Name.HYPOTHETICAL).build();
    
    FlowEntry cdFlowEntry = new FlowEntry
       .Builder().annotator(conceptDetection).build();
    
    FlowEntry hypoFlowEntry = new FlowEntry
       .Builder().annotator(hypothetical).build();
    
    Flow flow = new Flow.Builder()
       .elements(Arrays.asList(cdFlowEntry, hypoFlowEntry))
       .async(true)
       .build();
    
    AnnotatorFlow annotatorFlow = new AnnotatorFlow.Builder()
       .flow(flow)
       .build();
    
    AcdFlow acdFlow = new AcdFlow.Builder()
       .id("my_flow")
       .name("My flow name - updated")
       .description("My flow desc - updated")
       .annotatorFlows(Arrays.asList(annotatorFlow))
       .build();
    
    UpdateFlowsOptions opts = new UpdateFlowsOptions.Builder()
       .id("my_flow")
       .acdFlow(acdFlow)
       .build();
    
    ServiceCall<Void> call = acd.updateFlows(opts);
    Response<Void> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode()); // should be 200
  • # Update existing flow
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const annotator = {
       name: 'concept_detection',
    };
    const flowEntry = {
       annotator: annotator,
    };
    const flowEntries = [flowEntry];
    const flow = {
       elements: flowEntries,
       async: false,
    };
    const annotatorFlow = {
       flow: flow,
    };
    const flows = [annotatorFlow];
    const params = {
       id: 'my_flow',
       newId: 'my_flow',
       newName: 'My Flow',
       newDescription: 'Test update flow',
       version: '1.0',
       newAnnotatorFlows: flows,
    };
    ACD.updateFlows(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Update existing flow
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       updateFlowsOptions := ACD.NewUpdateFlowsOptions("testFlow")
       updateFlowsOptions.SetNewID("testFlow")
       updateFlowsOptions.SetNewDescription("testFlow updated")
       updateFlowsOptions.SetNewPublishedDate("2020-01-01")
       updateFlowsOptions.SetNewVersion("1.0")
       annotator, err := ACD.NewAnnotator("concept_detection")
       flowEntry, err := ACD.NewFlowEntry(annotator)
       flowEntry.Annotator = annotator
       async := false
       flow, err := ACD.NewFlow([]annotatorforclinicaldataacdv1.FlowEntry{*flowEntry}, core.BoolPtr(async))
       annotatorFlow, err := ACD.NewAnnotatorFlow(flow)
       updateFlowsOptions.SetNewAnnotatorFlows([]annotatorforclinicaldataacdv1.AnnotatorFlow{*annotatorFlow})
       detailedResponse, err := ACD.UpdateFlows(updateFlowsOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
    }

Response

Persisted flow

Status Code

  • Flow result

  • Invalid flow definition.

  • Forbidden update of shared artifact

  • Flow ID not found.

Example responses
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }

Delete flow

Using the specified Flow ID, deletes the flow from the list of persisted flows.

Using the specified Flow ID, deletes the flow from the list of persisted flows.

Using the specified Flow ID, deletes the flow from the list of persisted flows.

Using the specified Flow ID, deletes the flow from the list of persisted flows.

Using the specified Flow ID, deletes the flow from the list of persisted flows.

DELETE /v1/flows/{id}
ServiceCall<Void> deletePersistedFlow(DeletePersistedFlowOptions deletePersistedFlowOptions)
delete_persisted_flow(self, id: str, **kwargs) -> DetailedResponse
deletePersistedFlow(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) DeletePersistedFlow(deletePersistedFlowOptions *DeletePersistedFlowOptions) (response *core.DetailedResponse, err error)

Request

Use the DeletePersistedFlowOptions.Builder to create a DeletePersistedFlowOptions object that contains the parameter values for the deletePersistedFlow method.

Instantiate the DeletePersistedFlowOptions struct and set the fields to provide parameter values for the DeletePersistedFlow method.

Path Parameters

  • Flow ID

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The deletePersistedFlow options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Flow ID.

The DeletePersistedFlow options.

  • curl -X DELETE -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/flows/{flow_id}?version=2021-04-20"
  • # Delete an annotator flow
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.delete_flows("my_flow")
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
    
  • // DELETE /flows/{id} example
    DeleteFlowsOptions opts = new DeleteFlowsOptions
       .Builder()
       .id("my_flow")
       .build();
    
    ServiceCall call = acd.deleteFlows(opts);
    Response<AcdFlow> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode());
  • # Delete a specific flow
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {
       id: 'my_flow',
    };
    ACD.deleteFlows(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Delete a specific flow
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       deleteFlowOptions := ACD.NewDeleteFlowsOptions("testFlow")
       detailedResponse, err := ACD.DeleteFlows(deleteFlowOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
    }

Response

Persisted flow

Status Code

  • Flow result

  • Flow ID not found.

Example responses
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }
  • {
      "id": "flow_simple",
      "name": "flow simple",
      "description": "A simple flow with two annotators",
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
              {
                "annotator": {
                  "name": "concept_detection"
                }
              },
              {
                "annotator": {
                  "name": "symptom_disease"
                }
              }
            ],
            "async": false
          }
        }
      ]
    }

Deployed cartridges

Returns a summary of the cumulative cartridge deployment status artifacts for a given tenant.

Returns a summary of the cumulative cartridge deployment status artifacts for a given tenant.

Returns a summary of the cumulative cartridge deployment status artifacts for a given tenant.

Returns a summary of the cumulative cartridge deployment status artifacts for a given tenant.

Returns a summary of the cumulative cartridge deployment status artifacts for a given tenant.

GET /v1/cartridges
ServiceCall<Void> cartridgesGet(CartridgesGetOptions cartridgesGetOptions)
cartridges_get(self, **kwargs) -> DetailedResponse
cartridgesGet(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) CartridgesGet(cartridgesGetOptions *CartridgesGetOptions) (response *core.DetailedResponse, err error)

Request

Use the CartridgesGetOptions.Builder to create a CartridgesGetOptions object that contains the parameter values for the cartridgesGet method.

Instantiate the CartridgesGetOptions struct and set the fields to provide parameter values for the CartridgesGet method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"  "{url}/v1/cartridges?version=2021-09-01"
  • # Get list of deployed cartridges available to the requesting tenant
    try:
       resp = service.cartridges_get()
       rslt = resp.result
       for cartridge in rslt['cartridges']:
          print(cartridge['id'])
          print("status: ",cartridge['status'])
          print("
    ")
    
    except acd.ACDException as ex:
       print ("Error Code: ", ex.code, " Message: ", ex.message, " Correlation Id: ", ex.correlation_id)
  • // Not Supported
  • # Get list of deployed cartridges available to the requesting tenant
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {};
    ACD.cartridgesGet(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get list of deployed cartridges available to the requesting tenant
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       cartridgesGetOptions := ACD.NewCartridgesGetOptions()
       result, detailedResponse, err := ACD.CartridgesGet(cartridgesGetOptions)
       if err != nil {
           panic(err)
       }
       cartridgeCounter := 0
       for cartridgeCounter < len(result.Cartridges) {
           cartridge := result.Cartridges[cartridgeCounter]
           fmt.Println(cartridge.ID)
           fmt.Println(cartridge.Name)
           fmt.Println(cartridge.Status)
       }
    }

Response

Deployed cartridges

Status Code

  • List deployed cartridges

Example responses
  • {
      "cartridges": [
        {
          "id": "wh_acd.ibm_clinical_insights_v1.0",
          "status": "completed",
          "statusLocation": "api/v1/cartridges/wh_acd.ibm_clinical_insights_v1.0",
          "startTime": "2020-03-24T18:25:45.835Z",
          "endTime": "2020-03-24T18:25:55.847Z",
          "duration": "10",
          "correlationId": "718f14df-84ed-46ca-9aa8-923bcf1000ae",
          "artifactResponseCode": 200
        }
      ]
    }
  • {
      "cartridges": [
        {
          "id": "wh_acd.ibm_clinical_insights_v1.0",
          "status": "completed",
          "statusLocation": "api/v1/cartridges/wh_acd.ibm_clinical_insights_v1.0",
          "startTime": "2020-03-24T18:25:45.835Z",
          "endTime": "2020-03-24T18:25:55.847Z",
          "duration": "10",
          "correlationId": "718f14df-84ed-46ca-9aa8-923bcf1000ae",
          "artifactResponseCode": 200
        }
      ]
    }

Deploy asynchronously

Asynchronously deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge deployment.

Asynchronously deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge deployment.

Asynchronously deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge deployment.

Asynchronously deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge deployment.

Asynchronously deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge deployment.

POST /v1/cartridges
ServiceCall<Void> cartridgesPostMultipart(CartridgesPostMultipartOptions cartridgesPostMultipartOptions)
cartridges_post_multipart(self, *, archive_file: BinaryIO = None, archive_file_content_type: str = None, **kwargs) -> DetailedResponse
cartridgesPostMultipart(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) CartridgesPostMultipart(cartridgesPostMultipartOptions *CartridgesPostMultipartOptions) (response *core.DetailedResponse, err error)

Request

Use the CartridgesPostMultipartOptions.Builder to create a CartridgesPostMultipartOptions object that contains the parameter values for the cartridgesPostMultipart method.

Instantiate the CartridgesPostMultipartOptions struct and set the fields to provide parameter values for the CartridgesPostMultipart method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

Form Parameters

  • Cartridge archive file

The cartridgesPostMultipart options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Cartridge archive file.

  • The content type of archive_file.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Cartridge archive file.

  • The content type of archiveFile.

The CartridgesPostMultipart options.

  • curl -X POST -u "apikey":"{apikey}" --header "Content-Type: application/octet-stream" --header "Accept: application/json" --data-binary @/tmp/cartridge.zip  "{url}/v1/cartridges?version=2021-09-01"
  • # Deploy new cartridge
    try:
       f = open("/tmp/my_cartridge_v1.0.zip", "rb")
       # "multipart/form-data" is also supported for archive_file_content_type
       resp = service.cartridges_post_multipart(
          archive_file=f,
          archive_file_content_type="application/octet-stream")
       print(resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code: ", ex.code, " Message: ", ex.message, " Correlation Id: ", ex.correlation_id)
  • // POST (deploy) /cartridges example
    File cartridgeZip = new File("/tmp/my_cartridge_v1.0.zip");
    
    CartridgesPostMultipartOptions opts;
    
    try {
       opts = new CartridgesPostMultipartOptions.Builder()
          .archiveFile(cartridgeZip)
          .build();
    
       ServiceCall<DeployCartridgeResponse> call = acd.cartridgesPostMultipart(opts);
       Response<DeployCartridgeResponse> resp = call.execute();
       System.out.println(resp.getStatusCode()); // should be 202
    
    } catch (FileNotFoundException e) {
       e.printStackTrace();
    }
    
  • # Deploy a cartridge from a cartridge archive file
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const readerStream = fs.createReadStream('/tmp/my_cartridge_v1.0.zip');
    const params = {
       archiveFile: readerStream,
       archiveFileContentType: 'application/octet-stream',
    };
    ACD.cartridgesPostMultipart(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Deploy a cartridge from a cartridge archive file
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       cartridgesPostMultipartOptions := ACD.NewCartridgesPostMultipartOptions()
       cartridgesPostMultipartOptions.SetArchiveFileContentType("application/octet-stream")
       archiveFile, err := os.Open("/tmp/my_cartridge_v1.0.zip")
       cartridgesPostMultipartOptions.SetArchiveFile(archiveFile)
       result, detailedResponse, err := ACD.CartridgesPostMultipart(cartridgesPostMultipartOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
    }

Response

Details of cartridge deployment submit response

Status Code

  • Cartridge deployment results.

  • Invalid cartridge

  • Forbidden deployment of cartridge with reserved prefix

  • Cartridge deployment already exists (Uset PUT for updating).

Example responses
  • {
      "id": "rheumatoid_arthritis_cartridge_v1.0",
      "status": "submitted",
      "statusCode": 202,
      "statusLocation": "api/v1/cartridges/rheumatoid_arthritis_cartridge_v1.0",
      "startTime": "2020-05-14T15:35:56.518Z",
      "correlationId": "080dc0eb-9151-42bf-9b4f-1f7b456c29b3",
      "artifactResponseCode": 0
    }
  • {
      "id": "rheumatoid_arthritis_cartridge_v1.0",
      "status": "submitted",
      "statusCode": 202,
      "statusLocation": "api/v1/cartridges/rheumatoid_arthritis_cartridge_v1.0",
      "startTime": "2020-05-14T15:35:56.518Z",
      "correlationId": "080dc0eb-9151-42bf-9b4f-1f7b456c29b3",
      "artifactResponseCode": 0
    }

Redeploy asynchronously

Asynchronously re-deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge re-deployment.

Asynchronously re-deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge re-deployment.

Asynchronously re-deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge re-deployment.

Asynchronously re-deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge re-deployment.

Asynchronously re-deploys a cartridge, returning a reference to a status object for use in tracking the completion status and results of a cartridge re-deployment.

PUT /v1/cartridges
ServiceCall<Void> cartridgesPutMultipart(CartridgesPutMultipartOptions cartridgesPutMultipartOptions)
cartridges_put_multipart(self, *, archive_file: BinaryIO = None, archive_file_content_type: str = None, **kwargs) -> DetailedResponse
cartridgesPutMultipart(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) CartridgesPutMultipart(cartridgesPutMultipartOptions *CartridgesPutMultipartOptions) (response *core.DetailedResponse, err error)

Request

Use the CartridgesPutMultipartOptions.Builder to create a CartridgesPutMultipartOptions object that contains the parameter values for the cartridgesPutMultipart method.

Instantiate the CartridgesPutMultipartOptions struct and set the fields to provide parameter values for the CartridgesPutMultipart method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

Form Parameters

  • Cartridge archive file

The cartridgesPutMultipart options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Cartridge archive file.

  • The content type of archive_file.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Cartridge archive file.

  • The content type of archiveFile.

The CartridgesPutMultipart options.

  • curl -X PUT -u "apikey":"{apikey}" --header "Content-Type: application/octet-stream" --header "Accept: application/json" --data-binary @/tmp/cartridge.zip  "{url}/v1/cartridges?version=2021-09-01"
  • # Redeploy a cartridge
    try:
       f = open("/tmp/my_cartridge_v1.0.zip", "rb")
       # "multipart/form-data" is also supported for archive_file_content_type
       resp = service.cartridges_put_multipart(
          archive_file=f,
          archive_file_content_type="application/octet-stream")
       print(resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code: ", ex.code, " Message: ", ex.message, " Correlation Id: ", ex.correlation_id)
  • // PUT (redeploy) /cartridges example
    File cartridgeZip = new File("/tmp/my_cartridge_v1.0.zip");
    
    CartridgesPutMultipartOptions opts;
    
    try {
       opts = new CartridgesPutMultipartOptions.Builder()
          .archiveFile(cartridgeZip)
          .build();
    
       ServiceCall<DeployCartridgeResponse> call = acd.cartridgesPutMultipart(opts);
       Response<DeployCartridgeResponse> resp = call.execute();
       System.out.println(resp.getStatusCode()); // should be 202
    
    } catch (FileNotFoundException e) {
       e.printStackTrace();
    }
    
  • # Redeploy a cartridge from a cartridge archive file
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const readerStream = fs.createReadStream('/tmp/my_cartridge_v1.0.zip');
    const params = {
       archiveFile: readerStream,
       archiveFileContentType: 'application/octet-stream',
    };
    ACD.cartridgesPutMultipart(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Redeploy a cartridge from a cartridge archive file
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       cartridgesPutMultipartOptions := ACD.NewCartridgesPutMultipartOptions()
       cartridgesPutMultipartOptions.SetArchiveFileContentType("application/octet-stream")
       archiveFile, err := os.Open("/tmp/my_cartridge_v1.0.zip")
       cartridgesPutMultipartOptions.SetArchiveFile(archiveFile)
       result, detailedResponse, err := ACD.CartridgesPutMultipart(cartridgesPutMultipartOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
    }

Response

Details of cartridge deployment submit response

Status Code

  • Cartridge deployment results.

  • Cartridge is not accessible.

  • Forbidden deployment of cartridge with reserved prefix

  • Cartridge deployment status not found (use POST for initial deployments).

  • Cartridge deployment in progress.

Example responses
  • {
      "id": "rheumatoid_arthritis_cartridge_v1.0",
      "status": "submitted",
      "statusCode": 202,
      "statusLocation": "api/v1/cartridges/rheumatoid_arthritis_cartridge_v1.0",
      "startTime": "2020-05-14T15:35:56.518Z",
      "correlationId": "080dc0eb-9151-42bf-9b4f-1f7b456c29b3",
      "artifactResponseCode": 0
    }
  • {
      "id": "rheumatoid_arthritis_cartridge_v1.0",
      "status": "submitted",
      "statusCode": 202,
      "statusLocation": "api/v1/cartridges/rheumatoid_arthritis_cartridge_v1.0",
      "startTime": "2020-05-14T15:35:56.518Z",
      "correlationId": "080dc0eb-9151-42bf-9b4f-1f7b456c29b3",
      "artifactResponseCode": 0
    }

Deployment status

Returns the deployment status for a given a cartridge ID.

Returns the deployment status for a given a cartridge ID.

Returns the deployment status for a given a cartridge ID.

Returns the deployment status for a given a cartridge ID.

Returns the deployment status for a given a cartridge ID.

GET /v1/cartridges/{id}
ServiceCall<Void> cartridgesGetId(CartridgesGetIdOptions cartridgesGetIdOptions)
cartridges_get_id(self, id: str, **kwargs) -> DetailedResponse
cartridgesGetId(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) CartridgesGetID(cartridgesGetIdOptions *CartridgesGetIdOptions) (response *core.DetailedResponse, err error)

Request

Use the CartridgesGetIdOptions.Builder to create a CartridgesGetIdOptions object that contains the parameter values for the cartridgesGetId method.

Instantiate the CartridgesGetIdOptions struct and set the fields to provide parameter values for the CartridgesGetID method.

Path Parameters

  • Cartridge ID

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The cartridgesGetId options.

parameters

  • Cartridge ID.

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • Cartridge ID.

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The CartridgesGetID options.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"  "{url}/v1/cartridges/{id}?version=2021-09-01"
  • # Get details of specific cartridge deployment
    try:
       resp = service.cartridges_get_id("my_cartridge_v1.0")
       rslt = resp.result
       print("id: ", rslt['id'])
       print("status: ", rslt['status'])
    
    except acd.ACDException as ex:
       print ("Error Code: ", ex.code, " Message: ", ex.message, " Correlation Id: ", ex.correlation_id)
  • // GET /cartridges/{id} example
    CartridgesGetIdOptions opts = new CartridgesGetIdOptions.Builder()
       .id("my_cartridge_v1.0").build();
    
    ServiceCall<AcdCartridges> call = acd.cartridgesGetId(opts);
    Response<AcdCartridges> resp = call.execute();
    System.out.println("Status code: " + resp.getStatusCode());
    AcdCartridges cart = resp.getResult();
    System.out.println("Id: " + cart.getId() + " status: " + cart.getStatus());
  • # Get details of a cartridge deployment
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {
       id: 'my_cartridge_v1.0'
    };
    ACD.cartridgesGetId(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get details of a cartridge deployment
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       cartridgesGetIdOptions := ACD.NewCartridgesGetIdOptions("my_cartridge_v1.0")
       result, detailedResponse, err := ACD.CartridgesGetID(cartridgesGetIdOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
       fmt.Println(result.Code)
       responseCounter := 0
       responses := len(result.ArtifactResponse)
       for responseCounter < responses {
          response := result.ArtifactResponse[responseCounter]
          fmt.Println(response.Code)
          fmt.Println(response.Message)
          fmt.Println(response.Level)
       }
    }

Response

Details of cartridge deployment

Status Code

  • Cartridge deployment results.

  • Cartridge ID not found.

Example responses
  • {
      "id": "rheumatoid_arthritis_cartridge_v1.0",
      "status": "completed",
      "statusLocation": "api/v1/cartridges/rheumatoid_arthritis_cartridge_v1.0",
      "startTime": "2021-10-10T14:43:24.108Z",
      "endTime": "2021-10-10T14:43:31.803Z",
      "duration": "7",
      "correlationId": "48c07fd1-befc-44ee-9c86-b5546834ed2c",
      "artifactResponseCode": 200,
      "artifactResponse": [
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_reactions_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_reactions_derived_concepts_concept_inference_rules"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_outcome_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_rheumatoid_arthritis_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Flow rheumatoid_arthritis_cartridge_v1.0_no_context_flow updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_no_context_flow"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_rheumatoid_arthritis_corpus_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Flow rheumatoid_arthritis_cartridge_v1.0_all_annotators_flow updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_all_annotators_flow"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_dictionary_dictionary"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_dictionary_dictionary"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_dictionary_library"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_derived_concepts_concept_inference_rules"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_filter_concept_filter"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Profile rheumatoid_arthritis_cartridge_v1.0_profile updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_profile"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Flow rheumatoid_arthritis_cartridge_v1.0_default_flow updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_default_flow"
        }
      ]
    }
  • {
      "id": "rheumatoid_arthritis_cartridge_v1.0",
      "status": "completed",
      "statusLocation": "api/v1/cartridges/rheumatoid_arthritis_cartridge_v1.0",
      "startTime": "2021-10-10T14:43:24.108Z",
      "endTime": "2021-10-10T14:43:31.803Z",
      "duration": "7",
      "correlationId": "48c07fd1-befc-44ee-9c86-b5546834ed2c",
      "artifactResponseCode": 200,
      "artifactResponse": [
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_reactions_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_reactions_derived_concepts_concept_inference_rules"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_outcome_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_rheumatoid_arthritis_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Flow rheumatoid_arthritis_cartridge_v1.0_no_context_flow updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_no_context_flow"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_rheumatoid_arthritis_corpus_attributes_attribute_set"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Flow rheumatoid_arthritis_cartridge_v1.0_all_annotators_flow updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_all_annotators_flow"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_dictionary_dictionary"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_dictionary_dictionary"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_dictionary_library"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_derived_concepts_concept_inference_rules"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_general_medical_literature_filter_concept_filter"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Profile rheumatoid_arthritis_cartridge_v1.0_profile updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_profile"
        },
        {
          "code": 200,
          "message": "OK",
          "level": "INFO",
          "description": "Flow rheumatoid_arthritis_cartridge_v1.0_default_flow updated.",
          "artifact": "rheumatoid_arthritis_cartridge_v1.0_default_flow"
        }
      ]
    }

Deploy

Deploy a cartridge from a cartridge archive file.

Deploy a cartridge from a cartridge archive file.

Deploy a cartridge from a cartridge archive file.

Deploy a cartridge from a cartridge archive file.

Deploy a cartridge from a cartridge archive file.

POST /v1/deploy
ServiceCall<Void> deployCartridge(DeployCartridgeOptions deployCartridgeOptions)
deploy_cartridge(self, *, archive_file: BinaryIO = None, archive_file_content_type: str = None, update: bool = None, **kwargs) -> DetailedResponse
deployCartridge(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) DeployCartridge(deployCartridgeOptions *DeployCartridgeOptions) (response *core.DetailedResponse, err error)

Request

Use the DeployCartridgeOptions.Builder to create a DeployCartridgeOptions object that contains the parameter values for the deployCartridge method.

Instantiate the DeployCartridgeOptions struct and set the fields to provide parameter values for the DeployCartridge method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Update resources if they already exist

    Default: false

Form Parameters

  • Cartridge archive file

The deployCartridge options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Cartridge archive file.

  • The content type of archive_file.

  • Update resources if they already exist.

    Default: false

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Cartridge archive file.

  • The content type of archiveFile.

  • Update resources if they already exist.

    Default: false

The DeployCartridge options.

  • curl -X POST -u "apikey":"{apikey}" --header "Content-Type: application/octet-stream" --header "Accept: application/json" --data-binary @/tmp/cartridge.zip   "{url}/v1/deploy?version=2021-04-20"
  • # Deploy a cartridge
    try:
       f = open("/tmp/my_cartridge_v1.0.zip", "rb")
       # "multipart/form-data" is also supported for archive_file_content_type
       resp = service.deploy_cartridge(
          archive_file=f,
          archive_file_content_type="application/octet-stream",
          update=True)
       print(resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code: ", ex.code, " Message: ", ex.message, " Correlation Id: ", ex.correlation_id)
  • // POST /deploy example
    File cartridgeZip = new File("/tmp/my_cartridge_v2.0.zip");
    DeployCartridgeOptions opts;
    try {
       opts = new DeployCartridgeOptions.Builder()
          .archiveFile(cartridgeZip)
          .archiveFileContentType("application/octet-stream")
          .update(true).build();
       ServiceCall<DeployCartridgeResponse> call = acd.deployCartridge(opts);
       Response<DeployCartridgeResponse> resp = call.execute();
       System.out.println("Response code: " + resp.getStatusCode());
    } catch (FileNotFoundException e) {
       // TODO Auto-generated catch block
    }:
  • # Deploy a cartridge
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const readerStream = fs.createReadStream('/tmp/my_cartridge_v2.0.zip');
    const params = {
       archiveFile: readerStream,
       archiveFileContentType: 'application/octet-stream',
       update: true,
    };
    ACD.deployCartridge(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Deploy a cartridge
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       deployCartridgeOptions := ACD.NewDeployCartridgeOptions()
       deployCartridgeOptions.SetArchiveFileContentType("application/octet-stream")
       archiveFile, err := os.Open("/tmp/my_cartridge_v2.0.zip")
       deployCartridgeOptions.SetArchiveFile(archiveFile)
       deployCartridgeOptions.SetUpdate(true)
       result, detailedResponse, err := ACD.DeployCartridge(deployCartridgeOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(detailedResponse.StatusCode)
       fmt.Println(result.Code)
       responseCounter := 0
       responses := len(result.ArtifactResponse)
       for responseCounter < responses {
          response := result.ArtifactResponse[responseCounter]
          fmt.Println(response.Code)
          fmt.Println(response.Message)
          fmt.Println(response.Level)
       }
    }

Response

Details of cartridge deployment

Status Code

  • Cartridge deployment results.

  • Forbidden deployment of cartridge with reserved prefix

Example responses
  • {
      "code": 201,
      "artifactResponse": [
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_general_medical_attribute_set"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_general_labs_attribute_set"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "description": "Flow general_medical_v1.0_general_medical_literature_flow created.",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_general_medical_literature_flow"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "description": "Profile general_medical_v1.0_profile created.",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_profile"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "description": "Flow general_medical_v1.0_default_flow created.",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_default_flow"
        }
      ]
    }
  • {
      "code": 201,
      "artifactResponse": [
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_general_medical_attribute_set"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_general_labs_attribute_set"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "description": "Flow general_medical_v1.0_general_medical_literature_flow created.",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_general_medical_literature_flow"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "description": "Profile general_medical_v1.0_profile created.",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_profile"
        },
        {
          "code": 201,
          "message": "Created",
          "level": "INFO",
          "description": "Flow general_medical_v1.0_default_flow created.",
          "correlationId": "9fbfb666-1857-4b7f-aeb2-a42de78d3960",
          "artifact": "general_medical_v1.0_default_flow"
        }
      ]
    }

Analyze text with dynamic flow

Analyze text to detect medical concepts

Analyze text to detect medical concepts.

Analyze text to detect medical concepts.

Analyze text to detect medical concepts.

Analyze text to detect medical concepts.

POST /v1/analyze
ServiceCall<Void> runPipeline(RunPipelineOptions runPipelineOptions)
run_pipeline(self, body: str, *, return_analyzed_text: bool = None, **kwargs) -> DetailedResponse
runPipeline(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) RunPipeline(runPipelineOptions *RunPipelineOptions) (response *core.DetailedResponse, err error)

Request

Use the RunPipelineOptions.Builder to create a RunPipelineOptions object that contains the parameter values for the runPipeline method.

Instantiate the RunPipelineOptions struct and set the fields to provide parameter values for the RunPipeline method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • The analyzed text is not returned and the XSS encoding is performed when this parameter is not set. Set this to true to show the analyzed text and to avoid the XSS encoding in the response.

    Default: false

Input request data in JSON format containing an annotatorFlow and an unstructured container.

The runPipeline options.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Input request data in JSON format containing an annotatorFlow and an unstructured container.

  • The analyzed text is not returned and the XSS encoding is performed when this parameter is not set. Set this to true to show the analyzed text and to avoid the XSS encoding in the response.

    Default: false

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Input request data in JSON format containing an annotatorFlow and an unstructured container.

  • The analyzed text is not returned and the XSS encoding is performed when this parameter is not set. Set this to true to show the analyzed text and to avoid the XSS encoding in the response.

    Default: false

The RunPipeline options.

  • curl -X POST -u "apikey":"{apikey}" --header "Content-Type: application/json" --header "Accept: application/json" -d @parameters.json   "{url}/v1/analyze?version=2020-04-07"
  • {
      "annotatorFlows": [
        {
          "flow": {
            "elements": [
            {
              "annotator": {
                "name": "concept_detection"
              }
            },
            {
              "annotator": {
                "name": "attribute_detection"
              }
            }
            ],
            "async": false
          }
        }
      ],
      "unstructured": [
        {
          "text": "Patient has lung cancer, but did not smoke. She may consider chemotherapy as part of a treatment plan."
        }
      ]
    }
  • # Analyze unstructured text via dynamic annotator flow defined in the request
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    text = "Patient has lung cancer, but did not smoke. She may consider chemotherapy as part of a treatment plan."
    
    try:
       anno_cd = acd.Annotator(name="concept_detection")
       anno_neg = acd.Annotator(name="negation")
       flow_arr = [
          acd.FlowEntry(annotator=anno_cd),
          acd.FlowEntry(annotator=anno_neg)
       ]
       flow = acd.Flow(elements=flow_arr, async_=False)
       resp = service.analyze(text, flow)
       concepts = resp.concepts
       for concept in concepts:
           print("Type: ", concept.type, "~ Name: ", concept.preferred_name)
    
    except acd.ACDException as ex:
       print ("Error Occurred:  Code ", ex.code, " Message ", ex.message, " CorrelationId ", ex.correlation_id)
    
  • /*
     * Example: Simple /analyze request with a dynamic annotator flow
     */
    Authenticator authenticator = new BasicAuthenticator("apikey", "{apikey}");
    AnnotatorForClinicalData acd = new AnnotatorForClinicalData(
          "{version}"
          AnnotatorForClinicalData.DEFAULT_SERVICE_NAME
          authenticator);
    acd.setServiceUrl("{url}");
    String text = "Patient has lung cancer, but did not smoke. She may consider chemotherapy as part of a treatment plan.";
    
    List<String> annotators = Arrays.asList(
          Name.CONCEPT_DETECTION,
          Name.NEGATION);
    
    Flow flow = new FlowUtil.Builder().annotators(annotators).build();
    
    ContainerGroup resp = acd.analyze(text, flow);
    
    List<Concept> concepts = resp.getConcepts();
    
    for (Concept c:concepts)
       System.out.println("Type: " + c.getType()
          + " Name: " + c.getPreferredName()
          + "| Negated (t/f): " + c.get("negated"));
  • # Analyze unstructured text via a dynamic annotator flow defined in the request
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const container = {
       text: 'The patient has diabetes',
    };
    const containers = [container];
    const annotator = {
       name: 'concept_detection',
    };
    const flowEntry = {
       annotator: annotator,
    };
    const flowEntries = [flowEntry];
    const flow = {
       elements: flowEntries,
       async: false,
    };
    const annotatorFlow = {
       flow: flow,
    };
    const flows = [annotatorFlow];
    const params = {
       unstructured: containers,
       annotatorFlows: flows,
       returnAnalyzedText: false,
    };
    ACD.runPipeline(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Analyze unstructured text via a dynamic annotator flow defined in the request
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       pipelineOptions := ACD.NewRunPipelineOptions()
       cdParams := make(map[string][]string)
       cdParamValue := []string{"true"}
       cdParams["apply_spell_check"] = cdParamValue
       cdAnnotator, err := ACD.NewAnnotator("concept_detection")
       cdAnnotator.Parameters = cdParams
       cdFlowEntry, err := ACD.NewFlowEntry(cdAnnotator)
       cdFlowEntry.Annotator = cdAnnotator
       async := false
       flow, err := ACD.NewFlow([]annotatorforclinicaldataacdv1.FlowEntry{*cdFlowEntry}, core.BoolPtr(async))
       annotatorFlow, err := ACD.NewAnnotatorFlow(flow)
       pipelineOptions.SetAnnotatorFlows([]annotatorforclinicaldataacdv1.AnnotatorFlow{*annotatorFlow})
       container := ACD.NewUnstructuredContainer()
       container.SetText("Patient has lung cancer, but did not smoke. She may consider chemotherapy as part of a treatment plan.")
       pipelineOptions.SetUnstructured([]annotatorforclinicaldataacdv1.UnstructuredContainer{*container})
       pipelineOptions.SetDebugTextRestore(false)
       result, detailedResponse, err := ACD.RunPipeline(pipelineOptions)
       if err != nil {
          panic(err)
       }
       for _, element := range result.Unstructured {
          for _, conceptEntry := range element.Data.Concepts {
             fmt.Println(conceptEntry.Cui)
          }
       }
    }

Response

Results of the analysis

Status Code

  • Analysis results

  • Invalid annotator ID, invalid (missing) annotatorFlow object, or invalid request for the annotator.

  • The received text size exceeds the allowed maximum size.

  • Annotator unavailable.

  • Timeout while processing request.

Example responses
  • {
      "unstructured": [
        {
          "data": {
            "concepts": [
              {
                "cui": "C1306460",
                "preferredName": "Primary malignant neoplasm of lung",
                "semanticType": "neop",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.NeoplasticProcess",
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "uid": 2
              },
              {
                "cui": "C0013216",
                "preferredName": "Pharmacotherapy",
                "semanticType": "topp",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.TherapeuticOrPreventiveProcedure",
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "uid": 3
              }
            ],
            "attributeValues": [
              {
                "preferredName": "Primary malignant neoplasm of lung",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 2
                },
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "name": "Disease"
              },
              {
                "preferredName": "Pharmacotherapy",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 3
                },
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "name": "Procedure"
              }
            ]
          }
        }
      ]
    }
  • {
      "unstructured": [
        {
          "data": {
            "concepts": [
              {
                "cui": "C1306460",
                "preferredName": "Primary malignant neoplasm of lung",
                "semanticType": "neop",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.NeoplasticProcess",
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "uid": 2
              },
              {
                "cui": "C0013216",
                "preferredName": "Pharmacotherapy",
                "semanticType": "topp",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.TherapeuticOrPreventiveProcedure",
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "uid": 3
              }
            ],
            "attributeValues": [
              {
                "preferredName": "Primary malignant neoplasm of lung",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 2
                },
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "name": "Disease"
              },
              {
                "preferredName": "Pharmacotherapy",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 3
                },
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "name": "Procedure"
              }
            ]
          }
        }
      ]
    }

Analyze text with cartridge flow

Analyze text to detect medical concepts using a predefined annotator flow (e.g. deployed cartridge)

Analyze text to detect medical concepts using a predefined annotator flow (e.g. deployed cartridge).

Analyze text to detect medical concepts using a predefined annotator flow (e.g. deployed cartridge).

Analyze text to detect medical concepts using a predefined annotator flow (e.g. deployed cartridge).

Analyze text to detect medical concepts using a predefined annotator flow (e.g. deployed cartridge).

POST /v1/analyze/{flow_id}
ServiceCall<Void> runPipelineWithFlow(RunPipelineWithFlowOptions runPipelineWithFlowOptions)
run_pipeline_with_flow(self, flow_id: str, body: Union[str, TextIO], *, content_type: str = None, return_analyzed_text: bool = None, **kwargs) -> DetailedResponse
runPipelineWithFlow(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) RunPipelineWithFlow(runPipelineWithFlowOptions *RunPipelineWithFlowOptions) (response *core.DetailedResponse, err error)

Request

Use the RunPipelineWithFlowOptions.Builder to create a RunPipelineWithFlowOptions object that contains the parameter values for the runPipelineWithFlow method.

Instantiate the RunPipelineWithFlowOptions struct and set the fields to provide parameter values for the RunPipelineWithFlow method.

Custom Headers

  • Allowable values: [text/plain,application/json]

Path Parameters

  • flow identifier .

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • The analyzed text is not returned and the XSS encoding is performed when this parameter is not set. Set this to true to show the analyzed text and to avoid the XSS encoding in the response.

    Default: false

Input request data in TEXT or JSON format .

The runPipelineWithFlow options.

parameters

  • flow identifier .

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Input request data in TEXT or JSON format .

  • The type of the input. A character encoding can be specified by including a charset parameter. For example, 'text/plain;charset=utf-8'.

    Allowable values: [application/json,text/plain]

  • The analyzed text is not returned and the XSS encoding is performed when this parameter is not set. Set this to true to show the analyzed text and to avoid the XSS encoding in the response.

    Default: false

parameters

  • flow identifier .

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • Input request data in TEXT or JSON format .

  • The type of the input. A character encoding can be specified by including a charset parameter. For example, 'text/plain;charset=utf-8'.

    Allowable values: [application/json,text/plain]

  • The analyzed text is not returned and the XSS encoding is performed when this parameter is not set. Set this to true to show the analyzed text and to avoid the XSS encoding in the response.

    Default: false

The RunPipelineWithFlow options.

  • curl -X POST -u "apikey":"{apikey}" --header "Content-Type: text/plain" --header "Accept: application/json" --data-binary "Patient has lung cancer, but did not smoke. She may consider chemotherapy as part of a treatment plan."   "{url}/v1/analyze/wh_acd.ibm_clinical_insights_v1.0_standard_flow?version=2021-04-20"
  • /*
     * Simple /analyze call referencing a persisted annotator flow
     */
    Authenticator authenticator = new BasicAuthenticator("apikey", "{apikey}");
    AnnotatorForClinicalData acd = new AnnotatorForClinicalData(
          "{version}"
          AnnotatorForClinicalData.DEFAULT_SERVICE_NAME
          authenticator);
    acd.setServiceUrl("{url}");
    String flowId = "wh_acd.ibm_clinical_insights_v1.0_standard_flow";
    String text = "Patient has lung cancer, but did not smoke. She may consider chemotherapy as part of a treatment plan.";
    
    ContainerGroup resp = acd.analyzeWithFlow(flowId, text);
    
    List<Concept> concepts = resp.getConcepts();
    
    for (Concept c:concepts)
       System.out.println("Type: " + c.getType() + " Name: " + c.getPreferredName());
  • # Analyze unstructured text via a predefined annotator flow referenced in the request
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    flowId = "wh_acd.ibm_clinical_insights_v1.0_standard_flow"
    text = "Patient has lung cancer, but did not smoke. She may consider chemotherapy as part of a treatment plan."
    
    try:
       response = service.analyze_with_flow(flowId, text)
       concepts = response.concepts
       for concept in concepts:
           print("Type: ", concept.type, "~ Name: ", concept.preferred_name)
    
    except acd.ACDException as ex:
       print ("Error Occurred:  Code ", ex.code, " Message ", ex.message, " CorrelationId ", ex.correlation_id)
    
  • # Analyze unstructured text via a predefined annotator flow referenced in the request
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const container = {
       text: 'The patient has diabetes',
    };
    const containers = [container];
    const annotatorBean = {
       unstructured: containers,
    };
    const params = {
       analyticFlowBeanInput: annotatorBean,
       flowId: 'wh_acd.ibm_clinical_insights_v1.0_standard_flow',
       returnAnalyzedText: false,
    };
    ACD.runPipelineWithFlow(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Analyze unstructured text via a dynamic annotator flow defined in the request
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       pipelineOptions := ACD.NewRunPipelineWithFlowOptions("wh_acd.ibm_clinical_insights_v1.0_standard_flow", false)
       pipelineOptions.SetBody("The patient has diabetes")
       pipelineOptions.SetContentType("text/plain")
       pipelineOptions.SetDebugTextRestore(false)
       result, detailedResponse, err := ACD.RunPipelineWithFlow(pipelineOptions)
       if err != nil {
          panic(err)
       }
       for _, element := range result.Unstructured {
          for _, conceptEntry := range element.Data.Concepts {
             fmt.Println(conceptEntry.Cui)
          }
       }
    }

Response

Results of the analysis

Status Code

  • Analysis results

  • Invalid annotator ID, invalid (missing) annotatorFlow object, or invalid request for the annotator.

  • Flow ID not found.

  • The received text size exceeds the allowed maximum size.

  • Annotator unavailable.

  • Timeout while processing request.

Example responses
  • {
      "unstructured": [
        {
          "data": {
            "concepts": [
              {
                "cui": "C1306460",
                "preferredName": "Primary malignant neoplasm of lung",
                "semanticType": "neop",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.NeoplasticProcess",
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "uid": 2
              },
              {
                "cui": "C0013216",
                "preferredName": "Pharmacotherapy",
                "semanticType": "topp",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.TherapeuticOrPreventiveProcedure",
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "uid": 3
              }
            ],
            "attributeValues": [
              {
                "preferredName": "Primary malignant neoplasm of lung",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 2
                },
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "name": "Disease"
              },
              {
                "preferredName": "Pharmacotherapy",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 3
                },
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "name": "Procedure"
              }
            ]
          }
        }
      ]
    }
  • {
      "unstructured": [
        {
          "data": {
            "concepts": [
              {
                "cui": "C1306460",
                "preferredName": "Primary malignant neoplasm of lung",
                "semanticType": "neop",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.NeoplasticProcess",
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "uid": 2
              },
              {
                "cui": "C0013216",
                "preferredName": "Pharmacotherapy",
                "semanticType": "topp",
                "source": "umls",
                "sourceVersion": "2017AA",
                "type": "umls.TherapeuticOrPreventiveProcedure",
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "uid": 3
              }
            ],
            "attributeValues": [
              {
                "preferredName": "Primary malignant neoplasm of lung",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 2
                },
                "begin": 12,
                "end": 23,
                "coveredText": "lung cancer",
                "name": "Disease"
              },
              {
                "preferredName": "Pharmacotherapy",
                "values": [
                  {
                    "value": "true"
                  }
                ],
                "source": "General Medical",
                "sourceVersion": "v1.0",
                "concept": {
                  "uid": 3
                },
                "begin": 61,
                "end": 73,
                "coveredText": "chemotherapy",
                "name": "Procedure"
              }
            ]
          }
        }
      ]
    }

List annotators

Get list of available annotators that can be leveraged to detect information from unstructured data. One or more annotators can be leveraged within a single request to the service.

Get list of available annotators that can be leveraged to detect information from unstructured data. One or more annotators can be leveraged within a single request to the service.

Get list of available annotators that can be leveraged to detect information from unstructured data. One or more annotators can be leveraged within a single request to the service.

Get list of available annotators that can be leveraged to detect information from unstructured data. One or more annotators can be leveraged within a single request to the service.

Get list of available annotators that can be leveraged to detect information from unstructured data. One or more annotators can be leveraged within a single request to the service.

GET /v1/annotators
ServiceCall<Void> getAnnotators(GetAnnotatorsOptions getAnnotatorsOptions)
get_annotators(self, **kwargs) -> DetailedResponse
getAnnotators(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) GetAnnotators(getAnnotatorsOptions *GetAnnotatorsOptions) (response *core.DetailedResponse, err error)

Request

Use the GetAnnotatorsOptions.Builder to create a GetAnnotatorsOptions object that contains the parameter values for the getAnnotators method.

Instantiate the GetAnnotatorsOptions struct and set the fields to provide parameter values for the GetAnnotators method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/annotators?version=2021-04-20"
  • // GET /annotators example
    GetAnnotatorsOptions opts = new GetAnnotatorsOptions();
    ServiceCall<Map<String, ServiceApiBean>> call = acd.getAnnotators(opts);
    Response<Map<String, ServiceApiBean>> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode());
    Map<String, ServiceApiBean> annotators = resp.getResult();
    for (String id:annotators.keySet())
       System.out.println(id);
  • # Get list of available annotators
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.get_annotators()
       rslt = resp.result
       for annotator in rslt:
           print(annotator)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • # Get list of annotators
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {};
    ACD.getAnnotators(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get list of annotators
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       getAnnotatorsOptions := ACD.NewGetAnnotatorsOptions()
       result, detailedResponse, err := ACD.GetAnnotators(getAnnotatorsOptions)
       if err != nil {
          panic(err)
       }
       for annotatorId, _ := range result {
          fmt.Println(annotatorId)
       }
    }

Response

Annotators available for use in analyzing text to detect medical concepts

Status Code

  • List annotators results

Example responses
  • {
      "allergy": {
        "description": "Detect allergy information from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "attribute_detection": {
        "description": "Detect clinical attributes from a set of concepts and concept values.",
        "version": "2020-08-20T11:47:08Z"
      },
      "bathing_assistance": {
        "description": "Detect the need for bathing assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "cancer": {
        "description": "Detect cancer history & diagnoses from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "concept_detection": {
        "description": "Detect UMLS concepts from medical data.",
        "version": "2020-08-20T12:25:01Z"
      },
      "concept_value": {
        "description": "Detect values associated with a set of concepts.",
        "version": "2020-08-17T07:02:02Z"
      },
      "disambiguation": {
        "description": "Disambiguate medical concepts based on surrounding context.",
        "version": "2020-08-18T19:44:41Z"
      },
      "dressing_assistance": {
        "description": "Detect the need for dressing assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "eating_assistance": {
        "description": "Detect the need for eating assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "ejection_fraction": {
        "description": "Detect ejection fraction from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "hypothetical": {
        "description": "Detect spans of text deemed to be hypothetical in context such as 'An ultrasound guided biopsy is recommended'.",
        "version": "2020-08-17T07:02:35Z"
      },
      "lab_value": {
        "description": "Detect values from lab notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "medication": {
        "description": "Detect medications from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "model_broker": {
        "description": "Detect medications from clinic notes.",
        "version": "2020-08-17T06:02:53Z"
      },
      "named_entities": {
        "description": "Detect named entities from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "negation": {
        "description": "Detect negated spans from medical data.",
        "version": "2020-08-17T08:02:05Z"
      },
      "procedure": {
        "description": "Detect procedures from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "relation": {
        "description": "Detect ontology-based relationships within clinical data.",
        "version": "2020-08-17T09:04:57Z"
      },
      "section": {
        "description": "Detect sections within the case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "seeing_assistance": {
        "description": "Detect the need for seeing assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "smoking": {
        "description": "Detect smoking history from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "spell_checker": {
        "description": "Spell check word and phrases in documents.",
        "version": "2020-08-17T12:56:53Z"
      },
      "symptom_disease": {
        "description": "Detect symptoms & diseases from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "toileting_assistance": {
        "description": "Detect the need for bathroom assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "walking_assistance": {
        "description": "Detect the need for walking assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      }
    }
  • {
      "allergy": {
        "description": "Detect allergy information from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "attribute_detection": {
        "description": "Detect clinical attributes from a set of concepts and concept values.",
        "version": "2020-08-20T11:47:08Z"
      },
      "bathing_assistance": {
        "description": "Detect the need for bathing assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "cancer": {
        "description": "Detect cancer history & diagnoses from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "concept_detection": {
        "description": "Detect UMLS concepts from medical data.",
        "version": "2020-08-20T12:25:01Z"
      },
      "concept_value": {
        "description": "Detect values associated with a set of concepts.",
        "version": "2020-08-17T07:02:02Z"
      },
      "disambiguation": {
        "description": "Disambiguate medical concepts based on surrounding context.",
        "version": "2020-08-18T19:44:41Z"
      },
      "dressing_assistance": {
        "description": "Detect the need for dressing assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "eating_assistance": {
        "description": "Detect the need for eating assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "ejection_fraction": {
        "description": "Detect ejection fraction from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "hypothetical": {
        "description": "Detect spans of text deemed to be hypothetical in context such as 'An ultrasound guided biopsy is recommended'.",
        "version": "2020-08-17T07:02:35Z"
      },
      "lab_value": {
        "description": "Detect values from lab notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "medication": {
        "description": "Detect medications from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "model_broker": {
        "description": "Detect medications from clinic notes.",
        "version": "2020-08-17T06:02:53Z"
      },
      "named_entities": {
        "description": "Detect named entities from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "negation": {
        "description": "Detect negated spans from medical data.",
        "version": "2020-08-17T08:02:05Z"
      },
      "procedure": {
        "description": "Detect procedures from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "relation": {
        "description": "Detect ontology-based relationships within clinical data.",
        "version": "2020-08-17T09:04:57Z"
      },
      "section": {
        "description": "Detect sections within the case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "seeing_assistance": {
        "description": "Detect the need for seeing assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "smoking": {
        "description": "Detect smoking history from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "spell_checker": {
        "description": "Spell check word and phrases in documents.",
        "version": "2020-08-17T12:56:53Z"
      },
      "symptom_disease": {
        "description": "Detect symptoms & diseases from clinic notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "toileting_assistance": {
        "description": "Detect the need for bathroom assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      },
      "walking_assistance": {
        "description": "Detect the need for walking assistance from case notes.",
        "version": "2020-08-12T20:12:46Z"
      }
    }

Get annotator

Get details of an annotator that can be used to detect information from unstructured data.

Get details of an annotator that can be used to detect information from unstructured data.

Get details of an annotator that can be used to detect information from unstructured data.

Get details of an annotator that can be used to detect information from unstructured data.

Get details of an annotator that can be used to detect information from unstructured data.

GET /v1/annotators/{id}
ServiceCall<Void> getAnnotatorsById(GetAnnotatorsByIdOptions getAnnotatorsByIdOptions)
get_annotators_by_id(self, id: str, **kwargs) -> DetailedResponse
getAnnotatorsById(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) GetAnnotatorsByID(getAnnotatorsByIdOptions *GetAnnotatorsByIdOptions) (response *core.DetailedResponse, err error)

Request

Use the GetAnnotatorsByIdOptions.Builder to create a GetAnnotatorsByIdOptions object that contains the parameter values for the getAnnotatorsById method.

Instantiate the GetAnnotatorsByIdOptions struct and set the fields to provide parameter values for the GetAnnotatorsByID method.

Path Parameters

  • The ID the Service API was registered under.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The getAnnotatorsById options.

parameters

  • The ID the Service API was registered under.

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The ID the Service API was registered under.

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

The GetAnnotatorsByID options.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/annotators/concept_detection?version=2021-04-20"
  • # Get annotator by id
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.get_annotator_by_id("concept_detection")
       rslt = resp.result
       print("Description:",rslt['description'])
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • // GET /annotators/{id} example
    GetAnnotatorsByIdOptions opts = new GetAnnotatorsByIdOptions.Builder()
       .id("negation").build();
    ServiceCall<Annotator> call = acd.getAnnotatorsById(opts);
    Response<Annotator> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode());
    System.out.println(resp.getResult().description());
  • # Get annotator by ID
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {
       id: 'concept_detection'
    };
    ACD.getAnnotatorsById(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get annotator by ID
    import (
       "fmt"
       "github.com/IBM/go-sdk-core/core"
       "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    }
    func main() {
       ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
           URL:     "{url}",
           Version: core.StringPtr("{version}"),
           Authenticator: &core.IamAuthenticator{
               ApiKey:                 "{apikey},
           }
       })
       if err != nil {
           panic(err)
       }
    
       getAnnotatorsByIdOptions := ACD.NewGetAnnotatorsByIdOptions("concept_detection")
       result, detailedResponse, err := ACD.GetAnnotatorsByID(getAnnotatorsByIdOptions)
       if err != nil {
          panic(err)
       }
       fmt.Println(result.Description)
    }

Response

Details of an available annotator

Status Code

  • Get annotator results

  • Annotator ID not found.

Example responses
  • {
      "description": "Detect UMLS concepts from medical data.",
      "version": "2020-08-20T12:25:01Z"
    }
  • {
      "description": "Detect UMLS concepts from medical data.",
      "version": "2020-08-20T12:25:01Z"
    }

Health check

Get the health status of this service. The "serviceState" response field will be "OK" if the service if functioning properly, "ERROR" if otherwise.

Get the health status of this service. The "serviceState" response field will be "OK" if the service if functioning properly, "ERROR" if otherwise.

Get the health status of this service. The "serviceState" response field will be "OK" if the service if functioning properly, "ERROR" if otherwise.

Get the health status of this service. The "serviceState" response field will be "OK" if the service if functioning properly, "ERROR" if otherwise.

Get the health status of this service. The "serviceState" response field will be "OK" if the service if functioning properly, "ERROR" if otherwise.

GET /v1/status/health_check
ServiceCall<Void> getHealthCheckStatus(GetHealthCheckStatusOptions getHealthCheckStatusOptions)
get_health_check_status(self, *, format: str = None, **kwargs) -> DetailedResponse
getHealthCheckStatus(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) GetHealthCheckStatus(getHealthCheckStatusOptions *GetHealthCheckStatusOptions) (response *core.DetailedResponse, err error)

Request

Use the GetHealthCheckStatusOptions.Builder to create a GetHealthCheckStatusOptions object that contains the parameter values for the getHealthCheckStatus method.

Instantiate the GetHealthCheckStatusOptions struct and set the fields to provide parameter values for the GetHealthCheckStatus method.

Query Parameters

  • Override response format

    Allowable values: [json,xml]

The getHealthCheckStatus options.

parameters

  • Override response format.

    Allowable values: [json,xml]

parameters

  • Override response format.

    Allowable values: [json,xml]

The GetHealthCheckStatus options.

  • curl -X GET -u "apikey":"{apikey}" --header "Accept: application/json"   "{url}/v1/status/health_check?version=2021-04-20"
  • # Get health check status
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.get_health_check_status()
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • // GET /health_check example
    ServiceCall<ServiceStatus> call = acd.getHealthCheckStatus();
    Response<ServiceStatus> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode()
       + " Status: " + resp.getStatusMessage());
  • # Get health check status
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    ACD.getHealthCheckStatus()
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Get health check status
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/core"
      "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    )
    
    func main() {
      ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
        URL:     "{url}"
        Version: core.StringPtr("{version}")
        Authenticator: &core.IamAuthenticator{
           ApiKey:                 "{apikey}",
        },
      })
    
      getHealthCheckStatusOptions := ACD.NewGetHealthCheckStatusOptions()
      result, detailedResponse, err := ACD.GetHealthCheckStatus(getHealthCheckStatusOptions)
      if err != nil {
        panic(err)
      }
      fmt.Println(detailedResponse.StatusCode)
      fmt.Println(result.ServiceState)
    }

Response

Health check result

Status Code

  • Flow result

  • Service is not running properly

Example responses
  • {
      "serviceState": "OK"
    }
  • {
      "serviceState": "OK"
    }

Delete

Delete tenant specific artifacts.

Delete tenant specific artifacts.

Delete tenant specific artifacts.

Delete tenant specific artifacts.

Delete tenant specific artifacts.

DELETE /v1/user_data
ServiceCall<Void> deleteUserSpecificArtifacts(DeleteUserSpecificArtifactsOptions deleteUserSpecificArtifactsOptions)
delete_user_specific_artifacts(self, **kwargs) -> DetailedResponse
deleteUserSpecificArtifacts(params, [callback()])
(annotatorForClinicalDataAcd *AnnotatorForClinicalDataAcdV1) DeleteUserSpecificArtifacts(deleteUserSpecificArtifactsOptions *DeleteUserSpecificArtifactsOptions) (response *core.DetailedResponse, err error)

Request

Use the DeleteUserSpecificArtifactsOptions.Builder to create a DeleteUserSpecificArtifactsOptions object that contains the parameter values for the deleteUserSpecificArtifacts method.

Instantiate the DeleteUserSpecificArtifactsOptions struct and set the fields to provide parameter values for the DeleteUserSpecificArtifacts method.

Query Parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

parameters

  • The release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format.

  • curl -X DELETE -u "apikey":"{apikey}"   "{url}/v1/user_data?version=2021-04-20"
  • # Delete user specific artifacts
    from ibm_whcs_sdk import annotator_for_clinical_data as acd
    from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
    service = acd.AnnotatorForClinicalDataV1(
       authenticator=IAMAuthenticator(apikey="{apikey}"),
       version="{version}"
    )
    service.set_service_url("{url}")
    
    try:
       resp = service.delete_user_specific_artifacts()
       print("Response Code:",resp.status_code)
    
    except acd.ACDException as ex:
       print ("Error Code:", ex.code, " Message:", ex.message, " Correlation Id:", ex.correlation_id)
  • // DELETE /user_data example
    DeleteUserSpecificArtifactsOptions opts = new DeleteUserSpecificArtifactsOptions();
    ServiceCall<Void> call = acd.deleteUserSpecificArtifacts(opts);
    Response<Void> resp = call.execute();
    System.out.println("Response code: " + resp.getStatusCode());
  • # Delete user specific artifacts
    const AnnotatorForClinicalDataAcdV1 = require('ibm-whcs-services/annotator-for-clinical-data/v1');
    const core = require('ibm-cloud-sdk-core');
    const { IamAuthenticator } = core;
    const ACD = new AnnotatorForClinicalDataAcdV1({
       version='{version}',
       authenticator: new IamAuthenticator({
         apikey: '{apikey}'
       }),
       serviceUrl: '{url}'
    });
    
    const params = {
       headers: {
         'X-IBM-Client-ID': '{tenantId}'
       },
    };
    ACD.deleteUserSpecificArtifacts(params)
       .then(response => {
         console.log(JSON.stringify(response.result, null, 2));
       })
       .catch(err => {
         console.log('error', err);
       });
  • # Delete user specific artifacts
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/core"
      "github.com/IBM/whcs-go-sdk/annotatorforclinicaldataacdv1"
    )
    
    func main() {
      ACD, err = annotatorforclinicaldataacdv1.NewAnnotatorForClinicalDataAcdV1(&annotatorforclinicaldataacdv1.AnnotatorForClinicalDataAcdV1Options{
        URL:     "{url}"
        Version: core.StringPtr("{version}")
        Authenticator: &core.IamAuthenticator{
           ApiKey:                 "{apikey}",
        },
      })
    
      artifactsOptions := ACD.NewDeleteUserSpecificArtifactsOptions()
      sdkHeaders := make(map[string]string)
      sdkHeaders["X-IBM-Client-ID"] = "{tenantId}"
      artifactsOptions.SetHeaders(sdkHeaders)
      detailedResponse, err := ACD.DeleteUserSpecificArtifacts(artifactsOptions)
      if err != nil {
        panic(err)
      }
      fmt.Println(detailedResponse.StatusCode)
    }

Response

Status Code

  • The request is successfully processed but no content is returned

  • The tenant id could not be determined from the request.

  • Operation is not supported for file-based object store

No Sample Response

This method does not specify any sample responses.