@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.
Files changed (61) hide show
  1. package/icc-api/api/IccFormApi.d.ts +89 -0
  2. package/icc-api/api/IccFormApi.js +234 -0
  3. package/icc-api/api/IccFormApi.js.map +1 -1
  4. package/icc-x-api/icc-accesslog-x-api.d.ts +93 -0
  5. package/icc-x-api/icc-accesslog-x-api.js +93 -0
  6. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  7. package/icc-x-api/icc-calendar-item-x-api.d.ts +122 -0
  8. package/icc-x-api/icc-calendar-item-x-api.js +122 -0
  9. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  10. package/icc-x-api/icc-classification-x-api.d.ts +20 -0
  11. package/icc-x-api/icc-classification-x-api.js +20 -0
  12. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  13. package/icc-x-api/icc-code-x-api.d.ts +23 -0
  14. package/icc-x-api/icc-code-x-api.js +23 -0
  15. package/icc-x-api/icc-code-x-api.js.map +1 -1
  16. package/icc-x-api/icc-contact-x-api.d.ts +219 -1
  17. package/icc-x-api/icc-contact-x-api.js +219 -2
  18. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  19. package/icc-x-api/icc-data-owner-x-api.d.ts +14 -3
  20. package/icc-x-api/icc-data-owner-x-api.js +14 -3
  21. package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
  22. package/icc-x-api/icc-device-x-api.d.ts +8 -0
  23. package/icc-x-api/icc-device-x-api.js +8 -0
  24. package/icc-x-api/icc-device-x-api.js.map +1 -1
  25. package/icc-x-api/icc-doctemplate-x-api.d.ts +26 -0
  26. package/icc-x-api/icc-doctemplate-x-api.js +26 -0
  27. package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
  28. package/icc-x-api/icc-document-x-api.d.ts +114 -1
  29. package/icc-x-api/icc-document-x-api.js +127 -1
  30. package/icc-x-api/icc-document-x-api.js.map +1 -1
  31. package/icc-x-api/icc-form-x-api.d.ts +34 -4
  32. package/icc-x-api/icc-form-x-api.js +34 -4
  33. package/icc-x-api/icc-form-x-api.js.map +1 -1
  34. package/icc-x-api/icc-hcparty-x-api.d.ts +67 -0
  35. package/icc-x-api/icc-hcparty-x-api.js +67 -0
  36. package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
  37. package/icc-x-api/icc-helement-x-api.d.ts +141 -0
  38. package/icc-x-api/icc-helement-x-api.js +141 -0
  39. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  40. package/icc-x-api/icc-invoice-x-api.d.ts +54 -0
  41. package/icc-x-api/icc-invoice-x-api.js +54 -0
  42. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  43. package/icc-x-api/icc-message-x-api.d.ts +162 -0
  44. package/icc-x-api/icc-message-x-api.js +162 -0
  45. package/icc-x-api/icc-message-x-api.js.map +1 -1
  46. package/icc-x-api/icc-patient-x-api.d.ts +245 -0
  47. package/icc-x-api/icc-patient-x-api.js +245 -1
  48. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  49. package/icc-x-api/icc-receipt-x-api.d.ts +25 -0
  50. package/icc-x-api/icc-receipt-x-api.js +25 -0
  51. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  52. package/icc-x-api/icc-user-x-api.d.ts +25 -0
  53. package/icc-x-api/icc-user-x-api.js +25 -0
  54. package/icc-x-api/icc-user-x-api.js.map +1 -1
  55. package/package.json +1 -1
  56. package/test/icc-x-api/icc-form-x-api.js +316 -1
  57. package/test/icc-x-api/icc-form-x-api.js.map +1 -1
  58. package/test/utils/roles.js +5 -0
  59. package/test/utils/roles.js.map +1 -1
  60. package/test/utils/test_utils.js +1 -21
  61. package/test/utils/test_utils.js.map +1 -1
