@healthcloudai/hc-sdk 3.22.0 → 3.24.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 (36) hide show
  1. package/dist/index.cjs +77 -0
  2. package/dist/index.d.cts +1312 -4
  3. package/dist/index.d.ts +1312 -4
  4. package/dist/index.js +77 -0
  5. package/docs/clients/PatientClient.md +1 -0
  6. package/docs/clients/ProviderClient.md +7 -0
  7. package/docs/docs-manifest.json +28 -3
  8. package/docs/examples/index.md +8 -0
  9. package/docs/index.md +8 -0
  10. package/docs/models/CreateProviderPatientRequest.md +22 -0
  11. package/docs/models/EncounterClinicalState.md +31 -0
  12. package/docs/models/LabOrder.md +35 -0
  13. package/docs/models/LabOrderDiagnosis.md +18 -0
  14. package/docs/models/LabOrderErrorResponse.md +21 -0
  15. package/docs/models/LabOrderItemRequest.md +17 -0
  16. package/docs/models/LabOrderProvider.md +20 -0
  17. package/docs/models/LabOrderRequisitionResponse.md +20 -0
  18. package/docs/models/LabOrderTest.md +19 -0
  19. package/docs/models/LabOrderUnsentItem.md +19 -0
  20. package/docs/models/ListLabOrdersResponse.md +18 -0
  21. package/docs/models/PlaceLabOrderRequest.md +27 -0
  22. package/docs/models/PlaceLabOrderResponse.md +20 -0
  23. package/docs/models/ProviderEncounterStatusCounts.md +21 -0
  24. package/docs/models/ProviderHomeSummaryResponse.md +19 -0
  25. package/docs/models/ProviderPatientListResponse.md +19 -0
  26. package/docs/models/ProviderPatientResponse.md +17 -0
  27. package/docs/models/index.md +17 -0
  28. package/docs/operations/patient.getPatientEncounterClinicalState.md +170 -0
  29. package/docs/operations/provider.createPatient.md +155 -0
  30. package/docs/operations/provider.getHomeSummary.md +115 -0
  31. package/docs/operations/provider.getLabOrder.md +179 -0
  32. package/docs/operations/provider.getLabOrderRequisition.md +148 -0
  33. package/docs/operations/provider.listLabOrders.md +198 -0
  34. package/docs/operations/provider.listPatients.md +154 -0
  35. package/docs/operations/provider.placeLabOrder.md +384 -0
  36. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1010,6 +1010,33 @@ var MCPClient = class extends BaseServiceClient {
1010
1010
  }
1011
1011
  };
1012
1012
 
1013
+ // src/models/openapi-generated/patient/models/EncounterClinicalState.ts
1014
+ function EncounterClinicalStateFromJSON(json) {
1015
+ return EncounterClinicalStateFromJSONTyped(json, false);
1016
+ }
1017
+ function EncounterClinicalStateFromJSONTyped(json, ignoreDiscriminator) {
1018
+ if (json == null) {
1019
+ return json;
1020
+ }
1021
+ return {
1022
+ "clinical_outcome": json["clinical_outcome"] == null ? void 0 : json["clinical_outcome"],
1023
+ "ehr": json["ehr"] == null ? void 0 : json["ehr"],
1024
+ "ehr_notes": json["ehr_notes"] == null ? void 0 : json["ehr_notes"],
1025
+ "encounter_id": json["encounter_id"] === void 0 ? void 0 : json["encounter_id"] === null ? null : json["encounter_id"],
1026
+ "fhir_encounter": json["fhir_encounter"] == null ? void 0 : json["fhir_encounter"],
1027
+ "idempotency_key": json["idempotency_key"],
1028
+ "insurance": json["insurance"] == null ? void 0 : json["insurance"],
1029
+ "journal_status": json["journal_status"],
1030
+ "notes_fhir": json["notes_fhir"] == null ? void 0 : json["notes_fhir"],
1031
+ "patient_id": json["patient_id"],
1032
+ "reason": json["reason"],
1033
+ "request_hash": json["request_hash"],
1034
+ "resource_version": json["resource_version"] === void 0 ? void 0 : json["resource_version"] === null ? null : json["resource_version"],
1035
+ "response_code": json["response_code"] === void 0 ? void 0 : json["response_code"] === null ? null : json["response_code"],
1036
+ "retry_allowed": json["retry_allowed"] == null ? void 0 : json["retry_allowed"]
1037
+ };
1038
+ }
1039
+
1013
1040
  // src/models/openapi-generated/patient/models/EncounterEffect.ts
1014
1041
  function EncounterEffectFromJSON(json) {
1015
1042
  return EncounterEffectFromJSONTyped(json, false);
@@ -1210,6 +1237,20 @@ function encounterOperationResponse(value, key) {
1210
1237
  } else if (code != null || body != null) throw invalid();
1211
1238
  return EncounterOperationResponseFromJSON(value);
1212
1239
  }
