Skip to content

Commit 770e741

Browse files
authored
[Text Analytics] Healthcare Relation change for 3.1-preview.4 (Azure#19111)
# All SDK Contribution checklist: This checklist is used to make sure that common guidelines for a pull request are followed. - [ ] **Please open PR in `Draft` mode if it is:** - Work in progress or not intended to be merged. - Encountering multiple pipeline failures and working on fixes. - [ ] If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above. - [ ] **I have read the [contribution guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md).** - [ ] **The pull request does not introduce [breaking changes](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md).** ### [General Guidelines and Best Practices](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#general-guidelines) - [ ] Title of the pull request is clear and informative. - [ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### [Testing Guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#testing-guidelines) - [ ] Pull request includes test coverage for the included changes. ### [SDK Generation Guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#sdk-generation-guidelines) - [ ] The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code. (Track 2 only) - [ ] The `*.csproj` and `AssemblyInfo.cs` files have been updated with the new version of the SDK. Please double check nuget.org current release version. ## Additional management plane SDK specific contribution checklist: Note: Only applies to `Microsoft.Azure.Management.[RP]` or `Azure.ResourceManager.[RP]` - [ ] Include updated [management metadata](https://github.com/Azure/azure-sdk-for-net/tree/master/eng/mgmt/mgmtmetadata). - [ ] Update AzureRP.props to add/remove version info to maintain up to date API versions. ### Management plane SDK Troubleshooting - If this is very first SDK for a services and you are adding new service folders directly under /SDK, please add `new service` label and/or contact assigned reviewer. - If the check fails at the `Verify Code Generation` step, please ensure: - Do not modify any code in generated folders. - Do not selectively include/remove generated files in the PR. - Do use `generate.ps1/cmd` to generate this PR instead of calling `autorest` directly. Please pay attention to the @microsoft.csharp version output after running generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version, ### Old outstanding PR cleanup Please note: If PRs (including draft) has been out for more than 60 days and there are no responses from our query or followups, they will be closed to maintain a concise list for our reviewers.
1 parent f31dae5 commit 770e741

28 files changed

+825
-569
lines changed

sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
## 5.1.0-beta.5 (Unreleased)
44
### New features
55
- Added ability to filter the categories returned in a Personally Identifiable Information recognition with the optional parameter `CategoriesFilter` in `RecognizePiiEntitiesOptions`.
6+
- `AnalyzeHealthcareEntitiesResult`, now exposes the property `EntityRelations`of type `HealthcareEntityRelation`.
7+
- Introduced `HealthcareEntityRelation` class which will determine all the different relations between the entities as `Roles`.
8+
- Added `HealthcareEntityRelationRole`, which exposes `Name` and `Entity` of type `string` and `HealthcareEntity` respectively.
9+
- `HealthcareEntityAssertion` is added to `HealthcareEntity` which further exposes `Association`, `Certainity` and `Conditionality`.
10+
- Added new types under `HealthcareRelationType` class.
611

712
### Breaking changes
813
- Renamed `AspectSentiment` to `TargetSentiment`.
914
- Renamed `MinedOpinion` to `SentenceOpinion`.
1015
- Renamed `OpinionSentiment` to `AssessmentSentiment`.
1116
- For `PiiEntity.Category` the type of the property is now `PiiEntityCategory` instead of `EntityCategory`.
17+
- Removed `RelatedEntities`.
1218
- `RecognizePiiEntitiesOptions.Domain` is now a nullable type.
1319

1420
### Fixes

sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public partial class AnalyzeHealthcareEntitiesResult : Azure.AI.TextAnalytics.Te
6666
{
6767
internal AnalyzeHealthcareEntitiesResult() { }
6868
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.HealthcareEntity> Entities { get { throw null; } }
69+
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.HealthcareEntityRelation> EntityRelations { get { throw null; } }
6970
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.TextAnalyticsWarning> Warnings { get { throw null; } }
7071
}
7172
public partial class AnalyzeHealthcareEntitiesResultCollection : System.Collections.ObjectModel.ReadOnlyCollection<Azure.AI.TextAnalytics.AnalyzeHealthcareEntitiesResult>
@@ -102,6 +103,11 @@ public readonly partial struct AssessmentSentiment
102103
public Azure.AI.TextAnalytics.TextSentiment Sentiment { get { throw null; } }
103104
public string Text { get { throw null; } }
104105
}
106+
public enum Association
107+
{
108+
Subject = 0,
109+
Other = 1,
110+
}
105111
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
106112
public readonly partial struct CategorizedEntity
107113
{
@@ -119,6 +125,19 @@ public partial class CategorizedEntityCollection : System.Collections.ObjectMode
119125
internal CategorizedEntityCollection() : base (default(System.Collections.Generic.IList<Azure.AI.TextAnalytics.CategorizedEntity>)) { }
120126
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.TextAnalyticsWarning> Warnings { get { throw null; } }
121127
}
128+
public enum Certainty
129+
{
130+
Positive = 0,
131+
PositivePossible = 1,
132+
NeutralPossible = 2,
133+
NegativePossible = 3,
134+
Negative = 4,
135+
}
136+
public enum Conditionality
137+
{
138+
Hypothetical = 0,
139+
Conditional = 1,
140+
}
122141
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
123142
public readonly partial struct DetectedLanguage
124143
{
@@ -213,33 +232,69 @@ internal ExtractKeyPhrasesResultCollection() : base (default(System.Collections.
213232
public partial class HealthcareEntity
214233
{
215234
internal HealthcareEntity() { }
235+
public Azure.AI.TextAnalytics.HealthcareEntityAssertion Assertion { get { throw null; } }
216236
public string Category { get { throw null; } }
217237
public double ConfidenceScore { get { throw null; } }
218238
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.EntityDataSource> DataSources { get { throw null; } }
219239
public int Length { get { throw null; } }
240+
public string NormalizedText { get { throw null; } }
220241
public int Offset { get { throw null; } }
221-
public System.Collections.Generic.IDictionary<Azure.AI.TextAnalytics.HealthcareEntity, Azure.AI.TextAnalytics.HealthcareEntityRelationType> RelatedEntities { get { throw null; } }
222242
public string SubCategory { get { throw null; } }
223243
public string Text { get { throw null; } }
224244
}
245+
public partial class HealthcareEntityAssertion
246+
{
247+
internal HealthcareEntityAssertion() { }
248+
public Azure.AI.TextAnalytics.Association? Association { get { throw null; } }
249+
public Azure.AI.TextAnalytics.Certainty? Certainty { get { throw null; } }
250+
public Azure.AI.TextAnalytics.Conditionality? Conditionality { get { throw null; } }
251+
}
252+
public partial class HealthcareEntityRelation
253+
{
254+
internal HealthcareEntityRelation() { }
255+
public Azure.AI.TextAnalytics.HealthcareEntityRelationType RelationType { get { throw null; } }
256+
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.HealthcareEntityRelationRole> Roles { get { throw null; } }
257+
}
258+
public partial class HealthcareEntityRelationRole
259+
{
260+
internal HealthcareEntityRelationRole() { }
261+
public Azure.AI.TextAnalytics.HealthcareEntity Entity { get { throw null; } }
262+
public string Name { get { throw null; } }
263+
}
225264
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
226265
public readonly partial struct HealthcareEntityRelationType : System.IEquatable<Azure.AI.TextAnalytics.HealthcareEntityRelationType>
227266
{
228267
private readonly object _dummy;
229268
private readonly int _dummyPrimitive;
230-
public static readonly Azure.AI.TextAnalytics.HealthcareEntityRelationType DirectionOfBodyStructure;
231-
public static readonly Azure.AI.TextAnalytics.HealthcareEntityRelationType DirectionOfExamination;
232-
public static readonly Azure.AI.TextAnalytics.HealthcareEntityRelationType DosageOfMedication;
233-
public static readonly Azure.AI.TextAnalytics.HealthcareEntityRelationType RelationOfExamination;
234-
public static readonly Azure.AI.TextAnalytics.HealthcareEntityRelationType TimeOfExamination;
269+
public HealthcareEntityRelationType(string value) { throw null; }
270+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType Abbreviation { get { throw null; } }
271+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType DirectionOfBodyStructure { get { throw null; } }
272+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType DirectionOfCondition { get { throw null; } }
273+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType DirectionOfExamination { get { throw null; } }
274+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType DirectionOfTreatment { get { throw null; } }
275+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType DosageOfMedication { get { throw null; } }
276+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType FormOfMedication { get { throw null; } }
277+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType FrequencyOfMedication { get { throw null; } }
278+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType FrequencyOfTreatment { get { throw null; } }
279+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType QualifierOfCondition { get { throw null; } }
280+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType RelationOfExamination { get { throw null; } }
281+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType RouteOfMedication { get { throw null; } }
282+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType TimeOfCondition { get { throw null; } }
283+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType TimeOfEvent { get { throw null; } }
284+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType TimeOfExamination { get { throw null; } }
285+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType TimeOfMedication { get { throw null; } }
286+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType TimeOfTreatment { get { throw null; } }
287+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType UnitOfCondition { get { throw null; } }
288+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType UnitOfExamination { get { throw null; } }
289+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType ValueOfCondition { get { throw null; } }
290+
public static Azure.AI.TextAnalytics.HealthcareEntityRelationType ValueOfExamination { get { throw null; } }
235291
public bool Equals(Azure.AI.TextAnalytics.HealthcareEntityRelationType other) { throw null; }
236292
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
237293
public override bool Equals(object obj) { throw null; }
238294
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
239295
public override int GetHashCode() { throw null; }
240296
public static bool operator ==(Azure.AI.TextAnalytics.HealthcareEntityRelationType left, Azure.AI.TextAnalytics.HealthcareEntityRelationType right) { throw null; }
241-
public static explicit operator string (Azure.AI.TextAnalytics.HealthcareEntityRelationType relationtype) { throw null; }
242-
public static implicit operator Azure.AI.TextAnalytics.HealthcareEntityRelationType (string relationtype) { throw null; }
297+
public static implicit operator Azure.AI.TextAnalytics.HealthcareEntityRelationType (string value) { throw null; }
243298
public static bool operator !=(Azure.AI.TextAnalytics.HealthcareEntityRelationType left, Azure.AI.TextAnalytics.HealthcareEntityRelationType right) { throw null; }
244299
public override string ToString() { throw null; }
245300
}

sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesResult.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ public partial class AnalyzeHealthcareEntitiesResult : TextAnalyticsResult
1616

1717
internal AnalyzeHealthcareEntitiesResult(string id, TextDocumentStatistics statistics,
1818
IList<HealthcareEntity> healthcareEntities,
19+
IList<HealthcareEntityRelation> entityRelations,
1920
IList<TextAnalyticsWarning> warnings)
2021
: base(id, statistics)
2122
{
2223
_entities = new ReadOnlyCollection<HealthcareEntity>(healthcareEntities);
2324
Warnings = new ReadOnlyCollection<TextAnalyticsWarning>(warnings);
25+
EntityRelations = new ReadOnlyCollection<HealthcareEntityRelation>(entityRelations);
2426
}
2527

2628
internal AnalyzeHealthcareEntitiesResult(string id, TextAnalyticsError error) : base(id, error) { }
@@ -44,5 +46,10 @@ public IReadOnlyCollection<HealthcareEntity> Entities
4446
return _entities;
4547
}
4648
}
49+
50+
/// <summary>
51+
/// Gets the relations between the entities. <see cref="HealthcareEntityRelation"/>
52+
/// </summary>
53+
public IReadOnlyCollection<HealthcareEntityRelation> EntityRelations { get; }
4754
}
4855
}

