@healthcloudai/hc-sdk 3.7.0 → 3.8.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 (30) hide show
  1. package/dist/index.cjs +44 -0
  2. package/dist/index.d.cts +792 -403
  3. package/dist/index.d.ts +792 -403
  4. package/dist/index.js +44 -0
  5. package/docs/clients/ProviderClient.md +7 -0
  6. package/docs/docs-manifest.json +23 -3
  7. package/docs/examples/index.md +7 -0
  8. package/docs/index.md +7 -0
  9. package/docs/models/ProviderAppointment.md +24 -0
  10. package/docs/models/ProviderAppointmentResponse.md +17 -0
  11. package/docs/models/ProviderAppointmentsResponse.md +18 -0
  12. package/docs/models/ProviderEncounterListResponse.md +18 -0
  13. package/docs/models/ProviderEncounterResponse.md +17 -0
  14. package/docs/models/ProviderPatientAddress.md +22 -0
  15. package/docs/models/ProviderPatientPhone.md +19 -0
  16. package/docs/models/ProviderPatientRecordResponse.md +24 -0
  17. package/docs/models/ProviderPatientSummary.md +27 -0
  18. package/docs/models/UpdateEncounterClinicalNoteRequest.md +24 -0
  19. package/docs/models/UpdateEncounterClinicalNoteResponse.md +19 -0
  20. package/docs/models/UpdateEncounterStatusRequest.md +21 -0
  21. package/docs/models/UpdateEncounterStatusResponse.md +19 -0
  22. package/docs/models/index.md +13 -0
  23. package/docs/operations/provider.getAppointment.md +148 -0
  24. package/docs/operations/provider.getEncounter.md +120 -0
  25. package/docs/operations/provider.getPatientRecord.md +122 -0
  26. package/docs/operations/provider.listAppointments.md +176 -0
  27. package/docs/operations/provider.listEncounters.md +123 -0
  28. package/docs/operations/provider.updateEncounterClinicalNote.md +154 -0
  29. package/docs/operations/provider.updateEncounterStatus.md +152 -0
  30. package/package.json +1 -1
@@ -0,0 +1,152 @@
1
+ # Update encounter status
2
+
3
+ Operation ID: `provider.updateEncounterStatus`
4
+
5
+ Update a tenant-scoped FHIR encounter status. When the encounter is linked to Athena, the backend writes the practice's flow-board patient status before FHIR, using a fixed HealthCloud->Athena mapping (arrived -> ready for staff, triaged -> ready for provider, in-progress -> with provider, finished -> checked out). HealthCloud statuses without a flow-board equivalent (planned, onleave, cancelled, entered-in-error, unknown) skip the Athena mirror and update FHIR only, returning ehr_status='skipped'. Closing (finished) also stamps period.end and the recorded visit length; starting (in-progress) stamps period.start when missing. Provider clients never submit Athena IDs.
6
+
7
+ ## Public method
8
+
9
+ `updateEncounterStatus`
10
+
11
+ Signature: `provider.updateEncounterStatus(encounterId, request)`
12
+
13
+ Return type: `Promise<UpdateEncounterStatusResponse>`
14
+
15
+ ## Authentication
16
+
17
+ Classification: **AUTHENTICATED**
18
+
19
+ Schemes: `bearerAuth`
20
+
21
+ ## Prerequisites
22
+
23
+ None documented.
24
+
25
+ ## HTTP
26
+
27
+ `PATCH /encounters/{encounter_id}/status`
28
+
29
+ ## Path parameters
30
+
31
+ | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
32
+ |---|---|---:|---|---|---|---:|---|
33
+ | `encounter_id` | `string` | Yes | | | | No | |
34
+
35
+ ## Query parameters
36
+
37
+ None.
38
+
39
+ ## Body parameters
40
+
41
+ | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
42
+ |---|---|---:|---|---|---|---:|---|
43
+ | `body` | [`UpdateEncounterStatusRequest`](../models/UpdateEncounterStatusRequest.md) | No | | | | Yes | |
44
+
45
+ Request model: [`UpdateEncounterStatusRequest`](../models/UpdateEncounterStatusRequest.md)
46
+
47
+ ## Request example
48
+
49
+ ```json
50
+ {
51
+ "status": "arrived"
52
+ }
53
+ ```
54
+
55
+ ## Success responses
56
+
57
+ | Status | Shape | Content type | Description |
58
+ |---|---|---|---|
59
+ | `200` | [`UpdateEncounterStatusResponse`](../models/UpdateEncounterStatusResponse.md) | application/json | FHIR and linked EHR encounter status updated |
60
+
61
+ ## Success response examples
62
+
63
+ ### 200
64
+
65
+ ```json
66
+ {
67
+ "ehr_status": "updated",
68
+ "encounter": {},
69
+ "fhir_status": "updated"
70
+ }
71
+ ```
72
+
73
+ ## Common errors
74
+
75
+ | Status | Shape | Content type | Description |
76
+ |---|---|---|---|
77
+ | `400` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | The HealthCloud status is invalid |
78
+ | `401` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Provider Bearer authentication is required |
79
+ | `409` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | The encounter is linked but no EHR integration is configured |
80
+ | `502` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | The EHR or FHIR update failed after request validation |
81
+
82
+ ## Error examples
83
+
84
+ ### 400 — Invalid status
85
+
86
+ ```json
87
+ {
88
+ "error": "status must be a valid HealthCloud encounter status"
89
+ }
90
+ ```
91
+
92
+ ### 401 — No provider JWT
93
+
94
+ ```json
95
+ {
96
+ "error": "Provider authorization required"
97
+ }
98
+ ```
99
+
100
+ ### 409 — Linked EHR unavailable
101
+
102
+ ```json
103
+ {
104
+ "error": "Encounter is linked to an EHR but no EHR integration is configured"
105
+ }
106
+ ```
107
+
108
+ ### 502 — EHR update failure
109
+
110
+ ```json
111
+ {
112
+ "error": "EHR update failed"
113
+ }
114
+ ```
115
+
116
+ ## NodeJS / TypeScript implementation
117
+
118
+ ```ts
119
+ import { HCSDK } from "@healthcloudai/hc-sdk";
120
+ ```
121
+
122
+ ```ts
123
+ const encounterId = "<ENCOUNTER_ID>";
124
+
125
+ const request = {
126
+ "status": "arrived"
127
+ };
128
+
129
+ const result = await provider.updateEncounterStatus(encounterId, request);
130
+ ```
131
+
132
+ ## cURL
133
+
134
+ ```bash
135
+ curl -X PATCH \
136
+ -H 'Authorization: Bearer <ACCESS_TOKEN>' \
137
+ -H 'Content-Type: application/json' \
138
+ -d '{"status":"arrived"}' \
139
+ 'https://dev-api-provider.health.cloud/encounters/%3CENCOUNTER_ID%3E/status'
140
+ ```
141
+
142
+ ## Notes
143
+
144
+ None.
145
+
146
+ ## Prepared Test Console scenario
147
+
148
+ No canonical scenario is currently associated.
149
+
150
+ ## Real response
151
+
152
+ 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.7.0",
3
+ "version": "3.8.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",