saferx-pharma-sdk 0.0.36 → 0.0.39
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/BaseClient.js +2 -2
- package/dist/cjs/api/resources/drugSafety/client/Client.d.ts +30 -0
- package/dist/cjs/api/resources/drugSafety/client/Client.js +30 -0
- package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.ts +31 -0
- package/dist/cjs/api/types/DrugSafetyCheckResponse.d.ts +1 -0
- package/dist/cjs/api/types/IntelligenceClinicalProfile.d.ts +24 -0
- package/dist/cjs/api/types/IntelligenceClinicalProfile.js +13 -0
- package/dist/cjs/api/types/IntelligenceContext.d.ts +17 -0
- package/dist/cjs/api/types/IntelligenceContext.js +3 -0
- package/dist/cjs/api/types/IntelligenceProcessorError.d.ts +4 -0
- package/dist/cjs/api/types/IntelligenceProcessorError.js +3 -0
- package/dist/cjs/api/types/IntelligenceResult.d.ts +16 -0
- package/dist/cjs/api/types/IntelligenceResult.js +3 -0
- package/dist/cjs/api/types/IntelligenceSynthesis.d.ts +6 -0
- package/dist/cjs/api/types/IntelligenceSynthesis.js +3 -0
- package/dist/cjs/api/types/MedicationHistoryItem.d.ts +22 -0
- package/dist/cjs/api/types/MedicationHistoryItem.js +15 -0
- package/dist/cjs/api/types/index.d.ts +6 -0
- package/dist/cjs/api/types/index.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/drugSafety/client/Client.d.mts +30 -0
- package/dist/esm/api/resources/drugSafety/client/Client.mjs +30 -0
- package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.mts +31 -0
- package/dist/esm/api/types/DrugSafetyCheckResponse.d.mts +1 -0
- package/dist/esm/api/types/IntelligenceClinicalProfile.d.mts +24 -0
- package/dist/esm/api/types/IntelligenceClinicalProfile.mjs +10 -0
- package/dist/esm/api/types/IntelligenceContext.d.mts +17 -0
- package/dist/esm/api/types/IntelligenceContext.mjs +2 -0
- package/dist/esm/api/types/IntelligenceProcessorError.d.mts +4 -0
- package/dist/esm/api/types/IntelligenceProcessorError.mjs +2 -0
- package/dist/esm/api/types/IntelligenceResult.d.mts +16 -0
- package/dist/esm/api/types/IntelligenceResult.mjs +2 -0
- package/dist/esm/api/types/IntelligenceSynthesis.d.mts +6 -0
- package/dist/esm/api/types/IntelligenceSynthesis.mjs +2 -0
- package/dist/esm/api/types/MedicationHistoryItem.d.mts +22 -0
- package/dist/esm/api/types/MedicationHistoryItem.mjs +12 -0
- package/dist/esm/api/types/index.d.mts +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "saferx-pharma-sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "0.0.
|
|
47
|
-
"User-Agent": "saferx-pharma-sdk/0.0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.0.39",
|
|
47
|
+
"User-Agent": "saferx-pharma-sdk/0.0.39",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -51,6 +51,36 @@ export declare class DrugSafetyClient {
|
|
|
51
51
|
* @example
|
|
52
52
|
* await client.drugSafety.check({
|
|
53
53
|
* drugs: ["Augmentin 1g", "Marivan"],
|
|
54
|
+
* intelligence_context: {
|
|
55
|
+
* user_id: "patient-123",
|
|
56
|
+
* clinical_profile: {
|
|
57
|
+
* age: 72,
|
|
58
|
+
* crcl: 38,
|
|
59
|
+
* hepatic_status: "normal",
|
|
60
|
+
* pregnancy: false,
|
|
61
|
+
* lactation: false,
|
|
62
|
+
* conditions: ["renal impairment", "hypertension"],
|
|
63
|
+
* populations: ["geriatric", "renal"],
|
|
64
|
+
* allergies: ["penicillin"],
|
|
65
|
+
* diet_habits: ["low_sodium"]
|
|
66
|
+
* },
|
|
67
|
+
* medication_history: [{
|
|
68
|
+
* sfrx_id: "SRX-010-004748",
|
|
69
|
+
* start_date: "2026-01-10",
|
|
70
|
+
* status: "active"
|
|
71
|
+
* }, {
|
|
72
|
+
* sfrx_id: "SRX-050-000123",
|
|
73
|
+
* start_date: "2025-09-01",
|
|
74
|
+
* status: "historical"
|
|
75
|
+
* }]
|
|
76
|
+
* },
|
|
77
|
+
* include: ["ae", "ddi", "pllr", "clinical", "dose"],
|
|
78
|
+
* lang: "en"
|
|
79
|
+
* })
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.drugSafety.check({
|
|
83
|
+
* drugs: ["Augmentin 1g", "Marivan"],
|
|
54
84
|
* include: ["ddi"]
|
|
55
85
|
* })
|
|
56
86
|
*
|
|
@@ -96,6 +96,36 @@ class DrugSafetyClient {
|
|
|
96
96
|
* @example
|
|
97
97
|
* await client.drugSafety.check({
|
|
98
98
|
* drugs: ["Augmentin 1g", "Marivan"],
|
|
99
|
+
* intelligence_context: {
|
|
100
|
+
* user_id: "patient-123",
|
|
101
|
+
* clinical_profile: {
|
|
102
|
+
* age: 72,
|
|
103
|
+
* crcl: 38,
|
|
104
|
+
* hepatic_status: "normal",
|
|
105
|
+
* pregnancy: false,
|
|
106
|
+
* lactation: false,
|
|
107
|
+
* conditions: ["renal impairment", "hypertension"],
|
|
108
|
+
* populations: ["geriatric", "renal"],
|
|
109
|
+
* allergies: ["penicillin"],
|
|
110
|
+
* diet_habits: ["low_sodium"]
|
|
111
|
+
* },
|
|
112
|
+
* medication_history: [{
|
|
113
|
+
* sfrx_id: "SRX-010-004748",
|
|
114
|
+
* start_date: "2026-01-10",
|
|
115
|
+
* status: "active"
|
|
116
|
+
* }, {
|
|
117
|
+
* sfrx_id: "SRX-050-000123",
|
|
118
|
+
* start_date: "2025-09-01",
|
|
119
|
+
* status: "historical"
|
|
120
|
+
* }]
|
|
121
|
+
* },
|
|
122
|
+
* include: ["ae", "ddi", "pllr", "clinical", "dose"],
|
|
123
|
+
* lang: "en"
|
|
124
|
+
* })
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* await client.drugSafety.check({
|
|
128
|
+
* drugs: ["Augmentin 1g", "Marivan"],
|
|
99
129
|
* include: ["ddi"]
|
|
100
130
|
* })
|
|
101
131
|
*
|
|
@@ -20,6 +20,36 @@ import type * as SafeRx from "../../../../index.js";
|
|
|
20
20
|
* @example
|
|
21
21
|
* {
|
|
22
22
|
* drugs: ["Augmentin 1g", "Marivan"],
|
|
23
|
+
* intelligence_context: {
|
|
24
|
+
* user_id: "patient-123",
|
|
25
|
+
* clinical_profile: {
|
|
26
|
+
* age: 72,
|
|
27
|
+
* crcl: 38,
|
|
28
|
+
* hepatic_status: "normal",
|
|
29
|
+
* pregnancy: false,
|
|
30
|
+
* lactation: false,
|
|
31
|
+
* conditions: ["renal impairment", "hypertension"],
|
|
32
|
+
* populations: ["geriatric", "renal"],
|
|
33
|
+
* allergies: ["penicillin"],
|
|
34
|
+
* diet_habits: ["low_sodium"]
|
|
35
|
+
* },
|
|
36
|
+
* medication_history: [{
|
|
37
|
+
* sfrx_id: "SRX-010-004748",
|
|
38
|
+
* start_date: "2026-01-10",
|
|
39
|
+
* status: "active"
|
|
40
|
+
* }, {
|
|
41
|
+
* sfrx_id: "SRX-050-000123",
|
|
42
|
+
* start_date: "2025-09-01",
|
|
43
|
+
* status: "historical"
|
|
44
|
+
* }]
|
|
45
|
+
* },
|
|
46
|
+
* include: ["ae", "ddi", "pllr", "clinical", "dose"],
|
|
47
|
+
* lang: "en"
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* {
|
|
52
|
+
* drugs: ["Augmentin 1g", "Marivan"],
|
|
23
53
|
* include: ["ddi"]
|
|
24
54
|
* }
|
|
25
55
|
*
|
|
@@ -40,6 +70,7 @@ export interface DrugSafetyCheckRequest {
|
|
|
40
70
|
*/
|
|
41
71
|
drugs: string[];
|
|
42
72
|
patient_profile?: SafeRx.PatientProfile;
|
|
73
|
+
intelligence_context?: SafeRx.IntelligenceContext;
|
|
43
74
|
/**
|
|
44
75
|
* Safety domains to check. Omit to run all six domains.
|
|
45
76
|
* Including fewer domains reduces response size and may improve latency.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Patient profile fields used by intelligence processors.
|
|
3
|
+
*/
|
|
4
|
+
export interface IntelligenceClinicalProfile {
|
|
5
|
+
age?: number | undefined;
|
|
6
|
+
/** Creatinine clearance in mL/min. */
|
|
7
|
+
crcl?: number | undefined;
|
|
8
|
+
hepatic_status?: IntelligenceClinicalProfile.HepaticStatus | undefined;
|
|
9
|
+
pregnancy?: boolean | undefined;
|
|
10
|
+
lactation?: boolean | undefined;
|
|
11
|
+
conditions?: string[] | undefined;
|
|
12
|
+
populations?: string[] | undefined;
|
|
13
|
+
allergies?: string[] | undefined;
|
|
14
|
+
diet_habits?: string[] | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace IntelligenceClinicalProfile {
|
|
17
|
+
const HepaticStatus: {
|
|
18
|
+
readonly Normal: "normal";
|
|
19
|
+
readonly Mild: "mild";
|
|
20
|
+
readonly Moderate: "moderate";
|
|
21
|
+
readonly Severe: "severe";
|
|
22
|
+
};
|
|
23
|
+
type HepaticStatus = (typeof HepaticStatus)[keyof typeof HepaticStatus];
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IntelligenceClinicalProfile = void 0;
|
|
5
|
+
var IntelligenceClinicalProfile;
|
|
6
|
+
(function (IntelligenceClinicalProfile) {
|
|
7
|
+
IntelligenceClinicalProfile.HepaticStatus = {
|
|
8
|
+
Normal: "normal",
|
|
9
|
+
Mild: "mild",
|
|
10
|
+
Moderate: "moderate",
|
|
11
|
+
Severe: "severe",
|
|
12
|
+
};
|
|
13
|
+
})(IntelligenceClinicalProfile || (exports.IntelligenceClinicalProfile = IntelligenceClinicalProfile = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Optional Medication Intelligence Platform context. When present and the
|
|
4
|
+
* intelligence layer is enabled, SafeRx adds a top-level `intelligence`
|
|
5
|
+
* block without changing the standard safety response.
|
|
6
|
+
*/
|
|
7
|
+
export interface IntelligenceContext {
|
|
8
|
+
/** Optional caller-side patient or profile identifier. */
|
|
9
|
+
user_id?: string | undefined;
|
|
10
|
+
clinical_profile?: SafeRx.IntelligenceClinicalProfile | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Longitudinal medication list used for active-medication cumulative
|
|
13
|
+
* dose tracking. Items with `status: historical` are retained as
|
|
14
|
+
* context but excluded from active overdose aggregation.
|
|
15
|
+
*/
|
|
16
|
+
medication_history?: SafeRx.MedicationHistoryItem[] | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Optional Medication Intelligence Platform post-processing output.
|
|
4
|
+
*/
|
|
5
|
+
export interface IntelligenceResult {
|
|
6
|
+
status?: string | undefined;
|
|
7
|
+
/** Active-medication cumulative dose warnings. */
|
|
8
|
+
cumulative_warnings?: Record<string, unknown>[] | undefined;
|
|
9
|
+
synthesis?: SafeRx.IntelligenceSynthesis | undefined;
|
|
10
|
+
/** Allergy/profile-filtered alternative candidates keyed by source `sfrx_id`. */
|
|
11
|
+
safer_alternatives?: Record<string, unknown> | undefined;
|
|
12
|
+
/** Best-effort processor errors; standard safety output remains valid. */
|
|
13
|
+
processor_errors?: SafeRx.IntelligenceProcessorError[] | undefined;
|
|
14
|
+
/** Top-level degradation reason when the whole intelligence layer fails. */
|
|
15
|
+
error?: string | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface IntelligenceSynthesis {
|
|
2
|
+
cross_domain_findings?: Record<string, unknown>[] | undefined;
|
|
3
|
+
summary?: string | undefined;
|
|
4
|
+
/** Condition-specific adverse effects elevated for the supplied context. */
|
|
5
|
+
predictive_ae?: Record<string, unknown>[] | undefined;
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface MedicationHistoryItem {
|
|
2
|
+
/** SafeRx product identifier. */
|
|
3
|
+
sfrx_id: string;
|
|
4
|
+
/** Caller-provided start date, preferably ISO 8601. */
|
|
5
|
+
start_date?: string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Active medications participate in cumulative dose checks.
|
|
8
|
+
* Historical medications are retained as context only.
|
|
9
|
+
*/
|
|
10
|
+
status?: MedicationHistoryItem.Status | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace MedicationHistoryItem {
|
|
13
|
+
/**
|
|
14
|
+
* Active medications participate in cumulative dose checks.
|
|
15
|
+
* Historical medications are retained as context only.
|
|
16
|
+
*/
|
|
17
|
+
const Status: {
|
|
18
|
+
readonly Active: "active";
|
|
19
|
+
readonly Historical: "historical";
|
|
20
|
+
};
|
|
21
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MedicationHistoryItem = void 0;
|
|
5
|
+
var MedicationHistoryItem;
|
|
6
|
+
(function (MedicationHistoryItem) {
|
|
7
|
+
/**
|
|
8
|
+
* Active medications participate in cumulative dose checks.
|
|
9
|
+
* Historical medications are retained as context only.
|
|
10
|
+
*/
|
|
11
|
+
MedicationHistoryItem.Status = {
|
|
12
|
+
Active: "active",
|
|
13
|
+
Historical: "historical",
|
|
14
|
+
};
|
|
15
|
+
})(MedicationHistoryItem || (exports.MedicationHistoryItem = MedicationHistoryItem = {}));
|
|
@@ -18,11 +18,17 @@ export * from "./ErrorResponse.js";
|
|
|
18
18
|
export * from "./FoodConflict.js";
|
|
19
19
|
export * from "./FoodData.js";
|
|
20
20
|
export * from "./ForbiddenErrorBody.js";
|
|
21
|
+
export * from "./IntelligenceClinicalProfile.js";
|
|
22
|
+
export * from "./IntelligenceContext.js";
|
|
23
|
+
export * from "./IntelligenceProcessorError.js";
|
|
24
|
+
export * from "./IntelligenceResult.js";
|
|
25
|
+
export * from "./IntelligenceSynthesis.js";
|
|
21
26
|
export * from "./Interaction.js";
|
|
22
27
|
export * from "./InteractionSummary.js";
|
|
23
28
|
export * from "./InteractionsData.js";
|
|
24
29
|
export * from "./InternalServerErrorBody.js";
|
|
25
30
|
export * from "./MealTiming.js";
|
|
31
|
+
export * from "./MedicationHistoryItem.js";
|
|
26
32
|
export * from "./Meta.js";
|
|
27
33
|
export * from "./MetadataResponse.js";
|
|
28
34
|
export * from "./Monitoring.js";
|
|
@@ -34,11 +34,17 @@ __exportStar(require("./ErrorResponse.js"), exports);
|
|
|
34
34
|
__exportStar(require("./FoodConflict.js"), exports);
|
|
35
35
|
__exportStar(require("./FoodData.js"), exports);
|
|
36
36
|
__exportStar(require("./ForbiddenErrorBody.js"), exports);
|
|
37
|
+
__exportStar(require("./IntelligenceClinicalProfile.js"), exports);
|
|
38
|
+
__exportStar(require("./IntelligenceContext.js"), exports);
|
|
39
|
+
__exportStar(require("./IntelligenceProcessorError.js"), exports);
|
|
40
|
+
__exportStar(require("./IntelligenceResult.js"), exports);
|
|
41
|
+
__exportStar(require("./IntelligenceSynthesis.js"), exports);
|
|
37
42
|
__exportStar(require("./Interaction.js"), exports);
|
|
38
43
|
__exportStar(require("./InteractionSummary.js"), exports);
|
|
39
44
|
__exportStar(require("./InteractionsData.js"), exports);
|
|
40
45
|
__exportStar(require("./InternalServerErrorBody.js"), exports);
|
|
41
46
|
__exportStar(require("./MealTiming.js"), exports);
|
|
47
|
+
__exportStar(require("./MedicationHistoryItem.js"), exports);
|
|
42
48
|
__exportStar(require("./Meta.js"), exports);
|
|
43
49
|
__exportStar(require("./MetadataResponse.js"), exports);
|
|
44
50
|
__exportStar(require("./Monitoring.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.39";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "saferx-pharma-sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "saferx-pharma-sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.39",
|
|
10
|
+
"User-Agent": "saferx-pharma-sdk/0.0.39",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -51,6 +51,36 @@ export declare class DrugSafetyClient {
|
|
|
51
51
|
* @example
|
|
52
52
|
* await client.drugSafety.check({
|
|
53
53
|
* drugs: ["Augmentin 1g", "Marivan"],
|
|
54
|
+
* intelligence_context: {
|
|
55
|
+
* user_id: "patient-123",
|
|
56
|
+
* clinical_profile: {
|
|
57
|
+
* age: 72,
|
|
58
|
+
* crcl: 38,
|
|
59
|
+
* hepatic_status: "normal",
|
|
60
|
+
* pregnancy: false,
|
|
61
|
+
* lactation: false,
|
|
62
|
+
* conditions: ["renal impairment", "hypertension"],
|
|
63
|
+
* populations: ["geriatric", "renal"],
|
|
64
|
+
* allergies: ["penicillin"],
|
|
65
|
+
* diet_habits: ["low_sodium"]
|
|
66
|
+
* },
|
|
67
|
+
* medication_history: [{
|
|
68
|
+
* sfrx_id: "SRX-010-004748",
|
|
69
|
+
* start_date: "2026-01-10",
|
|
70
|
+
* status: "active"
|
|
71
|
+
* }, {
|
|
72
|
+
* sfrx_id: "SRX-050-000123",
|
|
73
|
+
* start_date: "2025-09-01",
|
|
74
|
+
* status: "historical"
|
|
75
|
+
* }]
|
|
76
|
+
* },
|
|
77
|
+
* include: ["ae", "ddi", "pllr", "clinical", "dose"],
|
|
78
|
+
* lang: "en"
|
|
79
|
+
* })
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.drugSafety.check({
|
|
83
|
+
* drugs: ["Augmentin 1g", "Marivan"],
|
|
54
84
|
* include: ["ddi"]
|
|
55
85
|
* })
|
|
56
86
|
*
|
|
@@ -60,6 +60,36 @@ export class DrugSafetyClient {
|
|
|
60
60
|
* @example
|
|
61
61
|
* await client.drugSafety.check({
|
|
62
62
|
* drugs: ["Augmentin 1g", "Marivan"],
|
|
63
|
+
* intelligence_context: {
|
|
64
|
+
* user_id: "patient-123",
|
|
65
|
+
* clinical_profile: {
|
|
66
|
+
* age: 72,
|
|
67
|
+
* crcl: 38,
|
|
68
|
+
* hepatic_status: "normal",
|
|
69
|
+
* pregnancy: false,
|
|
70
|
+
* lactation: false,
|
|
71
|
+
* conditions: ["renal impairment", "hypertension"],
|
|
72
|
+
* populations: ["geriatric", "renal"],
|
|
73
|
+
* allergies: ["penicillin"],
|
|
74
|
+
* diet_habits: ["low_sodium"]
|
|
75
|
+
* },
|
|
76
|
+
* medication_history: [{
|
|
77
|
+
* sfrx_id: "SRX-010-004748",
|
|
78
|
+
* start_date: "2026-01-10",
|
|
79
|
+
* status: "active"
|
|
80
|
+
* }, {
|
|
81
|
+
* sfrx_id: "SRX-050-000123",
|
|
82
|
+
* start_date: "2025-09-01",
|
|
83
|
+
* status: "historical"
|
|
84
|
+
* }]
|
|
85
|
+
* },
|
|
86
|
+
* include: ["ae", "ddi", "pllr", "clinical", "dose"],
|
|
87
|
+
* lang: "en"
|
|
88
|
+
* })
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* await client.drugSafety.check({
|
|
92
|
+
* drugs: ["Augmentin 1g", "Marivan"],
|
|
63
93
|
* include: ["ddi"]
|
|
64
94
|
* })
|
|
65
95
|
*
|
|
@@ -20,6 +20,36 @@ import type * as SafeRx from "../../../../index.mjs";
|
|
|
20
20
|
* @example
|
|
21
21
|
* {
|
|
22
22
|
* drugs: ["Augmentin 1g", "Marivan"],
|
|
23
|
+
* intelligence_context: {
|
|
24
|
+
* user_id: "patient-123",
|
|
25
|
+
* clinical_profile: {
|
|
26
|
+
* age: 72,
|
|
27
|
+
* crcl: 38,
|
|
28
|
+
* hepatic_status: "normal",
|
|
29
|
+
* pregnancy: false,
|
|
30
|
+
* lactation: false,
|
|
31
|
+
* conditions: ["renal impairment", "hypertension"],
|
|
32
|
+
* populations: ["geriatric", "renal"],
|
|
33
|
+
* allergies: ["penicillin"],
|
|
34
|
+
* diet_habits: ["low_sodium"]
|
|
35
|
+
* },
|
|
36
|
+
* medication_history: [{
|
|
37
|
+
* sfrx_id: "SRX-010-004748",
|
|
38
|
+
* start_date: "2026-01-10",
|
|
39
|
+
* status: "active"
|
|
40
|
+
* }, {
|
|
41
|
+
* sfrx_id: "SRX-050-000123",
|
|
42
|
+
* start_date: "2025-09-01",
|
|
43
|
+
* status: "historical"
|
|
44
|
+
* }]
|
|
45
|
+
* },
|
|
46
|
+
* include: ["ae", "ddi", "pllr", "clinical", "dose"],
|
|
47
|
+
* lang: "en"
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* {
|
|
52
|
+
* drugs: ["Augmentin 1g", "Marivan"],
|
|
23
53
|
* include: ["ddi"]
|
|
24
54
|
* }
|
|
25
55
|
*
|
|
@@ -40,6 +70,7 @@ export interface DrugSafetyCheckRequest {
|
|
|
40
70
|
*/
|
|
41
71
|
drugs: string[];
|
|
42
72
|
patient_profile?: SafeRx.PatientProfile;
|
|
73
|
+
intelligence_context?: SafeRx.IntelligenceContext;
|
|
43
74
|
/**
|
|
44
75
|
* Safety domains to check. Omit to run all six domains.
|
|
45
76
|
* Including fewer domains reduces response size and may improve latency.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Patient profile fields used by intelligence processors.
|
|
3
|
+
*/
|
|
4
|
+
export interface IntelligenceClinicalProfile {
|
|
5
|
+
age?: number | undefined;
|
|
6
|
+
/** Creatinine clearance in mL/min. */
|
|
7
|
+
crcl?: number | undefined;
|
|
8
|
+
hepatic_status?: IntelligenceClinicalProfile.HepaticStatus | undefined;
|
|
9
|
+
pregnancy?: boolean | undefined;
|
|
10
|
+
lactation?: boolean | undefined;
|
|
11
|
+
conditions?: string[] | undefined;
|
|
12
|
+
populations?: string[] | undefined;
|
|
13
|
+
allergies?: string[] | undefined;
|
|
14
|
+
diet_habits?: string[] | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace IntelligenceClinicalProfile {
|
|
17
|
+
const HepaticStatus: {
|
|
18
|
+
readonly Normal: "normal";
|
|
19
|
+
readonly Mild: "mild";
|
|
20
|
+
readonly Moderate: "moderate";
|
|
21
|
+
readonly Severe: "severe";
|
|
22
|
+
};
|
|
23
|
+
type HepaticStatus = (typeof HepaticStatus)[keyof typeof HepaticStatus];
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var IntelligenceClinicalProfile;
|
|
3
|
+
(function (IntelligenceClinicalProfile) {
|
|
4
|
+
IntelligenceClinicalProfile.HepaticStatus = {
|
|
5
|
+
Normal: "normal",
|
|
6
|
+
Mild: "mild",
|
|
7
|
+
Moderate: "moderate",
|
|
8
|
+
Severe: "severe",
|
|
9
|
+
};
|
|
10
|
+
})(IntelligenceClinicalProfile || (IntelligenceClinicalProfile = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Optional Medication Intelligence Platform context. When present and the
|
|
4
|
+
* intelligence layer is enabled, SafeRx adds a top-level `intelligence`
|
|
5
|
+
* block without changing the standard safety response.
|
|
6
|
+
*/
|
|
7
|
+
export interface IntelligenceContext {
|
|
8
|
+
/** Optional caller-side patient or profile identifier. */
|
|
9
|
+
user_id?: string | undefined;
|
|
10
|
+
clinical_profile?: SafeRx.IntelligenceClinicalProfile | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Longitudinal medication list used for active-medication cumulative
|
|
13
|
+
* dose tracking. Items with `status: historical` are retained as
|
|
14
|
+
* context but excluded from active overdose aggregation.
|
|
15
|
+
*/
|
|
16
|
+
medication_history?: SafeRx.MedicationHistoryItem[] | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Optional Medication Intelligence Platform post-processing output.
|
|
4
|
+
*/
|
|
5
|
+
export interface IntelligenceResult {
|
|
6
|
+
status?: string | undefined;
|
|
7
|
+
/** Active-medication cumulative dose warnings. */
|
|
8
|
+
cumulative_warnings?: Record<string, unknown>[] | undefined;
|
|
9
|
+
synthesis?: SafeRx.IntelligenceSynthesis | undefined;
|
|
10
|
+
/** Allergy/profile-filtered alternative candidates keyed by source `sfrx_id`. */
|
|
11
|
+
safer_alternatives?: Record<string, unknown> | undefined;
|
|
12
|
+
/** Best-effort processor errors; standard safety output remains valid. */
|
|
13
|
+
processor_errors?: SafeRx.IntelligenceProcessorError[] | undefined;
|
|
14
|
+
/** Top-level degradation reason when the whole intelligence layer fails. */
|
|
15
|
+
error?: string | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface IntelligenceSynthesis {
|
|
2
|
+
cross_domain_findings?: Record<string, unknown>[] | undefined;
|
|
3
|
+
summary?: string | undefined;
|
|
4
|
+
/** Condition-specific adverse effects elevated for the supplied context. */
|
|
5
|
+
predictive_ae?: Record<string, unknown>[] | undefined;
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface MedicationHistoryItem {
|
|
2
|
+
/** SafeRx product identifier. */
|
|
3
|
+
sfrx_id: string;
|
|
4
|
+
/** Caller-provided start date, preferably ISO 8601. */
|
|
5
|
+
start_date?: string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Active medications participate in cumulative dose checks.
|
|
8
|
+
* Historical medications are retained as context only.
|
|
9
|
+
*/
|
|
10
|
+
status?: MedicationHistoryItem.Status | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace MedicationHistoryItem {
|
|
13
|
+
/**
|
|
14
|
+
* Active medications participate in cumulative dose checks.
|
|
15
|
+
* Historical medications are retained as context only.
|
|
16
|
+
*/
|
|
17
|
+
const Status: {
|
|
18
|
+
readonly Active: "active";
|
|
19
|
+
readonly Historical: "historical";
|
|
20
|
+
};
|
|
21
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var MedicationHistoryItem;
|
|
3
|
+
(function (MedicationHistoryItem) {
|
|
4
|
+
/**
|
|
5
|
+
* Active medications participate in cumulative dose checks.
|
|
6
|
+
* Historical medications are retained as context only.
|
|
7
|
+
*/
|
|
8
|
+
MedicationHistoryItem.Status = {
|
|
9
|
+
Active: "active",
|
|
10
|
+
Historical: "historical",
|
|
11
|
+
};
|
|
12
|
+
})(MedicationHistoryItem || (MedicationHistoryItem = {}));
|
|
@@ -18,11 +18,17 @@ export * from "./ErrorResponse.mjs";
|
|
|
18
18
|
export * from "./FoodConflict.mjs";
|
|
19
19
|
export * from "./FoodData.mjs";
|
|
20
20
|
export * from "./ForbiddenErrorBody.mjs";
|
|
21
|
+
export * from "./IntelligenceClinicalProfile.mjs";
|
|
22
|
+
export * from "./IntelligenceContext.mjs";
|
|
23
|
+
export * from "./IntelligenceProcessorError.mjs";
|
|
24
|
+
export * from "./IntelligenceResult.mjs";
|
|
25
|
+
export * from "./IntelligenceSynthesis.mjs";
|
|
21
26
|
export * from "./Interaction.mjs";
|
|
22
27
|
export * from "./InteractionSummary.mjs";
|
|
23
28
|
export * from "./InteractionsData.mjs";
|
|
24
29
|
export * from "./InternalServerErrorBody.mjs";
|
|
25
30
|
export * from "./MealTiming.mjs";
|
|
31
|
+
export * from "./MedicationHistoryItem.mjs";
|
|
26
32
|
export * from "./Meta.mjs";
|
|
27
33
|
export * from "./MetadataResponse.mjs";
|
|
28
34
|
export * from "./Monitoring.mjs";
|
|
@@ -18,11 +18,17 @@ export * from "./ErrorResponse.mjs";
|
|
|
18
18
|
export * from "./FoodConflict.mjs";
|
|
19
19
|
export * from "./FoodData.mjs";
|
|
20
20
|
export * from "./ForbiddenErrorBody.mjs";
|
|
21
|
+
export * from "./IntelligenceClinicalProfile.mjs";
|
|
22
|
+
export * from "./IntelligenceContext.mjs";
|
|
23
|
+
export * from "./IntelligenceProcessorError.mjs";
|
|
24
|
+
export * from "./IntelligenceResult.mjs";
|
|
25
|
+
export * from "./IntelligenceSynthesis.mjs";
|
|
21
26
|
export * from "./Interaction.mjs";
|
|
22
27
|
export * from "./InteractionSummary.mjs";
|
|
23
28
|
export * from "./InteractionsData.mjs";
|
|
24
29
|
export * from "./InternalServerErrorBody.mjs";
|
|
25
30
|
export * from "./MealTiming.mjs";
|
|
31
|
+
export * from "./MedicationHistoryItem.mjs";
|
|
26
32
|
export * from "./Meta.mjs";
|
|
27
33
|
export * from "./MetadataResponse.mjs";
|
|
28
34
|
export * from "./Monitoring.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.39";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.39";
|