@icanbwell/bwell-sdk-ts 1.31.0 → 1.33.0-rc.1750778560

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.
Files changed (49) hide show
  1. package/README.md +7 -0
  2. package/dist/__version__.d.ts +1 -1
  3. package/dist/__version__.js +1 -1
  4. package/dist/api/base/api-provider.d.ts +2 -0
  5. package/dist/api/base/health-data/health-data-request.d.ts +7 -0
  6. package/dist/api/base/health-data/health-data-request.js +7 -0
  7. package/dist/api/base/health-data/health-manager.d.ts +23 -2
  8. package/dist/api/base/health-data/index.d.ts +2 -2
  9. package/dist/api/base/health-data/index.js +1 -1
  10. package/dist/api/base/health-space/appointments-request.d.ts +6 -1
  11. package/dist/api/base/health-space/appointments-request.js +8 -2
  12. package/dist/api/base/index.d.ts +1 -0
  13. package/dist/api/base/index.js +1 -0
  14. package/dist/api/base/questionnaire/index.d.ts +2 -0
  15. package/dist/api/base/questionnaire/index.js +1 -0
  16. package/dist/api/base/questionnaire/next-question-request.d.ts +18 -0
  17. package/dist/api/base/questionnaire/next-question-request.js +55 -0
  18. package/dist/api/base/questionnaire/questionnaire-manager.d.ts +19 -0
  19. package/dist/api/base/questionnaire/questionnaire-manager.js +1 -0
  20. package/dist/api/base/requests/search-token.d.ts +8 -4
  21. package/dist/api/base/requests/search-token.js +24 -2
  22. package/dist/api/base/search/index.d.ts +2 -1
  23. package/dist/api/base/search/index.js +1 -0
  24. package/dist/api/base/search/search-health-resources-request.d.ts +87 -0
  25. package/dist/api/base/search/search-health-resources-request.js +20 -0
  26. package/dist/api/base/search/search-manager.d.ts +14 -3
  27. package/dist/api/graphql-api/graphql-api-provider.d.ts +2 -0
  28. package/dist/api/graphql-api/graphql-api-provider.js +2 -0
  29. package/dist/api/graphql-api/health-space/appointments-request-factory.js +2 -1
  30. package/dist/api/graphql-api/healthdata/graphql-health-manager.d.ts +3 -1
  31. package/dist/api/graphql-api/healthdata/graphql-health-manager.js +34 -0
  32. package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.d.ts +19 -0
  33. package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.js +58 -0
  34. package/dist/api/graphql-api/questionnaire/index.d.ts +1 -0
  35. package/dist/api/graphql-api/questionnaire/index.js +1 -0
  36. package/dist/api/graphql-api/search/graphql-search-manager.d.ts +2 -1
  37. package/dist/api/graphql-api/search/graphql-search-manager.js +24 -3
  38. package/dist/api/graphql-api/search/search-health-resources-request-factory.d.ts +14 -0
  39. package/dist/api/graphql-api/search/search-health-resources-request-factory.js +28 -0
  40. package/dist/api/graphql-api/search/search-request-factory.d.ts +1 -1
  41. package/dist/api/graphql-api/search/search-request-factory.js +1 -1
  42. package/dist/bwell-sdk/bwell-sdk.d.ts +2 -0
  43. package/dist/bwell-sdk/bwell-sdk.js +3 -0
  44. package/dist/graphql/operations/index.d.ts +30 -2
  45. package/dist/graphql/operations/index.js +402 -1
  46. package/dist/graphql/operations/types.d.ts +3617 -826
  47. package/dist/graphql/schema.d.ts +408 -205
  48. package/dist/graphql/schema.js +18 -1
  49. package/package.json +2 -2
package/README.md CHANGED
@@ -7,10 +7,17 @@ data stored and maintained by b.well, as well as manage users, configure device
7
7
  notifications and mark them read, set up data connections, and search for
8
8
  providers or connections. Please see the documentation for details.
9
9
 
10
+ ## SDKv2 / SDKv1 Update
11
+
12
+ The `main` branch will soon be updated to be for SDKv2 only. Any v1 updates are
13
+ to be made to `typescript-sdk-v1` branch.
14
+
10
15
  ## Installation
11
16
 
12
17
  `npm i @icanbwell/bwell-sdk-ts`
13
18
 
19
+ Or to test locally, you can use yalc to publish and install
20
+
14
21
  ## Example
15
22
 
