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.
Files changed (165) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +12 -0
  3. package/dist/cjs/Client.js +67 -0
  4. package/dist/cjs/api/resources/developers/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/developers/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/developers/exports.d.ts +2 -0
  7. package/dist/cjs/api/resources/developers/exports.js +21 -0
  8. package/dist/cjs/api/resources/drugSafety/client/Client.d.ts +39 -5
  9. package/dist/cjs/api/resources/drugSafety/client/Client.js +39 -5
  10. package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.ts +38 -4
  11. package/dist/cjs/api/resources/drugSafety/exports.d.ts +2 -0
  12. package/dist/cjs/api/resources/drugSafety/exports.js +21 -0
  13. package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.ts +2 -14
  14. package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.js +0 -11
  15. package/dist/cjs/api/types/Alert.d.ts +8 -2
  16. package/dist/cjs/api/types/Alert.js +5 -1
  17. package/dist/cjs/api/types/AllergyCrossReactivityReference.d.ts +16 -0
  18. package/dist/cjs/api/types/AllergyCrossReactivityReference.js +3 -0
  19. package/dist/cjs/api/types/AllergyData.d.ts +24 -0
  20. package/dist/cjs/api/types/AllergyData.js +11 -0
  21. package/dist/cjs/api/types/AllergyFamilyReference.d.ts +10 -0
  22. package/dist/cjs/api/types/AllergyFamilyReference.js +3 -0
  23. package/dist/cjs/api/types/AllergyInputEntry.d.ts +10 -0
  24. package/dist/cjs/api/types/AllergyInputEntry.js +3 -0
  25. package/dist/cjs/api/types/AllergyProductFamilyReference.d.ts +9 -0
  26. package/dist/cjs/api/types/AllergyProductFamilyReference.js +3 -0
  27. package/dist/cjs/api/types/AllergySummary.d.ts +14 -0
  28. package/dist/cjs/api/types/AllergySummary.js +3 -0
  29. package/dist/cjs/api/types/AllergyWarning.d.ts +30 -0
  30. package/dist/cjs/api/types/AllergyWarning.js +11 -0
  31. package/dist/cjs/api/types/ClinicalAlert.d.ts +8 -0
  32. package/dist/cjs/api/types/ClinicalContextApplied.d.ts +10 -0
  33. package/dist/cjs/api/types/ClinicalContextApplied.js +3 -0
  34. package/dist/cjs/api/types/ClinicalData.d.ts +7 -4
  35. package/dist/cjs/api/types/DailyLimit.d.ts +1 -1
  36. package/dist/cjs/api/types/DomainCode.d.ts +4 -2
  37. package/dist/cjs/api/types/DomainCode.js +4 -2
  38. package/dist/cjs/api/types/DosingData.d.ts +22 -12
  39. package/dist/cjs/api/types/DosingData.js +3 -3
  40. package/dist/cjs/api/types/DrugSafetyCheckResponse.d.ts +1 -0
  41. package/dist/cjs/api/types/ErrorResponse.d.ts +5 -0
  42. package/dist/cjs/api/types/IdentityMatch.d.ts +13 -0
  43. package/dist/cjs/api/types/IdentityMatch.js +3 -0
  44. package/dist/cjs/api/types/IntelligenceClinicalProfile.d.ts +24 -0
  45. package/dist/cjs/api/types/IntelligenceClinicalProfile.js +13 -0
  46. package/dist/cjs/api/types/IntelligenceContext.d.ts +17 -0
  47. package/dist/cjs/api/types/IntelligenceContext.js +3 -0
  48. package/dist/cjs/api/types/IntelligenceProcessorError.d.ts +4 -0
  49. package/dist/cjs/api/types/IntelligenceProcessorError.js +3 -0
  50. package/dist/cjs/api/types/IntelligenceResult.d.ts +16 -0
  51. package/dist/cjs/api/types/IntelligenceResult.js +3 -0
  52. package/dist/cjs/api/types/IntelligenceSynthesis.d.ts +6 -0
  53. package/dist/cjs/api/types/IntelligenceSynthesis.js +3 -0
  54. package/dist/cjs/api/types/Interaction.d.ts +0 -2
  55. package/dist/cjs/api/types/InteractionSummary.d.ts +4 -4
  56. package/dist/cjs/api/types/MedicationHistoryItem.d.ts +22 -0
  57. package/dist/cjs/api/types/MedicationHistoryItem.js +15 -0
  58. package/dist/cjs/api/types/Meta.d.ts +2 -0
  59. package/dist/cjs/api/types/Meta.js +1 -0
  60. package/dist/cjs/api/types/MetadataResponse.d.ts +14 -6
  61. package/dist/cjs/api/types/MetadataResponse.js +1 -0
  62. package/dist/cjs/api/types/PatientProfile.d.ts +31 -0
  63. package/dist/cjs/api/types/PatientProfile.js +17 -0
  64. package/dist/cjs/api/types/QuotaMeta.d.ts +11 -0
  65. package/dist/cjs/api/types/QuotaMeta.js +3 -0
  66. package/dist/cjs/api/types/RateLimitResponse.d.ts +11 -0
  67. package/dist/cjs/api/types/RateLimitResponse.js +1 -0
  68. package/dist/cjs/api/types/ResolvedDrug.d.ts +26 -0
  69. package/dist/cjs/api/types/SafetyData.d.ts +1 -0
  70. package/dist/cjs/api/types/index.d.ts +16 -0
  71. package/dist/cjs/api/types/index.js +16 -0
  72. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
  73. package/dist/cjs/core/fetcher/Fetcher.js +1 -1
  74. package/dist/cjs/core/fetcher/index.d.ts +2 -0
  75. package/dist/cjs/core/fetcher/index.js +3 -1
  76. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
  77. package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
  78. package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
  79. package/dist/cjs/core/fetcher/makeRequest.js +30 -9
  80. package/dist/cjs/core/runtime/runtime.js +8 -7
  81. package/dist/cjs/version.d.ts +1 -1
  82. package/dist/cjs/version.js +1 -1
  83. package/dist/esm/BaseClient.mjs +2 -2
  84. package/dist/esm/Client.d.mts +12 -0
  85. package/dist/esm/Client.mjs +34 -0
  86. package/dist/esm/api/resources/developers/client/Client.d.mts +1 -1
  87. package/dist/esm/api/resources/developers/client/Client.mjs +1 -1
  88. package/dist/esm/api/resources/developers/exports.d.mts +2 -0
  89. package/dist/esm/api/resources/developers/exports.mjs +3 -0
  90. package/dist/esm/api/resources/drugSafety/client/Client.d.mts +39 -5
  91. package/dist/esm/api/resources/drugSafety/client/Client.mjs +39 -5
  92. package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.mts +38 -4
  93. package/dist/esm/api/resources/drugSafety/exports.d.mts +2 -0
  94. package/dist/esm/api/resources/drugSafety/exports.mjs +3 -0
  95. package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.mts +2 -14
  96. package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.mjs +0 -11
  97. package/dist/esm/api/types/Alert.d.mts +8 -2
  98. package/dist/esm/api/types/Alert.mjs +5 -1
  99. package/dist/esm/api/types/AllergyCrossReactivityReference.d.mts +16 -0
  100. package/dist/esm/api/types/AllergyCrossReactivityReference.mjs +2 -0
  101. package/dist/esm/api/types/AllergyData.d.mts +24 -0
  102. package/dist/esm/api/types/AllergyData.mjs +8 -0
  103. package/dist/esm/api/types/AllergyFamilyReference.d.mts +10 -0
  104. package/dist/esm/api/types/AllergyFamilyReference.mjs +2 -0
  105. package/dist/esm/api/types/AllergyInputEntry.d.mts +10 -0
  106. package/dist/esm/api/types/AllergyInputEntry.mjs +2 -0
  107. package/dist/esm/api/types/AllergyProductFamilyReference.d.mts +9 -0
  108. package/dist/esm/api/types/AllergyProductFamilyReference.mjs +2 -0
  109. package/dist/esm/api/types/AllergySummary.d.mts +14 -0
  110. package/dist/esm/api/types/AllergySummary.mjs +2 -0
  111. package/dist/esm/api/types/AllergyWarning.d.mts +30 -0
  112. package/dist/esm/api/types/AllergyWarning.mjs +8 -0
  113. package/dist/esm/api/types/ClinicalAlert.d.mts +8 -0
  114. package/dist/esm/api/types/ClinicalContextApplied.d.mts +10 -0
  115. package/dist/esm/api/types/ClinicalContextApplied.mjs +2 -0
  116. package/dist/esm/api/types/ClinicalData.d.mts +7 -4
  117. package/dist/esm/api/types/DailyLimit.d.mts +1 -1
  118. package/dist/esm/api/types/DomainCode.d.mts +4 -2
  119. package/dist/esm/api/types/DomainCode.mjs +4 -2
  120. package/dist/esm/api/types/DosingData.d.mts +22 -12
  121. package/dist/esm/api/types/DosingData.mjs +3 -3
  122. package/dist/esm/api/types/DrugSafetyCheckResponse.d.mts +1 -0
  123. package/dist/esm/api/types/ErrorResponse.d.mts +5 -0
  124. package/dist/esm/api/types/IdentityMatch.d.mts +13 -0
  125. package/dist/esm/api/types/IdentityMatch.mjs +2 -0
  126. package/dist/esm/api/types/IntelligenceClinicalProfile.d.mts +24 -0
  127. package/dist/esm/api/types/IntelligenceClinicalProfile.mjs +10 -0
  128. package/dist/esm/api/types/IntelligenceContext.d.mts +17 -0
  129. package/dist/esm/api/types/IntelligenceContext.mjs +2 -0
  130. package/dist/esm/api/types/IntelligenceProcessorError.d.mts +4 -0
  131. package/dist/esm/api/types/IntelligenceProcessorError.mjs +2 -0
  132. package/dist/esm/api/types/IntelligenceResult.d.mts +16 -0
  133. package/dist/esm/api/types/IntelligenceResult.mjs +2 -0
  134. package/dist/esm/api/types/IntelligenceSynthesis.d.mts +6 -0
  135. package/dist/esm/api/types/IntelligenceSynthesis.mjs +2 -0
  136. package/dist/esm/api/types/Interaction.d.mts +0 -2
  137. package/dist/esm/api/types/InteractionSummary.d.mts +4 -4
  138. package/dist/esm/api/types/MedicationHistoryItem.d.mts +22 -0
  139. package/dist/esm/api/types/MedicationHistoryItem.mjs +12 -0
  140. package/dist/esm/api/types/Meta.d.mts +2 -0
  141. package/dist/esm/api/types/Meta.mjs +1 -0
  142. package/dist/esm/api/types/MetadataResponse.d.mts +14 -6
  143. package/dist/esm/api/types/MetadataResponse.mjs +1 -0
  144. package/dist/esm/api/types/PatientProfile.d.mts +31 -0
  145. package/dist/esm/api/types/PatientProfile.mjs +16 -1
  146. package/dist/esm/api/types/QuotaMeta.d.mts +11 -0
  147. package/dist/esm/api/types/QuotaMeta.mjs +2 -0
  148. package/dist/esm/api/types/RateLimitResponse.d.mts +11 -0
  149. package/dist/esm/api/types/RateLimitResponse.mjs +1 -0
  150. package/dist/esm/api/types/ResolvedDrug.d.mts +26 -0
  151. package/dist/esm/api/types/SafetyData.d.mts +1 -0
  152. package/dist/esm/api/types/index.d.mts +16 -0
  153. package/dist/esm/api/types/index.mjs +16 -0
  154. package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
  155. package/dist/esm/core/fetcher/Fetcher.mjs +1 -1
  156. package/dist/esm/core/fetcher/index.d.mts +2 -0
  157. package/dist/esm/core/fetcher/index.mjs +1 -0
  158. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
  159. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
  160. package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
  161. package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
  162. package/dist/esm/core/runtime/runtime.mjs +8 -7
  163. package/dist/esm/version.d.mts +1 -1
  164. package/dist/esm/version.mjs +1 -1
  165. package/package.json +31 -9