1240
+ function encounterClinicalState(value, key) {
1241
+ const invalid = () => new Error("Invalid or mismatched encounter clinical state; no retry authorized");
1242
+ const required = ["idempotency_key", "patient_id", "request_hash", "journal_status", "fhir_encounter", "notes_fhir", "ehr", "insurance", "ehr_notes", "clinical_outcome", "retry_allowed", "reason"];
1243
+ const identifier = (item) => typeof item === "string" && item.length <= 64 && /^[A-Za-z0-9.-]+$/.test(item) && item.trim() === item;
1244
+ if (!record2(value) || required.some((name) => !Object.prototype.hasOwnProperty.call(value, name)) || Object.keys(value).some((name) => ![...required, "response_code", "encounter_id", "resource_version"].includes(name)) || 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.journal_status !== "string" || !["reserved", "dispatching", "unknown", "recorded"].includes(value.journal_status) || typeof value.fhir_encounter !== "string" || !["present", "unknown"].includes(value.fhir_encounter) || typeof value.notes_fhir !== "string" || !["matches", "unknown"].includes(value.notes_fhir) || ["ehr", "insurance", "ehr_notes", "clinical_outcome"].some((name) => value[name] !== "unknown") || value.retry_allowed !== false || typeof value.reason !== "string" || !["journal_unresolved", "no_recorded_encounter", "resource_unavailable", "resource_mismatch", "resource_unversioned", "resource_inactive", "notes_unverified", "notes_match"].includes(value.reason)) throw invalid();
1245
+ const code = value.response_code;
1246
+ if (value.journal_status === "recorded") {
1247
+ if (typeof code !== "number" || !Number.isInteger(code) || code < 100 || code > 599) throw invalid();
1248
+ } else if (code != null) throw invalid();
1249
+ if (value.fhir_encounter === "present") {
1250
+ if (value.journal_status !== "recorded" || !identifier(value.encounter_id) || !identifier(value.resource_version) || value.reason !== (value.notes_fhir === "matches" ? "notes_match" : "notes_unverified")) throw invalid();
1251
+ } else if (value.encounter_id != null || value.resource_version != null || value.notes_fhir !== "unknown" || ["notes_match", "notes_unverified"].includes(value.reason)) throw invalid();
1252
+ return EncounterClinicalStateFromJSON(value);
1253
+ }
1213
1254
 
1214
1255
  // src/models/openapi-generated/patient/models/StediClaimsResponse.ts
1215
1256
  function StediClaimsResponseFromJSON(json) {
@@ -3138,6 +3179,11 @@ var PatientClient = class extends BaseServiceClient {
3138
3179
  const key = intakeOperationKey(idempotencyKey);
3139
3180
  return encounterOperationResponse(await this.send("GET", `/patients/encounter/operations/${key}`), key);
3140
3181
  }
3182
+ /** Read only original-key FHIR facts. Never authorizes clinical completion or retry. */
3183
+ async getPatientEncounterClinicalState(idempotencyKey) {
3184
+ const key = intakeOperationKey(idempotencyKey);
3185
+ return encounterClinicalState(await this.send("GET", `/patients/encounter/operations/${key}/clinical-state`), key);
3186
+ }
3141
3187
  /** GET /patients/attributes - get the authenticated patient's arbitrary JSON attributes. */
3142
3188
  getAttributes() {
3143
3189
  return this.send("GET", "/patients/attributes", {});
@@ -3748,6 +3794,37 @@ var ProviderClient = class extends BaseServiceClient {
3748
3794
  getAppointment(appointmentId) {
3749
3795
  return this.send("GET", "/appointments/{appointment_id}", { pathParams: { appointment_id: appointmentId } });
3750
3796
  }
3797
+ /**
3798
+ * List or search the calling practitioner's own patients (GET /patients), one page at a time. Never tenant-wide: only patients assigned to the caller. `q` matches the start of a given or
3799
+ * family name; pass the previous page's `next_page_token` as `page_token` to read on. `page_size` is 1-100 (default 20).
3800
+ */
3801
+ listPatients(filters) {
3802
+ return this.send("GET", "/patients", { query: filters });
3803
+ }
3804
+ /** Create a patient assigned to the calling practitioner (POST /patients). Returns the patient's demographic summary. */
3805
+ createPatient(request) {
3806
+ return this.send("POST", "/patients", { body: request });
3807
+ }
3808
+ /** Counts for the home screen (GET /dashboard/summary): the caller's own patients and encounters by status. */
3809
+ getHomeSummary() {
3810
+ return this.send("GET", "/dashboard/summary", {});
3811
+ }
3812
+ /** Place a real Quest lab order for a patient (POST /patients/{patient_id}/lab-orders). Confirm the tests with the clinician first. */
3813
+ placeLabOrder(patientId, request) {
3814
+ return this.send("POST", "/patients/{patient_id}/lab-orders", { pathParams: { patient_id: patientId }, body: request });
3815
+ }
3816
+ /** List a patient's lab orders (GET /patients/{patient_id}/lab-orders), optionally by `status` (submitting, accepted or rejected). */
3817
+ listLabOrders(patientId, filters) {
3818
+ return this.send("GET", "/patients/{patient_id}/lab-orders", { pathParams: { patient_id: patientId }, query: filters });
3819
+ }
3820
+ /** Get one lab order (GET /patients/{patient_id}/lab-orders/{order_id}). */
3821
+ getLabOrder(patientId, orderId) {
3822
+ return this.send("GET", "/patients/{patient_id}/lab-orders/{order_id}", { pathParams: { patient_id: patientId, order_id: orderId } });
3823
+ }
3824
+ /** Get a lab order's Quest requisition PDF (GET /patients/{patient_id}/lab-orders/{order_id}/requisition). */
3825
+ getLabOrderRequisition(patientId, orderId) {
3826
+ return this.send("GET", "/patients/{patient_id}/lab-orders/{order_id}/requisition", { pathParams: { patient_id: patientId, order_id: orderId } });
3827
+ }
3751
3828
  /** Get a patient's consolidated health record (provider tenant scope). */
3752
3829
  getPatientRecord(patientId) {
3753
3830
  return this.send("GET", "/patients/{patient_id}/record", { pathParams: { patient_id: patientId } });