sdk/textanalytics/Azure.AI.TextAnalytics/src/Association.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33

44
using Azure.Core;
55

6-
namespace Azure.AI.TextAnalytics.Models
6+
namespace Azure.AI.TextAnalytics
77
{
8+
/// <summary>
9+
/// Determines the association of <see cref="HealthcareEntityAssertion"/>
10+
/// </summary>
811
[CodeGenModel("Association")]
9-
internal enum Association
12+
public enum Association
1013
{
1114
/// <summary> subject. </summary>
1215
Subject,

sdk/textanalytics/Azure.AI.TextAnalytics/src/Certainty.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33

44
using Azure.Core;
55

6-
namespace Azure.AI.TextAnalytics.Models
6+
namespace Azure.AI.TextAnalytics
77
{
8+
/// <summary>
9+
/// Determines the Certainity of the <see cref="HealthcareEntityAssertion"/>
10+
/// It can be Positive, PositivePossible, NuetralPossible, NegativePossible and Negative.
11+
/// </summary>
812
[CodeGenModel("Certainty")]
9-
internal enum Certainty
13+
public enum Certainty
1014
{
1115
/// <summary> Positive. </summary>
1216
Positive,

sdk/textanalytics/Azure.AI.TextAnalytics/src/Conditionality.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33

44
using Azure.Core;
55

6-
namespace Azure.AI.TextAnalytics.Models
6+
namespace Azure.AI.TextAnalytics
77
{
8+
/// <summary>
9+
/// Determines the condition of the <see cref="HealthcareEntityAssertion"/>
10+
/// </summary>
811
[CodeGenModel("Conditionality")]
9-
internal enum Conditionality
12+
public enum Conditionality
1013
{
11-
/// <summary> Hypothetical. </summary>
14+
/// <summary> Hypothetical. </summary>
1215
Hypothetical,
1316
/// <summary> Conditional. </summary>
1417
Conditional

sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Association.Serialization.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Certainty.Serialization.cs

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Conditionality.Serialization.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/HealthcareAssertion.Serialization.cs renamed to sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/HealthcareEntityAssertion.Serialization.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)