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.
Files changed (109) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/developers/client/Client.d.ts +1 -1
  3. package/dist/cjs/api/resources/developers/client/Client.js +1 -1
  4. package/dist/cjs/api/resources/drugSafety/client/Client.d.ts +10 -6
  5. package/dist/cjs/api/resources/drugSafety/client/Client.js +10 -6
  6. package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.ts +8 -5
  7. package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.ts +2 -14
  8. package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.js +0 -11
  9. package/dist/cjs/api/types/Alert.d.ts +8 -2
  10. package/dist/cjs/api/types/Alert.js +5 -1
  11. package/dist/cjs/api/types/AllergyCrossReactivityReference.d.ts +16 -0
  12. package/dist/cjs/api/types/AllergyCrossReactivityReference.js +3 -0
  13. package/dist/cjs/api/types/AllergyData.d.ts +24 -0
  14. package/dist/cjs/api/types/AllergyData.js +11 -0
  15. package/dist/cjs/api/types/AllergyFamilyReference.d.ts +10 -0
  16. package/dist/cjs/api/types/AllergyFamilyReference.js +3 -0
  17. package/dist/cjs/api/types/AllergyInputEntry.d.ts +10 -0
  18. package/dist/cjs/api/types/AllergyInputEntry.js +3 -0
  19. package/dist/cjs/api/types/AllergyProductFamilyReference.d.ts +9 -0
  20. package/dist/cjs/api/types/AllergyProductFamilyReference.js +3 -0
  21. package/dist/cjs/api/types/AllergySummary.d.ts +14 -0
  22. package/dist/cjs/api/types/AllergySummary.js +3 -0
  23. package/dist/cjs/api/types/AllergyWarning.d.ts +30 -0
  24. package/dist/cjs/api/types/AllergyWarning.js +11 -0
  25. package/dist/cjs/api/types/ClinicalAlert.d.ts +8 -0
  26. package/dist/cjs/api/types/ClinicalContextApplied.d.ts +10 -0
  27. package/dist/cjs/api/types/ClinicalContextApplied.js +3 -0
  28. package/dist/cjs/api/types/ClinicalData.d.ts +7 -4
  29. package/dist/cjs/api/types/DailyLimit.d.ts +1 -1
  30. package/dist/cjs/api/types/DomainCode.d.ts +4 -2
  31. package/dist/cjs/api/types/DomainCode.js +4 -2
  32. package/dist/cjs/api/types/DosingData.d.ts +22 -12
  33. package/dist/cjs/api/types/DosingData.js +3 -3
  34. package/dist/cjs/api/types/ErrorResponse.d.ts +5 -0
  35. package/dist/cjs/api/types/IdentityMatch.d.ts +13 -0
  36. package/dist/cjs/api/types/IdentityMatch.js +3 -0
  37. package/dist/cjs/api/types/Interaction.d.ts +0 -2
  38. package/dist/cjs/api/types/InteractionSummary.d.ts +4 -4
  39. package/dist/cjs/api/types/Meta.d.ts +2 -0
  40. package/dist/cjs/api/types/Meta.js +1 -0
  41. package/dist/cjs/api/types/MetadataResponse.d.ts +14 -6
  42. package/dist/cjs/api/types/MetadataResponse.js +1 -0
  43. package/dist/cjs/api/types/PatientProfile.d.ts +31 -0
  44. package/dist/cjs/api/types/PatientProfile.js +17 -0
  45. package/dist/cjs/api/types/QuotaMeta.d.ts +11 -0
  46. package/dist/cjs/api/types/QuotaMeta.js +3 -0
  47. package/dist/cjs/api/types/RateLimitResponse.d.ts +11 -0
  48. package/dist/cjs/api/types/RateLimitResponse.js +1 -0
  49. package/dist/cjs/api/types/ResolvedDrug.d.ts +26 -0
  50. package/dist/cjs/api/types/SafetyData.d.ts +1 -0
  51. package/dist/cjs/api/types/index.d.ts +10 -0
  52. package/dist/cjs/api/types/index.js +10 -0
  53. package/dist/cjs/version.d.ts +1 -1
  54. package/dist/cjs/version.js +1 -1
  55. package/dist/esm/BaseClient.mjs +2 -2
  56. package/dist/esm/api/resources/developers/client/Client.d.mts +1 -1
  57. package/dist/esm/api/resources/developers/client/Client.mjs +1 -1
  58. package/dist/esm/api/resources/drugSafety/client/Client.d.mts +10 -6
  59. package/dist/esm/api/resources/drugSafety/client/Client.mjs +10 -6
  60. package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.mts +8 -5
  61. package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.mts +2 -14
  62. package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.mjs +0 -11
  63. package/dist/esm/api/types/Alert.d.mts +8 -2
  64. package/dist/esm/api/types/Alert.mjs +5 -1
  65. package/dist/esm/api/types/AllergyCrossReactivityReference.d.mts +16 -0
  66. package/dist/esm/api/types/AllergyCrossReactivityReference.mjs +2 -0
  67. package/dist/esm/api/types/AllergyData.d.mts +24 -0
  68. package/dist/esm/api/types/AllergyData.mjs +8 -0
  69. package/dist/esm/api/types/AllergyFamilyReference.d.mts +10 -0
  70. package/dist/esm/api/types/AllergyFamilyReference.mjs +2 -0
  71. package/dist/esm/api/types/AllergyInputEntry.d.mts +10 -0
  72. package/dist/esm/api/types/AllergyInputEntry.mjs +2 -0
  73. package/dist/esm/api/types/AllergyProductFamilyReference.d.mts +9 -0
  74. package/dist/esm/api/types/AllergyProductFamilyReference.mjs +2 -0
  75. package/dist/esm/api/types/AllergySummary.d.mts +14 -0
  76. package/dist/esm/api/types/AllergySummary.mjs +2 -0
  77. package/dist/esm/api/types/AllergyWarning.d.mts +30 -0
  78. package/dist/esm/api/types/AllergyWarning.mjs +8 -0
  79. package/dist/esm/api/types/ClinicalAlert.d.mts +8 -0
  80. package/dist/esm/api/types/ClinicalContextApplied.d.mts +10 -0
  81. package/dist/esm/api/types/ClinicalContextApplied.mjs +2 -0
  82. package/dist/esm/api/types/ClinicalData.d.mts +7 -4
  83. package/dist/esm/api/types/DailyLimit.d.mts +1 -1
  84. package/dist/esm/api/types/DomainCode.d.mts +4 -2
  85. package/dist/esm/api/types/DomainCode.mjs +4 -2
  86. package/dist/esm/api/types/DosingData.d.mts +22 -12
  87. package/dist/esm/api/types/DosingData.mjs +3 -3
  88. package/dist/esm/api/types/ErrorResponse.d.mts +5 -0
  89. package/dist/esm/api/types/IdentityMatch.d.mts +13 -0
  90. package/dist/esm/api/types/IdentityMatch.mjs +2 -0
  91. package/dist/esm/api/types/Interaction.d.mts +0 -2
  92. package/dist/esm/api/types/InteractionSummary.d.mts +4 -4
  93. package/dist/esm/api/types/Meta.d.mts +2 -0
  94. package/dist/esm/api/types/Meta.mjs +1 -0
  95. package/dist/esm/api/types/MetadataResponse.d.mts +14 -6
  96. package/dist/esm/api/types/MetadataResponse.mjs +1 -0
  97. package/dist/esm/api/types/PatientProfile.d.mts +31 -0
  98. package/dist/esm/api/types/PatientProfile.mjs +16 -1
  99. package/dist/esm/api/types/QuotaMeta.d.mts +11 -0
  100. package/dist/esm/api/types/QuotaMeta.mjs +2 -0
  101. package/dist/esm/api/types/RateLimitResponse.d.mts +11 -0
  102. package/dist/esm/api/types/RateLimitResponse.mjs +1 -0
  103. package/dist/esm/api/types/ResolvedDrug.d.mts +26 -0
  104. package/dist/esm/api/types/SafetyData.d.mts +1 -0
  105. package/dist/esm/api/types/index.d.mts +10 -0
  106. package/dist/esm/api/types/index.mjs +10 -0
  107. package/dist/esm/version.d.mts +1 -1
  108. package/dist/esm/version.mjs +1 -1
  109. package/package.json +1 -1
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "saferx-pharma-sdk",
46
- "X-Fern-SDK-Version": "0.0.39",
47
- "User-Agent": "saferx-pharma-sdk/0.0.39",
46
+ "X-Fern-SDK-Version": "0.0.51",
47
+ "User-Agent": "saferx-pharma-sdk/0.0.51",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -37,7 +37,7 @@ export declare class DevelopersClient {
37
37
  * - Code expires after 30 minutes
38
38
  * - Max 5 wrong attempts per code (then must request new code)
39
39
  * - On success: issues sfx_free_ key (persistent, 1 per email)
40
- * - Free tier: 20 requests/minute, 60 requests/day
40
+ * - Free tier: 100 checks/month, 20 requests/minute anti-abuse, 60/day safety cap
41
41
  *
42
42
  * @param {SafeRx.VerifyFreeKeyDevelopersRequest} request
43
43
  * @param {DevelopersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -124,7 +124,7 @@ class DevelopersClient {
124
124
  * - Code expires after 30 minutes
125
125
  * - Max 5 wrong attempts per code (then must request new code)
126
126
  * - On success: issues sfx_free_ key (persistent, 1 per email)
127
- * - Free tier: 20 requests/minute, 60 requests/day
127
+ * - Free tier: 100 checks/month, 20 requests/minute anti-abuse, 60/day safety cap
128
128
  *
129
129
  * @param {SafeRx.VerifyFreeKeyDevelopersRequest} request
130
130
  * @param {DevelopersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -14,12 +14,14 @@ export declare class DrugSafetyClient {
14
14
  protected readonly _options: NormalizedClientOptionsWithAuth<DrugSafetyClient.Options>;
15
15
  constructor(options?: DrugSafetyClient.Options);
16
16
  /**
17
- * Screen one or more drugs across six safety domains in a single request.
17
+ * Screen one or more drugs across seven safety domains in a single request.
18
18
  *
19
19
  * The API resolves drug names via fuzzy matching, runs all requested safety
20
20
  * checks in parallel, and returns a unified response with alerts bubbled to
21
21
  * the top for easy triage.
22
22
  *
23
+ * This endpoint is API-key only. It does not require `X-SafeRx-Token`.
24
+ *
23
25
  * **Typical response time:** ~40ms (warm cache, 3 drugs, all domains).
24
26
  *
25
27
  * @param {SafeRx.DrugSafetyCheckRequest} request
@@ -42,9 +44,10 @@ export declare class DrugSafetyClient {
42
44
  * drugs: ["Augmentin 1g", "Glucophage 500mg", "Marivan"],
43
45
  * patient_profile: {
44
46
  * populations: ["geriatric", "renal"],
45
- * conditions: ["diabetes", "hypertension"]
47
+ * conditions: ["diabetes", "hypertension"],
48
+ * allergies: ["penicillin"]
46
49
  * },
47
- * include: ["ae", "ddi", "pllr", "clinical"],
50
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
48
51
  * lang: "en"
49
52
  * })
50
53
  *
@@ -74,7 +77,7 @@ export declare class DrugSafetyClient {
74
77
  * status: "historical"
75
78
  * }]
76
79
  * },
77
- * include: ["ae", "ddi", "pllr", "clinical", "dose"],
80
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
78
81
  * lang: "en"
79
82
  * })
80
83
  *
@@ -113,10 +116,11 @@ export declare class DrugSafetyClient {
113
116
  getMetadata(requestOptions?: DrugSafetyClient.RequestOptions): core.HttpResponsePromise<SafeRx.MetadataResponse>;
114
117
  private __getMetadata;
115
118
  /**
116
- * Returns health status of the Drug Safety API subsystem including
117
- * overall system health and availability.
119
+ * Returns minimal health status of the Drug Safety API subsystem.
118
120
  *
119
121
  * No authentication required. Designed for monitoring services.
122
+ * The public enterprise health endpoint intentionally does not expose
123
+ * database counts, module internals, or detailed dependency checks.
120
124
  *
121
125
  * @param {DrugSafetyClient.RequestOptions} requestOptions - Request-specific configuration.
122
126
  *
@@ -59,12 +59,14 @@ class DrugSafetyClient {
59
59
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
60
60
  }
61
61
  /**
62
- * Screen one or more drugs across six safety domains in a single request.
62
+ * Screen one or more drugs across seven safety domains in a single request.
63
63
  *
64
64
  * The API resolves drug names via fuzzy matching, runs all requested safety
65
65
  * checks in parallel, and returns a unified response with alerts bubbled to
66
66
  * the top for easy triage.
67
67
  *
68
+ * This endpoint is API-key only. It does not require `X-SafeRx-Token`.
69
+ *
68
70
  * **Typical response time:** ~40ms (warm cache, 3 drugs, all domains).
69
71
  *
70
72
  * @param {SafeRx.DrugSafetyCheckRequest} request
@@ -87,9 +89,10 @@ class DrugSafetyClient {
87
89
  * drugs: ["Augmentin 1g", "Glucophage 500mg", "Marivan"],
88
90
  * patient_profile: {
89
91
  * populations: ["geriatric", "renal"],
90
- * conditions: ["diabetes", "hypertension"]
92
+ * conditions: ["diabetes", "hypertension"],
93
+ * allergies: ["penicillin"]
91
94
  * },
92
- * include: ["ae", "ddi", "pllr", "clinical"],
95
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
93
96
  * lang: "en"
94
97
  * })
95
98
  *
@@ -119,7 +122,7 @@ class DrugSafetyClient {
119
122
  * status: "historical"
120
123
  * }]
121
124
  * },
122
- * include: ["ae", "ddi", "pllr", "clinical", "dose"],
125
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
123
126
  * lang: "en"
124
127
  * })
125
128
  *
@@ -241,10 +244,11 @@ class DrugSafetyClient {
241
244
  });
242
245
  }
243
246
  /**
244
- * Returns health status of the Drug Safety API subsystem including
245
- * overall system health and availability.
247
+ * Returns minimal health status of the Drug Safety API subsystem.
246
248
  *
247
249
  * No authentication required. Designed for monitoring services.
250
+ * The public enterprise health endpoint intentionally does not expose
251
+ * database counts, module internals, or detailed dependency checks.
248
252
  *
249
253
  * @param {DrugSafetyClient.RequestOptions} requestOptions - Request-specific configuration.
250
254
  *
@@ -11,9 +11,10 @@ import type * as SafeRx from "../../../../index.js";
11
11
  * drugs: ["Augmentin 1g", "Glucophage 500mg", "Marivan"],
12
12
  * patient_profile: {
13
13
  * populations: ["geriatric", "renal"],
14
- * conditions: ["diabetes", "hypertension"]
14
+ * conditions: ["diabetes", "hypertension"],
15
+ * allergies: ["penicillin"]
15
16
  * },
16
- * include: ["ae", "ddi", "pllr", "clinical"],
17
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
17
18
  * lang: "en"
18
19
  * }
19
20
  *
@@ -43,7 +44,7 @@ import type * as SafeRx from "../../../../index.js";
43
44
  * status: "historical"
44
45
  * }]
45
46
  * },
46
- * include: ["ae", "ddi", "pllr", "clinical", "dose"],
47
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
47
48
  * lang: "en"
48
49
  * }
49
50
  *
@@ -72,8 +73,10 @@ export interface DrugSafetyCheckRequest {
72
73
  patient_profile?: SafeRx.PatientProfile;
73
74
  intelligence_context?: SafeRx.IntelligenceContext;
74
75
  /**
75
- * Safety domains to check. Omit to run all six domains.
76
- * Including fewer domains reduces response size and may improve latency.
76
+ * Safety domains to check. Omit or pass `null` to run all seven domains.
77
+ * When provided, `include` must be a non-empty array of valid lowercase
78
+ * domain codes. Unknown domain codes return `400 INVALID_INCLUDE_DOMAIN`.
79
+ * Duplicate valid domains are accepted and de-duplicated.
77
80
  */
78
81
  include?: SafeRx.DomainCode[];
79
82
  /**
@@ -1,7 +1,8 @@
1
1
  export interface GetDrugSafetyHealthResponse {
2
2
  status?: GetDrugSafetyHealthResponse.Status | undefined;
3
3
  subsystem?: string | undefined;
4
- checks?: Record<string, GetDrugSafetyHealthResponse.Checks.Value> | undefined;
4
+ /** Always empty on the public health endpoint. */
5
+ checks?: Record<string, unknown> | undefined;
5
6
  latency_ms?: number | undefined;
6
7
  }
7
8
  export declare namespace GetDrugSafetyHealthResponse {
@@ -10,17 +11,4 @@ export declare namespace GetDrugSafetyHealthResponse {
10
11
  readonly Degraded: "degraded";
11
12
  };
12
13
  type Status = (typeof Status)[keyof typeof Status];
13
- namespace Checks {
14
- interface Value {
15
- status?: Value.Status | undefined;
16
- }
17
- namespace Value {
18
- const Status: {
19
- readonly Healthy: "healthy";
20
- readonly Degraded: "degraded";
21
- readonly Unhealthy: "unhealthy";
22
- };
23
- type Status = (typeof Status)[keyof typeof Status];
24
- }
25
- }
26
14
  }
@@ -8,15 +8,4 @@ var GetDrugSafetyHealthResponse;
8
8
  Healthy: "healthy",
9
9
  Degraded: "degraded",
10
10
  };
11
- let Checks;
12
- (function (Checks) {
13
- let Value;
14
- (function (Value) {
15
- Value.Status = {
16
- Healthy: "healthy",
17
- Degraded: "degraded",
18
- Unhealthy: "unhealthy",
19
- };
20
- })(Value = Checks.Value || (Checks.Value = {}));
21
- })(Checks = GetDrugSafetyHealthResponse.Checks || (GetDrugSafetyHealthResponse.Checks = {}));
22
11
  })(GetDrugSafetyHealthResponse || (exports.GetDrugSafetyHealthResponse = GetDrugSafetyHealthResponse = {}));
@@ -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 4) or contraindicated (severity 5) interaction
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 4) or contraindicated (severity 5) interaction
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
  }
