@icure/api 8.6.5 → 8.6.7
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/icc-api/api/IccFormApi.d.ts +89 -0
- package/icc-api/api/IccFormApi.js +234 -0
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.d.ts +93 -0
- package/icc-x-api/icc-accesslog-x-api.js +93 -0
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +122 -0
- package/icc-x-api/icc-calendar-item-x-api.js +122 -0
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +20 -0
- package/icc-x-api/icc-classification-x-api.js +20 -0
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-code-x-api.d.ts +23 -0
- package/icc-x-api/icc-code-x-api.js +23 -0
- package/icc-x-api/icc-code-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +219 -1
- package/icc-x-api/icc-contact-x-api.js +219 -2
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-data-owner-x-api.d.ts +14 -3
- package/icc-x-api/icc-data-owner-x-api.js +14 -3
- package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
- package/icc-x-api/icc-device-x-api.d.ts +8 -0
- package/icc-x-api/icc-device-x-api.js +8 -0
- package/icc-x-api/icc-device-x-api.js.map +1 -1
- package/icc-x-api/icc-doctemplate-x-api.d.ts +26 -0
- package/icc-x-api/icc-doctemplate-x-api.js +26 -0
- package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +114 -1
- package/icc-x-api/icc-document-x-api.js +127 -1
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +34 -4
- package/icc-x-api/icc-form-x-api.js +34 -4
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-hcparty-x-api.d.ts +67 -0
- package/icc-x-api/icc-hcparty-x-api.js +67 -0
- package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +141 -0
- package/icc-x-api/icc-helement-x-api.js +141 -0
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +54 -0
- package/icc-x-api/icc-invoice-x-api.js +54 -0
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +162 -0
- package/icc-x-api/icc-message-x-api.js +162 -0
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +245 -0
- package/icc-x-api/icc-patient-x-api.js +245 -1
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +25 -0
- package/icc-x-api/icc-receipt-x-api.js +25 -0
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-user-x-api.d.ts +25 -0
- package/icc-x-api/icc-user-x-api.js +25 -0
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/package.json +1 -1
- package/test/icc-x-api/icc-form-x-api.js +316 -1
- package/test/icc-x-api/icc-form-x-api.js.map +1 -1
- package/test/utils/roles.js +5 -0
- package/test/utils/roles.js.map +1 -1
- package/test/utils/test_utils.js +1 -21
- package/test/utils/test_utils.js.map +1 -1
|
@@ -27,6 +27,13 @@ export declare class IccMessageXApi extends IccMessageApi implements EncryptedEn
|
|
|
27
27
|
constructor(host: string, headers: {
|
|
28
28
|
[key: string]: string;
|
|
29
29
|
}, crypto: IccCryptoXApi, dataOwnerApi: IccDataOwnerXApi, authApi: IccAuthApi, autofillAuthor: boolean, authenticationProvider?: AuthenticationProvider, encryptedKeys?: Array<string>, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new instance of message with initialised encryption metadata (not in the database).
|
|
32
|
+
* @param user the current user.
|
|
33
|
+
* @param m initialised data for the message. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify
|
|
34
|
+
* other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.
|
|
35
|
+
* @return a new instance of message.
|
|
36
|
+
*/
|
|
30
37
|
newInstance(user: User, m: any): Promise<models.Message>;
|
|
31
38
|
/**
|
|
32
39
|
* Creates a new instance of message with initialised encryption metadata (not in the database).
|
|
@@ -51,10 +58,20 @@ export declare class IccMessageXApi extends IccMessageApi implements EncryptedEn
|
|
|
51
58
|
sfkOption?: SecretIdUseOption;
|
|
52
59
|
alternateRootDelegation?: string;
|
|
53
60
|
}): Promise<models.Message>;
|
|
61
|
+
/**
|
|
62
|
+
* Decrypts the encrypted content of messages.
|
|
63
|
+
* @param messages the messages to decrypt.
|
|
64
|
+
* @return the decrypted messages with their encryption status.
|
|
65
|
+
*/
|
|
54
66
|
decrypt(messages: Array<models.Message>): Promise<{
|
|
55
67
|
entity: models.Message;
|
|
56
68
|
decrypted: boolean;
|
|
57
69
|
}[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Encrypts the content of messages.
|
|
72
|
+
* @param messages the messages to encrypt.
|
|
73
|
+
* @return the encrypted messages.
|
|
74
|
+
*/
|
|
58
75
|
encrypt(messages: Array<models.Message>): Promise<Array<models.Message>>;
|
|
59
76
|
/**
|
|
60
77
|
* @param message a message
|
|
@@ -140,18 +157,65 @@ export declare class IccMessageXApi extends IccMessageApi implements EncryptedEn
|
|
|
140
157
|
* the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.
|
|
141
158
|
*/
|
|
142
159
|
decryptSecretIdsOf(message: models.Message): Promise<string[]>;
|
|
160
|
+
/**
|
|
161
|
+
* Creates or updates de-anonymization metadata for the message, allowing resolution of anonymous delegations.
|
|
162
|
+
* @param entity the message.
|
|
163
|
+
* @param delegates the data owner ids of the delegates.
|
|
164
|
+
*/
|
|
143
165
|
createDelegationDeAnonymizationMetadata(entity: Message, delegates: string[]): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Retrieves the data owners that have access to the message.
|
|
168
|
+
* @param entity the message.
|
|
169
|
+
* @return the data owners with their access levels and a flag indicating if there are unknown anonymous data owners.
|
|
170
|
+
*/
|
|
144
171
|
getDataOwnersWithAccessTo(entity: models.Message): Promise<{
|
|
145
172
|
permissionsByDataOwnerId: {
|
|
146
173
|
[p: string]: AccessLevelEnum;
|
|
147
174
|
};
|
|
148
175
|
hasUnknownAnonymousDataOwners: boolean;
|
|
149
176
|
}>;
|
|
177
|
+
/**
|
|
178
|
+
* Retrieves the encryption keys of the message.
|
|
179
|
+
* @param entity the message.
|
|
180
|
+
* @return the encryption keys.
|
|
181
|
+
*/
|
|
150
182
|
getEncryptionKeysOf(entity: models.Message): Promise<string[]>;
|
|
183
|
+
/**
|
|
184
|
+
* Subscribes to message events (create, update, delete).
|
|
185
|
+
* @param eventTypes the types of events to subscribe to.
|
|
186
|
+
* @param filter optional filter to apply to the events.
|
|
187
|
+
* @param eventFired callback function to be called when an event is fired.
|
|
188
|
+
* @param options optional subscription options.
|
|
189
|
+
* @return a connection that can be used to close the subscription.
|
|
190
|
+
*/
|
|
151
191
|
subscribeToMessageEvents(eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[], filter: AbstractFilter<Message> | undefined, eventFired: (message: Message) => Promise<void>, options?: SubscriptionOptions): Promise<Connection>;
|
|
152
192
|
private decryptPage;
|
|
193
|
+
/**
|
|
194
|
+
* Creates a message.
|
|
195
|
+
* @param user the current user (unused, for compatibility).
|
|
196
|
+
* @param body the message to create.
|
|
197
|
+
* @return the created message.
|
|
198
|
+
*/
|
|
153
199
|
createMessageWithUser(user: models.User | undefined, body: Message): Promise<Message>;
|
|
200
|
+
/**
|
|
201
|
+
* Finds messages with pagination.
|
|
202
|
+
* @param user the current user (unused, for compatibility).
|
|
203
|
+
* @param startKey optional start key for pagination.
|
|
204
|
+
* @param startDocumentId optional start document id for pagination.
|
|
205
|
+
* @param limit optional maximum number of results to return.
|
|
206
|
+
* @return a paginated list of messages.
|
|
207
|
+
*/
|
|
154
208
|
findMessagesWithUser(user: models.User | undefined, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListMessage>;
|
|
209
|
+
/**
|
|
210
|
+
* Finds messages by sender address with pagination.
|
|
211
|
+
* @param user the current user (unused, for compatibility).
|
|
212
|
+
* @param fromAddress the sender address to filter by.
|
|
213
|
+
* @param startKey optional start key for pagination.
|
|
214
|
+
* @param startDocumentId optional start document id for pagination.
|
|
215
|
+
* @param limit optional maximum number of results to return.
|
|
216
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
217
|
+
* @return a paginated list of messages.
|
|
218
|
+
*/
|
|
155
219
|
findMessagesByFromAddressWithUser(user: models.User | undefined, fromAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): Promise<PaginatedListMessage>;
|
|
156
220
|
/**
|
|
157
221
|
* @deprecated
|
|
@@ -161,18 +225,116 @@ export declare class IccMessageXApi extends IccMessageApi implements EncryptedEn
|
|
|
161
225
|
* @deprecated
|
|
162
226
|
*/
|
|
163
227
|
findMessagesByHCPartyPatientForeignKeysWithUser(user: models.User | undefined, secretFKeys: string): Promise<Array<Message>>;
|
|
228
|
+
/**
|
|
229
|
+
* Finds messages by recipient address with pagination.
|
|
230
|
+
* @param user the current user (unused, for compatibility).
|
|
231
|
+
* @param toAddress the recipient address to filter by.
|
|
232
|
+
* @param startKey optional start key for pagination.
|
|
233
|
+
* @param startDocumentId optional start document id for pagination.
|
|
234
|
+
* @param limit optional maximum number of results to return.
|
|
235
|
+
* @param reverse optional flag to reverse the sort order.
|
|
236
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
237
|
+
* @return a paginated list of messages.
|
|
238
|
+
*/
|
|
164
239
|
findMessagesByToAddressWithUser(user: models.User | undefined, toAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, reverse?: boolean, hcpId?: string): Promise<PaginatedListMessage>;
|
|
240
|
+
/**
|
|
241
|
+
* Finds messages by transport GUID with pagination.
|
|
242
|
+
* @param user the current user (unused, for compatibility).
|
|
243
|
+
* @param transportGuid the transport GUID to filter by.
|
|
244
|
+
* @param received optional flag to filter by received status.
|
|
245
|
+
* @param startKey optional start key for pagination.
|
|
246
|
+
* @param startDocumentId optional start document id for pagination.
|
|
247
|
+
* @param limit optional maximum number of results to return.
|
|
248
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
249
|
+
* @return a paginated list of messages.
|
|
250
|
+
*/
|
|
165
251
|
findMessagesByTransportGuidWithUser(user: models.User | undefined, transportGuid?: string, received?: boolean, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): Promise<PaginatedListMessage>;
|
|
252
|
+
/**
|
|
253
|
+
* Finds messages by transport GUID and sent date range with pagination.
|
|
254
|
+
* @param user the current user (unused, for compatibility).
|
|
255
|
+
* @param transportGuid the transport GUID to filter by.
|
|
256
|
+
* @param from optional start timestamp for the date range.
|
|
257
|
+
* @param to optional end timestamp for the date range.
|
|
258
|
+
* @param startKey optional start key for pagination.
|
|
259
|
+
* @param startDocumentId optional start document id for pagination.
|
|
260
|
+
* @param limit optional maximum number of results to return.
|
|
261
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
262
|
+
* @return a paginated list of messages.
|
|
263
|
+
*/
|
|
166
264
|
findMessagesByTransportGuidSentDateWithUser(user: models.User | undefined, transportGuid?: string, from?: number, to?: number, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): Promise<PaginatedListMessage>;
|
|
265
|
+
/**
|
|
266
|
+
* Retrieves the children messages of a message.
|
|
267
|
+
* @param user the current user (unused, for compatibility).
|
|
268
|
+
* @param messageId the id of the parent message.
|
|
269
|
+
* @return the children messages.
|
|
270
|
+
*/
|
|
167
271
|
getChildrenMessagesWithUser(user: models.User | undefined, messageId: string): Promise<Array<Message>>;
|
|
272
|
+
/**
|
|
273
|
+
* Retrieves the children messages of a list of parent messages.
|
|
274
|
+
* @param user the current user (unused, for compatibility).
|
|
275
|
+
* @param body the list of parent message ids.
|
|
276
|
+
* @return the children messages.
|
|
277
|
+
*/
|
|
168
278
|
getChildrenMessagesOfListWithUser(user: models.User | undefined, body?: ListOfIds): Promise<Array<Message>>;
|
|
279
|
+
/**
|
|
280
|
+
* Retrieves a message by its id.
|
|
281
|
+
* @param user the current user (unused, for compatibility).
|
|
282
|
+
* @param messageId the id of the message.
|
|
283
|
+
* @return the message.
|
|
284
|
+
*/
|
|
169
285
|
getMessageWithUser(user: models.User | undefined, messageId: string): Promise<Message>;
|
|
286
|
+
/**
|
|
287
|
+
* Retrieves multiple messages by their ids.
|
|
288
|
+
* @param user the current user (unused, for compatibility).
|
|
289
|
+
* @param messageIds the list of message ids.
|
|
290
|
+
* @return the messages.
|
|
291
|
+
*/
|
|
170
292
|
getMessagesWithUser(user: models.User | undefined, messageIds: ListOfIds): Promise<Message[]>;
|
|
293
|
+
/**
|
|
294
|
+
* Lists messages by invoice ids.
|
|
295
|
+
* @param user the current user (unused, for compatibility).
|
|
296
|
+
* @param body the list of invoice ids.
|
|
297
|
+
* @return the messages associated with the invoices.
|
|
298
|
+
*/
|
|
171
299
|
listMessagesByInvoiceIdsWithUser(user: models.User | undefined, body?: ListOfIds): Promise<Array<Message>>;
|
|
300
|
+
/**
|
|
301
|
+
* Lists messages by transport GUIDs.
|
|
302
|
+
* @param user the current user (unused, for compatibility).
|
|
303
|
+
* @param hcpId the healthcare party id.
|
|
304
|
+
* @param body the list of transport GUIDs.
|
|
305
|
+
* @return the messages associated with the transport GUIDs.
|
|
306
|
+
*/
|
|
172
307
|
listMessagesByTransportGuidsWithUser(user: models.User | undefined, hcpId: string, body?: ListOfIds): Promise<Array<Message>>;
|
|
308
|
+
/**
|
|
309
|
+
* Modifies a message.
|
|
310
|
+
* @param user the current user (unused, for compatibility).
|
|
311
|
+
* @param body the message to modify.
|
|
312
|
+
* @return the modified message.
|
|
313
|
+
*/
|
|
173
314
|
modifyMessageWithUser(user: models.User | undefined, body: Message): Promise<Message>;
|
|
315
|
+
/**
|
|
316
|
+
* Sets the status bits of multiple messages.
|
|
317
|
+
* @param user the current user (unused, for compatibility).
|
|
318
|
+
* @param status the status bits to set.
|
|
319
|
+
* @param body the list of message ids.
|
|
320
|
+
* @return the updated messages.
|
|
321
|
+
*/
|
|
174
322
|
setMessagesStatusBitsWithUser(user: models.User | undefined, status: number, body?: ListOfIds): Promise<Array<Message>>;
|
|
323
|
+
/**
|
|
324
|
+
* Filters messages using a filter chain with pagination.
|
|
325
|
+
* @param user the current user (unused, for compatibility).
|
|
326
|
+
* @param body the filter chain to apply.
|
|
327
|
+
* @param startDocumentId optional start document id for pagination.
|
|
328
|
+
* @param limit optional maximum number of results to return.
|
|
329
|
+
* @return a paginated list of filtered messages.
|
|
330
|
+
*/
|
|
175
331
|
filterMessagesByWithUser(user: models.User | undefined, body: FilterChainMessage, startDocumentId?: string, limit?: number): Promise<PaginatedListMessage>;
|
|
332
|
+
/**
|
|
333
|
+
* Sets the read status of multiple messages.
|
|
334
|
+
* @param user the current user (unused, for compatibility).
|
|
335
|
+
* @param body the read status update information.
|
|
336
|
+
* @return the updated messages.
|
|
337
|
+
*/
|
|
176
338
|
setMessagesReadStatusWithUser(user: models.User | undefined, body?: MessagesReadStatusUpdate): Promise<Array<Message>>;
|
|
177
339
|
createMessage(body?: Message): never;
|
|
178
340
|
findMessages(startKey?: string, startDocumentId?: string, limit?: number): never;
|
|
@@ -35,6 +35,13 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
35
35
|
this.encryptedFields = (0, utils_1.parseEncryptedFields)(encryptedKeys, 'Message.');
|
|
36
36
|
}
|
|
37
37
|
// noinspection JSUnusedGlobalSymbols
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new instance of message with initialised encryption metadata (not in the database).
|
|
40
|
+
* @param user the current user.
|
|
41
|
+
* @param m initialised data for the message. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify
|
|
42
|
+
* other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.
|
|
43
|
+
* @return a new instance of message.
|
|
44
|
+
*/
|
|
38
45
|
newInstance(user, m) {
|
|
39
46
|
return this.newInstanceWithPatient(user, null, m);
|
|
40
47
|
}
|
|
@@ -72,11 +79,21 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
72
79
|
.then((x) => x.updatedEntity));
|
|
73
80
|
});
|
|
74
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Decrypts the encrypted content of messages.
|
|
84
|
+
* @param messages the messages to decrypt.
|
|
85
|
+
* @return the decrypted messages with their encryption status.
|
|
86
|
+
*/
|
|
75
87
|
decrypt(messages) {
|
|
76
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
89
|
return yield this.crypto.xapi.tryDecryptEntities(messages, utils_1.EntityWithDelegationTypeName.Message, (x) => new models.Message(x));
|
|
78
90
|
});
|
|
79
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Encrypts the content of messages.
|
|
94
|
+
* @param messages the messages to encrypt.
|
|
95
|
+
* @return the encrypted messages.
|
|
96
|
+
*/
|
|
80
97
|
encrypt(messages) {
|
|
81
98
|
return this.crypto.xapi.tryEncryptEntities(messages, utils_1.EntityWithDelegationTypeName.Message, this.encryptedFields, true, false, (x) => new models.Message(x));
|
|
82
99
|
}
|
|
@@ -187,15 +204,38 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
187
204
|
decryptSecretIdsOf(message) {
|
|
188
205
|
return this.crypto.xapi.secretIdsOf({ entity: message, type: utils_1.EntityWithDelegationTypeName.Message }, undefined);
|
|
189
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Creates or updates de-anonymization metadata for the message, allowing resolution of anonymous delegations.
|
|
209
|
+
* @param entity the message.
|
|
210
|
+
* @param delegates the data owner ids of the delegates.
|
|
211
|
+
*/
|
|
190
212
|
createDelegationDeAnonymizationMetadata(entity, delegates) {
|
|
191
213
|
return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: utils_1.EntityWithDelegationTypeName.Message }, delegates);
|
|
192
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Retrieves the data owners that have access to the message.
|
|
217
|
+
* @param entity the message.
|
|
218
|
+
* @return the data owners with their access levels and a flag indicating if there are unknown anonymous data owners.
|
|
219
|
+
*/
|
|
193
220
|
getDataOwnersWithAccessTo(entity) {
|
|
194
221
|
return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: utils_1.EntityWithDelegationTypeName.Message });
|
|
195
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Retrieves the encryption keys of the message.
|
|
225
|
+
* @param entity the message.
|
|
226
|
+
* @return the encryption keys.
|
|
227
|
+
*/
|
|
196
228
|
getEncryptionKeysOf(entity) {
|
|
197
229
|
return this.crypto.xapi.encryptionKeysOf({ entity, type: utils_1.EntityWithDelegationTypeName.Message }, undefined);
|
|
198
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Subscribes to message events (create, update, delete).
|
|
233
|
+
* @param eventTypes the types of events to subscribe to.
|
|
234
|
+
* @param filter optional filter to apply to the events.
|
|
235
|
+
* @param eventFired callback function to be called when an event is fired.
|
|
236
|
+
* @param options optional subscription options.
|
|
237
|
+
* @return a connection that can be used to close the subscription.
|
|
238
|
+
*/
|
|
199
239
|
subscribeToMessageEvents(eventTypes_1, filter_1, eventFired_1) {
|
|
200
240
|
return __awaiter(this, arguments, void 0, function* (eventTypes, filter, eventFired, options = {}) {
|
|
201
241
|
return yield (0, utils_1.subscribeToEntityEvents)(this.host, this.authApi, utils_1.EntityWithDelegationTypeName.Message, eventTypes, filter, eventFired, options, (encrypted) => __awaiter(this, void 0, void 0, function* () { return (yield this.decrypt([encrypted]))[0].entity; })).then((rs) => new Connection_1.ConnectionImpl(rs));
|
|
@@ -207,6 +247,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
207
247
|
return Object.assign(Object.assign({}, page), { rows: (yield this.decrypt((_a = page.rows) !== null && _a !== void 0 ? _a : [])).map((x) => x.entity) });
|
|
208
248
|
});
|
|
209
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Creates a message.
|
|
252
|
+
* @param user the current user (unused, for compatibility).
|
|
253
|
+
* @param body the message to create.
|
|
254
|
+
* @return the created message.
|
|
255
|
+
*/
|
|
210
256
|
createMessageWithUser(user, body) {
|
|
211
257
|
const _super = Object.create(null, {
|
|
212
258
|
createMessage: { get: () => super.createMessage }
|
|
@@ -215,6 +261,14 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
215
261
|
return (yield this.decrypt([yield _super.createMessage.call(this, (yield this.encrypt([body]))[0])]))[0].entity;
|
|
216
262
|
});
|
|
217
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Finds messages with pagination.
|
|
266
|
+
* @param user the current user (unused, for compatibility).
|
|
267
|
+
* @param startKey optional start key for pagination.
|
|
268
|
+
* @param startDocumentId optional start document id for pagination.
|
|
269
|
+
* @param limit optional maximum number of results to return.
|
|
270
|
+
* @return a paginated list of messages.
|
|
271
|
+
*/
|
|
218
272
|
findMessagesWithUser(user, startKey, startDocumentId, limit) {
|
|
219
273
|
const _super = Object.create(null, {
|
|
220
274
|
findMessages: { get: () => super.findMessages }
|
|
@@ -223,6 +277,16 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
223
277
|
return yield this.decryptPage(yield _super.findMessages.call(this, startKey, startDocumentId, limit));
|
|
224
278
|
});
|
|
225
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Finds messages by sender address with pagination.
|
|
282
|
+
* @param user the current user (unused, for compatibility).
|
|
283
|
+
* @param fromAddress the sender address to filter by.
|
|
284
|
+
* @param startKey optional start key for pagination.
|
|
285
|
+
* @param startDocumentId optional start document id for pagination.
|
|
286
|
+
* @param limit optional maximum number of results to return.
|
|
287
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
288
|
+
* @return a paginated list of messages.
|
|
289
|
+
*/
|
|
226
290
|
findMessagesByFromAddressWithUser(user, fromAddress, startKey, startDocumentId, limit, hcpId) {
|
|
227
291
|
const _super = Object.create(null, {
|
|
228
292
|
findMessagesByFromAddress: { get: () => super.findMessagesByFromAddress }
|
|
@@ -253,6 +317,17 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
253
317
|
return (yield this.decrypt(yield _super.findMessagesByHCPartyPatientForeignKeys.call(this, secretFKeys))).map((x) => x.entity);
|
|
254
318
|
});
|
|
255
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* Finds messages by recipient address with pagination.
|
|
322
|
+
* @param user the current user (unused, for compatibility).
|
|
323
|
+
* @param toAddress the recipient address to filter by.
|
|
324
|
+
* @param startKey optional start key for pagination.
|
|
325
|
+
* @param startDocumentId optional start document id for pagination.
|
|
326
|
+
* @param limit optional maximum number of results to return.
|
|
327
|
+
* @param reverse optional flag to reverse the sort order.
|
|
328
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
329
|
+
* @return a paginated list of messages.
|
|
330
|
+
*/
|
|
256
331
|
findMessagesByToAddressWithUser(user, toAddress, startKey, startDocumentId, limit, reverse, hcpId) {
|
|
257
332
|
const _super = Object.create(null, {
|
|
258
333
|
findMessagesByToAddress: { get: () => super.findMessagesByToAddress }
|
|
@@ -261,6 +336,17 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
261
336
|
return yield this.decryptPage(yield _super.findMessagesByToAddress.call(this, toAddress, startKey, startDocumentId, limit, reverse, hcpId));
|
|
262
337
|
});
|
|
263
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* Finds messages by transport GUID with pagination.
|
|
341
|
+
* @param user the current user (unused, for compatibility).
|
|
342
|
+
* @param transportGuid the transport GUID to filter by.
|
|
343
|
+
* @param received optional flag to filter by received status.
|
|
344
|
+
* @param startKey optional start key for pagination.
|
|
345
|
+
* @param startDocumentId optional start document id for pagination.
|
|
346
|
+
* @param limit optional maximum number of results to return.
|
|
347
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
348
|
+
* @return a paginated list of messages.
|
|
349
|
+
*/
|
|
264
350
|
findMessagesByTransportGuidWithUser(user, transportGuid, received, startKey, startDocumentId, limit, hcpId) {
|
|
265
351
|
const _super = Object.create(null, {
|
|
266
352
|
findMessagesByTransportGuid: { get: () => super.findMessagesByTransportGuid }
|
|
@@ -269,6 +355,18 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
269
355
|
return yield this.decryptPage(yield _super.findMessagesByTransportGuid.call(this, transportGuid, received, startKey, startDocumentId, limit, hcpId));
|
|
270
356
|
});
|
|
271
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* Finds messages by transport GUID and sent date range with pagination.
|
|
360
|
+
* @param user the current user (unused, for compatibility).
|
|
361
|
+
* @param transportGuid the transport GUID to filter by.
|
|
362
|
+
* @param from optional start timestamp for the date range.
|
|
363
|
+
* @param to optional end timestamp for the date range.
|
|
364
|
+
* @param startKey optional start key for pagination.
|
|
365
|
+
* @param startDocumentId optional start document id for pagination.
|
|
366
|
+
* @param limit optional maximum number of results to return.
|
|
367
|
+
* @param hcpId optional healthcare party id to filter by.
|
|
368
|
+
* @return a paginated list of messages.
|
|
369
|
+
*/
|
|
272
370
|
findMessagesByTransportGuidSentDateWithUser(user, transportGuid, from, to, startKey, startDocumentId, limit, hcpId) {
|
|
273
371
|
const _super = Object.create(null, {
|
|
274
372
|
findMessagesByTransportGuidSentDate: { get: () => super.findMessagesByTransportGuidSentDate }
|
|
@@ -277,6 +375,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
277
375
|
return yield this.decryptPage(yield _super.findMessagesByTransportGuidSentDate.call(this, transportGuid, from, to, startKey, startDocumentId, limit, hcpId));
|
|
278
376
|
});
|
|
279
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* Retrieves the children messages of a message.
|
|
380
|
+
* @param user the current user (unused, for compatibility).
|
|
381
|
+
* @param messageId the id of the parent message.
|
|
382
|
+
* @return the children messages.
|
|
383
|
+
*/
|
|
280
384
|
getChildrenMessagesWithUser(user, messageId) {
|
|
281
385
|
const _super = Object.create(null, {
|
|
282
386
|
getChildrenMessages: { get: () => super.getChildrenMessages }
|
|
@@ -285,6 +389,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
285
389
|
return (yield this.decrypt(yield _super.getChildrenMessages.call(this, messageId))).map((x) => x.entity);
|
|
286
390
|
});
|
|
287
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* Retrieves the children messages of a list of parent messages.
|
|
394
|
+
* @param user the current user (unused, for compatibility).
|
|
395
|
+
* @param body the list of parent message ids.
|
|
396
|
+
* @return the children messages.
|
|
397
|
+
*/
|
|
288
398
|
getChildrenMessagesOfListWithUser(user, body) {
|
|
289
399
|
const _super = Object.create(null, {
|
|
290
400
|
getChildrenMessagesOfList: { get: () => super.getChildrenMessagesOfList }
|
|
@@ -293,6 +403,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
293
403
|
return (yield this.decrypt(yield _super.getChildrenMessagesOfList.call(this, body))).map((x) => x.entity);
|
|
294
404
|
});
|
|
295
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Retrieves a message by its id.
|
|
408
|
+
* @param user the current user (unused, for compatibility).
|
|
409
|
+
* @param messageId the id of the message.
|
|
410
|
+
* @return the message.
|
|
411
|
+
*/
|
|
296
412
|
getMessageWithUser(user, messageId) {
|
|
297
413
|
const _super = Object.create(null, {
|
|
298
414
|
getMessage: { get: () => super.getMessage }
|
|
@@ -301,6 +417,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
301
417
|
return (yield this.decrypt([yield _super.getMessage.call(this, messageId)]))[0].entity;
|
|
302
418
|
});
|
|
303
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Retrieves multiple messages by their ids.
|
|
422
|
+
* @param user the current user (unused, for compatibility).
|
|
423
|
+
* @param messageIds the list of message ids.
|
|
424
|
+
* @return the messages.
|
|
425
|
+
*/
|
|
304
426
|
getMessagesWithUser(user, messageIds) {
|
|
305
427
|
const _super = Object.create(null, {
|
|
306
428
|
getMessages: { get: () => super.getMessages }
|
|
@@ -309,6 +431,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
309
431
|
return (yield this.decrypt(yield _super.getMessages.call(this, messageIds))).map((x) => x.entity);
|
|
310
432
|
});
|
|
311
433
|
}
|
|
434
|
+
/**
|
|
435
|
+
* Lists messages by invoice ids.
|
|
436
|
+
* @param user the current user (unused, for compatibility).
|
|
437
|
+
* @param body the list of invoice ids.
|
|
438
|
+
* @return the messages associated with the invoices.
|
|
439
|
+
*/
|
|
312
440
|
listMessagesByInvoiceIdsWithUser(user, body) {
|
|
313
441
|
const _super = Object.create(null, {
|
|
314
442
|
listMessagesByInvoiceIds: { get: () => super.listMessagesByInvoiceIds }
|
|
@@ -317,6 +445,13 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
317
445
|
return (yield this.decrypt(yield _super.listMessagesByInvoiceIds.call(this, body))).map((x) => x.entity);
|
|
318
446
|
});
|
|
319
447
|
}
|
|
448
|
+
/**
|
|
449
|
+
* Lists messages by transport GUIDs.
|
|
450
|
+
* @param user the current user (unused, for compatibility).
|
|
451
|
+
* @param hcpId the healthcare party id.
|
|
452
|
+
* @param body the list of transport GUIDs.
|
|
453
|
+
* @return the messages associated with the transport GUIDs.
|
|
454
|
+
*/
|
|
320
455
|
listMessagesByTransportGuidsWithUser(user, hcpId, body) {
|
|
321
456
|
const _super = Object.create(null, {
|
|
322
457
|
listMessagesByTransportGuids: { get: () => super.listMessagesByTransportGuids }
|
|
@@ -325,6 +460,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
325
460
|
return (yield this.decrypt(yield _super.listMessagesByTransportGuids.call(this, hcpId, body))).map((x) => x.entity);
|
|
326
461
|
});
|
|
327
462
|
}
|
|
463
|
+
/**
|
|
464
|
+
* Modifies a message.
|
|
465
|
+
* @param user the current user (unused, for compatibility).
|
|
466
|
+
* @param body the message to modify.
|
|
467
|
+
* @return the modified message.
|
|
468
|
+
*/
|
|
328
469
|
modifyMessageWithUser(user, body) {
|
|
329
470
|
const _super = Object.create(null, {
|
|
330
471
|
modifyMessage: { get: () => super.modifyMessage }
|
|
@@ -333,6 +474,13 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
333
474
|
return (yield this.decrypt([yield _super.modifyMessage.call(this, (yield this.encrypt([body]))[0])]))[0].entity;
|
|
334
475
|
});
|
|
335
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* Sets the status bits of multiple messages.
|
|
479
|
+
* @param user the current user (unused, for compatibility).
|
|
480
|
+
* @param status the status bits to set.
|
|
481
|
+
* @param body the list of message ids.
|
|
482
|
+
* @return the updated messages.
|
|
483
|
+
*/
|
|
336
484
|
setMessagesStatusBitsWithUser(user, status, body) {
|
|
337
485
|
const _super = Object.create(null, {
|
|
338
486
|
setMessagesStatusBits: { get: () => super.setMessagesStatusBits }
|
|
@@ -341,6 +489,14 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
341
489
|
return (yield this.decrypt(yield _super.setMessagesStatusBits.call(this, status, body))).map((x) => x.entity);
|
|
342
490
|
});
|
|
343
491
|
}
|
|
492
|
+
/**
|
|
493
|
+
* Filters messages using a filter chain with pagination.
|
|
494
|
+
* @param user the current user (unused, for compatibility).
|
|
495
|
+
* @param body the filter chain to apply.
|
|
496
|
+
* @param startDocumentId optional start document id for pagination.
|
|
497
|
+
* @param limit optional maximum number of results to return.
|
|
498
|
+
* @return a paginated list of filtered messages.
|
|
499
|
+
*/
|
|
344
500
|
filterMessagesByWithUser(user, body, startDocumentId, limit) {
|
|
345
501
|
const _super = Object.create(null, {
|
|
346
502
|
filterMessagesBy: { get: () => super.filterMessagesBy }
|
|
@@ -349,6 +505,12 @@ class IccMessageXApi extends icc_api_1.IccMessageApi {
|
|
|
349
505
|
return yield this.decryptPage(yield _super.filterMessagesBy.call(this, body, startDocumentId, limit));
|
|
350
506
|
});
|
|
351
507
|
}
|
|
508
|
+
/**
|
|
509
|
+
* Sets the read status of multiple messages.
|
|
510
|
+
* @param user the current user (unused, for compatibility).
|
|
511
|
+
* @param body the read status update information.
|
|
512
|
+
* @return the updated messages.
|
|
513
|
+
*/
|
|
352
514
|
setMessagesReadStatusWithUser(user, body) {
|
|
353
515
|
const _super = Object.create(null, {
|
|
354
516
|
setMessagesReadStatus: { get: () => super.setMessagesReadStatus }
|