comprehendmedical

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2019 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Overview

Package comprehendmedical provides the client and types for making API requests to AWS Comprehend Medical.

Comprehend Medical extracts structured information from unstructured clinical text. Use these actions to gain insight in your documents.

See https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30 for more information on this service.

See comprehendmedical package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/comprehendmedical/

Using the Client

To AWS Comprehend Medical with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the AWS Comprehend Medical client ComprehendMedical for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/comprehendmedical/#New

Index

Constants

View Source
const (

	// ErrCodeInternalServerException for service response error code
	// "InternalServerException".
	//
	// An internal server error occurred. Retry your request.
	ErrCodeInternalServerException = "InternalServerException"

	// ErrCodeInvalidEncodingException for service response error code
	// "InvalidEncodingException".
	//
	// The input text was not in valid UTF-8 character encoding. Check your text
	// then retry your request.
	ErrCodeInvalidEncodingException = "InvalidEncodingException"

	// ErrCodeInvalidRequestException for service response error code
	// "InvalidRequestException".
	//
	// The request that you made is invalid. Check your request to determine why
	// it's invalid and then retry the request.
	ErrCodeInvalidRequestException = "InvalidRequestException"

	// ErrCodeServiceUnavailableException for service response error code
	// "ServiceUnavailableException".
	//
	// The Comprehend Medical service is temporarily unavailable. Please wait and
	// then retry your request.
	ErrCodeServiceUnavailableException = "ServiceUnavailableException"

	// ErrCodeTextSizeLimitExceededException for service response error code
	// "TextSizeLimitExceededException".
	//
	// The size of the text you submitted exceeds the size limit. Reduce the size
	// of the text or use a smaller document and then retry your request.
	ErrCodeTextSizeLimitExceededException = "TextSizeLimitExceededException"

	// ErrCodeTooManyRequestsException for service response error code
	// "TooManyRequestsException".
	//
	// You have made too many requests within a short period of time. Wait for a
	// short time and then try your request again. Contact customer support for
	// more information about a service limit increase.
	ErrCodeTooManyRequestsException = "TooManyRequestsException"
)
View Source
const (
	ServiceName = "comprehendmedical" // Service endpoint prefix API calls made to.
	EndpointsID = ServiceName         // Service ID for Regions and Endpoints metadata.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {

	// The 0-based character offset in the input text that shows where the attribute
	// begins. The offset returns the UTF-8 code point in the string.
	BeginOffset *int64 `type:"integer"`

	// The 0-based character offset in the input text that shows where the attribute
	// ends. The offset returns the UTF-8 code point in the string.
	EndOffset *int64 `type:"integer"`

	// The numeric identifier for this attribute. This is a monotonically increasing
	// id unique within this response rather than a global unique identifier.
	Id *int64 `type:"integer"`

	// The level of confidence that Comprehend Medical has that this attribute is
	// correctly related to this entity.
	RelationshipScore *float64 `type:"float"`

	// The level of confidence that Comprehend Medical has that the segment of text
	// is correctly recognized as an attribute.
	Score *float64 `type:"float"`

	// The segment of input text extracted as this attribute.
	Text *string `min:"1" type:"string"`

	// Contextual information for this attribute.
	Traits []Trait `type:"list"`

	// The type of attribute.
	Type EntitySubType `type:"string" enum:"true"`
	// contains filtered or unexported fields
}

An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the dosage of a medication taken. It contains information about the attribute such as id, begin and end offset within the input text, and the segment of the input text. Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/Attribute

func (Attribute) GoString

func (s Attribute) GoString() string

GoString returns the string representation

func (Attribute) String

func (s Attribute) String() string

String returns the string representation

type AttributeName

type AttributeName string
const (
	AttributeNameSign      AttributeName = "SIGN"
	AttributeNameSymptom   AttributeName = "SYMPTOM"
	AttributeNameDiagnosis AttributeName = "DIAGNOSIS"
	AttributeNameNegation  AttributeName = "NEGATION"
)

Enum values for AttributeName

func (AttributeName) MarshalValue

func (enum AttributeName) MarshalValue() (string, error)

func (AttributeName) MarshalValueBuf

func (enum AttributeName) MarshalValueBuf(b []byte) ([]byte, error)

type ComprehendMedical

type ComprehendMedical struct {
	*aws.Client
}

ComprehendMedical provides the API operation methods for making requests to AWS Comprehend Medical. See this package's package overview docs for details on the service.

ComprehendMedical methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(config aws.Config) *ComprehendMedical

New creates a new instance of the ComprehendMedical client with a config.

Example:

// Create a ComprehendMedical client from just a config.
svc := comprehendmedical.New(myConfig)

func (*ComprehendMedical) DetectEntitiesRequest

func (c *ComprehendMedical) DetectEntitiesRequest(input *DetectEntitiesInput) DetectEntitiesRequest

DetectEntitiesRequest returns a request value for making API operation for AWS Comprehend Medical.

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 .

// Example sending a request using the DetectEntitiesRequest method.
req := client.DetectEntitiesRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectEntities

func (*ComprehendMedical) DetectPHIRequest

