Skip to content

Commit aa3618d

Browse files
authored
[Cognitive Services - Health Insights] CADL revision for public preview (#22990)
* health insights cadl + generated openapi spec * fix PR Comments * change country to countryOrRegion * split to multiple cadl projects * update cadl-project.yaml files * update example with generic contact details * update samples with generic contacts * convert cadl to typespec * update generated openapi spec * convert cadl to typespec (#4) * convert cadl to typespec * update generated openapi spec * move ClinicalNoteEvidence to common modules * remove redundant imports * fix typespec dependencies * remove dependencies from main.tsp * using rest * move imports from service.tsp to its caller * fix comment - directive error * remove imports from service.tsp
1 parent 806d161 commit aa3618d

29 files changed

+3872
-0
lines changed

custom-words.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ clientaccesspolicy
380380
clienterror
381381
clientgroup
382382
clientlib
383+
clinicaltrials
383384
clipart
384385
CLIs
385386
CLOGFILE
@@ -923,6 +924,7 @@ hdinsight
923924
Headnode
924925
healthbot
925926
healthcareapis
927+
healthinsights
926928
healthstatus
927929
hecto
928930
Heatbeat
@@ -1008,6 +1010,7 @@ integrationaccount
10081010
integrationruntimes
10091011
Intelli
10101012
intervaled
1013+
Interventional
10111014
Intraorg
10121015
intset
10131016
intune
@@ -1495,6 +1498,8 @@ OIDC
14951498
onboarded
14961499
Onboarding
14971500
Onboards
1501+
Onco
1502+
oncophenotype
14981503
ondemand
14991504
onedeploy
15001505
onmachine
@@ -1993,6 +1998,7 @@ snapshotset
19931998
snaptshot
19941999
SNAT
19952000
SNMP
2001+
SNOMED
19962002
Sobol
19972003
softwareplan
19982004
SOHSV
@@ -2231,6 +2237,7 @@ transcriptmoderationresult
22312237
transferkey
22322238
translatortext
22332239
trendingtopics
2240+
trialmatcher
22342241
triggeredwebjobs
22352242
triggerruns
22362243
TSVE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#### linux gitignore
2+
3+
# Ignore output files
4+
tsp-output
5+
package-lock.json
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import "./model.common.shared.tsp";
2+
3+
using TypeSpec.Rest;
4+
5+
namespace AzureHealthInsights;
6+
7+
alias Request = {
8+
@doc("The list of patients, including their clinical information and data.")
9+
patients: PatientRecord[];
10+
};
11+
12+
alias ModelConfiguration = {
13+
@doc("An indication whether the model should produce verbose output.")
14+
verbose?: boolean = false;
15+
16+
@doc("An indication whether the model's output should include evidence for the inferences.")
17+
includeEvidence?: boolean = true;
18+
};
19+
20+
@doc("A patient record, including their clinical information and data.")
21+
model PatientRecord {
22+
@doc("""
23+
A given identifier for the patient. Has to be unique across all patients in a single request.
24+
""")
25+
@minLength(1)
26+
id: string;
27+
28+
@doc("""
29+
Patient structured information, including demographics and known structured clinical information.
30+
""")
31+
info?: PatientInfo;
32+
33+
@doc("Patient unstructured clinical data, given as documents.")
34+
data?: PatientDocument[];
35+
}
36+
37+
@doc("Patient structured information, including demographics and known structured clinical information.")
38+
model PatientInfo {
39+
@doc("The patient's sex.")
40+
sex?: PatientInfoSex;
41+
42+
@doc("The patient's date of birth.")
43+
birthDate?: plainDate;
44+
45+
@doc("Known clinical information for the patient, structured.")
46+
clinicalInfo?: ClinicalCodedElement[];
47+
}
48+
49+
@doc("The patient's sex.")
50+
enum PatientInfoSex {
51+
Female: "female",
52+
Male: "male",
53+
Unspecified: "unspecified",
54+
}
55+
56+
@doc("The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document).")
57+
enum DocumentType {
58+
Note: "note",
59+
FhirBundle: "fhirBundle",
60+
Dicom: "dicom",
61+
GenomicSequencing: "genomicSequencing",
62+
}
63+
64+
@doc("The type of the clinical document.")
65+
enum ClinicalDocumentType {
66+
Consultation: "consultation",
67+
DischargeSummary: "dischargeSummary",
68+
HistoryAndPhysical: "historyAndPhysical",
69+
Procedure: "procedure",
70+
Progress: "progress",
71+
Imaging: "imaging",
72+
Laboratory: "laboratory",
73+
Pathology: "pathology",
74+
}
75+
76+
@doc("""
77+
The type of the content's source.
78+
In case the source type is 'inline', the content is given as a string (for instance, text).
79+
In case the source type is 'reference', the content is given as a URI.
80+
""")
81+
enum DocumentContentSourceType {
82+
Inline: "inline",
83+
Reference: "reference",
84+
}
85+
86+
@doc("A clinical document related to a patient. Document here is in the wide sense - not just a text document (note).")
87+
model PatientDocument {
88+
@doc("The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document).")
89+
type: DocumentType;
90+
91+
@doc("The type of the clinical document.")
92+
clinicalType?: ClinicalDocumentType;
93+
94+
@doc("A given identifier for the document. Has to be unique across all documents for a single patient.")
95+
@minLength(1)
96+
id: string;
97+
98+
@doc("A 2 letter ISO 639-1 representation of the language of the document.")
99+
language?: string;
100+
101+
@doc("The date and time when the document was created.")
102+
createdDateTime?: zonedDateTime;
103+
104+
@doc("The content of the patient document.")
105+
content: DocumentContent;
106+
}
107+
108+
@doc("The content of the patient document.")
109+
model DocumentContent {
110+
@doc("""
111+
The type of the content's source.
112+
In case the source type is 'inline', the content is given as a string (for instance, text).
113+
In case the source type is 'reference', the content is given as a URI.
114+
""")
115+
sourceType: DocumentContentSourceType;
116+
117+
@doc("""
118+
The content of the document, given either inline (as a string) or as a reference (URI).
119+
""")
120+
value: string;
121+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import "./model.common.shared.tsp";
2+
3+
using TypeSpec.Rest;
4+
5+
namespace AzureHealthInsights;
6+
7+
alias Response = {
8+
@doc("A processing job identifier.")
9+
@visibility("read")
10+
@key
11+
@format("uuid")
12+
jobId: string;
13+
14+
@doc("The date and time when the processing job was created.")
15+
@visibility("read")
16+
createdDateTime: zonedDateTime;
17+
18+
@doc("The date and time when the processing job is set to expire.")
19+
@visibility("read")
20+
expirationDateTime: zonedDateTime;
21+
22+
@doc("The date and time when the processing job was last updated.")
23+
@visibility("read")
24+
lastUpdateDateTime: zonedDateTime;
25+
26+
@doc("The status of the processing job.")
27+
@visibility("read")
28+
status: JobStatus;
29+
30+
@doc("An array of errors, if any errors occurred during the processing job.")
31+
@visibility("read")
32+
errors?: Azure.Core.Foundations.Error[];
33+
};
34+
35+
36+
@doc("An inference made by the model regarding a patient.")
37+
model Inference {
38+
@doc("The value of the inference, as relevant for the given inference type.")
39+
value: string;
40+
41+
@doc("The description corresponding to the inference value.")
42+
description?: string;
43+
44+
@doc("Confidence score for this inference.")
45+
@minValue(0)
46+
@maxValue(1)
47+
confidenceScore?: float32;
48+
}
49+
50+
@doc("A piece of evidence from a clinical note (text document).")
51+
model ClinicalNoteEvidence {
52+
@doc("The identifier of the document containing the evidence.")
53+
id: string;
54+
55+
@doc("The actual text span which is evidence for the inference.")
56+
text?: string;
57+
58+
@doc("The start index of the evidence text span in the document (0 based).")
59+
@minValue(0)
60+
offset: int32;
61+
62+
@doc("The length of the evidence text span.")
63+
@minValue(1)
64+
length: int32;
65+
}
66+
67+
@doc("A piece of evidence corresponding to an inference.")
68+
model InferenceEvidence {
69+
@doc("A piece of evidence from a clinical note (text document).")
70+
patientDataEvidence?: ClinicalNoteEvidence;
71+
72+
@doc("""
73+
A piece of clinical information, expressed as a code in a clinical coding
74+
system.
75+
""")
76+
patientInfoEvidence?: ClinicalCodedElement;
77+
78+
@doc("A value indicating how important this piece of evidence is for the inference.")
79+
@minValue(0)
80+
@maxValue(1)
81+
importance?: float32;
82+
}
83+
84+
@doc("A piece of evidence corresponding to a Trial Matcher inference.")
85+
model TrialMatcherInferenceEvidence {
86+
@doc("A piece of evidence from the eligibility criteria text of a clinical trial.")
87+
eligibilityCriteriaEvidence?: string;
88+
...InferenceEvidence;
89+
}
90+
91+
@doc("The status of the processing job.")
92+
enum JobStatus {
93+
NotStarted: "notStarted",
94+
Running: "running",
95+
Succeeded: "succeeded",
96+
Failed: "failed",
97+
PartiallyCompleted: "partiallyCompleted",
98+
}
99+
100+
@doc("The version of the model used for inference, expressed as the model date.")
101+
scalar ModelVersion extends string;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using TypeSpec.Rest;
2+
3+
namespace AzureHealthInsights;
4+
5+
@doc("""
6+
A piece of clinical information, expressed as a code in a clinical coding system.
7+
""")
8+
model ClinicalCodedElement {
9+
@doc("The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS.")
10+
system: string;
11+
12+
@doc("The code within the given clinical coding system.")
13+
code: string;
14+
15+
@doc("The name of this coded concept in the coding system.")
16+
name?: string;
17+
18+
@doc("A value associated with the code within the given clinical coding system.")
19+
value?: string;
20+
}
21+
22+
@doc("""
23+
A location given as a combination of city, state and country/region. It could specify a city, a state or a country/region.
24+
In case a city is specified, either state +country/region or country/region (for countries/regions where there are no states) should be added.
25+
In case a state is specified (without a city), country/region should be added.
26+
""")
27+
model GeographicLocation {
28+
@doc("City name.")
29+
city?: string;
30+
31+
@doc("State name.")
32+
state?: string;
33+
34+
@doc("Country/region name.")
35+
countryOrRegion: string;
36+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Azure.Core;
2+
using TypeSpec.Http;
3+
namespace AzureHealthInsights;
4+
5+
@doc("Long running RPC operation template")
6+
op LongRunningRpcOperation<
7+
TParams extends object,
8+
TResponse extends object,
9+
Traits extends object = {}
10+
> is RpcOperation<
11+
TParams & Traits,
12+
Foundations.AcceptedResponse<Traits &
13+
Foundations.LongRunningStatusLocation &
14+
Foundations.RetryAfterHeader &
15+
RepeatabilityResponseHeaders> | TResponse,
16+
Traits
17+
>;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import "@azure-tools/typespec-client-generator-core";
2+
import "./route.oncophenotype.tsp";
3+
4+
import "@typespec/rest";
5+
import "@typespec/http";
6+
import "@typespec/versioning";
7+
import "../healthinsights.openapi/service.tsp";
8+
9+
using Azure.ClientGenerator.Core;
10+
11+
namespace ClientForAzureHealthInsights;
12+
13+
@client({
14+
name: "CancerProfilingClient",
15+
service: AzureHealthInsights
16+
})
17+
interface CancerProfilingClient {
18+
InferCancerProfile is AzureHealthInsights.OncoPhenotype.CreateJob;
19+
}

0 commit comments

Comments
 (0)