saferx-pharma-sdk 0.0.39 → 0.0.51
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/developers/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/developers/client/Client.js +1 -1
- package/dist/cjs/api/resources/drugSafety/client/Client.d.ts +10 -6
- package/dist/cjs/api/resources/drugSafety/client/Client.js +10 -6
- package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.ts +8 -5
- 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 +8 -2
- 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/ErrorResponse.d.ts +5 -0
- package/dist/cjs/api/types/IdentityMatch.d.ts +13 -0
- package/dist/cjs/api/types/IdentityMatch.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/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/ResolvedDrug.d.ts +26 -0
- package/dist/cjs/api/types/SafetyData.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +10 -0
- package/dist/cjs/api/types/index.js +10 -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/developers/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/developers/client/Client.mjs +1 -1
- package/dist/esm/api/resources/drugSafety/client/Client.d.mts +10 -6
- package/dist/esm/api/resources/drugSafety/client/Client.mjs +10 -6
- package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.mts +8 -5
- 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 +8 -2
- 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/ErrorResponse.d.mts +5 -0
- package/dist/esm/api/types/IdentityMatch.d.mts +13 -0
- package/dist/esm/api/types/IdentityMatch.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/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/ResolvedDrug.d.mts +26 -0
- package/dist/esm/api/types/SafetyData.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +10 -0
- package/dist/esm/api/types/index.mjs +10 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -14,11 +14,13 @@ export interface Alert {
|
|
|
14
14
|
/**
|
|
15
15
|
* Alert source domain and trigger.
|
|
16
16
|
* - `ae_bbw` — Drug has a Black Box Warning
|
|
17
|
-
* - `ddi` — Major (severity
|
|
17
|
+
* - `ddi` — Major (severity 3) or contraindicated (severity 4) interaction
|
|
18
18
|
* - `pllr_pregnancy` — Pregnancy risk >= 6 (Contraindicated or Absolutely Contraindicated)
|
|
19
19
|
* - `pllr_lactation` — Lactation risk >= 6
|
|
20
20
|
* - `clinical_condition` — Clinical condition severity >= 4
|
|
21
21
|
* - `clinical_population` — Clinical population severity >= 4
|
|
22
|
+
* - `allergy_direct` — Product directly matches a supplied patient allergy
|
|
23
|
+
* - `allergy_cross_reactivity` — Product cross-reacts with a supplied patient allergy
|
|
22
24
|
*/
|
|
23
25
|
type: Alert.Type;
|
|
24
26
|
/** Human-readable alert message (English) */
|
|
@@ -46,11 +48,13 @@ export declare namespace Alert {
|
|
|
46
48
|
/**
|
|
47
49
|
* Alert source domain and trigger.
|
|
48
50
|
* - `ae_bbw` — Drug has a Black Box Warning
|
|
49
|
-
* - `ddi` — Major (severity
|
|
51
|
+
* - `ddi` — Major (severity 3) or contraindicated (severity 4) interaction
|
|
50
52
|
* - `pllr_pregnancy` — Pregnancy risk >= 6 (Contraindicated or Absolutely Contraindicated)
|
|
51
53
|
* - `pllr_lactation` — Lactation risk >= 6
|
|
52
54
|
* - `clinical_condition` — Clinical condition severity >= 4
|
|
53
55
|
* - `clinical_population` — Clinical population severity >= 4
|
|
56
|
+
* - `allergy_direct` — Product directly matches a supplied patient allergy
|
|
57
|
+
* - `allergy_cross_reactivity` — Product cross-reacts with a supplied patient allergy
|
|
54
58
|
*/
|
|
55
59
|
const Type: {
|
|
56
60
|
readonly AeBbw: "ae_bbw";
|
|
@@ -59,6 +63,8 @@ export declare namespace Alert {
|
|
|
59
63
|
readonly PllrLactation: "pllr_lactation";
|
|
60
64
|
readonly ClinicalCondition: "clinical_condition";
|
|
61
65
|
readonly ClinicalPopulation: "clinical_population";
|
|
66
|
+
readonly AllergyDirect: "allergy_direct";
|
|
67
|
+
readonly AllergyCrossReactivity: "allergy_cross_reactivity";
|
|
62
68
|
};
|
|
63
69
|
type Type = (typeof Type)[keyof typeof Type];
|
|
64
70
|
}
|
|
@@ -17,11 +17,13 @@ export var Alert;
|
|
|
17
17
|
/**
|
|
18
18
|
* Alert source domain and trigger.
|
|
19
19
|
* - `ae_bbw` — Drug has a Black Box Warning
|
|
20
|
-
* - `ddi` — Major (severity
|
|
20
|
+
* - `ddi` — Major (severity 3) or contraindicated (severity 4) interaction
|
|
21
21
|
* - `pllr_pregnancy` — Pregnancy risk >= 6 (Contraindicated or Absolutely Contraindicated)
|
|
22
22
|
* - `pllr_lactation` — Lactation risk >= 6
|
|
23
23
|
* - `clinical_condition` — Clinical condition severity >= 4
|
|
24
24
|
* - `clinical_population` — Clinical population severity >= 4
|
|
25
|
+
* - `allergy_direct` — Product directly matches a supplied patient allergy
|
|
26
|
+
* - `allergy_cross_reactivity` — Product cross-reacts with a supplied patient allergy
|
|
25
27
|
*/
|
|
26
28
|
Alert.Type = {
|
|
27
29
|
AeBbw: "ae_bbw",
|
|
@@ -30,5 +32,7 @@ export var Alert;
|
|
|
30
32
|
PllrLactation: "pllr_lactation",
|
|
31
33
|
ClinicalCondition: "clinical_condition",
|
|
32
34
|
ClinicalPopulation: "clinical_population",
|
|
35
|
+
AllergyDirect: "allergy_direct",
|
|
36
|
+
AllergyCrossReactivity: "allergy_cross_reactivity",
|
|
33
37
|
};
|
|
34
38
|
})(Alert || (Alert = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AllergyCrossReactivityReference {
|
|
2
|
+
target_family?: string | undefined;
|
|
3
|
+
target_family_name_en?: string | undefined;
|
|
4
|
+
target_family_name_ar?: (string | null) | undefined;
|
|
5
|
+
severity?: number | undefined;
|
|
6
|
+
severity_label?: (string | null) | undefined;
|
|
7
|
+
severity_label_ar?: (string | null) | undefined;
|
|
8
|
+
frequency_category?: (number | null) | undefined;
|
|
9
|
+
frequency_label?: (string | null) | undefined;
|
|
10
|
+
frequency_label_ar?: (string | null) | undefined;
|
|
11
|
+
mechanism_en?: (string | null) | undefined;
|
|
12
|
+
mechanism_ar?: (string | null) | undefined;
|
|
13
|
+
clinical_note_en?: (string | null) | undefined;
|
|
14
|
+
clinical_note_ar?: (string | null) | undefined;
|
|
15
|
+
evidence_level?: (string | null) | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Patient allergy matching results. Without `patient_profile.allergies`,
|
|
4
|
+
* the domain returns reference-only summary data and no patient-specific
|
|
5
|
+
* clearance should be inferred.
|
|
6
|
+
*/
|
|
7
|
+
export interface AllergyData {
|
|
8
|
+
mode?: AllergyData.Mode | undefined;
|
|
9
|
+
warnings?: SafeRx.AllergyWarning[] | undefined;
|
|
10
|
+
summary?: SafeRx.AllergySummary | undefined;
|
|
11
|
+
/** Product-level allergy family and cross-reactivity reference data keyed by `sfrx_id`. */
|
|
12
|
+
product_families?: Record<string, SafeRx.AllergyProductFamilyReference> | undefined;
|
|
13
|
+
needs_review_entries?: SafeRx.AllergyInputEntry[] | undefined;
|
|
14
|
+
unresolved_entries?: SafeRx.AllergyInputEntry[] | undefined;
|
|
15
|
+
/** Resolved product IDs that had no allergy reference record. */
|
|
16
|
+
missing_products?: string[] | undefined;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace AllergyData {
|
|
19
|
+
const Mode: {
|
|
20
|
+
readonly ReferenceOnly: "reference_only";
|
|
21
|
+
readonly PatientProfile: "patient_profile";
|
|
22
|
+
};
|
|
23
|
+
type Mode = (typeof Mode)[keyof typeof Mode];
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.mjs";
|
|
2
|
+
export interface AllergyFamilyReference {
|
|
3
|
+
family_id?: string | undefined;
|
|
4
|
+
name_en?: string | undefined;
|
|
5
|
+
name_ar?: (string | null) | undefined;
|
|
6
|
+
description_en?: (string | null) | undefined;
|
|
7
|
+
description_ar?: (string | null) | undefined;
|
|
8
|
+
clinical_significance?: (string | null) | undefined;
|
|
9
|
+
cross_reactivity?: SafeRx.AllergyCrossReactivityReference[] | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caller-provided allergy entry that could not be fully resolved or needs review.
|
|
3
|
+
*/
|
|
4
|
+
export interface AllergyInputEntry {
|
|
5
|
+
raw_input?: string | undefined;
|
|
6
|
+
source_label?: string | undefined;
|
|
7
|
+
family_id?: (string | null) | undefined;
|
|
8
|
+
source_sfrx_id?: (string | null) | undefined;
|
|
9
|
+
normalization_status?: (string | null) | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.mjs";
|
|
2
|
+
export interface AllergyProductFamilyReference {
|
|
3
|
+
tradename_en?: string | undefined;
|
|
4
|
+
generic_en?: string | undefined;
|
|
5
|
+
dosage_form_en?: string | undefined;
|
|
6
|
+
route_type?: (string | null) | undefined;
|
|
7
|
+
has_allergy_data?: boolean | undefined;
|
|
8
|
+
families?: SafeRx.AllergyFamilyReference[] | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AllergySummary {
|
|
2
|
+
check_mode?: string | undefined;
|
|
3
|
+
products_checked?: number | undefined;
|
|
4
|
+
patient_allergies_count?: number | undefined;
|
|
5
|
+
resolved_patient_allergies_count?: number | undefined;
|
|
6
|
+
resolved_family_count?: number | undefined;
|
|
7
|
+
needs_review_count?: number | undefined;
|
|
8
|
+
unresolved_patient_allergies_count?: number | undefined;
|
|
9
|
+
direct_warnings?: number | undefined;
|
|
10
|
+
cross_reactivity_warnings?: number | undefined;
|
|
11
|
+
total_warnings?: number | undefined;
|
|
12
|
+
contraindicated_count?: number | undefined;
|
|
13
|
+
missing_products_count?: number | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface AllergyWarning {
|
|
2
|
+
sfrx_id?: string | undefined;
|
|
3
|
+
drug_name?: string | undefined;
|
|
4
|
+
generic_en?: string | undefined;
|
|
5
|
+
dosage_form_en?: string | undefined;
|
|
6
|
+
warning_type?: AllergyWarning.WarningType | undefined;
|
|
7
|
+
allergen_family?: string | undefined;
|
|
8
|
+
allergen_family_name_en?: string | undefined;
|
|
9
|
+
patient_allergy?: string | undefined;
|
|
10
|
+
patient_allergy_raw_input?: string | undefined;
|
|
11
|
+
severity?: number | undefined;
|
|
12
|
+
severity_label?: string | undefined;
|
|
13
|
+
severity_label_ar?: string | undefined;
|
|
14
|
+
frequency_category?: (number | null) | undefined;
|
|
15
|
+
frequency_label?: (string | null) | undefined;
|
|
16
|
+
frequency_min_pct?: (number | null) | undefined;
|
|
17
|
+
frequency_max_pct?: (number | null) | undefined;
|
|
18
|
+
mechanism_en?: (string | null) | undefined;
|
|
19
|
+
mechanism_ar?: (string | null) | undefined;
|
|
20
|
+
clinical_note_en?: (string | null) | undefined;
|
|
21
|
+
clinical_note_ar?: (string | null) | undefined;
|
|
22
|
+
evidence_level?: (string | null) | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace AllergyWarning {
|
|
25
|
+
const WarningType: {
|
|
26
|
+
readonly Direct: "direct";
|
|
27
|
+
readonly CrossReactivity: "cross_reactivity";
|
|
28
|
+
};
|
|
29
|
+
type WarningType = (typeof WarningType)[keyof typeof WarningType];
|
|
30
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var AllergyWarning;
|
|
3
|
+
(function (AllergyWarning) {
|
|
4
|
+
AllergyWarning.WarningType = {
|
|
5
|
+
Direct: "direct",
|
|
6
|
+
CrossReactivity: "cross_reactivity",
|
|
7
|
+
};
|
|
8
|
+
})(AllergyWarning || (AllergyWarning = {}));
|
|
@@ -26,6 +26,14 @@ export interface ClinicalAlert {
|
|
|
26
26
|
contraindicated?: boolean | undefined;
|
|
27
27
|
/** Whether dose adjustment is needed */
|
|
28
28
|
requires_dose_adjustment?: boolean | undefined;
|
|
29
|
+
/** Matched dose-adjustment instruction from the population band, when available. */
|
|
30
|
+
dose_adjustment?: (string | null) | undefined;
|
|
31
|
+
/** Matched dosing recommendation in English, when available. */
|
|
32
|
+
dose_recommendation?: (string | null) | undefined;
|
|
33
|
+
/** Matched dosing recommendation in Arabic, when available. */
|
|
34
|
+
dose_recommendation_ar?: (string | null) | undefined;
|
|
35
|
+
/** Matched renal/hepatic/pediatric context, including the selected band or grade when available. */
|
|
36
|
+
matched_context?: Record<string, unknown> | undefined;
|
|
29
37
|
/** Whether additional monitoring is needed */
|
|
30
38
|
monitoring_required?: boolean | undefined;
|
|
31
39
|
/** Clinical rationale (English) */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ClinicalContextApplied {
|
|
2
|
+
/** Condition keys applied to clinical filtering. */
|
|
3
|
+
conditions?: string[] | undefined;
|
|
4
|
+
/** Population keys applied to clinical filtering after adding inferred populations. */
|
|
5
|
+
populations?: string[] | undefined;
|
|
6
|
+
/** Population keys explicitly supplied by the caller. */
|
|
7
|
+
requested_populations?: string[] | undefined;
|
|
8
|
+
/** Population keys inferred from patient values such as `crcl`, `child_pugh`, or `age`. */
|
|
9
|
+
inferred_populations?: string[] | undefined;
|
|
10
|
+
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type * as SafeRx from "../index.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* Clinical safety considerations combining per-drug population/condition
|
|
4
|
-
* data with cross-drug clinical alerts.
|
|
5
|
-
*
|
|
4
|
+
* data with cross-drug clinical alerts. Without `patient_profile`, the
|
|
5
|
+
* API returns product-wide clinical signals; with `patient_profile`, alert
|
|
6
|
+
* lists are narrowed to the supplied populations and conditions.
|
|
6
7
|
*/
|
|
7
8
|
export interface ClinicalData {
|
|
8
9
|
/** Per-drug clinical data keyed by sfrx_id */
|
|
9
10
|
drug_specific?: Record<string, SafeRx.DrugClinicalData> | undefined;
|
|
10
|
-
/**
|
|
11
|
+
/** Condition-related alerts. Narrowed to `patient_profile.conditions` when supplied; otherwise product-wide condition signals may be returned. */
|
|
11
12
|
condition_alerts?: SafeRx.ClinicalAlert[] | undefined;
|
|
12
|
-
/**
|
|
13
|
+
/** Population-related alerts. Narrowed to `patient_profile.populations` when supplied; otherwise product-wide population signals may be returned. */
|
|
13
14
|
population_alerts?: SafeRx.ClinicalAlert[] | undefined;
|
|
15
|
+
/** Patient context actually applied to clinical-dose matching, including inferred populations from age, renal, or hepatic values. */
|
|
16
|
+
context_applied?: SafeRx.ClinicalContextApplied | undefined;
|
|
14
17
|
}
|
|
@@ -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
|
/**
|
|
@@ -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
|
+
}
|
|
@@ -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
|
}
|
|
@@ -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
|
+
}
|