@azure-rest/health-insights-clinicalmatching 1.0.0-alpha.20250224.1 → 1.0.0-alpha.20250226.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 +25 -19
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/package.json +12 -11
package/README.md
CHANGED
|
@@ -61,9 +61,16 @@ Trial Matcher provides the user of the services two main modes of operation: pat
|
|
|
61
61
|
|
|
62
62
|
- [Match Trials - Find potential eligible trials for a patient](#match-trials)
|
|
63
63
|
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
```ts snippet:ReadmeSampleMatchTrials
|
|
65
|
+
import { AzureKeyCredential } from "@azure/core-auth";
|
|
66
|
+
import ClinicalMatchingRestClient, {
|
|
67
|
+
isUnexpected,
|
|
68
|
+
getLongRunningPoller,
|
|
69
|
+
} from "@azure-rest/health-insights-clinicalmatching";
|
|
70
|
+
import { readFileSync } from "node:fs";
|
|
71
|
+
|
|
72
|
+
const endpoint = "https://<your-endpoint>";
|
|
73
|
+
const apiKey = "<your-api-key>";
|
|
67
74
|
const credential = new AzureKeyCredential(apiKey);
|
|
68
75
|
const client = ClinicalMatchingRestClient(endpoint, credential);
|
|
69
76
|
|
|
@@ -106,7 +113,10 @@ const patientInfo = {
|
|
|
106
113
|
birthDate: new Date("1965-11-26T00:00:00.000Z"), // Note: Months are zero-based (11 represents December)
|
|
107
114
|
clinicalInfo: clinicalInfoList,
|
|
108
115
|
};
|
|
109
|
-
const docContent = {
|
|
116
|
+
const docContent = {
|
|
117
|
+
sourceType: "INLINE",
|
|
118
|
+
value: readFileSync("./example-data/match_trial_fhir_data.txt").toString(),
|
|
119
|
+
};
|
|
110
120
|
const patientDataList = {
|
|
111
121
|
type: "fhirBundle",
|
|
112
122
|
id: "Consultation-14-Demo",
|
|
@@ -120,7 +130,11 @@ const patient1 = {
|
|
|
120
130
|
data: [patientDataList],
|
|
121
131
|
};
|
|
122
132
|
|
|
123
|
-
const geographicLocation = {
|
|
133
|
+
const geographicLocation = {
|
|
134
|
+
countryOrRegion: "United States",
|
|
135
|
+
city: "Gilbert",
|
|
136
|
+
state: "Arizona",
|
|
137
|
+
};
|
|
124
138
|
const registryFilters = {
|
|
125
139
|
conditions: ["Non-small cell lung cancer"],
|
|
126
140
|
phases: ["PHASE1"],
|
|
@@ -149,18 +163,17 @@ const trialMatcherParameter = {
|
|
|
149
163
|
// Initiate clinical matching job and retrieve results
|
|
150
164
|
const initialResponse = await client.path("/trialmatcher/jobs").post(trialMatcherParameter);
|
|
151
165
|
if (isUnexpected(initialResponse)) {
|
|
152
|
-
throw initialResponse;
|
|
166
|
+
throw initialResponse.body.error;
|
|
153
167
|
}
|
|
154
168
|
const poller = await getLongRunningPoller(client, initialResponse);
|
|
155
169
|
const trialMatcherResult = await poller.pollUntilDone();
|
|
156
170
|
if (isUnexpected(trialMatcherResult)) {
|
|
157
|
-
throw trialMatcherResult;
|
|
171
|
+
throw trialMatcherResult.body.error;
|
|
158
172
|
}
|
|
159
173
|
const resultBody = trialMatcherResult.body;
|
|
160
174
|
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
const results = resultBody.results;
|
|
175
|
+
const results = resultBody.results;
|
|
176
|
+
if (results) {
|
|
164
177
|
const patients = results.patients;
|
|
165
178
|
for (const patientResult of patients) {
|
|
166
179
|
console.log(`Inferences of Patient ${patientResult.id}`);
|
|
@@ -170,13 +183,6 @@ if (resultBody.status === "succeeded") {
|
|
|
170
183
|
console.log(`Description ${tmInferences.description}`);
|
|
171
184
|
}
|
|
172
185
|
}
|
|
173
|
-
} else {
|
|
174
|
-
const errors = trialMatcherResult.errors;
|
|
175
|
-
if (errors) {
|
|
176
|
-
for (const error of errors) {
|
|
177
|
-
console.log('${error.code} ":" ${error.message}');
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
186
|
}
|
|
181
187
|
```
|
|
182
188
|
|
|
@@ -186,8 +192,8 @@ if (resultBody.status === "succeeded") {
|
|
|
186
192
|
|
|
187
193
|
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`:
|
|
188
194
|
|
|
189
|
-
```
|
|
190
|
-
|
|
195
|
+
```ts snippet:SetLogLevel
|
|
196
|
+
import { setLogLevel } from "@azure/logger";
|
|
191
197
|
|
|
192
198
|
setLogLevel("info");
|
|
193
199
|
```
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/health-insights-clinicalmatching",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-alpha.
|
|
5
|
+
"version": "1.0.0-alpha.20250226.1",
|
|
6
6
|
"description": "A generated SDK for Health Insights Clinical Matching 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-clinicalmatching-rest/README.md",
|
|
87
87
|
"//metadata": {
|
|
@@ -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
|
}
|