@healthcloudai/hc-sdk 3.5.1 → 3.6.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 (39) hide show
  1. package/dist/index.cjs +35 -0
  2. package/dist/index.d.cts +1030 -101
  3. package/dist/index.d.ts +1030 -101
  4. package/dist/index.js +35 -0
  5. package/docs/clients/PatientClient.md +1 -0
  6. package/docs/docs-manifest.json +18 -3
  7. package/docs/examples/index.md +1 -0
  8. package/docs/index.md +1 -0
  9. package/docs/models/AddPatientIntakeRequest.md +24 -0
  10. package/docs/models/AddPatientIntakeResponse.md +17 -0
  11. package/docs/models/AdvanceDirective.md +31 -0
  12. package/docs/models/AdvanceDirectiveType.md +15 -0
  13. package/docs/models/CarequalityRetrieveDocumentsRequest.md +1 -1
  14. package/docs/models/DirectiveScope.md +15 -0
  15. package/docs/models/DirectiveStatus.md +15 -0
  16. package/docs/models/GetHealthRecordResponse.md +2 -2
  17. package/docs/models/Immunization.md +40 -0
  18. package/docs/models/ImmunizationRoute.md +15 -0
  19. package/docs/models/ImmunizationStatus.md +15 -0
  20. package/docs/models/ListDirectivesResponse.md +1 -1
  21. package/docs/models/ListImmunizationsResponse.md +1 -1
  22. package/docs/models/ListProceduresResponse.md +1 -1
  23. package/docs/models/OpenAIEmbedRequest.md +1 -1
  24. package/docs/models/Procedure.md +37 -0
  25. package/docs/models/ProcedureLaterality.md +15 -0
  26. package/docs/models/ProcedureStatus.md +15 -0
  27. package/docs/models/SendGridSendEmailRequest.md +1 -1
  28. package/docs/models/VaccinationSite.md +15 -0
  29. package/docs/models/ehr.ImmunizationReaction.md +20 -0
  30. package/docs/models/ehr.ListMedicationsResponse.md +1 -1
  31. package/docs/models/index.md +14 -0
  32. package/docs/operations/connectors.carequalityRetrieveDocuments.md +11 -7
  33. package/docs/operations/connectors.openaiEmbed.md +3 -7
  34. package/docs/operations/connectors.sendgridSend.md +3 -7
  35. package/docs/operations/diagnostics.lookupTestByGs1.md +11 -3
  36. package/docs/operations/ehr.listMedications.md +2 -2
  37. package/docs/operations/patient.addPatientIntake.md +117 -0
  38. package/docs/operations/patient.listMedications.md +2 -2
  39. package/package.json +1 -1
@@ -52,9 +52,7 @@ Request model: [`OpenAIEmbedRequest`](../models/OpenAIEmbedRequest.md)
52
52
  "mode": "sandbox",
53
53
  "model": "text-embedding-3-small",
54
54
  "organization": "example-organization",
55
- "text": {
56
- "vendorField": "vendor-defined value"
57
- }
55
+ "text": "example-text"
58
56
  }
59
57
  ```
60
58
 
@@ -141,9 +139,7 @@ const body = {
141
139
  "mode": "sandbox",
142
140
  "model": "text-embedding-3-small",
143
141
  "organization": "example-organization",
144
- "text": {
145
- "vendorField": "vendor-defined value"
146
- }
142
+ "text": "example-text"
147
143
  };
148
144
 
149
145
  const result = await connectors.openai.createClient(config).embed(body);
@@ -155,7 +151,7 @@ const result = await connectors.openai.createClient(config).embed(body);
155
151
  curl -X POST \
156
152
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
157
153
  -H 'Content-Type: application/json' \
158
- -d '{"api_key":"example-api-key","default_model":"gpt-4o","environment":"example-environment","mode":"sandbox","model":"text-embedding-3-small","organization":"example-organization","text":{"vendorField":"vendor-defined value"}}' \
154
+ -d '{"api_key":"example-api-key","default_model":"gpt-4o","environment":"example-environment","mode":"sandbox","model":"text-embedding-3-small","organization":"example-organization","text":"example-text"}' \
159
155
  'https://dev-api-connectors.health.cloud/connectors/openai/embed'
160
156
  ```
161
157
 
@@ -53,9 +53,7 @@ Request model: [`SendGridSendEmailRequest`](../models/SendGridSendEmailRequest.m
53
53
  "mode": "sandbox",
54
54
  "subject": "Your appointment confirmation",
55
55
  "text_content": "Your appointment is confirmed.",
56
- "to": {
57
- "vendorField": "vendor-defined value"
58
- }
56
+ "to": "patient@example.com"
59
57
  }
