@healthcloudai/hc-sdk 3.20.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 (40) hide show
  1. package/dist/index.cjs +259 -1
  2. package/dist/index.d.cts +1010 -101
  3. package/dist/index.d.ts +1010 -101
  4. package/dist/index.js +259 -1
  5. package/docs/clients/PatientClient.md +4 -0
  6. package/docs/clients/QuestClient.md +1 -1
  7. package/docs/docs-manifest.json +22 -3
  8. package/docs/examples/index.md +5 -1
  9. package/docs/index.md +5 -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/IntakeOperationError.md +18 -0
  19. package/docs/models/IntakeOperationResponse.md +22 -0
  20. package/docs/models/ObservedEncounterResponse.md +26 -0
  21. package/docs/models/ObservedIntakeResponse.md +17 -0
  22. package/docs/models/OrderItem.md +4 -0
  23. package/docs/models/PlaceTestOrderResponse.md +1 -0
  24. package/docs/models/QuestRetrieveCompendiumResponse.md +5 -0
  25. package/docs/models/SubmitEncounterOperationRequest.md +18 -0
  26. package/docs/models/SubmitIntakeOperationRequest.md +19 -0
  27. package/docs/models/TestOrder.md +1 -0
  28. package/docs/models/UnknownEncounterOperation.md +18 -0
  29. package/docs/models/UnknownIntakeOperation.md +18 -0
  30. package/docs/models/index.md +15 -0
  31. package/docs/operations/connectors.questRetrieveCompendium.md +17 -2
  32. package/docs/operations/patient.getPatientEncounterOperation.md +151 -0
  33. package/docs/operations/patient.getPatientIntakeOperation.md +166 -0
  34. package/docs/operations/patient.getTestOrder.md +1 -0
  35. package/docs/operations/patient.listOrderItems.md +12 -4
  36. package/docs/operations/patient.listTestOrders.md +1 -0
  37. package/docs/operations/patient.placeTestOrder.md +2 -0
  38. package/docs/operations/patient.submitPatientEncounterOperation.md +161 -0
  39. package/docs/operations/patient.submitPatientIntakeOperation.md +178 -0
  40. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -935,6 +935,207 @@ var MCPClient = class extends BaseServiceClient {
935
935
  }
936
936
  };
937
937
 
