@healthcloudai/hc-sdk 3.4.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +42 -2
- package/dist/index.d.cts +1394 -236
- package/dist/index.d.ts +1394 -236
- package/dist/index.js +40 -2
- package/docs/configuration.md +1 -0
- package/docs/docs-manifest.json +6 -3
- package/docs/models/AddInsuranceRequest.md +2 -0
- package/docs/models/AddInsuranceResponse.md +2 -0
- package/docs/models/CheckEncounterResponse.md +36 -0
- package/docs/models/CheckInEncounterResponse.md +51 -0
- package/docs/models/CreateRapidTestRequest.md +3 -0
- package/docs/models/{RapidTest.md → CreateRapidTestResponse.md} +8 -4
- package/docs/models/GetAppointmentTelehealthLinkResponse.md +17 -0
- package/docs/models/GetPreferredPharmacyResponse.md +2 -2
- package/docs/models/GetScanUploadUrlRequest.md +1 -0
- package/docs/models/SearchDocumentSummariesCypherRequest.md +4 -6
- package/docs/models/SearchDocumentSummariesRequest.md +7 -7
- package/docs/models/SearchHealthPlansCypherRequest.md +4 -6
- package/docs/models/SearchHealthPlansRequest.md +8 -8
- package/docs/models/SearchMedicalConceptsCypherRequest.md +6 -6
- package/docs/models/SearchMedicalConceptsRequest.md +14 -19
- package/docs/models/SearchProvidersCypherRequest.md +4 -6
- package/docs/models/SearchProvidersRequest.md +8 -8
- package/docs/models/VectorSearchDocumentsRequest.md +11 -11
- package/docs/models/index.md +13 -10
- package/docs/operations/appointments.getTelehealthLink.md +4 -2
- package/docs/operations/diagnostics.createRapidTest.md +49 -37
- package/docs/operations/diagnostics.getScanUploadUrl.md +3 -1
- package/docs/operations/diagnostics.lookupTestByGs1.md +7 -1
- package/docs/operations/graph.searchDocumentSummaries.md +9 -0
- package/docs/operations/graph.searchHealthPlans.md +9 -0
- package/docs/operations/graph.searchMedicalConcepts.md +26 -17
- package/docs/operations/graph.searchProviders.md +9 -0
- package/docs/operations/graph.vectorSearchDocuments.md +3 -3
- package/docs/operations/patient.addInsurance.md +15 -9
- package/docs/operations/patient.checkEncounter.md +93 -7
- package/docs/operations/patient.checkInEncounter.md +68 -2
- package/docs/operations/patient.getPreferredPharmacy.md +13 -1
- package/package.json +5 -4
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ __export(index_exports, {
|
|
|
31
31
|
ConnectorFactory: () => ConnectorFactory,
|
|
32
32
|
ConnectorsNamespace: () => ConnectorsNamespace,
|
|
33
33
|
ConnectureClient: () => ConnectureClient,
|
|
34
|
+
DEFAULT_TIMEOUT_MS: () => DEFAULT_TIMEOUT_MS,
|
|
34
35
|
ElevenLabsClient: () => ElevenLabsClient,
|
|
35
36
|
FedExClient: () => FedExClient,
|
|
36
37
|
GoogleAIClient: () => GoogleAIClient,
|
|
@@ -64,6 +65,7 @@ __export(index_exports, {
|
|
|
64
65
|
ZocdocClient: () => ZocdocClient,
|
|
65
66
|
ZusClient: () => ZusClient,
|
|
66
67
|
assertEnvironment: () => assertEnvironment,
|
|
68
|
+
assertTimeout: () => assertTimeout,
|
|
67
69
|
isJsonRpcError: () => isJsonRpcError,
|
|
68
70
|
isServiceName: () => isServiceName,
|
|
69
71
|
resolveBaseUrl: () => resolveBaseUrl,
|
|
@@ -72,6 +74,7 @@ __export(index_exports, {
|
|
|
72
74
|
module.exports = __toCommonJS(index_exports);
|
|
73
75
|
|
|
74
76
|
// src/config/SDKConfig.ts
|
|
77
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
75
78
|
var SERVICES = [
|
|
76
79
|
"patient",
|
|
77
80
|
"vitals",
|
|
@@ -100,6 +103,11 @@ function resolveBaseUrl(environment, service) {
|
|
|
100
103
|
const prefix = environment === "prod" ? "" : `${environment}-`;
|
|
101
104
|
return `https://${prefix}api-${service}.health.cloud`;
|
|
102
105
|
}
|
|
106
|
+
function assertTimeout(timeout, label = "timeout") {
|
|
107
|
+
if (typeof timeout !== "number" || !Number.isFinite(timeout) || timeout <= 0) {
|
|
108
|
+
throw new Error(`Invalid HealthCloud SDK ${label}: expected a positive number of milliseconds, got ${String(timeout)}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
103
111
|
function assertEnvironment(environment) {
|
|
104
112
|
if (environment !== "dev" && environment !== "uat" && environment !== "prod") {
|
|
105
113
|
throw new Error(`Unsupported HealthCloud environment: "${environment}"`);
|
|
@@ -132,23 +140,46 @@ var HttpClient = class {
|
|
|
132
140
|
this.state = state;
|
|
133
141
|
}
|
|
134
142
|
async request(service, method, path, options = {}) {
|
|
143
|
+
var _a, _b;
|
|
135
144
|
const url = this.buildUrl(service, path, options);
|
|
136
145
|
const headers = this.buildHeaders(options);
|
|
137
146
|
const init = { method, headers };
|
|
138
147
|
if (method !== "GET" && method !== "DELETE" && options.body !== void 0) {
|
|
139
148
|
init.body = this.serializeBody(options.body, headers);
|
|
140
149
|
}
|
|
150
|
+
const timeoutMs = (_b = (_a = options.timeoutMs) != null ? _a : this.state.timeout) != null ? _b : DEFAULT_TIMEOUT_MS;
|
|
151
|
+
assertTimeout(timeoutMs, options.timeoutMs !== void 0 ? "timeoutMs" : "timeout");
|
|
152
|
+
let didTimeout = false;
|
|
153
|
+
const controller = new AbortController();
|
|
154
|
+
init.signal = controller.signal;
|
|
155
|
+
const timer = setTimeout(() => {
|
|
156
|
+
didTimeout = true;
|
|
157
|
+
controller.abort();
|
|
158
|
+
}, timeoutMs);
|
|
141
159
|
let response;
|
|
160
|
+
let payload;
|
|
142
161
|
try {
|
|
143
162
|
response = await fetch(url, init);
|
|
163
|
+
payload = await this.parseResponse(response);
|
|
144
164
|
} catch (error) {
|
|
165
|
+
if (didTimeout) {
|
|
166
|
+
throw new SDKError({
|
|
167
|
+
message: `Request timed out after ${timeoutMs}ms: ${method} ${path}`,
|
|
168
|
+
statusCode: 0,
|
|
169
|
+
cause: error
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (error instanceof SDKError) {
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
145
175
|
throw new SDKError({
|
|
146
176
|
message: error instanceof Error ? error.message : "Network request failed.",
|
|
147
177
|
statusCode: 0,
|
|
148
178
|
cause: error
|
|
149
179
|
});
|
|
180
|
+
} finally {
|
|
181
|
+
clearTimeout(timer);
|
|
150
182
|
}
|
|
151
|
-
const payload = await this.parseResponse(response);
|
|
152
183
|
if (!response.ok) {
|
|
153
184
|
throw new SDKError({
|
|
154
185
|
message: this.resolveErrorMessage(response, payload),
|
|
@@ -497,7 +528,9 @@ function CreateRapidTestRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
497
528
|
}
|
|
498
529
|
return {
|
|
499
530
|
"administered_date": value["administered_date"],
|
|
531
|
+
"athena_encounter_id": value["athena_encounter_id"],
|
|
500
532
|
"device_name": value["device_name"],
|
|
533
|
+
"encounter_id": value["encounter_id"],
|
|
501
534
|
"lot_number": value["lot_number"],
|
|
502
535
|
"notes": value["notes"],
|
|
503
536
|
"performed_date": value["performed_date"] == null ? value["performed_date"] : value["performed_date"].toISOString().substring(0, 10),
|
|
@@ -505,6 +538,7 @@ function CreateRapidTestRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
505
538
|
"quantitative_unit": value["quantitative_unit"],
|
|
506
539
|
"quantitative_value": value["quantitative_value"],
|
|
507
540
|
"result": RapidTestResultToJSON(value["result"]),
|
|
541
|
+
"scan_storage_key": value["scan_storage_key"],
|
|
508
542
|
"specimen_type": SpecimenTypeToJSON(value["specimen_type"]),
|
|
509
543
|
"type": RapidTestTypeToJSON(value["type"])
|
|
510
544
|
};
|
|
@@ -520,6 +554,7 @@ function GetScanUploadUrlRequestToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
520
554
|
}
|
|
521
555
|
return {
|
|
522
556
|
"content_type": value["content_type"],
|
|
557
|
+
"encounter_id": value["encounter_id"],
|
|
523
558
|
"filename": value["filename"],
|
|
524
559
|
"gtin": value["gtin"],
|
|
525
560
|
"test_id": value["test_id"]
|
|
@@ -6000,12 +6035,15 @@ var ConnectorsNamespace = class {
|
|
|
6000
6035
|
// src/HCSDK.ts
|
|
6001
6036
|
var HCSDK = class {
|
|
6002
6037
|
constructor(config) {
|
|
6038
|
+
var _a, _b;
|
|
6003
6039
|
assertEnvironment(config.environment);
|
|
6040
|
+
assertTimeout((_a = config.timeout) != null ? _a : DEFAULT_TIMEOUT_MS);
|
|
6004
6041
|
this.state = {
|
|
6005
6042
|
environment: config.environment,
|
|
6006
6043
|
tenantId: config.tenantId,
|
|
6007
6044
|
accessToken: config.accessToken,
|
|
6008
|
-
baseUrlOverrides: config.baseUrlOverrides
|
|
6045
|
+
baseUrlOverrides: config.baseUrlOverrides,
|
|
6046
|
+
timeout: (_b = config.timeout) != null ? _b : DEFAULT_TIMEOUT_MS
|
|
6009
6047
|
};
|
|
6010
6048
|
this.http = new HttpClient(this.state);
|
|
6011
6049
|
this.auth = new AuthClient(
|
|
@@ -6141,6 +6179,7 @@ var HCSDK_SWAGGER_OPERATION_COUNTS = {
|
|
|
6141
6179
|
ConnectorFactory,
|
|
6142
6180
|
ConnectorsNamespace,
|
|
6143
6181
|
ConnectureClient,
|
|
6182
|
+
DEFAULT_TIMEOUT_MS,
|
|
6144
6183
|
ElevenLabsClient,
|
|
6145
6184
|
FedExClient,
|
|
6146
6185
|
GoogleAIClient,
|
|
@@ -6174,6 +6213,7 @@ var HCSDK_SWAGGER_OPERATION_COUNTS = {
|
|
|
6174
6213
|
ZocdocClient,
|
|
6175
6214
|
ZusClient,
|
|
6176
6215
|
assertEnvironment,
|
|
6216
|
+
assertTimeout,
|
|
6177
6217
|
isJsonRpcError,
|
|
6178
6218
|
isServiceName,
|
|
6179
6219
|
resolveBaseUrl,
|