@@ -75,7 +75,7 @@ export declare class IccContactXApi extends IccContactApi implements EncryptedEn
75
75
  */
76
76
  findBy(hcpartyId: string, patient: models.Patient, usingPost?: boolean): Promise<any[]>;
77
77
  /**
78
- * Same as {@link findIdsBy} but it will only return the ids of the contacts. It can also filter the contacts where Contact.openingDate is between
78
+ * Same as {@link findBy} but it will only return the ids of the contacts. It can also filter the contacts where Contact.openingDate is between
79
79
  * startDate and endDate in ascending or descending order by that field. (default: ascending).
80
80
  */
81
81
  findIdsBy(hcpartyId: string, patient: models.Patient, startDate?: number, endDate?: number, descending?: boolean): Promise<string[]>;
@@ -102,34 +102,206 @@ export declare class IccContactXApi extends IccContactApi implements EncryptedEn
102
102
  * @deprecated use {@link findContactIdsByDataOwnerPatientOpeningDate} instead.
103
103
  */
104
104
  findByHCPartyPatientSecretFKeysArray(hcPartyId: string, secretFKeys: string[], planOfActionIds?: string, skipClosedContacts?: boolean): Promise<Array<models.Contact> | any>;
105
+ /**
106
+ * Filters contacts using a filter chain and decrypts the results for the given user.
107
+ * @param user the user for decryption
108
+ * @param startDocumentId optional document id to start pagination from
109
+ * @param limit maximum number of results to return
110
+ * @param body the filter chain to apply
111
+ * @return a paginated list of decrypted contacts
112
+ */
105
113
  filterByWithUser(user: models.User, startDocumentId?: string, limit?: number, body?: models.FilterChainContact): Promise<PaginatedListContact | any>;