938
+ // src/models/openapi-generated/patient/models/EncounterEffect.ts
939
+ function EncounterEffectFromJSON(json) {
940
+ return EncounterEffectFromJSONTyped(json, false);
941
+ }
942
+ function EncounterEffectFromJSONTyped(json, ignoreDiscriminator) {
943
+ if (json == null) {
944
+ return json;
945
+ }
946
+ return {
947
+ "error_present": json["error_present"],
948
+ "status": json["status"]
949
+ };
950
+ }
951
+
952
+ // src/models/openapi-generated/patient/models/EncounterSections.ts
953
+ function EncounterSectionsFromJSON(json) {
954
+ return EncounterSectionsFromJSONTyped(json, false);
955
+ }
956
+ function EncounterSectionsFromJSONTyped(json, ignoreDiscriminator) {
957
+ if (json == null) {
958
+ return json;
959
+ }
960
+ return {
961
+ "assessment": json["assessment"] === void 0 ? void 0 : json["assessment"] === null ? null : EncounterEffectFromJSON(json["assessment"]),
962
+ "hpi": json["hpi"] === void 0 ? void 0 : json["hpi"] === null ? null : EncounterEffectFromJSON(json["hpi"]),
963
+ "overall": EncounterEffectFromJSON(json["overall"]),
964
+ "plan": json["plan"] === void 0 ? void 0 : json["plan"] === null ? null : EncounterEffectFromJSON(json["plan"]),
965
+ "reason_for_visit": json["reason_for_visit"] === void 0 ? void 0 : json["reason_for_visit"] === null ? null : EncounterEffectFromJSON(json["reason_for_visit"]),
966
+ "ros": json["ros"] === void 0 ? void 0 : json["ros"] === null ? null : EncounterEffectFromJSON(json["ros"])
967
+ };
968
+ }
969
+
970
+ // src/models/openapi-generated/patient/models/ObservedEncounterResponse.ts
971
+ function ObservedEncounterResponseFromJSON(json) {
972
+ return ObservedEncounterResponseFromJSONTyped(json, false);
973
+ }
974
+ function ObservedEncounterResponseFromJSONTyped(json, ignoreDiscriminator) {
975
+ if (json == null) {
976
+ return json;
977
+ }
978
+ return {
979
+ "athena_encounter": json["athena_encounter"] === void 0 ? void 0 : json["athena_encounter"] === null ? null : EncounterEffectFromJSON(json["athena_encounter"]),
980
+ "athena_insurance": json["athena_insurance"] === void 0 ? void 0 : json["athena_insurance"] === null ? null : EncounterEffectFromJSON(json["athena_insurance"]),
981
+ "clinical_outcome": json["clinical_outcome"] == null ? void 0 : json["clinical_outcome"],
982
+ "created": json["created"] === void 0 ? void 0 : json["created"] === null ? null : json["created"],
983
+ "encounter_id": json["encounter_id"] === void 0 ? void 0 : json["encounter_id"] === null ? null : json["encounter_id"],
984
+ "error_present": json["error_present"],
985
+ "notes_athena_sections": json["notes_athena_sections"] === void 0 ? void 0 : json["notes_athena_sections"] === null ? null : EncounterSectionsFromJSON(json["notes_athena_sections"]),
986
+ "notes_fhir": json["notes_fhir"] === void 0 ? void 0 : json["notes_fhir"] === null ? null : EncounterEffectFromJSON(json["notes_fhir"]),
987
+ "openloop_encounter": json["openloop_encounter"] === void 0 ? void 0 : json["openloop_encounter"] === null ? null : EncounterEffectFromJSON(json["openloop_encounter"]),
988
+ "steadymd_encounter": json["steadymd_encounter"] === void 0 ? void 0 : json["steadymd_encounter"] === null ? null : EncounterEffectFromJSON(json["steadymd_encounter"])
989
+ };
990
+ }
991
+
992
+ // src/models/openapi-generated/patient/models/EncounterOperationResponse.ts
993
+ function EncounterOperationResponseFromJSON(json) {
994
+ return EncounterOperationResponseFromJSONTyped(json, false);
995
+ }
996
+ function EncounterOperationResponseFromJSONTyped(json, ignoreDiscriminator) {
997
+ if (json == null) {
998
+ return json;
999
+ }
1000
+ return {
1001
+ "idempotency_key": json["idempotency_key"],
1002
+ "patient_id": json["patient_id"],
1003
+ "request_hash": json["request_hash"],
1004
+ "response_body": json["response_body"] === void 0 ? void 0 : json["response_body"] === null ? null : ObservedEncounterResponseFromJSON(json["response_body"]),
1005
+ "response_code": json["response_code"] === void 0 ? void 0 : json["response_code"] === null ? null : json["response_code"],
1006
+ "status": json["status"]
1007
+ };
1008
+ }
1009
+
1010
+ // src/models/openapi-generated/patient/models/ObservedIntakeResponse.ts
1011
+ function ObservedIntakeResponseFromJSON(json) {
1012
+ return ObservedIntakeResponseFromJSONTyped(json, false);
1013
+ }
1014
+ function ObservedIntakeResponseFromJSONTyped(json, ignoreDiscriminator) {
1015
+ if (json == null) {
1016
+ return json;
1017
+ }
1018
+ return {
1019
+ "error_messages": json["error_messages"]
1020
+ };
1021
+ }
1022
+
1023
+ // src/models/openapi-generated/patient/models/IntakeOperationResponse.ts
1024
+ function IntakeOperationResponseFromJSON(json) {
1025
+ return IntakeOperationResponseFromJSONTyped(json, false);
1026
+ }
1027
+ function IntakeOperationResponseFromJSONTyped(json, ignoreDiscriminator) {
1028
+ if (json == null) {
1029
+ return json;
1030
+ }
1031
+ return {
1032
+ "idempotency_key": json["idempotency_key"],
1033
+ "patient_id": json["patient_id"],
1034
+ "request_hash": json["request_hash"],
1035
+ "response_body": json["response_body"] === void 0 ? void 0 : json["response_body"] === null ? null : ObservedIntakeResponseFromJSON(json["response_body"]),
1036
+ "response_code": json["response_code"] === void 0 ? void 0 : json["response_code"] === null ? null : json["response_code"],
1037
+ "status": json["status"]
1038
+ };
1039
+ }
1040
+
1041
+ // src/clients/intakeOperations.ts
1042
+ var sections = /* @__PURE__ */ new Set(["allergies", "cancer_cases", "family_history", "gyn_history", "perinatal_history", "medications", "problems", "social_history", "surgical_history", "vaccines"]);
1043
+ var record = (value) => !!value && typeof value === "object" && !Array.isArray(value);
1044
+ function intakeOperationKey(key) {
1045
+ 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)) {
1046
+ throw new Error("A canonical UUID operation key is required");
1047
+ }
1048
+ return key;
1049
+ }
1050
+ function intakeRequestSnapshot(request) {
1051
+ const invalid = () => new Error("Valid bounded raw intake terms are required");
1052
+ if (!record(request) || Object.keys(request).sort().join(",") !== "idempotency_key,section,summary") throw invalid();
1053
+ const key = intakeOperationKey(request.idempotency_key);
1054
+ if (!sections.has(request.section)) throw invalid();
1055
+ const raw = request.summary;
1056
+ if (typeof raw === "string" ? !raw.trim() : !record(raw) || Object.keys(raw).length !== 1 || !Object.prototype.hasOwnProperty.call(raw, request.section)) throw invalid();
1057
+ let visited = 0;
1058
+ function snapshot(value, depth) {
1059
+ if (depth > 16 || ++visited > 65536) throw invalid();
1060
+ if (value === null || typeof value === "string" || typeof value === "boolean") return value;
1061
+ if (typeof value === "number" && Number.isFinite(value)) return value;
1062
+ if (!value || typeof value !== "object" || Object.getOwnPropertySymbols(value).length) throw invalid();
1063
+ const array = Array.isArray(value);
1064
+ if (!array && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) throw invalid();
1065
+ const names = Object.getOwnPropertyNames(value).filter((name) => !(array && name === "length"));
1066
+ if (array && (names.length !== value.length || names.some((name, index) => name !== String(index)))) throw invalid();
1067
+ const entries = names.map((name) => {
1068
+ const descriptor = Object.getOwnPropertyDescriptor(value, name);
1069
+ if (!descriptor.enumerable || !("value" in descriptor)) throw invalid();
1070
+ return [name, snapshot(descriptor.value, depth + 1)];
1071
+ });
1072
+ return array ? entries.map(([, item]) => item) : Object.fromEntries(entries);
1073
+ }
1074
+ const summary = snapshot(raw, 0);
1075
+ if (new TextEncoder().encode(JSON.stringify(summary)).length > 65536) throw invalid();
1076
+ return { idempotency_key: key, section: request.section, summary };
1077
+ }
1078
+ function intakeOperationResponse(value, key) {
1079
+ const invalid = () => new Error("Invalid or mismatched intake operation response; reconcile the original key");
1080
+ const required = ["idempotency_key", "patient_id", "request_hash", "status"];
1081
+ if (!record(value) || required.some((name) => !Object.prototype.hasOwnProperty.call(value, name)) || Object.keys(value).some((name) => ![...required, "response_code", "response_body"].includes(name)) || value.idempotency_key !== key || typeof value.patient_id !== "string" || value.patient_id.length > 64 || !/^[A-Za-z0-9.-]+$/.test(value.patient_id) || value.patient_id.trim() !== 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();
1082
+ const code = value.response_code, body = value.response_body;
1083
+ if (value.status === "recorded") {
1084
+ if (typeof code !== "number" || !Number.isInteger(code) || code < 100 || code > 599 || !record(body) || Object.keys(body).join(",") !== "error_messages" || !Array.isArray(body.error_messages) || body.error_messages.length > 100 || body.error_messages.some((item) => typeof item !== "string" || Array.from(item).length > 4e3)) throw invalid();
1085
+ } else if (code != null || body != null) throw invalid();
1086
+ return IntakeOperationResponseFromJSON(value);
1087
+ }
1088
+
1089
+ // src/clients/encounterOperations.ts
1090
+ var effects = ["athena_encounter", "athena_insurance", "openloop_encounter", "steadymd_encounter", "notes_fhir"];
1091
+ var sections2 = ["reason_for_visit", "hpi", "ros", "assessment", "plan"];
1092
+ 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"]);
1093
+ var record2 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
1094
+ function encounterRequestSnapshot(request) {
1095
+ const invalid = () => new Error("Valid bounded exact encounter notes are required");
1096
+ if (!record2(request) || Object.keys(request).sort().join(",") !== "idempotency_key,notes") throw invalid();
1097
+ for (const name of Object.getOwnPropertyNames(request)) {
1098
+ const descriptor = Object.getOwnPropertyDescriptor(request, name);
1099
+ if (!descriptor.enumerable || !("value" in descriptor)) throw invalid();
1100
+ }
1101
+ if (Object.getOwnPropertySymbols(request).length) throw invalid();
1102
+ const key = intakeOperationKey(request.idempotency_key), notes = request.notes;
1103
+ if (typeof notes !== "string" || new TextEncoder().encode(notes).length > 65536) throw invalid();
1104
+ const blank = Array.from(notes).every((character) => !character.trim() || character.charCodeAt(0) >= 28 && character.charCodeAt(0) <= 31 || character.charCodeAt(0) === 133);
1105
+ if (blank) throw invalid();
1106
+ for (const character of notes) {
1107
+ const point = character.codePointAt(0);
1108
+ if (point >= 55296 && point <= 57343) throw invalid();
1109
+ }
1110
+ return { idempotency_key: key, notes };
1111
+ }
1112
+ function encounterOperationResponse(value, key) {
1113
+ const invalid = () => new Error("Invalid or mismatched encounter operation response; reconcile the original key");
1114
+ function closed(item, required, optional = []) {
1115
+ if (!record2(item) || required.some((name) => !Object.prototype.hasOwnProperty.call(item, name)) || Object.keys(item).some((name) => ![...required, ...optional].includes(name))) throw invalid();
1116
+ }
1117
+ function effect(item) {
1118
+ closed(item, ["status", "error_present"]);
1119
+ if (typeof item.status !== "string" || !statuses.has(item.status) || typeof item.error_present !== "boolean") throw invalid();
1120
+ }
1121
+ const identifier = (item) => typeof item === "string" && item.length <= 64 && /^[A-Za-z0-9.-]+$/.test(item) && item.trim() === item;
1122
+ closed(value, ["idempotency_key", "patient_id", "request_hash", "status"], ["response_code", "response_body"]);
1123
+ 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();
1124
+ const code = value.response_code, body = value.response_body;
1125
+ if (value.status === "recorded") {
1126
+ if (typeof code !== "number" || !Number.isInteger(code) || code < 100 || code > 599) throw invalid();
1127
+ closed(body, ["clinical_outcome", "error_present"], [...effects, "encounter_id", "created", "notes_athena_sections"]);
1128
+ 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();
1129
+ for (const name of effects) if (body[name] != null) effect(body[name]);
1130
+ if (body.notes_athena_sections != null) {
1131
+ closed(body.notes_athena_sections, ["overall"], sections2);
1132
+ effect(body.notes_athena_sections.overall);
1133
+ for (const name of sections2) if (body.notes_athena_sections[name] != null) effect(body.notes_athena_sections[name]);
1134
+ }
1135
+ } else if (code != null || body != null) throw invalid();
1136
+ return EncounterOperationResponseFromJSON(value);
1137
+ }
1138
+
938
1139
  // src/models/openapi-generated/patient/models/StediClaimsResponse.ts
939
1140
  function StediClaimsResponseFromJSON(json) {
940
1141
  return StediClaimsResponseFromJSONTyped(json, false);
@@ -2249,6 +2450,30 @@ function ListDeliveryOrdersResponseFromJSONTyped(json, ignoreDiscriminator) {
2249
2450
  };
2250
2451
  }
2251
2452
 
2453
+ // src/models/openapi-generated/patient/models/CatalogVendor.ts
2454
+ function CatalogVendorFromJSON(json) {
2455
+ return CatalogVendorFromJSONTyped(json, false);
2456
+ }
2457
+ function CatalogVendorFromJSONTyped(json, ignoreDiscriminator) {
2458
+ return json;
2459
+ }
2460
+
2461
+ // src/models/openapi-generated/patient/models/CatalogItemKind.ts
2462
+ function CatalogItemKindFromJSON(json) {
2463
+ return CatalogItemKindFromJSONTyped(json, false);
2464
+ }
2465
+ function CatalogItemKindFromJSONTyped(json, ignoreDiscriminator) {
2466
+ return json;
2467
+ }
2468
+
2469
+ // src/models/openapi-generated/patient/models/CollectionModality.ts
2470
+ function CollectionModalityFromJSON(json) {
2471
+ return CollectionModalityFromJSONTyped(json, false);
2472
+ }
2473
+ function CollectionModalityFromJSONTyped(json, ignoreDiscriminator) {
2474
+ return json;
2475
+ }
2476
+
2252
2477
  // src/models/openapi-generated/patient/models/OrderItem.ts
2253
2478
  function OrderItemFromJSON(json) {
2254
2479
  return OrderItemFromJSONTyped(json, false);
@@ -2258,9 +2483,13 @@ function OrderItemFromJSONTyped(json, ignoreDiscriminator) {
2258
2483
  return json;
2259
2484
  }
2260
2485
  return {
2486
+ "collection_modalities": json["collection_modalities"] == null ? void 0 : json["collection_modalities"].map(CollectionModalityFromJSON),
2487
+ "collection_modality": CollectionModalityFromJSON(json["collection_modality"]),
2261
2488
  "id": json["id"],
2262
2489
  "image": json["image"] === void 0 ? void 0 : json["image"] === null ? null : json["image"],
2263
- "name": json["name"]
2490
+ "kind": CatalogItemKindFromJSON(json["kind"]),
2491
+ "name": json["name"],
2492
+ "vendor": CatalogVendorFromJSON(json["vendor"])
2264
2493
  };
2265
2494
  }
2266
2495
 
@@ -2401,6 +2630,7 @@ function PlaceTestOrderResponseFromJSONTyped(json, ignoreDiscriminator) {
2401
2630
  "patient_fhir_id": json["patient_fhir_id"] === void 0 ? void 0 : json["patient_fhir_id"] === null ? null : json["patient_fhir_id"],
2402
2631
  "performer_name": json["performer_name"] === void 0 ? void 0 : json["performer_name"] === null ? null : json["performer_name"],
2403
2632
  "priority": json["priority"] == null ? void 0 : OrderPriorityFromJSON(json["priority"]),
2633
+ "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"],
2404
2634
  "reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
2405
2635
  "requester_name": json["requester_name"] === void 0 ? void 0 : json["requester_name"] === null ? null : json["requester_name"],
2406
2636
  "requester_npi": json["requester_npi"] === void 0 ? void 0 : json["requester_npi"] === null ? null : json["requester_npi"],
@@ -2441,6 +2671,7 @@ function GetTestOrderResponseFromJSONTyped(json, ignoreDiscriminator) {
2441
2671
  "patient_fhir_id": json["patient_fhir_id"] === void 0 ? void 0 : json["patient_fhir_id"] === null ? null : json["patient_fhir_id"],
2442
2672
  "performer_name": json["performer_name"] === void 0 ? void 0 : json["performer_name"] === null ? null : json["performer_name"],
2443
2673
  "priority": json["priority"] == null ? void 0 : OrderPriorityFromJSON(json["priority"]),
2674
+ "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"],
2444
2675
  "reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
2445
2676
  "requester_name": json["requester_name"] === void 0 ? void 0 : json["requester_name"] === null ? null : json["requester_name"],
2446
2677
  "requester_npi": json["requester_npi"] === void 0 ? void 0 : json["requester_npi"] === null ? null : json["requester_npi"],
@@ -2481,6 +2712,7 @@ function TestOrderFromJSONTyped(json, ignoreDiscriminator) {
2481
2712
  "patient_fhir_id": json["patient_fhir_id"] === void 0 ? void 0 : json["patient_fhir_id"] === null ? null : json["patient_fhir_id"],
2482
2713
  "performer_name": json["performer_name"] === void 0 ? void 0 : json["performer_name"] === null ? null : json["performer_name"],
2483
2714
  "priority": json["priority"] == null ? void 0 : OrderPriorityFromJSON(json["priority"]),
2715
+ "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"],
2484
2716
  "reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
2485
2717
  "requester_name": json["requester_name"] === void 0 ? void 0 : json["requester_name"] === null ? null : json["requester_name"],
2486
2718
  "requester_npi": json["requester_npi"] === void 0 ? void 0 : json["requester_npi"] === null ? null : json["requester_npi"],
@@ -2805,6 +3037,32 @@ var PatientClient = class extends BaseServiceClient {
2805
3037
  body: payload
2806
3038
  });
