@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
@@ -59,65 +59,68 @@ None declared in canonical OpenAPI.
59
59
  "checked_in": true,
60
60
  "encounters": [
61
61
  {
62
- "appointment_id": "appointment-example-001",
62
+ "appointment_id": "string",
63
+ "athena_appointment_id": "string",
64
+ "athena_encounter_id": "string",
63
65
  "created_by": "self",
64
- "created_date": "2026-08-10T23:36:57Z",
66
+ "created_date": "2026-01-01T09:00:00Z",
65
67
  "diagnoses": [
66
68
  {
67
- "condition_display": "Acute upper respiratory infection",
68
- "condition_id": "condition-example-001",
69
+ "condition_display": "string",
70
+ "condition_id": "string",
69
71
  "rank": 1,
70
- "use_code": "AD"
72
+ "use_code": "CC"
71
73
  }
72
74
  ],
73
75
  "encounter_class": "AMB",
74
- "encounter_id": "167dd34e-1833-4260-a8b1-ea0b38229a1b",
75
- "fhir_id": "6e0d484f-4f8b-4025-b6ef-abedf69f0f91",
76
+ "encounter_id": "00000000-0000-0000-0000-000000000000",
77
+ "fhir_id": "string",
76
78
  "hospitalization": {
77
- "admit_source_code": "physician-referral",
78
- "destination_id": "location-example-002",
79
+ "admit_source_code": "string",
80
+ "destination_id": "string",
79
81
  "discharge_disposition": "home",
80
- "origin_id": "location-example-001",
81
- "pre_admission_id": "encounter-example-prior",
82
- "re_admission_code": "N"
82
+ "origin_id": "string",
83
+ "pre_admission_id": "string",
84
+ "re_admission_code": "string"
83
85
  },
84
- "length_minutes": 30,
86
+ "length_minutes": 0,
85
87
  "locations": [
86
88
  {
87
- "location_display": "Example Clinic, Room 101",
88
- "location_id": "location-example-001",
89
- "period_end": "2026-08-10T10:30:00Z",
90
- "period_start": "2026-08-10T10:00:00Z",
91
- "status": "completed"
89
+ "location_display": "string",
90
+ "location_id": "string",
91
+ "period_end": "2026-01-01T09:00:00Z",
92
+ "period_start": "2026-01-01T09:00:00Z",
93
+ "status": "active"
92
94
  }
93
95
  ],
96
+ "notes": "string",
94
97
  "participants": [
95
98
  {
96
- "participant_type": "ATND",
97
- "period_end": "2026-08-10T10:30:00Z",
98
- "period_start": "2026-08-10T10:00:00Z",
99
- "practitioner_display": "Dr. Alex Smith",
100
- "practitioner_id": "provider-example-001"
99
+ "participant_type": "PPRF",
100
+ "period_end": "2026-01-01T09:00:00Z",
101
+ "period_start": "2026-01-01T09:00:00Z",
102
+ "practitioner_display": "string",
103
+ "practitioner_id": "string"
101
104
  }
102
105
  ],
103
- "patient_id": "patient-example-001",
104
- "period_end": "2026-08-10T10:30:00Z",
105
- "period_start": "2026-08-10T10:00:00Z",
106
- "priority_code": "R",
107
- "priority_display": "Routine",
108
- "reason_code": "386661006",
109
- "reason_display": "Fever",
110
- "service_provider_display": "Example Health Clinic",
111
- "service_provider_id": "organization-example-001",
112
- "service_type_code": "124",
113
- "service_type_display": "General practice",
114
- "status": "finished",
115
- "type_code": "99213",
116
- "type_display": "Office outpatient visit"
106
+ "patient_id": "string",
107
+ "period_end": "2026-01-01T09:00:00Z",
108
+ "period_start": "2026-01-01T09:00:00Z",
109
+ "priority_code": "string",
110
+ "priority_display": "string",
111
+ "reason_code": "string",
112
+ "reason_display": "string",
113
+ "service_provider_display": "string",
114
+ "service_provider_id": "string",
115
+ "service_type_code": "string",
116
+ "service_type_display": "string",
117
+ "status": "planned",
118
+ "type_code": "string",
119
+ "type_display": "string"
117
120
  }
118
121
  ],
119
122
  "ok": true,
120
- "patient_id": "patient-example-001"
123
+ "patient_id": "string"
121
124
  }
122
125
  ```
123
126
 
@@ -56,69 +56,72 @@ None declared in canonical OpenAPI.
56
56
 
57
57
  ```json
58
58
  {
59
- "asOf": "2026-08-10T23:35:51.635813Z",
59
+ "asOf": "string",
60
60
  "careSession": {
61
61
  "encounters": [
62
62
  {
63
- "appointment_id": "appointment-example-001",
63
+ "appointment_id": "string",
64
+ "athena_appointment_id": "string",
65
+ "athena_encounter_id": "string",
64
66
  "created_by": "self",
65
- "created_date": "2026-08-10T23:36:57Z",
67
+ "created_date": "2026-01-01T09:00:00Z",
66
68
  "diagnoses": [
67
69
  {
68
- "condition_display": "Acute upper respiratory infection",
69
- "condition_id": "condition-example-001",
70
+ "condition_display": "string",
71
+ "condition_id": "string",
70
72
  "rank": 1,
71
- "use_code": "AD"
73
+ "use_code": "CC"
72
74
  }
73
75
  ],
74
76
  "encounter_class": "AMB",
75
- "encounter_id": "167dd34e-1833-4260-a8b1-ea0b38229a1b",
76
- "fhir_id": "6e0d484f-4f8b-4025-b6ef-abedf69f0f91",
77
+ "encounter_id": "00000000-0000-0000-0000-000000000000",
78
+ "fhir_id": "string",
77
79
  "hospitalization": {
78
- "admit_source_code": "physician-referral",
79
- "destination_id": "location-example-002",
80
+ "admit_source_code": "string",
81
+ "destination_id": "string",
80
82
  "discharge_disposition": "home",
81
- "origin_id": "location-example-001",
82
- "pre_admission_id": "encounter-example-prior",
83
- "re_admission_code": "N"
83
+ "origin_id": "string",
84
+ "pre_admission_id": "string",
85
+ "re_admission_code": "string"
84
86
  },
85
- "length_minutes": 30,
87
+ "length_minutes": 0,
86
88
  "locations": [
87
89
  {
88
- "location_display": "Example Clinic, Room 101",
89
- "location_id": "location-example-001",
90
- "period_end": "2026-08-10T10:30:00Z",
91
- "period_start": "2026-08-10T10:00:00Z",
92
- "status": "completed"
90
+ "location_display": "string",
91
+ "location_id": "string",
92
+ "period_end": "2026-01-01T09:00:00Z",
93
+ "period_start": "2026-01-01T09:00:00Z",
94
+ "status": "active"
93
95
  }
94
96
  ],
97
+ "notes": "string",
95
98
  "participants": [
96
99
  {
97
- "participant_type": "ATND",
98
- "period_end": "2026-08-10T10:30:00Z",
99
- "period_start": "2026-08-10T10:00:00Z",
100
- "practitioner_display": "Dr. Alex Smith",
101
- "practitioner_id": "provider-example-001"
100
+ "participant_type": "PPRF",
101
+ "period_end": "2026-01-01T09:00:00Z",
102
+ "period_start": "2026-01-01T09:00:00Z",
103
+ "practitioner_display": "string",
104
+ "practitioner_id": "string"
102
105
  }
103
106
  ],
104
- "patient_id": "patient-example-001",
105
- "period_end": "2026-08-10T10:30:00Z",
106
- "period_start": "2026-08-10T10:00:00Z",
107
- "priority_code": "R",
108
- "priority_display": "Routine",
109
- "reason_code": "386661006",
110
- "reason_display": "Fever",
111
- "service_provider_display": "Example Health Clinic",
112
- "service_provider_id": "organization-example-001",
113
- "service_type_code": "124",
114
- "service_type_display": "General practice",
115
- "status": "finished",
116
- "type_code": "99213",
117
- "type_display": "Office outpatient visit"
107
+ "patient_id": "string",
108
+ "period_end": "2026-01-01T09:00:00Z",
109
+ "period_start": "2026-01-01T09:00:00Z",
110
+ "priority_code": "string",
111
+ "priority_display": "string",
112
+ "reason_code": "string",
113
+ "reason_display": "string",
114
+ "service_provider_display": "string",
115
+ "service_provider_id": "string",
116
+ "service_type_code": "string",
117
+ "service_type_display": "string",
118
+ "status": "planned",
119
+ "type_code": "string",
120
+ "type_display": "string"
118
121
  }
119
122
  ],
120
- "patientId": "patient-example-001",
121
- "visitorName": "Test User"
123
+ "patientId": "string",
124
+ "visitorName": "string"
122
125
  },
123
126
  "ok": true
124
127
  }
@@ -58,61 +58,64 @@ None declared in canonical OpenAPI.
58
58
 
59
59
  ```json
60
60
  {
61
- "appointment_id": "appointment-example-001",
61
+ "appointment_id": "string",
62
+ "athena_appointment_id": "string",
63
+ "athena_encounter_id": "string",
62
64
  "created_by": "self",
63
- "created_date": "2026-08-10T23:36:57Z",
65
+ "created_date": "2026-01-01T09:00:00Z",
64
66
  "diagnoses": [
65
67
  {
66
- "condition_display": "Acute upper respiratory infection",
67
- "condition_id": "condition-example-001",
68
+ "condition_display": "string",
69
+ "condition_id": "string",
68
70
  "rank": 1,
69
- "use_code": "AD"
71
+ "use_code": "CC"
70
72
  }
71
73
  ],
72
74
  "encounter_class": "AMB",
73
- "encounter_id": "167dd34e-1833-4260-a8b1-ea0b38229a1b",
74
- "fhir_id": "6e0d484f-4f8b-4025-b6ef-abedf69f0f91",
75
+ "encounter_id": "00000000-0000-0000-0000-000000000000",
76
+ "fhir_id": "string",
75
77
  "hospitalization": {
76
- "admit_source_code": "physician-referral",
77
- "destination_id": "location-example-002",
78
+ "admit_source_code": "string",
79
+ "destination_id": "string",
78
80
  "discharge_disposition": "home",
79
- "origin_id": "location-example-001",
80
- "pre_admission_id": "encounter-example-prior",
81
- "re_admission_code": "N"
81
+ "origin_id": "string",
82
+ "pre_admission_id": "string",
83
+ "re_admission_code": "string"
82
84
  },
83
- "length_minutes": 30,
85
+ "length_minutes": 0,
84
86
  "locations": [
85
87
  {
86
- "location_display": "Example Clinic, Room 101",
87
- "location_id": "location-example-001",
88
- "period_end": "2026-08-10T10:30:00Z",
89
- "period_start": "2026-08-10T10:00:00Z",
90
- "status": "completed"
88
+ "location_display": "string",
89
+ "location_id": "string",
90
+ "period_end": "2026-01-01T09:00:00Z",
91
+ "period_start": "2026-01-01T09:00:00Z",
92
+ "status": "active"
91
93
  }
92
94
  ],
95
+ "notes": "string",
93
96
  "participants": [
94
97
  {
95
- "participant_type": "ATND",
96
- "period_end": "2026-08-10T10:30:00Z",
97
- "period_start": "2026-08-10T10:00:00Z",
98
- "practitioner_display": "Dr. Alex Smith",
99
- "practitioner_id": "provider-example-001"
98
+ "participant_type": "PPRF",
99
+ "period_end": "2026-01-01T09:00:00Z",
100
+ "period_start": "2026-01-01T09:00:00Z",
101
+ "practitioner_display": "string",
102
+ "practitioner_id": "string"
100
103
  }
101
104
  ],
102
- "patient_id": "patient-example-001",
103
- "period_end": "2026-08-10T10:30:00Z",
104
- "period_start": "2026-08-10T10:00:00Z",
105
- "priority_code": "R",
106
- "priority_display": "Routine",
107
- "reason_code": "386661006",
108
- "reason_display": "Fever",
109
- "service_provider_display": "Example Health Clinic",
110
- "service_provider_id": "organization-example-001",
111
- "service_type_code": "124",
112
- "service_type_display": "General practice",
113
- "status": "finished",
114
- "type_code": "99213",
115
- "type_display": "Office outpatient visit"
105
+ "patient_id": "string",
106
+ "period_end": "2026-01-01T09:00:00Z",
107
+ "period_start": "2026-01-01T09:00:00Z",
108
+ "priority_code": "string",
109
+ "priority_display": "string",
110
+ "reason_code": "string",
111
+ "reason_display": "string",
112
+ "service_provider_display": "string",
113
+ "service_provider_id": "string",
114
+ "service_type_code": "string",
115
+ "service_type_display": "string",
116
+ "status": "planned",
117
+ "type_code": "string",
118
+ "type_display": "string"
116
119
  }
117
120
  ```
