@healthcloudai/hc-sdk 3.8.0 → 3.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.
- package/dist/index.cjs +23 -3
- package/dist/index.d.cts +45 -6
- package/dist/index.d.ts +45 -6
- package/dist/index.js +23 -3
- package/docs/clients/ProviderClient.md +1 -0
- package/docs/docs-manifest.json +6 -3
- package/docs/examples/index.md +1 -0
- package/docs/index.md +1 -0
- package/docs/models/GetHealthRecordResponse.md +1 -1
- package/docs/models/ListObservationsResponse.md +1 -1
- package/docs/models/index.md +2 -0
- package/docs/models/provider.LoginResponse.md +1 -0
- package/docs/models/provider.RefreshTokenRequest.md +18 -0
- package/docs/models/provider.RefreshTokenResponse.md +21 -0
- package/docs/operations/provider.login.md +7 -6
- package/docs/operations/provider.refreshToken.md +115 -0
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -635,7 +635,11 @@ var EhrClient = class extends BaseServiceClient {
|
|
|
635
635
|
query: resourceType ? { resource_type: resourceType } : void 0
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
|
-
/**
|
|
638
|
+
/**
|
|
639
|
+
* List a patient's observations. Vital-sign observations are excluded by
|
|
640
|
+
* default (use {@link listVitals} for those); pass category "vital-signs"
|
|
641
|
+
* explicitly to include them here.
|
|
642
|
+
*/
|
|
639
643
|
listObservations(patientId, category) {
|
|
640
644
|
return this.send("GET", "/patients/{patient_id}/observations", {
|
|
641
645
|
pathParams: { patient_id: patientId },
|
|
@@ -655,7 +659,13 @@ var EhrClient = class extends BaseServiceClient {
|
|
|
655
659
|
query: questionnaireUrl ? { questionnaire_url: questionnaireUrl } : void 0
|
|
656
660
|
});
|
|
657
661
|
}
|
|
658
|
-
/**
|
|
662
|
+
/**
|
|
663
|
+
* Get a patient's consolidated health record. The record carries its mapped
|
|
664
|
+
* domain sections (social/functional/gyn/perinatal history, encounters,
|
|
665
|
+
* vitals, diagnostics, …) but no raw `observations` bucket — list general
|
|
666
|
+
* observations with {@link listObservations} (vital signs excluded) and
|
|
667
|
+
* vital signs with {@link listVitals}.
|
|
668
|
+
*/
|
|
659
669
|
getHealthRecord(patientId) {
|
|
660
670
|
return this.send("GET", "/patients/{patient_id}/record", {
|
|
661
671
|
pathParams: { patient_id: patientId }
|
|
@@ -667,7 +677,10 @@ var EhrClient = class extends BaseServiceClient {
|
|
|
667
677
|
pathParams: { patient_id: patientId }
|
|
668
678
|
});
|
|
669
679
|
}
|
|
670
|
-
/**
|
|
680
|
+
/**
|
|
681
|
+
* List a patient's vital signs (the only place vital-sign observations are
|
|
682
|
+
* returned — {@link listObservations} excludes them by default).
|
|
683
|
+
*/
|
|
671
684
|
listVitals(patientId, dateFrom, dateTo, type) {
|
|
672
685
|
const query = dateFrom || dateTo || type ? {
|
|
673
686
|
...dateFrom ? { date_from: dateFrom } : {},
|
|
@@ -2924,6 +2937,13 @@ var ProviderClient = class extends BaseServiceClient {
|
|
|
2924
2937
|
login(request) {
|
|
2925
2938
|
return this.send("POST", "/auth/login", { body: withTenantId(request, this.getTenantId()), auth: false });
|
|
2926
2939
|
}
|
|
2940
|
+
/**
|
|
2941
|
+
* Renew practitioner tokens via Cognito REFRESH_TOKEN_AUTH (POST /auth/refresh).
|
|
2942
|
+
* Requires a refresh token previously returned by login.
|
|
2943
|
+
*/
|
|
2944
|
+
refreshToken(request) {
|
|
2945
|
+
return this.send("POST", "/auth/refresh", { body: withTenantId(request, this.getTenantId()), auth: false });
|
|
2946
|
+
}
|
|
2927
2947
|
verifyEmail(request) {
|
|
2928
2948
|
return this.send("POST", "/auth/verify-email", { body: withTenantId(request, this.getTenantId()), auth: false });
|
|
2929
2949
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- [`listAppointments`](../operations/provider.listAppointments.md) — List tenant appointments
|
|
12
12
|
- [`listEncounters`](../operations/provider.listEncounters.md) — List tenant encounters
|
|
13
13
|
- [`login`](../operations/provider.login.md) — Log in a practitioner
|
|
14
|
+
- [`refreshToken`](../operations/provider.refreshToken.md) — Refresh practitioner access tokens
|
|
14
15
|
- [`register`](../operations/provider.register.md) — Register a practitioner
|
|
15
16
|
- [`resetPassword`](../operations/provider.resetPassword.md) — Start a password reset
|
|
16
17
|
- [`submitInsuranceEligibilityBatch`](../operations/provider.submitInsuranceEligibilityBatch.md) — Submit multiple insurance eligibility checks
|
package/docs/docs-manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"docsDataContentDigest": "sha256:
|
|
2
|
+
"docsDataContentDigest": "sha256:b0be17d679cc774ef551c27f8b531000c7f3313da6bb14b1db71707188c22b0c",
|
|
3
3
|
"generatedFiles": [
|
|
4
4
|
"authentication.md",
|
|
5
5
|
"clients/AmsClient.md",
|
|
@@ -2060,6 +2060,8 @@
|
|
|
2060
2060
|
"models/provider.GetPhotoUploadUrlResponse.md",
|
|
2061
2061
|
"models/provider.LoginRequest.md",
|
|
2062
2062
|
"models/provider.LoginResponse.md",
|
|
2063
|
+
"models/provider.RefreshTokenRequest.md",
|
|
2064
|
+
"models/provider.RefreshTokenResponse.md",
|
|
2063
2065
|
"models/provider.RegisterRequest.md",
|
|
2064
2066
|
"models/provider.RegisterResponse.md",
|
|
2065
2067
|
"models/provider.ResetPasswordRequest.md",
|
|
@@ -3082,6 +3084,7 @@
|
|
|
3082
3084
|
"operations/provider.listAppointments.md",
|
|
3083
3085
|
"operations/provider.listEncounters.md",
|
|
3084
3086
|
"operations/provider.login.md",
|
|
3087
|
+
"operations/provider.refreshToken.md",
|
|
3085
3088
|
"operations/provider.register.md",
|
|
3086
3089
|
"operations/provider.resetPassword.md",
|
|
3087
3090
|
"operations/provider.submitInsuranceEligibilityBatch.md",
|
|
@@ -3103,7 +3106,7 @@
|
|
|
3103
3106
|
"operations/vitals.recordVitals.md"
|
|
3104
3107
|
],
|
|
3105
3108
|
"language": "nodejs",
|
|
3106
|
-
"modelCount":
|
|
3107
|
-
"operationCount":
|
|
3109
|
+
"modelCount": 2024,
|
|
3110
|
+
"operationCount": 1025,
|
|
3108
3111
|
"schemaVersion": 1
|
|
3109
3112
|
}
|
package/docs/examples/index.md
CHANGED
|
@@ -1007,6 +1007,7 @@ Generated call examples use exact public surface signatures. Workflow examples r
|
|
|
1007
1007
|
- [List tenant appointments](../operations/provider.listAppointments.md)
|
|
1008
1008
|
- [List tenant encounters](../operations/provider.listEncounters.md)
|
|
1009
1009
|
- [Log in a practitioner](../operations/provider.login.md)
|
|
1010
|
+
- [Refresh practitioner access tokens](../operations/provider.refreshToken.md)
|
|
1010
1011
|
- [Register a practitioner](../operations/provider.register.md)
|
|
1011
1012
|
- [Start a password reset](../operations/provider.resetPassword.md)
|
|
1012
1013
|
- [Submit multiple insurance eligibility checks](../operations/provider.submitInsuranceEligibilityBatch.md)
|
package/docs/index.md
CHANGED
|
@@ -1015,6 +1015,7 @@ This directory is generated from the shared structured docs data. Do not edit ge
|
|
|
1015
1015
|
- [List tenant appointments](operations/provider.listAppointments.md) (`provider.listAppointments`)
|
|
1016
1016
|
- [List tenant encounters](operations/provider.listEncounters.md) (`provider.listEncounters`)
|
|
1017
1017
|
- [Log in a practitioner](operations/provider.login.md) (`provider.login`)
|
|
1018
|
+
- [Refresh practitioner access tokens](operations/provider.refreshToken.md) (`provider.refreshToken`)
|
|
1018
1019
|
- [Register a practitioner](operations/provider.register.md) (`provider.register`)
|
|
1019
1020
|
- [Start a password reset](operations/provider.resetPassword.md) (`provider.resetPassword`)
|
|
1020
1021
|
- [Submit multiple insurance eligibility checks](operations/provider.submitInsuranceEligibilityBatch.md) (`provider.submitInsuranceEligibilityBatch`)
|
|
@@ -11,7 +11,7 @@ Type: `object`
|
|
|
11
11
|
| Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
|
|
12
12
|
|---|---|---:|---|---|---|---:|---|
|
|
13
13
|
| `patient_id` | `string` | Yes | | | | No | Echoes the {patient_id} path parameter. |
|
|
14
|
-
| `resources` | `object` | Yes | | | | No | Resources grouped by type (conditions, allergies, medications, procedures, immunizations, family_history, consents, social_history, functional_status, gyn_history, perinatal_history,
|
|
14
|
+
| `resources` | `object` | Yes | | | | No | Resources grouped by type (conditions, allergies, medications, procedures, immunizations, family_history, consents, social_history, functional_status, gyn_history, perinatal_history, encounters, vitals, questionnaire_responses, diagnostics, intake_submissions). Medications includes MedicationRequest and patient-reported MedicationStatement. intake_submissions lists this patient's raw intake submission records (same shape as the patient intake GET endpoint); it is also available individually from that endpoint by submission_id. conditions/allergies/medications/procedures/immunizations/family_history/consents/gyn_history/perinatal_history are serialized domain models (Problem, Allergy, Medication, Procedure, Immunization, FamilyHistoryEntry, AdvanceDirective, GynHistory, PerinatalHistory) — the same shape returned by each resource's own list endpoint where one exists. social_history and functional_status are each a single serialized SocialHistory/FunctionalStatus record (0 or 1 entries), aggregated from that patient's social-history/survey-category Observations; fields never recorded as an Observation (e.g. SocialHistory.gender_identity) stay at their default. The record no longer carries a general observations bucket — list general Observations with GET /patients/{patient_id}/observations (vital signs excluded) and vital signs with GET /patients/{patient_id}/vitals, so observations and vitals never appear twice across the record and its sections. encounters, questionnaire responses, diagnostics, the vitals list, and intake_submissions are serialized service results. A resource type with a failed downstream fetch appears as an empty list, not an error. |
|
|
15
15
|
| `totals` | `object` | Yes | | | | No | Count of records per resource type key in `resources`. |
|
|
16
16
|
|
|
17
17
|
## Example
|
|
@@ -10,7 +10,7 @@ Type: `object`
|
|
|
10
10
|
|
|
11
11
|
| Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
|
|
12
12
|
|---|---|---:|---|---|---|---:|---|
|
|
13
|
-
| `observations` | `array` | Yes | | | | No | Raw FHIR Observation resources matching the optional ?category= filter. |
|
|
13
|
+
| `observations` | `array` | Yes | | | | No | Raw FHIR Observation resources matching the optional ?category= filter. Vital-sign Observations are excluded by default because they are served by GET /patients/{patient_id}/vitals — pass ?category=vital-signs to fetch them here. |
|
|
14
14
|
| `patient_id` | `string` | Yes | | | | No | Echoes the {patient_id} path parameter. |
|
|
15
15
|
| `total` | `integer` | Yes | | | | No | Number of observations in this response. |
|
|
16
16
|
|
package/docs/models/index.md
CHANGED
|
@@ -1426,6 +1426,8 @@
|
|
|
1426
1426
|
- [PhotoUploadUrlResponse](provider.GetPhotoUploadUrlResponse.md)
|
|
1427
1427
|
- [ProviderLoginRequest](provider.LoginRequest.md)
|
|
1428
1428
|
- [ProviderLoginResponse](provider.LoginResponse.md)
|
|
1429
|
+
- [ProviderRefreshTokenRequest](provider.RefreshTokenRequest.md)
|
|
1430
|
+
- [ProviderRefreshTokenResponse](provider.RefreshTokenResponse.md)
|
|
1429
1431
|
- [ProviderRegisterRequest](provider.RegisterRequest.md)
|
|
1430
1432
|
- [ProviderRegisterResponse](provider.RegisterResponse.md)
|
|
1431
1433
|
- [ProviderResetPasswordRequest](provider.ResetPasswordRequest.md)
|
|
@@ -20,6 +20,7 @@ Type: `object`
|
|
|
20
20
|
| `expires_in` | `integer` | Yes | | | | No | Access token lifetime in seconds from issuance. |
|
|
21
21
|
| `fhir_practitioner_id` | `string|null` | No | | | | Yes | FHIR Practitioner ID for this practitioner, used as {practitioner_id} on every other route. Null if it could not be resolved. |
|
|
22
22
|
| `id_token` | `string|null` | No | | | | Yes | Cognito ID token, carrying the tenant_id claim used by other HealthCloud services. |
|
|
23
|
+
| `refresh_token` | `string|null` | No | | | | Yes | Cognito refresh token; pass to POST /auth/refresh to renew the access token without re-entering credentials. |
|
|
23
24
|
| `telehealth_id` | `string|null` | No | | | | Yes | Telehealth service identifier for this practitioner, when the telehealth integration is enabled. Null if it could not be resolved. |
|
|
24
25
|
|
|
25
26
|
## Example
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# ProviderRefreshTokenRequest
|
|
2
|
+
|
|
3
|
+
Model ID: `provider.RefreshTokenRequest`
|
|
4
|
+
|
|
5
|
+
Request body for POST /auth/refresh.
|
|
6
|
+
|
|
7
|
+
Type: `object`
|
|
8
|
+
|
|
9
|
+
## Fields
|
|
10
|
+
|
|
11
|
+
| Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
|
|
12
|
+
|---|---|---:|---|---|---|---:|---|
|
|
13
|
+
| `refresh_token` | `string` | Yes | | | | No | Refresh token previously returned by provider.login. |
|
|
14
|
+
| `tenant_id` | `string` | Yes | | | | No | Tenant whose practitioner Cognito pool issued the refresh token. |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
None declared in canonical OpenAPI.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ProviderRefreshTokenResponse
|
|
2
|
+
|
|
3
|
+
Model ID: `provider.RefreshTokenResponse`
|
|
4
|
+
|
|
5
|
+
Response for POST /auth/refresh.
|
|
6
|
+
|
|
7
|
+
Type: `object`
|
|
8
|
+
|
|
9
|
+
## Fields
|
|
10
|
+
|
|
11
|
+
| Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
|
|
12
|
+
|---|---|---:|---|---|---|---:|---|
|
|
13
|
+
| `access_token` | `string` | Yes | | | | No | New Cognito access token. |
|
|
14
|
+
| `expires_in` | `integer` | Yes | | | | No | Access token lifetime in seconds. |
|
|
15
|
+
| `id_token` | `string|null` | No | | | | Yes | New Cognito ID token, when issued. |
|
|
16
|
+
| `refresh_token` | `string|null` | No | | | | Yes | Rotated refresh token, when Cognito returns one. |
|
|
17
|
+
| `token_type` | `string` | No | | | `"Bearer"` | No | OAuth token type returned by Cognito. |
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
None declared in canonical OpenAPI.
|
|
@@ -62,12 +62,13 @@ Request model: [`provider.LoginRequest`](../models/provider.LoginRequest.md)
|
|
|
62
62
|
|
|
63
63
|
```json
|
|
64
64
|
{
|
|
65
|
-
"access_token": "
|
|
66
|
-
"cognito_sub": "
|
|
67
|
-
"expires_in":
|
|
68
|
-
"fhir_practitioner_id": "
|
|
69
|
-
"id_token": "
|
|
70
|
-
"
|
|
65
|
+
"access_token": "string",
|
|
66
|
+
"cognito_sub": "string",
|
|
67
|
+
"expires_in": 0,
|
|
68
|
+
"fhir_practitioner_id": "string",
|
|
69
|
+
"id_token": "string",
|
|
70
|
+
"refresh_token": "string",
|
|
71
|
+
"telehealth_id": "string"
|
|
71
72
|
}
|
|
72
73
|
```
|
|
73
74
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Refresh practitioner access tokens
|
|
2
|
+
|
|
3
|
+
Operation ID: `provider.refreshToken`
|
|
4
|
+
|
|
5
|
+
Refresh practitioner access tokens
|
|
6
|
+
|
|
7
|
+
## Public method
|
|
8
|
+
|
|
9
|
+
`refreshToken`
|
|
10
|
+
|
|
11
|
+
Signature: `provider.refreshToken(request)`
|
|
12
|
+
|
|
13
|
+
Return type: `Promise<ProviderRefreshTokenResponse>`
|
|
14
|
+
|
|
15
|
+
## Authentication
|
|
16
|
+
|
|
17
|
+
Classification: **UNSPECIFIED**
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
None documented.
|
|
22
|
+
|
|
23
|
+
## HTTP
|
|
24
|
+
|
|
25
|
+
`POST /auth/refresh`
|
|
26
|
+
|
|
27
|
+
## Path parameters
|
|
28
|
+
|
|
29
|
+
None.
|
|
30
|
+
|
|
31
|
+
## Query parameters
|
|
32
|
+
|
|
33
|
+
None.
|
|
34
|
+
|
|
35
|
+
## Body parameters
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|
|
38
|
+
|---|---|---:|---|---|---|---:|---|
|
|
39
|
+
| `body` | [`provider.RefreshTokenRequest`](../models/provider.RefreshTokenRequest.md) | No | | | | Yes | |
|
|
40
|
+
|
|
41
|
+
Request model: [`provider.RefreshTokenRequest`](../models/provider.RefreshTokenRequest.md)
|
|
42
|
+
|
|
43
|
+
## Request example
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"refresh_token": "string",
|
|
48
|
+
"tenant_id": "string"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Success responses
|
|
53
|
+
|
|
54
|
+
| Status | Shape | Content type | Description |
|
|
55
|
+
|---|---|---|---|
|
|
56
|
+
| `200` | [`provider.RefreshTokenResponse`](../models/provider.RefreshTokenResponse.md) | application/json | Refreshed practitioner tokens |
|
|
57
|
+
|
|
58
|
+
## Success response examples
|
|
59
|
+
|
|
60
|
+
### 200
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"access_token": "string",
|
|
65
|
+
"expires_in": 0,
|
|
66
|
+
"id_token": "string",
|
|
67
|
+
"refresh_token": "string",
|
|
68
|
+
"token_type": "Bearer"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Common errors
|
|
73
|
+
|
|
74
|
+
None declared in canonical OpenAPI.
|
|
75
|
+
|
|
76
|
+
## Error examples
|
|
77
|
+
|
|
78
|
+
None declared in canonical OpenAPI.
|
|
79
|
+
|
|
80
|
+
## NodeJS / TypeScript implementation
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import { HCSDK } from "@healthcloudai/hc-sdk";
|
|
84
|
+
import type { ProviderRefreshTokenRequest } from "@healthcloudai/hc-sdk";
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
const request = {
|
|
89
|
+
"refresh_token": "string",
|
|
90
|
+
"tenant_id": "string"
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const result = await provider.refreshToken(request);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## cURL
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
curl -X POST \
|
|
100
|
+
-H 'Content-Type: application/json' \
|
|
101
|
+
-d '{"refresh_token":"string","tenant_id":"string"}' \
|
|
102
|
+
'https://dev-api-provider.health.cloud/auth/refresh'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Notes
|
|
106
|
+
|
|
107
|
+
None.
|
|
108
|
+
|
|
109
|
+
## Prepared Test Console scenario
|
|
110
|
+
|
|
111
|
+
No canonical scenario is currently associated.
|
|
112
|
+
|
|
113
|
+
## Real response
|
|
114
|
+
|
|
115
|
+
No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@healthcloudai/hc-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.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",
|
|
@@ -66,5 +66,8 @@
|
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=18"
|
|
69
|
+
},
|
|
70
|
+
"overrides": {
|
|
71
|
+
"source-map-js": "^1.2.2"
|
|
69
72
|
}
|
|
70
73
|
}
|