2807
3039
  }
3040
+ /** Submit exact approved terms once. Pending/unknown remains unresolved;
3041
+ * recorded HTTP evidence is not independent proof of clinical success.
3042
+ * After transport failure, look up the original key. No retries or fallback.
3043
+ */
3044
+ async submitPatientIntakeOperation(request) {
3045
+ const body = intakeRequestSnapshot(request);
3046
+ const response = await this.send("POST", "/patients/intake/operations", { body });
3047
+ return intakeOperationResponse(response, body.idempotency_key);
3048
+ }
3049
+ /** Read the original key without writing. A 404 does not prove no effect. */
3050
+ async getPatientIntakeOperation(idempotencyKey) {
3051
+ const key = intakeOperationKey(idempotencyKey);
3052
+ return intakeOperationResponse(await this.send("GET", `/patients/intake/operations/${key}`), key);
3053
+ }
3054
+ /** Submit exact reviewed notes once. Recorded HTTP never settles clinical effects.
3055
+ * Pending/unknown remains unresolved; reconcile the original key, with no retry or fallback.
3056
+ */
3057
+ async submitPatientEncounterOperation(request) {
3058
+ const body = encounterRequestSnapshot(request);
3059
+ return encounterOperationResponse(await this.send("POST", "/patients/encounter/operations", { body }), body.idempotency_key);
3060
+ }
3061
+ /** Read only the original key. A 404 does not prove no clinical effects. */
3062
+ async getPatientEncounterOperation(idempotencyKey) {
3063
+ const key = intakeOperationKey(idempotencyKey);
3064
+ return encounterOperationResponse(await this.send("GET", `/patients/encounter/operations/${key}`), key);
3065
+ }
2808
3066
  /** GET /patients/attributes - get the authenticated patient's arbitrary JSON attributes. */
