saferx-pharma-sdk 1.4.0 → 1.4.2
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 +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/DrugSafetyCheckResponse.d.ts +1 -0
- 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/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/ResolvedDrug.d.ts +26 -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 +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/DrugSafetyCheckResponse.d.mts +1 -0
- 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/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/ResolvedDrug.d.mts +26 -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
|
@@ -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
|
+
}
|
|
@@ -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
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as SafeRx from "../index.mjs";
|
|
1
2
|
export interface ResolvedDrug {
|
|
2
3
|
/** The original drug name as submitted in the request */
|
|
3
4
|
input: string;
|
|
@@ -17,6 +18,10 @@ export interface ResolvedDrug {
|
|
|
17
18
|
brand_name: string;
|
|
18
19
|
/** Arabic trade name */
|
|
19
20
|
brand_name_ar?: string | undefined;
|
|
21
|
+
/** Concise registered name plus strength, useful for app display and local matching. */
|
|
22
|
+
display_name?: string | undefined;
|
|
23
|
+
/** Arabic concise registered name plus strength, when available. */
|
|
24
|
+
display_name_ar?: string | undefined;
|
|
20
25
|
/** Active pharmaceutical ingredient(s), pipe-separated for combinations */
|
|
21
26
|
active_ingredient: string;
|
|
22
27
|
/** Arabic active ingredient name */
|
|
@@ -29,10 +34,30 @@ export interface ResolvedDrug {
|
|
|
29
34
|
form: string;
|
|
30
35
|
/** Arabic dosage form */
|
|
31
36
|
form_ar?: string | undefined;
|
|
37
|
+
/** Registered strength text as listed for the product. */
|
|
38
|
+
strength?: string | undefined;
|
|
39
|
+
/** Administration route, when available. */
|
|
40
|
+
route?: string | undefined;
|
|
32
41
|
/** Marketing authorization holder */
|
|
33
42
|
manufacturer_en?: string | undefined;
|
|
34
43
|
/** ATC-based therapeutic classification, pipe-separated hierarchy */
|
|
35
44
|
therapeutic_class?: string | undefined;
|
|
45
|
+
/** Public therapeutic/pharmacology summary in English. */
|
|
46
|
+
therapeutic_class_detail?: string | undefined;
|
|
47
|
+
/** Public therapeutic/pharmacology summary in Arabic, when available. */
|
|
48
|
+
therapeutic_class_detail_ar?: string | undefined;
|
|
49
|
+
/** Registered pharmaceutical uses or indications in English, when available. */
|
|
50
|
+
pharma_uses?: string | undefined;
|
|
51
|
+
/** Registered pharmaceutical uses or indications in Arabic, when available. */
|
|
52
|
+
pharma_uses_ar?: string | undefined;
|
|
53
|
+
/** Patient/app-friendly product description in English, when available. */
|
|
54
|
+
description?: string | undefined;
|
|
55
|
+
/** Patient/app-friendly product description in Arabic, when available. */
|
|
56
|
+
description_ar?: string | undefined;
|
|
57
|
+
/** Mechanism of action summary in English, when available. */
|
|
58
|
+
mechanism?: string | undefined;
|
|
59
|
+
/** Public warning summary in English, when available. */
|
|
60
|
+
warnings?: string | undefined;
|
|
36
61
|
/** Primary prescribing specialty */
|
|
37
62
|
medical_specialty?: string | undefined;
|
|
38
63
|
/** Distribution/supply company (may be empty) */
|
|
@@ -41,4 +66,5 @@ export interface ResolvedDrug {
|
|
|
41
66
|
barcode?: string | undefined;
|
|
42
67
|
/** Current price in Egyptian Pounds (EGP) */
|
|
43
68
|
price_egp?: number | undefined;
|
|
69
|
+
identity_match?: SafeRx.IdentityMatch | undefined;
|
|
44
70
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
export * from "./AdverseEffect.mjs";
|
|
2
2
|
export * from "./Alert.mjs";
|
|
3
|
+
export * from "./AllergyCrossReactivityReference.mjs";
|
|
4
|
+
export * from "./AllergyData.mjs";
|
|
5
|
+
export * from "./AllergyFamilyReference.mjs";
|
|
6
|
+
export * from "./AllergyInputEntry.mjs";
|
|
7
|
+
export * from "./AllergyProductFamilyReference.mjs";
|
|
8
|
+
export * from "./AllergySummary.mjs";
|
|
9
|
+
export * from "./AllergyWarning.mjs";
|
|
3
10
|
export * from "./BadRequestErrorBody.mjs";
|
|
4
11
|
export * from "./BlackBoxWarning.mjs";
|
|
5
12
|
export * from "./BlockedResponse.mjs";
|
|
6
13
|
export * from "./ClinicalAlert.mjs";
|
|
7
14
|
export * from "./ClinicalConcern.mjs";
|
|
15
|
+
export * from "./ClinicalContextApplied.mjs";
|
|
8
16
|
export * from "./ClinicalData.mjs";
|
|
9
17
|
export * from "./Condition.mjs";
|
|
10
18
|
export * from "./DailyLimit.mjs";
|
|
@@ -18,17 +26,25 @@ export * from "./ErrorResponse.mjs";
|
|
|
18
26
|
export * from "./FoodConflict.mjs";
|
|
19
27
|
export * from "./FoodData.mjs";
|
|
20
28
|
export * from "./ForbiddenErrorBody.mjs";
|
|
29
|
+
export * from "./IdentityMatch.mjs";
|
|
30
|
+
export * from "./IntelligenceClinicalProfile.mjs";
|
|
31
|
+
export * from "./IntelligenceContext.mjs";
|
|
32
|
+
export * from "./IntelligenceProcessorError.mjs";
|
|
33
|
+
export * from "./IntelligenceResult.mjs";
|
|
34
|
+
export * from "./IntelligenceSynthesis.mjs";
|
|
21
35
|
export * from "./Interaction.mjs";
|
|
22
36
|
export * from "./InteractionSummary.mjs";
|
|
23
37
|
export * from "./InteractionsData.mjs";
|
|
24
38
|
export * from "./InternalServerErrorBody.mjs";
|
|
25
39
|
export * from "./MealTiming.mjs";
|
|
40
|
+
export * from "./MedicationHistoryItem.mjs";
|
|
26
41
|
export * from "./Meta.mjs";
|
|
27
42
|
export * from "./MetadataResponse.mjs";
|
|
28
43
|
export * from "./Monitoring.mjs";
|
|
29
44
|
export * from "./PatientProfile.mjs";
|
|
30
45
|
export * from "./Population.mjs";
|
|
31
46
|
export * from "./PopulationMonitoring.mjs";
|
|
47
|
+
export * from "./QuotaMeta.mjs";
|
|
32
48
|
export * from "./RateLimitResponse.mjs";
|
|
33
49
|
export * from "./ReferenceDose.mjs";
|
|
34
50
|
export * from "./ReproductiveSafetyData.mjs";
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
export * from "./AdverseEffect.mjs";
|
|
2
2
|
export * from "./Alert.mjs";
|
|
3
|
+
export * from "./AllergyCrossReactivityReference.mjs";
|
|
4
|
+
export * from "./AllergyData.mjs";
|
|
5
|
+
export * from "./AllergyFamilyReference.mjs";
|
|
6
|
+
export * from "./AllergyInputEntry.mjs";
|
|
7
|
+
export * from "./AllergyProductFamilyReference.mjs";
|
|
8
|
+
export * from "./AllergySummary.mjs";
|
|
9
|
+
export * from "./AllergyWarning.mjs";
|
|
3
10
|
export * from "./BadRequestErrorBody.mjs";
|
|
4
11
|
export * from "./BlackBoxWarning.mjs";
|
|
5
12
|
export * from "./BlockedResponse.mjs";
|
|
6
13
|
export * from "./ClinicalAlert.mjs";
|
|
7
14
|
export * from "./ClinicalConcern.mjs";
|
|
15
|
+
export * from "./ClinicalContextApplied.mjs";
|
|
8
16
|
export * from "./ClinicalData.mjs";
|
|
9
17
|
export * from "./Condition.mjs";
|
|
10
18
|
export * from "./DailyLimit.mjs";
|
|
@@ -18,17 +26,25 @@ export * from "./ErrorResponse.mjs";
|
|
|
18
26
|
export * from "./FoodConflict.mjs";
|
|
19
27
|
export * from "./FoodData.mjs";
|
|
20
28
|
export * from "./ForbiddenErrorBody.mjs";
|
|
29
|
+
export * from "./IdentityMatch.mjs";
|
|
30
|
+
export * from "./IntelligenceClinicalProfile.mjs";
|
|
31
|
+
export * from "./IntelligenceContext.mjs";
|
|
32
|
+
export * from "./IntelligenceProcessorError.mjs";
|
|
33
|
+
export * from "./IntelligenceResult.mjs";
|
|
34
|
+
export * from "./IntelligenceSynthesis.mjs";
|
|
21
35
|
export * from "./Interaction.mjs";
|
|
22
36
|
export * from "./InteractionSummary.mjs";
|
|
23
37
|
export * from "./InteractionsData.mjs";
|
|
24
38
|
export * from "./InternalServerErrorBody.mjs";
|
|
25
39
|
export * from "./MealTiming.mjs";
|
|
40
|
+
export * from "./MedicationHistoryItem.mjs";
|
|
26
41
|
export * from "./Meta.mjs";
|
|
27
42
|
export * from "./MetadataResponse.mjs";
|
|
28
43
|
export * from "./Monitoring.mjs";
|
|
29
44
|
export * from "./PatientProfile.mjs";
|
|
30
45
|
export * from "./Population.mjs";
|
|
31
46
|
export * from "./PopulationMonitoring.mjs";
|
|
47
|
+
export * from "./QuotaMeta.mjs";
|
|
32
48
|
export * from "./RateLimitResponse.mjs";
|
|
33
49
|
export * from "./ReferenceDose.mjs";
|
|
34
50
|
export * from "./ReproductiveSafetyData.mjs";
|
|
@@ -14,6 +14,6 @@ export type BinaryResponse = {
|
|
|
14
14
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
|
|
15
15
|
* Some versions of the Fetch API may not support this method.
|
|
16
16
|
*/
|
|
17
|
-
bytes?():
|
|
17
|
+
bytes?(): Promise<Uint8Array>;
|
|
18
18
|
};
|
|
19
19
|
export declare function getBinaryResponse(response: Response): BinaryResponse;
|