60
58
  ```
61
59
 
@@ -144,9 +142,7 @@ const body = {
144
142
  "mode": "sandbox",
145
143
  "subject": "Your appointment confirmation",
146
144
  "text_content": "Your appointment is confirmed.",
147
- "to": {
148
- "vendorField": "vendor-defined value"
149
- }
145
+ "to": "patient@example.com"
150
146
  };
151
147
 
152
148
  const result = await connectors.sendgrid.createClient(config).sendEmail(body);
@@ -158,7 +154,7 @@ const result = await connectors.sendgrid.createClient(config).sendEmail(body);
158
154
  curl -X POST \
159
155
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
160
156
  -H 'Content-Type: application/json' \
161
- -d '{"api_key":"example-api-key","from_email":"patient@example.com","from_name":"Example Name","html_content":"<p>Your appointment is confirmed.</p>","mode":"sandbox","subject":"Your appointment confirmation","text_content":"Your appointment is confirmed.","to":{"vendorField":"vendor-defined value"}}' \
157
+ -d '{"api_key":"example-api-key","from_email":"patient@example.com","from_name":"Example Name","html_content":"<p>Your appointment is confirmed.</p>","mode":"sandbox","subject":"Your appointment confirmation","text_content":"Your appointment is confirmed.","to":"patient@example.com"}' \
162
158
  'https://dev-api-connectors.health.cloud/connectors/sendgrid/send-email'
163
159
  ```
164
160
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Operation ID: `diagnostics.lookupTestByGs1`
4
4
 
5
- Parse a GS1 Application Identifier barcode string (?gs1=) and, if the GTIN is recognized, return the matching manufacturer test profile (IFU instructions, analytes, regulatory status) from the catalog. product is null when the GTIN is not recognized. Same PATIENT-pool ownership rule as diagnostics.listDiagnostics applies to {patient_id}, though the lookup itself is not patient-scoped — it queries the shared test-kit catalog.
5
+ Parse a GS1 Application Identifier barcode string (?gs1=) and, if the GTIN is recognized, return the matching manufacturer test profile (IFU instructions, analytes, regulatory status) from the catalog. A GTIN of any standard length (8/12/13/14 digits) is accepted and normalized to canonical GTIN-14 before matching. A syntactically valid barcode whose GTIN isn't in the catalog is 404, not a 200 with a null product. Same PATIENT-pool ownership rule as diagnostics.listDiagnostics applies to {patient_id}, though the lookup itself is not patient-scoped — it queries the shared test-kit catalog.
6
6
 
7
7
  ## Public method
8
8
 
@@ -84,10 +84,10 @@ None declared in canonical OpenAPI.
84
84
 
85
85
  | Status | Shape | Content type | Description |
86
86
  |---|---|---|---|
87
- | `400` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | The gs1 query parameter was not supplied |
87
+ | `400` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | The gs1 query parameter was missing or could not be parsed as a GS1 barcode |
88
88
  | `401` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
89
89
  | `403` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | A PATIENT-pool caller attempted to access another patient's data |
90
- | `404` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | The PATIENT-pool caller's own FHIR Patient record could not be resolved |
90
+ | `404` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | The GS1 barcode parsed cleanly but its GTIN has no configured test profile |
91
91
  | `500` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | Internal server error |
92
92
 
93
93
  ## Error examples
@@ -124,6 +124,14 @@ None declared in canonical OpenAPI.
124
124
  }
125
125
  ```
126
126
 
127
+ ### 404 — GTIN parsed but not in the catalog
128
+
129
+ ```json
130
+ {
131
+ "error": "No diagnostic test profile is configured for GTIN 00000000000000"
132
+ }
133
+ ```
134
+
127
135
  ### 500 — Unexpected service failure (sanitized example)
128
136
 
129
137
  ```json
@@ -2,7 +2,7 @@
2
2
 
3
3
  Operation ID: `ehr.listMedications`
4
4
 
5
- List medication resources for a patient. ?resource_type= selects the FHIR resource type queried (MedicationRequest, MedicationStatement, ...); defaults to MedicationRequest.
5
+ List medication resources for a patient. ?resource_type= optionally filters to one FHIR resource type (MedicationRequest, MedicationStatement); omitted, returns both.
6
6
 
7
7
  ## Public method
8
8
 
@@ -36,7 +36,7 @@ None documented.
36
36
 
37
37
  | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
38
38
  |---|---|---:|---|---|---|---:|---|
39
- | `resource_type` | `string` | No | | MedicationRequest, MedicationStatement | `"MedicationRequest"` | No | |
39
+ | `resource_type` | `string` | No | | MedicationRequest, MedicationStatement | | No | Optional filter; omit to get both MedicationRequest and MedicationStatement. |
40
40
 
