
commonMain.aws.sdk.kotlin.services.comprehendmedical.DefaultComprehendMedicalClient.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.comprehendmedical
import aws.sdk.kotlin.runtime.client.AwsClientOption
import aws.sdk.kotlin.runtime.http.ApiMetadata
import aws.sdk.kotlin.runtime.http.AwsUserAgentMetadata
import aws.sdk.kotlin.runtime.http.interceptors.AwsSpanInterceptor
import aws.sdk.kotlin.runtime.http.middleware.AwsRetryHeaderMiddleware
import aws.sdk.kotlin.runtime.http.middleware.RecursionDetection
import aws.sdk.kotlin.runtime.http.middleware.UserAgent
import aws.sdk.kotlin.services.comprehendmedical.auth.ComprehendMedicalAuthSchemeProviderAdapter
import aws.sdk.kotlin.services.comprehendmedical.auth.ComprehendMedicalIdentityProviderConfigAdapter
import aws.sdk.kotlin.services.comprehendmedical.endpoints.internal.EndpointResolverAdapter
import aws.sdk.kotlin.services.comprehendmedical.model.*
import aws.sdk.kotlin.services.comprehendmedical.serde.*
import aws.smithy.kotlin.runtime.auth.AuthSchemeId
import aws.smithy.kotlin.runtime.auth.awssigning.AwsSigningAttributes
import aws.smithy.kotlin.runtime.auth.awssigning.DefaultAwsSigner
import aws.smithy.kotlin.runtime.awsprotocol.json.AwsJsonProtocol
import aws.smithy.kotlin.runtime.client.SdkClientOption
import aws.smithy.kotlin.runtime.collections.attributesOf
import aws.smithy.kotlin.runtime.collections.putIfAbsent
import aws.smithy.kotlin.runtime.collections.putIfAbsentNotNull
import aws.smithy.kotlin.runtime.http.SdkHttpClient
import aws.smithy.kotlin.runtime.http.auth.AuthScheme
import aws.smithy.kotlin.runtime.http.auth.SigV4AuthScheme
import aws.smithy.kotlin.runtime.http.operation.OperationAuthConfig
import aws.smithy.kotlin.runtime.http.operation.OperationMetrics
import aws.smithy.kotlin.runtime.http.operation.SdkHttpOperation
import aws.smithy.kotlin.runtime.http.operation.context
import aws.smithy.kotlin.runtime.http.operation.roundTrip
import aws.smithy.kotlin.runtime.http.operation.telemetry
import aws.smithy.kotlin.runtime.io.SdkManagedGroup
import aws.smithy.kotlin.runtime.io.addIfManaged
import aws.smithy.kotlin.runtime.operation.ExecutionContext
internal class DefaultComprehendMedicalClient(override val config: ComprehendMedicalClient.Config) : ComprehendMedicalClient {
private val managedResources = SdkManagedGroup()
private val client = SdkHttpClient(config.httpClient)
private val identityProviderConfig = ComprehendMedicalIdentityProviderConfigAdapter(config)
private val configuredAuthSchemes = with(config.authSchemes.associateBy(AuthScheme::schemeId).toMutableMap()){
getOrPut(AuthSchemeId.AwsSigV4){
SigV4AuthScheme(DefaultAwsSigner, "comprehendmedical")
}
toMap()
}
private val authSchemeAdapter = ComprehendMedicalAuthSchemeProviderAdapter(config)
private val telemetryScope = "aws.sdk.kotlin.services.comprehendmedical"
private val opMetrics = OperationMetrics(telemetryScope, config.telemetryProvider)
init {
managedResources.addIfManaged(config.httpClient)
managedResources.addIfManaged(config.credentialsProvider)
}
private val awsUserAgentMetadata = AwsUserAgentMetadata.fromEnvironment(ApiMetadata(ServiceId, SdkVersion), config.applicationId)
/**
* Gets the properties associated with a medical entities detection job. Use this operation to get the status of a detection job.
*/
override suspend fun describeEntitiesDetectionV2Job(input: DescribeEntitiesDetectionV2JobRequest): DescribeEntitiesDetectionV2JobResponse {
val op = SdkHttpOperation.build {
serializer = DescribeEntitiesDetectionV2JobOperationSerializer()
deserializer = DescribeEntitiesDetectionV2JobOperationDeserializer()
operationName = "DescribeEntitiesDetectionV2Job"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets the properties associated with an InferICD10CM job. Use this operation to get the status of an inference job.
*/
override suspend fun describeIcd10CmInferenceJob(input: DescribeIcd10CmInferenceJobRequest): DescribeIcd10CmInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = DescribeICD10CMInferenceJobOperationSerializer()
deserializer = DescribeICD10CMInferenceJobOperationDeserializer()
operationName = "DescribeICD10CMInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets the properties associated with a protected health information (PHI) detection job. Use this operation to get the status of a detection job.
*/
override suspend fun describePhiDetectionJob(input: DescribePhiDetectionJobRequest): DescribePhiDetectionJobResponse {
val op = SdkHttpOperation.build {
serializer = DescribePHIDetectionJobOperationSerializer()
deserializer = DescribePHIDetectionJobOperationDeserializer()
operationName = "DescribePHIDetectionJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets the properties associated with an InferRxNorm job. Use this operation to get the status of an inference job.
*/
override suspend fun describeRxNormInferenceJob(input: DescribeRxNormInferenceJobRequest): DescribeRxNormInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = DescribeRxNormInferenceJobOperationSerializer()
deserializer = DescribeRxNormInferenceJobOperationDeserializer()
operationName = "DescribeRxNormInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets the properties associated with an InferSNOMEDCT job. Use this operation to get the status of an inference job.
*/
override suspend fun describeSnomedctInferenceJob(input: DescribeSnomedctInferenceJobRequest): DescribeSnomedctInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = DescribeSNOMEDCTInferenceJobOperationSerializer()
deserializer = DescribeSNOMEDCTInferenceJobOperationDeserializer()
operationName = "DescribeSNOMEDCTInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* The `DetectEntities` operation is deprecated. You should use the DetectEntitiesV2 operation instead.
*
* Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information.
*/
@Deprecated("No longer recommended for use. See AWS API documentation for more details.")
override suspend fun detectEntities(input: DetectEntitiesRequest): DetectEntitiesResponse {
val op = SdkHttpOperation.build {
serializer = DetectEntitiesOperationSerializer()
deserializer = DetectEntitiesOperationDeserializer()
operationName = "DetectEntities"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information. Amazon Comprehend Medical only detects medical entities in English language texts.
*
* The `DetectEntitiesV2` operation replaces the DetectEntities operation. This new action uses a different model for determining the entities in your medical text and changes the way that some entities are returned in the output. You should use the `DetectEntitiesV2` operation in all new applications.
*
* The `DetectEntitiesV2` operation returns the `Acuity` and `Direction` entities as attributes instead of types.
*/
override suspend fun detectEntitiesV2(input: DetectEntitiesV2Request): DetectEntitiesV2Response {
val op = SdkHttpOperation.build {
serializer = DetectEntitiesV2OperationSerializer()
deserializer = DetectEntitiesV2OperationDeserializer()
operationName = "DetectEntitiesV2"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Inspects the clinical text for protected health information (PHI) entities and returns the entity category, location, and confidence score for each entity. Amazon Comprehend Medical only detects entities in English language texts.
*/
override suspend fun detectPhi(input: DetectPhiRequest): DetectPhiResponse {
val op = SdkHttpOperation.build {
serializer = DetectPHIOperationSerializer()
deserializer = DetectPHIOperationDeserializer()
operationName = "DetectPHI"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* InferICD10CM detects medical conditions as entities listed in a patient record and links those entities to normalized concept identifiers in the ICD-10-CM knowledge base from the Centers for Disease Control. Amazon Comprehend Medical only detects medical entities in English language texts.
*/
override suspend fun inferIcd10Cm(input: InferIcd10CmRequest): InferIcd10CmResponse {
val op = SdkHttpOperation.build {
serializer = InferICD10CMOperationSerializer()
deserializer = InferICD10CMOperationDeserializer()
operationName = "InferICD10CM"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* InferRxNorm detects medications as entities listed in a patient record and links to the normalized concept identifiers in the RxNorm database from the National Library of Medicine. Amazon Comprehend Medical only detects medical entities in English language texts.
*/
override suspend fun inferRxNorm(input: InferRxNormRequest): InferRxNormResponse {
val op = SdkHttpOperation.build {
serializer = InferRxNormOperationSerializer()
deserializer = InferRxNormOperationDeserializer()
operationName = "InferRxNorm"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* InferSNOMEDCT detects possible medical concepts as entities and links them to codes from the Systematized Nomenclature of Medicine, Clinical Terms (SNOMED-CT) ontology
*/
override suspend fun inferSnomedct(input: InferSnomedctRequest): InferSnomedctResponse {
val op = SdkHttpOperation.build {
serializer = InferSNOMEDCTOperationSerializer()
deserializer = InferSNOMEDCTOperationDeserializer()
operationName = "InferSNOMEDCT"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a list of medical entity detection jobs that you have submitted.
*/
override suspend fun listEntitiesDetectionV2Jobs(input: ListEntitiesDetectionV2JobsRequest): ListEntitiesDetectionV2JobsResponse {
val op = SdkHttpOperation.build {
serializer = ListEntitiesDetectionV2JobsOperationSerializer()
deserializer = ListEntitiesDetectionV2JobsOperationDeserializer()
operationName = "ListEntitiesDetectionV2Jobs"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a list of InferICD10CM jobs that you have submitted.
*/
override suspend fun listIcd10CmInferenceJobs(input: ListIcd10CmInferenceJobsRequest): ListIcd10CmInferenceJobsResponse {
val op = SdkHttpOperation.build {
serializer = ListICD10CMInferenceJobsOperationSerializer()
deserializer = ListICD10CMInferenceJobsOperationDeserializer()
operationName = "ListICD10CMInferenceJobs"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a list of protected health information (PHI) detection jobs you have submitted.
*/
override suspend fun listPhiDetectionJobs(input: ListPhiDetectionJobsRequest): ListPhiDetectionJobsResponse {
val op = SdkHttpOperation.build {
serializer = ListPHIDetectionJobsOperationSerializer()
deserializer = ListPHIDetectionJobsOperationDeserializer()
operationName = "ListPHIDetectionJobs"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a list of InferRxNorm jobs that you have submitted.
*/
override suspend fun listRxNormInferenceJobs(input: ListRxNormInferenceJobsRequest): ListRxNormInferenceJobsResponse {
val op = SdkHttpOperation.build {
serializer = ListRxNormInferenceJobsOperationSerializer()
deserializer = ListRxNormInferenceJobsOperationDeserializer()
operationName = "ListRxNormInferenceJobs"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a list of InferSNOMEDCT jobs a user has submitted.
*/
override suspend fun listSnomedctInferenceJobs(input: ListSnomedctInferenceJobsRequest): ListSnomedctInferenceJobsResponse {
val op = SdkHttpOperation.build {
serializer = ListSNOMEDCTInferenceJobsOperationSerializer()
deserializer = ListSNOMEDCTInferenceJobsOperationDeserializer()
operationName = "ListSNOMEDCTInferenceJobs"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Starts an asynchronous medical entity detection job for a collection of documents. Use the `DescribeEntitiesDetectionV2Job` operation to track the status of a job.
*/
override suspend fun startEntitiesDetectionV2Job(input: StartEntitiesDetectionV2JobRequest): StartEntitiesDetectionV2JobResponse {
val op = SdkHttpOperation.build {
serializer = StartEntitiesDetectionV2JobOperationSerializer()
deserializer = StartEntitiesDetectionV2JobOperationDeserializer()
operationName = "StartEntitiesDetectionV2Job"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Starts an asynchronous job to detect medical conditions and link them to the ICD-10-CM ontology. Use the `DescribeICD10CMInferenceJob` operation to track the status of a job.
*/
override suspend fun startIcd10CmInferenceJob(input: StartIcd10CmInferenceJobRequest): StartIcd10CmInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = StartICD10CMInferenceJobOperationSerializer()
deserializer = StartICD10CMInferenceJobOperationDeserializer()
operationName = "StartICD10CMInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Starts an asynchronous job to detect protected health information (PHI). Use the `DescribePHIDetectionJob` operation to track the status of a job.
*/
override suspend fun startPhiDetectionJob(input: StartPhiDetectionJobRequest): StartPhiDetectionJobResponse {
val op = SdkHttpOperation.build {
serializer = StartPHIDetectionJobOperationSerializer()
deserializer = StartPHIDetectionJobOperationDeserializer()
operationName = "StartPHIDetectionJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Starts an asynchronous job to detect medication entities and link them to the RxNorm ontology. Use the `DescribeRxNormInferenceJob` operation to track the status of a job.
*/
override suspend fun startRxNormInferenceJob(input: StartRxNormInferenceJobRequest): StartRxNormInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = StartRxNormInferenceJobOperationSerializer()
deserializer = StartRxNormInferenceJobOperationDeserializer()
operationName = "StartRxNormInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Starts an asynchronous job to detect medical concepts and link them to the SNOMED-CT ontology. Use the DescribeSNOMEDCTInferenceJob operation to track the status of a job.
*/
override suspend fun startSnomedctInferenceJob(input: StartSnomedctInferenceJobRequest): StartSnomedctInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = StartSNOMEDCTInferenceJobOperationSerializer()
deserializer = StartSNOMEDCTInferenceJobOperationDeserializer()
operationName = "StartSNOMEDCTInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Stops a medical entities detection job in progress.
*/
override suspend fun stopEntitiesDetectionV2Job(input: StopEntitiesDetectionV2JobRequest): StopEntitiesDetectionV2JobResponse {
val op = SdkHttpOperation.build {
serializer = StopEntitiesDetectionV2JobOperationSerializer()
deserializer = StopEntitiesDetectionV2JobOperationDeserializer()
operationName = "StopEntitiesDetectionV2Job"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Stops an InferICD10CM inference job in progress.
*/
override suspend fun stopIcd10CmInferenceJob(input: StopIcd10CmInferenceJobRequest): StopIcd10CmInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = StopICD10CMInferenceJobOperationSerializer()
deserializer = StopICD10CMInferenceJobOperationDeserializer()
operationName = "StopICD10CMInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Stops a protected health information (PHI) detection job in progress.
*/
override suspend fun stopPhiDetectionJob(input: StopPhiDetectionJobRequest): StopPhiDetectionJobResponse {
val op = SdkHttpOperation.build {
serializer = StopPHIDetectionJobOperationSerializer()
deserializer = StopPHIDetectionJobOperationDeserializer()
operationName = "StopPHIDetectionJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Stops an InferRxNorm inference job in progress.
*/
override suspend fun stopRxNormInferenceJob(input: StopRxNormInferenceJobRequest): StopRxNormInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = StopRxNormInferenceJobOperationSerializer()
deserializer = StopRxNormInferenceJobOperationDeserializer()
operationName = "StopRxNormInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Stops an InferSNOMEDCT inference job in progress.
*/
override suspend fun stopSnomedctInferenceJob(input: StopSnomedctInferenceJobRequest): StopSnomedctInferenceJobResponse {
val op = SdkHttpOperation.build {
serializer = StopSNOMEDCTInferenceJobOperationSerializer()
deserializer = StopSNOMEDCTInferenceJobOperationDeserializer()
operationName = "StopSNOMEDCTInferenceJob"
serviceName = ServiceId
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(authSchemeAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
execution.retryPolicy = config.retryPolicy
}
mergeServiceDefaults(op.context)
op.install(AwsRetryHeaderMiddleware())
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsJsonProtocol("ComprehendMedical_20181030", "1.1"))
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
override fun close() {
managedResources.unshareAll()
}
/**
* merge the defaults configured for the service into the execution context before firing off a request
*/
private fun mergeServiceDefaults(ctx: ExecutionContext) {
ctx.putIfAbsent(SdkClientOption.ClientName, config.clientName)
ctx.putIfAbsent(SdkClientOption.LogMode, config.logMode)
ctx.putIfAbsentNotNull(SdkClientOption.IdempotencyTokenProvider, config.idempotencyTokenProvider)
ctx.putIfAbsentNotNull(AwsClientOption.Region, config.region)
ctx.putIfAbsentNotNull(AwsSigningAttributes.SigningRegion, config.region)
ctx.putIfAbsent(AwsSigningAttributes.SigningService, "comprehendmedical")
ctx.putIfAbsent(AwsSigningAttributes.CredentialsProvider, config.credentialsProvider)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy