@healthcloudai/hc-sdk 3.14.0 → 3.16.0
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 +132 -72
- package/dist/index.d.cts +577 -261
- package/dist/index.d.ts +577 -261
- package/dist/index.js +132 -72
- package/docs/clients/AthenaHealthClient.md +1 -1
- package/docs/clients/PatientClient.md +5 -0
- package/docs/docs-manifest.json +16 -3
- package/docs/examples/index.md +6 -1
- package/docs/index.md +6 -1
- package/docs/models/ApplyPatientFlagsRequest.md +18 -0
- package/docs/models/AssignImpiloDeviceRequest.md +17 -0
- package/docs/models/AssignImpiloDeviceResponse.md +20 -0
- package/docs/models/AthenaLabResult.md +2 -0
- package/docs/models/FlagOperationError.md +18 -0
- package/docs/models/FlagOperationReceipt.md +20 -0
- package/docs/models/GetDefaultProviderResponse.md +2 -0
- package/docs/models/ImpiloDeviceItem.md +23 -0
- package/docs/models/ListImpiloDevicesResponse.md +18 -0
- package/docs/models/UnknownFlagOperation.md +18 -0
- package/docs/models/_InsuranceOcrResult.md +1 -0
- package/docs/models/index.md +8 -0
- package/docs/operations/connectors.athenaAddLabResultDocument.md +2 -2
- package/docs/operations/connectors.athenaGetLabResult.md +2 -0
- package/docs/operations/connectors.athenaListLabResults.md +2 -0
- package/docs/operations/patient.addInsurance.md +48 -16
- package/docs/operations/patient.applyPatientFlagsOperation.md +152 -0
- package/docs/operations/patient.assignImpiloDevice.md +112 -0
- package/docs/operations/patient.assistantOcrInsurance.md +64 -13
- package/docs/operations/patient.checkPatientInsuranceEligibility.md +133 -38
- package/docs/operations/patient.getDefaultProvider.md +2 -0
- package/docs/operations/patient.getPatientFlagsOperation.md +150 -0
- package/docs/operations/patient.importImpiloVitals.md +129 -0
- package/docs/operations/patient.listImpiloDevices.md +100 -0
- package/docs/operations/patient.submitPatientIntake.md +13 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1236,6 +1236,36 @@ function CreateEncounterRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1236
1236
|
};
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
|
+
// src/models/openapi-generated/patient/models/ApplyPatientFlagsRequest.ts
|
|
1240
|
+
function ApplyPatientFlagsRequestToJSON(json) {
|
|
1241
|
+
return ApplyPatientFlagsRequestToJSONTyped(json, false);
|
|
1242
|
+
}
|
|
1243
|
+
function ApplyPatientFlagsRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1244
|
+
if (value == null) {
|
|
1245
|
+
return value;
|
|
1246
|
+
}
|
|
1247
|
+
return {
|
|
1248
|
+
"flags": value["flags"],
|
|
1249
|
+
"idempotency_key": value["idempotency_key"]
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
// src/models/openapi-generated/patient/models/FlagOperationReceipt.ts
|
|
1254
|
+
function FlagOperationReceiptFromJSON(json) {
|
|
1255
|
+
return FlagOperationReceiptFromJSONTyped(json, false);
|
|
1256
|
+
}
|
|
1257
|
+
function FlagOperationReceiptFromJSONTyped(json, ignoreDiscriminator) {
|
|
1258
|
+
if (json == null) {
|
|
1259
|
+
return json;
|
|
1260
|
+
}
|
|
1261
|
+
return {
|
|
1262
|
+
"flags": json["flags"],
|
|
1263
|
+
"idempotency_key": json["idempotency_key"],
|
|
1264
|
+
"patient_id": json["patient_id"],
|
|
1265
|
+
"status": json["status"]
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1239
1269
|
// src/models/openapi-generated/patient/models/ProcedureStatus.ts
|
|
1240
1270
|
function ProcedureStatusToJSON(value) {
|
|
1241
1271
|
return value;
|
|
@@ -1369,104 +1399,81 @@ function GynHistoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1369
1399
|
};
|
|
1370
1400
|
}
|
|
1371
1401
|
|
|
1372
|
-
// src/models/openapi-generated/patient/models/
|
|
1373
|
-
function
|
|
1374
|
-
return
|
|
1402
|
+
// src/models/openapi-generated/patient/models/IntakeTobaccoUse.ts
|
|
1403
|
+
function IntakeTobaccoUseToJSON(json) {
|
|
1404
|
+
return IntakeTobaccoUseToJSONTyped(json, false);
|
|
1375
1405
|
}
|
|
1376
|
-
|
|
1377
|
-
// src/models/openapi-generated/patient/models/SubstanceUse.ts
|
|
1378
|
-
function SubstanceUseToJSON(json) {
|
|
1379
|
-
return SubstanceUseToJSONTyped(json, false);
|
|
1380
|
-
}
|
|
1381
|
-
function SubstanceUseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1406
|
+
function IntakeTobaccoUseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1382
1407
|
if (value == null) {
|
|
1383
1408
|
return value;
|
|
1384
1409
|
}
|
|
1385
1410
|
return {
|
|
1386
|
-
|
|
1387
|
-
"
|
|
1411
|
+
...value,
|
|
1412
|
+
"cessation_aids": value["cessation_aids"],
|
|
1413
|
+
"cigarettes_per_day": value["cigarettes_per_day"],
|
|
1414
|
+
"pack_years": value["pack_years"],
|
|
1388
1415
|
"quit_year": value["quit_year"],
|
|
1389
|
-
"route": value["route"],
|
|
1390
1416
|
"start_year": value["start_year"],
|
|
1391
|
-
"status":
|
|
1392
|
-
"substance": value["substance"]
|
|
1417
|
+
"status": value["status"]
|
|
1393
1418
|
};
|
|
1394
1419
|
}
|
|
1395
1420
|
|
|
1396
|
-
// src/models/openapi-generated/patient/models/
|
|
1397
|
-
function
|
|
1398
|
-
return
|
|
1421
|
+
// src/models/openapi-generated/patient/models/IntakeAlcoholUse.ts
|
|
1422
|
+
function IntakeAlcoholUseToJSON(json) {
|
|
1423
|
+
return IntakeAlcoholUseToJSONTyped(json, false);
|
|
1399
1424
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1425
|
+
function IntakeAlcoholUseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1426
|
+
if (value == null) {
|
|
1427
|
+
return value;
|
|
1428
|
+
}
|
|
1429
|
+
return {
|
|
1430
|
+
...value,
|
|
1431
|
+
"binge_drinking": value["binge_drinking"],
|
|
1432
|
+
"drinks_per_week": value["drinks_per_week"],
|
|
1433
|
+
"frequency": value["frequency"],
|
|
1434
|
+
"notes": value["notes"]
|
|
1435
|
+
};
|
|
1409
1436
|
}
|
|
1410
1437
|
|
|
1411
|
-
// src/models/openapi-generated/patient/models/
|
|
1412
|
-
function
|
|
1438
|
+
// src/models/openapi-generated/patient/models/GenderIdentity.ts
|
|
1439
|
+
function GenderIdentityToJSON(value) {
|
|
1413
1440
|
return value;
|
|
1414
1441
|
}
|
|
1415
1442
|
|
|
1416
|
-
// src/models/openapi-generated/patient/models/
|
|
1417
|
-
function
|
|
1418
|
-
return
|
|
1443
|
+
// src/models/openapi-generated/patient/models/IntakeSubstanceUse.ts
|
|
1444
|
+
function IntakeSubstanceUseToJSON(json) {
|
|
1445
|
+
return IntakeSubstanceUseToJSONTyped(json, false);
|
|
1419
1446
|
}
|
|
1420
|
-
function
|
|
1447
|
+
function IntakeSubstanceUseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1421
1448
|
if (value == null) {
|
|
1422
1449
|
return value;
|
|
1423
1450
|
}
|
|
1424
1451
|
return {
|
|
1425
|
-
|
|
1426
|
-
"
|
|
1427
|
-
"
|
|
1452
|
+
...value,
|
|
1453
|
+
"frequency": value["frequency"],
|
|
1454
|
+
"notes": value["notes"],
|
|
1428
1455
|
"quit_year": value["quit_year"],
|
|
1456
|
+
"route": value["route"],
|
|
1429
1457
|
"start_year": value["start_year"],
|
|
1430
|
-
"status":
|
|
1458
|
+
"status": value["status"],
|
|
1459
|
+
"substance": value["substance"]
|
|
1431
1460
|
};
|
|
1432
1461
|
}
|
|
1433
1462
|
|
|
1434
|
-
// src/models/openapi-generated/patient/models/
|
|
1435
|
-
function
|
|
1436
|
-
return
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
// src/models/openapi-generated/patient/models/AlcoholUse.ts
|
|
1440
|
-
function AlcoholUseToJSON(json) {
|
|
1441
|
-
return AlcoholUseToJSONTyped(json, false);
|
|
1463
|
+
// src/models/openapi-generated/patient/models/IntakeEhrAnswer.ts
|
|
1464
|
+
function IntakeEhrAnswerToJSON(json) {
|
|
1465
|
+
return IntakeEhrAnswerToJSONTyped(json, false);
|
|
1442
1466
|
}
|
|
1443
|
-
function
|
|
1467
|
+
function IntakeEhrAnswerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1444
1468
|
if (value == null) {
|
|
1445
1469
|
return value;
|
|
1446
1470
|
}
|
|
1447
1471
|
return {
|
|
1448
|
-
"
|
|
1449
|
-
"
|
|
1450
|
-
"frequency": AlcoholFrequencyToJSON(value["frequency"]),
|
|
1451
|
-
"notes": value["notes"]
|
|
1472
|
+
"question_key": value["question_key"],
|
|
1473
|
+
"value": value["value"]
|
|
1452
1474
|
};
|
|
1453
1475
|
}
|
|
1454
1476
|
|
|
1455
|
-
// src/models/openapi-generated/patient/models/GenderIdentity.ts
|
|
1456
|
-
function GenderIdentityToJSON(value) {
|
|
1457
|
-
return value;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
// src/models/openapi-generated/patient/models/EducationLevel.ts
|
|
1461
|
-
function EducationLevelToJSON(value) {
|
|
1462
|
-
return value;
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
// src/models/openapi-generated/patient/models/SexualOrientation.ts
|
|
1466
|
-
function SexualOrientationToJSON(value) {
|
|
1467
|
-
return value;
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
1477
|
// src/models/openapi-generated/patient/models/IntakeSocialHistory.ts
|
|
1471
1478
|
function IntakeSocialHistoryToJSON(json) {
|
|
1472
1479
|
return IntakeSocialHistoryToJSONTyped(json, false);
|
|
@@ -1477,24 +1484,25 @@ function IntakeSocialHistoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1477
1484
|
}
|
|
1478
1485
|
return {
|
|
1479
1486
|
...value,
|
|
1480
|
-
"alcohol":
|
|
1487
|
+
"alcohol": IntakeAlcoholUseToJSON(value["alcohol"]),
|
|
1481
1488
|
"contraception": value["contraception"],
|
|
1482
|
-
"diet_category":
|
|
1489
|
+
"diet_category": value["diet_category"],
|
|
1483
1490
|
"diet_description": value["diet_description"],
|
|
1484
|
-
"education":
|
|
1491
|
+
"education": value["education"],
|
|
1492
|
+
"ehr_answers": value["ehr_answers"] == null ? void 0 : value["ehr_answers"].map(IntakeEhrAnswerToJSON),
|
|
1485
1493
|
"employer": value["employer"],
|
|
1486
|
-
"exercise_frequency":
|
|
1494
|
+
"exercise_frequency": value["exercise_frequency"],
|
|
1487
1495
|
"exercise_minutes_per_week": value["exercise_minutes_per_week"],
|
|
1488
1496
|
"gender_identity": GenderIdentityToJSON(value["gender_identity"]),
|
|
1489
|
-
"living_situation":
|
|
1497
|
+
"living_situation": value["living_situation"],
|
|
1490
1498
|
"notes": value["notes"],
|
|
1491
1499
|
"number_of_dependents": value["number_of_dependents"],
|
|
1492
1500
|
"occupation": value["occupation"],
|
|
1493
1501
|
"occupational_exposures": value["occupational_exposures"],
|
|
1494
|
-
"sexual_orientation":
|
|
1502
|
+
"sexual_orientation": value["sexual_orientation"],
|
|
1495
1503
|
"sexually_active": value["sexually_active"],
|
|
1496
|
-
"substances": value["substances"] == null ? void 0 : value["substances"].map(
|
|
1497
|
-
"tobacco":
|
|
1504
|
+
"substances": value["substances"] == null ? void 0 : value["substances"].map(IntakeSubstanceUseToJSON),
|
|
1505
|
+
"tobacco": IntakeTobaccoUseToJSON(value["tobacco"]),
|
|
1498
1506
|
"travel_history": value["travel_history"]
|
|
1499
1507
|
};
|
|
1500
1508
|
}
|
|
@@ -2188,6 +2196,8 @@ function GetDefaultProviderResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
2188
2196
|
return json;
|
|
2189
2197
|
}
|
|
2190
2198
|
return {
|
|
2199
|
+
"first_name": json["first_name"] === void 0 ? void 0 : json["first_name"] === null ? null : json["first_name"],
|
|
2200
|
+
"last_name": json["last_name"] === void 0 ? void 0 : json["last_name"] === null ? null : json["last_name"],
|
|
2191
2201
|
"name": json["name"],
|
|
2192
2202
|
"npi": json["npi"]
|
|
2193
2203
|
};
|
|
@@ -2709,6 +2719,45 @@ var PatientClient = class extends BaseServiceClient {
|
|
|
2709
2719
|
body: request
|
|
2710
2720
|
});
|
|
2711
2721
|
}
|
|
2722
|
+
flagOperationKey(key) {
|
|
2723
|
+
if (typeof key !== "string" || key.length !== 36 || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(key)) {
|
|
2724
|
+
throw new Error("A canonical UUID operation key is required");
|
|
2725
|
+
}
|
|
2726
|
+
return key;
|
|
2727
|
+
}
|
|
2728
|
+
flagOperationReceipt(value, key, approved) {
|
|
2729
|
+
const invalid = () => new Error("Invalid or mismatched flag operation receipt; reconcile the original key");
|
|
2730
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw invalid();
|
|
2731
|
+
const receipt = value;
|
|
2732
|
+
if (Object.keys(receipt).sort().join(",") !== "flags,idempotency_key,patient_id,status" || receipt.idempotency_key !== key || receipt.status !== "applied" || typeof receipt.patient_id !== "string" || receipt.patient_id.trim() !== receipt.patient_id || !/^[A-Za-z0-9.-]{1,64}$/.test(receipt.patient_id) || !receipt.flags || typeof receipt.flags !== "object" || Array.isArray(receipt.flags)) throw invalid();
|
|
2733
|
+
const flags = receipt.flags;
|
|
2734
|
+
if (!Object.keys(flags).length || Object.entries(flags).some(([name, item]) => !name || name.length > 256 || typeof item !== "boolean") || approved && (Object.keys(flags).length !== Object.keys(approved).length || Object.entries(approved).some(([name, item]) => flags[name] !== item))) throw invalid();
|
|
2735
|
+
return FlagOperationReceiptFromJSON(value);
|
|
2736
|
+
}
|
|
2737
|
+
/**
|
|
2738
|
+
* Commit the exact approved flag patch under a stable key. No automatic retries.
|
|
2739
|
+
* After a timeout or unknown outcome, look up the original key before proceeding.
|
|
2740
|
+
* The receipt contains the original patch, even if current flags have changed.
|
|
2741
|
+
*/
|
|
2742
|
+
async applyPatientFlagsOperation(request) {
|
|
2743
|
+
const key = this.flagOperationKey(request.idempotency_key);
|
|
2744
|
+
const flags = { ...request.flags };
|
|
2745
|
+
const result = await this.send("POST", "/patients/flags/operations", {
|
|
2746
|
+
body: ApplyPatientFlagsRequestToJSON({ idempotency_key: key, flags })
|
|
2747
|
+
});
|
|
2748
|
+
return this.flagOperationReceipt(result, key, flags);
|
|
2749
|
+
}
|
|
2750
|
+
/**
|
|
2751
|
+
* Read only the authenticated patient's original keyed receipt.
|
|
2752
|
+
* A 404 remains an HTTP error; an in-flight write may still commit.
|
|
2753
|
+
*/
|
|
2754
|
+
async getPatientFlagsOperation(idempotencyKey) {
|
|
2755
|
+
const key = this.flagOperationKey(idempotencyKey);
|
|
2756
|
+
const result = await this.send("GET", "/patients/flags/operations/{idempotency_key}", {
|
|
2757
|
+
pathParams: { idempotency_key: key }
|
|
2758
|
+
});
|
|
2759
|
+
return this.flagOperationReceipt(result, key);
|
|
2760
|
+
}
|
|
2712
2761
|
/** GET /patients — self-service; returns the authenticated patient's own FHIR Patient record. */
|
|
2713
2762
|
getProfile() {
|
|
2714
2763
|
return this.send("GET", "/patients", {});
|
|
@@ -2842,6 +2891,17 @@ var PatientClient = class extends BaseServiceClient {
|
|
|
2842
2891
|
body: { source, payload }
|
|
2843
2892
|
});
|
|
2844
2893
|
}
|
|
2894
|
+
listImpiloDevices() {
|
|
2895
|
+
return this.send("GET", "/patients/vitals/devices/impilo");
|
|
2896
|
+
}
|
|
2897
|
+
assignImpiloDevice(itemId) {
|
|
2898
|
+
return this.send("POST", "/patients/vitals/deviceassign/impilo", {
|
|
2899
|
+
body: { item_id: itemId }
|
|
2900
|
+
});
|
|
2901
|
+
}
|
|
2902
|
+
importImpiloVitals() {
|
|
2903
|
+
return this.send("POST", "/patients/vitals/import/impilo");
|
|
2904
|
+
}
|
|
2845
2905
|
importActivity(source, payload) {
|
|
2846
2906
|
return this.send("POST", "/patients/activity/import", {
|
|
2847
2907
|
body: { source, payload }
|