Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Azure AI - Health Insights] - Typespec revision for Health Insights API V3 (Radiology Insights) #27614

Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1285e5e
V3 - remove OncoPhenotype, TrialMatcher, PatientTimeline interfaces
asaflevi-ms Feb 1, 2024
df97c8c
update readme file
asaflevi-ms Feb 1, 2024
b238f6f
remove client.tsp from all models except RadiologyInsights
asaflevi-ms Feb 1, 2024
9a9168d
Revert "remove client.tsp from all models except RadiologyInsights"
asaflevi-ms Feb 1, 2024
db33fc2
revert and return client.tsp files
asaflevi-ms Feb 1, 2024
7135f60
Merge branch 'main' of https://github.com/asaflevi-ms/azure-rest-api-…
asaflevi-ms Feb 4, 2024
c2b476a
Merge branch 'main' of https://github.com/asaflevi-ms/azure-rest-api-…
asaflevi-ms Feb 6, 2024
a0c0d83
remove version dependency, also remove all other models except RI
asaflevi-ms Feb 6, 2024
b3bc545
Fix: request example
asaflevi-ms Feb 6, 2024
a7dc6db
prettier
asaflevi-ms Feb 6, 2024
63bf0a8
remove model RadiologyInsightsResult
asaflevi-ms Feb 6, 2024
1625080
remove deprecated operation templates
asaflevi-ms Feb 6, 2024
3e01196
move imports to main.tsp
asaflevi-ms Feb 7, 2024
a587d83
add imports to rout.radiologyinsights
asaflevi-ms Feb 7, 2024
d91f484
revert - remove imports from rout file
asaflevi-ms Feb 7, 2024
f2a5a18
rename patientInfo
asaflevi-ms Feb 7, 2024
f014297
add expand trait
asaflevi-ms Feb 7, 2024
b3de133
update example with details property
asaflevi-ms Feb 7, 2024
c984b63
add imports to rout.radiologyinsights
asaflevi-ms Feb 7, 2024
71ef87a
fix: API Stewardship board review comments
asaflevi-ms Feb 8, 2024
fcc65bb
fix: tsv
asaflevi-ms Feb 8, 2024
182ae9e
prettier
asaflevi-ms Feb 8, 2024
59ace56
communication.communicatedAt , recommendation.effectiveAt
asaflevi-ms Feb 8, 2024
21e1855
expand format csv
asaflevi-ms Feb 8, 2024
87bc77d
comments
asaflevi-ms Feb 8, 2024
7f404bc
fix: tsv
asaflevi-ms Feb 8, 2024
1ff243e
Merge branch 'main' of https://github.com/asaflevi-ms/azure-rest-api-…
asaflevi-ms Feb 9, 2024
861343d
remove unused client.tsp
asaflevi-ms Feb 9, 2024
5cda6af
update spec
asaflevi-ms Feb 9, 2024
8abe807
python package version
asaflevi-ms Feb 12, 2024
3cd7536
spread extensions
asaflevi-ms Feb 12, 2024
87f04e5
remove retry-after from put operation
asaflevi-ms Feb 12, 2024
548b716
Update specification/ai/data-plane/HealthInsights/readme.md
asaflevi-ms Feb 12, 2024
8bc59fc
Update specification/ai/data-plane/HealthInsights/readme.md
asaflevi-ms Feb 12, 2024
c4a26f7
Update specification/ai/data-plane/HealthInsights/readme.md
asaflevi-ms Feb 12, 2024
52dc366
Update specification/ai/data-plane/HealthInsights/readme.md
asaflevi-ms Feb 12, 2024
1498c98
update readme package version
asaflevi-ms Feb 12, 2024
7481629
add x-ms-request-id to default error response
asaflevi-ms Feb 13, 2024
2be9c12
fix: tsv
asaflevi-ms Feb 13, 2024
d064bd8
use Azure.Core.ExpandQueryParameter
asaflevi-ms Feb 13, 2024
e5d996d
fix: tsv
asaflevi-ms Feb 13, 2024
825911a
order procedure spread extendible
asaflevi-ms Feb 14, 2024
d6e6999
fix: tsv
asaflevi-ms Feb 14, 2024
d426c06
remove tspconfig files from Onco,PTL,CTM
asaflevi-ms Feb 22, 2024
cccc442
Merge branch 'main' into asaflevi/healthinsights-radiologyinsights-ap…
asaflevi-ms Feb 27, 2024
9d3d6f4
Merge branch 'main' into asaflevi/healthinsights-radiologyinsights-ap…
asaflevi-ms Mar 26, 2024
2160ae6
update openapi.json
asaflevi-ms Mar 26, 2024
e563502
Merge branch 'main' into asaflevi/healthinsights-radiologyinsights-ap…
asaflevi-ms Mar 27, 2024
e64e7d8
Merge branch 'main' into asaflevi/healthinsights-radiologyinsights-ap…
asaflevi-ms Mar 28, 2024
22e15e2
Merge branch 'main' into asaflevi/healthinsights-radiologyinsights-ap…
asaflevi-ms Apr 1, 2024
1e7ead8
fix: PUT/GET same schema
asaflevi-ms Apr 1, 2024
54c0687
fix: PR comments
asaflevi-ms Apr 2, 2024
f8e0f6a
alias retry after traits
asaflevi-ms Apr 2, 2024
7343a0d
revert interface rout(radiology-insights)
asaflevi-ms Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ A given identifier for the patient. Has to be unique across all patients in a si
@doc("""
Patient structured information, including demographics and known structured clinical information.
""")
info?: PatientInfo;
details?: PatientDetails;