41
41
  ## Body parameters
42
42
 
@@ -0,0 +1,117 @@
1
+ # Add one structured patient intake section
2
+
3
+ Operation ID: `patient.addPatientIntake`
4
+
5
+ Adds exactly one agent-collected intake section to FHIR and Athena. Returns an empty error_messages list only after both FHIR storage and Athena chart read-back succeed.
6
+
7
+ ## Public method
8
+
9
+ `addToIntake`
10
+
11
+ Signature: `patient.addToIntake(patientId, section, summary)`
12
+
13
+ Return type: `Promise<AddPatientIntakeResponse>`
14
+
15
+ ## Authentication
16
+
17
+ Classification: **AUTHENTICATED**
18
+
19
+ Schemes: `bearerAuth`
20
+
21
+ ## Prerequisites
22
+
23
+ None documented.
24
+
25
+ ## HTTP
26
+
27
+ `POST /healthrecords/intake/add`
28
+
29
+ ## Path parameters
30
+
31
+ None.
32
+
33
+ ## Query parameters
34
+
35
+ None.
36
+
37
+ ## Body parameters
38
+
39
+ | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
40
+ |---|---|---:|---|---|---|---:|---|
41
+ | `body` | [`AddPatientIntakeRequest`](../models/AddPatientIntakeRequest.md) | Yes | | | | No | |
42
+
43
+ Request model: [`AddPatientIntakeRequest`](../models/AddPatientIntakeRequest.md)
44
+
45
+ ## Request example
46
+
47
+ ```json
48
+ {
49
+ "patient_id": "string",
50
+ "section": "allergies",
51
+ "summary": {}
52
+ }
53
+ ```
54
+
55
+ ## Success responses
56
+
57
+ | Status | Shape | Content type | Description |
58
+ |---|---|---|---|
59
+ | `200` | [`AddPatientIntakeResponse`](../models/AddPatientIntakeResponse.md) | application/json | Agent-facing intake result |
60
+
61
+ ## Success response examples
62
+
63
+ ### 200
64
+
65
+ ```json
66
+ {
67
+ "error_messages": [
68
+ "string"
69
+ ]
70
+ }
71
+ ```
72
+
73
+ ## Common errors
74
+
75
+ None declared in canonical OpenAPI.
76
+
77
+ ## Error examples
78
+
79
+ None declared in canonical OpenAPI.
80
+
81
+ ## NodeJS / TypeScript implementation
82
+
83
+ ```ts
84
+ import { HCSDK } from "@healthcloudai/hc-sdk";
85
+ ```
86
+
87
+ ```ts
88
+ const patientId = "<PATIENT_ID>";
89
+
90
+ const section = "<SECTION>";
91
+
92
+ const summary = "<SUMMARY>";
93
+
94
+ const result = await patient.addToIntake(patientId, section, summary);
95
+ ```
96
+
97
+ ## cURL
98
+
99
+ ```bash
100
+ curl -X POST \
101
+ -H 'Authorization: Bearer <ACCESS_TOKEN>' \
102
+ -H 'Content-Type: application/json' \
103
+ -d '{"patient_id":"string","section":"allergies","summary":{}}' \
104
+ 'https://dev-api-patient.health.cloud/healthrecords/intake/add'
105
+ ```
106
+
107
+ ## Notes
108
+
109
+ None.
110
+
111
+ ## Prepared Test Console scenario
112
+
113
+ No canonical scenario is currently associated.
114
+
115
+ ## Real response
116
+
117
+ No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Operation ID: `patient.listMedications`
4
4
 
5
- Return the authenticated patient's medications, filtered by `resource_type` (defaults to `MedicationRequest`). Requires a patient Bearer JWT.
5
+ Return the authenticated patient's medications, optionally filtered by `resource_type` (MedicationRequest or MedicationStatement); omitted, returns both. Requires a patient Bearer JWT.
6
6
 
7
7
  ## Public method
8
8
 
@@ -34,7 +34,7 @@ None.
34
34
 
35
35
  | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
36
36
  |---|---|---:|---|---|---|---:|---|
37
- | `resource_type` | `string` | No | | MedicationRequest, MedicationStatement | `"MedicationRequest"` | No | |
37
+ | `resource_type` | `string` | No | | MedicationRequest, MedicationStatement | | No | Optional filter; omit to get both MedicationRequest and MedicationStatement. |
38
38
 
39
39
  ## Body parameters
40
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthcloudai/hc-sdk",
3
- "version": "3.5.1",
3
+ "version": "3.6.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",