16
23
  ```typescript
@@ -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 = "1.31.0";
4
+ export declare const VERSION = "1.33.0-rc.1750778560";
@@ -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 = "1.31.0";
4
+ export const VERSION = "1.33.0-rc.1750778560";
@@ -5,6 +5,7 @@ import type { DeviceManager } from "./device/device-manager.js";
5
5
  import type { EventManager } from "./event/event-manager.js";
6
6
  import type { HealthManager } from "./health-data/health-manager.js";
7
7
  import type { HealthSpaceManager } from "./health-space/health-space-manager.js";
8
+ import type { QuestionnaireManager } from "./questionnaire/questionnaire-manager.js";
8
9
  import type { SearchManager } from "./search/search-manager.js";
9
10
  import type { UserManager } from "./user/user-manager.js";
10
11
  export interface ApiProvider {
@@ -17,4 +18,5 @@ export interface ApiProvider {
17
18
  readonly event: EventManager;
18
19
  readonly search: SearchManager;
19
20
  readonly language: LanguageManager;
21
+ readonly questionnaire: QuestionnaireManager;
20
22
  }
@@ -146,6 +146,11 @@ export declare class VitalSignsRequest extends HealthDataRequest {
146
146
  */
147
147
  export declare class VitalSignGroupsRequest extends PagedRequest {
148
148
  }
149
+ /**
150
+ * Request object for fetching DiagnosticReport Lab Groups
151
+ */
152
+ export declare class DiagnosticReportLabGroupsRequest extends PagedRequest {
153
+ }
149
154
  type MedicationDispenseRequestInput = PagedRequestInput & {
150
155
  prescription?: string[];
151
156
  ids?: string[];
@@ -205,4 +210,6 @@ export declare class MedicationGroupsRequest extends PagedRequest {
205
210
  export declare class BinaryRequest extends PagedRequest<BinaryRequestInput> {
206
211
  protected validator: BinaryRequestValidator;
207
212
  }
213
+ export declare class DiagnosticReportsRequest extends HealthDataRequest {
214
+ }
208
215
  export {};
@@ -180,6 +180,11 @@ export class VitalSignsRequest extends HealthDataRequest {
180
180
  */
181
181
  export class VitalSignGroupsRequest extends PagedRequest {
182
182
  }
183
+ /**
184
+ * Request object for fetching DiagnosticReport Lab Groups
185
+ */
186
+ export class DiagnosticReportLabGroupsRequest extends PagedRequest {
187
+ }
183
188
  export class MedicationRequestRequestValidator extends MedicationDispenseRequestValidator {
184
189
  constructor() {
185
190
  super(...arguments);
@@ -258,3 +263,5 @@ export class BinaryRequest extends PagedRequest {
258
263
  this.validator = new BinaryRequestValidator();
259
264
  }
260
265
  }
266
+ export class DiagnosticReportsRequest extends HealthDataRequest {
267
+ }
@@ -1,7 +1,7 @@
1
- import { GetAllergyIntoleranceGroupsQueryResults, GetAllergyIntolerancesQueryResults, GetBinaryQueryResults, GetCarePlanGroupsQueryResults, GetCarePlansQueryResults, GetCareTeamsQueryResults, GetConditionGroupsQueryResults, GetConditionsQueryResults, GetDocumentReferencesQueryResults, GetEncounterQueryResults, GetEncountersGroupQueryResults, GetHealthSummaryQueryResults, GetImmunizationGroupsQueryResults, GetImmunizationsQueryResults, GetLabGroupsQueryResults, GetLabKnowledgeQueryResults, GetLabsQueryResults, GetMedicationDispenseQueryResults, GetMedicationGroupsQueryResults, GetMedicationKnowledgeQueryResults, GetMedicationPricingQueryResults, GetMedicationRequestQueryResults, GetMedicationStatementsQueryResults, GetProcedureGroupsQueryResults, GetProceduresQueryResults, GetVitalSignGroupsQueryResults, GetVitalSignsQueryResults } from "../../../graphql/operations/types.js";
1
+ import { GetAllergyIntoleranceGroupsQueryResults, GetAllergyIntolerancesQueryResults, GetBinaryQueryResults, GetCarePlanGroupsQueryResults, GetCarePlansQueryResults, GetCareTeamsQueryResults, GetConditionGroupsQueryResults, GetConditionsQueryResults, GetDiagnosticReportLabGroupsQueryResults, GetDiagnosticReportsQueryResults, GetDocumentReferencesQueryResults, GetEncounterQueryResults, GetEncountersGroupQueryResults, GetHealthSummaryQueryResults, GetImmunizationGroupsQueryResults, GetImmunizationsQueryResults, GetLabGroupsQueryResults, GetLabKnowledgeQueryResults, GetLabsQueryResults, GetMedicationDispenseQueryResults, GetMedicationGroupsQueryResults, GetMedicationKnowledgeQueryResults, GetMedicationPricingQueryResults, GetMedicationRequestQueryResults, GetMedicationStatementsQueryResults, GetProcedureGroupsQueryResults, GetProceduresQueryResults, GetVitalSignGroupsQueryResults, GetVitalSignsQueryResults } from "../../../graphql/operations/types.js";
2
2
  import type { BWellQueryResult } from "../../../results/index.js";
3
3
  import type { BaseManagerError } from "../errors.js";
4
- import { AllergyIntoleranceGroupsRequest, AllergyIntolerancesRequest, BinaryRequest, CarePlanGroupsRequest, CarePlansRequest, CareTeamsRequest, ConditionGroupsRequest, ConditionsRequest, DocumentReferencesRequest, EncounterGroupsRequest, EncountersRequest, ImmunizationGroupsRequest, ImmunizationsRequest, LabGroupsRequest, LabsRequest, MedicationDispenseRequest, MedicationGroupsRequest, MedicationRequestRequest, MedicationStatementsRequest, ProcedureGroupsRequest, ProceduresRequest, VitalSignGroupsRequest, VitalSignsRequest } from "./health-data-request.js";
4
+ import { AllergyIntoleranceGroupsRequest, AllergyIntolerancesRequest, BinaryRequest, CarePlanGroupsRequest, CarePlansRequest, CareTeamsRequest, ConditionGroupsRequest, ConditionsRequest, DiagnosticReportLabGroupsRequest, DiagnosticReportsRequest, DocumentReferencesRequest, EncounterGroupsRequest, EncountersRequest, ImmunizationGroupsRequest, ImmunizationsRequest, LabGroupsRequest, LabsRequest, MedicationDispenseRequest, MedicationGroupsRequest, MedicationRequestRequest, MedicationStatementsRequest, ProcedureGroupsRequest, ProceduresRequest, VitalSignGroupsRequest, VitalSignsRequest } from "./health-data-request.js";
5
5
  import { LabKnowledgeRequest } from "./lab-knowledge-request.js";
6
6
  import { MedicationKnowledgeRequest } from "./medication-knowledge-request.js";
7
7
  import { MedicationPricingRequest } from "./medication-pricing-request.js";
@@ -11,6 +11,8 @@ export interface HealthSummaryResults extends HealthSummaryResultsType {
11
11
  type AllergyIntolerancesResultsType = GetAllergyIntolerancesQueryResults["getAllergyIntolerances"];
12
12
  export interface AllergyIntolerancesResults extends AllergyIntolerancesResultsType {
13
13
  }
14
+ type DiagnosticReportsResultsType = GetDiagnosticReportsQueryResults["diagnosticReports"];
15
+ export type DiagnosticReportsResults = DiagnosticReportsResultsType;
14
16
  type DocumentReferencesResultsType = GetDocumentReferencesQueryResults["getDocumentReferences"];
15
17
  export interface DocumentReferencesResults extends DocumentReferencesResultsType {
16
18
  }
@@ -65,6 +67,9 @@ export interface VitalSignsResults extends VitalSignsResultsType {
65
67
  type VitalSignGroupsResultsType = GetVitalSignGroupsQueryResults["getVitalSignGroups"];
66
68
  export interface VitalSignGroupsResults extends VitalSignGroupsResultsType {
67
69
  }
70
+ type DiagnosticReportLabGroupsResultsType = GetDiagnosticReportLabGroupsQueryResults["getDiagnosticReportLabGroups"];
71
+ export interface DiagnosticReportLabGroupsResults extends DiagnosticReportLabGroupsResultsType {
72
+ }
68
73
  type MedicationDispenseResultsType = GetMedicationDispenseQueryResults["getMedicationDispense"];
69
74
  export interface MedicationDispenseResults extends MedicationDispenseResultsType {
70
75
  }
@@ -321,5 +326,21 @@ export interface HealthManager {
321
326
  */
322
327
  getLabKnowledge(request?: LabKnowledgeRequest): Promise<BWellQueryResult<LabKnowledgeResults>>;
323
328
  getMedicationPricing(request: MedicationPricingRequest): Promise<BWellQueryResult<MedicationPricingResults>>;
329
+ /**
330
+ * Retrieves a list of diagnostic report resources.
331
+ *
332
+ * @param {DiagnosticReportsRequest} request An optional request class for specifying the search criteria, for the retrieval of diagnostic report resources.
333
+ *
334
+ * @returns {Promise<BWellQueryResult<DiagnosticReportsResults>>} A promise resolving to an object representing the list of diagnostic reports retrieved.
335
+ */
336
+ getDiagnosticReports(request?: DiagnosticReportsRequest): Promise<BWellQueryResult<DiagnosticReportsResults>>;
337
+ /**
338
+ * Retrieves a list of diagnostic report lab groups resources.
339
+ *
340
+ * @param {DiagnosticReportLabGroupsRequest} request An optional request class for specifying the search criteria, for the retrieval of diagnostic report lab groups resources.
341
+ *
342
+ * @returns {Promise<BWellQueryResult<DiagnosticReportLabGroupsResults>>} A promise resolving to an object representing the list of diagnostic report lab groups retrieved.
343
+ */
344
+ getDiagnosticReportLabGroups(request: DiagnosticReportLabGroupsRequest): Promise<BWellQueryResult<DiagnosticReportLabGroupsResults>>;
324
345
  }
325
346
  export {};
@@ -1,5 +1,5 @@
1
- export { HealthDataRequestInput, AllergyIntolerancesRequest, AllergyIntoleranceGroupsRequest, BinaryRequest, ConditionsRequest, ConditionGroupsRequest, DocumentReferencesRequest, LabsRequest, LabGroupsRequest, CarePlansRequest, CarePlanGroupsRequest, CareTeamsRequest, EncountersRequest, EncounterGroupsRequest, ImmunizationsRequest, ImmunizationGroupsRequest, ProceduresRequest, ProcedureGroupsRequest, VitalSignsRequest, VitalSignGroupsRequest, MedicationDispenseRequest, MedicationRequestRequest, MedicationStatementsRequest, MedicationGroupsRequest, HealthDataRequest, } from "./health-data-request.js";
1
+ export { HealthDataRequestInput, AllergyIntolerancesRequest, AllergyIntoleranceGroupsRequest, BinaryRequest, ConditionsRequest, ConditionGroupsRequest, DiagnosticReportsRequest, DocumentReferencesRequest, LabsRequest, LabGroupsRequest, CarePlansRequest, CarePlanGroupsRequest, CareTeamsRequest, EncountersRequest, EncounterGroupsRequest, ImmunizationsRequest, ImmunizationGroupsRequest, ProceduresRequest, ProcedureGroupsRequest, VitalSignsRequest, VitalSignGroupsRequest, MedicationDispenseRequest, MedicationRequestRequest, MedicationStatementsRequest, MedicationGroupsRequest, HealthDataRequest, DiagnosticReportLabGroupsRequest, } from "./health-data-request.js";
2
2
  export { MedicationPricingRequest, MedicationPricingRequestInput, } from "./medication-pricing-request.js";
3
3
  export { MedicationKnowledgeRequest, MedicationKnowledgeRequestInput, } from "./medication-knowledge-request.js";
4
4
  export { LabKnowledgeRequest, LabKnowledgeRequestInput, } from "./lab-knowledge-request.js";
5
- export { HealthSummaryResults, AllergyIntolerancesResults, AllergyIntolerancesGroupsResults, BinaryResults, ConditionsResults, ConditionGroupsResults, DocumentReferencesResults, LabsResults, LabGroupsResults, CarePlansResults, CarePlanGroupsResults, CareTeamsResults, EncountersResults, EncounterGroupsResults, ImmunizationsResults, ImmunizationGroupsResults, ProceduresResults, ProcedureGroupsResults, VitalSignsResults, VitalSignGroupsResults, MedicationDispenseResults, MedicationRequestResults, MedicationStatementsResults, MedicationKnowledgeResults, MedicationGroupsResults, LabKnowledgeResults, HealthManager, MedicationPricingResults, } from "./health-manager.js";
5
+ export { HealthSummaryResults, AllergyIntolerancesResults, AllergyIntolerancesGroupsResults, BinaryResults, ConditionsResults, ConditionGroupsResults, DiagnosticReportsResults, DocumentReferencesResults, LabsResults, LabGroupsResults, CarePlansResults, CarePlanGroupsResults, CareTeamsResults, EncountersResults, EncounterGroupsResults, ImmunizationsResults, ImmunizationGroupsResults, ProceduresResults, ProcedureGroupsResults, VitalSignsResults, VitalSignGroupsResults, MedicationDispenseResults, MedicationRequestResults, MedicationStatementsResults, MedicationKnowledgeResults, MedicationGroupsResults, LabKnowledgeResults, HealthManager, MedicationPricingResults, DiagnosticReportLabGroupsResults, } from "./health-manager.js";
@@ -1,4 +1,4 @@
1
- export { AllergyIntolerancesRequest, AllergyIntoleranceGroupsRequest, BinaryRequest, ConditionsRequest, ConditionGroupsRequest, DocumentReferencesRequest, LabsRequest, LabGroupsRequest, CarePlansRequest, CarePlanGroupsRequest, CareTeamsRequest, EncountersRequest, EncounterGroupsRequest, ImmunizationsRequest, ImmunizationGroupsRequest, ProceduresRequest, ProcedureGroupsRequest, VitalSignsRequest, VitalSignGroupsRequest, MedicationDispenseRequest, MedicationRequestRequest, MedicationStatementsRequest, MedicationGroupsRequest, HealthDataRequest, } from "./health-data-request.js";
1
+ export { AllergyIntolerancesRequest, AllergyIntoleranceGroupsRequest, BinaryRequest, ConditionsRequest, ConditionGroupsRequest, DiagnosticReportsRequest, DocumentReferencesRequest, LabsRequest, LabGroupsRequest, CarePlansRequest, CarePlanGroupsRequest, CareTeamsRequest, EncountersRequest, EncounterGroupsRequest, ImmunizationsRequest, ImmunizationGroupsRequest, ProceduresRequest, ProcedureGroupsRequest, VitalSignsRequest, VitalSignGroupsRequest, MedicationDispenseRequest, MedicationRequestRequest, MedicationStatementsRequest, MedicationGroupsRequest, HealthDataRequest, DiagnosticReportLabGroupsRequest, } from "./health-data-request.js";
2
2
  export { MedicationPricingRequest, } from "./medication-pricing-request.js";
3
3
  export { MedicationKnowledgeRequest, } from "./medication-knowledge-request.js";
4
4
  export { LabKnowledgeRequest, } from "./lab-knowledge-request.js";
@@ -1,6 +1,6 @@
1
1
  import { SearchReference } from "../../../graphql/schema.js";
2
2
  import { ErrorsCollector, ValidationRequest } from "../../../requests/index.js";
3
- import { SearchDate, SearchString } from "../requests/index.js";
3
+ import { SearchDate, SearchString, SearchToken } from "../requests/index.js";
4
4
  export type AppointmentsRequestInput = {
5
5
  /**
6
6
  * The source[s] of the appointments to search for
@@ -30,6 +30,10 @@ export type AppointmentsRequestInput = {
30
30
  * Keys to sort the results by
31
31
  */
32
32
  _sort?: string[];
33
+ /**
34
+ * Keys to sort the results by status
35
+ */
36
+ status?: SearchToken;
33
37
  };
34
38
  /**
35
39
  * A validator class for validating appointment request inputs.
@@ -51,6 +55,7 @@ declare class AppointmentsRequestValidator {
51
55
  * - Both `_count` and `_getpagesoffset` must either be provided together or omitted together.
52
56
  * - If `_count` is provided, its value must not be less than 0.
53
57
  * - If `_getpagesoffset` is provided, its value must not be less than 0.
58
+ * - If `status` is provided, its value should not be null or undefined.
54
59
  *
55
60
  * @throws This method does not throw exceptions directly but collects errors in the `ErrorsCollector` instance.
56
61
  */
@@ -3,12 +3,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
3
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _AppointmentsRequestValidator_searchDateValidator, _AppointmentsRequestValidator_searchStringValidator;
6
+ var _AppointmentsRequestValidator_searchDateValidator, _AppointmentsRequestValidator_searchStringValidator, _AppointmentsRequestValidator_searchTokenValidator;
7
7
  import { ValidationRequest, } from "../../../requests/index.js";
8
8
  import { isBlank } from "../../../utils/string-utils.js";
9
9
  import { isNotNullOrUndefined } from "../../../utils/type-utils.js";
10
10
  import { SearchDateValidator } from "../requests/search-date.js";
11
11
  import { SearchStringValidator } from "../requests/search-string.js";
12
+ import { SearchTokenValidator } from "../requests/search-token.js";
12
13
  /**
13
14
  * A validator class for validating appointment request inputs.
14
15
  * This class ensures that the provided data adheres to the expected structure
@@ -19,6 +20,7 @@ class AppointmentsRequestValidator {
19
20
  constructor() {
20
21
  _AppointmentsRequestValidator_searchDateValidator.set(this, new SearchDateValidator());
21
22
  _AppointmentsRequestValidator_searchStringValidator.set(this, new SearchStringValidator());
23
+ _AppointmentsRequestValidator_searchTokenValidator.set(this, new SearchTokenValidator());
22
24
  }
23
25
  /**
24
26
  * Validates the provided `AppointmentsRequestInput` data and collects any validation errors.
@@ -32,6 +34,7 @@ class AppointmentsRequestValidator {
32
34
  * - Both `_count` and `_getpagesoffset` must either be provided together or omitted together.
33
35
  * - If `_count` is provided, its value must not be less than 0.
34
36
  * - If `_getpagesoffset` is provided, its value must not be less than 0.
37
+ * - If `status` is provided, its value should not be null or undefined.
35
38
  *
36
39
  * @throws This method does not throw exceptions directly but collects errors in the `ErrorsCollector` instance.
37
40
  */
@@ -54,9 +57,12 @@ class AppointmentsRequestValidator {
54
57
  isBlank(data.supporting_info.value)) {
55
58
  errors.add("Supporting Information must have a non-empty value.");
56
59
  }
60
+ if (isNotNullOrUndefined(data.status)) {
61
+ __classPrivateFieldGet(this, _AppointmentsRequestValidator_searchTokenValidator, "f").validate(data.status, errors);
62
+ }
57
63
  }
58
64
  }
59
- _AppointmentsRequestValidator_searchDateValidator = new WeakMap(), _AppointmentsRequestValidator_searchStringValidator = new WeakMap();
65
+ _AppointmentsRequestValidator_searchDateValidator = new WeakMap(), _AppointmentsRequestValidator_searchStringValidator = new WeakMap(), _AppointmentsRequestValidator_searchTokenValidator = new WeakMap();
60
66
  /**
61
67
  * Represents a request for appointments within the health space.
62
68
  * This class extends the `ValidationRequest` to provide validation
@@ -7,3 +7,4 @@ export * from "./connection/index.js";
7
7
  export * from "./device/index.js";
8
8
  export * from "./event/index.js";
9
9
  export * from "./health-space/index.js";
10
+ export * from "./questionnaire/index.js";
@@ -7,3 +7,4 @@ export * from "./connection/index.js";
7
7
  export * from "./device/index.js";
8
8
  export * from "./event/index.js";
9
9
  export * from "./health-space/index.js";
10
+ export * from "./questionnaire/index.js";
@@ -0,0 +1,2 @@
1
+ export { NextQuestionRequest, NextQuestionRequestInput, } from "./next-question-request.js";
2
+ export { NextQuestionResults, QuestionnaireManager, } from "./questionnaire-manager.js";
@@ -0,0 +1 @@
1
+ export { NextQuestionRequest, } from "./next-question-request.js";
@@ -0,0 +1,18 @@
1
+ import { NextQuestionMutationVariables } from "../../../graphql/operations/types.js";
2
+ import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
3
+ /**
4
+ * Input type for the `nextQuestion` mutation.
5
+ * @experimental This class is experimental and may change in future releases.
6
+ */
7
+ export type NextQuestionRequestInput = NextQuestionMutationVariables;
8
+ declare class NextQuestionRequestValidator implements Validator<NextQuestionRequestInput> {
9
+ validate(data: NextQuestionRequestInput, errors: ErrorsCollector): void;
10
+ }
11
+ /**
12
+ * Request class for handling next question mutations.
13
+ * @experimental This class is experimental and may change in future releases.
14
+ */
15
+ export declare class NextQuestionRequest extends ValidationRequest<NextQuestionRequestInput> {
16
+ protected validator: NextQuestionRequestValidator;
17
+ }
18
+ export {};
@@ -0,0 +1,55 @@
1
+ import { ValidationRequest, } from "../../../requests/index.js";
2
+ import { isNullOrUndefined, isNullOrUndefinedOrEmptyString, } from "../../../utils/type-utils.js";
3
+ class NextQuestionRequestValidator {
4
+ validate(data, errors) {
5
+ const questionnaireResponse = data.questionnaireResponse;
6
+ if (isNullOrUndefined(questionnaireResponse)) {
7
+ errors.add("questionnaireResponse is required");
8
+ return;
9
+ }
10
+ if (isNullOrUndefinedOrEmptyString(questionnaireResponse.resourceType) ||
11
+ questionnaireResponse.resourceType !== "QuestionnaireResponse") {
12
+ errors.add('questionnaireResponse.resourceType must be "QuestionnaireResponse"');
13
+ }
14
+ if (isNullOrUndefinedOrEmptyString(questionnaireResponse.status)) {
15
+ errors.add("questionnaireResponse.status is required");
16
+ }
17
+ if (isNullOrUndefinedOrEmptyString(questionnaireResponse.questionnaire)) {
18
+ errors.add("questionnaireResponse.questionnaire is required");
19
+ }
20
+ if (isNullOrUndefined(questionnaireResponse.contained) ||
21
+ questionnaireResponse.contained.length === 0) {
22
+ errors.add("questionnaireResponse.contained must have at least one item");
23
+ }
24
+ else {
25
+ let questionnaire = null;
26
+ for (const resource of questionnaireResponse.contained) {
27
+ if (isNullOrUndefined(resource)) {
28
+ errors.add("questionnaireResponse.contained item cannot be null or undefined");
29
+ break;
30
+ }
31
+ if (resource.resourceType === "Questionnaire") {
32
+ questionnaire = resource;
33
+ break;
34
+ }
35
+ }
36
+ if (isNullOrUndefined(questionnaire)) {
37
+ errors.add("questionnaireResponse.contained must contain a Questionnaire resource");
38
+ return;
39
+ }
40
+ if (isNullOrUndefinedOrEmptyString(questionnaire.id)) {
41
+ errors.add("questionnaireResponse.contained Questionnaire resource must have an id");
42
+ }
43
+ }
44
+ }
45
+ }
46
+ /**
47
+ * Request class for handling next question mutations.
48
+ * @experimental This class is experimental and may change in future releases.
49
+ */
50
+ export class NextQuestionRequest extends ValidationRequest {
51
+ constructor() {
52
+ super(...arguments);
53
+ this.validator = new NextQuestionRequestValidator();
54
+ }
55
+ }
@@ -0,0 +1,19 @@
1
+ import { NextQuestionMutationResults } from "../../../graphql/operations/types.js";
2
+ import { BWellTransactionResult } from "../../../results/index.js";
3
+ import { NextQuestionRequest } from "../../base/questionnaire/next-question-request.js";
4
+ import { BaseManagerError } from "../errors.js";
5
+ export type NextQuestionResults = NextQuestionMutationResults["nextQuestion"];
6
+ /**
7
+ * Interface representing a manager for handling operations related to questionnaires.
8
+ */
9
+ export interface QuestionnaireManager {
10
+ /**
11
+ * Calls the nextQuestion mutation with the provided request.
12
+ * @experimental This method is experimental and may change in future releases.
13
+ *
14
+ * @param request - The request object containing parameters for the mutation.
15
+ * @returns A promise that resolves to a `BWellTransactionResult` containing the mutation results
16
+ * or an error of type `BaseManagerError`.
17
+ */
18
+ nextQuestion(request: NextQuestionRequest): Promise<BWellTransactionResult<NextQuestionResults, BaseManagerError>>;
19
+ }
@@ -1,13 +1,17 @@
1
1
  import { ErrorsCollector, Validator } from "../../../requests/index.js";
2
- export type SearchToken = {
3
- values?: SearchTokenValue[];
4
- value?: SearchTokenValue;
5
- };
6
2
  export type SearchTokenValue = {
7
3
  system?: string;
8
4
  code?: string;
9
5
  value?: string;
10
6
  };
7
+ export type NotSearchTokenValue = SearchTokenValue & {
8
+ values?: SearchTokenValue[];
9
+ };
10
+ export type SearchToken = {
11
+ values?: SearchTokenValue[];
12
+ value?: SearchTokenValue;
13
+ notEquals?: NotSearchTokenValue;
14
+ };
11
15
  /**
12
16
  * Validator for group codes.
13
17
  */
@@ -19,8 +19,10 @@ export class SearchTokenValidator {
19
19
  */
20
20
  validate(data, errors) {
21
21
  var _a;
22
- if (data.value === undefined && data.values === undefined) {
23
- errors.add("Either SearchToken value or values must be provided");
22
+ if (data.value === undefined &&
23
+ data.values === undefined &&
24
+ data.notEquals === undefined) {
25
+ errors.add("Either SearchToken value or values or notEquals must be provided");
24
26
  return;
25
27
  }
26
28
  if (data.value !== undefined) {
@@ -33,6 +35,26 @@ export class SearchTokenValidator {
33
35
  for (const value of (_a = data.values) !== null && _a !== void 0 ? _a : []) {
34
36
  __classPrivateFieldGet(this, _SearchTokenValidator_searchTokenValueValidator, "f").validate(value, errors);
35
37
  }
38
+ // Add validation for notEquals
39
+ if (data.notEquals !== undefined) {
40
+ // Validate notEquals values array if present
41
+ if (data.notEquals.values !== undefined) {
42
+ if (data.notEquals.values.length === 0) {
43
+ errors.add("If notEquals values are provided, at least one Coding must be set");
44
+ return;
45
+ }
46
+ for (const value of data.notEquals.values) {
47
+ __classPrivateFieldGet(this, _SearchTokenValidator_searchTokenValueValidator, "f").validate(value, errors);
48
+ }
49
+ }
50
+ // Ensure at least one property is set in notEquals
51
+ if (data.notEquals.code === undefined &&
52
+ data.notEquals.value === undefined &&
53
+ data.notEquals.system === undefined &&
54
+ data.notEquals.values === undefined) {
55
+ errors.add("NotEquals must have at least one non-null property (code, value, system, or values)");
56
+ }
57
+ }
36
58
  }
37
59
  }
38
60
  _SearchTokenValidator_searchTokenValueValidator = new WeakMap();
@@ -1,3 +1,4 @@
1
- export type { SearchResults, RequestConnectionResults, SearchManager, } from "./search-manager.js";
1
+ export type { SearchResults, RequestConnectionResults, SearchManager, SearchHealthResourcesResults, } from "./search-manager.js";
2
2
  export { SearchRequest, SearchRequestInput, FilterField, OrganizationType, OrderBy, SortOrder, SortField, SearchPosition, } from "./search-request.js";
3
3
  export { RequestConnectionRequestInput, RequestConnectionRequest, } from "./request-connection-request.js";
4
+ export { SearchHealthResourcesRequest, SearchHealthResourcesRequestInput, } from "./search-health-resources-request.js";
@@ -1,2 +1,3 @@
1
1
  export { SearchRequest, } from "./search-request.js";
2
2
  export { RequestConnectionRequest, } from "./request-connection-request.js";
3
+ export { SearchHealthResourcesRequest, } from "./search-health-resources-request.js";
@@ -0,0 +1,87 @@
1
+ import { ClientInput, FilterField as GraphQLFilterField, OrganizationType as GraphQLOrganizationType, SortField as GraphQLSortField, SortOrder as GraphQLSortOrder, OrderByInput, SearchFiltersInput, SearchLocation, UserInput } from "../../../graphql/schema.js";
2
+ import { PagedRequest, PagedRequestInput, PagedRequestValidator } from "../../../requests/index.js";
3
+ /**
4
+ * Type representing the search filters for health resources.
5
+ */
6
+ export type FilterField = `${GraphQLFilterField}`;
7
+ /**
8
+ * Type representing the organization type for health resources.
9
+ */
10
+ export type OrganizationType = `${GraphQLOrganizationType}`;
11
+ /**
12
+ * Type representing the sort field for health resources.
13
+ * @experimental
14
+ */
15
+ export type SortField = `${GraphQLSortField}`;
16
+ /**
17
+ * Type representing the sort order for health resources.
18
+ */
19
+ export type SortOrder = `${GraphQLSortOrder}`;
20
+ /**
21
+ * The provider location to search by
22
+ */
23
+ export type SearchPosition = {
24
+ /**
25
+ * Latitude
26
+ */
27
+ lat: number;
28
+ /**
29
+ * Longitude
30
+ */
31
+ lon: number;
32
+ /**
33
+ * Search radius (miles) from the specified lat/lon
34
+ */
35
+ distance?: number;
36
+ };
37
+ /**
38
+ * Type representing a provider search result sorting
39
+ */
40
+ export type OrderBy = {
41
+ /**
42
+ * The provider search field to sort by
43
+ */
44
+ field?: SortField;
45
+ /**
46
+ * The direction to sort by
47
+ */
48
+ order?: SortOrder;
49
+ };
50
+ /**
51
+ * Represents the parameters for a search request.
52
+ * @experimental
53
+ */
54
+ export type SearchHealthResourcesRequestInput = PagedRequestInput & {
55
+ /**
56
+ * The client configuration to search for health resources.
57
+ */
58
+ client: [ClientInput];
59
+ /**
60
+ * The filters to apply to the search.
61
+ */
62
+ filters: SearchFiltersInput;
63
+ /**
64
+ * Specifies order options for the search.
65
+ */
66
+ orderBy?: [OrderByInput];
67
+ /**
68
+ * Provides the main ability to filter searches by a given term.
69
+ * This can be something like an organization name, location, address, or phone number.
70
+ */
71
+ search?: string;
72
+ /**
73
+ * The location to search health resources by.
74
+ */
75
+ searchLocation?: SearchLocation;
76
+ /**
77
+ * The user for whom the search is being performed.
78
+ */
79
+ user?: UserInput;
80
+ };
81
+ /**
82
+ * Request for searching health resources.
83
+ * @experimental
84
+ */
85
+ export declare class SearchHealthResourcesRequest extends PagedRequest<SearchHealthResourcesRequestInput> {
86
+ protected validator: PagedRequestValidator<SearchHealthResourcesRequestInput>;
87
+ }
@@ -0,0 +1,20 @@
1
+ import { PagedRequest, PagedRequestValidator, } from "../../../requests/index.js";
2
+ /**
3
+ * Request for searching health resources.
4
+ * @experimental
5
+ */
6
+ export class SearchHealthResourcesRequest extends PagedRequest {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.validator = new SearchHealthResourcesRequestValidator();
10
+ }
11
+ }
12
+ /**
13
+ * Validator for SearchHealthResourcesRequestInput.
14
+ * Validates the input data for searching health resources.
15
+ */
16
+ class SearchHealthResourcesRequestValidator extends PagedRequestValidator {
17
+ validate(data, errors) {
18
+ super.validate(data, errors);
19
+ }
20
+ }
@@ -1,12 +1,14 @@
1
- import { ValidationError } from "../../../errors/validation-error.js";
2
- import { ProviderSearchQueryResults, RequestConnectionMutationResults } from "../../../graphql/operations/types.js";
1
+ import { ValidationError } from "../../../errors/index.js";
2
+ import { ProviderSearchQueryResults, RequestConnectionMutationResults, SearchHealthResourcesQueryResults } from "../../../graphql/operations/types.js";
3
3
  import type { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
4
4
  import { BaseManagerError } from "../errors.js";
5
5
  import { RequestConnectionRequest } from "./request-connection-request.js";
6
+ import { SearchHealthResourcesRequest } from "./search-health-resources-request.js";
6
7
  import { SearchRequest } from "./search-request.js";
7
8
  type SearchResultsType = ProviderSearchQueryResults["providers"];
8
9
  export interface SearchResults extends SearchResultsType {
9
10
  }
11
+ export type SearchHealthResourcesResults = SearchHealthResourcesQueryResults["searchHealthResources"];
10
12
  export type RequestConnectionResults = RequestConnectionMutationResults["requestConnection"];
11
13
  /**
12
14
  * The SearchManager interface provides methods for searching for providers and connections.
@@ -36,11 +38,20 @@ export interface SearchManager {
36
38
  * of matching search results
37
39
  */
38
40
  searchConnections(request: SearchRequest): Promise<BWellQueryResult<SearchResults, BaseManagerError | ValidationError>>;
41
+ /**
42
+ * Searches for health resources based on the provided request.
43
+ *
44
+ * @param {SearchHealthResourcesRequest} request - Object containing the details of the search being requested
45
+ * @returns {Promise<BWellQueryResult<SearchHealthResourcesResults, BaseManagerError | ValidationError>>} - An object containing the collection
46
+ * of matching search results
47
+ * @experimental
48
+ */
49
+ searchHealthResources(request: SearchHealthResourcesRequest): Promise<BWellQueryResult<SearchHealthResourcesResults, BaseManagerError | ValidationError>>;
39
50
  /**
40
51
  * Requests a new connection based on the provided information.
41
52
  *
42
53
  * @param {RequestConnectionRequest} request - Object containing the details of the connection being requested
43
- * @returns {Promise<BWellTransactionResult<RequestConnectionResults, BaseManagerError>>} - Indictates the outcome of the request
54
+ * @returns {Promise<BWellTransactionResult<RequestConnectionResults, BaseManagerError>>} - Indicates the outcome of the request
44
55
  */
45
56
  requestConnection(request: RequestConnectionRequest): Promise<BWellTransactionResult<RequestConnectionResults, BaseManagerError>>;
46
57
  }
@@ -8,6 +8,7 @@ import type { DeviceManager } from "../base/device/device-manager.js";
8
8
  import type { EventManager } from "../base/event/event-manager.js";
9
9
  import type { HealthManager } from "../base/health-data/health-manager.js";
10
10
  import { HealthSpaceManager } from "../base/health-space/health-space-manager.js";
11
+ import { QuestionnaireManager } from "../base/questionnaire/questionnaire-manager.js";
11
12
  import type { SearchManager } from "../base/search/search-manager.js";
12
13
  import type { UserManager } from "../base/user/user-manager.js";
13
14
  import type { GraphQLSdk } from "./graphql-sdk/index.js";
@@ -21,6 +22,7 @@ export declare class GraphQLApiProvider implements ApiProvider {
21
22
  readonly activity: ActivityManager;
22
23
  readonly event: EventManager;
23
24
  readonly search: SearchManager;
25
+ readonly questionnaire: QuestionnaireManager;
24
26
  readonly language: LanguageManager;
25
27
  constructor(graphqlSDK: GraphQLSdk, loggerProvider: LoggerProvider, graphqlClient: GraphQLClient);
26
28
  }
@@ -17,6 +17,7 @@ import { GraphQLDeviceManager } from "./device/index.js";
17
17
  import { GraphQLEventManager } from "./event/index.js";
18
18
  import { GraphQLHealthSpaceManager } from "./health-space/index.js";
19
19
  import { GraphQLHealthManager } from "./healthdata/index.js";
20
+ import { GraphQLQuestionnaireManager } from "./questionnaire/index.js";
20
21
  import { GraphQLSearchManager } from "./search/index.js";
21
22
  import { GraphQLUserManager } from "./user/index.js";
22
23
  export class GraphQLApiProvider {
@@ -34,6 +35,7 @@ export class GraphQLApiProvider {
34
35
  this.healthSpace = new GraphQLHealthSpaceManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
35
36
  this.user = new GraphQLUserManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
36
37
  this.search = new GraphQLSearchManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
38
+ this.questionnaire = new GraphQLQuestionnaireManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
37
39
  this.language = new BwellSdkLanguageManager(graphqlClient);
38
40
  }
39
41
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export class AppointmentsRequestFactory {
8
8
  create(request) {
9
- var _a, _b, _c, _d, _e, _f, _g;
9
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10
10
  const input = request.data();
11
11
  return {
12
12
  source: (_a = input._source) !== null && _a !== void 0 ? _a : null,
@@ -16,6 +16,7 @@ export class AppointmentsRequestFactory {
16
16
  date: (_e = input.date) !== null && _e !== void 0 ? _e : null,
17
17
  sort: (_f = input._sort) !== null && _f !== void 0 ? _f : null,
18
18
  supportingInformation: (_g = input.supporting_info) !== null && _g !== void 0 ? _g : null,
19
+ status: (_h = input.status) !== null && _h !== void 0 ? _h : null,
19
20
  };
20
21
  }
21
22
  }