@@ -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,40 @@ 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"]
49
+ * },
50
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
51
+ * lang: "en"
52
+ * })
53
+ *
54
+ * @example
55
+ * await client.drugSafety.check({
56
+ * drugs: ["Augmentin 1g", "Marivan"],
57
+ * intelligence_context: {
58
+ * user_id: "patient-123",
59
+ * clinical_profile: {
60
+ * age: 72,
61
+ * crcl: 38,
62
+ * hepatic_status: "normal",
63
+ * pregnancy: false,
64
+ * lactation: false,
65
+ * conditions: ["renal impairment", "hypertension"],
66
+ * populations: ["geriatric", "renal"],
67
+ * allergies: ["penicillin"],
68
+ * diet_habits: ["low_sodium"]
69
+ * },
70
+ * medication_history: [{
71
+ * sfrx_id: "SRX-010-004748",
72
+ * start_date: "2026-01-10",
73
+ * status: "active"
74
+ * }, {
75
+ * sfrx_id: "SRX-050-000123",
76
+ * start_date: "2025-09-01",
77
+ * status: "historical"
78
+ * }]
46
79
  * },
47
- * include: ["ae", "ddi", "pllr", "clinical"],
80
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
48
81
  * lang: "en"
49
82
  * })
50
83
  *
@@ -83,10 +116,11 @@ export declare class DrugSafetyClient {
83
116
  getMetadata(requestOptions?: DrugSafetyClient.RequestOptions): core.HttpResponsePromise<SafeRx.MetadataResponse>;
84
117
  private __getMetadata;
85
118
  /**
86
- * Returns health status of the Drug Safety API subsystem including
87
- * overall system health and availability.
119
+ * Returns minimal health status of the Drug Safety API subsystem.
88
120
  *
89
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.
90
124
  *
91
125
  * @param {DrugSafetyClient.RequestOptions} requestOptions - Request-specific configuration.
92
126
  *
@@ -23,12 +23,14 @@ export class DrugSafetyClient {
23
23
  this._options = normalizeClientOptionsWithAuth(options);
24
24
  }
25
25
  /**
26
- * Screen one or more drugs across six safety domains in a single request.
26
+ * Screen one or more drugs across seven safety domains in a single request.
27
27
  *
28
28
  * The API resolves drug names via fuzzy matching, runs all requested safety
29
29
  * checks in parallel, and returns a unified response with alerts bubbled to
30
30
  * the top for easy triage.
31
31
  *
32
+ * This endpoint is API-key only. It does not require `X-SafeRx-Token`.
33
+ *
32
34
  * **Typical response time:** ~40ms (warm cache, 3 drugs, all domains).
33
35
  *
34
36
  * @param {SafeRx.DrugSafetyCheckRequest} request
@@ -51,9 +53,40 @@ export class DrugSafetyClient {
51
53
  * drugs: ["Augmentin 1g", "Glucophage 500mg", "Marivan"],
52
54
  * patient_profile: {
53
55
  * populations: ["geriatric", "renal"],
54
- * conditions: ["diabetes", "hypertension"]
56
+ * conditions: ["diabetes", "hypertension"],
57
+ * allergies: ["penicillin"]
58
+ * },
59
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
60
+ * lang: "en"
61
+ * })
62
+ *
63
+ * @example
64
+ * await client.drugSafety.check({
65
+ * drugs: ["Augmentin 1g", "Marivan"],
66
+ * intelligence_context: {
67
+ * user_id: "patient-123",
68
+ * clinical_profile: {
69
+ * age: 72,
70
+ * crcl: 38,
71
+ * hepatic_status: "normal",
72
+ * pregnancy: false,
73
+ * lactation: false,
74
+ * conditions: ["renal impairment", "hypertension"],
75
+ * populations: ["geriatric", "renal"],
76
+ * allergies: ["penicillin"],
77
+ * diet_habits: ["low_sodium"]
78
+ * },
79
+ * medication_history: [{
80
+ * sfrx_id: "SRX-010-004748",
81
+ * start_date: "2026-01-10",
82
+ * status: "active"
83
+ * }, {
84
+ * sfrx_id: "SRX-050-000123",
85
+ * start_date: "2025-09-01",
86
+ * status: "historical"
87
+ * }]
55
88
  * },
56
- * include: ["ae", "ddi", "pllr", "clinical"],
89
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
57
90
  * lang: "en"
58
91
  * })
59
92
  *
@@ -175,10 +208,11 @@ export class DrugSafetyClient {
175
208
  });
176
209
  }
177
210
  /**
178
- * Returns health status of the Drug Safety API subsystem including
179
- * overall system health and availability.
211
+ * Returns minimal health status of the Drug Safety API subsystem.
180
212
  *
181
213
  * No authentication required. Designed for monitoring services.
214
+ * The public enterprise health endpoint intentionally does not expose
215
+ * database counts, module internals, or detailed dependency checks.
182
216
  *
183
217
  * @param {DrugSafetyClient.RequestOptions} requestOptions - Request-specific configuration.
184
218
  *
@@ -11,9 +11,40 @@ import type * as SafeRx from "../../../../index.mjs";
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"],
18
+ * lang: "en"
19
+ * }
20
+ *
21
+ * @example
22
+ * {
23
+ * drugs: ["Augmentin 1g", "Marivan"],
24
+ * intelligence_context: {
25
+ * user_id: "patient-123",
26
+ * clinical_profile: {
27
+ * age: 72,
28
+ * crcl: 38,
29
+ * hepatic_status: "normal",
30
+ * pregnancy: false,
31
+ * lactation: false,
32
+ * conditions: ["renal impairment", "hypertension"],
33
+ * populations: ["geriatric", "renal"],
34
+ * allergies: ["penicillin"],
35
+ * diet_habits: ["low_sodium"]
36
+ * },
37
+ * medication_history: [{
38
+ * sfrx_id: "SRX-010-004748",
39
+ * start_date: "2026-01-10",
40
+ * status: "active"
41
+ * }, {
42
+ * sfrx_id: "SRX-050-000123",
43
+ * start_date: "2025-09-01",
44
+ * status: "historical"
45
+ * }]
46
+ * },
47
+ * include: ["ae", "ddi", "pllr", "food", "clinical", "dose", "allergy"],
17
48
  * lang: "en"
18
49
  * }
19
50
  *
@@ -40,9 +71,12 @@ export interface DrugSafetyCheckRequest {
40
71
  */
41
72
  drugs: string[];
42
73
  patient_profile?: SafeRx.PatientProfile;
74
+ intelligence_context?: SafeRx.IntelligenceContext;
43
75
  /**
44
- * Safety domains to check. Omit to run all six domains.
45
- * 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.
46
80
  */
47
81
  include?: SafeRx.DomainCode[];
48
82
  /**
@@ -0,0 +1,2 @@
1
+ export { DrugSafetyClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { DrugSafetyClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -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
  }
@@ -5,15 +5,4 @@ export var GetDrugSafetyHealthResponse;
5
5
  Healthy: "healthy",
6
6
  Degraded: "degraded",
7
7
  };
8
- let Checks;
9
- (function (Checks) {
10
- let Value;
11
- (function (Value) {
12
- Value.Status = {
13
- Healthy: "healthy",
14
- Degraded: "degraded",
15
- Unhealthy: "unhealthy",
16
- };
17
- })(Value = Checks.Value || (Checks.Value = {}));
18
- })(Checks = GetDrugSafetyHealthResponse.Checks || (GetDrugSafetyHealthResponse.Checks = {}));
19
8
  })(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
  }
@@ -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 4) or contraindicated (severity 5) interaction
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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var AllergyData;
3
+ (function (AllergyData) {
4
+ AllergyData.Mode = {
5
+ ReferenceOnly: "reference_only",
6
+ PatientProfile: "patient_profile",
7
+ };
8
+ })(AllergyData || (AllergyData = {}));
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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. 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];
@@ -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 (enhanced with `patient_profile`)
9
- * - `dose` — Maximum daily dose (V3: dual-source, 19K+ products, tier-based safety)
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
  };