@healthcloudai/hc-sdk 0.8.10 → 0.8.12
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/README.md +52 -1
- package/dist/index.cjs +130 -44
- package/dist/index.d.cts +93 -19
- package/dist/index.d.ts +93 -19
- package/dist/index.js +130 -44
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,7 +130,8 @@ sdk.fieldAgent // connect, register/login/resetPassword/verifyEmail/verifySm
|
|
|
130
130
|
// getAgent/updateAgent, getDashboard, photo, listPatients, listEncounters
|
|
131
131
|
sdk.mcp // connect + JSON-RPC proxy (patient/fieldAgent tool calls)
|
|
132
132
|
sdk.graph // connect, provider search/cypher, health plan search/cypher,
|
|
133
|
-
// document
|
|
133
|
+
// document/medical-concept search/cypher, medical-concept
|
|
134
|
+
// list/detail/hierarchy, policy document list/search/get
|
|
134
135
|
```
|
|
135
136
|
|
|
136
137
|
`sdk.fieldAgent` talks to a different host (`*-api-fieldagent.health.cloud`)
|
|
@@ -143,6 +144,56 @@ instances.
|
|
|
143
144
|
|
|
144
145
|
All groups share one HTTP client, one token store, one error handler, the same URL resolver, query serialiser, and path-param interpolator.
|
|
145
146
|
|
|
147
|
+
### Graph API
|
|
148
|
+
|
|
149
|
+
`sdk.graph` exposes 19 public methods, one for each Graph API route. The eight
|
|
150
|
+
Search/Cypher methods accept `rag?: boolean`; setting `rag: true` uses the same
|
|
151
|
+
POST route and returns a typed `GraphRagResponse`. There are no separate RAG
|
|
152
|
+
wrapper methods.
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
// Standard structured response
|
|
156
|
+
const providers = await sdk.graph.searchProviders({
|
|
157
|
+
phrase: "cardiology",
|
|
158
|
+
state_code: "CA",
|
|
159
|
+
limit: 20,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// Same endpoint, Graph-RAG response
|
|
163
|
+
const providerAnswer = await sdk.graph.searchProviders({
|
|
164
|
+
phrase: "cardiology",
|
|
165
|
+
state_code: "CA",
|
|
166
|
+
limit: 20,
|
|
167
|
+
rag: true,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Cypher uses the same rag flag
|
|
171
|
+
const conceptAnswer = await sdk.graph.searchMedicalConceptsCypher({
|
|
172
|
+
query: "How many medical concepts are available?",
|
|
173
|
+
limit: 20,
|
|
174
|
+
rag: true,
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Search/Cypher methods:
|
|
179
|
+
|
|
180
|
+
- `searchProviders`, `searchProvidersCypher`
|
|
181
|
+
- `searchHealthPlans`, `searchHealthPlansCypher`
|
|
182
|
+
- `searchDocumentSummaries`, `searchDocumentSummariesCypher`
|
|
183
|
+
- `searchMedicalConcepts`, `searchMedicalConceptsCypher`
|
|
184
|
+
|
|
185
|
+
Additional GET-backed methods:
|
|
186
|
+
|
|
187
|
+
- `searchMedicalConceptsFaceted`, `listMedicalConceptVocabularies`
|
|
188
|
+
- `listMedicalConcepts`, `getMedicalConcept`
|
|
189
|
+
- `listMedicalConceptRelationships`, `listMedicalConceptAncestors`,
|
|
190
|
+
`listMedicalConceptDescendants`
|
|
191
|
+
- `listPolicyDocuments`, `searchPolicyDocuments`, `getPolicyDocument`
|
|
192
|
+
|
|
193
|
+
Together with `connect`, this is 19 public SDK methods. The live suite executes
|
|
194
|
+
29 scenarios because it tests all eight POST methods both with and without RAG,
|
|
195
|
+
and runs faceted medical-concept search for SNOMED, RXNORM, and MESH.
|
|
196
|
+
|
|
146
197
|
### Telehealth helpers
|
|
147
198
|
|
|
148
199
|
The telehealth client exposes the backend's channel and RTC-token routes:
|
package/dist/index.cjs
CHANGED
|
@@ -592,13 +592,28 @@ var MCPClient = class extends BaseServiceClient {
|
|
|
592
592
|
connect() {
|
|
593
593
|
return this.connectService();
|
|
594
594
|
}
|
|
595
|
+
sendToAudience(audience, request) {
|
|
596
|
+
return this.send("POST", `/${audience}`, { body: request });
|
|
597
|
+
}
|
|
595
598
|
/** Calls one of the 14 Patient API tools via `POST /patient`. */
|
|
596
599
|
patient(request) {
|
|
597
|
-
return this.
|
|
600
|
+
return this.sendToAudience("patient", request);
|
|
598
601
|
}
|
|
599
602
|
/** Calls one of the 8 Field Agent API tools via `POST /fieldagent`. */
|
|
600
603
|
fieldAgent(request) {
|
|
601
|
-
return this.
|
|
604
|
+
return this.sendToAudience("fieldagent", request);
|
|
605
|
+
}
|
|
606
|
+
/** Calls one of the Assistant API tools via `POST /assistant`. */
|
|
607
|
+
assistant(request) {
|
|
608
|
+
return this.sendToAudience("assistant", request);
|
|
609
|
+
}
|
|
610
|
+
/** Calls one of the Communications API tools via `POST /communications`. */
|
|
611
|
+
communications(request) {
|
|
612
|
+
return this.sendToAudience("communications", request);
|
|
613
|
+
}
|
|
614
|
+
/** Calls one of the Person API tools via `POST /person`. */
|
|
615
|
+
person(request) {
|
|
616
|
+
return this.sendToAudience("person", request);
|
|
602
617
|
}
|
|
603
618
|
};
|
|
604
619
|
|
|
@@ -697,6 +712,100 @@ var PatientClient = class extends BaseServiceClient {
|
|
|
697
712
|
pathParams: { id: fhirPatientId }
|
|
698
713
|
});
|
|
699
714
|
}
|
|
715
|
+
importHealthRecord(fhirPatientId, payload) {
|
|
716
|
+
return this.send("POST", "/patients/{id}/health-record/import", {
|
|
717
|
+
pathParams: { id: fhirPatientId },
|
|
718
|
+
body: payload
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
importCCDA(fhirPatientId, content) {
|
|
722
|
+
return this.send("POST", "/patients/{id}/health-record/import", {
|
|
723
|
+
pathParams: { id: fhirPatientId },
|
|
724
|
+
body: {
|
|
725
|
+
resourceType: "Binary",
|
|
726
|
+
contentType: "text/xml",
|
|
727
|
+
data: Buffer.from(content, "utf8").toString("base64")
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
importVitals(fhirPatientId, source, payload) {
|
|
732
|
+
return this.send("POST", "/patients/{id}/vitals/import", {
|
|
733
|
+
pathParams: { id: fhirPatientId },
|
|
734
|
+
body: { source, payload }
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
importActivity(fhirPatientId, source, payload) {
|
|
738
|
+
return this.send("POST", "/patients/{id}/activity/import", {
|
|
739
|
+
pathParams: { id: fhirPatientId },
|
|
740
|
+
body: { source, payload }
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
listActivity(fhirPatientId, type) {
|
|
744
|
+
return this.send("GET", "/patients/{id}/activity", {
|
|
745
|
+
pathParams: { id: fhirPatientId },
|
|
746
|
+
query: type ? { type } : void 0
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
deleteActivity(fhirPatientId, activityId) {
|
|
750
|
+
return this.send("DELETE", "/patients/{id}/activity/{activity_id}", {
|
|
751
|
+
pathParams: { id: fhirPatientId, activity_id: activityId }
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
getPreferredPharmacy(fhirPatientId) {
|
|
755
|
+
return this.send("GET", "/patients/{id}/preferred-pharmacy", {
|
|
756
|
+
pathParams: { id: fhirPatientId }
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
setPreferredPharmacy(fhirPatientId, data) {
|
|
760
|
+
return this.send("PUT", "/patients/{id}/preferred-pharmacy", {
|
|
761
|
+
pathParams: { id: fhirPatientId },
|
|
762
|
+
body: data
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
listDependents(fhirPatientId) {
|
|
766
|
+
return this.send("GET", "/patients/{id}/dependents", {
|
|
767
|
+
pathParams: { id: fhirPatientId }
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
saveDependent(fhirPatientId, data, dependentId) {
|
|
771
|
+
if (dependentId) {
|
|
772
|
+
return this.send("PUT", "/patients/{id}/dependents/{dependent_id}", {
|
|
773
|
+
pathParams: { id: fhirPatientId, dependent_id: dependentId },
|
|
774
|
+
body: data
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
return this.send("POST", "/patients/{id}/dependents", {
|
|
778
|
+
pathParams: { id: fhirPatientId },
|
|
779
|
+
body: data
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
deleteDependent(fhirPatientId, dependentId) {
|
|
783
|
+
return this.send("DELETE", "/patients/{id}/dependents/{dependent_id}", {
|
|
784
|
+
pathParams: { id: fhirPatientId, dependent_id: dependentId }
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
listNotifications(fhirPatientId) {
|
|
788
|
+
return this.send("GET", "/patients/{id}/notifications", {
|
|
789
|
+
pathParams: { id: fhirPatientId }
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
saveNotification(fhirPatientId, data, notificationId) {
|
|
793
|
+
if (notificationId) {
|
|
794
|
+
return this.send("PUT", "/patients/{id}/notifications/{notification_id}", {
|
|
795
|
+
pathParams: { id: fhirPatientId, notification_id: notificationId },
|
|
796
|
+
body: data
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
return this.send("POST", "/patients/{id}/notifications", {
|
|
800
|
+
pathParams: { id: fhirPatientId },
|
|
801
|
+
body: data
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
deleteNotification(fhirPatientId, notificationId) {
|
|
805
|
+
return this.send("DELETE", "/patients/{id}/notifications/{notification_id}", {
|
|
806
|
+
pathParams: { id: fhirPatientId, notification_id: notificationId }
|
|
807
|
+
});
|
|
808
|
+
}
|
|
700
809
|
createMedication(fhirPatientId, request) {
|
|
701
810
|
return this.send("POST", "/patients/{id}/medications", {
|
|
702
811
|
pathParams: { id: fhirPatientId },
|
|
@@ -1101,7 +1210,6 @@ var GraphClient = class extends BaseServiceClient {
|
|
|
1101
1210
|
connect() {
|
|
1102
1211
|
return this.connectService();
|
|
1103
1212
|
}
|
|
1104
|
-
// ─── Providers ───────────────────────────────────────────────────────
|
|
1105
1213
|
searchProviders(request) {
|
|
1106
1214
|
return this.send("POST", "/graph/providers/search", {
|
|
1107
1215
|
body: request
|
|
@@ -1112,17 +1220,6 @@ var GraphClient = class extends BaseServiceClient {
|
|
|
1112
1220
|
body: request
|
|
1113
1221
|
});
|
|
1114
1222
|
}
|
|
1115
|
-
ragProvidersSearch(request) {
|
|
1116
|
-
return this.send("POST", "/graph/rag/providers/search", {
|
|
1117
|
-
body: request
|
|
1118
|
-
});
|
|
1119
|
-
}
|
|
1120
|
-
ragProvidersCypher(request) {
|
|
1121
|
-
return this.send("POST", "/graph/rag/providers/cypher", {
|
|
1122
|
-
body: request
|
|
1123
|
-
});
|
|
1124
|
-
}
|
|
1125
|
-
// ─── Health Plans ────────────────────────────────────────────────────
|
|
1126
1223
|
searchHealthPlans(request) {
|
|
1127
1224
|
return this.send("POST", "/graph/health-plans/search", {
|
|
1128
1225
|
body: request
|
|
@@ -1133,17 +1230,6 @@ var GraphClient = class extends BaseServiceClient {
|
|
|
1133
1230
|
body: request
|
|
1134
1231
|
});
|
|
1135
1232
|
}
|
|
1136
|
-
ragHealthPlansSearch(request) {
|
|
1137
|
-
return this.send("POST", "/graph/rag/health-plans/search", {
|
|
1138
|
-
body: request
|
|
1139
|
-
});
|
|
1140
|
-
}
|
|
1141
|
-
ragHealthPlansCypher(request) {
|
|
1142
|
-
return this.send("POST", "/graph/rag/health-plans/cypher", {
|
|
1143
|
-
body: request
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
// ─── Document Summaries ──────────────────────────────────────────────
|
|
1147
1233
|
searchDocumentSummaries(request) {
|
|
1148
1234
|
return this.send("POST", "/graph/document-summaries/search", {
|
|
1149
1235
|
body: request
|
|
@@ -1154,17 +1240,6 @@ var GraphClient = class extends BaseServiceClient {
|
|
|
1154
1240
|
body: request
|
|
1155
1241
|
});
|
|
1156
1242
|
}
|
|
1157
|
-
ragDocumentSummariesSearch(request) {
|
|
1158
|
-
return this.send("POST", "/graph/rag/document-summaries/search", {
|
|
1159
|
-
body: request
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
ragDocumentSummariesCypher(request) {
|
|
1163
|
-
return this.send("POST", "/graph/rag/document-summaries/cypher", {
|
|
1164
|
-
body: request
|
|
1165
|
-
});
|
|
1166
|
-
}
|
|
1167
|
-
// ─── Medical Concepts ────────────────────────────────────────────────
|
|
1168
1243
|
searchMedicalConcepts(request) {
|
|
1169
1244
|
return this.send("POST", "/graph/medical-concepts/search", {
|
|
1170
1245
|
body: request
|
|
@@ -1175,15 +1250,26 @@ var GraphClient = class extends BaseServiceClient {
|
|
|
1175
1250
|
body: request
|
|
1176
1251
|
});
|
|
1177
1252
|
}
|
|
1178
|
-
|
|
1179
|
-
return this.send("
|
|
1180
|
-
body: request
|
|
1181
|
-
});
|
|
1253
|
+
searchMedicalConceptsFaceted(query) {
|
|
1254
|
+
return this.send("GET", "/medical-concepts/search", { query });
|
|
1182
1255
|
}
|
|
1183
|
-
|
|
1184
|
-
return this.send("
|
|
1185
|
-
|
|
1186
|
-
|
|
1256
|
+
listMedicalConceptVocabularies() {
|
|
1257
|
+
return this.send("GET", "/medical-concepts/vocabularies");
|
|
1258
|
+
}
|
|
1259
|
+
listMedicalConcepts(query) {
|
|
1260
|
+
return this.send("GET", "/medical-concepts", { query });
|
|
1261
|
+
}
|
|
1262
|
+
getMedicalConcept(conceptId) {
|
|
1263
|
+
return this.send("GET", "/medical-concepts/{concept_id}", { pathParams: { concept_id: conceptId } });
|
|
1264
|
+
}
|
|
1265
|
+
listMedicalConceptRelationships(conceptId, query) {
|
|
1266
|
+
return this.send("GET", "/medical-concepts/{concept_id}/relationships", { pathParams: { concept_id: conceptId }, query });
|
|
1267
|
+
}
|
|
1268
|
+
listMedicalConceptAncestors(conceptId, query) {
|
|
1269
|
+
return this.send("GET", "/medical-concepts/{concept_id}/ancestors", { pathParams: { concept_id: conceptId }, query });
|
|
1270
|
+
}
|
|
1271
|
+
listMedicalConceptDescendants(conceptId, query) {
|
|
1272
|
+
return this.send("GET", "/medical-concepts/{concept_id}/descendants", { pathParams: { concept_id: conceptId }, query });
|
|
1187
1273
|
}
|
|
1188
1274
|
// ─── Policy Documents ────────────────────────────────────────────────
|
|
1189
1275
|
listPolicyDocuments(query) {
|