Skip to content

Commit

Permalink
[Text Analytics] Rename WellKnownFhirVersion enum to FhirVersion (Azu…
Browse files Browse the repository at this point in the history
  • Loading branch information
joseharriaga authored and Harshit-Shrivastava committed Feb 24, 2023
1 parent 454919e commit f461c4b
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 76 deletions.
6 changes: 6 additions & 0 deletions sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
### Features Added

### Breaking Changes
> Note: The following breaking changes only apply when upgrading from the previous beta version (5.3.0-beta.1) and do not impact stable versions.
- Renamed the `WellKnownFhirVersion` enum to `FhirVersion`.
- Changed the type of the `AnalyzeHealthcareEntitiesResult.FhirBundle` property from `IReadOnlyDictionary<string, object>` to `BinaryData`.
- Removed the `options` parameter from the following methods for consistency: `TextAnalyticsClient.DynamicClassify` and `TextAnalyticsClient.DynamicClassifyAsync`.
- Removed the `DynamicClassifyOptions` class.
- Added the `classificationType` parameter to the following methods: `TextAnalyticsClient.DynamicClassify`, `TextAnalyticsClient.DynamicClassifyAsync`, `TextAnalyticsClient.DynamicClassifyBatch` and `TextAnalyticsClient.DynamicClassifyBatchAsync`.

### Bugs Fixed

Expand Down
2 changes: 1 addition & 1 deletion sdk/textanalytics/Azure.AI.TextAnalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This table shows the relationship between SDK versions and supported API version
|SDK version |Supported API version of service
|-------------|-----------------------------------------------------|
|5.3.0-beta.1 | 3.0, 3.1, 2022-05-01, 2022-10-01-preview (default)
|5.3.0-beta.2 | 3.0, 3.1, 2022-05-01, 2022-10-01-preview (default)
|5.2.0 | 3.0, 3.1, 2022-05-01 (default)
|5.1.X | 3.0, 3.1 (default)
|5.0.0 | 3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public AnalyzeHealthcareEntitiesAction(Azure.AI.TextAnalytics.AnalyzeHealthcareE
public string ActionName { get { throw null; } set { } }
public bool? DisableServiceLogs { get { throw null; } set { } }
public Azure.AI.TextAnalytics.HealthcareDocumentType? DocumentType { get { throw null; } set { } }
public Azure.AI.TextAnalytics.WellKnownFhirVersion? FhirVersion { get { throw null; } set { } }
public Azure.AI.TextAnalytics.FhirVersion? FhirVersion { get { throw null; } set { } }
public string ModelVersion { get { throw null; } set { } }
}
public partial class AnalyzeHealthcareEntitiesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionResult
Expand Down Expand Up @@ -192,7 +192,7 @@ public AnalyzeHealthcareEntitiesOptions() { }
public string AutoDetectionDefaultLanguage { get { throw null; } set { } }
public string DisplayName { get { throw null; } set { } }
public Azure.AI.TextAnalytics.HealthcareDocumentType? DocumentType { get { throw null; } set { } }
public Azure.AI.TextAnalytics.WellKnownFhirVersion? FhirVersion { get { throw null; } set { } }
public Azure.AI.TextAnalytics.FhirVersion? FhirVersion { get { throw null; } set { } }
}
public partial class AnalyzeHealthcareEntitiesResult : Azure.AI.TextAnalytics.TextAnalyticsResult
{
Expand Down Expand Up @@ -627,6 +627,23 @@ internal ExtractKeyPhrasesResultCollection() : base (default(System.Collections.
public Azure.AI.TextAnalytics.TextDocumentBatchStatistics Statistics { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct FhirVersion : System.IEquatable<Azure.AI.TextAnalytics.FhirVersion>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public FhirVersion(string value) { throw null; }
public static Azure.AI.TextAnalytics.FhirVersion V4_0_1 { get { throw null; } }
public bool Equals(Azure.AI.TextAnalytics.FhirVersion other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static bool operator ==(Azure.AI.TextAnalytics.FhirVersion left, Azure.AI.TextAnalytics.FhirVersion right) { throw null; }
public static implicit operator Azure.AI.TextAnalytics.FhirVersion (string value) { throw null; }
public static bool operator !=(Azure.AI.TextAnalytics.FhirVersion left, Azure.AI.TextAnalytics.FhirVersion right) { throw null; }
public override string ToString() { throw null; }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct HealthcareDocumentType : System.IEquatable<Azure.AI.TextAnalytics.HealthcareDocumentType>
{
private readonly object _dummy;
Expand Down Expand Up @@ -2060,23 +2077,6 @@ internal WeightResolution() { }
public static bool operator !=(Azure.AI.TextAnalytics.WeightUnit left, Azure.AI.TextAnalytics.WeightUnit right) { throw null; }
public override string ToString() { throw null; }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct WellKnownFhirVersion : System.IEquatable<Azure.AI.TextAnalytics.WellKnownFhirVersion>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public WellKnownFhirVersion(string value) { throw null; }
public static Azure.AI.TextAnalytics.WellKnownFhirVersion V4_0_1 { get { throw null; } }
public bool Equals(Azure.AI.TextAnalytics.WellKnownFhirVersion other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static bool operator ==(Azure.AI.TextAnalytics.WellKnownFhirVersion left, Azure.AI.TextAnalytics.WellKnownFhirVersion right) { throw null; }
public static implicit operator Azure.AI.TextAnalytics.WellKnownFhirVersion (string value) { throw null; }
public static bool operator !=(Azure.AI.TextAnalytics.WellKnownFhirVersion left, Azure.AI.TextAnalytics.WellKnownFhirVersion right) { throw null; }
public override string ToString() { throw null; }
}
}
namespace Microsoft.Extensions.Azure
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public AnalyzeHealthcareEntitiesAction(AnalyzeHealthcareEntitiesOptions options)
/// in the result. If not set, the <see cref="AnalyzeHealthcareEntitiesResult.FhirBundle"/> will not be produced. For additional information, see
/// <see href="https://www.hl7.org/fhir/overview.html"/>.
/// </summary>
public WellKnownFhirVersion? FhirVersion { get; set; }
public FhirVersion? FhirVersion { get; set; }

/// <summary>
/// The document type, which can be provided as a hint to improve the production of the <see cref="AnalyzeHealthcareEntitiesResult.FhirBundle"/> when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public AnalyzeHealthcareEntitiesOptions()
/// <remarks>
/// This property only applies for <see cref="TextAnalyticsClientOptions.ServiceVersion.V2022_10_01_Preview"/>, and newer.
/// </remarks>
public WellKnownFhirVersion? FhirVersion { get; set; }
public FhirVersion? FhirVersion { get; set; }

/// <summary>
/// The document type, which can be provided as a hint to improve the production of the <see cref="AnalyzeHealthcareEntitiesResult.FhirBundle"/> when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public IReadOnlyCollection<HealthcareEntity> Entities

/// <summary>
/// The FHIR bundle that was produced for this document according to the specified
/// <see cref="WellKnownFhirVersion"/>. For additional information, see
/// <see cref="FhirVersion"/>. For additional information, see
/// <see href="https://www.hl7.org/fhir/overview.html"/>.
/// </summary>
public BinaryData FhirBundle { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
namespace Azure.AI.TextAnalytics
{
[CodeGenModel("FhirVersion")]
public readonly partial struct WellKnownFhirVersion
public readonly partial struct FhirVersion
{
#pragma warning disable CA1707 // Identifiers should not contain underscores
private const string V4_0_1Value = "4.0.1";

/// <summary> 4.0.1. </summary>
[CodeGenMember("Four01")]
public static WellKnownFhirVersion V4_0_1 { get; } = new WellKnownFhirVersion(V4_0_1Value);
public static FhirVersion V4_0_1 { get; } = new FhirVersion(V4_0_1Value);
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal partial class HealthcareEntitiesDocumentResultInternal
{
/// <summary>
/// The FHIR bundle that was produced for this document according to the specified
/// <see cref="WellKnownFhirVersion"/>. For additional information, see
/// <see cref="FhirVersion"/>. For additional information, see
/// <see href="https://www.hl7.org/fhir/overview.html"/>.
/// </summary>
[CodeGenMember("FhirBundle")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public async Task AnalyzeHealthcareEntitiesBatchWithFhirVersionTest()

AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments, new AnalyzeHealthcareEntitiesOptions
{
FhirVersion = WellKnownFhirVersion.V4_0_1,
FhirVersion = FhirVersion.V4_0_1,
DocumentType = HealthcareDocumentType.DischargeSummary
});

Expand Down Expand Up @@ -490,7 +490,7 @@ public void AnalyzeHealthcareEntitiesBatchWithFhirVersionThrows()

NotSupportedException ex = Assert.ThrowsAsync<NotSupportedException>(async () => await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments, new AnalyzeHealthcareEntitiesOptions
{
FhirVersion = WellKnownFhirVersion.V4_0_1,
FhirVersion = FhirVersion.V4_0_1,
}));

Assert.That(ex.Message.EndsWith("Use service API version 2022-10-01-preview or newer."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public async Task AnalyzeOperationAnalyzeHealthcareEntitiesWithFhirVersion()
{
new AnalyzeHealthcareEntitiesAction(new AnalyzeHealthcareEntitiesOptions()
{
FhirVersion = WellKnownFhirVersion.V4_0_1,
FhirVersion = FhirVersion.V4_0_1,
DocumentType = HealthcareDocumentType.DischargeSummary
}),
},
Expand Down

0 comments on commit f461c4b

Please sign in to comment.