func (c *ComprehendMedical) DetectPHIRequest(input *DetectPHIInput) DetectPHIRequest

DetectPHIRequest returns a request value for making API operation for AWS Comprehend Medical.

Inspects the clinical text for personal health information (PHI) entities and entity category, location, and confidence score on that information.

// Example sending a request using the DetectPHIRequest method.
req := client.DetectPHIRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectPHI

type DetectEntitiesInput

type DetectEntitiesInput struct {

	// A UTF-8 text string containing the clinical content being examined for entities.
	// Each string must contain fewer than 20,000 bytes of characters.
	//
	// Text is a required field
	Text *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectEntitiesRequest

func (DetectEntitiesInput) GoString

func (s DetectEntitiesInput) GoString() string

GoString returns the string representation

func (DetectEntitiesInput) String

func (s DetectEntitiesInput) String() string

String returns the string representation

func (*DetectEntitiesInput) Validate

func (s *DetectEntitiesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DetectEntitiesOutput

type DetectEntitiesOutput struct {

	// The collection of medical entities extracted from the input text and their
	// associated information. For each entity, the response provides the entity
	// text, the entity category, where the entity text begins and ends, and the
	// level of confidence that Comprehend Medical has in the detection and analysis.
	// Attributes and traits of the entity are also returned.
	//
	// Entities is a required field
	Entities []Entity `type:"list" required:"true"`

	// If the result of the previous request to DetectEntities was truncated, include
	// the Paginationtoken to fetch the next page of entities.
	PaginationToken *string `min:"1" type:"string"`

	// Attributes extracted from the input text that we were unable to relate to
	// an entity.
	UnmappedAttributes []UnmappedAttribute `type:"list"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectEntitiesResponse

func (DetectEntitiesOutput) GoString

func (s DetectEntitiesOutput) GoString() string

GoString returns the string representation

func (DetectEntitiesOutput) SDKResponseMetadata

func (s DetectEntitiesOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (DetectEntitiesOutput) String

func (s DetectEntitiesOutput) String() string

String returns the string representation

type DetectEntitiesRequest

type DetectEntitiesRequest struct {
	*aws.Request
	Input *DetectEntitiesInput
	Copy  func(*DetectEntitiesInput) DetectEntitiesRequest
}

DetectEntitiesRequest is a API request type for the DetectEntities API operation.

func (DetectEntitiesRequest) Send

Send marshals and sends the DetectEntities API request.

type DetectPHIInput

type DetectPHIInput struct {

	// A UTF-8 text string containing the clinical content being examined for PHI
	// entities. Each string must contain fewer than 20,000 bytes of characters.
	//
	// Text is a required field
	Text *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectPHIRequest

func (DetectPHIInput) GoString

func (s DetectPHIInput) GoString() string

GoString returns the string representation

func (DetectPHIInput) String

func (s DetectPHIInput) String() string

String returns the string representation

func (*DetectPHIInput) Validate

func (s *DetectPHIInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DetectPHIOutput

type DetectPHIOutput struct {

	// The collection of PHI entities extracted from the input text and their associated
	// information. For each entity, the response provides the entity text, the
	// entity category, where the entity text begins and ends, and the level of
	// confidence that Comprehend Medical has in its detection.
	//
	// Entities is a required field
	Entities []Entity `type:"list" required:"true"`

	// If the result of the previous request to DetectPHI was truncated, include
	// the Paginationtoken to fetch the next page of PHI entities.
	PaginationToken *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectPHIResponse

func (DetectPHIOutput) GoString

func (s DetectPHIOutput) GoString() string

GoString returns the string representation

func (DetectPHIOutput) SDKResponseMetadata

func (s DetectPHIOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (DetectPHIOutput) String

func (s DetectPHIOutput) String() string

String returns the string representation

type DetectPHIRequest

type DetectPHIRequest struct {
	*aws.Request
	Input *DetectPHIInput
	Copy  func(*DetectPHIInput) DetectPHIRequest
}

DetectPHIRequest is a API request type for the DetectPHI API operation.

func (DetectPHIRequest) Send

Send marshals and sends the DetectPHI API request.

type Entity

type Entity struct {

	// The extracted attributes that relate to this entity.
	Attributes []Attribute `type:"list"`

	// The 0-based character offset in the input text that shows where the entity
	// begins. The offset returns the UTF-8 code point in the string.
	BeginOffset *int64 `type:"integer"`

	// The category of the entity.
	Category EntityType `type:"string" enum:"true"`

	// The 0-based character offset in the input text that shows where the entity
	// ends. The offset returns the UTF-8 code point in the string.
	EndOffset *int64 `type:"integer"`

	// The numeric identifier for the entity. This is a monotonically increasing
	// id unique within this response rather than a global unique identifier.
	Id *int64 `type:"integer"`

	// The level of confidence that Comprehend Medical has in the accuracy of the
	// detection.
	Score *float64 `type:"float"`

	// The segment of input text extracted as this entity.
	Text *string `min:"1" type:"string"`

	// Contextual information for the entity
	Traits []Trait `type:"list"`

	// Describes the specific type of entity with category of entities.
	Type EntitySubType `type:"string" enum:"true"`
	// contains filtered or unexported fields
}

Provides information about an extracted medical entity. Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/Entity

func (Entity) GoString

func (s Entity) GoString() string

GoString returns the string representation

func (Entity) String

func (s Entity) String() string

String returns the string representation

type EntitySubType

type EntitySubType string
const (
	EntitySubTypeName            EntitySubType = "NAME"
	EntitySubTypeDosage          EntitySubType = "DOSAGE"
	EntitySubTypeRouteOrMode     EntitySubType = "ROUTE_OR_MODE"
	EntitySubTypeForm            EntitySubType = "FORM"
	EntitySubTypeFrequency       EntitySubType = "FREQUENCY"
	EntitySubTypeDuration        EntitySubType = "DURATION"
	EntitySubTypeGenericName     EntitySubType = "GENERIC_NAME"
	EntitySubTypeBrandName       EntitySubType = "BRAND_NAME"
	EntitySubTypeStrength        EntitySubType = "STRENGTH"
	EntitySubTypeRate            EntitySubType = "RATE"
	EntitySubTypeAcuity          EntitySubType = "ACUITY"
	EntitySubTypeTestName        EntitySubType = "TEST_NAME"
	EntitySubTypeTestValue       EntitySubType = "TEST_VALUE"
	EntitySubTypeTestUnits       EntitySubType = "TEST_UNITS"
	EntitySubTypeProcedureName   EntitySubType = "PROCEDURE_NAME"
	EntitySubTypeTreatmentName   EntitySubType = "TREATMENT_NAME"
	EntitySubTypeDate            EntitySubType = "DATE"
	EntitySubTypeAge             EntitySubType = "AGE"
	EntitySubTypeContactPoint    EntitySubType = "CONTACT_POINT"
	EntitySubTypeEmail           EntitySubType = "EMAIL"
	EntitySubTypeIdentifier      EntitySubType = "IDENTIFIER"
	EntitySubTypeUrl             EntitySubType = "URL"
	EntitySubTypeAddress         EntitySubType = "ADDRESS"
	EntitySubTypeProfession      EntitySubType = "PROFESSION"
	EntitySubTypeSystemOrganSite EntitySubType = "SYSTEM_ORGAN_SITE"
	EntitySubTypeDirection       EntitySubType = "DIRECTION"
	EntitySubTypeQuality         EntitySubType = "QUALITY"
	EntitySubTypeQuantity        EntitySubType = "QUANTITY"
)

Enum values for EntitySubType

func (EntitySubType) MarshalValue

func (enum EntitySubType) MarshalValue() (string, error)

func (EntitySubType) MarshalValueBuf

func (enum EntitySubType) MarshalValueBuf(b []byte) ([]byte, error)

type EntityType

type EntityType string
const (
	EntityTypeMedication                 EntityType = "MEDICATION"
	EntityTypeMedicalCondition           EntityType = "MEDICAL_CONDITION"
	EntityTypeProtectedHealthInformation EntityType = "PROTECTED_HEALTH_INFORMATION"
	EntityTypeTestTreatmentProcedure     EntityType = "TEST_TREATMENT_PROCEDURE"
	EntityTypeAnatomy                    EntityType = "ANATOMY"
)

Enum values for EntityType

func (EntityType) MarshalValue

func (enum EntityType) MarshalValue() (string, error)

func (EntityType) MarshalValueBuf

func (enum EntityType) MarshalValueBuf(b []byte) ([]byte, error)

type Trait

type Trait struct {

	// Provides a name or contextual description about the trait.
	Name AttributeName `type:"string" enum:"true"`

	// The level of confidence that Comprehend Medical has in the accuracy of this
	// trait.
	Score *float64 `type:"float"`
	// contains filtered or unexported fields
}

Provides contextual information about the extracted entity. Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/Trait

func (Trait) GoString

func (s Trait) GoString() string

GoString returns the string representation

func (Trait) String

func (s Trait) String() string

String returns the string representation

type UnmappedAttribute

type UnmappedAttribute struct {

	// The specific attribute that has been extracted but not mapped to an entity.
	Attribute *Attribute `type:"structure"`

	// The type of the attribute, could be one of the following values: "MEDICATION",
	// "MEDICAL_CONDITION", "ANATOMY", "TEST_AND_TREATMENT_PROCEDURE" or "PERSONAL_HEALTH_INFORMATION".
	Type EntityType `type:"string" enum:"true"`
	// contains filtered or unexported fields
}

An attribute that we extracted, but were unable to relate to an entity. Please also see https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/UnmappedAttribute

func (UnmappedAttribute) GoString

func (s UnmappedAttribute) GoString() string

GoString returns the string representation

func (UnmappedAttribute) String

func (s UnmappedAttribute) String() string

String returns the string representation

Directories

Path Synopsis
Package comprehendmedicaliface provides an interface to enable mocking the AWS Comprehend Medical service client for testing your code.
Package comprehendmedicaliface provides an interface to enable mocking the AWS Comprehend Medical service client for testing your code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL