@healthcloudai/hc-sdk 2.7.0 → 2.9.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 (68) hide show
  1. package/dist/index.cjs +70 -0
  2. package/dist/index.d.cts +168 -2
  3. package/dist/index.d.ts +168 -2
  4. package/dist/index.js +70 -0
  5. package/docs/clients/PatientClient.md +3 -0
  6. package/docs/docs-manifest.json +11 -6
  7. package/docs/examples/index.md +3 -0
  8. package/docs/index.md +3 -0
  9. package/docs/models/AddInsuranceRequest.md +1 -0
  10. package/docs/models/AddInsuranceResponse.md +2 -0
  11. package/docs/models/Appointment.md +1 -0
  12. package/docs/models/AthenaAppointment.md +1 -0
  13. package/docs/models/BookAppointmentRequest.md +1 -0
  14. package/docs/models/CheckEncounterRequest.md +17 -0
  15. package/docs/models/CheckInEncounterRequest.md +17 -0
  16. package/docs/models/GS1LookupResponse.md +3 -2
  17. package/docs/models/GetEncounterResponse.md +3 -0
  18. package/docs/models/GetLatestEncounterResponse.md +17 -0
  19. package/docs/models/GetPatientResponse.md +2 -0
  20. package/docs/models/GetScanUploadUrlRequest.md +3 -2
  21. package/docs/models/GetTestResultResponse.md +20 -0
  22. package/docs/models/PatientDemographics.md +2 -0
  23. package/docs/models/ScanUploadResponse.md +4 -4
  24. package/docs/models/SetPreferredPharmacyResponse.md +20 -0
  25. package/docs/models/Slot.md +1 -0
  26. package/docs/models/fieldagent.Encounter.md +3 -0
  27. package/docs/models/index.md +5 -3
  28. package/docs/models/patient.Encounter.md +3 -0
  29. package/docs/models/patient.LoginResponse.md +1 -0
  30. package/docs/operations/appointments.book.md +18 -15
  31. package/docs/operations/appointments.cancel.md +12 -11
  32. package/docs/operations/appointments.createSlot.md +44 -9
  33. package/docs/operations/appointments.listPatientAppointments.md +13 -12
  34. package/docs/operations/appointments.listSlots.md +9 -8
  35. package/docs/operations/appointments.reschedule.md +11 -10
  36. package/docs/operations/connectors.athenaBookAppointment.md +1 -0
  37. package/docs/operations/connectors.athenaCreateInsurancePackage.md +1 -1
  38. package/docs/operations/connectors.athenaGetAppointmentDetails.md +1 -0
  39. package/docs/operations/connectors.athenaGetBookedAppointments.md +1 -0
  40. package/docs/operations/connectors.athenaGetEncounter.md +1 -0
  41. package/docs/operations/connectors.athenaListAppointments.md +1 -0
  42. package/docs/operations/connectors.athenaListPatientAppointments.md +1 -0
  43. package/docs/operations/diagnostics.getScanUploadUrl.md +7 -5
  44. package/docs/operations/diagnostics.getTestResult.md +5 -23
  45. package/docs/operations/diagnostics.lookupTestByGs1.md +12 -6
  46. package/docs/operations/fieldagent.listEncounters.md +42 -39
  47. package/docs/operations/fieldagent.listPatients.md +60 -95
  48. package/docs/operations/patient.addInsurance.md +14 -10
  49. package/docs/operations/patient.checkEncounter.md +110 -0
  50. package/docs/operations/patient.checkInEncounter.md +114 -0
  51. package/docs/operations/patient.createEncounter.md +40 -37
  52. package/docs/operations/patient.createQuestionnaireResponse.md +1 -1
  53. package/docs/operations/patient.getCheckinCheckin.md +41 -38
  54. package/docs/operations/patient.getCurrentCareSessionCareSessionsCurrent.md +43 -40
  55. package/docs/operations/patient.getEncounter.md +40 -37
  56. package/docs/operations/patient.getLatestEncounter.md +162 -0
  57. package/docs/operations/patient.getPatient.md +57 -92
  58. package/docs/operations/patient.getPatientSidebarPatientSidebar.md +97 -129
  59. package/docs/operations/patient.listEncounters.md +41 -38
  60. package/docs/operations/patient.login.md +8 -7
  61. package/docs/operations/patient.setPreferredPharmacy.md +3 -4
  62. package/docs/operations/patient.updatePhone.md +42 -1
  63. package/docs/operations/person.updatePhone.md +42 -1
  64. package/docs/operations/provider.updatePhone.md +42 -1
  65. package/package.json +1 -1
  66. package/docs/models/OrganizationResource.md +0 -19
  67. package/docs/models/PanelResult.md +0 -24
  68. package/docs/models/SingleTestResultResponse.md +0 -28