2809
3067
  getAttributes() {
2810
3068
  return this.send("GET", "/patients/attributes", {});
@@ -53,9 +53,11 @@
53
53
  - [`getPatientAlerts`](../operations/patient.getPatientAlerts.md) — Get patient dashboard alerts
54
54
  - [`getAttributes`](../operations/patient.getPatientAttributes.md) — Get patient attributes
55
55
  - [`getDashboard`](../operations/patient.getPatientDashboard.md) — Get the patient dashboard summary
56
+ - [`getPatientEncounterOperation`](../operations/patient.getPatientEncounterOperation.md) — Read the logged-in patient's keyed encounter journal state
56
57
  - [`getFlags`](../operations/patient.getPatientFlags.md) — Get patient flags
57
58
  - [`getPatientFlagsOperation`](../operations/patient.getPatientFlagsOperation.md) — Look up a keyed patient flag receipt
58
59
  - [`getPatientIntake`](../operations/patient.getPatientIntake.md) — Get own patient intake submission and delivery status
60
+ - [`getPatientIntakeOperation`](../operations/patient.getPatientIntakeOperation.md) — Read the logged-in patient's keyed intake journal state
59
61
  - [`getPatientSidebar`](../operations/patient.getPatientSidebarPatientSidebar.md) — Get the patient sidebar summary
60
62
  - [`getPhoto`](../operations/patient.getPhoto.md) — Get a patient photo
61
63
  - [`getPreferredPharmacy`](../operations/patient.getPreferredPharmacy.md) — Get preferred pharmacy
@@ -85,7 +87,9 @@
85
87
  - [`searchKnowledge`](../operations/patient.searchKnowledge.md) — Search the knowledge base
86
88
  - [`setPreferredPharmacy`](../operations/patient.setPreferredPharmacy.md) — Set preferred pharmacy
87
89
  - [`createCurrentScreeningSymptoms`](../operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md) — Submit current symptoms
90
+ - [`submitPatientEncounterOperation`](../operations/patient.submitPatientEncounterOperation.md) — Execute or replay one keyed agent encounter operation
88
91
  - [`submitPatientIntake`](../operations/patient.submitPatientIntake.md) — Submit patient-reported health record intake
92
+ - [`submitPatientIntakeOperation`](../operations/patient.submitPatientIntakeOperation.md) — Execute or replay one keyed agent intake operation
89
93
  - [`submitRawX12InsuranceEligibility`](../operations/patient.submitPatientRawX12Eligibility.md) — Submit a raw X12 270 eligibility request
90
94
  - [`submitSummary`](../operations/patient.submitSummary.md) — Write raw conversation/summary text onto an encounter's FHIR notes and, when Athena-linked, Athena's Reason for Visit/Screening/HPI sections
91
95
  - [`updateAddress`](../operations/patient.updateAddress.md) — Update home address
@@ -21,7 +21,7 @@
21
21
  - [`requestCompendiums`](../operations/connectors.questRequestCompendiums.md) — Request compendiums (Quest)
22
22
  - [`requestCompendiumsOnDemand`](../operations/connectors.questRequestCompendiumsOnDemand.md) — Request compendiums on demand (Quest)
23
23
  - [`retrieveAndExtractCompendium`](../operations/connectors.questRetrieveAndExtractCompendium.md) — Retrieve a compendium zip and return {filename: base64_content}
24
- - [`retrieveCompendium`](../operations/connectors.questRetrieveCompendium.md) — Retrieve a compendium zip and return as a Base64-encoded dict
24
+ - [`retrieveCompendium`](../operations/connectors.questRetrieveCompendium.md) — Retrieve a compendium zip as Base64, or as a short-lived download URL
25
25
  - [`submitFullOrder`](../operations/connectors.questSubmitFullOrder.md) — Submit full order (Quest)
26
26
  - [`submitOrder`](../operations/connectors.questSubmitOrder.md) — Submit order (Quest)
27
27
  - [`syncCompendiums`](../operations/connectors.questSyncCompendiums.md) — Download all available compendium files; ack each one
@@ -1,5 +1,5 @@
1
1
  {
2
- "docsDataContentDigest": "sha256:8a885adeb4993c883d40ab90cd4b3c96f57da4d28661ca356427847752e9508e",
2
+ "docsDataContentDigest": "sha256:c8a94d1de8cfe737a7b080d1ab927b40a83f1215b40ce2acad358c3b4615f257",
3
3
  "generatedFiles": [
4
4
  "authentication.md",
5
5
  "clients/AmsClient.md",
@@ -446,6 +446,8 @@
446
446
  "models/CarequalityQueryDocumentsResponse.md",
447
447
  "models/CarequalityRetrieveDocumentsRequest.md",
448
448
  "models/CarequalityRetrieveDocumentsResponse.md",
449
+ "models/CatalogItemKind.md",
450
+ "models/CatalogVendor.md",
449
451
  "models/ChatMessageRecord.md",
450
452
  "models/CheckEligibilityRequest.md",
451
453
  "models/CheckEligibilityResponse.md",
@@ -457,6 +459,7 @@
457
459
  "models/CmsGetCountyFipsRequest.md",
458
460
  "models/CmsSearchHealthPlansRequest.md",
459
461
  "models/CmsSearchHealthPlansResponse.md",
462
+ "models/CollectionModality.md",
460
463
  "models/CommGroupRecord.md",
461
464
  "models/CommsGetStateResponse.md",
462
465
  "models/CommsGetUnreadCountResponse.md",
@@ -578,6 +581,10 @@
578
581
  "models/ElevenlabsUpdateToolRequest.md",
579
582
  "models/EmergencyContact.md",
580
583
  "models/EncounterClass.md",
584
+ "models/EncounterEffect.md",
585
+ "models/EncounterOperationError.md",
586
+ "models/EncounterOperationResponse.md",
587
+ "models/EncounterSections.md",
581
588
  "models/EncounterStatus.md",
582
589
  "models/Ethnicity.md",
583
590
  "models/ExerciseFrequency.md",
@@ -1214,6 +1221,8 @@
1214
1221
  "models/InitHealthRecordImportResponse.md",
1215
1222
  "models/Insurance.md",
1216
1223
  "models/InsurancePriority.md",
1224
+ "models/IntakeOperationError.md",
1225
+ "models/IntakeOperationResponse.md",
1217
1226
  "models/InterpretationCode.md",
1218
1227
  "models/IntoleranceType.md",
1219
1228
  "models/IntraocularPressure.md",
@@ -1300,6 +1309,8 @@
1300
1309
  "models/NppesVerifyProviderResponse.md",
1301
1310
  "models/ObservationComponent.md",
1302
1311
  "models/ObservationStatus.md",
1312
+ "models/ObservedEncounterResponse.md",
1313
+ "models/ObservedIntakeResponse.md",
1303
1314
  "models/OnboardEncounterPayload.md",
1304
1315
  "models/OnboardEncounterStepResult.md",
1305
1316
  "models/OnboardPatientAttributes.md",
@@ -1808,6 +1819,8 @@
1808
1819
  "models/StripeVerifyConnectionResponse.md",
1809
1820
  "models/SubmitCurrentSymptomsScreeningsCurrentSymptomsRequest.md",
1810
1821
  "models/SubmitCurrentSymptomsScreeningsCurrentSymptomsResponse.md",
1822
+ "models/SubmitEncounterOperationRequest.md",
1823
+ "models/SubmitIntakeOperationRequest.md",
1811
1824
  "models/SubmitSummaryRequest.md",
1812
1825
  "models/SubscriberRelationship.md",
1813
1826
  "models/SubstanceStatus.md",
@@ -1835,7 +1848,9 @@
1835
1848
  "models/UberGetUndeliveredOrdersResponse.md",
1836
1849
  "models/UberUpdateDeliveryRequest.md",
1837
1850
  "models/UberWaypoint.md",
1851
+ "models/UnknownEncounterOperation.md",
1838
1852
  "models/UnknownFlagOperation.md",
1853
+ "models/UnknownIntakeOperation.md",
1839
1854
  "models/UpdateAddressRequest.md",
1840
1855
  "models/UpdateAddressResponse.md",
1841
1856
  "models/UpdateAgentRequest.md",
@@ -3125,9 +3140,11 @@
3125
3140
  "operations/patient.getPatientAlerts.md",
3126
3141
  "operations/patient.getPatientAttributes.md",
3127
3142
  "operations/patient.getPatientDashboard.md",
3143
+ "operations/patient.getPatientEncounterOperation.md",
3128
3144
  "operations/patient.getPatientFlags.md",
3129
3145
  "operations/patient.getPatientFlagsOperation.md",
3130
3146
  "operations/patient.getPatientIntake.md",
3147
+ "operations/patient.getPatientIntakeOperation.md",
3131
3148
  "operations/patient.getPatientSidebarPatientSidebar.md",
3132
3149
  "operations/patient.getPhoto.md",
3133
3150
  "operations/patient.getPreferredPharmacy.md",
@@ -3162,7 +3179,9 @@
3162
3179
  "operations/patient.searchKnowledge.md",
3163
3180
  "operations/patient.setPreferredPharmacy.md",
3164
3181
  "operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md",
3182
+ "operations/patient.submitPatientEncounterOperation.md",
3165
3183
  "operations/patient.submitPatientIntake.md",
3184
+ "operations/patient.submitPatientIntakeOperation.md",
3166
3185
  "operations/patient.submitPatientRawX12Eligibility.md",
3167
3186
  "operations/patient.submitSummary.md",
3168
3187
  "operations/patient.updateAddress.md",
@@ -3235,7 +3254,7 @@
3235
3254
  "operations/vitals.recordVitals.md"
3236
3255
  ],
3237
3256
  "language": "nodejs",
3238
- "modelCount": 2128,
3239
- "operationCount": 1050,
3257
+ "modelCount": 2143,
3258
+ "operationCount": 1054,
3240
3259
  "schemaVersion": 1
3241
3260
  }
@@ -593,7 +593,7 @@ Generated call examples use exact public surface signatures. Workflow examples r
593
593
  - [Request compendiums (Quest)](../operations/connectors.questRequestCompendiums.md)
594
594
  - [Request compendiums on demand (Quest)](../operations/connectors.questRequestCompendiumsOnDemand.md)
595
595
  - [Retrieve a compendium zip and return {filename: base64_content}](../operations/connectors.questRetrieveAndExtractCompendium.md)
596
- - [Retrieve a compendium zip and return as a Base64-encoded dict](../operations/connectors.questRetrieveCompendium.md)
596
+ - [Retrieve a compendium zip as Base64, or as a short-lived download URL](../operations/connectors.questRetrieveCompendium.md)
597
597
  - [Submit full order (Quest)](../operations/connectors.questSubmitFullOrder.md)
598
598
  - [Submit order (Quest)](../operations/connectors.questSubmitOrder.md)
599
599
  - [Download all available compendium files; ack each one](../operations/connectors.questSyncCompendiums.md)
@@ -944,9 +944,11 @@ Generated call examples use exact public surface signatures. Workflow examples r
944
944
  - [Get patient dashboard alerts](../operations/patient.getPatientAlerts.md)
945
945
  - [Get patient attributes](../operations/patient.getPatientAttributes.md)
946
946
  - [Get the patient dashboard summary](../operations/patient.getPatientDashboard.md)
947
+ - [Read the logged-in patient's keyed encounter journal state](../operations/patient.getPatientEncounterOperation.md)
947
948
  - [Get patient flags](../operations/patient.getPatientFlags.md)
948
949
  - [Look up a keyed patient flag receipt](../operations/patient.getPatientFlagsOperation.md)
949
950
  - [Get own patient intake submission and delivery status](../operations/patient.getPatientIntake.md)
951
+ - [Read the logged-in patient's keyed intake journal state](../operations/patient.getPatientIntakeOperation.md)
950
952
  - [Get the patient sidebar summary](../operations/patient.getPatientSidebarPatientSidebar.md)
951
953
  - [Get a patient photo](../operations/patient.getPhoto.md)
952
954
  - [Get preferred pharmacy](../operations/patient.getPreferredPharmacy.md)
@@ -981,7 +983,9 @@ Generated call examples use exact public surface signatures. Workflow examples r
981
983
  - [Search the knowledge base](../operations/patient.searchKnowledge.md)
982
984
  - [Set preferred pharmacy](../operations/patient.setPreferredPharmacy.md)
983
985
  - [Submit current symptoms](../operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md)
986
+ - [Execute or replay one keyed agent encounter operation](../operations/patient.submitPatientEncounterOperation.md)
984
987
  - [Submit patient-reported health record intake](../operations/patient.submitPatientIntake.md)
988
+ - [Execute or replay one keyed agent intake operation](../operations/patient.submitPatientIntakeOperation.md)
985
989
  - [Submit a raw X12 270 eligibility request](../operations/patient.submitPatientRawX12Eligibility.md)
986
990
  - [Write raw conversation/summary text onto an encounter's FHIR notes and, when Athena-linked, Athena's Reason for Visit/Screening/HPI sections](../operations/patient.submitSummary.md)
987
991
  - [Update home address](../operations/patient.updateAddress.md)
package/docs/index.md CHANGED
@@ -601,7 +601,7 @@ This directory is generated from the shared structured docs data. Do not edit ge
601
601
  - [Request compendiums (Quest)](operations/connectors.questRequestCompendiums.md) (`connectors.questRequestCompendiums`)
602
602
  - [Request compendiums on demand (Quest)](operations/connectors.questRequestCompendiumsOnDemand.md) (`connectors.questRequestCompendiumsOnDemand`)
603
603
  - [Retrieve a compendium zip and return {filename: base64_content}](operations/connectors.questRetrieveAndExtractCompendium.md) (`connectors.questRetrieveAndExtractCompendium`)
604
- - [Retrieve a compendium zip and return as a Base64-encoded dict](operations/connectors.questRetrieveCompendium.md) (`connectors.questRetrieveCompendium`)
604
+ - [Retrieve a compendium zip as Base64, or as a short-lived download URL](operations/connectors.questRetrieveCompendium.md) (`connectors.questRetrieveCompendium`)
605
605
  - [Submit full order (Quest)](operations/connectors.questSubmitFullOrder.md) (`connectors.questSubmitFullOrder`)
606
606
  - [Submit order (Quest)](operations/connectors.questSubmitOrder.md) (`connectors.questSubmitOrder`)
607
607
  - [Download all available compendium files; ack each one](operations/connectors.questSyncCompendiums.md) (`connectors.questSyncCompendiums`)
@@ -952,9 +952,11 @@ This directory is generated from the shared structured docs data. Do not edit ge
952
952
  - [Get patient dashboard alerts](operations/patient.getPatientAlerts.md) (`patient.getPatientAlerts`)
953
953
  - [Get patient attributes](operations/patient.getPatientAttributes.md) (`patient.getPatientAttributes`)
954
954
  - [Get the patient dashboard summary](operations/patient.getPatientDashboard.md) (`patient.getPatientDashboard`)
955
+ - [Read the logged-in patient's keyed encounter journal state](operations/patient.getPatientEncounterOperation.md) (`patient.getPatientEncounterOperation`)
955
956
  - [Get patient flags](operations/patient.getPatientFlags.md) (`patient.getPatientFlags`)
956
957
  - [Look up a keyed patient flag receipt](operations/patient.getPatientFlagsOperation.md) (`patient.getPatientFlagsOperation`)
957
958
  - [Get own patient intake submission and delivery status](operations/patient.getPatientIntake.md) (`patient.getPatientIntake`)
959
+ - [Read the logged-in patient's keyed intake journal state](operations/patient.getPatientIntakeOperation.md) (`patient.getPatientIntakeOperation`)
958
960
  - [Get the patient sidebar summary](operations/patient.getPatientSidebarPatientSidebar.md) (`patient.getPatientSidebarPatientSidebar`)
959
961
  - [Get a patient photo](operations/patient.getPhoto.md) (`patient.getPhoto`)
960
962
  - [Get preferred pharmacy](operations/patient.getPreferredPharmacy.md) (`patient.getPreferredPharmacy`)
@@ -989,7 +991,9 @@ This directory is generated from the shared structured docs data. Do not edit ge
989
991
  - [Search the knowledge base](operations/patient.searchKnowledge.md) (`patient.searchKnowledge`)
990
992
  - [Set preferred pharmacy](operations/patient.setPreferredPharmacy.md) (`patient.setPreferredPharmacy`)
991
993
  - [Submit current symptoms](operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md) (`patient.submitCurrentSymptomsScreeningsCurrentSymptoms`)
994
+ - [Execute or replay one keyed agent encounter operation](operations/patient.submitPatientEncounterOperation.md) (`patient.submitPatientEncounterOperation`)
992
995
  - [Submit patient-reported health record intake](operations/patient.submitPatientIntake.md) (`patient.submitPatientIntake`)
996
+ - [Execute or replay one keyed agent intake operation](operations/patient.submitPatientIntakeOperation.md) (`patient.submitPatientIntakeOperation`)
993
997
  - [Submit a raw X12 270 eligibility request](operations/patient.submitPatientRawX12Eligibility.md) (`patient.submitPatientRawX12Eligibility`)
994
998
  - [Write raw conversation/summary text onto an encounter's FHIR notes and, when Athena-linked, Athena's Reason for Visit/Screening/HPI sections](operations/patient.submitSummary.md) (`patient.submitSummary`)
995
999
  - [Update home address](operations/patient.updateAddress.md) (`patient.updateAddress`)
@@ -0,0 +1,15 @@
1
+ # CatalogItemKind
2
+
3
+ Model ID: `CatalogItemKind`
4
+
5
+ No description.
6
+
7
+ Type: `string`
8
+
9
+ ## Fields
10
+
11
+ No fields.
12
+
13
+ ## Example
14
+
15
+ None declared in canonical OpenAPI.
@@ -0,0 +1,15 @@
1
+ # CatalogVendor
2
+
3
+ Model ID: `CatalogVendor`
4
+
5
+ No description.
6
+
7
+ Type: `string`
8
+
9
+ ## Fields
10
+
11
+ No fields.
12
+
13
+ ## Example
14
+
15
+ None declared in canonical OpenAPI.
@@ -0,0 +1,15 @@
1
+ # CollectionModality
2
+
3
+ Model ID: `CollectionModality`
4
+
5
+ Where and by whom the specimen is collected.
6
+
7
+ Type: `string`
8
+
9
+ ## Fields
10
+
11
+ No fields.
12
+
13
+ ## Example
14
+
15
+ None declared in canonical OpenAPI.
@@ -0,0 +1,18 @@
1
+ # EncounterEffect
2
+
3
+ Model ID: `EncounterEffect`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `error_present` | `boolean` | Yes | | | | No | |
14
+ | `status` | `string` | Yes | | 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 | | No | |
15
+
16
+ ## Example
17
+
18
+ None declared in canonical OpenAPI.
@@ -0,0 +1,18 @@
1
+ # EncounterOperationError
2
+
3
+ Model ID: `EncounterOperationError`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `error` | `string` | Yes | | | | No | |
14
+ | `outcome` | [`UnknownEncounterOperation`](./UnknownEncounterOperation.md) | No | | | | Yes | |
15
+
16
+ ## Example
17
+
18
+ None declared in canonical OpenAPI.
@@ -0,0 +1,22 @@
1
+ # EncounterOperationResponse
2
+
3
+ Model ID: `EncounterOperationResponse`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `idempotency_key` | `string` | Yes | | | | No | |
14
+ | `patient_id` | `string` | Yes | | | | No | |
15
+ | `request_hash` | `string` | Yes | | | | No | |
16
+ | `response_body` | [`ObservedEncounterResponse`](./ObservedEncounterResponse.md) | No | | | | Yes | |
17
+ | `response_code` | `integer|null` | No | | | | Yes | |
18
+ | `status` | `string` | Yes | | reserved, dispatching, unknown, recorded | | No | |
19
+
20
+ ## Example
21
+
22
+ None declared in canonical OpenAPI.
@@ -0,0 +1,22 @@
1
+ # EncounterSections
2
+
3
+ Model ID: `EncounterSections`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `assessment` | [`EncounterEffect`](./EncounterEffect.md) | No | | | | Yes | |
14
+ | `hpi` | [`EncounterEffect`](./EncounterEffect.md) | No | | | | Yes | |
15
+ | `overall` | [`EncounterEffect`](./EncounterEffect.md) | Yes | | | | No | |
16
+ | `plan` | [`EncounterEffect`](./EncounterEffect.md) | No | | | | Yes | |
17
+ | `reason_for_visit` | [`EncounterEffect`](./EncounterEffect.md) | No | | | | Yes | |
18
+ | `ros` | [`EncounterEffect`](./EncounterEffect.md) | No | | | | Yes | |
19
+
20
+ ## Example
21
+
22
+ None declared in canonical OpenAPI.