@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.
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This file is automatically generated. Please do not edit this file directly.
3
3
  */
4
- export declare const VERSION = "2.0.0-alpha.0-rc.1761062569";
4
+ export declare const VERSION = "2.0.0-alpha.0-rc.1761082808";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This file is automatically generated. Please do not edit this file directly.
3
3
  */
4
- export const VERSION = "2.0.0-alpha.0-rc.1761062569";
4
+ export const VERSION = "2.0.0-alpha.0-rc.1761082808";
@@ -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?: HealthDataRequest): HealthDataResponse<T>;
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(request) {
152
- return __awaiter(this, void 0, void 0, function* () {
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
- let gqlRequest;
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?: HealthDataRequest): HealthDataResponse<T>;
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 === null || request === void 0 ? void 0 : request.data();
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
- * SDK specific (non FHIR) type used to return paged results.
72
+ * Common interface used to return paging information.
73
73
  *
74
74
  * @category Models
75
75
  * @title PaginatedBundle
76
- * @excerpt SDK specific (non FHIR) type used to return paged results
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 CarePlanResult
132
- * @excerpt SDK response for care plan search results w. paging info.
131
+ * @title CarePlanResponse
132
+ * @excerpt SDK response for care plan search results with paging info.
133
133
  */
134
134
  export type CarePlanResponse = HealthDataResponse<CarePlan>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/bwell-sdk-ts",
3
- "version": "2.0.0-alpha.0-rc.1761062569",
3
+ "version": "2.0.0-alpha.0-rc.1761082808",
4
4
  "description": "b.well TypeScript SDK",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",