@healthcloudai/hc-sdk 3.21.0 → 3.22.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 (34) hide show
  1. package/dist/index.cjs +166 -1
  2. package/dist/index.d.cts +612 -2
  3. package/dist/index.d.ts +612 -2
  4. package/dist/index.js +166 -1
  5. package/docs/clients/PatientClient.md +2 -0
  6. package/docs/clients/QuestClient.md +1 -1
  7. package/docs/docs-manifest.json +15 -3
  8. package/docs/examples/index.md +3 -1
  9. package/docs/index.md +3 -1
  10. package/docs/models/CatalogItemKind.md +15 -0
  11. package/docs/models/CatalogVendor.md +15 -0
  12. package/docs/models/CollectionModality.md +15 -0
  13. package/docs/models/EncounterEffect.md +18 -0
  14. package/docs/models/EncounterOperationError.md +18 -0
  15. package/docs/models/EncounterOperationResponse.md +22 -0
  16. package/docs/models/EncounterSections.md +22 -0
  17. package/docs/models/GetTestOrderResponse.md +1 -0
  18. package/docs/models/ObservedEncounterResponse.md +26 -0
  19. package/docs/models/OrderItem.md +4 -0
  20. package/docs/models/PlaceTestOrderResponse.md +1 -0
  21. package/docs/models/QuestRetrieveCompendiumResponse.md +5 -0
  22. package/docs/models/SubmitEncounterOperationRequest.md +18 -0
  23. package/docs/models/TestOrder.md +1 -0
  24. package/docs/models/UnknownEncounterOperation.md +18 -0
  25. package/docs/models/index.md +10 -0
  26. package/docs/operations/connectors.questRetrieveCompendium.md +17 -2
  27. package/docs/operations/patient.getPatientEncounterOperation.md +151 -0
  28. package/docs/operations/patient.getTestOrder.md +1 -0
  29. package/docs/operations/patient.listOrderItems.md +12 -4
  30. package/docs/operations/patient.listTestOrders.md +1 -0
  31. package/docs/operations/patient.placeTestOrder.md +2 -0
  32. package/docs/operations/patient.submitPatientEncounterOperation.md +161 -0
  33. package/docs/operations/patient.submitPatientIntakeOperation.md +1 -1
  34. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1010,6 +1010,78 @@ var MCPClient = class extends BaseServiceClient {
1010
1010
  }
1011
1011
  };
1012
1012
 