114
+ /**
115
+ * Lists contacts by opening date within a date range and decrypts the results for the given user.
116
+ * @param user the user for decryption
117
+ * @param startDate start of the date range (format: YYYYMMDDHHmmss)
118
+ * @param endDate end of the date range (format: YYYYMMDDHHmmss)
119
+ * @param hcpartyid the healthcare party id
120
+ * @param startKey optional start key for pagination
121
+ * @param startDocumentId optional document id to start pagination from
122
+ * @param limit maximum number of results to return
123
+ * @return a paginated list of decrypted contacts
124
+ */
106
125
  listContactsByOpeningDateWithUser(user: models.User, startDate: number, endDate: number, hcpartyid: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListContact | any>;
126
+ /**
127
+ * Gets a service by id and decrypts it for the given user.
128
+ * @param user the user for decryption
129
+ * @param serviceId the service id
130
+ * @return the decrypted service
131
+ */
107
132
  getServiceWithUser(user: models.User, serviceId: string): Promise<Service>;
133
+ /**
134
+ * Lists services by their ids and decrypts them for the given user.
135
+ * @param user the user for decryption
136
+ * @param serviceIds the list of service ids to retrieve
137
+ * @return an array of decrypted services
138
+ */
108
139
  listServicesWithUser(user: models.User, serviceIds: ListOfIds): Promise<Array<Service> | any>;
140
+ /**
141
+ * Finds contacts by healthcare party and form id and decrypts them for the given user.
142
+ * @param user the user for decryption
143
+ * @param hcPartyId the healthcare party id
144
+ * @param formId the form id
145
+ * @return an array of decrypted contacts
146
+ */
109
147
  findByHCPartyFormIdWithUser(user: models.User, hcPartyId: string, formId: string): Promise<Array<models.Contact> | any>;
148
+ /**
149
+ * Finds contacts by healthcare party and multiple form ids and decrypts them for the given user.
150
+ * @param user the user for decryption
151
+ * @param hcPartyId the healthcare party id
152
+ * @param body the list of form ids
153
+ * @return an array of decrypted contacts
154
+ */
110
155
  findByHCPartyFormIdsWithUser(user: models.User, hcPartyId: string, body: models.ListOfIds): Promise<Array<models.Contact> | any>;
156
+ /**
157
+ * Gets a contact by id and decrypts it for the given user.
158
+ * @param user the user for decryption
159
+ * @param contactId the contact id
160
+ * @return the decrypted contact
161
+ */
111
162
  getContactWithUser(user: models.User, contactId: string): Promise<models.Contact>;
163
+ /**
164
+ * Gets multiple contacts by their ids and decrypts them for the given user.
165
+ * @param user the user for decryption
166
+ * @param body the list of contact ids
167
+ * @return an array of decrypted contacts
168
+ */
112
169
  getContactsWithUser(user: models.User, body?: models.ListOfIds): Promise<Array<models.Contact> | any>;
170
+ /**
171
+ * Modifies an existing contact by encrypting it and saving it to the database.
172
+ * @param user the user for encryption
173
+ * @param body the contact to modify
174
+ * @return the modified and decrypted contact
175
+ */
113
176
  modifyContactWithUser(user: models.User, body?: models.Contact): Promise<models.Contact | any>;
114
177
  private modifyContactAs;
178
+ /**
179
+ * Modifies multiple existing contacts by encrypting them and saving them to the database.
180
+ * @param user the user for encryption
181
+ * @param bodies the array of contacts to modify
182
+ * @return an array of modified and decrypted contacts
183
+ */
115
184
  modifyContactsWithUser(user: models.User, bodies?: Array<models.Contact>): Promise<models.Contact[] | any>;
185
+ /**
186
+ * Creates a new contact by encrypting it and saving it to the database.
187
+ * @param user the user for encryption
188
+ * @param body the contact to create
189
+ * @return the created and decrypted contact
190
+ */
116
191
  createContactWithUser(user: models.User, body?: models.Contact): Promise<models.Contact | null>;
192
+ /**
193
+ * Creates multiple new contacts by encrypting them and saving them to the database.
194
+ * @param user the user for encryption
195
+ * @param bodies the array of contacts to create
196
+ * @return an array of created and decrypted contacts
197
+ */
117
198
  createContactsWithUser(user: models.User, bodies?: Array<models.Contact>): Promise<models.Contact[] | null>;
199
+ /**
200
+ * Encrypts the content and custom encrypted fields of services.
201
+ * Services with compound values are recursively encrypted.
202
+ * @param key the encryption key
203
+ * @param rawKey the raw encryption key as a string
204
+ * @param services the array of services to encrypt
205
+ * @return a promise containing the encrypted services
206
+ */
118
207
  encryptServices(key: CryptoKey, rawKey: string, services: Service[]): PromiseLike<Service[]>;
208
+ /**
209
+ * Encrypts contacts for the given user including all services within the contacts.
210
+ * @param user the user for encryption
211
+ * @param ctcs the array of contacts to encrypt
212
+ * @return a promise containing the encrypted contacts
213
+ */
119
214
  encrypt(user: models.User, ctcs: Array<models.Contact>): Promise<models.Contact[]>;
120
215
  private encryptAs;
216
+ /**
217
+ * Decrypts contacts and all their encrypted content.
218
+ * @param hcpartyId the healthcare party id (deprecated parameter, kept for compatibility)
219
+ * @param ctcs the array of encrypted contacts
220
+ * @return a promise containing the decrypted contacts
221
+ */
121
222
  decrypt(hcpartyId: string, ctcs: Array<models.Contact>): Promise<Array<models.Contact>>;
223
+ /**
224
+ * Decrypts services and all their encrypted content.
225
+ * @param hcpartyId the healthcare party id (deprecated parameter, kept for compatibility)
226
+ * @param svcs the array of encrypted services
227
+ * @return a promise containing the decrypted services
228
+ */
122
229
  decryptServices(hcpartyId: string, svcs: Array<models.Service>): Promise<Array<models.Service>>;
230
+ /**
231
+ * Finds the contact containing the given service id, prioritizing the latest version by valueDate.
232
+ * @param ctcs the array of contacts to search
233
+ * @param svcId the service id to find
234
+ * @return the contact containing the service or undefined if not found
235
+ */
123
236
  contactOfService(ctcs: Array<models.Contact>, svcId: string): models.Contact | undefined;
237
+ /**
238
+ * Extracts and filters services from contacts, keeping only the latest version of each service and excluding deleted services.
239
+ * @param ctcs the array of contacts containing services
240
+ * @param filter a predicate function to filter services: (service, contact) => boolean
241
+ * @return an array of filtered services with contactId set
242
+ */
124
243
  filteredServices(ctcs: Array<models.Contact>, filter: any): Array<models.Service>;
244
+ /**
245
+ * Extracts and filters services from contacts, returning a promise. Same as filteredServices but wrapped in a promise.
246
+ * @param ctcs the array of contacts containing services
247
+ * @param filter a predicate function to filter services: (service, contact) => boolean
248
+ * @return a promise containing an array of filtered services
249
+ */
125
250
  filterServices(ctcs: Array<models.Contact>, filter: any): Promise<Array<models.Service>>;
251
+ /**
252
+ * Gets all services from a contact that have the specified label.
253
+ * @param ctc the contact
254
+ * @param label the service label to filter by
255
+ * @return an array of services with the given label
256
+ */
126
257
  services(ctc: models.Contact, label: string): models.Service[];
258
+ /**
259
+ * Gets the preferred content for a service based on language preference, falling back to French then first available language.
260
+ * @param svc the service
261
+ * @param lng the preferred language code
262
+ * @return the content in the preferred language or null if no content exists
263
+ */
127
264
  preferredContent(svc: models.Service, lng: string): models.Content | undefined;
265
+ /**
266
+ * Extracts the value from content, prioritizing string, number, measure, medication, and boolean values in that order.
267
+ * @param c the content
268
+ * @return the extracted value or undefined if no value is present
269
+ */
128
270
  contentValue(c: models.Content): string | number | boolean | models.Measure | models.Medication | undefined;
271
+ /**
272
+ * Gets a short human-readable description of a service in the preferred language.
273
+ * @param svc the service
274
+ * @param lng the preferred language code
275
+ * @return a short description of the service content or empty string
276
+ */
129
277
  shortServiceDescription(svc: models.Service, lng: string): string | number;
278
+ /**
279
+ * Gets a short human-readable description of content, formatted appropriately for the content type.
280
+ * @param c the content
281
+ * @param lng the language code for medication formatting
282
+ * @param label optional label used for boolean content display
283
+ * @return a short description of the content
284
+ */
130
285
  shortContentDescription(c: models.Content, lng: string, label?: string): string | number;
286
+ /**
287
+ * Extracts the medication value from a service's content in the preferred language.
288
+ * @param svc the service
289
+ * @param lng the preferred language code
290
+ * @return the medication value or undefined if not present
291
+ */
131
292
  medicationValue(svc: models.Service, lng: string): models.Medication | undefined;
293
+ /**
294
+ * Checks if content has any data value set (string, number, measure, boolean, medication, or document).
295
+ * @param c the content to check
296
+ * @return true if content has data, false otherwise
297
+ */
132
298
  contentHasData(c: any): boolean;
299
+ /**
300
+ * Localizes a value by selecting the appropriate language from an object, falling back through FR, EN, and NL.
301
+ * @param e the object with language-keyed values or a simple value
302
+ * @param lng the preferred language code
303
+ * @return the localized value or null if e is null/undefined
304
+ */
133
305
  localize(e: any, lng: string): any;
134
306
  /**
135
307
  * Modifies the subcontacts this svc belongs to while minimizing the number of references to the svcs inside the subcontacts
@@ -157,10 +329,24 @@ export declare class IccContactXApi extends IccContactApi implements EncryptedEn
157
329
  promoteServiceInContact(ctc: models.Contact, user: models.User, ctcs: Array<models.Contact>, svc: models.Service, formId: string, poaIds?: {
158
330
  [key: string]: string[];
159
331
  }, heIds?: Array<string>, init?: any): any;
332
+ /**
333
+ * Checks if a service has numeric content (measure or number value) in the preferred language.
334
+ * @param svc the service
335
+ * @param lng the preferred language code
336
+ * @return true if the service has numeric content, false otherwise
337
+ */
160
338
  isNumeric(svc: models.Service, lng: string): number | boolean | models.Measure | undefined;
339
+ /**
340
+ * Returns utility functions for working with services.
341
+ * @return an object with helper methods for creating and manipulating services
342
+ */
161
343
  service(): {
162
344
  newInstance: (user: models.User, s: any) => any;
163
345
  };
346
+ /**
347
+ * Returns utility functions for working with medication content.
348
+ * @return an object with helper methods for formatting and displaying medication information
349
+ */
164
350
  medication(): {
165
351
  regimenScores: () => any;
166
352
  medicationNameToString: (m: any) => string;
@@ -250,14 +436,46 @@ export declare class IccContactXApi extends IccContactApi implements EncryptedEn
250
436
  sharePatientId?: ShareMetadataBehaviour;
251
437
  };
252
438
  }): Promise<ShareResult<models.Contact>>;
