@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.js CHANGED
@@ -935,6 +935,33 @@ var MCPClient = class extends BaseServiceClient {
935
935
  }
936
936
  };
937
937
 
938
+ // src/models/openapi-generated/patient/models/EncounterClinicalState.ts
939
+ function EncounterClinicalStateFromJSON(json) {
940
+ return EncounterClinicalStateFromJSONTyped(json, false);
941
+ }
942
+ function EncounterClinicalStateFromJSONTyped(json, ignoreDiscriminator) {
943
+ if (json == null) {
944
+ return json;
945
+ }
946
+ return {
947
+ "clinical_outcome": json["clinical_outcome"] == null ? void 0 : json["clinical_outcome"],
948
+ "ehr": json["ehr"] == null ? void 0 : json["ehr"],
949
+ "ehr_notes": json["ehr_notes"] == null ? void 0 : json["ehr_notes"],
950
+ "encounter_id": json["encounter_id"] === void 0 ? void 0 : json["encounter_id"] === null ? null : json["encounter_id"],
951
+ "fhir_encounter": json["fhir_encounter"] == null ? void 0 : json["fhir_encounter"],
952
+ "idempotency_key": json["idempotency_key"],
953
+ "insurance": json["insurance"] == null ? void 0 : json["insurance"],
954
+ "journal_status": json["journal_status"],
955
+ "notes_fhir": json["notes_fhir"] == null ? void 0 : json["notes_fhir"],
956
+ "patient_id": json["patient_id"],
957
+ "reason": json["reason"],
958
+ "request_hash": json["request_hash"],
959
+ "resource_version": json["resource_version"] === void 0 ? void 0 : json["resource_version"] === null ? null : json["resource_version"],
960
+ "response_code": json["response_code"] === void 0 ? void 0 : json["response_code"] === null ? null : json["response_code"],
961
+ "retry_allowed": json["retry_allowed"] == null ? void 0 : json["retry_allowed"]
962
+ };
963
+ }
964
+
938
965
  // src/models/openapi-generated/patient/models/EncounterEffect.ts
939
966
  function EncounterEffectFromJSON(json) {
940
967
  return EncounterEffectFromJSONTyped(json, false);
@@ -1135,6 +1162,20 @@ function encounterOperationResponse(value, key) {
1135
1162
  } else if (code != null || body != null) throw invalid();
1136
1163
  return EncounterOperationResponseFromJSON(value);
1137
1164
  }
1165
+ function encounterClinicalState(value, key) {
1166
+ const invalid = () => new Error("Invalid or mismatched encounter clinical state; no retry authorized");
1167
+ const required = ["idempotency_key", "patient_id", "request_hash", "journal_status", "fhir_encounter", "notes_fhir", "ehr", "insurance", "ehr_notes", "clinical_outcome", "retry_allowed", "reason"];
1168
+ const identifier = (item) => typeof item === "string" && item.length <= 64 && /^[A-Za-z0-9.-]+$/.test(item) && item.trim() === item;
1169
+ 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();
1170
+ const code = value.response_code;
1171
+ if (value.journal_status === "recorded") {
1172
+ if (typeof code !== "number" || !Number.isInteger(code) || code < 100 || code > 599) throw invalid();
1173
+ } else if (code != null) throw invalid();
1174
+ if (value.fhir_encounter === "present") {
1175
+ 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();
1176
+ } else if (value.encounter_id != null || value.resource_version != null || value.notes_fhir !== "unknown" || ["notes_match", "notes_unverified"].includes(value.reason)) throw invalid();
1177
+ return EncounterClinicalStateFromJSON(value);
1178
+ }
1138
1179
 
1139
1180
  // src/models/openapi-generated/patient/models/StediClaimsResponse.ts
