@healthcloudai/hc-sdk 3.32.0 → 3.33.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
@@ -3909,6 +3909,15 @@ var ProviderClient = class extends BaseServiceClient {
3909
3909
  claimEncounter(encounterId) {
3910
3910
  return this.send("POST", "/encounters/{encounter_id}/claim", { pathParams: { encounter_id: encounterId } });
3911
3911
  }
3912
+ /**
3913
+ * Get or open the encounter for a video visit (POST /appointments/{id}/encounter). Returns the caller's open encounter
3914
+ * for the patient, else the appointment's own encounter (any status; a finished one is read-only), else creates a virtual
3915
+ * in-progress encounter linked to the appointment. `created` says which. The patient is not notified and no linked EHR is
3916
+ * written. Rejects with 403 when the appointment is not the caller's, 404 when it does not exist, 400 for an invalid id.
3917
+ */
3918
+ ensureAppointmentEncounter(appointmentId) {
3919
+ return this.send("POST", "/appointments/{appointment_id}/encounter", { pathParams: { appointment_id: appointmentId } });
3920
+ }
3912
3921
  /**
3913
3922
  * Replace an encounter's diagnoses (PUT /encounters/{id}/diagnoses): add, change or remove. Codes come from
3914
3923
  * searchIcd10; codes left out of the list are removed, and the display text always comes from the ICD-10 data. Only the
@@ -9,6 +9,7 @@
9
9
  - [`createPracticeInvite`](../operations/provider.createPracticeInvite.md) — Invite a patient to the practice
10
10
  - [`createPractitionerLocation`](../operations/provider.createPractitionerLocation.md) — Add a practice location
11
11
  - [`deletePractitionerLocation`](../operations/provider.deletePractitionerLocation.md) — Remove a practice location
12
+ - [`ensureAppointmentEncounter`](../operations/provider.ensureAppointmentEncounter.md) — Get or open the encounter for an appointment's video visit
12
13
  - [`getAppointment`](../operations/provider.getAppointment.md) — Get one appointment with patient demographics
13
14
  - [`getEncounter`](../operations/provider.getEncounter.md) — Get one of the caller's encounters with patient demographics
14
15
  - [`getEncounterCarePlan`](../operations/provider.getEncounterCarePlan.md) — Get an encounter's care plan
@@ -1,5 +1,5 @@
1
1
  {
2
- "docsDataContentDigest": "sha256:aa67a0a94c821a16019fca2516a039dbba4c7ee22814728e12db3d1fc0ae45f0",
2
+ "docsDataContentDigest": "sha256:8d802eaebddccf29de88e6f8680a7c49682c4199e281ff6840bed0fd6ca4e59b",
3
3
  "generatedFiles": [
4
4
  "authentication.md",
5
5
  "clients/AmsClient.md",
@@ -611,6 +611,7 @@
611
611
  "models/EncounterOperationResponse.md",
612
612
  "models/EncounterSections.md",
613
613
  "models/EncounterStatus.md",
614
+ "models/EnsureAppointmentEncounterResponse.md",
614
615
  "models/Ethnicity.md",
615
616
  "models/ExerciseFrequency.md",
616
617
  "models/FaceMatchRequest.md",
@@ -3321,6 +3322,7 @@
3321
3322
  "operations/provider.createPracticeInvite.md",
3322
3323
  "operations/provider.createPractitionerLocation.md",
3323
3324
  "operations/provider.deletePractitionerLocation.md",
3325
+ "operations/provider.ensureAppointmentEncounter.md",
3324
3326
  "operations/provider.getAppointment.md",
3325
3327
  "operations/provider.getEncounter.md",
3326
3328
  "operations/provider.getEncounterCarePlan.md",
@@ -3384,7 +3386,7 @@
3384
3386
  "operations/vitals.recordVitals.md"
3385
3387
  ],
3386
3388
  "language": "nodejs",
3387
- "modelCount": 2231,
3388
- "operationCount": 1096,
3389
+ "modelCount": 2232,
3390
+ "operationCount": 1097,
3389
3391
  "schemaVersion": 1
3390
3392
  }
@@ -1037,6 +1037,7 @@ Generated call examples use exact public surface signatures. Workflow examples r
1037
1037
  - [Invite a patient to the practice](../operations/provider.createPracticeInvite.md)
1038
1038
  - [Add a practice location](../operations/provider.createPractitionerLocation.md)
1039
1039
  - [Remove a practice location](../operations/provider.deletePractitionerLocation.md)
1040
+ - [Get or open the encounter for an appointment's video visit](../operations/provider.ensureAppointmentEncounter.md)
1040
1041
  - [Get one appointment with patient demographics](../operations/provider.getAppointment.md)
1041
1042
  - [Get one of the caller's encounters with patient demographics](../operations/provider.getEncounter.md)
1042
1043
  - [Get an encounter's care plan](../operations/provider.getEncounterCarePlan.md)
package/docs/index.md CHANGED
@@ -1045,6 +1045,7 @@ This directory is generated from the shared structured docs data. Do not edit ge
1045
1045
  - [Invite a patient to the practice](operations/provider.createPracticeInvite.md) (`provider.createPracticeInvite`)
1046
1046
  - [Add a practice location](operations/provider.createPractitionerLocation.md) (`provider.createPractitionerLocation`)
1047
1047
  - [Remove a practice location](operations/provider.deletePractitionerLocation.md) (`provider.deletePractitionerLocation`)
1048
+ - [Get or open the encounter for an appointment's video visit](operations/provider.ensureAppointmentEncounter.md) (`provider.ensureAppointmentEncounter`)
1048
1049
  - [Get one appointment with patient demographics](operations/provider.getAppointment.md) (`provider.getAppointment`)
1049
1050
  - [Get one of the caller's encounters with patient demographics](operations/provider.getEncounter.md) (`provider.getEncounter`)
1050
1051
  - [Get an encounter's care plan](operations/provider.getEncounterCarePlan.md) (`provider.getEncounterCarePlan`)
@@ -0,0 +1,20 @@
1
+ # EnsureAppointmentEncounterResponse
2
+
3
+ Model ID: `EnsureAppointmentEncounterResponse`
4
+
5
+ The encounter that belongs to a video visit on an appointment.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `created` | `boolean` | Yes | | | | No | True when this call created the encounter; false when it already existed. |
14
+ | `encounter_id` | `string` | Yes | | | | No | FHIR id of the encounter to open under the video call. |
15
+ | `patient_id` | `string` | Yes | | | | No | FHIR Patient id of the encounter's subject. |
16
+ | `status` | `string` | Yes | | | | No | Encounter status: planned, arrived, triaged, in-progress, onleave, finished, cancelled, entered-in-error or unknown. A finished (signed) encounter is read-only. |
17
+
18
+ ## Example
19
+
20
+ None declared in canonical OpenAPI.
@@ -589,6 +589,7 @@
589
589
  - [EncounterOperationResponse](EncounterOperationResponse.md)
590
590
  - [EncounterSections](EncounterSections.md)
591
591
  - [EncounterStatus](EncounterStatus.md)
592
+ - [EnsureAppointmentEncounterResponse](EnsureAppointmentEncounterResponse.md)
592
593
  - [Ethnicity](Ethnicity.md)
593
594
  - [ExerciseFrequency](ExerciseFrequency.md)
594
595
  - [FaceMatchRequest](FaceMatchRequest.md)
@@ -0,0 +1,150 @@
1
+ # Get or open the encounter for an appointment's video visit
2
+
3
+ Operation ID: `provider.ensureAppointmentEncounter`
4
+
5
+ Returns the encounter to open under the video call for this appointment, creating it when there is none. Idempotent: the caller's open encounter for the patient is returned first, then the appointment's own encounter (`enc-appt-<appointment id>`, in any status; a signed one is read-only), and only then a new virtual (VR) encounter is created in-progress with the caller as primary performer, linked to the appointment. `created` says which. Allowed when the appointment is booked with the caller or its patient is on the caller's patient list (403 otherwise). The patient is not notified and no linked EHR is written.
6
+
7
+ ## Public method
8
+
9
+ `ensureAppointmentEncounter`
10
+
11
+ Signature: `provider.ensureAppointmentEncounter(appointmentId)`
12
+
13
+ Return type: `Promise<EnsureAppointmentEncounterResponse>`
14
+
15
+ ## Authentication
16
+
17
+ Classification: **AUTHENTICATED**
18
+
19
+ Schemes: `bearerAuth`
20
+
21
+ ## Prerequisites
22
+
23
+ None documented.
24
+
25
+ ## HTTP
26
+
27
+ `POST /appointments/{appointment_id}/encounter`
28
+
29
+ ## Path parameters
30
+
31
+ | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
32
+ |---|---|---:|---|---|---|---:|---|
33
+ | `appointment_id` | `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` | [`EnsureAppointmentEncounterResponse`](../models/EnsureAppointmentEncounterResponse.md) | application/json | The appointment's encounter (existing or just created; see `created`) |
54
+
55
+ ## Success response examples
56
+
57
+ ### 200
58
+
59
+ ```json
60
+ {
61
+ "created": true,
62
+ "encounter_id": "string",
63
+ "patient_id": "string",
64
+ "status": "string"
65
+ }
66
+ ```
67
+
68
+ ## Common errors
69
+
70
+ | Status | Shape | Content type | Description |
71
+ |---|---|---|---|
72
+ | `400` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Invalid appointment id |
73
+ | `401` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Provider authorization required |
74
+ | `403` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Role cannot work patients, or the appointment is not the caller's |
75
+ | `404` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Appointment not found |
76
+ | `409` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | The encounter changed while being opened; retry |
77
+
78
+ ## Error examples
79
+
80
+ ### 400
81
+
82
+ ```json
83
+ {
84
+ "error": "string"
85
+ }
86
+ ```
87
+
88
+ ### 401
89
+
90
+ ```json
91
+ {
92
+ "error": "string"
93
+ }
94
+ ```
95
+
96
+ ### 403
97
+
98
+ ```json
99
+ {
100
+ "error": "string"
101
+ }
102
+ ```
103
+
104
+ ### 404
105
+
106
+ ```json
107
+ {
108
+ "error": "string"
109
+ }
110
+ ```
111
+
112
+ ### 409
113
+
114
+ ```json
115
+ {
116
+ "error": "string"
117
+ }
118
+ ```
119
+
120
+ ## NodeJS / TypeScript implementation
121
+
122
+ ```ts
123
+ import { HCSDK } from "@healthcloudai/hc-sdk";
124
+ ```
125
+
126
+ ```ts
127
+ const appointmentId = "<APPOINTMENT_ID>";
128
+
129
+ const result = await provider.ensureAppointmentEncounter(appointmentId);
130
+ ```
131
+
132
+ ## cURL
133
+
134
+ ```bash
135
+ curl -X POST \
136
+ -H 'Authorization: Bearer <ACCESS_TOKEN>' \
137
+ 'https://dev-api-provider.health.cloud/appointments/%3CAPPOINTMENT_ID%3E/encounter'
138
+ ```
139
+
140
+ ## Notes
141
+
142
+ None.
143
+
144
+ ## Prepared Test Console scenario
145
+
146
+ No canonical scenario is currently associated.
147
+
148
+ ## Real response
149
+
150
+ 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.32.0",
3
+ "version": "3.33.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",