439
+ /**
440
+ * Gets the data owners that have access to the contact and their permission levels.
441
+ * @param entity the contact
442
+ * @return a promise containing the permissions by data owner id and whether there are unknown anonymous data owners
443
+ */
253
444
  getDataOwnersWithAccessTo(entity: models.Contact): Promise<{
254
445
  permissionsByDataOwnerId: {
255
446
  [p: string]: AccessLevelEnum;
256
447
  };
257
448
  hasUnknownAnonymousDataOwners: boolean;
258
449
  }>;
450
+ /**
451
+ * Gets all encryption keys available for the contact.
452
+ * @param entity the contact
453
+ * @return a promise containing an array of encryption key hex strings
454
+ */
259
455
  getEncryptionKeysOf(entity: models.Contact): Promise<string[]>;
456
+ /**
457
+ * Subscribes to service events (create, update, delete) and receives decrypted services.
458
+ * @param eventTypes the types of events to subscribe to
459
+ * @param filter optional filter to apply to services
460
+ * @param eventFired callback function invoked when an event occurs, receives the decrypted service
461
+ * @param options optional subscription options
462
+ * @return a connection that can be closed to unsubscribe
463
+ */
260
464
  subscribeToServiceEvents(eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[], filter: AbstractFilter<Service> | undefined, eventFired: (dataSample: Service) => Promise<void>, options?: SubscriptionOptions): Promise<Connection>;
465
+ /**
466
+ * Subscribes to contact events (create, update, delete) and receives decrypted contacts.
467
+ * @param eventTypes the types of events to subscribe to
468
+ * @param filter optional filter to apply to contacts
469
+ * @param eventFired callback function invoked when an event occurs, receives the decrypted contact
470
+ * @param options optional subscription options
471
+ * @return a connection that can be closed to unsubscribe
472
+ */
261
473
  subscribeToContactEvents(eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[], filter: AbstractFilter<Contact> | undefined, eventFired: (dataSample: Contact) => Promise<void>, options?: SubscriptionOptions): Promise<Connection>;
474
+ /**
475
+ * Creates or updates de-anonymization metadata for delegations in a contact.
476
+ * @param entity the contact
477
+ * @param delegates the array of delegate ids to create de-anonymization metadata for
478
+ * @return a promise that completes when the metadata is created/updated
479
+ */
262
480
  createDelegationDeAnonymizationMetadata(entity: Contact, delegates: string[]): Promise<void>;
263
481
  }