118
121
 
@@ -0,0 +1,162 @@
1
+ # Get the patient's latest open encounter
2
+
3
+ Operation ID: `patient.getLatestEncounter`
4
+
5
+ Get the patient's latest open encounter
6
+
7
+ ## Public method
8
+
9
+ `getLatestEncounter`
10
+
11
+ Signature: `patient.getLatestEncounter(patientId)`
12
+
13
+ Return type: `Promise<GetLatestEncounterResponse>`
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/{patient_id}/encounters/latest`
28
+
29
+ ## Path parameters
30
+
31
+ | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
32
+ |---|---|---:|---|---|---|---:|---|
33
+ | `patient_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` | [`GetLatestEncounterResponse`](../models/GetLatestEncounterResponse.md) | application/json | The patient's latest open encounter, or null if none |
54
+
55
+ ## Success response examples
56
+
57
+ ### 200
58
+
59
+ ```json
60
+ {
61
+ "encounter": {
62
+ "appointment_id": "string",
63
+ "athena_appointment_id": "string",
64
+ "athena_encounter_id": "string",
65
+ "created_by": "self",
66
+ "created_date": "2026-01-01T09:00:00Z",
67
+ "diagnoses": [
68
+ {
69
+ "condition_display": "string",
70
+ "condition_id": "string",
71
+ "rank": 1,
72
+ "use_code": "CC"
73
+ }
74
+ ],
75
+ "encounter_class": "AMB",
76
+ "encounter_id": "00000000-0000-0000-0000-000000000000",
77
+ "fhir_id": "string",
78
+ "hospitalization": {
79
+ "admit_source_code": "string",
80
+ "destination_id": "string",
81
+ "discharge_disposition": "home",
82
+ "origin_id": "string",
83
+ "pre_admission_id": "string",
84
+ "re_admission_code": "string"
85
+ },
86
+ "length_minutes": 0,
87
+ "locations": [
88
+ {
89
+ "location_display": "string",
90
+ "location_id": "string",
91
+ "period_end": "2026-01-01T09:00:00Z",
92
+ "period_start": "2026-01-01T09:00:00Z",
93
+ "status": "active"
94
+ }
95
+ ],
96
+ "notes": "string",
97
+ "participants": [
98
+ {
99
+ "participant_type": "PPRF",
100
+ "period_end": "2026-01-01T09:00:00Z",
101
+ "period_start": "2026-01-01T09:00:00Z",
102
+ "practitioner_display": "string",
103
+ "practitioner_id": "string"
104
+ }
105
+ ],
106
+ "patient_id": "string",
107
+ "period_end": "2026-01-01T09:00:00Z",
108
+ "period_start": "2026-01-01T09:00:00Z",
109
+ "priority_code": "string",
110
+ "priority_display": "string",
111
+ "reason_code": "string",
112
+ "reason_display": "string",
113
+ "service_provider_display": "string",
114
+ "service_provider_id": "string",
115
+ "service_type_code": "string",
116
+ "service_type_display": "string",
117
+ "status": "planned",
118
+ "type_code": "string",
119
+ "type_display": "string"
120
+ }
121
+ }
122
+ ```
123
+
124
+ ## Common errors
125
+
126
+ None declared in canonical OpenAPI.
127
+
128
+ ## Error examples
129
+
130
+ None declared in canonical OpenAPI.
131
+
132
+ ## NodeJS / TypeScript implementation
133
+
134
+ ```ts
135
+ import { HCSDK } from "@healthcloudai/hc-sdk";
136
+ ```
137
+
138
+ ```ts
139
+ const patientId = "<PATIENT_ID>";
140
+
141
+ const result = await patient.getLatestEncounter(patientId);
142
+ ```
143
+
144
+ ## cURL
145
+
146
+ ```bash
147
+ curl -X GET \
148
+ -H 'Authorization: Bearer <ACCESS_TOKEN>' \
149
+ 'https://dev-api-patient.health.cloud/patients/%3CPATIENT_ID%3E/encounters/latest'
150
+ ```
151
+
152
+ ## Notes
153
+
154
+ None.
155
+
156
+ ## Prepared Test Console scenario
157
+
158
+ No canonical scenario is currently associated.
159
+
160
+ ## Real response
161
+
162
+ No approved real integration response is currently published. Unapproved candidates are never rendered as examples.