1013
+ // src/models/openapi-generated/patient/models/EncounterEffect.ts
1014
+ function EncounterEffectFromJSON(json) {
1015
+ return EncounterEffectFromJSONTyped(json, false);
1016
+ }
1017
+ function EncounterEffectFromJSONTyped(json, ignoreDiscriminator) {
1018
+ if (json == null) {
1019
+ return json;
1020
+ }
1021
+ return {
1022
+ "error_present": json["error_present"],
1023
+ "status": json["status"]
1024
+ };
1025
+ }
1026
+
1027
+ // src/models/openapi-generated/patient/models/EncounterSections.ts
1028
+ function EncounterSectionsFromJSON(json) {
1029
+ return EncounterSectionsFromJSONTyped(json, false);
1030
+ }
1031
+ function EncounterSectionsFromJSONTyped(json, ignoreDiscriminator) {
1032
+ if (json == null) {
1033
+ return json;
1034
+ }
1035
+ return {
1036
+ "assessment": json["assessment"] === void 0 ? void 0 : json["assessment"] === null ? null : EncounterEffectFromJSON(json["assessment"]),
1037
+ "hpi": json["hpi"] === void 0 ? void 0 : json["hpi"] === null ? null : EncounterEffectFromJSON(json["hpi"]),
1038
+ "overall": EncounterEffectFromJSON(json["overall"]),
1039
+ "plan": json["plan"] === void 0 ? void 0 : json["plan"] === null ? null : EncounterEffectFromJSON(json["plan"]),
1040
+ "reason_for_visit": json["reason_for_visit"] === void 0 ? void 0 : json["reason_for_visit"] === null ? null : EncounterEffectFromJSON(json["reason_for_visit"]),
1041
+ "ros": json["ros"] === void 0 ? void 0 : json["ros"] === null ? null : EncounterEffectFromJSON(json["ros"])
1042
+ };
1043
+ }
1044
+
1045
+ // src/models/openapi-generated/patient/models/ObservedEncounterResponse.ts
1046
+ function ObservedEncounterResponseFromJSON(json) {
1047
+ return ObservedEncounterResponseFromJSONTyped(json, false);
1048
+ }
1049
+ function ObservedEncounterResponseFromJSONTyped(json, ignoreDiscriminator) {
1050
+ if (json == null) {
1051
+ return json;
1052
+ }
1053
+ return {
1054
+ "athena_encounter": json["athena_encounter"] === void 0 ? void 0 : json["athena_encounter"] === null ? null : EncounterEffectFromJSON(json["athena_encounter"]),
1055
+ "athena_insurance": json["athena_insurance"] === void 0 ? void 0 : json["athena_insurance"] === null ? null : EncounterEffectFromJSON(json["athena_insurance"]),
1056
+ "clinical_outcome": json["clinical_outcome"] == null ? void 0 : json["clinical_outcome"],
1057
+ "created": json["created"] === void 0 ? void 0 : json["created"] === null ? null : json["created"],
1058
+ "encounter_id": json["encounter_id"] === void 0 ? void 0 : json["encounter_id"] === null ? null : json["encounter_id"],
1059
+ "error_present": json["error_present"],
1060
+ "notes_athena_sections": json["notes_athena_sections"] === void 0 ? void 0 : json["notes_athena_sections"] === null ? null : EncounterSectionsFromJSON(json["notes_athena_sections"]),
1061
+ "notes_fhir": json["notes_fhir"] === void 0 ? void 0 : json["notes_fhir"] === null ? null : EncounterEffectFromJSON(json["notes_fhir"]),
1062
+ "openloop_encounter": json["openloop_encounter"] === void 0 ? void 0 : json["openloop_encounter"] === null ? null : EncounterEffectFromJSON(json["openloop_encounter"]),
1063
+ "steadymd_encounter": json["steadymd_encounter"] === void 0 ? void 0 : json["steadymd_encounter"] === null ? null : EncounterEffectFromJSON(json["steadymd_encounter"])
1064
+ };
1065
+ }
1066
+
1067
+ // src/models/openapi-generated/patient/models/EncounterOperationResponse.ts
1068
+ function EncounterOperationResponseFromJSON(json) {
1069
+ return EncounterOperationResponseFromJSONTyped(json, false);
1070
+ }
1071
+ function EncounterOperationResponseFromJSONTyped(json, ignoreDiscriminator) {
1072
+ if (json == null) {
1073
+ return json;
1074
+ }
1075
+ return {
1076
+ "idempotency_key": json["idempotency_key"],
1077
+ "patient_id": json["patient_id"],
1078
+ "request_hash": json["request_hash"],
1079
+ "response_body": json["response_body"] === void 0 ? void 0 : json["response_body"] === null ? null : ObservedEncounterResponseFromJSON(json["response_body"]),
1080
+ "response_code": json["response_code"] === void 0 ? void 0 : json["response_code"] === null ? null : json["response_code"],
1081
+ "status": json["status"]
1082
+ };
1083
+ }
1084
+
1013
1085
  // src/models/openapi-generated/patient/models/ObservedIntakeResponse.ts
