@icanbwell/bwell-sdk-ts 2.0.0-beta.3 → 2.0.0-beta.3-rc.1781546530
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/connection/connection-manager.d.ts +6 -4
- package/dist/api/base/connection/connection-manager.js +1 -1
- package/dist/api/base/connection/index.d.ts +1 -0
- package/dist/api/base/connection/index.js +1 -0
- package/dist/api/base/connection/member-connections-request.d.ts +24 -0
- package/dist/api/base/connection/member-connections-request.js +32 -0
- package/dist/api/graphql-api/connection/graphql-connection-manager.d.ts +3 -4
- package/dist/api/graphql-api/connection/graphql-connection-manager.js +11 -9
- package/dist/api/graphql-api/connection/index.js +0 -1
- package/dist/api/graphql-api/connection/member-connection-response-factory.d.ts +21 -0
- package/dist/api/graphql-api/connection/member-connection-response-factory.js +46 -0
- package/dist/api/graphql-api/user/create-consent-request-factory.js +28 -1
- package/dist/graphql/operations/index.d.ts +1 -1
- package/dist/graphql/operations/index.js +20 -26
- package/dist/graphql/operations/types.d.ts +23 -35
- package/dist/graphql/schema.d.ts +15 -1
- package/dist/models/connection/index.d.ts +1 -1
- package/dist/models/connection/member-connection.d.ts +25 -2
- package/dist/models/enums/category-code.d.ts +2 -2
- package/dist/models/enums/category-code.js +1 -0
- package/dist/models/enums/connection-category.d.ts +1 -1
- package/package.json +1 -1
- package/dist/api/graphql-api/connection/connection-response-factory.d.ts +0 -7
- package/dist/api/graphql-api/connection/connection-response-factory.js +0 -101
package/dist/__version__.d.ts
CHANGED
package/dist/__version__.js
CHANGED
|
@@ -2,8 +2,9 @@ import type { Connection, ConnectionStatus, DataSource, MemberConnection, OAuthU
|
|
|
2
2
|
import type { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
3
3
|
import type { BaseManagerError } from "../errors.js";
|
|
4
4
|
import { ConnectionRequest, DataSourceRequest } from "./connection-request.js";
|
|
5
|
+
import type { MemberConnectionsRequest } from "./member-connections-request.js";
|
|
5
6
|
/**
|
|
6
|
-
* @
|
|
7
|
+
* @deprecated No longer used internally. Retained for backwards compatibility.
|
|
7
8
|
*/
|
|
8
9
|
export declare const MEMBER_CONNECTION_SUBSCRIPTION_STATUS_EXTENSION_ID = "data-connection-status";
|
|
9
10
|
/**
|
|
@@ -15,12 +16,13 @@ export declare const MEMBER_CONNECTION_SUBSCRIPTION_STATUS_EXTENSION_ID = "data-
|
|
|
15
16
|
*/
|
|
16
17
|
export interface ConnectionManager {
|
|
17
18
|
/**
|
|
18
|
-
* Retrieves a list of MemberConnections resources from
|
|
19
|
-
*
|
|
19
|
+
* Retrieves a list of MemberConnections resources from the server.
|
|
20
|
+
* Supports optional filtering by integrationType and status.
|
|
20
21
|
*
|
|
22
|
+
* @param request - Optional request with filter parameters (integrationType, status).
|
|
21
23
|
* @returns {Promise<BWellQueryResult<MemberConnection[]>>} A promise resolving to an object representing the list of MemberConnections resources retrieved, along with potential validation or GraphQL errors.
|
|
22
24
|
*/
|
|
23
|
-
getMemberConnections(): Promise<BWellQueryResult<MemberConnection[], BaseManagerError>>;
|
|
25
|
+
getMemberConnections(request?: MemberConnectionsRequest): Promise<BWellQueryResult<MemberConnection[], BaseManagerError>>;
|
|
24
26
|
/**
|
|
25
27
|
* Retrieves a data source by ID.
|
|
26
28
|
* Gets information about a specific healthcare provider connection.
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { MEMBER_CONNECTION_SUBSCRIPTION_STATUS_EXTENSION_ID, ConnectionManager, } from "./connection-manager.js";
|
|
2
2
|
export { DataSourceRequest, DataSourceRequestInput, ConnectionRequest, ConnectionRequestInput, } from "./connection-request.js";
|
|
3
|
+
export { MemberConnectionsRequest, MemberConnectionsRequestInput, } from "./member-connections-request.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input object for filtering member connections.
|
|
3
|
+
* @category Inputs
|
|
4
|
+
* @title MemberConnectionsRequestInput
|
|
5
|
+
* @excerpt Input for filtering member connections by integrationType and status
|
|
6
|
+
*/
|
|
7
|
+
export type MemberConnectionsRequestInput = {
|
|
8
|
+
integrationType?: string[];
|
|
9
|
+
status?: string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Request object for fetching member connections with optional filters.
|
|
13
|
+
* @category Requests
|
|
14
|
+
* @title MemberConnectionsRequest
|
|
15
|
+
* @excerpt Request object for fetching member connections with optional filters
|
|
16
|
+
*/
|
|
17
|
+
export declare class MemberConnectionsRequest {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(input?: MemberConnectionsRequestInput);
|
|
20
|
+
data(): {
|
|
21
|
+
integrationType: string[] | null;
|
|
22
|
+
status: string[] | null;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _MemberConnectionsRequest_input;
|
|
13
|
+
/**
|
|
14
|
+
* Request object for fetching member connections with optional filters.
|
|
15
|
+
* @category Requests
|
|
16
|
+
* @title MemberConnectionsRequest
|
|
17
|
+
* @excerpt Request object for fetching member connections with optional filters
|
|
18
|
+
*/
|
|
19
|
+
export class MemberConnectionsRequest {
|
|
20
|
+
constructor(input = {}) {
|
|
21
|
+
_MemberConnectionsRequest_input.set(this, void 0);
|
|
22
|
+
__classPrivateFieldSet(this, _MemberConnectionsRequest_input, input, "f");
|
|
23
|
+
}
|
|
24
|
+
data() {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return {
|
|
27
|
+
integrationType: (_a = __classPrivateFieldGet(this, _MemberConnectionsRequest_input, "f").integrationType) !== null && _a !== void 0 ? _a : null,
|
|
28
|
+
status: (_b = __classPrivateFieldGet(this, _MemberConnectionsRequest_input, "f").status) !== null && _b !== void 0 ? _b : null,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
_MemberConnectionsRequest_input = new WeakMap();
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { LoggerProvider } from "../../../logger/index.js";
|
|
2
2
|
import type { Connection, ConnectionStatus, DataSource, MemberConnection, OAuthUrl } from "../../../models/index.js";
|
|
3
3
|
import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
4
|
-
import { ConnectionManager, ConnectionRequest, DataSourceRequest } from "../../base/connection/index.js";
|
|
4
|
+
import { ConnectionManager, ConnectionRequest, DataSourceRequest, MemberConnectionsRequest } from "../../base/connection/index.js";
|
|
5
5
|
import { BaseManagerError } from "../../base/errors.js";
|
|
6
6
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
7
7
|
import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
8
|
-
import { GraphQLGetMemberConnectionsBWellResponseFactory } from "./connection-response-factory.js";
|
|
9
8
|
export declare class GraphQLConnectionManager extends GraphQLManager implements ConnectionManager {
|
|
10
9
|
#private;
|
|
11
|
-
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider
|
|
12
|
-
getMemberConnections(): Promise<BWellQueryResult<MemberConnection[], BaseManagerError>>;
|
|
10
|
+
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
|
|
11
|
+
getMemberConnections(request?: MemberConnectionsRequest): Promise<BWellQueryResult<MemberConnection[], BaseManagerError>>;
|
|
13
12
|
getDataSource(request: DataSourceRequest): Promise<BWellQueryResult<DataSource, BaseManagerError>>;
|
|
14
13
|
createConnection(request: ConnectionRequest): Promise<BWellTransactionResult<Connection, BaseManagerError>>;
|
|
15
14
|
disconnectConnection(request: DataSourceRequest): Promise<BWellTransactionResult<ConnectionStatus, BaseManagerError>>;
|
|
@@ -18,25 +18,25 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
18
18
|
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");
|
|
19
19
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
20
|
};
|
|
21
|
-
var _GraphQLConnectionManager_sdk, _GraphQLConnectionManager_logger
|
|
21
|
+
var _GraphQLConnectionManager_sdk, _GraphQLConnectionManager_logger;
|
|
22
22
|
import { ConsoleLoggerProvider, } from "../../../logger/index.js";
|
|
23
23
|
import { BWellQueryResult, BWellTransactionResult, } from "../../../results/index.js";
|
|
24
24
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
25
|
-
import {
|
|
25
|
+
import { MemberConnectionResponseFactory } from "./member-connection-response-factory.js";
|
|
26
26
|
export class GraphQLConnectionManager extends GraphQLManager {
|
|
27
|
-
constructor(sdk, loggerProvider = new ConsoleLoggerProvider()
|
|
27
|
+
constructor(sdk, loggerProvider = new ConsoleLoggerProvider()) {
|
|
28
28
|
super();
|
|
29
29
|
_GraphQLConnectionManager_sdk.set(this, void 0);
|
|
30
30
|
_GraphQLConnectionManager_logger.set(this, void 0);
|
|
31
|
-
_GraphQLConnectionManager_memberConnectionsResponseFactory.set(this, void 0);
|
|
32
31
|
__classPrivateFieldSet(this, _GraphQLConnectionManager_sdk, sdk, "f");
|
|
33
32
|
__classPrivateFieldSet(this, _GraphQLConnectionManager_logger, loggerProvider.getLogger("GraphQLConnectionManager"), "f");
|
|
34
|
-
__classPrivateFieldSet(this, _GraphQLConnectionManager_memberConnectionsResponseFactory, memberConnectionsResponseFactory, "f");
|
|
35
33
|
}
|
|
36
|
-
getMemberConnections() {
|
|
34
|
+
getMemberConnections(request) {
|
|
37
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
var _a, _b;
|
|
38
37
|
__classPrivateFieldGet(this, _GraphQLConnectionManager_logger, "f").verbose("calling getMemberConnections...");
|
|
39
|
-
const
|
|
38
|
+
const variables = request === null || request === void 0 ? void 0 : request.data();
|
|
39
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLConnectionManager_sdk, "f").getMemberConnections(variables));
|
|
40
40
|
__classPrivateFieldGet(this, _GraphQLConnectionManager_logger, "f").verbose("getMemberConnections complete");
|
|
41
41
|
if (result.hasError()) {
|
|
42
42
|
__classPrivateFieldGet(this, _GraphQLConnectionManager_logger, "f").error("getMemberConnections failed", result.error);
|
|
@@ -44,7 +44,9 @@ export class GraphQLConnectionManager extends GraphQLManager {
|
|
|
44
44
|
else {
|
|
45
45
|
__classPrivateFieldGet(this, _GraphQLConnectionManager_logger, "f").info("successfully called getMemberConnections");
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
const rawConnections = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.getMemberConnections) !== null && _b !== void 0 ? _b : [];
|
|
48
|
+
const connections = MemberConnectionResponseFactory.fromGraphQLResponseArray(rawConnections);
|
|
49
|
+
return new BWellQueryResult(connections, result.error);
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
getDataSource(request) {
|
|
@@ -160,4 +162,4 @@ export class GraphQLConnectionManager extends GraphQLManager {
|
|
|
160
162
|
});
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
|
-
_GraphQLConnectionManager_sdk = new WeakMap(), _GraphQLConnectionManager_logger = new WeakMap()
|
|
165
|
+
_GraphQLConnectionManager_sdk = new WeakMap(), _GraphQLConnectionManager_logger = new WeakMap();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GetMemberConnectionsQueryResults } from "../../../graphql/operations/types.js";
|
|
2
|
+
import type { MemberConnection } from "../../../models/index.js";
|
|
3
|
+
type RawConnection = GetMemberConnectionsQueryResults["getMemberConnections"][number];
|
|
4
|
+
/**
|
|
5
|
+
* Factory for transforming raw GraphQL connection responses into MemberConnection domain models.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MemberConnectionResponseFactory {
|
|
8
|
+
/**
|
|
9
|
+
* Transforms a raw GraphQL connection response into a MemberConnection.
|
|
10
|
+
*
|
|
11
|
+
* Note: Type casts for category, type, status, and syncStatus are safe because the GraphQL
|
|
12
|
+
* code generator ensures these values match the schema's string literal unions. If the schema
|
|
13
|
+
* adds new enum values, TypeScript strict mode will catch the mismatch at compile time.
|
|
14
|
+
*/
|
|
15
|
+
static fromGraphQLResponse(raw: RawConnection): MemberConnection;
|
|
16
|
+
/**
|
|
17
|
+
* Transforms an array of raw GraphQL connection responses into MemberConnections.
|
|
18
|
+
*/
|
|
19
|
+
static fromGraphQLResponseArray(raw: RawConnection[]): MemberConnection[];
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory for transforming raw GraphQL connection responses into MemberConnection domain models.
|
|
3
|
+
*/
|
|
4
|
+
export class MemberConnectionResponseFactory {
|
|
5
|
+
/**
|
|
6
|
+
* Transforms a raw GraphQL connection response into a MemberConnection.
|
|
7
|
+
*
|
|
8
|
+
* Note: Type casts for category, type, status, and syncStatus are safe because the GraphQL
|
|
9
|
+
* code generator ensures these values match the schema's string literal unions. If the schema
|
|
10
|
+
* adds new enum values, TypeScript strict mode will catch the mismatch at compile time.
|
|
11
|
+
*/
|
|
12
|
+
static fromGraphQLResponse(raw) {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
|
+
return {
|
|
15
|
+
id: raw.id,
|
|
16
|
+
name: raw.name,
|
|
17
|
+
category: raw.category,
|
|
18
|
+
type: raw.type,
|
|
19
|
+
integrationType: raw.integrationType,
|
|
20
|
+
status: raw.status,
|
|
21
|
+
syncStatus: raw.syncStatus,
|
|
22
|
+
syncError: (_b = (_a = raw.syncErrors) === null || _a === void 0 ? void 0 : _a.map((e) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
return ({
|
|
25
|
+
id: e.id,
|
|
26
|
+
text: e.text,
|
|
27
|
+
coding: (_b = (_a = e.coding) === null || _a === void 0 ? void 0 : _a.map((coding) => coding === null ? null : Object.assign({ id: null }, coding))) !== null && _b !== void 0 ? _b : null,
|
|
28
|
+
});
|
|
29
|
+
})) !== null && _b !== void 0 ? _b : null,
|
|
30
|
+
syncErrors: (_d = (_c = raw.syncErrors) === null || _c === void 0 ? void 0 : _c.map((e) => ({
|
|
31
|
+
id: e.id,
|
|
32
|
+
text: e.text,
|
|
33
|
+
coding: e.coding ? [...e.coding] : null,
|
|
34
|
+
}))) !== null && _d !== void 0 ? _d : null,
|
|
35
|
+
created: raw.created,
|
|
36
|
+
statusUpdated: raw.statusUpdated,
|
|
37
|
+
lastSynced: raw.lastSynced,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Transforms an array of raw GraphQL connection responses into MemberConnections.
|
|
42
|
+
*/
|
|
43
|
+
static fromGraphQLResponseArray(raw) {
|
|
44
|
+
return raw.map((c) => this.fromGraphQLResponse(c));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { isNotUndefined } from "../../../utils/index.js";
|
|
2
2
|
const CONSENT_CATEGORY_SYSTEM = "http://www.icanbwell.com/consent-category";
|
|
3
|
+
/**
|
|
4
|
+
* Maps the SDK's domain {@link CategoryCode} (the stored FHIR code, e.g.
|
|
5
|
+
* `"direct:import:records"`) to the GraphQL `CategoryCode` enum name the consent
|
|
6
|
+
* service's `createConsent` mutation requires (e.g. `DIRECT_IMPORT_RECORDS`).
|
|
7
|
+
*
|
|
8
|
+
* The service validates the inbound coding `code` against its category table —
|
|
9
|
+
* which is keyed by enum name — and rewrites it to the stored FHIR code. Sending
|
|
10
|
+
* the stored FHIR code directly is rejected as an unknown consent category. (The
|
|
11
|
+
* consent search path is the inverse: it token-matches on the stored FHIR code,
|
|
12
|
+
* which is the {@link CategoryCode} value itself.)
|
|
13
|
+
*
|
|
14
|
+
* Declared as a total `Record` so that adding a new {@link CategoryCode} is a
|
|
15
|
+
* compile error until its enum-name mapping is provided here.
|
|
16
|
+
*/
|
|
17
|
+
const CATEGORY_CODE_TO_GRAPHQL_NAME = {
|
|
18
|
+
"communicationPreferences:includePHI": "COMMUNICATION_PREFERENCES_PHI",
|
|
19
|
+
dataSharing: "DATA_SHARING",
|
|
20
|
+
"direct:import:records": "DIRECT_IMPORT_RECORDS",
|
|
21
|
+
healthCircleAdolescent: "HEALTH_CIRCLE_ADOLESCENT",
|
|
22
|
+
healthCircleMinor: "HEALTH_CIRCLE_MINOR",
|
|
23
|
+
healthMatch: "HEALTH_MATCH",
|
|
24
|
+
"ias:import:records": "IAS_IMPORT_RECORDS",
|
|
25
|
+
mobileCommunicationPreferences: "MOBILE_COMMUNICATION_PREFERENCES",
|
|
26
|
+
personalizedHealthOffersAndAds: "PERSONALIZED_HEALTH_OFFERS_AND_ADS",
|
|
27
|
+
proaAttestation: "PROA_ATTESTATION",
|
|
28
|
+
tos: "TOS",
|
|
29
|
+
};
|
|
3
30
|
export class CreateConsentRequestFactory {
|
|
4
31
|
create(request) {
|
|
5
32
|
const input = request.data();
|
|
@@ -26,7 +53,7 @@ export class CreateConsentRequestFactory {
|
|
|
26
53
|
coding: [
|
|
27
54
|
{
|
|
28
55
|
system: CONSENT_CATEGORY_SYSTEM,
|
|
29
|
-
code: input.category,
|
|
56
|
+
code: CATEGORY_CODE_TO_GRAPHQL_NAME[input.category],
|
|
30
57
|
},
|
|
31
58
|
],
|
|
32
59
|
},
|
|
@@ -96,7 +96,7 @@ export declare const CreateConnectionDocument = "\n mutation createConnection
|
|
|
96
96
|
export declare const DeleteConnectionDocument = "\n mutation deleteConnection($connectionId: String!) {\n deleteConnection(connectionId: $connectionId) {\n status\n statusUpdated\n }\n}\n ";
|
|
97
97
|
export declare const DisconnectConnectionDocument = "\n mutation disconnectConnection($connectionId: String!) {\n disconnectConnection(connectionId: $connectionId) {\n status\n statusUpdated\n }\n}\n ";
|
|
98
98
|
export declare const GetDataSourceDocument = "\n query getDataSource($connectionId: String!) {\n getDataSource(connectionId: $connectionId) {\n id\n name\n category\n type\n }\n}\n ";
|
|
99
|
-
export declare const GetMemberConnectionsDocument = "\n query getMemberConnections {\n
|
|
99
|
+
export declare const GetMemberConnectionsDocument = "\n query getMemberConnections($integrationType: [String!], $status: [String!]) {\n getMemberConnections(integrationType: $integrationType, status: $status) {\n id\n name\n category\n type\n integrationType\n status\n syncStatus\n syncErrors {\n id\n coding {\n code\n display\n system\n }\n text\n }\n statusUpdated\n lastSynced\n created\n }\n}\n ";
|
|
100
100
|
export declare const GetOauthUrlDocument = "\n query getOauthUrl($connectionId: String!) {\n getOauthUrl(connectionId: $connectionId) {\n redirectUrl\n }\n}\n ";
|
|
101
101
|
export declare const UpdateDeviceRegistrationDocument = "\n mutation updateDeviceRegistration($deviceToken: String!, $platformName: String!, $applicationName: String!, $notificationPreference: Boolean!) {\n updateDeviceRegistration(\n input: {deviceToken: $deviceToken, platform: $platformName, applicationName: $applicationName, notificationPreference: $notificationPreference}\n ) {\n id\n }\n}\n ";
|
|
102
102
|
export declare const PublishEventDocument = "\n mutation publishEvent($input: PublishEventRequest!) {\n publishEvent(input: $input) {\n id\n }\n}\n ";
|
|
@@ -1893,36 +1893,30 @@ export const GetDataSourceDocument = `
|
|
|
1893
1893
|
}
|
|
1894
1894
|
`;
|
|
1895
1895
|
export const GetMemberConnectionsDocument = `
|
|
1896
|
-
query getMemberConnections {
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
extension {
|
|
1912
|
-
id
|
|
1913
|
-
url
|
|
1914
|
-
valueString
|
|
1915
|
-
}
|
|
1916
|
-
notificationEvent {
|
|
1917
|
-
id
|
|
1918
|
-
timestamp
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1896
|
+
query getMemberConnections($integrationType: [String!], $status: [String!]) {
|
|
1897
|
+
getMemberConnections(integrationType: $integrationType, status: $status) {
|
|
1898
|
+
id
|
|
1899
|
+
name
|
|
1900
|
+
category
|
|
1901
|
+
type
|
|
1902
|
+
integrationType
|
|
1903
|
+
status
|
|
1904
|
+
syncStatus
|
|
1905
|
+
syncErrors {
|
|
1906
|
+
id
|
|
1907
|
+
coding {
|
|
1908
|
+
code
|
|
1909
|
+
display
|
|
1910
|
+
system
|
|
1921
1911
|
}
|
|
1912
|
+
text
|
|
1922
1913
|
}
|
|
1914
|
+
statusUpdated
|
|
1915
|
+
lastSynced
|
|
1916
|
+
created
|
|
1923
1917
|
}
|
|
1924
1918
|
}
|
|
1925
|
-
|
|
1919
|
+
`;
|
|
1926
1920
|
export const GetOauthUrlDocument = `
|
|
1927
1921
|
query getOauthUrl($connectionId: String!) {
|
|
1928
1922
|
getOauthUrl(connectionId: $connectionId) {
|
|
@@ -9541,43 +9541,31 @@ export type GetDataSourceQueryResults = {
|
|
|
9541
9541
|
};
|
|
9542
9542
|
};
|
|
9543
9543
|
export type GetMemberConnectionsQueryVariables = Types.Exact<{
|
|
9544
|
-
|
|
9544
|
+
integrationType: Types.InputMaybe<Array<Types.Scalars['String']['input']> | Types.Scalars['String']['input']>;
|
|
9545
|
+
status: Types.InputMaybe<Array<Types.Scalars['String']['input']> | Types.Scalars['String']['input']>;
|
|
9545
9546
|
}>;
|
|
9546
9547
|
export type GetMemberConnectionsQueryResults = {
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
extension: Array<{
|
|
9569
|
-
id: string | null;
|
|
9570
|
-
url: any | null;
|
|
9571
|
-
valueString: string | null;
|
|
9572
|
-
} | null> | null;
|
|
9573
|
-
notificationEvent: Array<{
|
|
9574
|
-
id: string | null;
|
|
9575
|
-
timestamp: any | null;
|
|
9576
|
-
} | null> | null;
|
|
9577
|
-
} | null> | null;
|
|
9578
|
-
} | null;
|
|
9579
|
-
} | null> | null;
|
|
9580
|
-
} | null;
|
|
9548
|
+
getMemberConnections: Array<{
|
|
9549
|
+
id: string;
|
|
9550
|
+
name: string;
|
|
9551
|
+
category: Types.ConnectionCategory;
|
|
9552
|
+
type: Types.DataConnectionType;
|
|
9553
|
+
integrationType: string | null;
|
|
9554
|
+
status: Types.DataConnectionStatus | null;
|
|
9555
|
+
syncStatus: Types.SyncStatus | null;
|
|
9556
|
+
statusUpdated: any | null;
|
|
9557
|
+
lastSynced: any | null;
|
|
9558
|
+
created: any;
|
|
9559
|
+
syncErrors: Array<{
|
|
9560
|
+
id: string | null;
|
|
9561
|
+
text: string | null;
|
|
9562
|
+
coding: Array<{
|
|
9563
|
+
code: string | null;
|
|
9564
|
+
display: string | null;
|
|
9565
|
+
system: string | null;
|
|
9566
|
+
} | null> | null;
|
|
9567
|
+
}> | null;
|
|
9568
|
+
}>;
|
|
9581
9569
|
};
|
|
9582
9570
|
export type GetOauthUrlQueryVariables = Types.Exact<{
|
|
9583
9571
|
connectionId: Types.Scalars['String']['input'];
|
package/dist/graphql/schema.d.ts
CHANGED
|
@@ -15239,10 +15239,16 @@ export type Connection = {
|
|
|
15239
15239
|
__typename?: 'Connection';
|
|
15240
15240
|
/** Category of data source */
|
|
15241
15241
|
category: ConnectionCategory;
|
|
15242
|
+
/** URL of the consent policy */
|
|
15243
|
+
consentPolicyUrl?: Maybe<Scalars['String']['output']>;
|
|
15244
|
+
/** ISO 8601 duration (e.g. P1Y, P30D) for which member consent remains valid */
|
|
15245
|
+
consentValidityDuration?: Maybe<Scalars['String']['output']>;
|
|
15242
15246
|
/** Token creation datetime */
|
|
15243
15247
|
created: Scalars['DateTime']['output'];
|
|
15244
15248
|
/** URL to disconnect this device connection */
|
|
15245
15249
|
disconnectUrl?: Maybe<Scalars['String']['output']>;
|
|
15250
|
+
/** Operational status of the endpoint */
|
|
15251
|
+
endpointStatus?: Maybe<Scalars['String']['output']>;
|
|
15246
15252
|
/** Uniquely identifies a data source */
|
|
15247
15253
|
id: Scalars['String']['output'];
|
|
15248
15254
|
/** Specifies whether the connection is direct or indirect or proa */
|
|
@@ -19017,6 +19023,12 @@ export type DataSource = {
|
|
|
19017
19023
|
__typename?: 'DataSource';
|
|
19018
19024
|
/** Category of data source */
|
|
19019
19025
|
category: ConnectionCategory;
|
|
19026
|
+
/** URL of the consent policy */
|
|
19027
|
+
consentPolicyUrl?: Maybe<Scalars['String']['output']>;
|
|
19028
|
+
/** ISO 8601 duration (e.g. P1Y, P30D) for which member consent remains valid */
|
|
19029
|
+
consentValidityDuration?: Maybe<Scalars['String']['output']>;
|
|
19030
|
+
/** Operational status of the endpoint */
|
|
19031
|
+
endpointStatus?: Maybe<Scalars['String']['output']>;
|
|
19020
19032
|
/** Uniquely identifies a data source */
|
|
19021
19033
|
id: Scalars['String']['output'];
|
|
19022
19034
|
/** Specifies whether the connection is direct or indirect or proa */
|
|
@@ -23663,6 +23675,7 @@ export type EmbeddableConfiguration = {
|
|
|
23663
23675
|
authStrategy: Scalars['String']['output'];
|
|
23664
23676
|
idleThreshold: Scalars['Int']['output'];
|
|
23665
23677
|
routeDefinition: Array<RouteDefinition>;
|
|
23678
|
+
themeId?: Maybe<Scalars['String']['output']>;
|
|
23666
23679
|
webSdkVersion: Scalars['String']['output'];
|
|
23667
23680
|
};
|
|
23668
23681
|
export type EmpiType = 'BWELL_PATIENT' | 'BWELL_PERSON' | 'CLIENT_PATIENT' | 'CLIENT_PERSON';
|
|
@@ -24500,12 +24513,13 @@ export type EndpointStatus = 'active' | 'entered_in_error' | 'error' | 'off' | '
|
|
|
24500
24513
|
*/
|
|
24501
24514
|
export type EndpointStatusEnum = 'ACTIVE' | 'ENTERED_IN_ERROR' | 'ERROR' | 'OFF' | 'SUSPENDED' | 'TEST';
|
|
24502
24515
|
/**
|
|
24503
|
-
*
|
|
24516
|
+
* Endpoint type
|
|
24504
24517
|
* New version
|
|
24505
24518
|
*/
|
|
24506
24519
|
export type EndpointType = {
|
|
24507
24520
|
__typename?: 'EndpointType';
|
|
24508
24521
|
name?: Maybe<Scalars['String']['output']>;
|
|
24522
|
+
status?: Maybe<EndpointStatusEnum>;
|
|
24509
24523
|
};
|
|
24510
24524
|
/**
|
|
24511
24525
|
* EnrollmentRequest
|
|
@@ -2,5 +2,5 @@ export type { BaseConnection } from "./base-connection.js";
|
|
|
2
2
|
export type { Connection } from "./connection.js";
|
|
3
3
|
export type { ConnectionStatus } from "./connection-status.js";
|
|
4
4
|
export type { DataSource } from "./data-source.js";
|
|
5
|
-
export type { MemberConnection } from "./member-connection.js";
|
|
5
|
+
export type { MemberConnection, SyncErrorCodeableConcept, } from "./member-connection.js";
|
|
6
6
|
export type { OAuthUrl } from "./oauth-url.js";
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { CodeableConcept } from "../common/codeable-concept.js";
|
|
2
2
|
import type { DataConnectionStatus, SyncStatus } from "../enums/index.js";
|
|
3
3
|
import type { BaseConnection } from "./base-connection.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a sync error with codeable concept fields.
|
|
6
|
+
*/
|
|
7
|
+
export type SyncErrorCodeableConcept = {
|
|
8
|
+
id: string | null;
|
|
9
|
+
coding: ({
|
|
10
|
+
code: string | null;
|
|
11
|
+
display: string | null;
|
|
12
|
+
system: string | null;
|
|
13
|
+
} | null)[] | null;
|
|
14
|
+
text: string | null;
|
|
15
|
+
};
|
|
4
16
|
/**
|
|
5
17
|
* MemberConnection model representing a member's healthcare provider connection.
|
|
6
18
|
* Contains connection metadata including authentication and synchronization status.
|
|
@@ -10,18 +22,29 @@ import type { BaseConnection } from "./base-connection.js";
|
|
|
10
22
|
* @excerpt MemberConnection model representing a member's healthcare provider connection
|
|
11
23
|
*/
|
|
12
24
|
export type MemberConnection = BaseConnection & {
|
|
25
|
+
/**
|
|
26
|
+
* The integration type of the connection (e.g., DIRECT, PROA, DIRECT_IAS, INDIRECT_IAS, IAL2).
|
|
27
|
+
*/
|
|
28
|
+
integrationType: string | null;
|
|
13
29
|
/**
|
|
14
30
|
* The authentication token status.
|
|
31
|
+
* Null when the status is not yet determined or unknown.
|
|
15
32
|
*/
|
|
16
|
-
status: DataConnectionStatus;
|
|
33
|
+
status: DataConnectionStatus | null;
|
|
17
34
|
/**
|
|
18
35
|
* The status of the data ingest pipeline.
|
|
36
|
+
* Null when the sync status is not yet determined or unknown.
|
|
19
37
|
*/
|
|
20
|
-
syncStatus: SyncStatus;
|
|
38
|
+
syncStatus: SyncStatus | null;
|
|
21
39
|
/**
|
|
22
40
|
* Errors from the data ingest pipeline.
|
|
41
|
+
* @deprecated Use syncErrors instead.
|
|
23
42
|
*/
|
|
24
43
|
syncError: (CodeableConcept | null)[] | null;
|
|
44
|
+
/**
|
|
45
|
+
* Errors from the data ingest pipeline.
|
|
46
|
+
*/
|
|
47
|
+
syncErrors: SyncErrorCodeableConcept[] | null;
|
|
25
48
|
/**
|
|
26
49
|
* The timestamp when connection was created.
|
|
27
50
|
*/
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* @title CategoryCode
|
|
7
7
|
* @excerpt CategoryCode enum representing the category code for consents or data.
|
|
8
8
|
*/
|
|
9
|
-
export type CategoryCode = "communicationPreferences:includePHI" | "dataSharing" | "healthCircleAdolescent" | "healthCircleMinor" | "healthMatch" | "ias:import:records" | "mobileCommunicationPreferences" | "personalizedHealthOffersAndAds" | "proaAttestation" | "tos";
|
|
9
|
+
export type CategoryCode = "communicationPreferences:includePHI" | "dataSharing" | "direct:import:records" | "healthCircleAdolescent" | "healthCircleMinor" | "healthMatch" | "ias:import:records" | "mobileCommunicationPreferences" | "personalizedHealthOffersAndAds" | "proaAttestation" | "tos";
|
|
10
10
|
/** @internal */
|
|
11
|
-
export declare const categoryCodeValues: readonly ["communicationPreferences:includePHI", "dataSharing", "healthCircleAdolescent", "healthCircleMinor", "healthMatch", "ias:import:records", "mobileCommunicationPreferences", "personalizedHealthOffersAndAds", "proaAttestation", "tos"];
|
|
11
|
+
export declare const categoryCodeValues: readonly ["communicationPreferences:includePHI", "dataSharing", "direct:import:records", "healthCircleAdolescent", "healthCircleMinor", "healthMatch", "ias:import:records", "mobileCommunicationPreferences", "personalizedHealthOffersAndAds", "proaAttestation", "tos"];
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GetMemberConnectionsQueryResults } from "../../../graphql/operations/types.js";
|
|
2
|
-
import { MemberConnection } from "../../../models/index.js";
|
|
3
|
-
import { BWellQueryResult, BWellQueryResultFactory } from "../../../results/index.js";
|
|
4
|
-
export declare class GraphQLGetMemberConnectionsBWellResponseFactory implements BWellQueryResultFactory<BWellQueryResult<GetMemberConnectionsQueryResults>, BWellQueryResult<MemberConnection[]>> {
|
|
5
|
-
#private;
|
|
6
|
-
create(result: BWellQueryResult<GetMemberConnectionsQueryResults>): BWellQueryResult<MemberConnection[]>;
|
|
7
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _GraphQLGetMemberConnectionsBWellResponseFactory_instances, _GraphQLGetMemberConnectionsBWellResponseFactory_buildFromSubscription, _GraphQLGetMemberConnectionsBWellResponseFactory_getEventTimestamp;
|
|
7
|
-
import { BWellQueryResult, } from "../../../results/index.js";
|
|
8
|
-
import { isNotNullOrUndefined, isNullOrUndefined, } from "../../../utils/type-utils.js";
|
|
9
|
-
export class GraphQLGetMemberConnectionsBWellResponseFactory {
|
|
10
|
-
constructor() {
|
|
11
|
-
_GraphQLGetMemberConnectionsBWellResponseFactory_instances.add(this);
|
|
12
|
-
}
|
|
13
|
-
create(result) {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
const connections = [];
|
|
16
|
-
const subscriptions = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.subscriptions) === null || _b === void 0 ? void 0 : _b.entry;
|
|
17
|
-
if (isNullOrUndefined(subscriptions) || subscriptions.length === 0) {
|
|
18
|
-
return new BWellQueryResult(connections, result.error);
|
|
19
|
-
}
|
|
20
|
-
for (const subscription of subscriptions) {
|
|
21
|
-
if (isNullOrUndefined(subscription)) {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
const connection = __classPrivateFieldGet(this, _GraphQLGetMemberConnectionsBWellResponseFactory_instances, "m", _GraphQLGetMemberConnectionsBWellResponseFactory_buildFromSubscription).call(this, subscription);
|
|
25
|
-
if (isNotNullOrUndefined(connection)) {
|
|
26
|
-
connections.push(connection);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return new BWellQueryResult(connections, result.error);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
_GraphQLGetMemberConnectionsBWellResponseFactory_instances = new WeakSet(), _GraphQLGetMemberConnectionsBWellResponseFactory_buildFromSubscription = function _GraphQLGetMemberConnectionsBWellResponseFactory_buildFromSubscription(subscription) {
|
|
33
|
-
var _a, _b, _c;
|
|
34
|
-
const subscriptionStatus = (_b = (_a = subscription === null || subscription === void 0 ? void 0 : subscription.resource) === null || _a === void 0 ? void 0 : _a.subscriptionStatus) === null || _b === void 0 ? void 0 : _b[0];
|
|
35
|
-
if (isNullOrUndefined(subscriptionStatus)) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const extensions = subscriptionStatus === null || subscriptionStatus === void 0 ? void 0 : subscriptionStatus.extension;
|
|
39
|
-
if (isNullOrUndefined(extensions) || extensions.length === 0) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
const events = subscriptionStatus.notificationEvent;
|
|
43
|
-
if (isNullOrUndefined(events) || events.length === 0) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
const connection = {};
|
|
47
|
-
// Map extensions to connection fields
|
|
48
|
-
for (const extension of extensions) {
|
|
49
|
-
const extensionKey = extension === null || extension === void 0 ? void 0 : extension.id;
|
|
50
|
-
const extensionValue = extension === null || extension === void 0 ? void 0 : extension.valueString;
|
|
51
|
-
if (isNullOrUndefined(extensionKey) ||
|
|
52
|
-
isNullOrUndefined(extensionValue)) {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
switch (extensionKey) {
|
|
56
|
-
case "service_slug":
|
|
57
|
-
connection.id = extensionValue;
|
|
58
|
-
break;
|
|
59
|
-
case "token-status":
|
|
60
|
-
connection.status = extensionValue;
|
|
61
|
-
break;
|
|
62
|
-
case "connection_name":
|
|
63
|
-
connection.name = extensionValue;
|
|
64
|
-
break;
|
|
65
|
-
case "connection_type": // mapped to category
|
|
66
|
-
connection.category =
|
|
67
|
-
extensionValue.toLowerCase() === "hapi" ? "BASIC" : "OAUTH";
|
|
68
|
-
break;
|
|
69
|
-
case "category": // mapped to type
|
|
70
|
-
connection.type = extensionValue;
|
|
71
|
-
break;
|
|
72
|
-
case "data-connection-status":
|
|
73
|
-
connection.syncStatus = extensionValue;
|
|
74
|
-
break;
|
|
75
|
-
default:
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// Timestamp when subscription status last updated
|
|
80
|
-
connection.statusUpdated = ((_c = subscriptionStatus.meta) === null || _c === void 0 ? void 0 : _c.lastUpdated) || null;
|
|
81
|
-
// Timestamp when connection token was created (required)
|
|
82
|
-
connection.created = __classPrivateFieldGet(this, _GraphQLGetMemberConnectionsBWellResponseFactory_instances, "m", _GraphQLGetMemberConnectionsBWellResponseFactory_getEventTimestamp).call(this, "created-date", events);
|
|
83
|
-
// Timestamp when data was last synchronized by pipeline
|
|
84
|
-
const dataLastUpdated = __classPrivateFieldGet(this, _GraphQLGetMemberConnectionsBWellResponseFactory_instances, "m", _GraphQLGetMemberConnectionsBWellResponseFactory_getEventTimestamp).call(this, "data-last-updated", events);
|
|
85
|
-
const dataRetrievalEnd = __classPrivateFieldGet(this, _GraphQLGetMemberConnectionsBWellResponseFactory_instances, "m", _GraphQLGetMemberConnectionsBWellResponseFactory_getEventTimestamp).call(this, "data-retrieval-end", events);
|
|
86
|
-
connection.lastSynced = dataLastUpdated || dataRetrievalEnd || null;
|
|
87
|
-
// Errors reported by pipeline during data ingest
|
|
88
|
-
connection.syncError = subscriptionStatus === null || subscriptionStatus === void 0 ? void 0 : subscriptionStatus.error;
|
|
89
|
-
// Validate connection object
|
|
90
|
-
if (isNullOrUndefined(connection.id) ||
|
|
91
|
-
isNullOrUndefined(connection.name) ||
|
|
92
|
-
isNullOrUndefined(connection.category) ||
|
|
93
|
-
isNullOrUndefined(connection.type) ||
|
|
94
|
-
isNullOrUndefined(connection.created)) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
return connection;
|
|
98
|
-
}, _GraphQLGetMemberConnectionsBWellResponseFactory_getEventTimestamp = function _GraphQLGetMemberConnectionsBWellResponseFactory_getEventTimestamp(id, events) {
|
|
99
|
-
var _a;
|
|
100
|
-
return (_a = events.find((e) => (e === null || e === void 0 ? void 0 : e.id) === id)) === null || _a === void 0 ? void 0 : _a.timestamp;
|
|
101
|
-
};
|