phenoml 8.0.0 → 9.1.0
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/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/construe/client/Client.d.ts +35 -0
- package/dist/cjs/api/resources/construe/client/Client.js +92 -0
- package/dist/cjs/api/resources/construe/client/requests/FeedbackRequest.d.ts +31 -0
- package/dist/cjs/api/resources/construe/client/requests/FeedbackRequest.js +3 -0
- package/dist/cjs/api/resources/construe/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/construe/types/FeedbackResponse.d.ts +4 -0
- package/dist/cjs/api/resources/construe/types/FeedbackResponse.js +3 -0
- package/dist/cjs/api/resources/construe/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/construe/types/index.js +1 -0
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +2 -10
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.js +0 -9
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/construe/client/Client.d.mts +35 -0
- package/dist/esm/api/resources/construe/client/Client.mjs +92 -0
- package/dist/esm/api/resources/construe/client/requests/FeedbackRequest.d.mts +31 -0
- package/dist/esm/api/resources/construe/client/requests/FeedbackRequest.mjs +2 -0
- package/dist/esm/api/resources/construe/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/construe/types/FeedbackResponse.d.mts +4 -0
- package/dist/esm/api/resources/construe/types/FeedbackResponse.mjs +2 -0
- package/dist/esm/api/resources/construe/types/index.d.mts +1 -0
- package/dist/esm/api/resources/construe/types/index.mjs +1 -0
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +2 -10
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.mjs +1 -8
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +82 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -52,8 +52,8 @@ class phenomlClient {
|
|
|
52
52
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
|
|
53
53
|
"X-Fern-Language": "JavaScript",
|
|
54
54
|
"X-Fern-SDK-Name": "phenoml",
|
|
55
|
-
"X-Fern-SDK-Version": "
|
|
56
|
-
"User-Agent": "phenoml/
|
|
55
|
+
"X-Fern-SDK-Version": "9.1.0",
|
|
56
|
+
"User-Agent": "phenoml/9.1.0",
|
|
57
57
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
58
58
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
59
59
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -218,6 +218,41 @@ export declare class Construe {
|
|
|
218
218
|
*/
|
|
219
219
|
semanticSearchEmbeddingBased(codesystem: string, request: phenoml.construe.GetConstrueCodesCodesystemSearchSemanticRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.SemanticSearchResponse>;
|
|
220
220
|
private __semanticSearchEmbeddingBased;
|
|
221
|
+
/**
|
|
222
|
+
* Submits user feedback on results from the Construe extraction endpoint.
|
|
223
|
+
* Feedback includes the full extraction result received and the result the user expected.
|
|
224
|
+
*
|
|
225
|
+
* @param {phenoml.construe.FeedbackRequest} request
|
|
226
|
+
* @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
|
|
227
|
+
*
|
|
228
|
+
* @throws {@link phenoml.construe.BadRequestError}
|
|
229
|
+
* @throws {@link phenoml.construe.UnauthorizedError}
|
|
230
|
+
* @throws {@link phenoml.construe.InternalServerError}
|
|
231
|
+
* @throws {@link phenoml.construe.ServiceUnavailableError}
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* await client.construe.submitFeedbackOnExtractionResults({
|
|
235
|
+
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
236
|
+
* received_result: {
|
|
237
|
+
* system: {},
|
|
238
|
+
* codes: [{
|
|
239
|
+
* code: "195967001",
|
|
240
|
+
* description: "Asthma",
|
|
241
|
+
* valid: true
|
|
242
|
+
* }]
|
|
243
|
+
* },
|
|
244
|
+
* expected_result: {
|
|
245
|
+
* system: {},
|
|
246
|
+
* codes: [{
|
|
247
|
+
* code: "195967001",
|
|
248
|
+
* description: "Asthma",
|
|
249
|
+
* valid: true
|
|
250
|
+
* }]
|
|
251
|
+
* }
|
|
252
|
+
* })
|
|
253
|
+
*/
|
|
254
|
+
submitFeedbackOnExtractionResults(request: phenoml.construe.FeedbackRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.FeedbackResponse>;
|
|
255
|
+
private __submitFeedbackOnExtractionResults;
|
|
221
256
|
/**
|
|
222
257
|
* Performs fast full-text search over code IDs and descriptions.
|
|
223
258
|
*
|
|
@@ -823,6 +823,98 @@ class Construe {
|
|
|
823
823
|
}
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Submits user feedback on results from the Construe extraction endpoint.
|
|
828
|
+
* Feedback includes the full extraction result received and the result the user expected.
|
|
829
|
+
*
|
|
830
|
+
* @param {phenoml.construe.FeedbackRequest} request
|
|
831
|
+
* @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
|
|
832
|
+
*
|
|
833
|
+
* @throws {@link phenoml.construe.BadRequestError}
|
|
834
|
+
* @throws {@link phenoml.construe.UnauthorizedError}
|
|
835
|
+
* @throws {@link phenoml.construe.InternalServerError}
|
|
836
|
+
* @throws {@link phenoml.construe.ServiceUnavailableError}
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
* await client.construe.submitFeedbackOnExtractionResults({
|
|
840
|
+
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
841
|
+
* received_result: {
|
|
842
|
+
* system: {},
|
|
843
|
+
* codes: [{
|
|
844
|
+
* code: "195967001",
|
|
845
|
+
* description: "Asthma",
|
|
846
|
+
* valid: true
|
|
847
|
+
* }]
|
|
848
|
+
* },
|
|
849
|
+
* expected_result: {
|
|
850
|
+
* system: {},
|
|
851
|
+
* codes: [{
|
|
852
|
+
* code: "195967001",
|
|
853
|
+
* description: "Asthma",
|
|
854
|
+
* valid: true
|
|
855
|
+
* }]
|
|
856
|
+
* }
|
|
857
|
+
* })
|
|
858
|
+
*/
|
|
859
|
+
submitFeedbackOnExtractionResults(request, requestOptions) {
|
|
860
|
+
return core.HttpResponsePromise.fromPromise(this.__submitFeedbackOnExtractionResults(request, requestOptions));
|
|
861
|
+
}
|
|
862
|
+
__submitFeedbackOnExtractionResults(request, requestOptions) {
|
|
863
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
864
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
865
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
866
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
867
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/feedback"),
|
|
868
|
+
method: "POST",
|
|
869
|
+
headers: _headers,
|
|
870
|
+
contentType: "application/json",
|
|
871
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
872
|
+
requestType: "json",
|
|
873
|
+
body: request,
|
|
874
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
875
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
876
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
877
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
878
|
+
logging: this._options.logging,
|
|
879
|
+
});
|
|
880
|
+
if (_response.ok) {
|
|
881
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
882
|
+
}
|
|
883
|
+
if (_response.error.reason === "status-code") {
|
|
884
|
+
switch (_response.error.statusCode) {
|
|
885
|
+
case 400:
|
|
886
|
+
throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
|
|
887
|
+
case 401:
|
|
888
|
+
throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
889
|
+
case 500:
|
|
890
|
+
throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
|
|
891
|
+
case 503:
|
|
892
|
+
throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
893
|
+
default:
|
|
894
|
+
throw new errors.phenomlError({
|
|
895
|
+
statusCode: _response.error.statusCode,
|
|
896
|
+
body: _response.error.body,
|
|
897
|
+
rawResponse: _response.rawResponse,
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
switch (_response.error.reason) {
|
|
902
|
+
case "non-json":
|
|
903
|
+
throw new errors.phenomlError({
|
|
904
|
+
statusCode: _response.error.statusCode,
|
|
905
|
+
body: _response.error.rawBody,
|
|
906
|
+
rawResponse: _response.rawResponse,
|
|
907
|
+
});
|
|
908
|
+
case "timeout":
|
|
909
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /construe/feedback.");
|
|
910
|
+
case "unknown":
|
|
911
|
+
throw new errors.phenomlError({
|
|
912
|
+
message: _response.error.errorMessage,
|
|
913
|
+
rawResponse: _response.rawResponse,
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
}
|
|
826
918
|
/**
|
|
827
919
|
* Performs fast full-text search over code IDs and descriptions.
|
|
828
920
|
*
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type * as phenoml from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
6
|
+
* received_result: {
|
|
7
|
+
* system: {},
|
|
8
|
+
* codes: [{
|
|
9
|
+
* code: "195967001",
|
|
10
|
+
* description: "Asthma",
|
|
11
|
+
* valid: true
|
|
12
|
+
* }]
|
|
13
|
+
* },
|
|
14
|
+
* expected_result: {
|
|
15
|
+
* system: {},
|
|
16
|
+
* codes: [{
|
|
17
|
+
* code: "195967001",
|
|
18
|
+
* description: "Asthma",
|
|
19
|
+
* valid: true
|
|
20
|
+
* }]
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
*/
|
|
24
|
+
export interface FeedbackRequest {
|
|
25
|
+
/** The natural language text that was used for code extraction */
|
|
26
|
+
text: string;
|
|
27
|
+
received_result: phenoml.construe.ExtractCodesResult;
|
|
28
|
+
expected_result: phenoml.construe.ExtractCodesResult;
|
|
29
|
+
/** Optional details explaining the feedback */
|
|
30
|
+
detail?: string;
|
|
31
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { DeleteConstrueCodesSystemsCodesystemRequest } from "./DeleteConstrueCodesSystemsCodesystemRequest.js";
|
|
2
2
|
export type { ExtractRequest } from "./ExtractRequest.js";
|
|
3
|
+
export type { FeedbackRequest } from "./FeedbackRequest.js";
|
|
3
4
|
export type { GetConstrueCodesCodesystemCodeIdRequest } from "./GetConstrueCodesCodesystemCodeIdRequest.js";
|
|
4
5
|
export type { GetConstrueCodesCodesystemRequest } from "./GetConstrueCodesCodesystemRequest.js";
|
|
5
6
|
export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConstrueCodesCodesystemSearchSemanticRequest.js";
|
|
@@ -9,6 +9,7 @@ export * from "./ExtractCodesResult.js";
|
|
|
9
9
|
export * from "./ExtractedCodeResult.js";
|
|
10
10
|
export * from "./ExtractRequestConfig.js";
|
|
11
11
|
export * from "./ExtractRequestSystem.js";
|
|
12
|
+
export * from "./FeedbackResponse.js";
|
|
12
13
|
export * from "./GetCodeResponse.js";
|
|
13
14
|
export * from "./GetCodeSystemDetailResponse.js";
|
|
14
15
|
export * from "./ListCodeSystemsResponse.js";
|
|
@@ -25,6 +25,7 @@ __exportStar(require("./ExtractCodesResult.js"), exports);
|
|
|
25
25
|
__exportStar(require("./ExtractedCodeResult.js"), exports);
|
|
26
26
|
__exportStar(require("./ExtractRequestConfig.js"), exports);
|
|
27
27
|
__exportStar(require("./ExtractRequestSystem.js"), exports);
|
|
28
|
+
__exportStar(require("./FeedbackResponse.js"), exports);
|
|
28
29
|
__exportStar(require("./GetCodeResponse.js"), exports);
|
|
29
30
|
__exportStar(require("./GetCodeSystemDetailResponse.js"), exports);
|
|
30
31
|
__exportStar(require("./ListCodeSystemsResponse.js"), exports);
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
export interface DocumentRequest {
|
|
10
10
|
/** FHIR version to use */
|
|
11
11
|
version: string;
|
|
12
|
-
/** Type of FHIR resource to create
|
|
13
|
-
resource:
|
|
12
|
+
/** Type of FHIR resource to create. Accepts any FHIR resource type or US Core profile name. */
|
|
13
|
+
resource: string;
|
|
14
14
|
/**
|
|
15
15
|
* Base64 encoded file content.
|
|
16
16
|
* Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
|
|
@@ -18,11 +18,3 @@ export interface DocumentRequest {
|
|
|
18
18
|
*/
|
|
19
19
|
content: string;
|
|
20
20
|
}
|
|
21
|
-
export declare namespace DocumentRequest {
|
|
22
|
-
/** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
|
|
23
|
-
const Resource: {
|
|
24
|
-
readonly Questionnaire: "questionnaire";
|
|
25
|
-
readonly Questionnaireresponse: "questionnaireresponse";
|
|
26
|
-
};
|
|
27
|
-
type Resource = (typeof Resource)[keyof typeof Resource];
|
|
28
|
-
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.DocumentRequest = void 0;
|
|
5
|
-
var DocumentRequest;
|
|
6
|
-
(function (DocumentRequest) {
|
|
7
|
-
/** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
|
|
8
|
-
DocumentRequest.Resource = {
|
|
9
|
-
Questionnaire: "questionnaire",
|
|
10
|
-
Questionnaireresponse: "questionnaireresponse",
|
|
11
|
-
};
|
|
12
|
-
})(DocumentRequest || (exports.DocumentRequest = DocumentRequest = {}));
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "9.1.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -16,8 +16,8 @@ export class phenomlClient {
|
|
|
16
16
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
|
|
17
17
|
"X-Fern-Language": "JavaScript",
|
|
18
18
|
"X-Fern-SDK-Name": "phenoml",
|
|
19
|
-
"X-Fern-SDK-Version": "
|
|
20
|
-
"User-Agent": "phenoml/
|
|
19
|
+
"X-Fern-SDK-Version": "9.1.0",
|
|
20
|
+
"User-Agent": "phenoml/9.1.0",
|
|
21
21
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
22
22
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
23
23
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -218,6 +218,41 @@ export declare class Construe {
|
|
|
218
218
|
*/
|
|
219
219
|
semanticSearchEmbeddingBased(codesystem: string, request: phenoml.construe.GetConstrueCodesCodesystemSearchSemanticRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.SemanticSearchResponse>;
|
|
220
220
|
private __semanticSearchEmbeddingBased;
|
|
221
|
+
/**
|
|
222
|
+
* Submits user feedback on results from the Construe extraction endpoint.
|
|
223
|
+
* Feedback includes the full extraction result received and the result the user expected.
|
|
224
|
+
*
|
|
225
|
+
* @param {phenoml.construe.FeedbackRequest} request
|
|
226
|
+
* @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
|
|
227
|
+
*
|
|
228
|
+
* @throws {@link phenoml.construe.BadRequestError}
|
|
229
|
+
* @throws {@link phenoml.construe.UnauthorizedError}
|
|
230
|
+
* @throws {@link phenoml.construe.InternalServerError}
|
|
231
|
+
* @throws {@link phenoml.construe.ServiceUnavailableError}
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* await client.construe.submitFeedbackOnExtractionResults({
|
|
235
|
+
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
236
|
+
* received_result: {
|
|
237
|
+
* system: {},
|
|
238
|
+
* codes: [{
|
|
239
|
+
* code: "195967001",
|
|
240
|
+
* description: "Asthma",
|
|
241
|
+
* valid: true
|
|
242
|
+
* }]
|
|
243
|
+
* },
|
|
244
|
+
* expected_result: {
|
|
245
|
+
* system: {},
|
|
246
|
+
* codes: [{
|
|
247
|
+
* code: "195967001",
|
|
248
|
+
* description: "Asthma",
|
|
249
|
+
* valid: true
|
|
250
|
+
* }]
|
|
251
|
+
* }
|
|
252
|
+
* })
|
|
253
|
+
*/
|
|
254
|
+
submitFeedbackOnExtractionResults(request: phenoml.construe.FeedbackRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.FeedbackResponse>;
|
|
255
|
+
private __submitFeedbackOnExtractionResults;
|
|
221
256
|
/**
|
|
222
257
|
* Performs fast full-text search over code IDs and descriptions.
|
|
223
258
|
*
|
|
@@ -787,6 +787,98 @@ export class Construe {
|
|
|
787
787
|
}
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
|
+
/**
|
|
791
|
+
* Submits user feedback on results from the Construe extraction endpoint.
|
|
792
|
+
* Feedback includes the full extraction result received and the result the user expected.
|
|
793
|
+
*
|
|
794
|
+
* @param {phenoml.construe.FeedbackRequest} request
|
|
795
|
+
* @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
|
|
796
|
+
*
|
|
797
|
+
* @throws {@link phenoml.construe.BadRequestError}
|
|
798
|
+
* @throws {@link phenoml.construe.UnauthorizedError}
|
|
799
|
+
* @throws {@link phenoml.construe.InternalServerError}
|
|
800
|
+
* @throws {@link phenoml.construe.ServiceUnavailableError}
|
|
801
|
+
*
|
|
802
|
+
* @example
|
|
803
|
+
* await client.construe.submitFeedbackOnExtractionResults({
|
|
804
|
+
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
805
|
+
* received_result: {
|
|
806
|
+
* system: {},
|
|
807
|
+
* codes: [{
|
|
808
|
+
* code: "195967001",
|
|
809
|
+
* description: "Asthma",
|
|
810
|
+
* valid: true
|
|
811
|
+
* }]
|
|
812
|
+
* },
|
|
813
|
+
* expected_result: {
|
|
814
|
+
* system: {},
|
|
815
|
+
* codes: [{
|
|
816
|
+
* code: "195967001",
|
|
817
|
+
* description: "Asthma",
|
|
818
|
+
* valid: true
|
|
819
|
+
* }]
|
|
820
|
+
* }
|
|
821
|
+
* })
|
|
822
|
+
*/
|
|
823
|
+
submitFeedbackOnExtractionResults(request, requestOptions) {
|
|
824
|
+
return core.HttpResponsePromise.fromPromise(this.__submitFeedbackOnExtractionResults(request, requestOptions));
|
|
825
|
+
}
|
|
826
|
+
__submitFeedbackOnExtractionResults(request, requestOptions) {
|
|
827
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
828
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
829
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
830
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
831
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/feedback"),
|
|
832
|
+
method: "POST",
|
|
833
|
+
headers: _headers,
|
|
834
|
+
contentType: "application/json",
|
|
835
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
836
|
+
requestType: "json",
|
|
837
|
+
body: request,
|
|
838
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
839
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
840
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
841
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
842
|
+
logging: this._options.logging,
|
|
843
|
+
});
|
|
844
|
+
if (_response.ok) {
|
|
845
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
846
|
+
}
|
|
847
|
+
if (_response.error.reason === "status-code") {
|
|
848
|
+
switch (_response.error.statusCode) {
|
|
849
|
+
case 400:
|
|
850
|
+
throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
|
|
851
|
+
case 401:
|
|
852
|
+
throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
853
|
+
case 500:
|
|
854
|
+
throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
|
|
855
|
+
case 503:
|
|
856
|
+
throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
857
|
+
default:
|
|
858
|
+
throw new errors.phenomlError({
|
|
859
|
+
statusCode: _response.error.statusCode,
|
|
860
|
+
body: _response.error.body,
|
|
861
|
+
rawResponse: _response.rawResponse,
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
switch (_response.error.reason) {
|
|
866
|
+
case "non-json":
|
|
867
|
+
throw new errors.phenomlError({
|
|
868
|
+
statusCode: _response.error.statusCode,
|
|
869
|
+
body: _response.error.rawBody,
|
|
870
|
+
rawResponse: _response.rawResponse,
|
|
871
|
+
});
|
|
872
|
+
case "timeout":
|
|
873
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /construe/feedback.");
|
|
874
|
+
case "unknown":
|
|
875
|
+
throw new errors.phenomlError({
|
|
876
|
+
message: _response.error.errorMessage,
|
|
877
|
+
rawResponse: _response.rawResponse,
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
}
|
|
790
882
|
/**
|
|
791
883
|
* Performs fast full-text search over code IDs and descriptions.
|
|
792
884
|
*
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type * as phenoml from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
6
|
+
* received_result: {
|
|
7
|
+
* system: {},
|
|
8
|
+
* codes: [{
|
|
9
|
+
* code: "195967001",
|
|
10
|
+
* description: "Asthma",
|
|
11
|
+
* valid: true
|
|
12
|
+
* }]
|
|
13
|
+
* },
|
|
14
|
+
* expected_result: {
|
|
15
|
+
* system: {},
|
|
16
|
+
* codes: [{
|
|
17
|
+
* code: "195967001",
|
|
18
|
+
* description: "Asthma",
|
|
19
|
+
* valid: true
|
|
20
|
+
* }]
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
*/
|
|
24
|
+
export interface FeedbackRequest {
|
|
25
|
+
/** The natural language text that was used for code extraction */
|
|
26
|
+
text: string;
|
|
27
|
+
received_result: phenoml.construe.ExtractCodesResult;
|
|
28
|
+
expected_result: phenoml.construe.ExtractCodesResult;
|
|
29
|
+
/** Optional details explaining the feedback */
|
|
30
|
+
detail?: string;
|
|
31
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { DeleteConstrueCodesSystemsCodesystemRequest } from "./DeleteConstrueCodesSystemsCodesystemRequest.mjs";
|
|
2
2
|
export type { ExtractRequest } from "./ExtractRequest.mjs";
|
|
3
|
+
export type { FeedbackRequest } from "./FeedbackRequest.mjs";
|
|
3
4
|
export type { GetConstrueCodesCodesystemCodeIdRequest } from "./GetConstrueCodesCodesystemCodeIdRequest.mjs";
|
|
4
5
|
export type { GetConstrueCodesCodesystemRequest } from "./GetConstrueCodesCodesystemRequest.mjs";
|
|
5
6
|
export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConstrueCodesCodesystemSearchSemanticRequest.mjs";
|
|
@@ -9,6 +9,7 @@ export * from "./ExtractCodesResult.mjs";
|
|
|
9
9
|
export * from "./ExtractedCodeResult.mjs";
|
|
10
10
|
export * from "./ExtractRequestConfig.mjs";
|
|
11
11
|
export * from "./ExtractRequestSystem.mjs";
|
|
12
|
+
export * from "./FeedbackResponse.mjs";
|
|
12
13
|
export * from "./GetCodeResponse.mjs";
|
|
13
14
|
export * from "./GetCodeSystemDetailResponse.mjs";
|
|
14
15
|
export * from "./ListCodeSystemsResponse.mjs";
|
|
@@ -9,6 +9,7 @@ export * from "./ExtractCodesResult.mjs";
|
|
|
9
9
|
export * from "./ExtractedCodeResult.mjs";
|
|
10
10
|
export * from "./ExtractRequestConfig.mjs";
|
|
11
11
|
export * from "./ExtractRequestSystem.mjs";
|
|
12
|
+
export * from "./FeedbackResponse.mjs";
|
|
12
13
|
export * from "./GetCodeResponse.mjs";
|
|
13
14
|
export * from "./GetCodeSystemDetailResponse.mjs";
|
|
14
15
|
export * from "./ListCodeSystemsResponse.mjs";
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
export interface DocumentRequest {
|
|
10
10
|
/** FHIR version to use */
|
|
11
11
|
version: string;
|
|
12
|
-
/** Type of FHIR resource to create
|
|
13
|
-
resource:
|
|
12
|
+
/** Type of FHIR resource to create. Accepts any FHIR resource type or US Core profile name. */
|
|
13
|
+
resource: string;
|
|
14
14
|
/**
|
|
15
15
|
* Base64 encoded file content.
|
|
16
16
|
* Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
|
|
@@ -18,11 +18,3 @@ export interface DocumentRequest {
|
|
|
18
18
|
*/
|
|
19
19
|
content: string;
|
|
20
20
|
}
|
|
21
|
-
export declare namespace DocumentRequest {
|
|
22
|
-
/** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
|
|
23
|
-
const Resource: {
|
|
24
|
-
readonly Questionnaire: "questionnaire";
|
|
25
|
-
readonly Questionnaireresponse: "questionnaireresponse";
|
|
26
|
-
};
|
|
27
|
-
type Resource = (typeof Resource)[keyof typeof Resource];
|
|
28
|
-
}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
3
|
-
(function (DocumentRequest) {
|
|
4
|
-
/** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
|
|
5
|
-
DocumentRequest.Resource = {
|
|
6
|
-
Questionnaire: "questionnaire",
|
|
7
|
-
Questionnaireresponse: "questionnaireresponse",
|
|
8
|
-
};
|
|
9
|
-
})(DocumentRequest || (DocumentRequest = {}));
|
|
2
|
+
export {};
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "9.1.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "9.1.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1877,6 +1877,88 @@ await client.construe.semanticSearchEmbeddingBased("ICD-10-CM", {
|
|
|
1877
1877
|
</dl>
|
|
1878
1878
|
|
|
1879
1879
|
|
|
1880
|
+
</dd>
|
|
1881
|
+
</dl>
|
|
1882
|
+
</details>
|
|
1883
|
+
|
|
1884
|
+
<details><summary><code>client.construe.<a href="/src/api/resources/construe/client/Client.ts">submitFeedbackOnExtractionResults</a>({ ...params }) -> phenoml.FeedbackResponse</code></summary>
|
|
1885
|
+
<dl>
|
|
1886
|
+
<dd>
|
|
1887
|
+
|
|
1888
|
+
#### 📝 Description
|
|
1889
|
+
|
|
1890
|
+
<dl>
|
|
1891
|
+
<dd>
|
|
1892
|
+
|
|
1893
|
+
<dl>
|
|
1894
|
+
<dd>
|
|
1895
|
+
|
|
1896
|
+
Submits user feedback on results from the Construe extraction endpoint.
|
|
1897
|
+
Feedback includes the full extraction result received and the result the user expected.
|
|
1898
|
+
</dd>
|
|
1899
|
+
</dl>
|
|
1900
|
+
</dd>
|
|
1901
|
+
</dl>
|
|
1902
|
+
|
|
1903
|
+
#### 🔌 Usage
|
|
1904
|
+
|
|
1905
|
+
<dl>
|
|
1906
|
+
<dd>
|
|
1907
|
+
|
|
1908
|
+
<dl>
|
|
1909
|
+
<dd>
|
|
1910
|
+
|
|
1911
|
+
```typescript
|
|
1912
|
+
await client.construe.submitFeedbackOnExtractionResults({
|
|
1913
|
+
text: "Patient has type 2 diabetes with hyperglycemia",
|
|
1914
|
+
received_result: {
|
|
1915
|
+
system: {},
|
|
1916
|
+
codes: [{
|
|
1917
|
+
code: "195967001",
|
|
1918
|
+
description: "Asthma",
|
|
1919
|
+
valid: true
|
|
1920
|
+
}]
|
|
1921
|
+
},
|
|
1922
|
+
expected_result: {
|
|
1923
|
+
system: {},
|
|
1924
|
+
codes: [{
|
|
1925
|
+
code: "195967001",
|
|
1926
|
+
description: "Asthma",
|
|
1927
|
+
valid: true
|
|
1928
|
+
}]
|
|
1929
|
+
}
|
|
1930
|
+
});
|
|
1931
|
+
|
|
1932
|
+
```
|
|
1933
|
+
</dd>
|
|
1934
|
+
</dl>
|
|
1935
|
+
</dd>
|
|
1936
|
+
</dl>
|
|
1937
|
+
|
|
1938
|
+
#### ⚙️ Parameters
|
|
1939
|
+
|
|
1940
|
+
<dl>
|
|
1941
|
+
<dd>
|
|
1942
|
+
|
|
1943
|
+
<dl>
|
|
1944
|
+
<dd>
|
|
1945
|
+
|
|
1946
|
+
**request:** `phenoml.construe.FeedbackRequest`
|
|
1947
|
+
|
|
1948
|
+
</dd>
|
|
1949
|
+
</dl>
|
|
1950
|
+
|
|
1951
|
+
<dl>
|
|
1952
|
+
<dd>
|
|
1953
|
+
|
|
1954
|
+
**requestOptions:** `Construe.RequestOptions`
|
|
1955
|
+
|
|
1956
|
+
</dd>
|
|
1957
|
+
</dl>
|
|
1958
|
+
</dd>
|
|
1959
|
+
</dl>
|
|
1960
|
+
|
|
1961
|
+
|
|
1880
1962
|
</dd>
|
|
1881
1963
|
</dl>
|
|
1882
1964
|
</details>
|