Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TA] Healthcare Design update #18200

Merged
merged 12 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## 5.1.0-beta.4 (Unreleased)

### Breaking changes
- Renamed `RecognizeHealthcareEntitiesResultCollection` to `AnalyzeHealthcareEntitiesResultCollection`.
- Renamed `DocumentHealthcareResult` to `AnalyzeHealthcareEntitiesResult`.
- Removed `StartHealthcare` and `StartHealthcareAsync` methods.
- Renamed `StartHealthcareBatch` and `StartHealthcareBatchAsync` to `StartAnalyzeHealthcareEntities` and `StartAnalyzeHealthcareEntitiesAsync` respectively.
- Renamed `HealthcareOperation` to `AnalyzeHealthcareEntitiesOperation`.
- Renamed `HealthcareOptions` to `AnalyzeHealthcareEntitiesOptions`.
maririos marked this conversation as resolved.
Show resolved Hide resolved
- Moved `Cancel` and `CancelAsync` for Healthcare from `TextAnalyticsClient` to `AnalyzeHealthcareEntitiesOperation`.
- Renamed `JobStatus` to `TextAnalyticsOperationStatus`.
- Renamed `HealthcareEntityLink` to `EntityDataSource` with `DataSource` to `EntityDataSource` and `Id` to `Name`.
- Removed `HealthcareRelation` and added `HealthcareRelationType`.


maririos marked this conversation as resolved.
Show resolved Hide resolved
## 5.1.0-beta.3 (2020-11-19)
maririos marked this conversation as resolved.
Show resolved Hide resolved
### New Features
Expand Down
38 changes: 30 additions & 8 deletions sdk/textanalytics/Azure.AI.TextAnalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ catch (RequestFailedException exception)
### Recognize Healthcare Entities Asynchronously
Text Analytics for health is a containerized service that extracts and labels relevant medical information from unstructured texts such as doctor's notes, discharge summaries, clinical documents, and electronic health records. For more information see [How to: Use Text Analytics for health][healthcare].

```C# Snippet:RecognizeHealthcareEntitiesAsync
```C# Snippet:TextAnalyticsSampleHealthcareBatchAsync
string document = @"RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE | Signed | DIS | \
Admission Date: 5/22/2001 Report Status: Signed Discharge Date: 4/24/2001 ADMISSION DIAGNOSIS: CORONARY ARTERY DISEASE. \
HISTORY OF PRESENT ILLNESS: The patient is a 54-year-old gentleman with a history of progressive angina over the past several months. \
Expand All @@ -422,16 +422,29 @@ Text Analytics for health is a containerized service that extracts and labels re
minimal ST depressions in the anterior lateral leads , thought due to fatigue and wrist pain , his anginal equivalent. Due to the patient's \
increased symptoms and family history and history left main disease with total occasional of his RCA was referred for revascularization with open heart surgery.";

AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartHealthcareAsync(document);
List<string> batchInput = new List<string>()
{
document,
document,
};

AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions()
{
Top = 1,
Skip = 0,
IncludeStatistics = true
};

AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartAnalyzeHealthcareEntitiesAsync(batchInput, "en", options);

await healthOperation.WaitForCompletionAsync();

RecognizeHealthcareEntitiesResultCollection results = healthOperation.Value;
AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value;

Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\"");
Console.WriteLine("");

foreach (DocumentHealthcareResult result in results)
foreach (AnalyzeHealthcareEntitiesResult result in results)
{
Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:");

Expand All @@ -441,17 +454,26 @@ Text Analytics for health is a containerized service that extracts and labels re
Console.WriteLine($" Category: {entity.Category}");
Console.WriteLine($" Offset: {entity.Offset}");
Console.WriteLine($" Length: {entity.Length}");
Console.WriteLine($" IsNegated: {entity.IsNegated}");
Console.WriteLine($" Links:");

foreach (HealthcareEntityLink healthcareEntityLink in entity.Links)
foreach (EntityDataSource entityDataSource in entity.DataSources)
{
Console.WriteLine($" ID: {healthcareEntityLink.Id}");
Console.WriteLine($" DataSource: {healthcareEntityLink.DataSource}");
Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}");
Console.WriteLine($" DataSource: {entityDataSource.Name}");
}
}

Console.WriteLine($" Document statistics:");
Console.WriteLine($" Character count (in Unicode graphemes): {result.Statistics.CharacterCount}");
Console.WriteLine($" Transaction count: {result.Statistics.TransactionCount}");
Console.WriteLine("");
}
Console.WriteLine($"Request statistics:");
Console.WriteLine($" Document Count: {results.Statistics.DocumentCount}");
Console.WriteLine($" Valid Document Count: {results.Statistics.ValidDocumentCount}");
Console.WriteLine($" Transaction Count: {results.Statistics.TransactionCount}");
Console.WriteLine($" Invalid Document Count: {results.Statistics.InvalidDocumentCount}");
Console.WriteLine("");
}
```

Expand Down
Loading