@azure-rest/health-insights-cancerprofiling 1.0.0-alpha.20250224.1 → 1.0.0-alpha.20250225.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -110
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -58,44 +58,50 @@ The Cancer Profiling model allows you to infer cancer attributes such as tumor s
|
|
|
58
58
|
|
|
59
59
|
- [Infer Cancer Profiling](#cancer_profiling)
|
|
60
60
|
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
```ts snippet:ReadmeSampleInferCanerProfiling
|
|
62
|
+
import { AzureKeyCredential } from "@azure/core-auth";
|
|
63
|
+
import CancerProfilingRestClient, {
|
|
64
|
+
OncoPhenotypeData,
|
|
65
|
+
isUnexpected,
|
|
66
|
+
getLongRunningPoller,
|
|
67
|
+
} from "@azure-rest/health-insights-cancerprofiling";
|
|
68
|
+
|
|
69
|
+
const endpoint = "https://<your-endpoint>";
|
|
70
|
+
const apiKey = "<your-api-key>";
|
|
64
71
|
const credential = new AzureKeyCredential(apiKey);
|
|
65
72
|
const client = CancerProfilingRestClient(endpoint, credential);
|
|
66
73
|
|
|
67
|
-
// Define patient information and clinical documents
|
|
74
|
+
// Define patient information and clinical documents
|
|
68
75
|
const patientInfo = {
|
|
69
76
|
sex: "FEMALE",
|
|
70
77
|
birthDate: new Date("1979-10-08T00:00:00.000Z"), // Note: Months are zero-based (11 represents December)
|
|
71
78
|
};
|
|
72
79
|
|
|
73
|
-
const doc1 =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
80
|
+
const doc1 = `15.8.2021
|
|
81
|
+
Jane Doe 091175-8967
|
|
82
|
+
42 year old female, married with 3 children, works as a nurse.
|
|
83
|
+
Healthy, no medications taken on a regular basis.
|
|
84
|
+
PMHx is significant for migraines with aura, uses Mirena for contraception.
|
|
85
|
+
Smoking history of 10 pack years (has stopped and relapsed several times).
|
|
86
|
+
She is in c/o 2 weeks of productive cough and shortness of breath.
|
|
87
|
+
She has a fever of 37.8 and general weakness.
|
|
88
|
+
Denies night sweats and rash. She denies symptoms of rhinosinusitis, asthma, and heartburn.
|
|
89
|
+
On PE:
|
|
90
|
+
GENERAL: mild pallor, no cyanosis. Regular breathing rate.
|
|
91
|
+
LUNGS: decreased breath sounds on the base of the right lung. Vesicular breathing.
|
|
92
|
+
No crackles, rales, and wheezes. Resonant percussion.
|
|
93
|
+
PLAN:
|
|
94
|
+
Will be referred for a chest x-ray.
|
|
95
|
+
======================================
|
|
96
|
+
CXR showed mild nonspecific opacities in right lung base.
|
|
97
|
+
PLAN:
|
|
98
|
+
Findings are suggestive of a working diagnosis of pneumonia. The patient is referred to a
|
|
99
|
+
follow-up CXR in 2 weeks.`;
|
|
93
100
|
|
|
94
101
|
const docContent = {
|
|
95
102
|
sourceType: "INLINE",
|
|
96
103
|
value: doc1,
|
|
97
104
|
};
|
|
98
|
-
|
|
99
105
|
const patientDoc1 = {
|
|
100
106
|
type: "NOTE",
|
|
101
107
|
id: "doc1",
|
|
@@ -105,76 +111,77 @@ const patientDoc1 = {
|
|
|
105
111
|
createdDateTime: new Date("2021-15-08T00:00:00.000Z"),
|
|
106
112
|
};
|
|
107
113
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
// Define patientDoc2 and patientDoc3 similarly
|
|
115
|
+
const doc2 = `Oncology Clinic
|
|
116
|
+
20.10.2021
|
|
117
|
+
Jane Doe 091175-8967
|
|
118
|
+
42-year-old healthy female who works as a nurse in the ER of this hospital.
|
|
119
|
+
First menstruation at 11 years old. First delivery- 27 years old. She has 3 children.
|
|
120
|
+
Didn’t breastfeed.
|
|
121
|
+
Contraception- Mirena.
|
|
122
|
+
Smoking- 10 pack years.
|
|
123
|
+
Mother- Belarusian. Father- Georgian.
|
|
124
|
+
About 3 months prior to admission, she stated she had SOB and was febrile.
|
|
125
|
+
She did a CXR as an outpatient which showed a finding in the base of the right lung-
|
|
126
|
+
possibly an infiltrate.
|
|
127
|
+
She was treated with antibiotics with partial response.
|
|
128
|
+
6 weeks later a repeat CXR was performed- a few solid dense findings in the right lung.
|
|
129
|
+
Therefore, she was referred for a PET-CT which demonstrated increased uptake in the right
|
|
130
|
+
breast, lymph nodes on the right a few areas in the lungs and liver.
|
|
131
|
+
On biopsy from the lesion in the right breast- triple negative adenocarcinoma. Genetic
|
|
132
|
+
testing has not been done thus far.
|
|
133
|
+
Genetic counseling- the patient denies a family history of breast, ovary, uterus,
|
|
134
|
+
and prostate cancer. Her mother has chronic lymphocytic leukemia (CLL).
|
|
135
|
+
She is planned to undergo genetic tests because the aggressive course of the disease,
|
|
136
|
+
and her young age.
|
|
137
|
+
Impression:
|
|
138
|
+
Stage 4 triple negative breast adenocarcinoma.
|
|
139
|
+
Could benefit from biological therapy.
|
|
140
|
+
Different treatment options were explained- the patient wants to get a second opinion.`;
|
|
128
141
|
|
|
129
|
-
const
|
|
142
|
+
const docContent2 = {
|
|
130
143
|
sourceType: "INLINE",
|
|
131
|
-
value:
|
|
144
|
+
value: doc2,
|
|
132
145
|
};
|
|
133
146
|
|
|
134
|
-
const
|
|
147
|
+
const patientDoc2 = {
|
|
135
148
|
type: "NOTE",
|
|
136
|
-
id: "
|
|
137
|
-
content:
|
|
138
|
-
clinicalType: "
|
|
149
|
+
id: "doc2",
|
|
150
|
+
content: docContent2,
|
|
151
|
+
clinicalType: "PATHOLOGY",
|
|
139
152
|
language: "en",
|
|
140
|
-
createdDateTime: new Date("2021-
|
|
153
|
+
createdDateTime: new Date("2021-10-20T00:00:00.000Z"),
|
|
141
154
|
};
|
|
142
155
|
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
Impression:
|
|
166
|
-
Stage 4 triple negative breast adenocarcinoma.
|
|
167
|
-
Could benefit from biological therapy.
|
|
168
|
-
Different treatment options were explained- the patient wants to get a second opinion.`;
|
|
169
|
-
|
|
170
|
-
const docContent2 = {
|
|
156
|
+
const doc3 = `PATHOLOGY REPORT
|
|
157
|
+
Clinical Information
|
|
158
|
+
Ultrasound-guided biopsy; A. 18 mm mass; most likely diagnosis based on imaging: IDC
|
|
159
|
+
Diagnosis
|
|
160
|
+
A. BREAST, LEFT AT 2:00 4 CM FN; ULTRASOUND-GUIDED NEEDLE CORE BIOPSIES:
|
|
161
|
+
- Invasive carcinoma of no special type (invasive ductal carcinoma), grade 1
|
|
162
|
+
Nottingham histologic grade: 1/3 (tubules 2; nuclear grade 2; mitotic rate 1;
|
|
163
|
+
total score; 5/9)
|
|
164
|
+
Fragments involved by invasive carcinoma: 2
|
|
165
|
+
Largest measurement of invasive carcinoma on a single fragment: 7 mm
|
|
166
|
+
Ductal carcinoma in situ (DCIS): Present
|
|
167
|
+
Architectural pattern: Cribriform
|
|
168
|
+
Nuclear grade: 2-
|
|
169
|
+
-intermediate
|
|
170
|
+
Necrosis: Not identified
|
|
171
|
+
Fragments involved by DCIS: 1
|
|
172
|
+
Largest measurement of DCIS on a single fragment: Span 2 mm
|
|
173
|
+
Microcalcifications: Present in benign breast tissue and invasive carcinoma
|
|
174
|
+
Blocks with invasive carcinoma: A1
|
|
175
|
+
Special studies: Pending`;
|
|
176
|
+
|
|
177
|
+
const docContent3 = {
|
|
171
178
|
sourceType: "INLINE",
|
|
172
|
-
value:
|
|
179
|
+
value: doc3,
|
|
173
180
|
};
|
|
174
181
|
|
|
175
|
-
const
|
|
182
|
+
const patientDoc3 = {
|
|
176
183
|
type: "NOTE",
|
|
177
|
-
id: "
|
|
184
|
+
id: "doc3",
|
|
178
185
|
content: docContent3,
|
|
179
186
|
clinicalType: "PATHOLOGY",
|
|
180
187
|
language: "en",
|
|
@@ -184,7 +191,7 @@ const patientDoc2 = {
|
|
|
184
191
|
const patient1 = {
|
|
185
192
|
id: "patient_id",
|
|
186
193
|
info: patientInfo,
|
|
187
|
-
data: [patientDoc1, patientDoc2],
|
|
194
|
+
data: [patientDoc1, patientDoc2, patientDoc3],
|
|
188
195
|
};
|
|
189
196
|
|
|
190
197
|
const cancerProfilingData: OncoPhenotypeData = {
|
|
@@ -199,41 +206,34 @@ const parameters = {
|
|
|
199
206
|
// Initiate cancer profiling job and retrieve results
|
|
200
207
|
const initialResponse = await client.path("/oncophenotype/jobs").post(parameters);
|
|
201
208
|
if (isUnexpected(initialResponse)) {
|
|
202
|
-
throw initialResponse;
|
|
209
|
+
throw initialResponse.body.error;
|
|
203
210
|
}
|
|
211
|
+
|
|
204
212
|
const poller = await getLongRunningPoller(client, initialResponse);
|
|
205
213
|
const cancerProfilingResult = await poller.pollUntilDone();
|
|
206
214
|
if (isUnexpected(cancerProfilingResult)) {
|
|
207
|
-
throw cancerProfilingResult;
|
|
215
|
+
throw cancerProfilingResult.body.error;
|
|
208
216
|
}
|
|
217
|
+
|
|
209
218
|
const resultBody = cancerProfilingResult.body;
|
|
210
219
|
// Print the inference results for a patient's cancer attributes
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
);
|
|
225
|
-
}
|
|
220
|
+
const results = resultBody.results;
|
|
221
|
+
if (results) {
|
|
222
|
+
for (const patientResult of results.patients) {
|
|
223
|
+
console.log(`Inferences of Patient ${patientResult.id}`);
|
|
224
|
+
for (const { type, value, confidenceScore, evidence } of patientResult.inferences) {
|
|
225
|
+
console.log(
|
|
226
|
+
`Clinical Type: ${String(type)} Value: ${value}, ConfidenceScore: ${confidenceScore}`,
|
|
227
|
+
);
|
|
228
|
+
for (const { patientDataEvidence } of evidence || []) {
|
|
229
|
+
if (patientDataEvidence) {
|
|
230
|
+
console.log(
|
|
231
|
+
`Evidence: ${patientDataEvidence.id} ${patientDataEvidence.offset} ${patientDataEvidence.length} ${patientDataEvidence.text}`,
|
|
232
|
+
);
|
|
226
233
|
}
|
|
227
234
|
}
|
|
228
235
|
}
|
|
229
236
|
}
|
|
230
|
-
} else {
|
|
231
|
-
const errors = cancerProfilingResult.errors;
|
|
232
|
-
if (errors) {
|
|
233
|
-
for (const error of errors) {
|
|
234
|
-
console.log(error.code, ":", error.message);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
237
|
}
|
|
238
238
|
```
|
|
239
239
|
|
|
@@ -243,8 +243,8 @@ if (cancerProfilingResult.status === "succeeded") {
|
|
|
243
243
|
|
|
244
244
|
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
245
245
|
|
|
246
|
-
```
|
|
247
|
-
|
|
246
|
+
```ts snippet:SetLogLevel
|
|
247
|
+
import { setLogLevel } from "@azure/logger";
|
|
248
248
|
|
|
249
249
|
setLogLevel("info");
|
|
250
250
|
```
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/health-insights-cancerprofiling",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-alpha.
|
|
5
|
+
"version": "1.0.0-alpha.20250225.1",
|
|
6
6
|
"description": "A generated SDK for Health Insights Cancer Profiling Rest",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
54
54
|
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
|
|
55
55
|
"unit-test:node": "dev-tool run test:vitest",
|
|
56
|
-
"update-snippets": "
|
|
56
|
+
"update-snippets": "dev-tool run update-snippets"
|
|
57
57
|
},
|
|
58
58
|
"sideEffects": false,
|
|
59
59
|
"autoPublish": false,
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@azure/abort-controller": "^2.1.2",
|
|
63
63
|
"@azure/core-auth": "^1.9.0",
|
|
64
64
|
"@azure/core-lro": "^2.7.2",
|
|
65
|
-
"@azure/core-rest-pipeline": "^1.
|
|
65
|
+
"@azure/core-rest-pipeline": "^1.19.0",
|
|
66
66
|
"@azure/logger": "^1.1.4",
|
|
67
67
|
"tslib": "^2.8.1"
|
|
68
68
|
},
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
"@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
|
|
73
73
|
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
|
|
74
74
|
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
|
|
75
|
-
"@azure/identity": "^4.0
|
|
75
|
+
"@azure/identity": "^4.7.0",
|
|
76
76
|
"@types/node": "^18.0.0",
|
|
77
|
-
"@vitest/browser": "^3.0.
|
|
78
|
-
"@vitest/coverage-istanbul": "^3.0.
|
|
77
|
+
"@vitest/browser": "^3.0.6",
|
|
78
|
+
"@vitest/coverage-istanbul": "^3.0.6",
|
|
79
79
|
"autorest": "latest",
|
|
80
80
|
"dotenv": "^16.0.0",
|
|
81
81
|
"eslint": "^9.9.0",
|
|
82
|
-
"playwright": "^1.
|
|
82
|
+
"playwright": "^1.50.1",
|
|
83
83
|
"typescript": "~5.7.2",
|
|
84
|
-
"vitest": "^3.0.
|
|
84
|
+
"vitest": "^3.0.6"
|
|
85
85
|
},
|
|
86
86
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthinsights/health-insights-cancerprofiling-rest/README.md",
|
|
87
87
|
"//metadata": {
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
},
|
|
95
95
|
"browser": "./dist/browser/index.js",
|
|
96
96
|
"//sampleConfiguration": {
|
|
97
|
-
"productName": "
|
|
97
|
+
"productName": "HealthInsightsCancerprofiling",
|
|
98
98
|
"productSlugs": [
|
|
99
99
|
"azure"
|
|
100
100
|
],
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
"type": "module",
|
|
105
105
|
"tshy": {
|
|
106
|
+
"project": "./tsconfig.src.json",
|
|
106
107
|
"exports": {
|
|
107
108
|
"./package.json": "./package.json",
|
|
108
109
|
".": "./src/index.ts"
|
|
@@ -115,8 +116,7 @@
|
|
|
115
116
|
"browser",
|
|
116
117
|
"react-native"
|
|
117
118
|
],
|
|
118
|
-
"selfLink": false
|
|
119
|
-
"project": "./tsconfig.src.json"
|
|
119
|
+
"selfLink": false
|
|
120
120
|
},
|
|
121
121
|
"exports": {
|
|
122
122
|
"./package.json": "./package.json",
|
|
@@ -138,5 +138,6 @@
|
|
|
138
138
|
"default": "./dist/commonjs/index.js"
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
}
|
|
141
|
+
},
|
|
142
|
+
"react-native": "./dist/react-native/index.js"
|
|
142
143
|
}
|