@doc("Patient encounters/visits.")
encounters?: Array<Encounter>;
encounters?: Array<PatientEncounter>;

@doc("Patient unstructured clinical data, given as documents.")
patientDocuments?: Array<PatientDocument>;
}

@doc("Patient structured information, including demographics and known structured clinical information.")
model PatientInfo {
model PatientDetails {
@doc("The patient's sex.")
sex?: PatientInfoSex;
sex?: PatientSex;

@doc("The patient's date of birth.")
birthDate?: plainDate;
Expand All @@ -53,7 +53,7 @@ model PatientInfo {

#suppress "@azure-tools/typespec-azure-core/documentation-required" "MUST fix in next update"
@doc("The patient's sex.")
enum PatientInfoSex {
enum PatientSex {
Female: "female",
Male: "male",
Unspecified: "unspecified",
Expand Down Expand Up @@ -111,9 +111,10 @@ model PatientDocument {
language?: string;

@doc("The date and time when the document was created.")
createdDateTime?: utcDateTime;
createdAt?: utcDateTime;

@doc("Document author(s)")
@maxItems(1)
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved
authors?: Array<DocumentAuthor>;

@doc("specialty type the document")
Expand All @@ -137,8 +138,9 @@ model DocumentAdministrativeMetadata {
}

@doc("visit/encounter information")
model Encounter {
model PatientEncounter {
@doc("The id of the visit.")
@minLength(1)
id: string;

@doc("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,45 @@ using TypeSpec.Rest;

namespace AzureHealthInsights;

/**
* Provides status details for long running operations.
* @template TStatusResult The type of the operation status result.
* @template TStatusError The type of the operation status error. If not provided, the default error is used.
*/
@doc("Provides status details for long running operations.")
model HealthInsightsOperationStatus<
TStatusResult = never,
TStatusError = Foundations.Error
> {
@key("operationId")
@doc("The unique ID of the operation.")
@visibility("read")
id: Azure.Core.uuid;

@doc("The status of the operation")
@visibility("read")
@lroStatus
status: JobStatus;

@doc("The date and time when the processing job was created.")
@visibility("read")
createdDateTime?: utcDateTime;

@doc("The date and time when the processing job is set to expire.")
@visibility("read")
expirationDateTime?: utcDateTime;

@doc("The date and time when the processing job was last updated.")
@visibility("read")
lastUpdateDateTime?: utcDateTime;

@doc("Error object that describes the error when status is \"Failed\".")
error?: TStatusError;

@doc("The result of the operation.")
@lroResult
result?: TStatusResult;
}
// /**
// * Provides status details for long running operations.
// * @template TStatusResult The type of the operation status result.
// * @template TStatusError The type of the operation status error. If not provided, the default error is used.
// */
// @doc("Provides status details for long running operations.")
// model HealthInsightsOperationStatus<
// TStatusResult = never,
// TStatusError = Foundations.Error
// > {
// @key("operationId")
// @doc("The unique ID of the operation.")
// @visibility("read")
// id: Azure.Core.uuid;

// @doc("The status of the operation")
// @visibility("read")
// @lroStatus
// status: JobStatus;

// @doc("The date and time when the processing job was created.")
// @visibility("read")
// createdDateTime?: utcDateTime;

// @doc("The date and time when the processing job is set to expire.")
// @visibility("read")
// expirationDateTime?: utcDateTime;

// @doc("The date and time when the processing job was last updated.")
// @visibility("read")
// lastUpdateDateTime?: utcDateTime;

// @doc("Error object that describes the error when status is \"Failed\".")
// error?: TStatusError;

// @doc("The result of the operation.")
// @lroResult
// result?: TStatusResult;
// }
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved
////////////////// Inference //////////////////
@doc("An inference made by the model regarding a patient.")
model Inference {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
using TypeSpec.Http;
using TypeSpec.Rest;
using Azure.Core;

namespace AzureHealthInsights;

/**
* Provides HealthInsights resource details for long running operations.
* @template TRequest The type of the operation request data.
* @template TResult The type of the operation result.
* @template TStatusError The type of the operation status error. If not provided, the default error is used.
*/
// @TypeSpec.Versioning.added(AzureHealthInsights.ApiVersion.v2024_04_01)
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved
@doc("Provides status details for long running operations.")
model HealthInsightsJobBase {
@key("id")
@doc("The unique ID of the job.")
@visibility("read")
@maxLength(36)
@minLength(3)
@pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$")
@path
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved
id: string;

@doc("The status of the job.")
@visibility("read")
@lroStatus
status: JobStatus;

@doc("The date and time when the processing job was created.")
@visibility("read")
createdAt?: utcDateTime;

@doc("The date and time when the processing job is set to expire.")
@visibility("read")
expiresAt?: utcDateTime;

@doc("The date and time when the processing job was last updated.")
@visibility("read")
updatedAt?: utcDateTime;

@doc("Error object that describes the error when status is \"Failed\".")
@visibility("read")
error?: Foundations.Error;
}

@doc("ConditionStage")
model ConditionStage {
@doc("""
Expand Down Expand Up @@ -183,12 +225,14 @@ model TimePeriod {
}

@doc("Procedure information")
model OrderedProcedure is Fhir.R4.Extendible {
model OrderedProcedure {
@doc("Procedure code")
code?: Fhir.R4.CodeableConcept;

@doc("Procedure description")
description?: string;

...Fhir.R4.Extendible;
}

@doc("""
Expand Down
112 changes: 69 additions & 43 deletions specification/ai/HealthInsights/HealthInsights.Common/primitives.tsp
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,85 @@ using Azure.Core.Traits;

namespace AzureHealthInsights;

#suppress "@azure-tools/typespec-azure-core/long-running-polling-operation-required" "This is a template"
@doc("Long running RPC operation template")
op HealthInsightsLongRunningRpcOperation<
TParams extends TypeSpec.Reflection.Model,
TResponse extends TypeSpec.Reflection.Model,
TModelResult extends TypeSpec.Reflection.Model,
Traits extends TypeSpec.Reflection.Model = {}
> is Azure.Core.RpcOperation<
TParams & RepeatabilityRequestHeaders,
Foundations.AcceptedResponse<HealthInsightsLongRunningStatusLocation<TResponse> &
Foundations.RetryAfterHeader> &
RepeatabilityResponseHeaders &
HealthInsightsOperationStatus<TModelResult>,
Traits
>;
// #suppress "@azure-tools/typespec-azure-core/long-running-polling-operation-required" "This is a template"
// @doc("Long running RPC operation template")
// op HealthInsightsLongRunningRpcOperation<
// TParams extends TypeSpec.Reflection.Model,
// TResponse extends TypeSpec.Reflection.Model,
// TModelResult extends TypeSpec.Reflection.Model,
// Traits extends TypeSpec.Reflection.Model = {}
// > is Azure.Core.RpcOperation<
// TParams & RepeatabilityRequestHeaders,
// Foundations.AcceptedResponse<HealthInsightsLongRunningStatusLocation<TResponse> &
// Foundations.RetryAfterHeader> &
// RepeatabilityResponseHeaders &
// HealthInsightsOperationStatus<TModelResult>,
// Traits
// >;

#suppress "@azure-tools/typespec-azure-core/long-running-polling-operation-required" "This is a template"
@doc("Long running Pool operation template")
op HealthInsightsLongRunningPollOperation<TResult extends TypeSpec.Reflection.Model> is Azure.Core.RpcOperation<
{
@doc("A processing job identifier.")
@path("id")
id: Azure.Core.uuid;
},
TResult,
HealthInsightsRetryAfterTrait
>;
// #suppress "@azure-tools/typespec-azure-core/long-running-polling-operation-required" "This is a template"
// @doc("Long running Pool operation template")
// op HealthInsightsLongRunningPollOperation<TResult extends TypeSpec.Reflection.Model> is Azure.Core.RpcOperation<
// {
// @doc("A processing job identifier.")
// @path("id")
// id: Azure.Core.uuid;
// },
// TResult,
// HealthInsightsRetryAfterTrait
// >;

/**
* Metadata for long running operation status monitor locations.
* @template TStatusResult The type of the operation status result.
*/
@doc("Metadata for long running operation status monitor locations")
model HealthInsightsLongRunningStatusLocation<TStatusResult = never> {
@pollingLocation
@doc("The location for monitoring the operation state.")
@TypeSpec.Http.header("Operation-Location")
operationLocation: HealthInsightsResourceLocation<HealthInsightsOperationStatus<TStatusResult>>;
}
// /**
// * Metadata for long running operation status monitor locations.
// * @template TStatusResult The type of the operation status result.
// */
// @doc("Metadata for long running operation status monitor locations")
// model HealthInsightsLongRunningStatusLocation<TStatusResult = never> {
// @pollingLocation
// @doc("The location for monitoring the operation state.")
// @TypeSpec.Http.header("Operation-Location")
// operationLocation: HealthInsightsResourceLocation<HealthInsightsOperationStatus<TStatusResult>>;
// }

/**
* A URL that points to a resource.
* @template TResource The type of resource that the URL points to.
*/
@doc("The location of an instance of {name}", TResource)
scalar HealthInsightsResourceLocation<TResource extends {}> extends url;
// /**
// * A URL that points to a resource.
// * @template TResource The type of resource that the URL points to.
// */
// @doc("The location of an instance of {name}", TResource)
// scalar HealthInsightsResourceLocation<TResource extends {}> extends url;

@trait("HealthInsightsRetryAfterTrait")
@doc("Health Insights retry after trait")
model HealthInsightsRetryAfterTrait {
@traitContext(TraitContext.Read)
@doc("The retry-after header.")
retryAfter: {
@traitLocation(TraitLocation.Response)
response: Foundations.RetryAfterHeader;
};
}
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved
@doc("Provides the 'x-ms-request-id' header to enable request correlation in responses.")
@trait("RequestIdResponseHeader")
model RequestIdResponseHeaderTrait {
@doc("An opaque, globally-unique, server-generated string identifier for the request.")
requestId: {
@traitLocation(TraitLocation.Response)
response: RequestIdResponseHeader;
};
}
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved

alias ServiceTraits = NoRepeatableRequests &
NoConditionalRequests &
NoClientRequestId &
HealthInsightsRetryAfterTrait &
RequestIdResponseHeaderTrait &
asaflevi-ms marked this conversation as resolved.
Show resolved Hide resolved
QueryParametersTrait<Azure.Core.ExpandQueryParameter>;

model HealthInsightsErrorResponse is Azure.Core.Foundations.ErrorResponse {
...RequestIdResponseHeaderTrait;
}

alias HealthInsightsOperations = ResourceOperations<
ServiceTraits,
HealthInsightsErrorResponse
>;
Loading