1140
1181
  function StediClaimsResponseFromJSON(json) {
@@ -3063,6 +3104,11 @@ var PatientClient = class extends BaseServiceClient {
3063
3104
  const key = intakeOperationKey(idempotencyKey);
3064
3105
  return encounterOperationResponse(await this.send("GET", `/patients/encounter/operations/${key}`), key);
3065
3106
  }
3107
+ /** Read only original-key FHIR facts. Never authorizes clinical completion or retry. */
3108
+ async getPatientEncounterClinicalState(idempotencyKey) {
3109
+ const key = intakeOperationKey(idempotencyKey);
3110
+ return encounterClinicalState(await this.send("GET", `/patients/encounter/operations/${key}/clinical-state`), key);
3111
+ }
3066
3112
  /** GET /patients/attributes - get the authenticated patient's arbitrary JSON attributes. */
3067
3113
  getAttributes() {
3068
3114
  return this.send("GET", "/patients/attributes", {});
@@ -53,6 +53,7 @@
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
+ - [`getPatientEncounterClinicalState`](../operations/patient.getPatientEncounterClinicalState.md) — Read current FHIR facts for the authenticated patient's original encounter key
56
57
  - [`getPatientEncounterOperation`](../operations/patient.getPatientEncounterOperation.md) — Read the logged-in patient's keyed encounter journal state
57
58
  - [`getFlags`](../operations/patient.getPatientFlags.md) — Get patient flags
58
59
  - [`getPatientFlagsOperation`](../operations/patient.getPatientFlagsOperation.md) — Look up a keyed patient flag receipt
@@ -1,5 +1,5 @@
1
1
  {
2
- "docsDataContentDigest": "sha256:c8a94d1de8cfe737a7b080d1ab927b40a83f1215b40ce2acad358c3b4615f257",
2
+ "docsDataContentDigest": "sha256:3cc44dfe6b6c58864456a393ecf73a669aa0cc1a30d87b4cdf8333bc27f77d79",
3
3
  "generatedFiles": [
4
4
  "authentication.md",
5
5
  "clients/AmsClient.md",
@@ -581,6 +581,7 @@
581
581
  "models/ElevenlabsUpdateToolRequest.md",
582
582
  "models/EmergencyContact.md",
583
583
  "models/EncounterClass.md",
584
+ "models/EncounterClinicalState.md",
584
585
  "models/EncounterEffect.md",
585
586
  "models/EncounterOperationError.md",
586
587
  "models/EncounterOperationResponse.md",
@@ -3140,6 +3141,7 @@
3140
3141
  "operations/patient.getPatientAlerts.md",
3141
3142
  "operations/patient.getPatientAttributes.md",
3142
3143
  "operations/patient.getPatientDashboard.md",
3144
+ "operations/patient.getPatientEncounterClinicalState.md",
3143
3145
  "operations/patient.getPatientEncounterOperation.md",
3144
3146
  "operations/patient.getPatientFlags.md",
3145
3147
  "operations/patient.getPatientFlagsOperation.md",
@@ -3254,7 +3256,7 @@
3254
3256
  "operations/vitals.recordVitals.md"
3255
3257
  ],
3256
3258
  "language": "nodejs",
3257
- "modelCount": 2143,
3258
- "operationCount": 1054,
3259
+ "modelCount": 2144,
3260
+ "operationCount": 1055,
3259
3261
  "schemaVersion": 1
3260
3262
  }
@@ -944,6 +944,7 @@ 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 current FHIR facts for the authenticated patient's original encounter key](../operations/patient.getPatientEncounterClinicalState.md)
947
948
  - [Read the logged-in patient's keyed encounter journal state](../operations/patient.getPatientEncounterOperation.md)
948
949
  - [Get patient flags](../operations/patient.getPatientFlags.md)
949
950
  - [Look up a keyed patient flag receipt](../operations/patient.getPatientFlagsOperation.md)
package/docs/index.md CHANGED
@@ -952,6 +952,7 @@ 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 current FHIR facts for the authenticated patient's original encounter key](operations/patient.getPatientEncounterClinicalState.md) (`patient.getPatientEncounterClinicalState`)
955
956
  - [Read the logged-in patient's keyed encounter journal state](operations/patient.getPatientEncounterOperation.md) (`patient.getPatientEncounterOperation`)
956
957
  - [Get patient flags](operations/patient.getPatientFlags.md) (`patient.getPatientFlags`)
957
958
  - [Look up a keyed patient flag receipt](operations/patient.getPatientFlagsOperation.md) (`patient.getPatientFlagsOperation`)
@@ -0,0 +1,31 @@
1
+ # EncounterClinicalState
2
+
3
+ Model ID: `EncounterClinicalState`
4
+
5
+ Current versioned FHIR facts; never proof of causation or all-provider completion.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `clinical_outcome` | `string` | No | | | `"unknown"` | No | |
14
+ | `ehr` | `string` | No | | | `"unknown"` | No | |
15
+ | `ehr_notes` | `string` | No | | | `"unknown"` | No | |
16
+ | `encounter_id` | `string|null` | No | | | | Yes | |
17
+ | `fhir_encounter` | `string` | No | | present, unknown | `"unknown"` | No | |
18
+ | `idempotency_key` | `string` | Yes | | | | No | |
19
+ | `insurance` | `string` | No | | | `"unknown"` | No | |
20
+ | `journal_status` | `string` | Yes | | reserved, dispatching, unknown, recorded | | No | |
21
+ | `notes_fhir` | `string` | No | | matches, unknown | `"unknown"` | No | |
22
+ | `patient_id` | `string` | Yes | | | | No | |
23
+ | `reason` | `string` | Yes | | journal_unresolved, no_recorded_encounter, resource_unavailable, resource_mismatch, resource_unversioned, resource_inactive, notes_unverified, notes_match | | No | |
24
+ | `request_hash` | `string` | Yes | | | | No | |
25
+ | `resource_version` | `string|null` | No | | | | Yes | |
26
+ | `response_code` | `integer|null` | No | | | | Yes | |
27
+ | `retry_allowed` | `boolean` | No | | | `false` | No | |
28
+
29
+ ## Example
30
+
31
+ None declared in canonical OpenAPI.
@@ -559,6 +559,7 @@
559
559
  - [ElevenLabsVoice](ElevenLabsVoice.md)
560
560
  - [EmergencyContact](EmergencyContact.md)
561
561
  - [EncounterClass](EncounterClass.md)
562
+ - [EncounterClinicalState](EncounterClinicalState.md)
562
563
  - [EncounterEffect](EncounterEffect.md)
563
564
  - [EncounterOperationError](EncounterOperationError.md)
564
565
  - [EncounterOperationResponse](EncounterOperationResponse.md)
@@ -0,0 +1,170 @@
1
+ # Read current FHIR facts for the authenticated patient's original encounter key
2
+
3
+ Operation ID: `patient.getPatientEncounterClinicalState`
4
+
5
+ Reads only the recorded original encounter, never searches or writes. Exact reviewed notes are compared by the original hash, with patient ownership and resource version required. Presence/matching notes do not prove causation, vendor completion or permission to retry. All provider effects and overall clinical outcome remain unknown.
6
+
7
+ ## Public method
8
+
9
+ `getPatientEncounterClinicalState`
10
+
11
+ Signature: `patient.getPatientEncounterClinicalState(idempotencyKey)`
12
+
13
+ Return type: `Promise<EncounterClinicalState>`
14
+
15
+ ## Authentication
16
+
17
+ Classification: **AUTHENTICATED**
18
+
19
+ Schemes: `bearerAuth`
20
+
21
+ ## Prerequisites
22
+
23
+ None documented.
24
+
25
+ ## HTTP
26
+
27
+ `GET /patients/encounter/operations/{idempotency_key}/clinical-state`
28
+
29
+ ## Path parameters
30
+
31
+ | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
32
+ |---|---|---:|---|---|---|---:|---|
33
+ | `idempotency_key` | `string` | Yes | | | | No | |
34
+
35
+ ## Query parameters
36
+
37
+ None.
38
+
39
+ ## Body parameters
40
+
41
+ None.
42
+
43
+ Request model: None.
44
+
45
+ ## Request example
46
+
47
+ None declared in canonical OpenAPI.
48
+
49
+ ## Success responses
50
+
51
+ | Status | Shape | Content type | Description |
52
+ |---|---|---|---|
53
+ | `200` | [`EncounterClinicalState`](../models/EncounterClinicalState.md) | application/json | Current scoped FHIR facts; overall clinical outcome and retry remain unresolved |
54
+
55
+ ## Success response examples
56
+
57
+ ### 200
58
+
59
+ ```json
60
+ {
61
+ "clinical_outcome": "unknown",
62
+ "ehr": "unknown",
63
+ "ehr_notes": "unknown",
64
+ "encounter_id": "encounter-example-001",
65
+ "fhir_encounter": "present",
66
+ "idempotency_key": "940be5cc-c1fd-4b38-ae7d-13516f9ac098",
67
+ "insurance": "unknown",
68
+ "journal_status": "recorded",
69
+ "notes_fhir": "matches",
70
+ "patient_id": "patient-example-001",
71
+ "reason": "notes_match",
72
+ "request_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
73
+ "resource_version": "1",
74
+ "response_code": 200,
75
+ "retry_allowed": false
76
+ }
77
+ ```
78
+
79
+ ## Common errors
80
+
81
+ | Status | Shape | Content type | Description |
82
+ |---|---|---|---|
83
+ | `401` | [`EncounterOperationError`](../models/EncounterOperationError.md) | application/json | Patient login required |
84
+ | `403` | [`EncounterOperationError`](../models/EncounterOperationError.md) | application/json | Verified tenant required |
85
+ | `404` | [`EncounterOperationError`](../models/EncounterOperationError.md) | application/json | Patient or operation not found; an in-flight operation may still commit |
86
+ | `409` | [`EncounterOperationError`](../models/EncounterOperationError.md) | application/json | Key already bound to different raw terms |
87
+ | `422` | [`EncounterOperationError`](../models/EncounterOperationError.md) | application/json | Invalid key or encounter terms |
88
+ | `503` | [`EncounterOperationError`](../models/EncounterOperationError.md) | application/json | Coordination or outcome unavailable; look up the original key, never fall back to an unkeyed write |
89
+
90
+ ## Error examples
91
+
92
+ ### 401
93
+
94
+ ```json
95
+ {
96
+ "error": "string"
97
+ }
98
+ ```
99
+
100
+ ### 403
101
+
102
+ ```json
103
+ {
104
+ "error": "string"
105
+ }
106
+ ```
107
+
108
+ ### 404
109
+
110
+ ```json
111
+ {
112
+ "error": "string"
113
+ }
114
+ ```
115
+
116
+ ### 409
117
+
118
+ ```json
119
+ {
120
+ "error": "string"
121
+ }
122
+ ```
123
+
124
+ ### 422
125
+
126
+ ```json
127
+ {
128
+ "error": "string"
129
+ }
130
+ ```
131
+
132
+ ### 503
133
+
134
+ ```json
135
+ {
136
+ "error": "string"
137
+ }
138
+ ```
139
+
140
+ ## NodeJS / TypeScript implementation
141
+
142
+ ```ts
143
+ import { HCSDK } from "@healthcloudai/hc-sdk";
144
+ ```
145
+
146
+ ```ts
147
+ const idempotencyKey = "<IDEMPOTENCY_KEY>";
148
+
149
+ const result = await patient.getPatientEncounterClinicalState(idempotencyKey);
150
+ ```
151
+
152
+ ## cURL
153
+
154
+ ```bash
155
+ curl -X GET \
156
+ -H 'Authorization: Bearer <ACCESS_TOKEN>' \
157
+ 'https://dev-api-patient.health.cloud/patients/encounter/operations/%3CIDEMPOTENCY_KEY%3E/clinical-state'
158
+ ```
159
+
160
+ ## Notes
161
+
162
+ None.
163
+
164
+ ## Prepared Test Console scenario
165
+
166
+ No canonical scenario is currently associated.
167
+
168
+ ## Real response
169
+
170
+ No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthcloudai/hc-sdk",
3
- "version": "3.22.0",
3
+ "version": "3.23.0",
4
4
  "description": "All-in-one HealthCloud SDK with typed platform APIs and secure connector clients.",
5
5
  "author": "Healthcheck Systems Inc",
6
6
  "license": "MIT",