@@ -20,11 +20,13 @@ var Alert;
20
20
  /**
21
21
  * Alert source domain and trigger.
22
22
  * - `ae_bbw` — Drug has a Black Box Warning
23
- * - `ddi` — Major (severity 4) or contraindicated (severity 5) interaction
23
+ * - `ddi` — Major (severity 3) or contraindicated (severity 4) interaction
24
24
  * - `pllr_pregnancy` — Pregnancy risk >= 6 (Contraindicated or Absolutely Contraindicated)
25
25
  * - `pllr_lactation` — Lactation risk >= 6
26
26
  * - `clinical_condition` — Clinical condition severity >= 4
27
27
  * - `clinical_population` — Clinical population severity >= 4
28
+ * - `allergy_direct` — Product directly matches a supplied patient allergy
29
+ * - `allergy_cross_reactivity` — Product cross-reacts with a supplied patient allergy
28
30
  */
29
31
  Alert.Type = {
30
32
  AeBbw: "ae_bbw",
@@ -33,5 +35,7 @@ var Alert;
33
35
  PllrLactation: "pllr_lactation",
34
36
  ClinicalCondition: "clinical_condition",
35
37
  ClinicalPopulation: "clinical_population",
38
+ AllergyDirect: "allergy_direct",
39
+ AllergyCrossReactivity: "allergy_cross_reactivity",
36
40
  };