1014
1086
  function ObservedIntakeResponseFromJSON(json) {
1015
1087
  return ObservedIntakeResponseFromJSONTyped(json, false);
@@ -1089,6 +1161,56 @@ function intakeOperationResponse(value, key) {
1089
1161
  return IntakeOperationResponseFromJSON(value);
1090
1162
  }
1091
1163
 
1164
+ // src/clients/encounterOperations.ts
1165
+ var effects = ["athena_encounter", "athena_insurance", "openloop_encounter", "steadymd_encounter", "notes_fhir"];
1166
+ var sections2 = ["reason_for_visit", "hpi", "ros", "assessment", "plan"];
1167
+ var statuses = /* @__PURE__ */ new Set(["linked", "failed", "partial", "skipped_no_athena", "skipped_no_openloop", "skipped_no_steadymd", "skipped_no_notes", "skipped_no_content", "skipped_no_package_configured", "skipped_no_openai", "skipped_no_athena_integration", "skipped", "unknown"]);
1168
+ var record2 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
1169
+ function encounterRequestSnapshot(request) {
1170
+ const invalid = () => new Error("Valid bounded exact encounter notes are required");
1171
+ if (!record2(request) || Object.keys(request).sort().join(",") !== "idempotency_key,notes") throw invalid();
1172
+ for (const name of Object.getOwnPropertyNames(request)) {
1173
+ const descriptor = Object.getOwnPropertyDescriptor(request, name);
1174
+ if (!descriptor.enumerable || !("value" in descriptor)) throw invalid();
1175
+ }
1176
+ if (Object.getOwnPropertySymbols(request).length) throw invalid();
1177
+ const key = intakeOperationKey(request.idempotency_key), notes = request.notes;
1178
+ if (typeof notes !== "string" || new TextEncoder().encode(notes).length > 65536) throw invalid();
1179
+ const blank = Array.from(notes).every((character) => !character.trim() || character.charCodeAt(0) >= 28 && character.charCodeAt(0) <= 31 || character.charCodeAt(0) === 133);
1180
+ if (blank) throw invalid();
1181
+ for (const character of notes) {
1182
+ const point = character.codePointAt(0);
1183
+ if (point >= 55296 && point <= 57343) throw invalid();
1184
+ }
1185
+ return { idempotency_key: key, notes };
1186
+ }
1187
+ function encounterOperationResponse(value, key) {
1188
+ const invalid = () => new Error("Invalid or mismatched encounter operation response; reconcile the original key");
1189
+ function closed(item, required, optional = []) {
1190
+ if (!record2(item) || required.some((name) => !Object.prototype.hasOwnProperty.call(item, name)) || Object.keys(item).some((name) => ![...required, ...optional].includes(name))) throw invalid();
1191
+ }
1192
+ function effect(item) {
1193
+ closed(item, ["status", "error_present"]);
1194
+ if (typeof item.status !== "string" || !statuses.has(item.status) || typeof item.error_present !== "boolean") throw invalid();
1195
+ }
1196
+ const identifier = (item) => typeof item === "string" && item.length <= 64 && /^[A-Za-z0-9.-]+$/.test(item) && item.trim() === item;
1197
+ closed(value, ["idempotency_key", "patient_id", "request_hash", "status"], ["response_code", "response_body"]);
1198
+ if (value.idempotency_key !== key || !identifier(value.patient_id) || typeof value.request_hash !== "string" || value.request_hash.length !== 64 || !/^[0-9a-f]{64}$/.test(value.request_hash) || typeof value.status !== "string" || !["reserved", "dispatching", "unknown", "recorded"].includes(value.status)) throw invalid();
1199
+ const code = value.response_code, body = value.response_body;
1200
+ if (value.status === "recorded") {
1201
+ if (typeof code !== "number" || !Number.isInteger(code) || code < 100 || code > 599) throw invalid();
1202
+ closed(body, ["clinical_outcome", "error_present"], [...effects, "encounter_id", "created", "notes_athena_sections"]);
1203
+ if (body.clinical_outcome !== "unknown" || typeof body.error_present !== "boolean" || body.encounter_id != null && !identifier(body.encounter_id) || body.created != null && typeof body.created !== "boolean") throw invalid();
1204
+ for (const name of effects) if (body[name] != null) effect(body[name]);
1205
+ if (body.notes_athena_sections != null) {
1206
+ closed(body.notes_athena_sections, ["overall"], sections2);
1207
+ effect(body.notes_athena_sections.overall);
1208
+ for (const name of sections2) if (body.notes_athena_sections[name] != null) effect(body.notes_athena_sections[name]);
1209
+ }
1210
+ } else if (code != null || body != null) throw invalid();
1211
+ return EncounterOperationResponseFromJSON(value);
1212
+ }
1213
+
1092
1214
  // src/models/openapi-generated/patient/models/StediClaimsResponse.ts
1093
1215
  function StediClaimsResponseFromJSON(json) {
1094
1216
  return StediClaimsResponseFromJSONTyped(json, false);
@@ -2403,6 +2525,30 @@ function ListDeliveryOrdersResponseFromJSONTyped(json, ignoreDiscriminator) {
2403
2525
  };
2404
2526
  }
2405
2527
 
2528
+ // src/models/openapi-generated/patient/models/CatalogVendor.ts
2529
+ function CatalogVendorFromJSON(json) {
2530
+ return CatalogVendorFromJSONTyped(json, false);
2531
+ }
2532
+ function CatalogVendorFromJSONTyped(json, ignoreDiscriminator) {
2533
+ return json;
2534
+ }
2535
+
2536
+ // src/models/openapi-generated/patient/models/CatalogItemKind.ts
2537
+ function CatalogItemKindFromJSON(json) {
2538
+ return CatalogItemKindFromJSONTyped(json, false);
2539
+ }
2540
+ function CatalogItemKindFromJSONTyped(json, ignoreDiscriminator) {
2541
+ return json;
2542
+ }
2543
+
2544
+ // src/models/openapi-generated/patient/models/CollectionModality.ts
2545
+ function CollectionModalityFromJSON(json) {
2546
+ return CollectionModalityFromJSONTyped(json, false);
2547
+ }
2548
+ function CollectionModalityFromJSONTyped(json, ignoreDiscriminator) {
2549
+ return json;
2550
+ }
2551
+
2406
2552
  // src/models/openapi-generated/patient/models/OrderItem.ts
2407
2553
  function OrderItemFromJSON(json) {
2408
2554
  return OrderItemFromJSONTyped(json, false);
@@ -2412,9 +2558,13 @@ function OrderItemFromJSONTyped(json, ignoreDiscriminator) {
2412
2558
  return json;
2413
2559
  }
2414
2560
  return {
2561
+ "collection_modalities": json["collection_modalities"] == null ? void 0 : json["collection_modalities"].map(CollectionModalityFromJSON),
2562
+ "collection_modality": CollectionModalityFromJSON(json["collection_modality"]),
2415
2563
  "id": json["id"],
2416
2564
  "image": json["image"] === void 0 ? void 0 : json["image"] === null ? null : json["image"],
2417
- "name": json["name"]
2565
+ "kind": CatalogItemKindFromJSON(json["kind"]),
2566
+ "name": json["name"],
2567
+ "vendor": CatalogVendorFromJSON(json["vendor"])
2418
2568
  };
2419
2569
  }
2420
2570
 
@@ -2555,6 +2705,7 @@ function PlaceTestOrderResponseFromJSONTyped(json, ignoreDiscriminator) {
2555
2705
  "patient_fhir_id": json["patient_fhir_id"] === void 0 ? void 0 : json["patient_fhir_id"] === null ? null : json["patient_fhir_id"],
2556
2706
  "performer_name": json["performer_name"] === void 0 ? void 0 : json["performer_name"] === null ? null : json["performer_name"],
2557
2707
  "priority": json["priority"] == null ? void 0 : OrderPriorityFromJSON(json["priority"]),
2708
+ "quest_placer_order_number": json["quest_placer_order_number"] === void 0 ? void 0 : json["quest_placer_order_number"] === null ? null : json["quest_placer_order_number"],
2558
2709
  "reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
2559
2710
  "requester_name": json["requester_name"] === void 0 ? void 0 : json["requester_name"] === null ? null : json["requester_name"],
2560
2711
  "requester_npi": json["requester_npi"] === void 0 ? void 0 : json["requester_npi"] === null ? null : json["requester_npi"],
@@ -2595,6 +2746,7 @@ function GetTestOrderResponseFromJSONTyped(json, ignoreDiscriminator) {
2595
2746
  "patient_fhir_id": json["patient_fhir_id"] === void 0 ? void 0 : json["patient_fhir_id"] === null ? null : json["patient_fhir_id"],
2596
2747
  "performer_name": json["performer_name"] === void 0 ? void 0 : json["performer_name"] === null ? null : json["performer_name"],
2597
2748
  "priority": json["priority"] == null ? void 0 : OrderPriorityFromJSON(json["priority"]),
2749
+ "quest_placer_order_number": json["quest_placer_order_number"] === void 0 ? void 0 : json["quest_placer_order_number"] === null ? null : json["quest_placer_order_number"],
2598
2750
  "reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
2599
2751
  "requester_name": json["requester_name"] === void 0 ? void 0 : json["requester_name"] === null ? null : json["requester_name"],
2600
2752
  "requester_npi": json["requester_npi"] === void 0 ? void 0 : json["requester_npi"] === null ? null : json["requester_npi"],
@@ -2635,6 +2787,7 @@ function TestOrderFromJSONTyped(json, ignoreDiscriminator) {
2635
2787
  "patient_fhir_id": json["patient_fhir_id"] === void 0 ? void 0 : json["patient_fhir_id"] === null ? null : json["patient_fhir_id"],
2636
2788
  "performer_name": json["performer_name"] === void 0 ? void 0 : json["performer_name"] === null ? null : json["performer_name"],
2637
2789
  "priority": json["priority"] == null ? void 0 : OrderPriorityFromJSON(json["priority"]),
2790
+ "quest_placer_order_number": json["quest_placer_order_number"] === void 0 ? void 0 : json["quest_placer_order_number"] === null ? null : json["quest_placer_order_number"],
2638
2791
  "reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
2639
2792
  "requester_name": json["requester_name"] === void 0 ? void 0 : json["requester_name"] === null ? null : json["requester_name"],
2640
2793
  "requester_npi": json["requester_npi"] === void 0 ? void 0 : json["requester_npi"] === null ? null : json["requester_npi"],
@@ -2973,6 +3126,18 @@ var PatientClient = class extends BaseServiceClient {
2973
3126
  const key = intakeOperationKey(idempotencyKey);
2974
3127
  return intakeOperationResponse(await this.send("GET", `/patients/intake/operations/${key}`), key);
2975
3128
  }
3129
+ /** Submit exact reviewed notes once. Recorded HTTP never settles clinical effects.
3130
+ * Pending/unknown remains unresolved; reconcile the original key, with no retry or fallback.
3131
+ */
3132
+ async submitPatientEncounterOperation(request) {
3133
+ const body = encounterRequestSnapshot(request);
3134
+ return encounterOperationResponse(await this.send("POST", "/patients/encounter/operations", { body }), body.idempotency_key);
3135
+ }
3136
+ /** Read only the original key. A 404 does not prove no clinical effects. */
3137
+ async getPatientEncounterOperation(idempotencyKey) {
3138
+ const key = intakeOperationKey(idempotencyKey);
3139
+ return encounterOperationResponse(await this.send("GET", `/patients/encounter/operations/${key}`), key);
3140
+ }
2976
3141
  /** GET /patients/attributes - get the authenticated patient's arbitrary JSON attributes. */
2977
3142
  getAttributes() {
2978
3143
  return this.send("GET", "/patients/attributes", {});