From e0fd1cd415d8339947b20c3565c7adc7d7f60fbe Mon Sep 17 00:00:00 2001 From: Mariana Rios Flores Date: Wed, 3 Feb 2021 16:06:56 -0800 Subject: [PATCH] [TA] PageableOperation implementation (#18351) --- .../Azure.AI.TextAnalytics/README.md | 67 +- .../Azure.AI.TextAnalytics.netstandard2.0.cs | 20 +- .../Sample_RecognizeHealthcareEntities.md | 127 +- .../src/AnalyzeHealthcareEntitiesOperation.cs | 163 +- .../src/AnalyzeHealthcareEntitiesOptions.cs | 10 - .../src/HealthcareEntity.cs | 1 + .../src/PageableOperation.cs | 41 + .../src/TextAnalyticsClient.cs | 98 +- .../src/TextAnalyticsRestClient.cs | 90 + .../tests/RecognizeHealthcareEntitiesTests.cs | 283 +-- ... AnalyzeHealthcareEntitiesPagination.json} | 288 ++- ...yzeHealthcareEntitiesPaginationAsync.json} | 256 ++- ...HealthcareEntitiesBatchWithPagination.json | 1616 ----------------- ...hcareEntitiesBatchWithPaginationAsync.json | 1544 ---------------- ...izeHealthcareEntitiesWithLanguageTest.json | 932 +++++++++- ...althcareEntitiesWithLanguageTestAsync.json | 902 ++++++++- ...izeHealthcareEntitiesWithTopParameter.json | 299 --- ...althcareEntitiesWithTopParameterAsync.json | 299 --- ...Sample_HealthcareAsync_AutomaticPolling.cs | 35 +- .../Sample_HealthcareAsync_ManualPolling.cs | 35 +- .../Sample_HealthcareAsync_Pagination.cs | 57 - .../tests/samples/Sample_HealthcareBatch.cs | 52 +- .../samples/Sample_HealthcareBatchAsync.cs | 67 +- .../Sample_HealthcareBatchConvenience.cs | 44 +- .../Sample_HealthcareBatchConvenienceAsync.cs | 60 +- 25 files changed, 2814 insertions(+), 4572 deletions(-) create mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs create mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs rename sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/{RecognizeHealthcareEntitiesWithSkipParameterAsync.json => AnalyzeHealthcareEntitiesPagination.json} (75%) rename sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/{RecognizeHealthcareEntitiesWithSkipParameter.json => AnalyzeHealthcareEntitiesPaginationAsync.json} (77%) delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPagination.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPaginationAsync.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameter.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameterAsync.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_Pagination.cs diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md index f67b99c0d5999..6aca7df05997c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md @@ -412,9 +412,9 @@ catch (RequestFailedException exception) 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: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. \ + string document1 = @"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. The patient had a cardiac catheterization in July of this year revealing total occlusion of the RCA and 50% left main disease ,\ with a strong family history of coronary artery disease with a brother dying at the age of 52 from a myocardial infarction and \ another brother who is status post coronary artery bypass grafting. The patient had a stress echocardiogram done on July , 2001 , \ @@ -422,16 +422,16 @@ 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."; + string document2 = "Prescribed 100mg ibuprofen, taken twice daily."; + List batchInput = new List() { - document, - document, + document1, + document2, }; AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() { - Top = 1, - Skip = 0, IncludeStatistics = true }; @@ -439,41 +439,42 @@ Text Analytics for health is a containerized service that extracts and labels re await healthOperation.WaitForCompletionAsync(); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + await foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.Value) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult result in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); + Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); - foreach (EntityDataSource entityDataSource in entity.DataSources) + foreach (HealthcareEntity entity in result.Entities) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + 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($" 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: {documentsInPage.Statistics.DocumentCount}"); + Console.WriteLine($" Valid Document Count: {documentsInPage.Statistics.ValidDocumentCount}"); + Console.WriteLine($" Transaction Count: {documentsInPage.Statistics.TransactionCount}"); + Console.WriteLine($" Invalid Document Count: {documentsInPage.Statistics.InvalidDocumentCount}"); 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(""); } ``` diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs index ccfd4ab92555c..64bd492cc2422 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs @@ -1,6 +1,6 @@ namespace Azure.AI.TextAnalytics { - public partial class AnalyzeHealthcareEntitiesOperation : Azure.Operation + public partial class AnalyzeHealthcareEntitiesOperation : Azure.AI.TextAnalytics.PageableOperation { public AnalyzeHealthcareEntitiesOperation(string operationId, Azure.AI.TextAnalytics.TextAnalyticsClient client) { } public System.DateTimeOffset CreatedOn { get { throw null; } } @@ -10,20 +10,20 @@ public AnalyzeHealthcareEntitiesOperation(string operationId, Azure.AI.TextAnaly public override string Id { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } public Azure.AI.TextAnalytics.TextAnalyticsOperationStatus Status { get { throw null; } } - public override Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesResultCollection Value { get { throw null; } } + public override Azure.AsyncPageable Value { get { throw null; } } public virtual void Cancel(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { } public virtual System.Threading.Tasks.Task CancelAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Pageable GetValues() { throw null; } + public override Azure.AsyncPageable GetValuesAsync() { throw null; } public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask>> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask>> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class AnalyzeHealthcareEntitiesOptions : Azure.AI.TextAnalytics.TextAnalyticsRequestOptions { public AnalyzeHealthcareEntitiesOptions() { } - public int? Skip { get { throw null; } set { } } - public int? Top { get { throw null; } set { } } } public partial class AnalyzeHealthcareEntitiesResult : Azure.AI.TextAnalytics.TextAnalyticsResult { @@ -337,6 +337,13 @@ public readonly partial struct OpinionSentiment public Azure.AI.TextAnalytics.TextSentiment Sentiment { get { throw null; } } public string Text { get { throw null; } } } + public abstract partial class PageableOperation : Azure.Operation> where T : notnull + { + protected PageableOperation() { } + public override Azure.AsyncPageable Value { get { throw null; } } + public abstract Azure.Pageable GetValues(); + public abstract Azure.AsyncPageable GetValuesAsync(); + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PiiEntity { @@ -515,7 +522,6 @@ public TextAnalyticsClient(System.Uri endpoint, Azure.Core.TokenCredential crede public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public virtual Azure.AsyncPageable GetHealthcareEntities(Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesOperation operation, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RecognizeEntities(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RecognizeEntitiesAsync(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_RecognizeHealthcareEntities.md b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_RecognizeHealthcareEntities.md index a26e0362be63f..18a1df97ac14a 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_RecognizeHealthcareEntities.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_RecognizeHealthcareEntities.md @@ -18,9 +18,9 @@ var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(a To recognize healthcare entities in a document, use the `StarthealthcareAsyc` method. The returned type is a Long Running operation of type `HealthcareOperation` which polls for the results from the API. ```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. \ + string document1 = @"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. The patient had a cardiac catheterization in July of this year revealing total occlusion of the RCA and 50% left main disease ,\ with a strong family history of coronary artery disease with a brother dying at the age of 52 from a myocardial infarction and \ another brother who is status post coronary artery bypass grafting. The patient had a stress echocardiogram done on July , 2001 , \ @@ -28,16 +28,16 @@ To recognize healthcare entities in a document, use the `StarthealthcareAsyc` me 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."; + string document2 = "Prescribed 100mg ibuprofen, taken twice daily."; + List batchInput = new List() { - document, - document, + document1, + document2, }; AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() { - Top = 1, - Skip = 0, IncludeStatistics = true }; @@ -45,41 +45,42 @@ To recognize healthcare entities in a document, use the `StarthealthcareAsyc` me await healthOperation.WaitForCompletionAsync(); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + await foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.Value) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult result in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); + Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); - foreach (EntityDataSource entityDataSource in entity.DataSources) + foreach (HealthcareEntity entity in result.Entities) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + 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($" 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: {documentsInPage.Statistics.DocumentCount}"); + Console.WriteLine($" Valid Document Count: {documentsInPage.Statistics.ValidDocumentCount}"); + Console.WriteLine($" Transaction Count: {documentsInPage.Statistics.TransactionCount}"); + Console.WriteLine($" Invalid Document Count: {documentsInPage.Statistics.InvalidDocumentCount}"); 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(""); } ``` @@ -88,48 +89,50 @@ To recognize healthcare entities in a document, use the `StarthealthcareAsyc` me To recognize healthcare entities in multiple documents, call `StartHealthcareBatchAsync` on an `IEnumerable` of strings. The result is a Long Running operation of type `HealthcareOperation` which polls for the results from the API. ```C# Snippet:TextAnalyticsSampleHealthcareBatchConvenienceAsync - 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. \ - The patient had a cardiac catheterization in July of this year revealing total occlusion of the RCA and 50% left main disease ,\ - with a strong family history of coronary artery disease with a brother dying at the age of 52 from a myocardial infarction and \ - another brother who is status post coronary artery bypass grafting. The patient had a stress echocardiogram done on July , 2001 , \ - which showed no wall motion abnormalities , but this was a difficult study due to body habitus. The patient went for six minutes with \ - 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."; + string document = "Subject is taking 100mg of ibuprofen twice daily"; - List batchInput = new List() + var list = new List(); + + for (int i = 0; i < 6; i++) { - document, + list.Add(document); }; - AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartAnalyzeHealthcareEntitiesAsync(batchInput, "en"); + AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartAnalyzeHealthcareEntitiesAsync(list, "en", new AnalyzeHealthcareEntitiesOptions() { IncludeStatistics = true } ); await healthOperation.WaitForCompletionAsync(); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + await foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.Value) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult entitiesInDoc in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); - - foreach (EntityDataSource entityDataSource in entity.DataSources) + if (!entitiesInDoc.HasError) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + foreach (var entity in entitiesInDoc.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); + Console.WriteLine($" DataSource: {entityDataSource.Name}"); + } + } } } + + Console.WriteLine($"Request statistics:"); + Console.WriteLine($" Document Count: {documentsInPage.Statistics.DocumentCount}"); + Console.WriteLine($" Valid Document Count: {documentsInPage.Statistics.ValidDocumentCount}"); + Console.WriteLine($" Transaction Count: {documentsInPage.Statistics.TransactionCount}"); + Console.WriteLine($" Invalid Document Count: {documentsInPage.Statistics.InvalidDocumentCount}"); Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs index d165498005342..f4cfe39e38302 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOperation.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using Azure.AI.TextAnalytics.Models; @@ -14,21 +13,8 @@ namespace Azure.AI.TextAnalytics { /// The AnalyzeHealthcareEntitiesOperation class for LRO. - public class AnalyzeHealthcareEntitiesOperation : Operation + public class AnalyzeHealthcareEntitiesOperation : PageableOperation { - /// Provides communication with the Text Analytics Azure Cognitive Service through its REST API. - private readonly TextAnalyticsRestClient _serviceClient; - - /// Provides tools for exception creation in case of failure. - private readonly ClientDiagnostics _diagnostics; - - private TextAnalyticsOperationStatus _status; - - /// - /// Provides the input to be part of AnalyzeHealthcareEntitiesOperation class - /// - internal readonly IDictionary _idToIndexMap; - /// /// Gets an ID representing the operation that can be used to poll for the status /// of the long-running operation. @@ -56,55 +42,48 @@ public class AnalyzeHealthcareEntitiesOperation : Operation _status; /// - /// next link string for pagination - /// - internal string NextLink { get; set; } - - /// - /// Final result of the long-running operation. + /// Gets the final result of the long-running operation in a synchronous way. /// /// /// This property can be accessed only after the operation completes successfully (HasValue is true). /// - public override AnalyzeHealthcareEntitiesResultCollection Value - { - get - { -#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations - if (HasCompleted && !HasValue) - throw _requestFailedException; -#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations - else - { - return OperationHelpers.GetValue(ref _value); - } - } - } - - /// true if the long-running operation has completed. Otherwise, false. - private bool _hasCompleted; + public override AsyncPageable Value => GetValuesAsync(); /// /// Returns true if the long-running operation completed. /// public override bool HasCompleted => _hasCompleted; + /// + /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). + /// + public override bool HasValue => _firstPage != null; + + /// Provides communication with the Text Analytics Azure Cognitive Service through its REST API. + private readonly TextAnalyticsRestClient _serviceClient; + + /// Provides tools for exception creation in case of failure. + private readonly ClientDiagnostics _diagnostics; + + /// true if the long-running operation has completed. Otherwise, false. + private bool _hasCompleted; + + private TextAnalyticsOperationStatus _status; + private RequestFailedException _requestFailedException; - /// The last HTTP response received from the server. null until the first response is received. private Response _response; - /// The result of the long-running operation. null until result is received on status update. - private AnalyzeHealthcareEntitiesResultCollection _value; + private Page _firstPage; - private int? _top { get; } - private int? _skip { get; } - private bool? _showStats { get; } + private readonly bool? _showStats; + + private readonly string _apiVersion; /// - /// Returns true if the long-running operation completed successfully and has produced final result (accessible by Value property). + /// Provides the input to be part of AnalyzeHealthcareEntitiesOperation class /// - public override bool HasValue => _value != null; + internal readonly IDictionary _idToIndexMap; /// /// Initializes a new instance of the class. @@ -125,18 +104,16 @@ public AnalyzeHealthcareEntitiesOperation(string operationId, TextAnalyticsClien /// /// The client for communicating with the Text Analytics Azure Cognitive Service through its REST API. /// The client diagnostics for exception creation in case of failure. + /// The specific api version to use. /// The address of the long-running operation. It can be obtained from the response headers upon starting the operation. /// - /// - /// /// - internal AnalyzeHealthcareEntitiesOperation(TextAnalyticsRestClient serviceClient, ClientDiagnostics diagnostics, string operationLocation, IDictionary idToIndexMap, int? top = default, int? skip = default, bool? showStats = default) + internal AnalyzeHealthcareEntitiesOperation(TextAnalyticsRestClient serviceClient, ClientDiagnostics diagnostics, string apiversion, string operationLocation, IDictionary idToIndexMap, bool? showStats = default) { _serviceClient = serviceClient; _diagnostics = diagnostics; + _apiVersion = apiversion; _idToIndexMap = idToIndexMap; - _top = top; - _skip = skip; _showStats = showStats; // TODO: Add validation here @@ -184,7 +161,7 @@ public override async ValueTask UpdateStatusAsync(CancellationToken ca /// /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + public override ValueTask>> WaitForCompletionAsync(CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(cancellationToken); /// @@ -200,7 +177,7 @@ public override ValueTask> W /// /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => + public override ValueTask>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); /// @@ -219,27 +196,27 @@ private async ValueTask UpdateStatusAsync(bool async, CancellationToke try { Response update = async - ? await _serviceClient.HealthStatusAsync(new Guid(Id), _top, _skip, _showStats, cancellationToken).ConfigureAwait(false) - : _serviceClient.HealthStatus(new Guid(Id), _top, _skip, _showStats, cancellationToken); + ? await _serviceClient.HealthStatusAsync(new Guid(Id), null, null, _showStats, cancellationToken).ConfigureAwait(false) + : _serviceClient.HealthStatus(new Guid(Id), null, null, _showStats, cancellationToken); _response = update.GetRawResponse(); _status = update.Value.Status; - if (update.Value.Status == TextAnalyticsOperationStatus.Succeeded) + if (_status == TextAnalyticsOperationStatus.Succeeded) { - // we need to first assign a vaue and then mark the operation as completed to avoid race conditions - _value = Transforms.ConvertToRecognizeHealthcareEntitiesResultCollection(update.Value.Results, _idToIndexMap); - NextLink = update.Value.NextLink; + var nextLink = update.Value.NextLink; + var value = Transforms.ConvertToRecognizeHealthcareEntitiesResultCollection(update.Value.Results, _idToIndexMap); + _firstPage = Page.FromValues(new List() { value }, nextLink, _response); _hasCompleted = true; } - else if (update.Value.Status == TextAnalyticsOperationStatus.Failed) + else if (_status == TextAnalyticsOperationStatus.Failed) { _requestFailedException = await ClientCommon.CreateExceptionForFailedOperationAsync(async, _diagnostics, _response, update.Value.Errors) .ConfigureAwait(false); _hasCompleted = true; throw _requestFailedException; } - else if (update.Value.Status == TextAnalyticsOperationStatus.Cancelled) + else if (_status == TextAnalyticsOperationStatus.Cancelled) { _requestFailedException = new RequestFailedException("The operation was canceled so no value is available."); _hasCompleted = true; @@ -297,5 +274,69 @@ public virtual async Task CancelAsync(CancellationToken cancellationToken = defa throw; } } + + /// + /// Gets the final result of the long-running operation in an asynchronous way. + /// + /// + /// Operation must complete successfully (HasValue is true) for it to provide values. + /// + public override AsyncPageable GetValuesAsync() + { + if (!HasCompleted) + throw new InvalidOperationException("The operation has not completed yet."); + if (HasCompleted && !HasValue) + throw _requestFailedException; + + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + //diagnostics scope? + try + { + Response jobState = await _serviceClient.HealthStatusNextPageAsync(_apiVersion, nextLink, _showStats).ConfigureAwait(false); + + AnalyzeHealthcareEntitiesResultCollection result = Transforms.ConvertToRecognizeHealthcareEntitiesResultCollection(jobState.Value.Results, _idToIndexMap); + return Page.FromValues(new List() { result }, jobState.Value.NextLink, jobState.GetRawResponse()); + } + catch (Exception) + { + throw; + } + } + + return PageableHelpers.CreateAsyncEnumerable(_ => Task.FromResult(_firstPage), NextPageFunc); + } + + /// + /// Gets the final result of the long-running operation in an asynchronous way. + /// + /// + /// Operation must complete successfully (HasValue is true) for it to provide values. + /// + public override Pageable GetValues() + { + if (!HasCompleted) + throw new InvalidOperationException("The operation has not completed yet."); + if (HasCompleted && !HasValue) + throw _requestFailedException; + + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + //diagnostics scope? + try + { + Response jobState = _serviceClient.HealthStatusNextPage(_apiVersion, nextLink, _showStats); + + AnalyzeHealthcareEntitiesResultCollection result = Transforms.ConvertToRecognizeHealthcareEntitiesResultCollection(jobState.Value.Results, _idToIndexMap); + return Page.FromValues(new List() { result }, jobState.Value.NextLink, jobState.GetRawResponse()); + } + catch (Exception) + { + throw; + } + } + + return PageableHelpers.CreateEnumerable(_ => _firstPage, NextPageFunc); + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOptions.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOptions.cs index 8631d868a3746..3d20938d63318 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOptions.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesOptions.cs @@ -16,15 +16,5 @@ public class AnalyzeHealthcareEntitiesOptions : TextAnalyticsRequestOptions public AnalyzeHealthcareEntitiesOptions() { } - - /// - /// The first top documents from the result. - /// - public int? Top { get; set; } - - /// - /// The skipped documents from the result. The Skip is called first when used with Top. - /// - public int? Skip { get; set; } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/HealthcareEntity.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/HealthcareEntity.cs index b437e21f47e2c..a3fe3bf2eed7c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/HealthcareEntity.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/HealthcareEntity.cs @@ -17,6 +17,7 @@ internal HealthcareEntity(HealthcareEntityInternal entity) SubCategory = entity.Subcategory; ConfidenceScore = entity.ConfidenceScore; Offset = entity.Offset; + Length = entity.Length; DataSources = entity.Links; RelatedEntities = new Dictionary(entity.RelatedEntities); } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs new file mode 100644 index 0000000000000..3ad71e40a813f --- /dev/null +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PageableOperation.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ComponentModel; + +#nullable enable + +namespace Azure.AI.TextAnalytics +{ + /// + /// Represents a pageable long-running operation that exposes the results + /// in either synchronous or asynchronous format. + /// + /// + public abstract class PageableOperation : Operation> where T : notnull + { + /// + /// Gets the final result of the long-running operation in a synchronous way. + /// + /// + /// This property can be accessed only after the operation completes successfully (HasValue is true). + /// + public override AsyncPageable Value => GetValuesAsync(); + + /// + /// Gets the final result of the long-running operation in an asynchronous way. + /// + /// + /// Operation must complete successfully (HasValue is true) for it to provide values. + /// + public abstract AsyncPageable GetValuesAsync(); + + /// + /// Gets the final result of the long-running operation in an asynchronous way. + /// + /// + /// Operation must complete successfully (HasValue is true) for it to provide values. + /// + public abstract Pageable GetValues(); + } +} diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs index 83a939d3d3283..bc4e162e2a11b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs @@ -2206,7 +2206,7 @@ private AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities(MultiL var _idToIndexMap = CreateIdToIndexMap(batchInput.Documents); - return new AnalyzeHealthcareEntitiesOperation(_serviceRestClient, _clientDiagnostics, location, _idToIndexMap, options.Top, options.Skip, options.IncludeStatistics); + return new AnalyzeHealthcareEntitiesOperation(_serviceRestClient, _clientDiagnostics, _options.GetVersionString(), location, _idToIndexMap, options.IncludeStatistics); } catch (Exception e) { @@ -2229,7 +2229,7 @@ private async Task StartAnalyzeHealthcareEnt var _idToIndexMap = CreateIdToIndexMap(batchInput.Documents); - return new AnalyzeHealthcareEntitiesOperation(_serviceRestClient, _clientDiagnostics, location, _idToIndexMap, options.Top, options.Skip, options.IncludeStatistics); + return new AnalyzeHealthcareEntitiesOperation(_serviceRestClient, _clientDiagnostics, _options.GetVersionString(), location, _idToIndexMap, options.IncludeStatistics); } catch (Exception e) { @@ -2238,100 +2238,6 @@ private async Task StartAnalyzeHealthcareEnt } } - /// - /// Gets collection of healthcare entities from the HealthOperation using async pageable. - /// - /// Healthcare operation class object which is returned when operation is started. - /// A controlling the request lifetime. - /// A collection of items. - public virtual AsyncPageable GetHealthcareEntities(AnalyzeHealthcareEntitiesOperation operation, CancellationToken cancellationToken = default) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(TextAnalyticsClient)}.{nameof(GetHealthcareEntities)}"); - scope.Start(); - - try - { - Response response = await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - - AnalyzeHealthcareEntitiesResultCollection result = operation.Value; - return Page.FromValues(result.AsEnumerable(), operation.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) - { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(TextAnalyticsClient)}.{nameof(GetHealthcareEntities)}"); - scope.Start(); - - try - { - int top = default; - int skip = default; - bool showStats = default; - - // Extracting Job ID and parameters from the URL. - // TODO - Update with Regex for cleaner implementation - // nextLink - https://cognitiveusw2dev.azure-api.net/text/analytics/v3.1-preview.3/entities/health/jobs/8002878d-2e43-4675-ad20-455fe004641b?$skip=20&$top=0&showStats=true - - string[] nextLinkSplit = nextLink.Split('/'); - // nextLinkSplit = [ 'https:', '', 'cognitiveusw2dev.azure-api.net', 'text', ..., '8002878d-2e43-4675-ad20-455fe004641b?$skip=20&$top=0'] - - string[] jobIdParams = nextLinkSplit.Last().Split('?'); - // jobIdParams = ['8002878d-2e43-4675-ad20-455fe004641b', '$skip=20&$top=0'] - - if (jobIdParams.Length != 2) - { - throw new InvalidOperationException($"Failed to parse element reference: {nextLink}"); - } - - // The Id for the Job i.e. the first index of the list - string jobId = jobIdParams[0]; - // '8002878d-2e43-4675-ad20-455fe004641b' - - // Extracting Top and Skip parameter values - string[] parameters = jobIdParams[1].Split('&'); - // '$skip=20', '$top=0', 'showStats=true' - - foreach (string paramater in parameters) - { - if (paramater.Contains("top")) - { - _ = int.TryParse(paramater.Split('=')[1], out top); - // 0 - } - if (paramater.Contains("skip")) - { - _ = int.TryParse(paramater.Split('=')[1], out skip); - // 20 - } - if (paramater.Contains("showStats")) - { - _ = bool.TryParse(paramater.Split('=')[1], out showStats); - // 20 - } - } - - Response jobState = await _serviceRestClient.HealthStatusAsync(new Guid(jobId), top, skip, showStats, cancellationToken).ConfigureAwait(false); - - AnalyzeHealthcareEntitiesResultCollection result = Transforms.ConvertToRecognizeHealthcareEntitiesResultCollection(jobState.Value.Results, operation._idToIndexMap); - return Page.FromValues(result.AsEnumerable(), jobState.Value.NextLink, jobState.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); - } - #endregion #region Analyze Operation diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs new file mode 100644 index 0000000000000..dec97d7dc0702 --- /dev/null +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsRestClient.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.AI.TextAnalytics.Models; +using Azure.Core; + +namespace Azure.AI.TextAnalytics +{ + internal partial class TextAnalyticsRestClient + { + private HttpMessage CreateHealthStatusNextPageRequest(string apiversion, string nextLink, bool? showStats) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendRaw("/text/analytics/", false); + uri.AppendRaw(apiversion, false); + uri.AppendRawNextLink(nextLink, false); + if (showStats != null) + { + uri.AppendQuery("showStats", showStats.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json, text/json"); + return message; + } + + /// Get details of the healthcare prediction job specified by the jobId. + /// The specific api version to use. + /// The URL to the next page of results. + /// (Optional) if set to true, response will contain request and document level statistics. + /// The cancellation token to use. + public async Task> HealthStatusNextPageAsync(string apiversion, string nextLink, bool? showStats = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateHealthStatusNextPageRequest(apiversion, nextLink, showStats); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HealthcareJobState value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HealthcareJobState.DeserializeHealthcareJobState(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Get details of the healthcare prediction job specified by the jobId. + /// The specific api version to use. + /// The URL to the next page of results. + /// (Optional) if set to true, response will contain request and document level statistics. + /// The cancellation token to use. + public Response HealthStatusNextPage(string apiversion, string nextLink, bool? showStats = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateHealthStatusNextPageRequest(apiversion, nextLink, showStats); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HealthcareJobState value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HealthcareJobState.DeserializeHealthcareJobState(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeHealthcareEntitiesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeHealthcareEntitiesTests.cs index 1bceb4cf2daa8..ecb134ef3328c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeHealthcareEntitiesTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeHealthcareEntitiesTests.cs @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Azure.Core.TestFramework; using NUnit.Framework; namespace Azure.AI.TextAnalytics.Tests @@ -12,15 +14,13 @@ public class RecognizeHealthcareEntitiesTests : TextAnalyticsClientLiveTestBase { public RecognizeHealthcareEntitiesTests(bool isAsync) : base(isAsync) { } - private const string singleEnglish = "Subject is taking 100mg of ibuprofen twice daily"; - - private static List batchConvenienceDocuments = new List + private static List s_batchConvenienceDocuments = new List { "Subject is taking 100mg of ibuprofen twice daily", "Can cause rapid or irregular heartbeat, delirium, panic, psychosis, and heart failure." }; - private static List batchDocuments = new List + private static List s_batchDocuments = new List { new TextDocumentInput("1", "Subject is taking 100mg of ibuprofen twice daily") { @@ -32,30 +32,48 @@ public RecognizeHealthcareEntitiesTests(bool isAsync) : base(isAsync) { } } }; + private static readonly List s_document1ExpectedEntitiesOutput = new List + { + "ibuprofen", + "100mg", + "twice daily" + }; + + private static readonly List s_document2ExpectedEntitiesOutput = new List + { + "rapid", + "irregular heartbeat", + "delirium", + "panic", + "psychosis", + "heart failure" + }; + [Test] public async Task RecognizeHealthcareEntitiesTest() { TextAnalyticsClient client = GetClient(); - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(batchDocuments); + AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments); await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; - - Assert.AreEqual(2, resultCollection.Count); + List resultInPages = operation.Value.ToEnumerableAsync().Result; + Assert.AreEqual(1, resultInPages.Count); - AnalyzeHealthcareEntitiesResult result = resultCollection[0]; + //Take the first page + var resultCollection = resultInPages.FirstOrDefault(); + Assert.AreEqual(s_batchDocuments.Count, resultCollection.Count); - var entitiesList = new List { "100mg", "ibuprofen", "twice daily" }; + AnalyzeHealthcareEntitiesResult result1 = resultCollection[0]; - Assert.AreEqual(3, result.Entities.Count); - Assert.IsNotNull(result.Id); - Assert.AreEqual("1", result.Id); + Assert.AreEqual(s_document1ExpectedEntitiesOutput.Count, result1.Entities.Count); + Assert.IsNotNull(result1.Id); + Assert.AreEqual("1", result1.Id); - foreach (HealthcareEntity entity in result.Entities) + foreach (HealthcareEntity entity in result1.Entities) { - Assert.IsTrue(entitiesList.Contains(entity.Text)); + Assert.IsTrue(s_document1ExpectedEntitiesOutput.Contains(entity.Text)); if (entity.Text == "ibuprofen") { @@ -73,7 +91,7 @@ public async Task RecognizeHealthcareEntitiesTest() Assert.AreEqual("ibuprofen", relatedEntity.Text); Assert.AreEqual("MedicationName", relatedEntity.Category); - Assert.AreEqual(0, relatedEntity.Length); + Assert.AreEqual(9, relatedEntity.Length); Assert.AreEqual(27, relatedEntity.Offset); Assert.AreEqual(1.0, relatedEntity.ConfidenceScore); @@ -87,69 +105,21 @@ public async Task RecognizeHealthcareEntitiesTest() public async Task RecognizeHealthcareEntitiesWithLanguageTest() { TextAnalyticsClient client = GetClient(); - string document = singleEnglish; - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(new List() { document }, "en"); + AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchConvenienceDocuments, "en"); await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; + //Take the first page + AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); - foreach (AnalyzeHealthcareEntitiesResult result in resultCollection) + var expectedOutput = new Dictionary>() { - Assert.AreEqual(3, result.Entities.Count); - Assert.IsNotNull(result.Id); - } - } - - [Test] - public async Task RecognizeHealthcareEntitiesWithTopParameter() - { - TextAnalyticsClient client = GetClient(); - - AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() - { - Top = 1 + { "0", s_document1ExpectedEntitiesOutput }, + { "1", s_document2ExpectedEntitiesOutput }, }; - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(batchDocuments, options); - - await operation.WaitForCompletionAsync(PollingInterval); - - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; - - Assert.AreEqual(1, resultCollection.Count); - Assert.AreEqual(3, resultCollection[0].Entities.Count); - Assert.IsNotNull(resultCollection[0].Id); - Assert.AreEqual("1", resultCollection[0].Id); - Assert.AreEqual("100mg", resultCollection[0].Entities.FirstOrDefault().Text); - Assert.AreEqual("Dosage", resultCollection[0].Entities.FirstOrDefault().Category); - } - - [Test] - public async Task RecognizeHealthcareEntitiesWithSkipParameter() - { - TextAnalyticsClient client = GetClient(); - - AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() - { - Skip = 1 - }; - - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(batchDocuments, options); - - await operation.WaitForCompletionAsync(PollingInterval); - - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; - - Assert.IsFalse(resultCollection[0].HasError); - Assert.IsNotNull(resultCollection[0].Warnings); - Assert.AreEqual(1, resultCollection.Count); - Assert.AreEqual(6, resultCollection[0].Entities.Count); - Assert.IsNotNull(resultCollection[0].Id); - Assert.AreEqual("2", resultCollection[0].Id); - Assert.AreEqual("rapid", resultCollection[0].Entities.FirstOrDefault().Text); - Assert.AreEqual("SymptomOrSign", resultCollection[0].Entities.FirstOrDefault().Category); + ValidateBatchDocumentsResult(resultCollection, expectedOutput); } [Test] @@ -167,11 +137,16 @@ public async Task RecognizeHealthcareEntitiesBatchWithErrorTest() await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; + //Take the first page + AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); Assert.IsNotNull(resultCollection[2].Id); + Assert.IsTrue(!resultCollection[0].HasError); + Assert.IsTrue(!resultCollection[1].HasError); + Assert.IsTrue(resultCollection[2].HasError); + InvalidOperationException ex = Assert.Throws(() => resultCollection[2].Entities.GetType()); Assert.AreEqual(TextAnalyticsErrorCode.InvalidDocument, resultCollection[2].Error.ErrorCode.ToString()); } @@ -179,83 +154,94 @@ public async Task RecognizeHealthcareEntitiesBatchWithErrorTest() public async Task RecognizeHealthcareEntitiesBatchConvenienceTest() { TextAnalyticsClient client = GetClient(); - var documents = batchConvenienceDocuments; - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(documents); + AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchConvenienceDocuments); await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; + //Take the first page + AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); - Assert.AreEqual(2, resultCollection.Count); + var expectedOutput = new Dictionary>() + { + { "0", s_document1ExpectedEntitiesOutput }, + { "1", s_document2ExpectedEntitiesOutput }, + }; + + ValidateBatchDocumentsResult(resultCollection, expectedOutput); } [Test] public async Task RecognizeHealthcareEntitiesBatchConvenienceWithStatisticsTest() { TextAnalyticsClient client = GetClient(); - var documents = batchConvenienceDocuments; AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() { IncludeStatistics = true }; - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(documents, "en", options); + AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchConvenienceDocuments, "en", options); await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; - - Assert.AreEqual(documents.Count, resultCollection.Statistics.DocumentCount); + //Take the first page + AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); - Assert.AreEqual(48, resultCollection[0].Statistics.CharacterCount); - Assert.AreEqual(1, resultCollection[0].Statistics.TransactionCount); + var expectedOutput = new Dictionary>() + { + { "0", s_document1ExpectedEntitiesOutput }, + { "1", s_document2ExpectedEntitiesOutput }, + }; - Assert.Greater(resultCollection.Statistics.DocumentCount, 0); - Assert.AreEqual(2, resultCollection.Statistics.DocumentCount); - Assert.AreEqual(2, resultCollection.Statistics.TransactionCount); - Assert.AreEqual(0, resultCollection.Statistics.InvalidDocumentCount); - Assert.AreEqual(2, resultCollection.Statistics.ValidDocumentCount); + ValidateBatchDocumentsResult(resultCollection, expectedOutput, true); } [Test] public async Task RecognizeHealthcareEntitiesBatchTest() { TextAnalyticsClient client = GetClient(); - List documents = batchDocuments; - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(documents); + AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments); await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; + //Take the first page + AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); + + var expectedOutput = new Dictionary>() + { + { "1", s_document1ExpectedEntitiesOutput }, + { "2", s_document2ExpectedEntitiesOutput }, + }; - Assert.AreEqual(2, resultCollection.Count); + ValidateBatchDocumentsResult(resultCollection, expectedOutput); } [Test] public async Task RecognizeHealthcareEntitiesBatchWithStatisticsTest() { TextAnalyticsClient client = GetClient(); - var documents = batchDocuments; AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() { IncludeStatistics = true }; - AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(documents, options); + AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments, options); await operation.WaitForCompletionAsync(PollingInterval); - AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value; + //Take the first page + AnalyzeHealthcareEntitiesResultCollection resultCollection = operation.Value.ToEnumerableAsync().Result.FirstOrDefault(); - Assert.AreEqual(2, resultCollection.Count); + var expectedOutput = new Dictionary>() + { + { "1", s_document1ExpectedEntitiesOutput }, + { "2", s_document2ExpectedEntitiesOutput }, + }; - Assert.AreEqual(2, resultCollection.Statistics.DocumentCount); - Assert.AreEqual(2, resultCollection.Statistics.TransactionCount); - Assert.AreEqual(0, resultCollection.Statistics.InvalidDocumentCount); + ValidateBatchDocumentsResult(resultCollection, expectedOutput, true); } [Test] @@ -275,7 +261,7 @@ public async Task RecognizeHealthcareEntitiesBatchWithCancellation() await operation.CancelAsync(); - RequestFailedException ex = Assert.ThrowsAsync(async() => await operation.WaitForCompletionAsync()); + RequestFailedException ex = Assert.ThrowsAsync(async () => await operation.WaitForCompletionAsync()); Assert.IsTrue(ex.Message.Contains("The operation was canceled so no value is available.")); Assert.IsTrue(operation.HasCompleted); @@ -294,34 +280,97 @@ public async Task RecognizeHealthcareEntitiesBatchWithCancellation() } [Test] - public async Task RecognizeHealthcareEntitiesBatchWithPagination() + public async Task AnalyzeHealthcareEntitiesPagination() { TextAnalyticsClient client = GetClient(); - string document = @"RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE."; - var list = new List(); + AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments); - for (int i = 0; i < 10; i++) - { - list.Add(document); - }; + Assert.IsFalse(operation.HasCompleted); + Assert.IsFalse(operation.HasValue); - AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() - { - Top = 2 - }; + Assert.ThrowsAsync(async () => await Task.Run(() => operation.Value)); + Assert.Throws(() => operation.GetValues()); + + await operation.WaitForCompletionAsync(PollingInterval); + + Assert.IsTrue(operation.HasCompleted); + Assert.IsTrue(operation.HasValue); + + // try async + //There most be 1 page + List asyncPages = operation.Value.ToEnumerableAsync().Result; + Assert.AreEqual(1, asyncPages.Count); + + // First page should have 2 results + Assert.AreEqual(2, asyncPages[0].Count); - AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartAnalyzeHealthcareEntitiesAsync(list, "en", options); + // try sync + //There most be 1 page + List pages = operation.GetValues().AsEnumerable().ToList(); + Assert.AreEqual(1, pages.Count); - AsyncPageable results = client.GetHealthcareEntities(healthOperation); + // First page should have 2 results + Assert.AreEqual(2, pages[0].Count); + } + + private void ValidateInDocumenResult(IReadOnlyCollection entities, List minimumExpectedOutput) + { + Assert.GreaterOrEqual(entities.Count, minimumExpectedOutput.Count); + foreach (HealthcareEntity entity in entities) + { + Assert.That(entity.Text, Is.Not.Null.And.Not.Empty); + Assert.IsTrue(minimumExpectedOutput.Contains(entity.Text, StringComparer.OrdinalIgnoreCase)); + Assert.IsNotNull(entity.Category); + Assert.GreaterOrEqual(entity.ConfidenceScore, 0.0); + Assert.GreaterOrEqual(entity.Offset, 0); + Assert.Greater(entity.Length, 0); + + if (entity.SubCategory != null) + { + Assert.IsNotEmpty(entity.SubCategory); + } + } + } + + private void ValidateBatchDocumentsResult(AnalyzeHealthcareEntitiesResultCollection results, Dictionary> minimumExpectedOutput, bool includeStatistics = default) + { + Assert.That(results.ModelVersion, Is.Not.Null.And.Not.Empty); - int resultCount = 0; - await foreach (AnalyzeHealthcareEntitiesResult result in results) + if (includeStatistics) { - resultCount += 1; + Assert.IsNotNull(results.Statistics); + Assert.Greater(results.Statistics.DocumentCount, 0); + Assert.Greater(results.Statistics.TransactionCount, 0); + Assert.GreaterOrEqual(results.Statistics.InvalidDocumentCount, 0); + Assert.GreaterOrEqual(results.Statistics.ValidDocumentCount, 0); } + else + Assert.IsNull(results.Statistics); - Assert.AreEqual(10, resultCount); + foreach (AnalyzeHealthcareEntitiesResult entitiesInDocument in results) + { + Assert.That(entitiesInDocument.Id, Is.Not.Null.And.Not.Empty); + + Assert.False(entitiesInDocument.HasError); + + //Even though statistics are not asked for, TA 5.0.0 shipped with Statistics default always present. + Assert.IsNotNull(entitiesInDocument.Statistics); + + if (includeStatistics) + { + Assert.GreaterOrEqual(entitiesInDocument.Statistics.CharacterCount, 0); + Assert.Greater(entitiesInDocument.Statistics.TransactionCount, 0); + } + else + { + Assert.AreEqual(0, entitiesInDocument.Statistics.CharacterCount); + Assert.AreEqual(0, entitiesInDocument.Statistics.TransactionCount); + } + + Assert.IsNotNull(entitiesInDocument.Warnings); + ValidateInDocumenResult(entitiesInDocument.Entities, minimumExpectedOutput[entitiesInDocument.Id]); + } } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithSkipParameterAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/AnalyzeHealthcareEntitiesPagination.json similarity index 75% rename from sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithSkipParameterAsync.json rename to sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/AnalyzeHealthcareEntitiesPagination.json index 2c80aee94c676..2810cd2a1b9e6 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithSkipParameterAsync.json +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/AnalyzeHealthcareEntitiesPagination.json @@ -1,22 +1,16 @@ { "Entries": [ { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", "RequestMethod": "POST", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Content-Length": "223", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-51417cebb732f041aae3fd6629760b9f-b532a00a7940684b-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "9e757d2d83ce1123a7e23fad5376473f", + "traceparent": "00-e3af461b36c97145930bd94dbd5fa5c9-2ec6d924443a7f45-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210203.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "d518e71fb8bbde791a4a8e2d519abd2d", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -35,124 +29,272 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "0e245385-bf5f-4786-af97-619eaf455fcf", - "Date": "Tue, 17 Nov 2020 20:18:03 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/8da09cb2-5c3b-4082-857e-e6e042c74ebc", + "apim-request-id": "770a9381-3640-4870-9add-d2926d065f1d", + "Date": "Wed, 03 Feb 2021 19:13:54 GMT", + "operation-location": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/738f5bcd-edbe-4dad-8e85-92d4857e1942", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "92" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "118" }, "ResponseBody": [] }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/8da09cb2-5c3b-4082-857e-e6e042c74ebc?$skip=1\u0026showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/738f5bcd-edbe-4dad-8e85-92d4857e1942?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "68a7733fd31f0864ffb638781102da48", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210203.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "15392559dddf00be7c02b37db1655d5f", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "eb516f73-1c8e-4292-91f9-12a4ecae291d", + "apim-request-id": "a15bd8f8-a225-4cee-9ac9-01f55330f02a", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:18:03 GMT", + "Date": "Wed, 03 Feb 2021 19:13:54 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "9" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "11" }, "ResponseBody": { - "jobId": "8da09cb2-5c3b-4082-857e-e6e042c74ebc", - "lastUpdateDateTime": "2020-11-17T20:18:03Z", - "createdDateTime": "2020-11-17T20:18:03Z", - "expirationDateTime": "2020-11-18T20:18:03Z", + "jobId": "738f5bcd-edbe-4dad-8e85-92d4857e1942", + "lastUpdateDateTime": "2021-02-03T19:13:55Z", + "createdDateTime": "2021-02-03T19:13:55Z", + "expirationDateTime": "2021-02-04T19:13:55Z", "status": "notStarted", "errors": [] } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/8da09cb2-5c3b-4082-857e-e6e042c74ebc?$skip=1\u0026showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/738f5bcd-edbe-4dad-8e85-92d4857e1942?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "39eac04aaed6996e7ea6b9f62c4a8897", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210203.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "8fbb3015ae7667cee796b09df47c3a1a", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "875d762e-fd4e-48ac-b3a9-cbb909786f25", + "apim-request-id": "3e9a1f03-7818-4687-b276-8dbaa281b90a", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:18:04 GMT", + "Date": "Wed, 03 Feb 2021 19:13:56 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "8" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "10" }, "ResponseBody": { - "jobId": "8da09cb2-5c3b-4082-857e-e6e042c74ebc", - "lastUpdateDateTime": "2020-11-17T20:18:03Z", - "createdDateTime": "2020-11-17T20:18:03Z", - "expirationDateTime": "2020-11-18T20:18:03Z", - "status": "notStarted", + "jobId": "738f5bcd-edbe-4dad-8e85-92d4857e1942", + "lastUpdateDateTime": "2021-02-03T19:13:56Z", + "createdDateTime": "2021-02-03T19:13:55Z", + "expirationDateTime": "2021-02-04T19:13:55Z", + "status": "running", "errors": [] } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/8da09cb2-5c3b-4082-857e-e6e042c74ebc?$skip=1\u0026showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/738f5bcd-edbe-4dad-8e85-92d4857e1942?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "eaa1ba814c8b59b1196c9f174baaffa5", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210203.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "9ca689c8d08e41aa291759b905fb2cb5", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "0a8a7b59-8aec-4d64-9072-9e8963ba9816", + "apim-request-id": "eaf750ef-0383-4e0e-8a50-615a6bd37b91", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:18:05 GMT", + "Date": "Wed, 03 Feb 2021 19:13:57 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "49" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "804" }, "ResponseBody": { - "jobId": "8da09cb2-5c3b-4082-857e-e6e042c74ebc", - "lastUpdateDateTime": "2020-11-17T20:18:05Z", - "createdDateTime": "2020-11-17T20:18:03Z", - "expirationDateTime": "2020-11-18T20:18:03Z", + "jobId": "738f5bcd-edbe-4dad-8e85-92d4857e1942", + "lastUpdateDateTime": "2021-02-03T19:13:57Z", + "createdDateTime": "2021-02-03T19:13:55Z", + "expirationDateTime": "2021-02-04T19:13:55Z", "status": "succeeded", "errors": [], "results": { "documents": [ + { + "id": "1", + "entities": [ + { + "offset": 18, + "length": 5, + "text": "100mg", + "category": "Dosage", + "confidenceScore": 1.0, + "isNegated": false + }, + { + "offset": 27, + "length": 9, + "text": "ibuprofen", + "category": "MedicationName", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0020740" + }, + { + "dataSource": "AOD", + "id": "0000019879" + }, + { + "dataSource": "ATC", + "id": "M01AE01" + }, + { + "dataSource": "CCPSS", + "id": "0046165" + }, + { + "dataSource": "CHV", + "id": "0000006519" + }, + { + "dataSource": "CSP", + "id": "2270-2077" + }, + { + "dataSource": "DRUGBANK", + "id": "DB01050" + }, + { + "dataSource": "GS", + "id": "1611" + }, + { + "dataSource": "LCH_NW", + "id": "sh97005926" + }, + { + "dataSource": "LNC", + "id": "LP16165-0" + }, + { + "dataSource": "MEDCIN", + "id": "40458" + }, + { + "dataSource": "MMSL", + "id": "d00015" + }, + { + "dataSource": "MSH", + "id": "D007052" + }, + { + "dataSource": "MTHSPL", + "id": "WK2XYI10QM" + }, + { + "dataSource": "NCI", + "id": "C561" + }, + { + "dataSource": "NCI_CTRP", + "id": "C561" + }, + { + "dataSource": "NCI_DCP", + "id": "00803" + }, + { + "dataSource": "NCI_DTP", + "id": "NSC0256857" + }, + { + "dataSource": "NCI_FDA", + "id": "WK2XYI10QM" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000613511" + }, + { + "dataSource": "NDDF", + "id": "002377" + }, + { + "dataSource": "PDQ", + "id": "CDR0000040475" + }, + { + "dataSource": "RCD", + "id": "x02MO" + }, + { + "dataSource": "RXNORM", + "id": "5640" + }, + { + "dataSource": "SNM", + "id": "E-7772" + }, + { + "dataSource": "SNMI", + "id": "C-603C0" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "387207008" + }, + { + "dataSource": "USP", + "id": "m39860" + }, + { + "dataSource": "USPMG", + "id": "MTHU000060" + }, + { + "dataSource": "VANDF", + "id": "4017840" + } + ] + }, + { + "offset": 37, + "length": 11, + "text": "twice daily", + "category": "Frequency", + "confidenceScore": 1.0, + "isNegated": false + } + ], + "relations": [ + { + "relationType": "DosageOfMedication", + "bidirectional": false, + "source": "#/results/documents/0/entities/0", + "target": "#/results/documents/0/entities/1" + }, + { + "relationType": "FrequencyOfMedication", + "bidirectional": false, + "source": "#/results/documents/0/entities/2", + "target": "#/results/documents/0/entities/1" + } + ], + "warnings": [] + }, { "id": "2", "entities": [ @@ -944,8 +1086,8 @@ } ], "Variables": { - "RandomSeed": "448859439", + "RandomSeed": "21962335", "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" + "TEXT_ANALYTICS_ENDPOINT": "https://mariari-westus2-s.cognitiveservices.azure.com/" } } \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithSkipParameter.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/AnalyzeHealthcareEntitiesPaginationAsync.json similarity index 77% rename from sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithSkipParameter.json rename to sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/AnalyzeHealthcareEntitiesPaginationAsync.json index ce04a1b3075ab..34fd94d0b00b7 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithSkipParameter.json +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/AnalyzeHealthcareEntitiesPaginationAsync.json @@ -1,22 +1,16 @@ { "Entries": [ { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", "RequestMethod": "POST", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Content-Length": "223", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-835ca07a1f6c854d90cee53817174c75-7c84577713198947-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "e5bbee521fd95f6f85d46045340cc5e0", + "traceparent": "00-30e8538acb411a4d9c64a91af0d3ea35-7b57f25b4ee32544-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210203.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "fbbc5786a282c64df8d358b9cc278a4d", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -35,88 +29,242 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "899e90f1-f7e4-4661-8987-c7b513bfb215", - "Date": "Tue, 17 Nov 2020 20:17:39 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/ae7852a7-abb0-428f-97fa-3534f4c6be36", + "apim-request-id": "3a069025-90fd-4b56-bdbc-9046037ed6be", + "Date": "Wed, 03 Feb 2021 19:14:00 GMT", + "operation-location": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/9abafb97-01eb-4077-bc11-fef995cf1831", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "93" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "1491" }, "ResponseBody": [] }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/ae7852a7-abb0-428f-97fa-3534f4c6be36?$skip=1\u0026showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/9abafb97-01eb-4077-bc11-fef995cf1831?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "cb3ef020b17077b8ee6ec139b3f21813", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210203.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "bbeac74cd30307fda0d67684218a1c72", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "d2ef618d-aebd-4a4a-a655-1fa52e190d1c", + "apim-request-id": "ea4533ee-e4b3-4e22-8de6-90cece45b8ae", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:39 GMT", + "Date": "Wed, 03 Feb 2021 19:14:00 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "8" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "12" }, "ResponseBody": { - "jobId": "ae7852a7-abb0-428f-97fa-3534f4c6be36", - "lastUpdateDateTime": "2020-11-17T20:17:39Z", - "createdDateTime": "2020-11-17T20:17:39Z", - "expirationDateTime": "2020-11-18T20:17:39Z", + "jobId": "9abafb97-01eb-4077-bc11-fef995cf1831", + "lastUpdateDateTime": "2021-02-03T19:14:01Z", + "createdDateTime": "2021-02-03T19:13:59Z", + "expirationDateTime": "2021-02-04T19:13:59Z", "status": "notStarted", "errors": [] } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/ae7852a7-abb0-428f-97fa-3534f4c6be36?$skip=1\u0026showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/9abafb97-01eb-4077-bc11-fef995cf1831?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "beccfc644b839adbc9a8ce8f926f328c", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210203.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "2c9581455d02f093db0efd8af829c0c9", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "a568563c-be35-4841-b7fd-8a9c8f7d0a87", + "apim-request-id": "8d11b78b-8bc8-4842-8ef2-ba09315e5b88", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:40 GMT", + "Date": "Wed, 03 Feb 2021 19:14:02 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "44" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "128" }, "ResponseBody": { - "jobId": "ae7852a7-abb0-428f-97fa-3534f4c6be36", - "lastUpdateDateTime": "2020-11-17T20:17:40Z", - "createdDateTime": "2020-11-17T20:17:39Z", - "expirationDateTime": "2020-11-18T20:17:39Z", + "jobId": "9abafb97-01eb-4077-bc11-fef995cf1831", + "lastUpdateDateTime": "2021-02-03T19:14:02Z", + "createdDateTime": "2021-02-03T19:13:59Z", + "expirationDateTime": "2021-02-04T19:13:59Z", "status": "succeeded", "errors": [], "results": { "documents": [ + { + "id": "1", + "entities": [ + { + "offset": 18, + "length": 5, + "text": "100mg", + "category": "Dosage", + "confidenceScore": 1.0, + "isNegated": false + }, + { + "offset": 27, + "length": 9, + "text": "ibuprofen", + "category": "MedicationName", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0020740" + }, + { + "dataSource": "AOD", + "id": "0000019879" + }, + { + "dataSource": "ATC", + "id": "M01AE01" + }, + { + "dataSource": "CCPSS", + "id": "0046165" + }, + { + "dataSource": "CHV", + "id": "0000006519" + }, + { + "dataSource": "CSP", + "id": "2270-2077" + }, + { + "dataSource": "DRUGBANK", + "id": "DB01050" + }, + { + "dataSource": "GS", + "id": "1611" + }, + { + "dataSource": "LCH_NW", + "id": "sh97005926" + }, + { + "dataSource": "LNC", + "id": "LP16165-0" + }, + { + "dataSource": "MEDCIN", + "id": "40458" + }, + { + "dataSource": "MMSL", + "id": "d00015" + }, + { + "dataSource": "MSH", + "id": "D007052" + }, + { + "dataSource": "MTHSPL", + "id": "WK2XYI10QM" + }, + { + "dataSource": "NCI", + "id": "C561" + }, + { + "dataSource": "NCI_CTRP", + "id": "C561" + }, + { + "dataSource": "NCI_DCP", + "id": "00803" + }, + { + "dataSource": "NCI_DTP", + "id": "NSC0256857" + }, + { + "dataSource": "NCI_FDA", + "id": "WK2XYI10QM" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000613511" + }, + { + "dataSource": "NDDF", + "id": "002377" + }, + { + "dataSource": "PDQ", + "id": "CDR0000040475" + }, + { + "dataSource": "RCD", + "id": "x02MO" + }, + { + "dataSource": "RXNORM", + "id": "5640" + }, + { + "dataSource": "SNM", + "id": "E-7772" + }, + { + "dataSource": "SNMI", + "id": "C-603C0" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "387207008" + }, + { + "dataSource": "USP", + "id": "m39860" + }, + { + "dataSource": "USPMG", + "id": "MTHU000060" + }, + { + "dataSource": "VANDF", + "id": "4017840" + } + ] + }, + { + "offset": 37, + "length": 11, + "text": "twice daily", + "category": "Frequency", + "confidenceScore": 1.0, + "isNegated": false + } + ], + "relations": [ + { + "relationType": "DosageOfMedication", + "bidirectional": false, + "source": "#/results/documents/0/entities/0", + "target": "#/results/documents/0/entities/1" + }, + { + "relationType": "FrequencyOfMedication", + "bidirectional": false, + "source": "#/results/documents/0/entities/2", + "target": "#/results/documents/0/entities/1" + } + ], + "warnings": [] + }, { "id": "2", "entities": [ @@ -908,8 +1056,8 @@ } ], "Variables": { - "RandomSeed": "900872338", + "RandomSeed": "1439010920", "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" + "TEXT_ANALYTICS_ENDPOINT": "https://mariari-westus2-s.cognitiveservices.azure.com/" } } \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPagination.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPagination.json deleted file mode 100644 index 476cf064b65b3..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPagination.json +++ /dev/null @@ -1,1616 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "1395", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-2dcca0f4273eab408841a8b945efb8d0-5f6dcf46f2900147-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "3d690e65097214462e3994d44b026896", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "documents": [ - { - "id": "0", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "1", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "2", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "3", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "4", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "5", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "6", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "7", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "8", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "9", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - } - ] - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "905323d2-0148-41fa-a03e-f6bb4f53c37c", - "Date": "Tue, 17 Nov 2020 20:17:28 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "273" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "60014c42eec829d6c5965295103c077f", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "a6efae33-03b0-46d1-9a94-b74fa7d5d6ee", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:28 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "8" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:28Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "notStarted", - "errors": [] - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "e6e71e1943fddaaba6e9191ddcfc8d38", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "dcfb1111-41bf-4280-84e8-21971e251254", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:29 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "9" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:28Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "notStarted", - "errors": [] - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "6bedcd03a2427620384078dbb7b003f2", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "c94b7d03-a988-4a47-804b-a0dabbcb2c22", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:30 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "8" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:30Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "running", - "errors": [] - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "2cba1531821bff99a027b9ded5b94dc9", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "ac799a42-e207-4727-aef3-d7d073fad944", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:31 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "61" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:31Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "0", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "1", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$skip=2\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026$skip=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "439219099c4e763dfe70aebdcbcf23f6", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "14af19a6-08b2-4e39-8461-f4b78e1a586f", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:32 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "54" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:31Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "2", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "3", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$skip=4\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026$skip=4\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "c6eb26e66141811d33eeca1ae941a17e", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "f3e26ac2-fb54-42c7-a263-858866af9316", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:32 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "53" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:31Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "4", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "5", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$skip=6\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026$skip=6\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "9dd2aef2c01e95a3d8442daad3dc33d1", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "c2b61286-ebb1-4d78-b85a-285636c499e1", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:33 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "60" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:31Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "6", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "7", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$skip=8\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/828de621-689c-4434-b72e-3caaaa60d6e5?$top=2\u0026$skip=8\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "aef8c20486cda788fc100f60d1228dbd", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "c2a0641a-233e-4fc8-b658-88403206c4f8", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:33 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "58" - }, - "ResponseBody": { - "jobId": "828de621-689c-4434-b72e-3caaaa60d6e5", - "lastUpdateDateTime": "2020-11-17T20:17:31Z", - "createdDateTime": "2020-11-17T20:17:28Z", - "expirationDateTime": "2020-11-18T20:17:28Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "8", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "9", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - } - } - } - ], - "Variables": { - "RandomSeed": "1357450788", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPaginationAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPaginationAsync.json deleted file mode 100644 index f57c7a18ba7e8..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesBatchWithPaginationAsync.json +++ /dev/null @@ -1,1544 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "1395", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-607bc0a7a208aa41810b58713abb68ea-5d1eba8ac5995640-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "f142919ab8153bebc5d9f5272ba0209d", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "documents": [ - { - "id": "0", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "1", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "2", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "3", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "4", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "5", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "6", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "7", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "8", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - }, - { - "id": "9", - "text": "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE.", - "language": "en" - } - ] - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "c5358900-0109-40ac-a4e8-78ed8190675d", - "Date": "Tue, 17 Nov 2020 20:17:53 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "220" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$top=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "abea9627e0cd843f9974ee5faa963225", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "39e48ba7-59b6-4313-a141-132a29f040ea", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:53 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "8" - }, - "ResponseBody": { - "jobId": "dcb89372-7aef-40b9-b879-409253681ed4", - "lastUpdateDateTime": "2020-11-17T20:17:53Z", - "createdDateTime": "2020-11-17T20:17:53Z", - "expirationDateTime": "2020-11-18T20:17:53Z", - "status": "running", - "errors": [] - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$top=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "29e58cf2b8b376a1d7b53c264371cd5a", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "807c4f12-8cce-4016-85f5-8cfdbd88569e", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:54 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "68" - }, - "ResponseBody": { - "jobId": "dcb89372-7aef-40b9-b879-409253681ed4", - "lastUpdateDateTime": "2020-11-17T20:17:54Z", - "createdDateTime": "2020-11-17T20:17:53Z", - "expirationDateTime": "2020-11-18T20:17:53Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "0", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "1", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$skip=2\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$top=2\u0026$skip=2\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "ebc37c63c42eb92852bd57a0ca8c902e", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "64f636d5-dfd2-46c0-9f5c-8e919242953e", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:55 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "61" - }, - "ResponseBody": { - "jobId": "dcb89372-7aef-40b9-b879-409253681ed4", - "lastUpdateDateTime": "2020-11-17T20:17:54Z", - "createdDateTime": "2020-11-17T20:17:53Z", - "expirationDateTime": "2020-11-18T20:17:53Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "2", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "3", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$skip=4\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$top=2\u0026$skip=4\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "9f34cfa6f7bb6feaf474d418a4184128", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "44cb7af7-c55e-4b02-904b-7c197939733f", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:55 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "40" - }, - "ResponseBody": { - "jobId": "dcb89372-7aef-40b9-b879-409253681ed4", - "lastUpdateDateTime": "2020-11-17T20:17:54Z", - "createdDateTime": "2020-11-17T20:17:53Z", - "expirationDateTime": "2020-11-18T20:17:53Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "4", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "5", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$skip=6\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$top=2\u0026$skip=6\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "2efb93a746d22ef7642bd7f66001ab4b", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "dda4d9ab-f0de-47ca-80fe-e086b9aaaae1", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:55 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "62" - }, - "ResponseBody": { - "jobId": "dcb89372-7aef-40b9-b879-409253681ed4", - "lastUpdateDateTime": "2020-11-17T20:17:54Z", - "createdDateTime": "2020-11-17T20:17:53Z", - "expirationDateTime": "2020-11-18T20:17:53Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "6", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "7", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$skip=8\u0026$top=2" - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/dcb89372-7aef-40b9-b879-409253681ed4?$top=2\u0026$skip=8\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "747f0d242e3c6c9f9253f6b9ef0f1539", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "599abe3b-cc45-4df6-93db-315a8247e24d", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:56 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "61" - }, - "ResponseBody": { - "jobId": "dcb89372-7aef-40b9-b879-409253681ed4", - "lastUpdateDateTime": "2020-11-17T20:17:54Z", - "createdDateTime": "2020-11-17T20:17:53Z", - "expirationDateTime": "2020-11-18T20:17:53Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "8", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - }, - { - "id": "9", - "entities": [ - { - "offset": 63, - "length": 11, - "text": "12:00:00 AM", - "category": "Time", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 77, - "length": 23, - "text": "CORONARY ARTERY DISEASE", - "category": "Diagnosis", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C1956346" - }, - { - "dataSource": "AOD", - "id": "0000005327" - }, - { - "dataSource": "BI", - "id": "BI00010" - }, - { - "dataSource": "CCPSS", - "id": "0037465" - }, - { - "dataSource": "CSP", - "id": "1393-3397" - }, - { - "dataSource": "CST", - "id": "CORONARY ART DIS" - }, - { - "dataSource": "DXP", - "id": "U000871" - }, - { - "dataSource": "HPO", - "id": "HP:0001677" - }, - { - "dataSource": "ICPC2ICD10ENG", - "id": "MTHU019520" - }, - { - "dataSource": "ICPC2P", - "id": "K76003" - }, - { - "dataSource": "LNC", - "id": "LP90122-0" - }, - { - "dataSource": "MDR", - "id": "10011078" - }, - { - "dataSource": "MEDCIN", - "id": "35988" - }, - { - "dataSource": "MEDLINEPLUS", - "id": "1276" - }, - { - "dataSource": "MSH", - "id": "D003324" - }, - { - "dataSource": "NCI", - "id": "C26732" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000439400" - }, - { - "dataSource": "OMIM", - "id": "MTHU002067" - }, - { - "dataSource": "RCD", - "id": "XE2uV" - }, - { - "dataSource": "SNMI", - "id": "D3-13000" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "414024009" - }, - { - "dataSource": "WHO", - "id": "0426" - } - ] - } - ], - "relations": [ - { - "relationType": "TimeOfCondition", - "bidirectional": false, - "source": "#/results/documents/1/entities/0", - "target": "#/results/documents/1/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - } - } - } - ], - "Variables": { - "RandomSeed": "386709158", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTest.json index 06805f2a2c6ac..fcc809a3b2a99 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTest.json +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTest.json @@ -1,21 +1,15 @@ { "Entries": [ { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", "RequestMethod": "POST", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "100", + "Accept": "application/json, text/json", + "Content-Length": "223", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-36cfc969bf6a294796db3cb15203a604-89e222e418939149-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-1e6a1287af151040b3a9b49e95e6cfdb-2764f7acf961a34c-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "0e649e128b084513c9c62e584c5f813b", "x-ms-return-client-request-id": "true" }, @@ -25,89 +19,142 @@ "id": "0", "text": "Subject is taking 100mg of ibuprofen twice daily", "language": "en" + }, + { + "id": "1", + "text": "Can cause rapid or irregular heartbeat, delirium, panic, psychosis, and heart failure.", + "language": "en" } ] }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "38c00f76-81ce-4583-87df-3d387c5eb35b", - "Date": "Tue, 17 Nov 2020 20:17:37 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/4a6dd64f-c7d5-4282-95fa-c825c6f17899", + "apim-request-id": "7cadf99e-ac28-4300-b1b6-1c5fb79b76bf", + "Date": "Tue, 02 Feb 2021 19:27:43 GMT", + "operation-location": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1c091e34-a18e-4bc6-9b48-d779cef530ea", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "78" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "306" }, "ResponseBody": [] }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/4a6dd64f-c7d5-4282-95fa-c825c6f17899?showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1c091e34-a18e-4bc6-9b48-d779cef530ea?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "796705c1528f3adf8bba34f0a8f2bd37", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "aad0caa3-cf62-4233-b820-78bbfc7078bc", + "apim-request-id": "ff908c29-ecae-41a1-b646-7fcd98655046", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:37 GMT", + "Date": "Tue, 02 Feb 2021 19:27:43 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "9" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "19" }, "ResponseBody": { - "jobId": "4a6dd64f-c7d5-4282-95fa-c825c6f17899", - "lastUpdateDateTime": "2020-11-17T20:17:37Z", - "createdDateTime": "2020-11-17T20:17:37Z", - "expirationDateTime": "2020-11-18T20:17:37Z", + "jobId": "1c091e34-a18e-4bc6-9b48-d779cef530ea", + "lastUpdateDateTime": "2021-02-02T19:27:44Z", + "createdDateTime": "2021-02-02T19:27:43Z", + "expirationDateTime": "2021-02-03T19:27:43Z", "status": "notStarted", "errors": [] } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/4a6dd64f-c7d5-4282-95fa-c825c6f17899?showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1c091e34-a18e-4bc6-9b48-d779cef530ea?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "740ea8ad2ce006c130b149d1ae645358", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "e5539721-c70f-43ce-a7a6-e2d7d75126fe", + "apim-request-id": "8dae5e4c-1d9f-40da-ad4e-9b1a469b1dc1", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 02 Feb 2021 19:27:45 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "7" + }, + "ResponseBody": { + "jobId": "1c091e34-a18e-4bc6-9b48-d779cef530ea", + "lastUpdateDateTime": "2021-02-02T19:27:44Z", + "createdDateTime": "2021-02-02T19:27:43Z", + "expirationDateTime": "2021-02-03T19:27:43Z", + "status": "notStarted", + "errors": [] + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1c091e34-a18e-4bc6-9b48-d779cef530ea?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "07effce6ecdcc068be2a834d57229cd7", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "9a5be5b8-a5e1-46d6-9e61-e85b6b5f9ecf", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 02 Feb 2021 19:27:46 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "6" + }, + "ResponseBody": { + "jobId": "1c091e34-a18e-4bc6-9b48-d779cef530ea", + "lastUpdateDateTime": "2021-02-02T19:27:44Z", + "createdDateTime": "2021-02-02T19:27:43Z", + "expirationDateTime": "2021-02-03T19:27:43Z", + "status": "notStarted", + "errors": [] + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1c091e34-a18e-4bc6-9b48-d779cef530ea?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "a4abf7090d51955a436148dd080e8c26", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "c3c33ed4-7d2b-423f-bc48-82dde9e5f672", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:39 GMT", + "Date": "Tue, 02 Feb 2021 19:27:47 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "50" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "790" }, "ResponseBody": { - "jobId": "4a6dd64f-c7d5-4282-95fa-c825c6f17899", - "lastUpdateDateTime": "2020-11-17T20:17:38Z", - "createdDateTime": "2020-11-17T20:17:37Z", - "expirationDateTime": "2020-11-18T20:17:37Z", + "jobId": "1c091e34-a18e-4bc6-9b48-d779cef530ea", + "lastUpdateDateTime": "2021-02-02T19:27:47Z", + "createdDateTime": "2021-02-02T19:27:43Z", + "expirationDateTime": "2021-02-03T19:27:43Z", "status": "succeeded", "errors": [], "results": { @@ -277,6 +324,789 @@ } ], "warnings": [] + }, + { + "id": "1", + "entities": [ + { + "offset": 10, + "length": 5, + "text": "rapid", + "category": "SymptomOrSign", + "confidenceScore": 0.98, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0456962" + }, + { + "dataSource": "AOD", + "id": "0000002744" + }, + { + "dataSource": "CHV", + "id": "0000034666" + }, + { + "dataSource": "LNC", + "id": "LA24868-4" + }, + { + "dataSource": "NCI", + "id": "C65069" + }, + { + "dataSource": "RCD", + "id": "X78xZ" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "255358001" + } + ] + }, + { + "offset": 19, + "length": 19, + "text": "irregular heartbeat", + "category": "SymptomOrSign", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0003811" + }, + { + "dataSource": "AOD", + "id": "0000005346" + }, + { + "dataSource": "BI", + "id": "BI00057" + }, + { + "dataSource": "CCPSS", + "id": "1017785" + }, + { + "dataSource": "CCS", + "id": "7.2.9" + }, + { + "dataSource": "CCSR_10", + "id": "CIR017" + }, + { + "dataSource": "CHV", + "id": "0000001440" + }, + { + "dataSource": "COSTAR", + "id": "153" + }, + { + "dataSource": "CSP", + "id": "1393-3277" + }, + { + "dataSource": "CST", + "id": "ARRHYTHMIA" + }, + { + "dataSource": "HPO", + "id": "HP:0011675" + }, + { + "dataSource": "ICD10", + "id": "I49.9" + }, + { + "dataSource": "ICD10AM", + "id": "I49.9" + }, + { + "dataSource": "ICD10CM", + "id": "I49.9" + }, + { + "dataSource": "ICD9CM", + "id": "427.9" + }, + { + "dataSource": "ICPC", + "id": "K80" + }, + { + "dataSource": "ICPC2EENG", + "id": "K80" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU033639" + }, + { + "dataSource": "ICPC2P", + "id": "K80012" + }, + { + "dataSource": "LCH", + "id": "U000359" + }, + { + "dataSource": "LCH_NW", + "id": "sh85007430" + }, + { + "dataSource": "LNC", + "id": "LA15419-7" + }, + { + "dataSource": "MDR", + "id": "10003119" + }, + { + "dataSource": "MEDCIN", + "id": "35851" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "147" + }, + { + "dataSource": "MSH", + "id": "D001145" + }, + { + "dataSource": "MTH", + "id": "153" + }, + { + "dataSource": "MTHICD9", + "id": "427.9" + }, + { + "dataSource": "NANDA-I", + "id": "00126" + }, + { + "dataSource": "NCI", + "id": "C2881" + }, + { + "dataSource": "NCI_FDA", + "id": "1721" + }, + { + "dataSource": "NCI_NICHD", + "id": "C2881" + }, + { + "dataSource": "NOC", + "id": "040520" + }, + { + "dataSource": "OMIM", + "id": "115000" + }, + { + "dataSource": "PSY", + "id": "03790" + }, + { + "dataSource": "RCD", + "id": "X77BB" + }, + { + "dataSource": "SNM", + "id": "F-73102" + }, + { + "dataSource": "SNMI", + "id": "D3-30010" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "698247007" + }, + { + "dataSource": "WHO", + "id": "0433" + } + ] + }, + { + "offset": 40, + "length": 8, + "text": "delirium", + "category": "Diagnosis", + "confidenceScore": 0.99, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0011206" + }, + { + "dataSource": "AOD", + "id": "0000004328" + }, + { + "dataSource": "CCPSS", + "id": "1017884" + }, + { + "dataSource": "CHV", + "id": "0000003670" + }, + { + "dataSource": "COSTAR", + "id": "U000178" + }, + { + "dataSource": "CSP", + "id": "5003-0016" + }, + { + "dataSource": "CST", + "id": "DELIRIUM" + }, + { + "dataSource": "DSM-5", + "id": "780.09" + }, + { + "dataSource": "DXP", + "id": "U000937" + }, + { + "dataSource": "HPO", + "id": "HP:0031258" + }, + { + "dataSource": "ICD10", + "id": "F05.9" + }, + { + "dataSource": "ICD10AM", + "id": "F05.9" + }, + { + "dataSource": "ICD10CM", + "id": "R41.0" + }, + { + "dataSource": "ICNP", + "id": "10022091" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU022150" + }, + { + "dataSource": "LCH", + "id": "U001289" + }, + { + "dataSource": "LCH_NW", + "id": "sh85036579" + }, + { + "dataSource": "LNC", + "id": "LP89856-6" + }, + { + "dataSource": "MDR", + "id": "10012218" + }, + { + "dataSource": "MEDCIN", + "id": "677" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "5562" + }, + { + "dataSource": "MSH", + "id": "D003693" + }, + { + "dataSource": "NANDA-I", + "id": "02157" + }, + { + "dataSource": "NCI", + "id": "C2981" + }, + { + "dataSource": "NCI_CTCAE", + "id": "E12898" + }, + { + "dataSource": "NCI_CTRP", + "id": "C2981" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000450100" + }, + { + "dataSource": "NCI_NICHD", + "id": "C2981" + }, + { + "dataSource": "NOC", + "id": "091213" + }, + { + "dataSource": "OMIM", + "id": "MTHU035152" + }, + { + "dataSource": "PDQ", + "id": "CDR0000042226" + }, + { + "dataSource": "PSY", + "id": "13360" + }, + { + "dataSource": "QMR", + "id": "Q0200089" + }, + { + "dataSource": "RCD", + "id": "XE1Xv" + }, + { + "dataSource": "SNM", + "id": "F-85720" + }, + { + "dataSource": "SNMI", + "id": "D9-20100" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "2776000" + }, + { + "dataSource": "WHO", + "id": "0099" + } + ] + }, + { + "offset": 50, + "length": 5, + "text": "panic", + "category": "Diagnosis", + "confidenceScore": 0.89, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0030318" + }, + { + "dataSource": "AOD", + "id": "0000023911" + }, + { + "dataSource": "CHV", + "id": "0000009234" + }, + { + "dataSource": "CST", + "id": "AGITATION" + }, + { + "dataSource": "ICD10CM", + "id": "F41.0" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU057222" + }, + { + "dataSource": "LCH", + "id": "U003458" + }, + { + "dataSource": "LCH_NW", + "id": "sh85097438" + }, + { + "dataSource": "MDR", + "id": "10033670" + }, + { + "dataSource": "MSH", + "id": "D010200" + }, + { + "dataSource": "MTH", + "id": "551" + }, + { + "dataSource": "MTHICD9", + "id": "300.01" + }, + { + "dataSource": "NCI", + "id": "C94438" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000454704" + }, + { + "dataSource": "NOC", + "id": "121346" + }, + { + "dataSource": "PSY", + "id": "36260" + }, + { + "dataSource": "RCD", + "id": "Xa3Vj" + }, + { + "dataSource": "SNM", + "id": "F-90880" + }, + { + "dataSource": "SNMI", + "id": "F-92560" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "79823003" + }, + { + "dataSource": "WHO", + "id": "0163" + } + ] + }, + { + "offset": 57, + "length": 9, + "text": "psychosis", + "category": "Diagnosis", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0033975" + }, + { + "dataSource": "AIR", + "id": "PSYCH" + }, + { + "dataSource": "AOD", + "id": "0000004324" + }, + { + "dataSource": "BI", + "id": "BI00688" + }, + { + "dataSource": "CCPSS", + "id": "1018204" + }, + { + "dataSource": "CHV", + "id": "0000010350" + }, + { + "dataSource": "COSTAR", + "id": "089" + }, + { + "dataSource": "CSP", + "id": "2484-8182" + }, + { + "dataSource": "CST", + "id": "PSYCHOSIS" + }, + { + "dataSource": "DXP", + "id": "U003257" + }, + { + "dataSource": "HPO", + "id": "HP:0000709" + }, + { + "dataSource": "ICD9CM", + "id": "298.9" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU070382" + }, + { + "dataSource": "ICPC2P", + "id": "P98004" + }, + { + "dataSource": "LCH_NW", + "id": "sh85108502" + }, + { + "dataSource": "LNC", + "id": "LA7534-6" + }, + { + "dataSource": "MDR", + "id": "10061920" + }, + { + "dataSource": "MEDCIN", + "id": "364298" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "4180" + }, + { + "dataSource": "MSH", + "id": "D011618" + }, + { + "dataSource": "MTH", + "id": "089" + }, + { + "dataSource": "MTHICD9", + "id": "298.9" + }, + { + "dataSource": "NANDA-I", + "id": "03128" + }, + { + "dataSource": "NCI", + "id": "C78576" + }, + { + "dataSource": "NCI_CTCAE", + "id": "E12954" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000450115" + }, + { + "dataSource": "NCI_NICHD", + "id": "C78576" + }, + { + "dataSource": "NOC", + "id": "061619" + }, + { + "dataSource": "OMIM", + "id": "MTHU002910" + }, + { + "dataSource": "PSY", + "id": "41910" + }, + { + "dataSource": "QMR", + "id": "Q0200208" + }, + { + "dataSource": "RCD", + "id": "X00S6" + }, + { + "dataSource": "SNM", + "id": "D-9200" + }, + { + "dataSource": "SNMI", + "id": "D9-72000" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "69322001" + }, + { + "dataSource": "WHO", + "id": "0193" + } + ] + }, + { + "offset": 72, + "length": 13, + "text": "heart failure", + "category": "Diagnosis", + "confidenceScore": 0.99, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0018801" + }, + { + "dataSource": "AOD", + "id": "0000005308" + }, + { + "dataSource": "BI", + "id": "BI00019" + }, + { + "dataSource": "CCPSS", + "id": "0017571" + }, + { + "dataSource": "CCS", + "id": "7.2.11.2" + }, + { + "dataSource": "CCSR_10", + "id": "CIR019" + }, + { + "dataSource": "CHV", + "id": "0000005877" + }, + { + "dataSource": "COSTAR", + "id": "U000338" + }, + { + "dataSource": "CSP", + "id": "1393-3587" + }, + { + "dataSource": "CST", + "id": "HEART FAIL" + }, + { + "dataSource": "HPO", + "id": "HP:0001635" + }, + { + "dataSource": "ICD10", + "id": "I50.9" + }, + { + "dataSource": "ICD10AM", + "id": "I50.9" + }, + { + "dataSource": "ICD10CM", + "id": "I50.9" + }, + { + "dataSource": "ICD9CM", + "id": "428.9" + }, + { + "dataSource": "ICPC", + "id": "K77" + }, + { + "dataSource": "ICPC2EENG", + "id": "K77" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU027668" + }, + { + "dataSource": "ICPC2P", + "id": "K77011" + }, + { + "dataSource": "LCH", + "id": "U005616" + }, + { + "dataSource": "LCH_NW", + "id": "sh85059745" + }, + { + "dataSource": "LNC", + "id": "LP269421-6" + }, + { + "dataSource": "MDR", + "id": "10007554" + }, + { + "dataSource": "MEDCIN", + "id": "95724" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "199" + }, + { + "dataSource": "MSH", + "id": "D006333" + }, + { + "dataSource": "MTHICD9", + "id": "428.9" + }, + { + "dataSource": "NCI", + "id": "C50577" + }, + { + "dataSource": "NCI_CTCAE", + "id": "E10124" + }, + { + "dataSource": "NCI_FDA", + "id": "2206" + }, + { + "dataSource": "NCI_NICHD", + "id": "C50577" + }, + { + "dataSource": "OMIM", + "id": "MTHU009472" + }, + { + "dataSource": "RCD", + "id": "G58.." + }, + { + "dataSource": "SNM", + "id": "D-7050" + }, + { + "dataSource": "SNMI", + "id": "D3-16000" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "84114007" + }, + { + "dataSource": "WHO", + "id": "0496" + } + ] + } + ], + "relations": [], + "warnings": [] } ], "errors": [], @@ -288,6 +1118,6 @@ "Variables": { "RandomSeed": "1940196881", "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" + "TEXT_ANALYTICS_ENDPOINT": "https://mariari-westus2-s.cognitiveservices.azure.com/" } } \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTestAsync.json index 44a91c2273118..19cd0b961b81a 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTestAsync.json +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithLanguageTestAsync.json @@ -1,21 +1,15 @@ { "Entries": [ { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", "RequestMethod": "POST", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "100", + "Accept": "application/json, text/json", + "Content-Length": "223", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-99228a8ee4d9cc488f6e34bc8987592a-9923de0f474bf643-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-2bed19706cb9724aa846fdc53132c0e8-8705568b7c1c2b48-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "ac50657e0564f29f4cf677ed0a13f18a", "x-ms-return-client-request-id": "true" }, @@ -25,89 +19,112 @@ "id": "0", "text": "Subject is taking 100mg of ibuprofen twice daily", "language": "en" + }, + { + "id": "1", + "text": "Can cause rapid or irregular heartbeat, delirium, panic, psychosis, and heart failure.", + "language": "en" } ] }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "656324cd-2d1e-442d-9868-c7a8bfdd3e6c", - "Date": "Tue, 17 Nov 2020 20:18:01 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/c5509402-2dd7-446d-b06b-0a4c18b1121e", + "apim-request-id": "ee56cf4e-ec0c-445d-afe5-5a3425b28b3f", + "Date": "Tue, 02 Feb 2021 19:27:49 GMT", + "operation-location": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/36b5c940-d84f-42c7-8b78-81858610571b", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "70" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "500" }, "ResponseBody": [] }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/c5509402-2dd7-446d-b06b-0a4c18b1121e?showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/36b5c940-d84f-42c7-8b78-81858610571b?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "ee06e8ec9851bf144fa0b3348eac9147", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "80aa3164-ca18-445a-87c4-02c589e46445", + "apim-request-id": "f1485843-ffd3-4832-ba99-dac497aed872", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:18:01 GMT", + "Date": "Tue, 02 Feb 2021 19:27:49 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "9" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "7" }, "ResponseBody": { - "jobId": "c5509402-2dd7-446d-b06b-0a4c18b1121e", - "lastUpdateDateTime": "2020-11-17T20:18:01Z", - "createdDateTime": "2020-11-17T20:18:01Z", - "expirationDateTime": "2020-11-18T20:18:01Z", + "jobId": "36b5c940-d84f-42c7-8b78-81858610571b", + "lastUpdateDateTime": "2021-02-02T19:27:49Z", + "createdDateTime": "2021-02-02T19:27:49Z", + "expirationDateTime": "2021-02-03T19:27:49Z", "status": "notStarted", "errors": [] } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/c5509402-2dd7-446d-b06b-0a4c18b1121e?showStats=false", + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/36b5c940-d84f-42c7-8b78-81858610571b?showStats=false", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "c56f00a8f06aed051c550a52700d0abf", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "44af406a-5ab5-4d04-a332-7498a53767fe", + "apim-request-id": "7cf5f11b-a63f-49b3-9c80-38791efaf581", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:18:02 GMT", + "Date": "Tue, 02 Feb 2021 19:27:50 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "69" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "7" }, "ResponseBody": { - "jobId": "c5509402-2dd7-446d-b06b-0a4c18b1121e", - "lastUpdateDateTime": "2020-11-17T20:18:02Z", - "createdDateTime": "2020-11-17T20:18:01Z", - "expirationDateTime": "2020-11-18T20:18:01Z", + "jobId": "36b5c940-d84f-42c7-8b78-81858610571b", + "lastUpdateDateTime": "2021-02-02T19:27:51Z", + "createdDateTime": "2021-02-02T19:27:49Z", + "expirationDateTime": "2021-02-03T19:27:49Z", + "status": "running", + "errors": [] + } + }, + { + "RequestUri": "https://mariari-westus2-s.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/36b5c940-d84f-42c7-8b78-81858610571b?showStats=false", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210202.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "c9cabda7fe2ee58e51915dc3526b639f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "154f5f60-d105-4502-93f5-dfc31ac14d8d", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 02 Feb 2021 19:27:51 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "207" + }, + "ResponseBody": { + "jobId": "36b5c940-d84f-42c7-8b78-81858610571b", + "lastUpdateDateTime": "2021-02-02T19:27:51Z", + "createdDateTime": "2021-02-02T19:27:49Z", + "expirationDateTime": "2021-02-03T19:27:49Z", "status": "succeeded", "errors": [], "results": { @@ -277,6 +294,789 @@ } ], "warnings": [] + }, + { + "id": "1", + "entities": [ + { + "offset": 10, + "length": 5, + "text": "rapid", + "category": "SymptomOrSign", + "confidenceScore": 0.98, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0456962" + }, + { + "dataSource": "AOD", + "id": "0000002744" + }, + { + "dataSource": "CHV", + "id": "0000034666" + }, + { + "dataSource": "LNC", + "id": "LA24868-4" + }, + { + "dataSource": "NCI", + "id": "C65069" + }, + { + "dataSource": "RCD", + "id": "X78xZ" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "255358001" + } + ] + }, + { + "offset": 19, + "length": 19, + "text": "irregular heartbeat", + "category": "SymptomOrSign", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0003811" + }, + { + "dataSource": "AOD", + "id": "0000005346" + }, + { + "dataSource": "BI", + "id": "BI00057" + }, + { + "dataSource": "CCPSS", + "id": "1017785" + }, + { + "dataSource": "CCS", + "id": "7.2.9" + }, + { + "dataSource": "CCSR_10", + "id": "CIR017" + }, + { + "dataSource": "CHV", + "id": "0000001440" + }, + { + "dataSource": "COSTAR", + "id": "153" + }, + { + "dataSource": "CSP", + "id": "1393-3277" + }, + { + "dataSource": "CST", + "id": "ARRHYTHMIA" + }, + { + "dataSource": "HPO", + "id": "HP:0011675" + }, + { + "dataSource": "ICD10", + "id": "I49.9" + }, + { + "dataSource": "ICD10AM", + "id": "I49.9" + }, + { + "dataSource": "ICD10CM", + "id": "I49.9" + }, + { + "dataSource": "ICD9CM", + "id": "427.9" + }, + { + "dataSource": "ICPC", + "id": "K80" + }, + { + "dataSource": "ICPC2EENG", + "id": "K80" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU033639" + }, + { + "dataSource": "ICPC2P", + "id": "K80012" + }, + { + "dataSource": "LCH", + "id": "U000359" + }, + { + "dataSource": "LCH_NW", + "id": "sh85007430" + }, + { + "dataSource": "LNC", + "id": "LA15419-7" + }, + { + "dataSource": "MDR", + "id": "10003119" + }, + { + "dataSource": "MEDCIN", + "id": "35851" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "147" + }, + { + "dataSource": "MSH", + "id": "D001145" + }, + { + "dataSource": "MTH", + "id": "153" + }, + { + "dataSource": "MTHICD9", + "id": "427.9" + }, + { + "dataSource": "NANDA-I", + "id": "00126" + }, + { + "dataSource": "NCI", + "id": "C2881" + }, + { + "dataSource": "NCI_FDA", + "id": "1721" + }, + { + "dataSource": "NCI_NICHD", + "id": "C2881" + }, + { + "dataSource": "NOC", + "id": "040520" + }, + { + "dataSource": "OMIM", + "id": "115000" + }, + { + "dataSource": "PSY", + "id": "03790" + }, + { + "dataSource": "RCD", + "id": "X77BB" + }, + { + "dataSource": "SNM", + "id": "F-73102" + }, + { + "dataSource": "SNMI", + "id": "D3-30010" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "698247007" + }, + { + "dataSource": "WHO", + "id": "0433" + } + ] + }, + { + "offset": 40, + "length": 8, + "text": "delirium", + "category": "Diagnosis", + "confidenceScore": 0.99, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0011206" + }, + { + "dataSource": "AOD", + "id": "0000004328" + }, + { + "dataSource": "CCPSS", + "id": "1017884" + }, + { + "dataSource": "CHV", + "id": "0000003670" + }, + { + "dataSource": "COSTAR", + "id": "U000178" + }, + { + "dataSource": "CSP", + "id": "5003-0016" + }, + { + "dataSource": "CST", + "id": "DELIRIUM" + }, + { + "dataSource": "DSM-5", + "id": "780.09" + }, + { + "dataSource": "DXP", + "id": "U000937" + }, + { + "dataSource": "HPO", + "id": "HP:0031258" + }, + { + "dataSource": "ICD10", + "id": "F05.9" + }, + { + "dataSource": "ICD10AM", + "id": "F05.9" + }, + { + "dataSource": "ICD10CM", + "id": "R41.0" + }, + { + "dataSource": "ICNP", + "id": "10022091" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU022150" + }, + { + "dataSource": "LCH", + "id": "U001289" + }, + { + "dataSource": "LCH_NW", + "id": "sh85036579" + }, + { + "dataSource": "LNC", + "id": "LP89856-6" + }, + { + "dataSource": "MDR", + "id": "10012218" + }, + { + "dataSource": "MEDCIN", + "id": "677" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "5562" + }, + { + "dataSource": "MSH", + "id": "D003693" + }, + { + "dataSource": "NANDA-I", + "id": "02157" + }, + { + "dataSource": "NCI", + "id": "C2981" + }, + { + "dataSource": "NCI_CTCAE", + "id": "E12898" + }, + { + "dataSource": "NCI_CTRP", + "id": "C2981" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000450100" + }, + { + "dataSource": "NCI_NICHD", + "id": "C2981" + }, + { + "dataSource": "NOC", + "id": "091213" + }, + { + "dataSource": "OMIM", + "id": "MTHU035152" + }, + { + "dataSource": "PDQ", + "id": "CDR0000042226" + }, + { + "dataSource": "PSY", + "id": "13360" + }, + { + "dataSource": "QMR", + "id": "Q0200089" + }, + { + "dataSource": "RCD", + "id": "XE1Xv" + }, + { + "dataSource": "SNM", + "id": "F-85720" + }, + { + "dataSource": "SNMI", + "id": "D9-20100" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "2776000" + }, + { + "dataSource": "WHO", + "id": "0099" + } + ] + }, + { + "offset": 50, + "length": 5, + "text": "panic", + "category": "Diagnosis", + "confidenceScore": 0.89, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0030318" + }, + { + "dataSource": "AOD", + "id": "0000023911" + }, + { + "dataSource": "CHV", + "id": "0000009234" + }, + { + "dataSource": "CST", + "id": "AGITATION" + }, + { + "dataSource": "ICD10CM", + "id": "F41.0" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU057222" + }, + { + "dataSource": "LCH", + "id": "U003458" + }, + { + "dataSource": "LCH_NW", + "id": "sh85097438" + }, + { + "dataSource": "MDR", + "id": "10033670" + }, + { + "dataSource": "MSH", + "id": "D010200" + }, + { + "dataSource": "MTH", + "id": "551" + }, + { + "dataSource": "MTHICD9", + "id": "300.01" + }, + { + "dataSource": "NCI", + "id": "C94438" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000454704" + }, + { + "dataSource": "NOC", + "id": "121346" + }, + { + "dataSource": "PSY", + "id": "36260" + }, + { + "dataSource": "RCD", + "id": "Xa3Vj" + }, + { + "dataSource": "SNM", + "id": "F-90880" + }, + { + "dataSource": "SNMI", + "id": "F-92560" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "79823003" + }, + { + "dataSource": "WHO", + "id": "0163" + } + ] + }, + { + "offset": 57, + "length": 9, + "text": "psychosis", + "category": "Diagnosis", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0033975" + }, + { + "dataSource": "AIR", + "id": "PSYCH" + }, + { + "dataSource": "AOD", + "id": "0000004324" + }, + { + "dataSource": "BI", + "id": "BI00688" + }, + { + "dataSource": "CCPSS", + "id": "1018204" + }, + { + "dataSource": "CHV", + "id": "0000010350" + }, + { + "dataSource": "COSTAR", + "id": "089" + }, + { + "dataSource": "CSP", + "id": "2484-8182" + }, + { + "dataSource": "CST", + "id": "PSYCHOSIS" + }, + { + "dataSource": "DXP", + "id": "U003257" + }, + { + "dataSource": "HPO", + "id": "HP:0000709" + }, + { + "dataSource": "ICD9CM", + "id": "298.9" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU070382" + }, + { + "dataSource": "ICPC2P", + "id": "P98004" + }, + { + "dataSource": "LCH_NW", + "id": "sh85108502" + }, + { + "dataSource": "LNC", + "id": "LA7534-6" + }, + { + "dataSource": "MDR", + "id": "10061920" + }, + { + "dataSource": "MEDCIN", + "id": "364298" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "4180" + }, + { + "dataSource": "MSH", + "id": "D011618" + }, + { + "dataSource": "MTH", + "id": "089" + }, + { + "dataSource": "MTHICD9", + "id": "298.9" + }, + { + "dataSource": "NANDA-I", + "id": "03128" + }, + { + "dataSource": "NCI", + "id": "C78576" + }, + { + "dataSource": "NCI_CTCAE", + "id": "E12954" + }, + { + "dataSource": "NCI_NCI-GLOSS", + "id": "CDR0000450115" + }, + { + "dataSource": "NCI_NICHD", + "id": "C78576" + }, + { + "dataSource": "NOC", + "id": "061619" + }, + { + "dataSource": "OMIM", + "id": "MTHU002910" + }, + { + "dataSource": "PSY", + "id": "41910" + }, + { + "dataSource": "QMR", + "id": "Q0200208" + }, + { + "dataSource": "RCD", + "id": "X00S6" + }, + { + "dataSource": "SNM", + "id": "D-9200" + }, + { + "dataSource": "SNMI", + "id": "D9-72000" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "69322001" + }, + { + "dataSource": "WHO", + "id": "0193" + } + ] + }, + { + "offset": 72, + "length": 13, + "text": "heart failure", + "category": "Diagnosis", + "confidenceScore": 0.99, + "isNegated": false, + "links": [ + { + "dataSource": "UMLS", + "id": "C0018801" + }, + { + "dataSource": "AOD", + "id": "0000005308" + }, + { + "dataSource": "BI", + "id": "BI00019" + }, + { + "dataSource": "CCPSS", + "id": "0017571" + }, + { + "dataSource": "CCS", + "id": "7.2.11.2" + }, + { + "dataSource": "CCSR_10", + "id": "CIR019" + }, + { + "dataSource": "CHV", + "id": "0000005877" + }, + { + "dataSource": "COSTAR", + "id": "U000338" + }, + { + "dataSource": "CSP", + "id": "1393-3587" + }, + { + "dataSource": "CST", + "id": "HEART FAIL" + }, + { + "dataSource": "HPO", + "id": "HP:0001635" + }, + { + "dataSource": "ICD10", + "id": "I50.9" + }, + { + "dataSource": "ICD10AM", + "id": "I50.9" + }, + { + "dataSource": "ICD10CM", + "id": "I50.9" + }, + { + "dataSource": "ICD9CM", + "id": "428.9" + }, + { + "dataSource": "ICPC", + "id": "K77" + }, + { + "dataSource": "ICPC2EENG", + "id": "K77" + }, + { + "dataSource": "ICPC2ICD10ENG", + "id": "MTHU027668" + }, + { + "dataSource": "ICPC2P", + "id": "K77011" + }, + { + "dataSource": "LCH", + "id": "U005616" + }, + { + "dataSource": "LCH_NW", + "id": "sh85059745" + }, + { + "dataSource": "LNC", + "id": "LP269421-6" + }, + { + "dataSource": "MDR", + "id": "10007554" + }, + { + "dataSource": "MEDCIN", + "id": "95724" + }, + { + "dataSource": "MEDLINEPLUS", + "id": "199" + }, + { + "dataSource": "MSH", + "id": "D006333" + }, + { + "dataSource": "MTHICD9", + "id": "428.9" + }, + { + "dataSource": "NCI", + "id": "C50577" + }, + { + "dataSource": "NCI_CTCAE", + "id": "E10124" + }, + { + "dataSource": "NCI_FDA", + "id": "2206" + }, + { + "dataSource": "NCI_NICHD", + "id": "C50577" + }, + { + "dataSource": "OMIM", + "id": "MTHU009472" + }, + { + "dataSource": "RCD", + "id": "G58.." + }, + { + "dataSource": "SNM", + "id": "D-7050" + }, + { + "dataSource": "SNMI", + "id": "D3-16000" + }, + { + "dataSource": "SNOMEDCT_US", + "id": "84114007" + }, + { + "dataSource": "WHO", + "id": "0496" + } + ] + } + ], + "relations": [], + "warnings": [] } ], "errors": [], @@ -288,6 +1088,6 @@ "Variables": { "RandomSeed": "330150674", "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" + "TEXT_ANALYTICS_ENDPOINT": "https://mariari-westus2-s.cognitiveservices.azure.com/" } } \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameter.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameter.json deleted file mode 100644 index 671208807c3c1..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameter.json +++ /dev/null @@ -1,299 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "223", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-a5d188d6be4c56459dc4295f082149ba-06c979a38b63aa49-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "8efbb01e5acc858dcd1ff153470e4093", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "documents": [ - { - "id": "1", - "text": "Subject is taking 100mg of ibuprofen twice daily", - "language": "en" - }, - { - "id": "2", - "text": "Can cause rapid or irregular heartbeat, delirium, panic, psychosis, and heart failure.", - "language": "en" - } - ] - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "0d9495bb-a756-4f93-99c7-0d34356d7079", - "Date": "Tue, 17 Nov 2020 20:17:41 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/ff9a49c9-ab18-4f9d-8582-4a648ef21779", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "103" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/ff9a49c9-ab18-4f9d-8582-4a648ef21779?$top=1\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "2660bb690f1e14745ff6a5df3888e782", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "6212bebf-3e21-4549-9d4f-87a68a9efedf", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:41 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "8" - }, - "ResponseBody": { - "jobId": "ff9a49c9-ab18-4f9d-8582-4a648ef21779", - "lastUpdateDateTime": "2020-11-17T20:17:41Z", - "createdDateTime": "2020-11-17T20:17:41Z", - "expirationDateTime": "2020-11-18T20:17:41Z", - "status": "notStarted", - "errors": [] - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/ff9a49c9-ab18-4f9d-8582-4a648ef21779?$top=1\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "4c0a13cbdad64cf8d7c97184a7f98e05", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "629a2cc8-fc42-4ede-8797-964086c19816", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:17:42 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "65" - }, - "ResponseBody": { - "jobId": "ff9a49c9-ab18-4f9d-8582-4a648ef21779", - "lastUpdateDateTime": "2020-11-17T20:17:42Z", - "createdDateTime": "2020-11-17T20:17:41Z", - "expirationDateTime": "2020-11-18T20:17:41Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "1", - "entities": [ - { - "offset": 18, - "length": 5, - "text": "100mg", - "category": "Dosage", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 27, - "length": 9, - "text": "ibuprofen", - "category": "MedicationName", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C0020740" - }, - { - "dataSource": "AOD", - "id": "0000019879" - }, - { - "dataSource": "ATC", - "id": "M01AE01" - }, - { - "dataSource": "CCPSS", - "id": "0046165" - }, - { - "dataSource": "CHV", - "id": "0000006519" - }, - { - "dataSource": "CSP", - "id": "2270-2077" - }, - { - "dataSource": "DRUGBANK", - "id": "DB01050" - }, - { - "dataSource": "GS", - "id": "1611" - }, - { - "dataSource": "LCH_NW", - "id": "sh97005926" - }, - { - "dataSource": "LNC", - "id": "LP16165-0" - }, - { - "dataSource": "MEDCIN", - "id": "40458" - }, - { - "dataSource": "MMSL", - "id": "d00015" - }, - { - "dataSource": "MSH", - "id": "D007052" - }, - { - "dataSource": "MTHSPL", - "id": "WK2XYI10QM" - }, - { - "dataSource": "NCI", - "id": "C561" - }, - { - "dataSource": "NCI_CTRP", - "id": "C561" - }, - { - "dataSource": "NCI_DCP", - "id": "00803" - }, - { - "dataSource": "NCI_DTP", - "id": "NSC0256857" - }, - { - "dataSource": "NCI_FDA", - "id": "WK2XYI10QM" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000613511" - }, - { - "dataSource": "NDDF", - "id": "002377" - }, - { - "dataSource": "PDQ", - "id": "CDR0000040475" - }, - { - "dataSource": "RCD", - "id": "x02MO" - }, - { - "dataSource": "RXNORM", - "id": "5640" - }, - { - "dataSource": "SNM", - "id": "E-7772" - }, - { - "dataSource": "SNMI", - "id": "C-603C0" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "387207008" - }, - { - "dataSource": "USP", - "id": "m39860" - }, - { - "dataSource": "USPMG", - "id": "MTHU000060" - }, - { - "dataSource": "VANDF", - "id": "4017840" - } - ] - }, - { - "offset": 37, - "length": 11, - "text": "twice daily", - "category": "Frequency", - "confidenceScore": 1.0, - "isNegated": false - } - ], - "relations": [ - { - "relationType": "DosageOfMedication", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - }, - { - "relationType": "FrequencyOfMedication", - "bidirectional": false, - "source": "#/results/documents/0/entities/2", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/ff9a49c9-ab18-4f9d-8582-4a648ef21779?$skip=1\u0026$top=1" - } - } - ], - "Variables": { - "RandomSeed": "1474656437", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameterAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameterAsync.json deleted file mode 100644 index fbaad6c902f23..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeHealthcareEntitiesTests/RecognizeHealthcareEntitiesWithTopParameterAsync.json +++ /dev/null @@ -1,299 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=Utf16CodeUnit", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "223", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-0b22aeee30fbfe4fa9f98fa85c31cbdb-8655d085fc074f42-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "724372daad48480e76510121b5839b2e", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "documents": [ - { - "id": "1", - "text": "Subject is taking 100mg of ibuprofen twice daily", - "language": "en" - }, - { - "id": "2", - "text": "Can cause rapid or irregular heartbeat, delirium, panic, psychosis, and heart failure.", - "language": "en" - } - ] - }, - "StatusCode": 202, - "ResponseHeaders": { - "apim-request-id": "27196e4a-c609-4a0b-99c2-3de38564fe6c", - "Date": "Tue, 17 Nov 2020 20:18:05 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1e11eb94-911f-44c6-a50c-767fe44c7ae0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "109" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1e11eb94-911f-44c6-a50c-767fe44c7ae0?$top=1\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "934d972f1ac830d592026d8c2beeac11", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "ba43e48e-6dc8-464b-aa0e-aded5d7a8d11", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:18:06 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "8" - }, - "ResponseBody": { - "jobId": "1e11eb94-911f-44c6-a50c-767fe44c7ae0", - "lastUpdateDateTime": "2020-11-17T20:18:06Z", - "createdDateTime": "2020-11-17T20:18:06Z", - "expirationDateTime": "2020-11-18T20:18:06Z", - "status": "notStarted", - "errors": [] - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1e11eb94-911f-44c6-a50c-767fe44c7ae0?$top=1\u0026showStats=false", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201116.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "ceb201b6e72887166038d111abceeca7", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "a780e6f6-195b-4db1-ba95-db5eae13e086", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 17 Nov 2020 20:18:07 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "51" - }, - "ResponseBody": { - "jobId": "1e11eb94-911f-44c6-a50c-767fe44c7ae0", - "lastUpdateDateTime": "2020-11-17T20:18:07Z", - "createdDateTime": "2020-11-17T20:18:06Z", - "expirationDateTime": "2020-11-18T20:18:06Z", - "status": "succeeded", - "errors": [], - "results": { - "documents": [ - { - "id": "1", - "entities": [ - { - "offset": 18, - "length": 5, - "text": "100mg", - "category": "Dosage", - "confidenceScore": 1.0, - "isNegated": false - }, - { - "offset": 27, - "length": 9, - "text": "ibuprofen", - "category": "MedicationName", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "dataSource": "UMLS", - "id": "C0020740" - }, - { - "dataSource": "AOD", - "id": "0000019879" - }, - { - "dataSource": "ATC", - "id": "M01AE01" - }, - { - "dataSource": "CCPSS", - "id": "0046165" - }, - { - "dataSource": "CHV", - "id": "0000006519" - }, - { - "dataSource": "CSP", - "id": "2270-2077" - }, - { - "dataSource": "DRUGBANK", - "id": "DB01050" - }, - { - "dataSource": "GS", - "id": "1611" - }, - { - "dataSource": "LCH_NW", - "id": "sh97005926" - }, - { - "dataSource": "LNC", - "id": "LP16165-0" - }, - { - "dataSource": "MEDCIN", - "id": "40458" - }, - { - "dataSource": "MMSL", - "id": "d00015" - }, - { - "dataSource": "MSH", - "id": "D007052" - }, - { - "dataSource": "MTHSPL", - "id": "WK2XYI10QM" - }, - { - "dataSource": "NCI", - "id": "C561" - }, - { - "dataSource": "NCI_CTRP", - "id": "C561" - }, - { - "dataSource": "NCI_DCP", - "id": "00803" - }, - { - "dataSource": "NCI_DTP", - "id": "NSC0256857" - }, - { - "dataSource": "NCI_FDA", - "id": "WK2XYI10QM" - }, - { - "dataSource": "NCI_NCI-GLOSS", - "id": "CDR0000613511" - }, - { - "dataSource": "NDDF", - "id": "002377" - }, - { - "dataSource": "PDQ", - "id": "CDR0000040475" - }, - { - "dataSource": "RCD", - "id": "x02MO" - }, - { - "dataSource": "RXNORM", - "id": "5640" - }, - { - "dataSource": "SNM", - "id": "E-7772" - }, - { - "dataSource": "SNMI", - "id": "C-603C0" - }, - { - "dataSource": "SNOMEDCT_US", - "id": "387207008" - }, - { - "dataSource": "USP", - "id": "m39860" - }, - { - "dataSource": "USPMG", - "id": "MTHU000060" - }, - { - "dataSource": "VANDF", - "id": "4017840" - } - ] - }, - { - "offset": 37, - "length": 11, - "text": "twice daily", - "category": "Frequency", - "confidenceScore": 1.0, - "isNegated": false - } - ], - "relations": [ - { - "relationType": "DosageOfMedication", - "bidirectional": false, - "source": "#/results/documents/0/entities/0", - "target": "#/results/documents/0/entities/1" - }, - { - "relationType": "FrequencyOfMedication", - "bidirectional": false, - "source": "#/results/documents/0/entities/2", - "target": "#/results/documents/0/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-09-03" - }, - "@nextLink": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/entities/health/jobs/1e11eb94-911f-44c6-a50c-767fe44c7ae0?$skip=1\u0026$top=1" - } - } - ], - "Variables": { - "RandomSeed": "554796851", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" - } -} \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_AutomaticPolling.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_AutomaticPolling.cs index 3c475e4066903..601cb0d2da1b0 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_AutomaticPolling.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_AutomaticPolling.cs @@ -38,30 +38,31 @@ with a strong family history of coronary artery disease with a brother dying at await healthOperation.WaitForCompletionAsync(pollingInterval); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + await foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.Value) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult result in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); + Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); - foreach (EntityDataSource entityDataSource in entity.DataSources) + foreach (HealthcareEntity entity in result.Entities) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); + Console.WriteLine($" DataSource: {entityDataSource.Name}"); + } } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_ManualPolling.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_ManualPolling.cs index 39ffbe0763021..46828a03b8154 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_ManualPolling.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_ManualPolling.cs @@ -47,30 +47,31 @@ with a strong family history of coronary artery disease with a brother dying at await Task.Delay(pollingInterval); } - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + await foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.Value) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult result in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); + Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); - foreach (EntityDataSource entityDataSource in entity.DataSources) + foreach (HealthcareEntity entity in result.Entities) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); + Console.WriteLine($" DataSource: {entityDataSource.Name}"); + } } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_Pagination.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_Pagination.cs deleted file mode 100644 index 39ca46ec5fefa..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_Pagination.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure.AI.TextAnalytics.Tests; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.AI.TextAnalytics.Samples -{ - [LiveOnly] - public partial class TextAnalyticsSamples: SamplesBase - { - [Test] - public async Task HealthcareAsyncPagination() - { - string endpoint = TestEnvironment.Endpoint; - string apiKey = TestEnvironment.ApiKey; - - var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); - - #region Snippet:TextAnalyticsSampleHealthcareAsyncPagination - string document = @"RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE."; - - var list = new List(); - - for (int i = 0; i < 10; i++) - { - list.Add(document); - }; - - AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() - { - Top = 2 - }; - - AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartAnalyzeHealthcareEntitiesAsync(list, "en", options); - - AsyncPageable results = client.GetHealthcareEntities(healthOperation); - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\""); - Console.WriteLine(""); - - int resultCount = 0; - await foreach (AnalyzeHealthcareEntitiesResult result in results) - { - resultCount += 1; - } - - Console.WriteLine("resultCount " + resultCount); - } - - #endregion - } -} diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatch.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatch.cs index 1b69c8304bf1f..5a50cb694bf40 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatch.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatch.cs @@ -47,41 +47,41 @@ with a strong family history of coronary artery disease with a brother dying at await healthOperation.WaitForCompletionAsync(); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.GetValues()) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult result in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); + Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); - foreach (EntityDataSource entityDataSource in entity.DataSources) + foreach (HealthcareEntity entity in result.Entities) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + 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($" Document statistics:"); - Console.WriteLine($" Character count (in Unicode graphemes): {result.Statistics.CharacterCount}"); - Console.WriteLine($" Transaction count: {result.Statistics.TransactionCount}"); + Console.WriteLine($"Request statistics:"); + Console.WriteLine($" Document Count: {documentsInPage.Statistics.DocumentCount}"); + Console.WriteLine($" Valid Document Count: {documentsInPage.Statistics.ValidDocumentCount}"); + Console.WriteLine($" Transaction Count: {documentsInPage.Statistics.TransactionCount}"); + Console.WriteLine($" Invalid Document Count: {documentsInPage.Statistics.InvalidDocumentCount}"); 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(""); } #endregion diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchAsync.cs index 21ac7d445a528..bfe5e3307ce20 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchAsync.cs @@ -22,9 +22,9 @@ public async Task HealthcareBatchAsync() var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region 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. \ + string document1 = @"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. The patient had a cardiac catheterization in July of this year revealing total occlusion of the RCA and 50% left main disease ,\ with a strong family history of coronary artery disease with a brother dying at the age of 52 from a myocardial infarction and \ another brother who is status post coronary artery bypass grafting. The patient had a stress echocardiogram done on July , 2001 , \ @@ -32,16 +32,16 @@ with a strong family history of coronary artery disease with a brother dying at 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."; + string document2 = "Prescribed 100mg ibuprofen, taken twice daily."; + List batchInput = new List() { - document, - document, + document1, + document2, }; AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions() { - Top = 1, - Skip = 0, IncludeStatistics = true }; @@ -49,41 +49,42 @@ with a strong family history of coronary artery disease with a brother dying at await healthOperation.WaitForCompletionAsync(); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + await foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.Value) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult result in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); + Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); - foreach (EntityDataSource entityDataSource in entity.DataSources) + foreach (HealthcareEntity entity in result.Entities) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + 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($" 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: {documentsInPage.Statistics.DocumentCount}"); + Console.WriteLine($" Valid Document Count: {documentsInPage.Statistics.ValidDocumentCount}"); + Console.WriteLine($" Transaction Count: {documentsInPage.Statistics.TransactionCount}"); + Console.WriteLine($" Invalid Document Count: {documentsInPage.Statistics.InvalidDocumentCount}"); 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(""); } #endregion diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenience.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenience.cs index 7a2fc45695f53..74baf96581823 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenience.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenience.cs @@ -22,7 +22,7 @@ public async Task HealthcareBatchConvenience() var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:TextAnalyticsSampleHealthcareBatchConvenience - string document = @"RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | CORONARY ARTERY DISEASE | Signed | DIS | \ + string document1 = @"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. \ The patient had a cardiac catheterization in July of this year revealing total occlusion of the RCA and 50% left main disease ,\ @@ -32,39 +32,43 @@ with a strong family history of coronary artery disease with a brother dying at 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."; + string document2 = "Prescribed 100mg ibuprofen, taken twice daily."; + List batchInput = new List() { - document, + document1, + document2, }; - AnalyzeHealthcareEntitiesOperation healthOperation = client.StartAnalyzeHealthcareEntities(batchInput, "en"); + AnalyzeHealthcareEntitiesOperation healthOperation = client.StartAnalyzeHealthcareEntities(batchInput); await healthOperation.WaitForCompletionAsync(); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.GetValues()) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult result in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); + Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); - foreach (EntityDataSource entityDataSource in entity.DataSources) + foreach (HealthcareEntity entity in result.Entities) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); + Console.WriteLine($" DataSource: {entityDataSource.Name}"); + } } + Console.WriteLine(""); } - Console.WriteLine(""); } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenienceAsync.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenienceAsync.cs index d30999df06e3a..423974b55c9b8 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenienceAsync.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareBatchConvenienceAsync.cs @@ -22,48 +22,50 @@ public async Task HealthcareBatchConvenienceAsync() var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:TextAnalyticsSampleHealthcareBatchConvenienceAsync - 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. \ - The patient had a cardiac catheterization in July of this year revealing total occlusion of the RCA and 50% left main disease ,\ - with a strong family history of coronary artery disease with a brother dying at the age of 52 from a myocardial infarction and \ - another brother who is status post coronary artery bypass grafting. The patient had a stress echocardiogram done on July , 2001 , \ - which showed no wall motion abnormalities , but this was a difficult study due to body habitus. The patient went for six minutes with \ - 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."; + string document = "Subject is taking 100mg of ibuprofen twice daily"; - List batchInput = new List() + var list = new List(); + + for (int i = 0; i < 6; i++) { - document, + list.Add(document); }; - AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartAnalyzeHealthcareEntitiesAsync(batchInput, "en"); + AnalyzeHealthcareEntitiesOperation healthOperation = await client.StartAnalyzeHealthcareEntitiesAsync(list, "en", new AnalyzeHealthcareEntitiesOptions() { IncludeStatistics = true } ); await healthOperation.WaitForCompletionAsync(); - AnalyzeHealthcareEntitiesResultCollection results = healthOperation.Value; - - Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{results.ModelVersion}\""); - Console.WriteLine(""); - - foreach (AnalyzeHealthcareEntitiesResult result in results) + await foreach (AnalyzeHealthcareEntitiesResultCollection documentsInPage in healthOperation.Value) { - Console.WriteLine($" Recognized the following {result.Entities.Count} healthcare entities:"); + Console.WriteLine($"Results of Azure Text Analytics \"Healthcare Async\" Model, version: \"{documentsInPage.ModelVersion}\""); + Console.WriteLine(""); - foreach (HealthcareEntity entity in result.Entities) + foreach (AnalyzeHealthcareEntitiesResult entitiesInDoc in documentsInPage) { - Console.WriteLine($" Entity: {entity.Text}"); - Console.WriteLine($" Category: {entity.Category}"); - Console.WriteLine($" Offset: {entity.Offset}"); - Console.WriteLine($" Length: {entity.Length}"); - Console.WriteLine($" Links:"); - - foreach (EntityDataSource entityDataSource in entity.DataSources) + if (!entitiesInDoc.HasError) { - Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); - Console.WriteLine($" DataSource: {entityDataSource.Name}"); + foreach (var entity in entitiesInDoc.Entities) + { + Console.WriteLine($" Entity: {entity.Text}"); + Console.WriteLine($" Category: {entity.Category}"); + Console.WriteLine($" Offset: {entity.Offset}"); + Console.WriteLine($" Length: {entity.Length}"); + Console.WriteLine($" Links:"); + + foreach (EntityDataSource entityDataSource in entity.DataSources) + { + Console.WriteLine($" Entity ID in Data Source: {entityDataSource.EntityId}"); + Console.WriteLine($" DataSource: {entityDataSource.Name}"); + } + } } } + + Console.WriteLine($"Request statistics:"); + Console.WriteLine($" Document Count: {documentsInPage.Statistics.DocumentCount}"); + Console.WriteLine($" Valid Document Count: {documentsInPage.Statistics.ValidDocumentCount}"); + Console.WriteLine($" Transaction Count: {documentsInPage.Statistics.TransactionCount}"); + Console.WriteLine($" Invalid Document Count: {documentsInPage.Statistics.InvalidDocumentCount}"); Console.WriteLine(""); } }