@healthcloudai/hc-sdk 2.8.0 → 2.10.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "docsDataContentDigest": "sha256:b772c7c5bd9d1be5a63cc8c5eb916027da1e012b56ee858728c88b3ffb6f31b0",
2
+ "docsDataContentDigest": "sha256:8862eacd1c7e0798f51dbc7a398e2f12ea901c7a27b945b20a87b87749021a48",
3
3
  "generatedFiles": [
4
4
  "authentication.md",
5
5
  "clients/AnthropicClient.md",
@@ -1278,7 +1278,6 @@
1278
1278
  "models/OpenAIModerateRequest.md",
1279
1279
  "models/OpenAIUpdateAssistantRequest.md",
1280
1280
  "models/OpenAIUpdateAssistantResponse.md",
1281
- "models/OrganizationResource.md",
1282
1281
  "models/OuraBuildAuthorizationUrlRequest.md",
1283
1282
  "models/OuraBuildAuthorizationUrlResponse.md",
1284
1283
  "models/OuraDailyActivity.md",
@@ -1607,6 +1606,7 @@
1607
1606
  "models/SendGridSendResult.md",
1608
1607
  "models/SendGridTemplate.md",
1609
1608
  "models/SetPreferredPharmacyRequest.md",
1609
+ "models/SetPreferredPharmacyResponse.md",
1610
1610
  "models/SexAtBirth.md",
1611
1611
  "models/Slot.md",
1612
1612
  "models/SlotStatus.md",
@@ -0,0 +1,20 @@
1
+ # SetPreferredPharmacyResponse
2
+
3
+ Model ID: `SetPreferredPharmacyResponse`
4
+
5
+ Response for PUT /patients/preferred-pharmacy: the saved FHIR
6
+ Organization resource (passthrough, hence `extra="allow"` rather than
7
+ enumerating every FHIR field) plus the Athena mirror outcome.
8
+
9
+ Type: `object`
10
+
11
+ ## Fields
12
+
13
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
14
+ |---|---|---:|---|---|---|---:|---|
15
+ | `athena_pharmacy_error` | `string|null` | No | | | | Yes | Reason for a 'failed' athena_pharmacy_status, when present. |
16
+ | `athena_pharmacy_status` | `string|null` | No | | | | Yes | Outcome of mirroring this pharmacy into Athena: 'linked', 'failed', 'skipped_no_athena' (tenant not Athena-integrated), or 'skipped_not_linked' (patient has no athena_patient_id). |
17
+
18
+ ## Example
19
+
20
+ None declared in canonical OpenAPI.
@@ -1266,7 +1266,6 @@
1266
1266
  - [OpenAIModerateRequest](OpenAIModerateRequest.md)
1267
1267
  - [OpenAIUpdateAssistantRequest](OpenAIUpdateAssistantRequest.md)
1268
1268
  - [OpenAIUpdateAssistantResponse](OpenAIUpdateAssistantResponse.md)
1269
- - [OrganizationResource](OrganizationResource.md)
1270
1269
  - [OuraBuildAuthorizationUrlRequest](OuraBuildAuthorizationUrlRequest.md)
1271
1270
  - [OuraBuildAuthorizationUrlResponse](OuraBuildAuthorizationUrlResponse.md)
1272
1271
  - [OuraDailyActivity](OuraDailyActivity.md)
@@ -1672,6 +1671,7 @@
1672
1671
  - [SendGridTemplate](SendGridTemplate.md)
1673
1672
  - [session.ConnectResponse](session.ConnectResponse.md)
1674
1673
  - [SetPreferredPharmacyRequest](SetPreferredPharmacyRequest.md)
1674
+ - [SetPreferredPharmacyResponse](SetPreferredPharmacyResponse.md)
1675
1675
  - [SexAtBirth](SexAtBirth.md)
1676
1676
  - [Slot](Slot.md)
1677
1677
  - [SlotStatus](SlotStatus.md)
@@ -11,6 +11,7 @@ Type: `object`
11
11
  | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
12
  |---|---|---:|---|---|---|---:|---|
13
13
  | `access_token` | `string` | Yes | | | | No | Cognito access token (JWT) for subsequent Bearer-authenticated requests. |
14
+ | `athena_patient_id` | `string|null` | No | | | | Yes | Athena Health patient ID, when this tenant is Athena-integrated and the patient was linked at registration. |
14
15
  | `cognito_sub` | `string|null` | No | | | | Yes | Cognito user's stable `sub` claim. |
15
16
  | `expires_in` | `integer` | Yes | | | | No | Access token lifetime in seconds. |
16
17
  | `fhir_patient_id` | `string|null` | No | | | | Yes | FHIR Patient resource ID resolved for this user, when found. |
@@ -56,73 +56,14 @@ Request model: [`CheckInEncounterRequest`](../models/CheckInEncounterRequest.md)
56
56
 
57
57
  | Status | Shape | Content type | Description |
58
58
  |---|---|---|---|
59
- | `200` | [`patient.Encounter`](../models/patient.Encounter.md) | application/json | Encounter checked in and linked to the EHR encounter |
59
+ | `200` | `object` | application/json | Encounter checked in and linked to the EHR encounter, plus athena_patient_id |
60
60
 
61
61
  ## Success response examples
62
62
 
63
63
  ### 200
64
64
 
65
65
  ```json
66
- {
67
- "appointment_id": "string",
68
- "athena_appointment_id": "string",
69
- "athena_encounter_id": "string",
70
- "created_by": "self",
71
- "created_date": "2026-01-01T09:00:00Z",
72
- "diagnoses": [
73
- {
74
- "condition_display": "string",
75
- "condition_id": "string",
76
- "rank": 1,
77
- "use_code": "CC"
78
- }
79
- ],
80
- "encounter_class": "AMB",
81
- "encounter_id": "00000000-0000-0000-0000-000000000000",
82
- "fhir_id": "string",
83
- "hospitalization": {
84
- "admit_source_code": "string",
85
- "destination_id": "string",
86
- "discharge_disposition": "home",
87
- "origin_id": "string",
88
- "pre_admission_id": "string",
89
- "re_admission_code": "string"
90
- },
91
- "length_minutes": 0,
92
- "locations": [
93
- {
94
- "location_display": "string",
95
- "location_id": "string",
96
- "period_end": "2026-01-01T09:00:00Z",
97
- "period_start": "2026-01-01T09:00:00Z",
98
- "status": "active"
99
- }
100
- ],
101
- "notes": "string",
102
- "participants": [
103
- {
104
- "participant_type": "PPRF",
105
- "period_end": "2026-01-01T09:00:00Z",
106
- "period_start": "2026-01-01T09:00:00Z",
107
- "practitioner_display": "string",
108
- "practitioner_id": "string"
109
- }
110
- ],
111
- "patient_id": "string",
112
- "period_end": "2026-01-01T09:00:00Z",
113
- "period_start": "2026-01-01T09:00:00Z",
114
- "priority_code": "string",
115
- "priority_display": "string",
116
- "reason_code": "string",
117
- "reason_display": "string",
118
- "service_provider_display": "string",
119
- "service_provider_id": "string",
120
- "service_type_code": "string",
121
- "service_type_display": "string",
122
- "status": "planned",
123
- "type_code": "string",
124
- "type_display": "string"
125
- }
66
+ {}
126
67
  ```
127
68
 
128
69
  ## Common errors
@@ -10,7 +10,7 @@ Create a FHIR QuestionnaireResponse for the given Questionnaire. `patient_id` is
10
10
 
11
11
  Signature: `patient.createQuestionnaireResponse(questionnaireId, request)`
12
12
 
13
- Return type: `Promise<FhirIdResponse>`
13
+ Return type: `Promise<QuestionnaireResponseCreated>`
14
14
 
15
15
  ## Authentication
16
16
 
@@ -62,13 +62,14 @@ Request model: [`patient.LoginRequest`](../models/patient.LoginRequest.md)
62
62
 
63
63
  ```json
64
64
  {
65
- "access_token": "eyJraWQ...example",
66
- "cognito_sub": "11111111-2222-3333-4444-555555555555",
67
- "expires_in": 3600,
68
- "fhir_patient_id": "patient-example-001",
69
- "id_token": "eyJraWQ...example",
70
- "refresh_token": "example-refresh-token",
71
- "telehealth_id": 42,
65
+ "access_token": "string",
66
+ "athena_patient_id": "string",
67
+ "cognito_sub": "string",
68
+ "expires_in": 0,
69
+ "fhir_patient_id": "string",
70
+ "id_token": "string",
71
+ "refresh_token": "string",
72
+ "telehealth_id": 0,
72
73
  "token_type": "Bearer"
73
74
  }
74
75
  ```
@@ -64,7 +64,7 @@ Request model: [`SetPreferredPharmacyRequest`](../models/SetPreferredPharmacyReq
64
64
 
65
65
  | Status | Shape | Content type | Description |
66
66
  |---|---|---|---|
67
- | `200` | [`OrganizationResource`](../models/OrganizationResource.md) | application/json | The saved preferred-pharmacy FHIR Organization resource |
67
+ | `200` | [`SetPreferredPharmacyResponse`](../models/SetPreferredPharmacyResponse.md) | application/json | The saved preferred-pharmacy FHIR Organization resource, plus the Athena mirror outcome |
68
68
 
69
69
  ## Success response examples
70
70
 
@@ -72,9 +72,8 @@ Request model: [`SetPreferredPharmacyRequest`](../models/SetPreferredPharmacyReq
72
72
 
73
73
  ```json
74
74
  {
75
- "id": "6fb47dc2-e877-4a03-9661-934085434983",
76
- "meta": {},
77
- "resourceType": "Organization"
75
+ "athena_pharmacy_error": "string",
76
+ "athena_pharmacy_status": "string"
78
77
  }
79
78
  ```
80
79
 
@@ -70,12 +70,21 @@ Request model: [`patient.UpdatePhoneRequest`](../models/patient.UpdatePhoneReque
70
70
 
71
71
  | Status | Shape | Content type | Description |
72
72
  |---|---|---|---|
73
- | `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Bad request — phone is missing or invalid |
73
+ | `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Bad request — phone is missing, malformed, or not a dialable number |
74
74
  | `401` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Authorization required — missing, invalid, expired, or non-patient Bearer JWT |
75
75
  | `404` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The authenticated patient has no FHIR Patient record |
76
+ | `502` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The SMS provider could not be reached or rejected our credentials. The phone number itself was accepted; this is a server-side fault, so the request may be retried unchanged. |
76
77
 
77
78
  ## Error examples
78
79
 
80
+ ### 400 — Not E.164 format
81
+
82
+ ```json
83
+ {
84
+ "error": "phone: 'abc-def-ghij' is not a valid phone number. Expected E.164 format (e.g. +12065551234)"
85
+ }
86
+ ```
87
+
79
88
  ### 400 — phone is required
80
89
 
81
90
  ```json
@@ -84,6 +93,22 @@ Request model: [`patient.UpdatePhoneRequest`](../models/patient.UpdatePhoneReque
84
93
  }
85
94
  ```
86
95
 
96
+ ### 400 — The number is well-formed but the SMS provider will not deliver to it (e.g. a landline, or an unsubscribed recipient)
97
+
98
+ ```json
99
+ {
100
+ "error": "Twilio error 21614: 'To' number is not a valid mobile number"
101
+ }
102
+ ```
103
+
104
+ ### 400 — Correct length and E.164, but not a dialable US/Canada number
105
+
106
+ ```json
107
+ {
108
+ "error": "phone: '+11234123412' is not a dialable US/Canada number — the area code and exchange code must each start with 2-9 and must not be a service code like 411 (e.g. +12065551234)"
109
+ }
110
+ ```
111
+
87
112
  ### 401 — Missing or invalid access token
88
113
 
89
114
  ```json
@@ -100,6 +125,22 @@ Request model: [`patient.UpdatePhoneRequest`](../models/patient.UpdatePhoneReque
100
125
  }
101
126
  ```
102
127
 
128
+ ### 502 — Our SMS provider credentials are invalid or expired
129
+
130
+ ```json
131
+ {
132
+ "error": "Twilio error 20003: Authentication Error - invalid username"
133
+ }
134
+ ```
135
+
136
+ ### 502 — The SMS provider returned a server error
137
+
138
+ ```json
139
+ {
140
+ "error": "Twilio error: Internal Server Error"
141
+ }
142
+ ```
143
+
103
144
  ## NodeJS / TypeScript implementation
104
145
 
105
146
  ```ts
@@ -72,11 +72,20 @@ Request model: [`person.UpdatePhoneRequest`](../models/person.UpdatePhoneRequest
72
72
 
73
73
  | Status | Shape | Content type | Description |
74
74
  |---|---|---|---|
75
- | `400` | [`person.ErrorResponse`](../models/person.ErrorResponse.md) | application/json | phone was not supplied, or the update/OTP dispatch failed |
75
+ | `400` | [`person.ErrorResponse`](../models/person.ErrorResponse.md) | application/json | phone was not supplied, is not a dialable number, or the update/OTP dispatch was rejected because of it |
76
76
  | `401` | [`person.ErrorResponse`](../models/person.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
77
+ | `502` | [`person.ErrorResponse`](../models/person.ErrorResponse.md) | application/json | The SMS provider could not be reached or rejected our credentials. The phone number itself was accepted; this is a server-side fault, so the request may be retried unchanged. |
77
78
 
78
79
  ## Error examples
79
80
 
81
+ ### 400 — Not E.164 format
82
+
83
+ ```json
84
+ {
85
+ "error": "phone: 'abc-def-ghij' is not a valid phone number. Expected E.164 format (e.g. +12065551234)"
86
+ }
87
+ ```
88
+
80
89
  ### 400 — Required field is missing
81
90
 
82
91
  ```json
@@ -85,6 +94,22 @@ Request model: [`person.UpdatePhoneRequest`](../models/person.UpdatePhoneRequest
85
94
  }
86
95
  ```
87
96
 
97
+ ### 400 — The number is well-formed but the SMS provider will not deliver to it
98
+
99
+ ```json
100
+ {
101
+ "error": "Twilio error 21614: 'To' number is not a valid mobile number"
102
+ }
103
+ ```
104
+
105
+ ### 400 — Correct length and E.164, but not a dialable US/Canada number
106
+
107
+ ```json
108
+ {
109
+ "error": "phone: '+11234123412' is not a dialable US/Canada number — the area code and exchange code must each start with 2-9 and must not be a service code like 411 (e.g. +12065551234)"
110
+ }
111
+ ```
112
+
88
113
  ### 401 — Missing or invalid access token
89
114
 
90
115
  ```json
@@ -93,6 +118,22 @@ Request model: [`person.UpdatePhoneRequest`](../models/person.UpdatePhoneRequest
93
118
  }
94
119
  ```
95
120
 
121
+ ### 502 — Our SMS provider credentials are invalid or expired
122
+
123
+ ```json
124
+ {
125
+ "error": "Twilio error 20003: Authentication Error - invalid username"
126
+ }
127
+ ```
128
+
129
+ ### 502 — The SMS provider returned a server error
130
+
131
+ ```json
132
+ {
133
+ "error": "Twilio error: Internal Server Error"
134
+ }
135
+ ```
136
+
96
137
  ## NodeJS / TypeScript implementation
97
138
 
98
139
  ```ts
@@ -72,11 +72,20 @@ Request model: [`provider.UpdatePhoneRequest`](../models/provider.UpdatePhoneReq
72
72
 
73
73
  | Status | Shape | Content type | Description |
74
74
  |---|---|---|---|
75
- | `400` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | phone was not supplied, or the update/OTP dispatch failed |
75
+ | `400` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | phone was not supplied, is not a dialable number, or the update/OTP dispatch was rejected because of it |
76
76
  | `401` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
77
+ | `502` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | The SMS provider could not be reached or rejected our credentials. The phone number itself was accepted; this is a server-side fault, so the request may be retried unchanged. |
77
78
 
78
79
  ## Error examples
79
80
 
81
+ ### 400 — Not E.164 format
82
+
83
+ ```json
84
+ {
85
+ "error": "phone: 'abc-def-ghij' is not a valid phone number. Expected E.164 format (e.g. +12065551234)"
86
+ }
87
+ ```
88
+
80
89
  ### 400 — Required field is missing
81
90
 
82
91
  ```json
@@ -85,6 +94,22 @@ Request model: [`provider.UpdatePhoneRequest`](../models/provider.UpdatePhoneReq
85
94
  }
86
95
  ```
87
96
 
97
+ ### 400 — The number is well-formed but the SMS provider will not deliver to it
98
+
99
+ ```json
100
+ {
101
+ "error": "Twilio error 21614: 'To' number is not a valid mobile number"
102
+ }
103
+ ```
104
+
105
+ ### 400 — Correct length and E.164, but not a dialable US/Canada number
106
+
107
+ ```json
108
+ {
109
+ "error": "phone: '+11234123412' is not a dialable US/Canada number — the area code and exchange code must each start with 2-9 and must not be a service code like 411 (e.g. +12065551234)"
110
+ }
111
+ ```
112
+
88
113
  ### 401 — Missing or invalid access token
89
114
 
90
115
  ```json
@@ -93,6 +118,22 @@ Request model: [`provider.UpdatePhoneRequest`](../models/provider.UpdatePhoneReq
93
118
  }
94
119
  ```
95
120
 
121
+ ### 502 — Our SMS provider credentials are invalid or expired
122
+
123
+ ```json
124
+ {
125
+ "error": "Twilio error 20003: Authentication Error - invalid username"
126
+ }
127
+ ```
128
+
129
+ ### 502 — The SMS provider returned a server error
130
+
131
+ ```json
132
+ {
133
+ "error": "Twilio error: Internal Server Error"
134
+ }
135
+ ```
136
+
96
137
  ## NodeJS / TypeScript implementation
97
138
 
98
139
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthcloudai/hc-sdk",
3
- "version": "2.8.0",
3
+ "version": "2.10.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",
@@ -1,19 +0,0 @@
1
- # OrganizationResource
2
-
3
- Model ID: `OrganizationResource`
4
-
5
- A FHIR R4 Organization resource exactly as the FHIR server returned it. HealthCloud stores and echoes the resource without reshaping it, so the remaining fields are those the FHIR specification defines for this resource type.
6
-
7
- Type: `object`
8
-
9
- ## Fields
10
-
11
- | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
- |---|---|---:|---|---|---|---:|---|
13
- | `id` | `string` | No | | | | No | Server-assigned logical id. |
14
- | `meta` | `object` | No | | | | No | FHIR resource metadata (versionId, lastUpdated). |
15
- | `resourceType` | `string` | Yes | | | | No | |
16
-
17
- ## Example
18
-
19
- None declared in canonical OpenAPI.