@healthcloudai/hc-sdk 3.22.0 → 3.23.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 +46 -0
- package/dist/index.d.cts +211 -2
- package/dist/index.d.ts +211 -2
- package/dist/index.js +46 -0
- package/docs/clients/PatientClient.md +1 -0
- package/docs/docs-manifest.json +5 -3
- package/docs/examples/index.md +1 -0
- package/docs/index.md +1 -0
- package/docs/models/EncounterClinicalState.md +31 -0
- package/docs/models/index.md +1 -0
- package/docs/operations/patient.getPatientEncounterClinicalState.md +170 -0
- 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", {});
|