37
41
  })(Alert || (exports.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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import type * as SafeRx from "../index.js";
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,11 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AllergyData = void 0;
5
+ var AllergyData;
6
+ (function (AllergyData) {
7
+ AllergyData.Mode = {
8
+ ReferenceOnly: "reference_only",
9
+ PatientProfile: "patient_profile",
10
+ };
11
+ })(AllergyData || (exports.AllergyData = AllergyData = {}));
@@ -0,0 +1,10 @@
1
+ import type * as SafeRx from "../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type * as SafeRx from "../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,11 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AllergyWarning = void 0;
5
+ var AllergyWarning;
6
+ (function (AllergyWarning) {
7
+ AllergyWarning.WarningType = {
8
+ Direct: "direct",
9
+ CrossReactivity: "cross_reactivity",
10
+ };
11
+ })(AllergyWarning || (exports.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
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +1,17 @@
1
1
  import type * as SafeRx from "../index.js";
2
2
  /**
3
3
  * Clinical safety considerations combining per-drug population/condition
4
- * data with cross-drug clinical alerts. Enhanced when `patient_profile`
5
- * is provided in the request.
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
- /** Cross-drug condition-related alerts (requires `patient_profile.conditions`) */
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
- /** Cross-drug population-related alerts (requires `patient_profile.populations`) */
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
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OpenFDA Maximum Daily Dose data
2
+ * Regulatory maximum daily dose data
3
3
  */
4
4
  export interface DailyLimit {
5
5
  /** Maximum daily dose in milligrams */
@@ -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 (enhanced with `patient_profile`)
8
- * - `dose` — Maximum daily dose (V3: dual-source, 19K+ products, tier-based safety)
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];
@@ -8,8 +8,9 @@ exports.DomainCode = void 0;
8
8
  * - `ddi` — Drug-drug interactions (requires 2+ drugs)
9
9
  * - `pllr` — Pregnancy & lactation risk ratings
10
10
  * - `food` — Meal timing & food-drug conflicts
11
- * - `clinical` — Population & condition safety (enhanced with `patient_profile`)
12
- * - `dose` — Maximum daily dose (V3: dual-source, 19K+ products, tier-based safety)
11
+ * - `clinical` — Population & condition safety. Without patient context, returns product-wide clinical signals; with `patient_profile`, alerts are narrowed to supplied populations and conditions.
12
+ * - `dose` — Dose limits and daily-dose references from the unified dosing data path
13
+ * - `allergy` — Patient allergy matching plus direct and cross-reactivity warnings
13
14
  */
14
15
  exports.DomainCode = {
15
16
  Ae: "ae",
@@ -18,4 +19,5 @@ exports.DomainCode = {
18
19
  Food: "food",
19
20
  Clinical: "clinical",
20
21
  Dose: "dose",
22
+ Allergy: "allergy",
21
23
  };
@@ -1,14 +1,14 @@
1
1
  import type * as SafeRx from "../index.js";
2
2
  /**
3
- * Maximum daily dose data from Dose V3 — dual-source system combining
4
- * WHO Defined Daily Dose (DDD) and OpenFDA Maximum Daily Dose (MDD).
5
- * Covers 19,341 products (67.7% of database) with tier-based safety calculations.
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` — Full reference data (WHO DDD + OpenFDA MDD available)
11
- * - `2` — Regulatory label data only
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
- /** OpenFDA maximum daily dose data */
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` — WHO DDD only
35
- * - `regulatory_label` — OpenFDA MDD only
36
- * - `dual_source` — Both WHO DDD and OpenFDA MDD available
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` — WHO DDD only
44
- * - `regulatory_label` — OpenFDA MDD only
45
- * - `dual_source` — Both WHO DDD and OpenFDA MDD available
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";
@@ -6,9 +6,9 @@ var DosingData;
6
6
  (function (DosingData) {
7
7
  /**
8
8
  * Data source for this dose calculation.
9
- * - `reference_standard` — WHO DDD only
10
- * - `regulatory_label` — OpenFDA MDD only
11
- * - `dual_source` — Both WHO DDD and OpenFDA MDD available
9
+ * - `reference_standard` — reference dose data only
10
+ * - `regulatory_label` — regulatory daily-limit data only
11
+ * - `dual_source` — reference and regulatory daily-limit data available
12
12
  */
13
13
  DosingData.Source = {
14
14
  ReferenceStandard: "reference_standard",