@@ -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.7.0",
3
+ "version": "2.9.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.
@@ -1,24 +0,0 @@
1
- # PanelResult
2
-
3
- Model ID: `PanelResult`
4
-
5
- A single panel/analyte result within a (possibly multi-panel) test.
6
-
7
- Type: `object`
8
-
9
- ## Fields
10
-
11
- | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
- |---|---|---:|---|---|---|---:|---|
13
- | `interpretation` | `string|null` | No | | | | Yes | Clinical interpretation flag, optional. |
14
- | `loinc_code` | `string` | Yes | | | | No | LOINC code for this panel/analyte. |
15
- | `loinc_display` | `string` | Yes | | | | No | Display text for loinc_code. |
16
- | `panel_name` | `string` | Yes | | | | No | Name of this panel/analyte. |
17
- | `quantitative_unit` | `string|null` | No | | | | Yes | Unit of measure for quantitative_value, optional. |
18
- | `quantitative_value` | `number|null` | No | | | | Yes | Numeric result value, for quantitative panels. Requires quantitative_unit. |
19
- | `result` | `string` | Yes | | | | No | The result value for this panel. |
20
- | `result_type` | `string` | No | | | `"qualitative"` | No | 'qualitative' or 'quantitative'. Defaults to qualitative. |
21
-
22
- ## Example
23
-
24
- None declared in canonical OpenAPI.
@@ -1,28 +0,0 @@
1
- # SingleTestResultResponse
2
-
3
- Model ID: `SingleTestResultResponse`
4
-
5
- Response for GET /patients/{patient_id}/diagnostics/{test_id}. Supports
6
- both single-panel and multi-panel tests via the panels list.
7
-
8
- Type: `object`
9
-
10
- ## Fields
11
-
12
- | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
13
- |---|---|---:|---|---|---|---:|---|
14
- | `device_name` | `string|null` | No | | | | Yes | CLIA-waived device make/model, optional. |
15
- | `is_multi_panel` | `boolean` | Yes | | | | No | True if this test reports more than one panel/analyte result. |
16
- | `lot_number` | `string|null` | No | | | | Yes | Test kit lot number, optional. |
17
- | `panels` | array of [`PanelResult`](./PanelResult.md) | Yes | | | | No | One or more panel/analyte results for this test. |
18
- | `patient_id` | `string` | Yes | | | | No | FHIR Patient ID this test result belongs to. |
19
- | `performed_by` | `string|null` | No | | | | Yes | Name of the person who performed the test, optional. |
20
- | `performed_datetime` | `string|null` | No | | | | Yes | ISO 8601 datetime the test was performed, optional. |
21
- | `scan_url` | `string|null` | No | | | | Yes | URL of an uploaded scan image, when one was captured via the scan-upload-url flow. |
22
- | `status` | `string` | Yes | | | | No | Observation lifecycle status. |
23
- | `test_id` | `string` | Yes | uuid | | | No | Domain UUID of the test. |
24
- | `test_type` | `string` | Yes | | | | No | Which test kit was used. |
25
-
26
- ## Example
27
-
28
- None declared in canonical OpenAPI.