@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.
Files changed (35) hide show
  1. package/dist/index.cjs +132 -72
  2. package/dist/index.d.cts +577 -261
  3. package/dist/index.d.ts +577 -261
  4. package/dist/index.js +132 -72
  5. package/docs/clients/AthenaHealthClient.md +1 -1
  6. package/docs/clients/PatientClient.md +5 -0
  7. package/docs/docs-manifest.json +16 -3
  8. package/docs/examples/index.md +6 -1
  9. package/docs/index.md +6 -1
  10. package/docs/models/ApplyPatientFlagsRequest.md +18 -0
  11. package/docs/models/AssignImpiloDeviceRequest.md +17 -0
  12. package/docs/models/AssignImpiloDeviceResponse.md +20 -0
  13. package/docs/models/AthenaLabResult.md +2 -0
  14. package/docs/models/FlagOperationError.md +18 -0
  15. package/docs/models/FlagOperationReceipt.md +20 -0
  16. package/docs/models/GetDefaultProviderResponse.md +2 -0
  17. package/docs/models/ImpiloDeviceItem.md +23 -0
  18. package/docs/models/ListImpiloDevicesResponse.md +18 -0
  19. package/docs/models/UnknownFlagOperation.md +18 -0
  20. package/docs/models/_InsuranceOcrResult.md +1 -0
  21. package/docs/models/index.md +8 -0
  22. package/docs/operations/connectors.athenaAddLabResultDocument.md +2 -2
  23. package/docs/operations/connectors.athenaGetLabResult.md +2 -0
  24. package/docs/operations/connectors.athenaListLabResults.md +2 -0
  25. package/docs/operations/patient.addInsurance.md +48 -16
  26. package/docs/operations/patient.applyPatientFlagsOperation.md +152 -0
  27. package/docs/operations/patient.assignImpiloDevice.md +112 -0
  28. package/docs/operations/patient.assistantOcrInsurance.md +64 -13
  29. package/docs/operations/patient.checkPatientInsuranceEligibility.md +133 -38
  30. package/docs/operations/patient.getDefaultProvider.md +2 -0
  31. package/docs/operations/patient.getPatientFlagsOperation.md +150 -0
  32. package/docs/operations/patient.importImpiloVitals.md +129 -0
  33. package/docs/operations/patient.listImpiloDevices.md +100 -0
  34. package/docs/operations/patient.submitPatientIntake.md +13 -1
  35. 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/SubstanceStatus.ts
1373
- function SubstanceStatusToJSON(value) {
1374
- return value;
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
- "frequency": value["frequency"],
1387
- "notes": value["notes"],
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": SubstanceStatusToJSON(value["status"]),
1392
- "substance": value["substance"]
1417
+ "status": value["status"]
1393
1418
  };
1394
1419
  }
1395
1420
 
1396
- // src/models/openapi-generated/patient/models/DietCategory.ts
1397
- function DietCategoryToJSON(value) {
1398
- return value;
1421
+ // src/models/openapi-generated/patient/models/IntakeAlcoholUse.ts
1422
+ function IntakeAlcoholUseToJSON(json) {
1423
+ return IntakeAlcoholUseToJSONTyped(json, false);
1399
1424
  }
1400
-
1401
- // src/models/openapi-generated/patient/models/ExerciseFrequency.ts
1402
- function ExerciseFrequencyToJSON(value) {
1403
- return value;
1404
- }
1405
-
1406
- // src/models/openapi-generated/patient/models/LivingSituation.ts
1407
- function LivingSituationToJSON(value) {
1408
- return value;
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/SmokingStatus.ts
1412
- function SmokingStatusToJSON(value) {
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/TobaccoUse.ts
1417
- function TobaccoUseToJSON(json) {
1418
- return TobaccoUseToJSONTyped(json, false);
1443
+ // src/models/openapi-generated/patient/models/IntakeSubstanceUse.ts
1444
+ function IntakeSubstanceUseToJSON(json) {
1445
+ return IntakeSubstanceUseToJSONTyped(json, false);
1419
1446
  }
1420
- function TobaccoUseToJSONTyped(value, ignoreDiscriminator = false) {
1447
+ function IntakeSubstanceUseToJSONTyped(value, ignoreDiscriminator = false) {
1421
1448
  if (value == null) {
1422
1449
  return value;
1423
1450
  }
1424
1451
  return {
1425
- "cessation_aids": value["cessation_aids"],
1426
- "cigarettes_per_day": value["cigarettes_per_day"],
1427
- "pack_years": value["pack_years"],
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": SmokingStatusToJSON(value["status"])
1458
+ "status": value["status"],
1459
+ "substance": value["substance"]
1431
1460
  };
1432
1461
  }
1433
1462
 
1434
- // src/models/openapi-generated/patient/models/AlcoholFrequency.ts
1435
- function AlcoholFrequencyToJSON(value) {
1436
- return value;
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 AlcoholUseToJSONTyped(value, ignoreDiscriminator = false) {
1467
+ function IntakeEhrAnswerToJSONTyped(value, ignoreDiscriminator = false) {
1444
1468
  if (value == null) {
1445
1469
  return value;
1446
1470
  }
1447
1471
  return {
1448
- "binge_drinking": value["binge_drinking"],
1449
- "drinks_per_week": value["drinks_per_week"],
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": AlcoholUseToJSON(value["alcohol"]),
1487
+ "alcohol": IntakeAlcoholUseToJSON(value["alcohol"]),
1481
1488
  "contraception": value["contraception"],
1482
- "diet_category": DietCategoryToJSON(value["diet_category"]),
1489
+ "diet_category": value["diet_category"],
1483
1490
  "diet_description": value["diet_description"],
1484
- "education": EducationLevelToJSON(value["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": ExerciseFrequencyToJSON(value["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": LivingSituationToJSON(value["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": SexualOrientationToJSON(value["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(SubstanceUseToJSON),
1497
- "tobacco": TobaccoUseToJSON(value["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 }