@icanbwell/bwell-sdk-ts 2.0.0-alpha.0-rc.1757362315 → 2.0.0-alpha.0-rc.1757691388
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-request.d.ts +3 -0
- package/dist/api/base/health-data/health-manager.d.ts +53 -1
- package/dist/api/base/requests/field-sort-order.d.ts +11 -0
- package/dist/api/base/requests/field-sort-order.js +1 -0
- package/dist/api/base/requests/index.d.ts +1 -0
- package/dist/api/base/search/search-health-resources-request.d.ts +3 -11
- package/dist/api/graphql-api/healthdata/graphql-health-manager.d.ts +5 -1
- package/dist/api/graphql-api/healthdata/graphql-health-manager.js +82 -0
- package/dist/api/graphql-api/healthdata/health-data-request-factory.js +13 -1
- package/dist/graphql/operations/index.d.ts +66 -5
- package/dist/graphql/operations/index.js +1115 -143
- package/dist/graphql/operations/types.d.ts +5625 -2203
- package/dist/models/common/contact-point.d.ts +4 -0
- package/dist/models/common/extension.d.ts +2 -0
- package/dist/models/common/index.d.ts +6 -1
- package/dist/models/common/location.d.ts +5 -0
- package/dist/models/common/organization.d.ts +22 -0
- package/dist/models/common/patient.d.ts +13 -0
- package/dist/models/common/patient.js +1 -0
- package/dist/models/common/practitioner.d.ts +15 -0
- package/dist/models/common/practitioner.js +1 -0
- package/dist/models/common/service-request.d.ts +21 -0
- package/dist/models/common/service-request.js +1 -0
- package/dist/models/common/specimen.d.ts +13 -0
- package/dist/models/common/specimen.js +1 -0
- package/dist/models/common/timing.d.ts +107 -0
- package/dist/models/common/timing.js +1 -0
- package/dist/models/common/value.d.ts +22 -0
- package/dist/models/common/value.js +1 -0
- package/dist/models/health-data/care-plan.d.ts +134 -0
- package/dist/models/health-data/care-plan.js +1 -0
- package/dist/models/health-data/condition.d.ts +102 -0
- package/dist/models/health-data/condition.js +1 -0
- package/dist/models/health-data/immunization.d.ts +149 -0
- package/dist/models/health-data/immunization.js +1 -0
- package/dist/models/health-data/index.d.ts +5 -0
- package/dist/models/health-data/observation.d.ts +100 -0
- package/dist/models/health-data/observation.js +1 -0
- package/dist/models/health-data/procedure.d.ts +77 -0
- package/dist/models/health-data/procedure.js +1 -0
- package/dist/models/search/health-resources.d.ts +2 -2
- package/package.json +1 -1
package/dist/__version__.d.ts
CHANGED
package/dist/__version__.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ErrorsCollector, PagedRequest, PagedRequestInput, PagedRequestValidator, Validator } from "../../../requests/index.js";
|
|
2
|
+
import { FieldSortOrder } from "../requests/field-sort-order.js";
|
|
2
3
|
import { SearchDate } from "../requests/search-date.js";
|
|
3
4
|
import { SearchToken } from "../requests/search-token.js";
|
|
4
5
|
/**
|
|
@@ -11,6 +12,8 @@ export type HealthDataRequestInput = PagedRequestInput & {
|
|
|
11
12
|
ids?: string[];
|
|
12
13
|
groupCode?: SearchToken;
|
|
13
14
|
lastUpdated?: SearchDate;
|
|
15
|
+
status?: SearchToken;
|
|
16
|
+
sort?: FieldSortOrder[];
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
16
19
|
* Input type for care team requests. Used to filter care teams by category.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AllergyIntoleranceBundle, AllergyIntoleranceGroupBundle, CarePlanGroupBundle, ConditionGroupBundle, DiagnosticReportLabGroupBundle, EncounterGroupBundle, HealthSummary, ImmunizationGroupBundle, LabGroupBundle, MedicationGroupBundle, ProcedureGroupBundle, VitalSignGroupBundle } from "../../../models/health-data/index.js";
|
|
1
|
+
import type { AllergyIntoleranceBundle, AllergyIntoleranceGroupBundle, CarePlanBundle, CarePlanGroupBundle, ConditionBundle, ConditionGroupBundle, DiagnosticReportLabGroupBundle, EncounterGroupBundle, HealthSummary, ImmunizationBundle, ImmunizationGroupBundle, LabGroupBundle, MedicationGroupBundle, ProcedureBundle, ProcedureGroupBundle, VitalSignGroupBundle } from "../../../models/health-data/index.js";
|
|
2
2
|
import type { BWellQueryResult } from "../../../results/index.js";
|
|
3
3
|
import type { BaseManagerError } from "../errors.js";
|
|
4
4
|
import type { AllergyIntoleranceGroupsRequest, CarePlanGroupsRequest, ConditionGroupsRequest, DiagnosticReportLabGroupsRequest, EncounterGroupsRequest, HealthDataRequest, ImmunizationGroupsRequest, LabGroupsRequest, MedicationGroupsRequest, ProcedureGroupsRequest, VitalSignGroupsRequest } from "./health-data-request.js";
|
|
@@ -46,6 +46,20 @@ export interface HealthManager {
|
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
48
|
getAllergyIntoleranceGroups(request?: AllergyIntoleranceGroupsRequest): Promise<BWellQueryResult<AllergyIntoleranceGroupBundle, BaseManagerError>>;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves a list of condition resources.
|
|
51
|
+
* Gets individual condition records for the authenticated user.
|
|
52
|
+
*
|
|
53
|
+
* @param {HealthDataRequest} request An optional request class for specifying the search criteria.
|
|
54
|
+
*
|
|
55
|
+
* @returns {Promise<BWellQueryResult<ConditionGroupBundle>>} A promise resolving to an object representing the list of conditions retrieved.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const conditions = await sdk.health.getConditions();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
getConditions(request?: HealthDataRequest): Promise<BWellQueryResult<ConditionBundle, BaseManagerError>>;
|
|
49
63
|
/**
|
|
50
64
|
* Retrieves a list of condition groups resources.
|
|
51
65
|
*
|
|
@@ -72,6 +86,16 @@ export interface HealthManager {
|
|
|
72
86
|
* ```
|
|
73
87
|
*/
|
|
74
88
|
getLabGroups(request?: LabGroupsRequest): Promise<BWellQueryResult<LabGroupBundle, BaseManagerError>>;
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves a list of care plan resources.
|
|
91
|
+
* @param {HealthDataRequest} request An optional request class for specifying the search criteria.
|
|
92
|
+
* @returns A promise resolving to an object representing the list of care plans retrieved.
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const carePlans = await sdk.health.getCarePlans();
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
getCarePlans(request?: HealthDataRequest): Promise<BWellQueryResult<CarePlanBundle, BaseManagerError>>;
|
|
75
99
|
/**
|
|
76
100
|
* Retrieves a list of care plan groups resources.
|
|
77
101
|
*
|
|
@@ -98,6 +122,20 @@ export interface HealthManager {
|
|
|
98
122
|
* ```
|
|
99
123
|
*/
|
|
100
124
|
getEncounterGroups(request?: EncounterGroupsRequest): Promise<BWellQueryResult<EncounterGroupBundle, BaseManagerError>>;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieves a list of immunization resources.
|
|
127
|
+
* Gets individual immunization records for the authenticated user.
|
|
128
|
+
*
|
|
129
|
+
* @param {HealthDataRequest} request An optional request class for specifying the search criteria.
|
|
130
|
+
*
|
|
131
|
+
* @returns {Promise<BWellQueryResult<ImmunizationBundle>>} A promise resolving to an object representing the list of immunizations retrieved.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* const immunizations = await sdk.health.getImmunizations();
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
getImmunizations(request?: HealthDataRequest): Promise<BWellQueryResult<ImmunizationBundle, BaseManagerError>>;
|
|
101
139
|
/**
|
|
102
140
|
* Retrieves a list of immunization groups resources.
|
|
103
141
|
*
|
|
@@ -111,6 +149,20 @@ export interface HealthManager {
|
|
|
111
149
|
* ```
|
|
112
150
|
*/
|
|
113
151
|
getImmunizationGroups(request?: ImmunizationGroupsRequest): Promise<BWellQueryResult<ImmunizationGroupBundle, BaseManagerError>>;
|
|
152
|
+
/**
|
|
153
|
+
* Retrieves a list of procedure resources.
|
|
154
|
+
* Gets individual procedures for the authenticated user.
|
|
155
|
+
*
|
|
156
|
+
* @param {HealthDataRequest} request An optional request class for specifying the search criteria.
|
|
157
|
+
*
|
|
158
|
+
* @returns {Promise<BWellQueryResult<ProcedureBundle>>} A promise resolving to an object representing the list of procedures.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* const procedures = await sdk.health.getProcedures();
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
getProcedures(request?: HealthDataRequest): Promise<BWellQueryResult<ProcedureBundle, BaseManagerError>>;
|
|
114
166
|
/**
|
|
115
167
|
* Retrieves a list of procedure groups resources.
|
|
116
168
|
*
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SortOrder } from "../../../models/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Base sorting type used to sort by specific field type.
|
|
4
|
+
* @category Inputs
|
|
5
|
+
* @title FieldSortOrder
|
|
6
|
+
* @excerpt Used to define field order as ascending or descending
|
|
7
|
+
*/
|
|
8
|
+
export type FieldSortOrder<T = string> = {
|
|
9
|
+
field?: T;
|
|
10
|
+
order?: SortOrder;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ClientInput, OrderByInput, SearchFiltersInput, SearchLocation, UserInput } from "../../../graphql/schema.js";
|
|
2
|
-
import { SortField
|
|
2
|
+
import { SortField } from "../../../models/enums/index.js";
|
|
3
3
|
import { PagedRequest, PagedRequestInput, PagedRequestValidator } from "../../../requests/index.js";
|
|
4
|
+
import { FieldSortOrder } from "../index.js";
|
|
4
5
|
/**
|
|
5
6
|
* The provider location to search by
|
|
6
7
|
* @category Inputs
|
|
@@ -27,16 +28,7 @@ export type SearchPosition = {
|
|
|
27
28
|
* @title OrderBy
|
|
28
29
|
* @excerpt Sorting configuration for search results
|
|
29
30
|
*/
|
|
30
|
-
export type OrderBy =
|
|
31
|
-
/**
|
|
32
|
-
* The provider search field to sort by
|
|
33
|
-
*/
|
|
34
|
-
field?: SortField;
|
|
35
|
-
/**
|
|
36
|
-
* The direction to sort by
|
|
37
|
-
*/
|
|
38
|
-
order?: SortOrder;
|
|
39
|
-
};
|
|
31
|
+
export type OrderBy = FieldSortOrder<SortField>;
|
|
40
32
|
/**
|
|
41
33
|
* Represents the parameters for a search request.
|
|
42
34
|
* @experimental
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValidationError } from "../../../errors/index.js";
|
|
2
2
|
import { LoggerProvider } from "../../../logger/index.js";
|
|
3
|
-
import type { AllergyIntoleranceBundle, AllergyIntoleranceGroupBundle, CarePlanGroupBundle, ConditionGroupBundle, DiagnosticReportLabGroupBundle, EncounterGroupBundle, HealthSummary, ImmunizationGroupBundle, LabGroupBundle, MedicationGroupBundle, ProcedureGroupBundle, VitalSignGroupBundle } from "../../../models/health-data/index.js";
|
|
3
|
+
import type { AllergyIntoleranceBundle, AllergyIntoleranceGroupBundle, CarePlanBundle, CarePlanGroupBundle, ConditionBundle, ConditionGroupBundle, DiagnosticReportLabGroupBundle, EncounterGroupBundle, HealthSummary, ImmunizationBundle, ImmunizationGroupBundle, LabGroupBundle, MedicationGroupBundle, ProcedureBundle, ProcedureGroupBundle, VitalSignGroupBundle } from "../../../models/health-data/index.js";
|
|
4
4
|
import { BWellQueryResult } from "../../../results/index.js";
|
|
5
5
|
import { BaseManagerError } from "../../base/errors.js";
|
|
6
6
|
import * as health from "../../base/health-data/index.js";
|
|
@@ -12,12 +12,16 @@ export declare class GraphQLHealthManager extends GraphQLManager implements Heal
|
|
|
12
12
|
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
|
|
13
13
|
getHealthSummary(): Promise<BWellQueryResult<HealthSummary, BaseManagerError>>;
|
|
14
14
|
getAllergyIntolerances(request?: health.HealthDataRequest): Promise<BWellQueryResult<AllergyIntoleranceBundle, BaseManagerError>>;
|
|
15
|
+
getConditions(request?: health.HealthDataRequest): Promise<BWellQueryResult<ConditionBundle, BaseManagerError>>;
|
|
15
16
|
getAllergyIntoleranceGroups(request?: health.AllergyIntoleranceGroupsRequest): Promise<BWellQueryResult<AllergyIntoleranceGroupBundle, ValidationError | BaseManagerError>>;
|
|
16
17
|
getConditionGroups(request?: health.ConditionGroupsRequest): Promise<BWellQueryResult<ConditionGroupBundle, ValidationError | BaseManagerError>>;
|
|
17
18
|
getLabGroups(request?: health.LabGroupsRequest): Promise<BWellQueryResult<LabGroupBundle, ValidationError | BaseManagerError>>;
|
|
19
|
+
getCarePlans(request?: health.HealthDataRequest): Promise<BWellQueryResult<CarePlanBundle, BaseManagerError>>;
|
|
18
20
|
getCarePlanGroups(request?: health.CarePlanGroupsRequest): Promise<BWellQueryResult<CarePlanGroupBundle, ValidationError | BaseManagerError>>;
|
|
19
21
|
getEncounterGroups(request?: health.EncounterGroupsRequest): Promise<BWellQueryResult<EncounterGroupBundle, ValidationError | BaseManagerError>>;
|
|
22
|
+
getImmunizations(request?: health.HealthDataRequest): Promise<BWellQueryResult<ImmunizationBundle, BaseManagerError>>;
|
|
20
23
|
getImmunizationGroups(request?: health.ImmunizationGroupsRequest): Promise<BWellQueryResult<ImmunizationGroupBundle, ValidationError | BaseManagerError>>;
|
|
24
|
+
getProcedures(request?: health.HealthDataRequest): Promise<BWellQueryResult<ProcedureBundle, BaseManagerError>>;
|
|
21
25
|
getProcedureGroups(request?: health.ProcedureGroupsRequest): Promise<BWellQueryResult<ProcedureGroupBundle, ValidationError | BaseManagerError>>;
|
|
22
26
|
getVitalSignGroups(request?: health.VitalSignGroupsRequest): Promise<BWellQueryResult<VitalSignGroupBundle, ValidationError | BaseManagerError>>;
|
|
23
27
|
getMedicationGroups(request?: health.MedicationGroupsRequest): Promise<BWellQueryResult<MedicationGroupBundle, ValidationError | BaseManagerError>>;
|
|
@@ -58,13 +58,35 @@ export class GraphQLHealthManager extends GraphQLManager {
|
|
|
58
58
|
if (request !== undefined) {
|
|
59
59
|
gqlRequest = __classPrivateFieldGet(this, _GraphQLHealthManager_healthDataRequestFactory, "f").create(request);
|
|
60
60
|
}
|
|
61
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("calling getAllergyIntolerances...");
|
|
61
62
|
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthManager_sdk, "f").getAllergyIntolerances(gqlRequest));
|
|
63
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("getAllergyIntolerances complete");
|
|
62
64
|
if (result.hasError()) {
|
|
63
65
|
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").error("getAllergyIntolerances error", result.error);
|
|
64
66
|
}
|
|
65
67
|
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.allergyIntolerances, result.error);
|
|
66
68
|
});
|
|
67
69
|
}
|
|
70
|
+
getConditions(request) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
var _a;
|
|
73
|
+
const validationResult = this.validateRequest(request);
|
|
74
|
+
if (validationResult.failure()) {
|
|
75
|
+
return validationResult.toQueryResult();
|
|
76
|
+
}
|
|
77
|
+
let gqlRequest;
|
|
78
|
+
if (request !== undefined) {
|
|
79
|
+
gqlRequest = __classPrivateFieldGet(this, _GraphQLHealthManager_healthDataRequestFactory, "f").create(request);
|
|
80
|
+
}
|
|
81
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("calling getConditions...");
|
|
82
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthManager_sdk, "f").getConditions(gqlRequest));
|
|
83
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("getConditions complete");
|
|
84
|
+
if (result.hasError()) {
|
|
85
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").error("getConditions error", result.error);
|
|
86
|
+
}
|
|
87
|
+
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.conditions, result.error);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
68
90
|
getAllergyIntoleranceGroups(request) {
|
|
69
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
92
|
var _a, _b;
|
|
@@ -119,6 +141,26 @@ export class GraphQLHealthManager extends GraphQLManager {
|
|
|
119
141
|
return new BWellQueryResult((_b = result.data) === null || _b === void 0 ? void 0 : _b.getLabGroups, result.error);
|
|
120
142
|
});
|
|
121
143
|
}
|
|
144
|
+
getCarePlans(request) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
var _a;
|
|
147
|
+
const validationResult = this.validateRequest(request);
|
|
148
|
+
if (validationResult.failure()) {
|
|
149
|
+
return validationResult.toQueryResult();
|
|
150
|
+
}
|
|
151
|
+
let gqlRequest;
|
|
152
|
+
if (request !== undefined) {
|
|
153
|
+
gqlRequest = __classPrivateFieldGet(this, _GraphQLHealthManager_healthDataRequestFactory, "f").create(request);
|
|
154
|
+
}
|
|
155
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("calling getCarePlans ...");
|
|
156
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthManager_sdk, "f").getCarePlans(gqlRequest));
|
|
157
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("getCarePlans complete");
|
|
158
|
+
if (result.hasError()) {
|
|
159
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").error("getCarePlans error", result.error);
|
|
160
|
+
}
|
|
161
|
+
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.carePlans, result.error);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
122
164
|
getCarePlanGroups(request) {
|
|
123
165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
166
|
var _a, _b;
|
|
@@ -155,6 +197,26 @@ export class GraphQLHealthManager extends GraphQLManager {
|
|
|
155
197
|
return new BWellQueryResult((_b = result.data) === null || _b === void 0 ? void 0 : _b.getEncounterGroups, result.error);
|
|
156
198
|
});
|
|
157
199
|
}
|
|
200
|
+
getImmunizations(request) {
|
|
201
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
202
|
+
var _a;
|
|
203
|
+
const validationResult = this.validateRequest(request);
|
|
204
|
+
if (validationResult.failure()) {
|
|
205
|
+
return validationResult.toQueryResult();
|
|
206
|
+
}
|
|
207
|
+
let gqlRequest;
|
|
208
|
+
if (request !== undefined) {
|
|
209
|
+
gqlRequest = __classPrivateFieldGet(this, _GraphQLHealthManager_healthDataRequestFactory, "f").create(request);
|
|
210
|
+
}
|
|
211
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("calling getImmunizations...");
|
|
212
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthManager_sdk, "f").getImmunizations(gqlRequest));
|
|
213
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("getImmunizations complete");
|
|
214
|
+
if (result.hasError()) {
|
|
215
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").error("getImmunizations errors", result.error);
|
|
216
|
+
}
|
|
217
|
+
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.immunizations, result.error);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
158
220
|
getImmunizationGroups(request) {
|
|
159
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
222
|
var _a, _b;
|
|
@@ -173,6 +235,26 @@ export class GraphQLHealthManager extends GraphQLManager {
|
|
|
173
235
|
return new BWellQueryResult((_b = result.data) === null || _b === void 0 ? void 0 : _b.getImmunizationGroups, result.error);
|
|
174
236
|
});
|
|
175
237
|
}
|
|
238
|
+
getProcedures(request) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
var _a;
|
|
241
|
+
const validationResult = this.validateRequest(request);
|
|
242
|
+
if (validationResult.failure()) {
|
|
243
|
+
return validationResult.toQueryResult();
|
|
244
|
+
}
|
|
245
|
+
let gqlRequest;
|
|
246
|
+
if (request !== undefined) {
|
|
247
|
+
gqlRequest = __classPrivateFieldGet(this, _GraphQLHealthManager_healthDataRequestFactory, "f").create(request);
|
|
248
|
+
}
|
|
249
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("calling getProcedures...");
|
|
250
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthManager_sdk, "f").getProcedures(gqlRequest));
|
|
251
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").verbose("getProcedures complete");
|
|
252
|
+
if (result.hasError()) {
|
|
253
|
+
__classPrivateFieldGet(this, _GraphQLHealthManager_logger, "f").error("getProcedures error", result.error);
|
|
254
|
+
}
|
|
255
|
+
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.procedures, result.error);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
176
258
|
getProcedureGroups(request) {
|
|
177
259
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
260
|
var _a, _b;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a field sort order to a FHIR string representation.
|
|
3
|
+
* @param ordering The field sort order to convert.
|
|
4
|
+
* @returns The string representation of the field sort order.
|
|
5
|
+
*/
|
|
6
|
+
function toSortString(ordering) {
|
|
7
|
+
const prefix = ordering.order === "asc" ? "+" : "-";
|
|
8
|
+
return `${prefix}${ordering.field}`;
|
|
9
|
+
}
|
|
1
10
|
export class HealthDataRequestFactory {
|
|
2
11
|
create(request) {
|
|
3
|
-
var _a, _b;
|
|
12
|
+
var _a, _b, _c, _d, _e;
|
|
4
13
|
const input = request.data();
|
|
5
14
|
return {
|
|
6
15
|
id: input.ids ? { values: input.ids } : null,
|
|
@@ -8,6 +17,9 @@ export class HealthDataRequestFactory {
|
|
|
8
17
|
pageSize: input.pageSize,
|
|
9
18
|
code: (_a = input.groupCode) !== null && _a !== void 0 ? _a : null,
|
|
10
19
|
lastUpdated: (_b = input.lastUpdated) !== null && _b !== void 0 ? _b : null,
|
|
20
|
+
sort: (_d = (_c = input.sort) === null || _c === void 0 ? void 0 : _c.map((sort) => toSortString(sort))) !== null && _d !== void 0 ? _d : null,
|
|
21
|
+
status: (_e = input.status) !== null && _e !== void 0 ? _e : null,
|
|
22
|
+
total: "accurate",
|
|
11
23
|
};
|
|
12
24
|
}
|
|
13
25
|
}
|