@icanbwell/bwell-sdk-ts 2.0.0-alpha.0-rc.1761062569 → 2.0.0-alpha.0-rc.1761082808
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/__version__.d.ts +1 -1
- package/dist/__version__.js +1 -1
- package/dist/api/base/health-data/health-data-response-factory.d.ts +2 -1
- package/dist/api/graphql-api/healthdata/graphql-health-manager.js +5 -6
- package/dist/api/graphql-api/healthdata/health-data-response-factory.d.ts +1 -1
- package/dist/api/graphql-api/healthdata/health-data-response-factory.js +1 -1
- package/dist/models/common/bundle.d.ts +2 -2
- package/dist/models/health-data/care-plan.d.ts +2 -2
- package/package.json +1 -1
package/dist/__version__.d.ts
CHANGED
package/dist/__version__.js
CHANGED
|
@@ -3,6 +3,7 @@ import { HealthDataRequest } from "./health-data-request.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Interface for creating paginated responses for health queries.
|
|
5
5
|
*
|
|
6
|
+
* @private
|
|
6
7
|
* @category Health Data
|
|
7
8
|
* @title HealthDataResponseFactory
|
|
8
9
|
* @excerpt Interface for creating paginated response bundles from GraphQL responses
|
|
@@ -15,7 +16,7 @@ export interface HealthDataResponseFactory {
|
|
|
15
16
|
* @param request - Optional request containing pagination parameters
|
|
16
17
|
* @returns Paginated bundle with type-safe data
|
|
17
18
|
*/
|
|
18
|
-
transformHealthDataResult<T>(bundle: EntryBundle<T>, request
|
|
19
|
+
transformHealthDataResult<T>(bundle: EntryBundle<T>, request: HealthDataRequest): HealthDataResponse<T>;
|
|
19
20
|
/**
|
|
20
21
|
* Creates a paginated SDK response from a raw grouped health data response.
|
|
21
22
|
*
|
|
@@ -22,11 +22,13 @@ var _GraphQLHealthManager_sdk, _GraphQLHealthManager_logger, _GraphQLHealthManag
|
|
|
22
22
|
import { ConsoleLoggerProvider, } from "../../../logger/index.js";
|
|
23
23
|
import { BWellQueryResult } from "../../../results/index.js";
|
|
24
24
|
import { isNullOrUndefined } from "../../../utils/type-utils.js";
|
|
25
|
+
import * as health from "../../base/health-data/index.js";
|
|
25
26
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
26
27
|
import { GetEncountersRequestFactory } from "./get-encounters-request-factory.js";
|
|
27
28
|
import { GetMedicationDispensesRequestFactory } from "./get-medication-dispenses-request-factory.js";
|
|
28
29
|
import { HealthDataRequestFactory, } from "./health-data-request-factory.js";
|
|
29
30
|
import { GraphQLHealthDataResponseFactory } from "./health-data-response-factory.js";
|
|
31
|
+
const DEFAULT_HEALTH_DATA_REQUEST = new health.HealthDataRequest({ page: 0 });
|
|
30
32
|
export class GraphQLHealthManager extends GraphQLManager {
|
|
31
33
|
constructor(sdk, loggerProvider = new ConsoleLoggerProvider()) {
|
|
32
34
|
super();
|
|
@@ -148,17 +150,14 @@ export class GraphQLHealthManager extends GraphQLManager {
|
|
|
148
150
|
return new BWellQueryResult((_b = result.data) === null || _b === void 0 ? void 0 : _b.getLabGroups, result.error);
|
|
149
151
|
});
|
|
150
152
|
}
|
|
151
|
-
getCarePlans(
|
|
152
|
-
return __awaiter(this,
|
|
153
|
+
getCarePlans() {
|
|
154
|
+
return __awaiter(this, arguments, void 0, function* (request = DEFAULT_HEALTH_DATA_REQUEST) {
|
|
153
155
|
var _a, _b;
|
|
154
156
|
const validationResult = this.validateRequest(request);
|
|
155
157
|
if (validationResult.failure()) {
|
|
156
158
|
return validationResult.toQueryResult();
|
|
157
159
|
}
|
|
158
|
-
|
|
159
|
-
if (request !== undefined) {
|
|
160
|
-
gqlRequest = __classPrivateFieldGet(this, _GraphQLHealthManager_healthDataRequestFactory, "f").create(request);
|
|
161
|
-
}
|
|
160
|
+
const gqlRequest = __classPrivateFieldGet(this, _GraphQLHealthManager_healthDataRequestFactory, "f").create(request);
|
|
162
161
|
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("calling getCarePlans ...");
|
|
163
162
|
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthManager_sdk, "f").getCarePlans(gqlRequest));
|
|
164
163
|
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("getCarePlans complete");
|
|
@@ -2,6 +2,6 @@ import { EntryBundle, GroupedHealthDataResponse, HealthDataResponse, ResourceBun
|
|
|
2
2
|
import { HealthDataRequest, HealthDataResponseFactory } from "../../base/index.js";
|
|
3
3
|
export declare class GraphQLHealthDataResponseFactory implements HealthDataResponseFactory {
|
|
4
4
|
#private;
|
|
5
|
-
transformHealthDataResult<T>(bundle: EntryBundle<T>, request
|
|
5
|
+
transformHealthDataResult<T>(bundle: EntryBundle<T>, request: HealthDataRequest): HealthDataResponse<T>;
|
|
6
6
|
transformGroupQueryResult<T>(bundle: ResourceBundle<T>): GroupedHealthDataResponse<T>;
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ export class GraphQLHealthDataResponseFactory {
|
|
|
33
33
|
}
|
|
34
34
|
_GraphQLHealthDataResponseFactory_instances = new WeakSet(), _GraphQLHealthDataResponseFactory_getPagingInfo = function _GraphQLHealthDataResponseFactory_getPagingInfo(bundle, request) {
|
|
35
35
|
var _a;
|
|
36
|
-
const req = request
|
|
36
|
+
const req = request.data();
|
|
37
37
|
const total = bundle.total;
|
|
38
38
|
// Without a request, we can't det. what page size or item count
|
|
39
39
|
// was sent/retrieved by the server. Instead, return only what we
|
|
@@ -69,11 +69,11 @@ export type GroupedHealthDataResponse<T> = Omit<ResourceBundle<T>, "paging_info"
|
|
|
69
69
|
pagingInfo: SDKPagingInfo | null;
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Common interface used to return paging information.
|
|
73
73
|
*
|
|
74
74
|
* @category Models
|
|
75
75
|
* @title PaginatedBundle
|
|
76
|
-
* @excerpt
|
|
76
|
+
* @excerpt Common interface used to return paging information
|
|
77
77
|
*/
|
|
78
78
|
export type SDKPagingInfo = {
|
|
79
79
|
pageNumber: number | null;
|
|
@@ -128,7 +128,7 @@ export type CarePlanBundle = EntryBundle<CarePlan>;
|
|
|
128
128
|
* SDK response for care plan search results w. paging info.
|
|
129
129
|
*
|
|
130
130
|
* @category Models
|
|
131
|
-
* @title
|
|
132
|
-
* @excerpt SDK response for care plan search results
|
|
131
|
+
* @title CarePlanResponse
|
|
132
|
+
* @excerpt SDK response for care plan search results with paging info.
|
|
133
133
|
*/
|
|
134
134
|
export type CarePlanResponse = HealthDataResponse<CarePlan>;
|