saferx-pharma-sdk 1.3.0 → 1.4.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +12 -0
- package/dist/cjs/Client.js +67 -0
- package/dist/cjs/api/resources/developers/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/developers/client/Client.js +1 -1
- package/dist/cjs/api/resources/developers/exports.d.ts +2 -0
- package/dist/cjs/api/resources/developers/exports.js +21 -0
- package/dist/cjs/api/resources/drugSafety/client/Client.d.ts +39 -5
- package/dist/cjs/api/resources/drugSafety/client/Client.js +39 -5
- package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.ts +38 -4
- package/dist/cjs/api/resources/drugSafety/exports.d.ts +2 -0
- package/dist/cjs/api/resources/drugSafety/exports.js +21 -0
- package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.ts +2 -14
- package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.js +0 -11
- package/dist/cjs/api/types/Alert.d.ts +11 -3
- package/dist/cjs/api/types/Alert.js +5 -1
- package/dist/cjs/api/types/AllergyCrossReactivityReference.d.ts +16 -0
- package/dist/cjs/api/types/AllergyCrossReactivityReference.js +3 -0
- package/dist/cjs/api/types/AllergyData.d.ts +24 -0
- package/dist/cjs/api/types/AllergyData.js +11 -0
- package/dist/cjs/api/types/AllergyFamilyReference.d.ts +10 -0
- package/dist/cjs/api/types/AllergyFamilyReference.js +3 -0
- package/dist/cjs/api/types/AllergyInputEntry.d.ts +10 -0
- package/dist/cjs/api/types/AllergyInputEntry.js +3 -0
- package/dist/cjs/api/types/AllergyProductFamilyReference.d.ts +9 -0
- package/dist/cjs/api/types/AllergyProductFamilyReference.js +3 -0
- package/dist/cjs/api/types/AllergySummary.d.ts +14 -0
- package/dist/cjs/api/types/AllergySummary.js +3 -0
- package/dist/cjs/api/types/AllergyWarning.d.ts +30 -0
- package/dist/cjs/api/types/AllergyWarning.js +11 -0
- package/dist/cjs/api/types/ClinicalAlert.d.ts +8 -0
- package/dist/cjs/api/types/ClinicalContextApplied.d.ts +10 -0
- package/dist/cjs/api/types/ClinicalContextApplied.js +3 -0
- package/dist/cjs/api/types/ClinicalData.d.ts +7 -4
- package/dist/cjs/api/types/DailyLimit.d.ts +1 -1
- package/dist/cjs/api/types/DomainCode.d.ts +4 -2
- package/dist/cjs/api/types/DomainCode.js +4 -2
- package/dist/cjs/api/types/DosingData.d.ts +22 -12
- package/dist/cjs/api/types/DosingData.js +3 -3
- package/dist/cjs/api/types/DrugSafetyCheckResponse.d.ts +1 -0
- package/dist/cjs/api/types/ErrorResponse.d.ts +5 -0
- package/dist/cjs/api/types/FoodConflict.d.ts +11 -3
- package/dist/cjs/api/types/IdentityMatch.d.ts +13 -0
- package/dist/cjs/api/types/IdentityMatch.js +3 -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/Interaction.d.ts +0 -2
- package/dist/cjs/api/types/InteractionSummary.d.ts +4 -4
- package/dist/cjs/api/types/MedicationHistoryItem.d.ts +22 -0
- package/dist/cjs/api/types/MedicationHistoryItem.js +15 -0
- package/dist/cjs/api/types/Meta.d.ts +2 -0
- package/dist/cjs/api/types/Meta.js +1 -0
- package/dist/cjs/api/types/MetadataResponse.d.ts +14 -6
- package/dist/cjs/api/types/MetadataResponse.js +1 -0
- package/dist/cjs/api/types/PatientProfile.d.ts +31 -0
- package/dist/cjs/api/types/PatientProfile.js +17 -0
- package/dist/cjs/api/types/QuotaMeta.d.ts +11 -0
- package/dist/cjs/api/types/QuotaMeta.js +3 -0
- package/dist/cjs/api/types/RateLimitResponse.d.ts +11 -0
- package/dist/cjs/api/types/RateLimitResponse.js +1 -0
- package/dist/cjs/api/types/ReproductiveSafetyData.d.ts +9 -5
- package/dist/cjs/api/types/ReproductiveWarning.d.ts +5 -3
- package/dist/cjs/api/types/ResolvedDrug.d.ts +36 -0
- package/dist/cjs/api/types/SafetyData.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +16 -0
- package/dist/cjs/api/types/index.js +16 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.js +1 -1
- package/dist/cjs/core/fetcher/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/index.js +3 -1
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/cjs/core/fetcher/makeRequest.js +30 -9
- package/dist/cjs/core/runtime/runtime.js +8 -7
- 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/Client.d.mts +12 -0
- package/dist/esm/Client.mjs +34 -0
- package/dist/esm/api/resources/developers/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/developers/client/Client.mjs +1 -1
- package/dist/esm/api/resources/developers/exports.d.mts +2 -0
- package/dist/esm/api/resources/developers/exports.mjs +3 -0
- package/dist/esm/api/resources/drugSafety/client/Client.d.mts +39 -5
- package/dist/esm/api/resources/drugSafety/client/Client.mjs +39 -5
- package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.mts +38 -4
- package/dist/esm/api/resources/drugSafety/exports.d.mts +2 -0
- package/dist/esm/api/resources/drugSafety/exports.mjs +3 -0
- package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.mts +2 -14
- package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.mjs +0 -11
- package/dist/esm/api/types/Alert.d.mts +11 -3
- package/dist/esm/api/types/Alert.mjs +5 -1
- package/dist/esm/api/types/AllergyCrossReactivityReference.d.mts +16 -0
- package/dist/esm/api/types/AllergyCrossReactivityReference.mjs +2 -0
- package/dist/esm/api/types/AllergyData.d.mts +24 -0
- package/dist/esm/api/types/AllergyData.mjs +8 -0
- package/dist/esm/api/types/AllergyFamilyReference.d.mts +10 -0
- package/dist/esm/api/types/AllergyFamilyReference.mjs +2 -0
- package/dist/esm/api/types/AllergyInputEntry.d.mts +10 -0
- package/dist/esm/api/types/AllergyInputEntry.mjs +2 -0
- package/dist/esm/api/types/AllergyProductFamilyReference.d.mts +9 -0
- package/dist/esm/api/types/AllergyProductFamilyReference.mjs +2 -0
- package/dist/esm/api/types/AllergySummary.d.mts +14 -0
- package/dist/esm/api/types/AllergySummary.mjs +2 -0
- package/dist/esm/api/types/AllergyWarning.d.mts +30 -0
- package/dist/esm/api/types/AllergyWarning.mjs +8 -0
- package/dist/esm/api/types/ClinicalAlert.d.mts +8 -0
- package/dist/esm/api/types/ClinicalContextApplied.d.mts +10 -0
- package/dist/esm/api/types/ClinicalContextApplied.mjs +2 -0
- package/dist/esm/api/types/ClinicalData.d.mts +7 -4
- package/dist/esm/api/types/DailyLimit.d.mts +1 -1
- package/dist/esm/api/types/DomainCode.d.mts +4 -2
- package/dist/esm/api/types/DomainCode.mjs +4 -2
- package/dist/esm/api/types/DosingData.d.mts +22 -12
- package/dist/esm/api/types/DosingData.mjs +3 -3
- package/dist/esm/api/types/DrugSafetyCheckResponse.d.mts +1 -0
- package/dist/esm/api/types/ErrorResponse.d.mts +5 -0
- package/dist/esm/api/types/FoodConflict.d.mts +11 -3
- package/dist/esm/api/types/IdentityMatch.d.mts +13 -0
- package/dist/esm/api/types/IdentityMatch.mjs +2 -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/Interaction.d.mts +0 -2
- package/dist/esm/api/types/InteractionSummary.d.mts +4 -4
- package/dist/esm/api/types/MedicationHistoryItem.d.mts +22 -0
- package/dist/esm/api/types/MedicationHistoryItem.mjs +12 -0
- package/dist/esm/api/types/Meta.d.mts +2 -0
- package/dist/esm/api/types/Meta.mjs +1 -0
- package/dist/esm/api/types/MetadataResponse.d.mts +14 -6
- package/dist/esm/api/types/MetadataResponse.mjs +1 -0
- package/dist/esm/api/types/PatientProfile.d.mts +31 -0
- package/dist/esm/api/types/PatientProfile.mjs +16 -1
- package/dist/esm/api/types/QuotaMeta.d.mts +11 -0
- package/dist/esm/api/types/QuotaMeta.mjs +2 -0
- package/dist/esm/api/types/RateLimitResponse.d.mts +11 -0
- package/dist/esm/api/types/RateLimitResponse.mjs +1 -0
- package/dist/esm/api/types/ReproductiveSafetyData.d.mts +9 -5
- package/dist/esm/api/types/ReproductiveWarning.d.mts +5 -3
- package/dist/esm/api/types/ResolvedDrug.d.mts +36 -0
- package/dist/esm/api/types/SafetyData.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +16 -0
- package/dist/esm/api/types/index.mjs +16 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +1 -1
- package/dist/esm/core/fetcher/index.d.mts +2 -0
- package/dist/esm/core/fetcher/index.mjs +1 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
- package/dist/esm/core/runtime/runtime.mjs +8 -7
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +31 -9
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* - `ddi` — Drug-drug interactions (requires 2+ drugs)
|
|
5
5
|
* - `pllr` — Pregnancy & lactation risk ratings
|
|
6
6
|
* - `food` — Meal timing & food-drug conflicts
|
|
7
|
-
* - `clinical` — Population & condition safety
|
|
8
|
-
* - `dose` —
|
|
7
|
+
* - `clinical` — Population & condition safety. Without patient context, returns product-wide clinical signals; with `patient_profile`, alerts are narrowed to supplied populations and conditions.
|
|
8
|
+
* - `dose` — Dose limits and daily-dose references from the unified dosing data path
|
|
9
|
+
* - `allergy` — Patient allergy matching plus direct and cross-reactivity warnings
|
|
9
10
|
*/
|
|
10
11
|
export declare const DomainCode: {
|
|
11
12
|
readonly Ae: "ae";
|
|
@@ -14,5 +15,6 @@ export declare const DomainCode: {
|
|
|
14
15
|
readonly Food: "food";
|
|
15
16
|
readonly Clinical: "clinical";
|
|
16
17
|
readonly Dose: "dose";
|
|
18
|
+
readonly Allergy: "allergy";
|
|
17
19
|
};
|
|
18
20
|
export type DomainCode = (typeof DomainCode)[keyof typeof DomainCode];
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* - `ddi` — Drug-drug interactions (requires 2+ drugs)
|
|
6
6
|
* - `pllr` — Pregnancy & lactation risk ratings
|
|
7
7
|
* - `food` — Meal timing & food-drug conflicts
|
|
8
|
-
* - `clinical` — Population & condition safety
|
|
9
|
-
* - `dose` —
|
|
8
|
+
* - `clinical` — Population & condition safety. Without patient context, returns product-wide clinical signals; with `patient_profile`, alerts are narrowed to supplied populations and conditions.
|
|
9
|
+
* - `dose` — Dose limits and daily-dose references from the unified dosing data path
|
|
10
|
+
* - `allergy` — Patient allergy matching plus direct and cross-reactivity warnings
|
|
10
11
|
*/
|
|
11
12
|
export const DomainCode = {
|
|
12
13
|
Ae: "ae",
|
|
@@ -15,4 +16,5 @@ export const DomainCode = {
|
|
|
15
16
|
Food: "food",
|
|
16
17
|
Clinical: "clinical",
|
|
17
18
|
Dose: "dose",
|
|
19
|
+
Allergy: "allergy",
|
|
18
20
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type * as SafeRx from "../index.mjs";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Dose limits and daily-dose reference data from the unified dosing path.
|
|
4
|
+
* Includes standard dose summaries, dose limits, daily-limit data when
|
|
5
|
+
* available, and caveats for products where calculation needs pharmacist review.
|
|
6
6
|
*/
|
|
7
7
|
export interface DosingData {
|
|
8
8
|
/**
|
|
9
9
|
* Data quality tier.
|
|
10
|
-
* - `1`
|
|
11
|
-
* - `2`
|
|
10
|
+
* - `1` - Full reference and regulatory daily-limit data available
|
|
11
|
+
* - `2` - Regulatory daily-limit data only
|
|
12
12
|
*/
|
|
13
13
|
tier?: number | undefined;
|
|
14
14
|
/** Maximum safe units (tablets, capsules) per day */
|
|
@@ -25,24 +25,34 @@ export interface DosingData {
|
|
|
25
25
|
caveat?: (string | null) | undefined;
|
|
26
26
|
/** WHO DDD reference dose data */
|
|
27
27
|
reference_dose?: (SafeRx.ReferenceDose | null) | undefined;
|
|
28
|
-
/**
|
|
28
|
+
/** Regulatory maximum daily dose data */
|
|
29
29
|
daily_limit?: (SafeRx.DailyLimit | null) | undefined;
|
|
30
|
+
/** Standard-dose summary when available, including route, frequency, and verification flags. */
|
|
31
|
+
standard_dose?: (Record<string, unknown> | null) | undefined;
|
|
32
|
+
/** Dose-limit records used by the unified dosing path. */
|
|
33
|
+
dose_limits?: Record<string, unknown>[] | undefined;
|
|
34
|
+
/** Clinician/patient display summary for dose limits and caveats, when available. */
|
|
35
|
+
display_summary?: (Record<string, unknown> | null) | undefined;
|
|
36
|
+
/** Calculation uncertainty or review requirement, when available. */
|
|
37
|
+
dose_uncertainty?: (Record<string, unknown> | null) | undefined;
|
|
38
|
+
/** Display-safe monitoring instructions linked to the dose record, when available. */
|
|
39
|
+
monitoring_display?: (Record<string, unknown> | null) | undefined;
|
|
30
40
|
/** Per-ingredient dose data for combination drugs */
|
|
31
41
|
components?: ((SafeRx.DoseComponent | null)[] | null) | undefined;
|
|
32
42
|
/**
|
|
33
43
|
* Data source for this dose calculation.
|
|
34
|
-
* - `reference_standard` —
|
|
35
|
-
* - `regulatory_label` —
|
|
36
|
-
* - `dual_source` —
|
|
44
|
+
* - `reference_standard` — reference dose data only
|
|
45
|
+
* - `regulatory_label` — regulatory daily-limit data only
|
|
46
|
+
* - `dual_source` — reference and regulatory daily-limit data available
|
|
37
47
|
*/
|
|
38
48
|
source?: DosingData.Source | undefined;
|
|
39
49
|
}
|
|
40
50
|
export declare namespace DosingData {
|
|
41
51
|
/**
|
|
42
52
|
* Data source for this dose calculation.
|
|
43
|
-
* - `reference_standard` —
|
|
44
|
-
* - `regulatory_label` —
|
|
45
|
-
* - `dual_source` —
|
|
53
|
+
* - `reference_standard` — reference dose data only
|
|
54
|
+
* - `regulatory_label` — regulatory daily-limit data only
|
|
55
|
+
* - `dual_source` — reference and regulatory daily-limit data available
|
|
46
56
|
*/
|
|
47
57
|
const Source: {
|
|
48
58
|
readonly ReferenceStandard: "reference_standard";
|
|
@@ -3,9 +3,9 @@ export var DosingData;
|
|
|
3
3
|
(function (DosingData) {
|
|
4
4
|
/**
|
|
5
5
|
* Data source for this dose calculation.
|
|
6
|
-
* - `reference_standard` —
|
|
7
|
-
* - `regulatory_label` —
|
|
8
|
-
* - `dual_source` —
|
|
6
|
+
* - `reference_standard` — reference dose data only
|
|
7
|
+
* - `regulatory_label` — regulatory daily-limit data only
|
|
8
|
+
* - `dual_source` — reference and regulatory daily-limit data available
|
|
9
9
|
*/
|
|
10
10
|
DosingData.Source = {
|
|
11
11
|
ReferenceStandard: "reference_standard",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.mjs";
|
|
1
2
|
export interface ErrorResponse {
|
|
2
3
|
/** Error indicator or error message */
|
|
3
4
|
error?: ErrorResponse.Error_ | undefined;
|
|
@@ -15,6 +16,10 @@ export interface ErrorResponse {
|
|
|
15
16
|
hint?: string | undefined;
|
|
16
17
|
/** Support email for assistance */
|
|
17
18
|
support?: string | undefined;
|
|
19
|
+
/** Invalid safety domain codes supplied in `include`. */
|
|
20
|
+
invalid_domains?: string[] | undefined;
|
|
21
|
+
/** Valid safety domain codes. */
|
|
22
|
+
valid_domains?: SafeRx.DomainCode[] | undefined;
|
|
18
23
|
}
|
|
19
24
|
export declare namespace ErrorResponse {
|
|
20
25
|
/**
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A specific food-drug interaction
|
|
2
|
+
* A specific food-drug interaction (bilingual)
|
|
3
3
|
*/
|
|
4
4
|
export interface FoodConflict {
|
|
5
5
|
/** Food item or food category involved */
|
|
6
6
|
food?: string | undefined;
|
|
7
|
+
/** Food category identifier */
|
|
8
|
+
food_category?: string | undefined;
|
|
9
|
+
/** Specific foods affected */
|
|
10
|
+
affected_foods?: string[] | undefined;
|
|
7
11
|
/** Interaction severity (1-5) */
|
|
8
12
|
severity?: number | undefined;
|
|
9
13
|
/** Pharmacological interaction mechanism */
|
|
10
14
|
interaction_type?: string | undefined;
|
|
11
|
-
/**
|
|
12
|
-
|
|
15
|
+
/** Patient guidance in English */
|
|
16
|
+
brief_en?: string | undefined;
|
|
17
|
+
/** Patient guidance in Arabic */
|
|
18
|
+
brief_ar?: string | undefined;
|
|
19
|
+
/** Required patient action */
|
|
20
|
+
action_required?: string | undefined;
|
|
13
21
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Non-sensitive drug identity resolution metadata for auditability.
|
|
3
|
+
*/
|
|
4
|
+
export interface IdentityMatch {
|
|
5
|
+
/** Resolver path that produced the match. */
|
|
6
|
+
method?: string | undefined;
|
|
7
|
+
/** Match confidence score. */
|
|
8
|
+
confidence?: number | undefined;
|
|
9
|
+
/** Public drug field used for the match. */
|
|
10
|
+
matched_field?: string | undefined;
|
|
11
|
+
/** Public-safe value that matched the input. */
|
|
12
|
+
matched_value?: string | undefined;
|
|
13
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -46,8 +46,6 @@ export interface Interaction {
|
|
|
46
46
|
recommendation?: string | undefined;
|
|
47
47
|
/** Clinical recommendation in Arabic */
|
|
48
48
|
recommendation_ar?: string | undefined;
|
|
49
|
-
/** Data source */
|
|
50
|
-
source?: string | undefined;
|
|
51
49
|
}
|
|
52
50
|
export declare namespace Interaction {
|
|
53
51
|
/** Human-readable severity label */
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Interaction count by severity level for quick triage
|
|
3
3
|
*/
|
|
4
4
|
export interface InteractionSummary {
|
|
5
|
-
/** Number of contraindicated (severity
|
|
5
|
+
/** Number of contraindicated (severity 4) interactions */
|
|
6
6
|
contraindicated?: number | undefined;
|
|
7
|
-
/** Number of major (severity
|
|
7
|
+
/** Number of major (severity 3) interactions */
|
|
8
8
|
major?: number | undefined;
|
|
9
|
-
/** Number of moderate (severity
|
|
9
|
+
/** Number of moderate (severity 2) interactions */
|
|
10
10
|
moderate?: number | undefined;
|
|
11
|
-
/** Number of minor (severity
|
|
11
|
+
/** Number of minor (severity 1) interactions */
|
|
12
12
|
minor?: number | undefined;
|
|
13
13
|
}
|
|
@@ -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 = {}));
|
|
@@ -15,11 +15,13 @@ export interface Meta {
|
|
|
15
15
|
unresolved_count?: number | undefined;
|
|
16
16
|
/** Caller's current tier */
|
|
17
17
|
tier?: Meta.Tier | undefined;
|
|
18
|
+
quota?: SafeRx.QuotaMeta | undefined;
|
|
18
19
|
}
|
|
19
20
|
export declare namespace Meta {
|
|
20
21
|
/** Caller's current tier */
|
|
21
22
|
const Tier: {
|
|
22
23
|
readonly Free: "free";
|
|
24
|
+
readonly Startup: "startup";
|
|
23
25
|
readonly Pro: "pro";
|
|
24
26
|
readonly Enterprise: "enterprise";
|
|
25
27
|
};
|
|
@@ -42,6 +42,8 @@ export declare namespace MetadataResponse {
|
|
|
42
42
|
ae_risk_levels?: string[] | undefined;
|
|
43
43
|
/** DDI severity scale: integer key → label */
|
|
44
44
|
ddi_severity?: Record<string, string> | undefined;
|
|
45
|
+
/** Allergy warning severity scale: integer key → label */
|
|
46
|
+
allergy_severity?: Record<string, string> | undefined;
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Current database versions
|
|
@@ -52,7 +54,8 @@ export declare namespace MetadataResponse {
|
|
|
52
54
|
clinical?: string | undefined;
|
|
53
55
|
pllr?: string | undefined;
|
|
54
56
|
food?: string | undefined;
|
|
55
|
-
|
|
57
|
+
clinical_dose?: string | undefined;
|
|
58
|
+
allergy?: string | undefined;
|
|
56
59
|
}
|
|
57
60
|
/**
|
|
58
61
|
* Database coverage statistics
|
|
@@ -69,15 +72,20 @@ export declare namespace MetadataResponse {
|
|
|
69
72
|
/** Number of supported populations */
|
|
70
73
|
clinical_populations?: number | undefined;
|
|
71
74
|
/** Products with dose data */
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
|
|
75
|
-
/** Products with
|
|
76
|
-
|
|
75
|
+
clinical_dose_products?: number | undefined;
|
|
76
|
+
/** Dose data schema version */
|
|
77
|
+
clinical_dose_schema_version?: string | undefined;
|
|
78
|
+
/** Products with allergy reference data */
|
|
79
|
+
allergy_products?: number | undefined;
|
|
80
|
+
/** Allergy family count */
|
|
81
|
+
allergy_families?: number | undefined;
|
|
82
|
+
/** Allergy family cross-reaction pair count */
|
|
83
|
+
allergy_cross_reaction_pairs?: number | undefined;
|
|
77
84
|
}
|
|
78
85
|
/** Caller's current tier */
|
|
79
86
|
const Tier: {
|
|
80
87
|
readonly Free: "free";
|
|
88
|
+
readonly Startup: "startup";
|
|
81
89
|
readonly Pro: "pro";
|
|
82
90
|
readonly Enterprise: "enterprise";
|
|
83
91
|
};
|
|
@@ -9,4 +9,35 @@ export interface PatientProfile {
|
|
|
9
9
|
populations?: SafeRx.Population[] | undefined;
|
|
10
10
|
/** Patient comorbidities (e.g., diabetes, hypertension) */
|
|
11
11
|
conditions?: SafeRx.Condition[] | undefined;
|
|
12
|
+
/** Known patient allergies for the `allergy` domain. */
|
|
13
|
+
allergies?: string[] | undefined;
|
|
14
|
+
/** Patient age in years. Used to infer pediatric or geriatric clinical-dose context. */
|
|
15
|
+
age?: number | undefined;
|
|
16
|
+
/** Patient weight in kilograms. Used for pediatric weight-based dose context when available. */
|
|
17
|
+
weight_kg?: number | undefined;
|
|
18
|
+
/** Creatinine clearance in mL/min. Supplying this infers the `renal` population and returns matched renal dose-adjustment context when available. */
|
|
19
|
+
crcl?: number | undefined;
|
|
20
|
+
/** eGFR value accepted as a fallback renal-function input when `crcl` is not supplied. */
|
|
21
|
+
egfr?: number | undefined;
|
|
22
|
+
/** Child-Pugh class. Supplying this infers the `hepatic` population and returns matched hepatic dose-adjustment context when available. */
|
|
23
|
+
child_pugh?: PatientProfile.ChildPugh | undefined;
|
|
24
|
+
/** Hepatic impairment severity. `mild`, `moderate`, and `severe` map to hepatic clinical-dose context when `child_pugh` is not supplied. */
|
|
25
|
+
hepatic_status?: PatientProfile.HepaticStatus | undefined;
|
|
26
|
+
}
|
|
27
|
+
export declare namespace PatientProfile {
|
|
28
|
+
/** Child-Pugh class. Supplying this infers the `hepatic` population and returns matched hepatic dose-adjustment context when available. */
|
|
29
|
+
const ChildPugh: {
|
|
30
|
+
readonly A: "A";
|
|
31
|
+
readonly B: "B";
|
|
32
|
+
readonly C: "C";
|
|
33
|
+
};
|
|
34
|
+
type ChildPugh = (typeof ChildPugh)[keyof typeof ChildPugh];
|
|
35
|
+
/** Hepatic impairment severity. `mild`, `moderate`, and `severe` map to hepatic clinical-dose context when `child_pugh` is not supplied. */
|
|
36
|
+
const HepaticStatus: {
|
|
37
|
+
readonly Normal: "normal";
|
|
38
|
+
readonly Mild: "mild";
|
|
39
|
+
readonly Moderate: "moderate";
|
|
40
|
+
readonly Severe: "severe";
|
|
41
|
+
};
|
|
42
|
+
type HepaticStatus = (typeof HepaticStatus)[keyof typeof HepaticStatus];
|
|
12
43
|
}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var PatientProfile;
|
|
3
|
+
(function (PatientProfile) {
|
|
4
|
+
/** Child-Pugh class. Supplying this infers the `hepatic` population and returns matched hepatic dose-adjustment context when available. */
|
|
5
|
+
PatientProfile.ChildPugh = {
|
|
6
|
+
A: "A",
|
|
7
|
+
B: "B",
|
|
8
|
+
C: "C",
|
|
9
|
+
};
|
|
10
|
+
/** Hepatic impairment severity. `mild`, `moderate`, and `severe` map to hepatic clinical-dose context when `child_pugh` is not supplied. */
|
|
11
|
+
PatientProfile.HepaticStatus = {
|
|
12
|
+
Normal: "normal",
|
|
13
|
+
Mild: "mild",
|
|
14
|
+
Moderate: "moderate",
|
|
15
|
+
Severe: "severe",
|
|
16
|
+
};
|
|
17
|
+
})(PatientProfile || (PatientProfile = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monthly quota accounting for the request.
|
|
3
|
+
*/
|
|
4
|
+
export interface QuotaMeta {
|
|
5
|
+
monthly_limit?: number | undefined;
|
|
6
|
+
monthly_used?: number | undefined;
|
|
7
|
+
monthly_remaining?: number | undefined;
|
|
8
|
+
reset_at?: string | undefined;
|
|
9
|
+
/** Units consumed by this response. Unresolved-only checks return 0. */
|
|
10
|
+
billable_units?: number | undefined;
|
|
11
|
+
}
|
|
@@ -11,6 +11,16 @@ export interface RateLimitResponse {
|
|
|
11
11
|
daily_limit?: number | undefined;
|
|
12
12
|
/** Requests made today (present on daily limit errors) */
|
|
13
13
|
requests_today?: number | undefined;
|
|
14
|
+
/** Machine-readable limit reason */
|
|
15
|
+
reason?: string | undefined;
|
|
16
|
+
/** Your monthly commercial quota (present on monthly quota errors) */
|
|
17
|
+
monthly_limit?: number | undefined;
|
|
18
|
+
/** Requests consumed in the current monthly quota period */
|
|
19
|
+
requests_this_month?: number | undefined;
|
|
20
|
+
/** Remaining monthly quota units */
|
|
21
|
+
monthly_remaining?: number | undefined;
|
|
22
|
+
/** Monthly quota reset timestamp */
|
|
23
|
+
reset_at?: string | undefined;
|
|
14
24
|
tier?: RateLimitResponse.Tier | undefined;
|
|
15
25
|
/** Upgrade guidance */
|
|
16
26
|
hint?: string | undefined;
|
|
@@ -19,6 +29,7 @@ export interface RateLimitResponse {
|
|
|
19
29
|
export declare namespace RateLimitResponse {
|
|
20
30
|
const Tier: {
|
|
21
31
|
readonly Free: "free";
|
|
32
|
+
readonly Startup: "startup";
|
|
22
33
|
readonly Pro: "pro";
|
|
23
34
|
readonly Enterprise: "enterprise";
|
|
24
35
|
};
|
|
@@ -21,10 +21,14 @@ export interface ReproductiveSafetyData {
|
|
|
21
21
|
lactation_risk_level?: number | undefined;
|
|
22
22
|
/** Human-readable lactation risk label */
|
|
23
23
|
lactation_risk_name?: string | undefined;
|
|
24
|
-
/** Clinical rationale for the pregnancy risk rating (
|
|
24
|
+
/** Clinical rationale for the pregnancy risk rating (English) */
|
|
25
25
|
pregnancy_rationale?: string | undefined;
|
|
26
|
-
/** Clinical rationale for the
|
|
26
|
+
/** Clinical rationale for the pregnancy risk rating (Arabic) */
|
|
27
|
+
pregnancy_rationale_ar?: string | undefined;
|
|
28
|
+
/** Clinical rationale for the lactation risk rating (English) */
|
|
27
29
|
lactation_rationale?: string | undefined;
|
|
30
|
+
/** Clinical rationale for the lactation risk rating (Arabic) */
|
|
31
|
+
lactation_rationale_ar?: string | undefined;
|
|
28
32
|
pregnancy_warning?: SafeRx.ReproductiveWarning | undefined;
|
|
29
33
|
lactation_warning?: SafeRx.ReproductiveWarning | undefined;
|
|
30
34
|
/** First trimester pregnancy risk classification */
|
|
@@ -32,19 +36,19 @@ export interface ReproductiveSafetyData {
|
|
|
32
36
|
/** First trimester clinical note */
|
|
33
37
|
preg_t1_note?: (string | null) | undefined;
|
|
34
38
|
/** First trimester note in Arabic */
|
|
35
|
-
|
|
39
|
+
preg_t1_note_ar?: (string | null) | undefined;
|
|
36
40
|
/** Second trimester pregnancy risk classification */
|
|
37
41
|
preg_t2_risk?: (string | null) | undefined;
|
|
38
42
|
/** Second trimester clinical note */
|
|
39
43
|
preg_t2_note?: (string | null) | undefined;
|
|
40
44
|
/** Second trimester note in Arabic */
|
|
41
|
-
|
|
45
|
+
preg_t2_note_ar?: (string | null) | undefined;
|
|
42
46
|
/** Third trimester pregnancy risk classification */
|
|
43
47
|
preg_t3_risk?: (string | null) | undefined;
|
|
44
48
|
/** Third trimester clinical note */
|
|
45
49
|
preg_t3_note?: (string | null) | undefined;
|
|
46
50
|
/** Third trimester note in Arabic */
|
|
47
|
-
|
|
51
|
+
preg_t3_note_ar?: (string | null) | undefined;
|
|
48
52
|
/** Measured drug concentration in breast milk (mg/L) */
|
|
49
53
|
lact_milk_level_mgl?: (number | null) | undefined;
|
|
50
54
|
/** Milk-to-plasma concentration ratio */
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pregnancy or lactation specific warning
|
|
2
|
+
* Pregnancy or lactation specific warning (bilingual)
|
|
3
3
|
*/
|
|
4
4
|
export interface ReproductiveWarning {
|
|
5
5
|
/** Whether a specific warning exists */
|
|
6
6
|
has_warning?: boolean | undefined;
|
|
7
|
-
/** Warning text
|
|
8
|
-
|
|
7
|
+
/** Warning text in English */
|
|
8
|
+
text_en?: (string | null) | undefined;
|
|
9
|
+
/** Warning text in Arabic */
|
|
10
|
+
text_ar?: (string | null) | undefined;
|
|
9
11
|
/** Warning categories */
|
|
10
12
|
categories?: string[] | undefined;
|
|
11
13
|
}
|