@icure/cardinal-sdk 3.0.0-PREVIEW-2 → 3.0.0-PREVIEW-3

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.
@@ -4,7 +4,7 @@ import { KeypairFingerprintV1String } from "../model/specializations/KeypairFing
4
4
  import { CryptoActorStubWithType } from "../model/CryptoActorStubWithType.mjs";
5
5
  import { RecoveryResult } from "./entities/RecoveryResult.mjs";
6
6
  import { RecoveryDataKey } from "./entities/RecoveryDataKey.mjs";
7
- import { RsaAlgorithm, XCryptoService, XRsaKeypair } from "./CryptoService.mjs";
7
+ import { RsaAlgorithm, RsaEncryptionAlgorithm, XCryptoService, XRsaKeypair } from "./CryptoService.mjs";
8
8
  import { CardinalApis } from "../sdk/CardinalSdk.mjs";
9
9
  /**
10
10
  * Allows customizing the behavior of the crypto api to better suit your needs.
@@ -54,21 +54,57 @@ export declare class CryptoStrategies {
54
54
  */
55
55
  generateNewKeyForDataOwner(self: DataOwnerWithType, cryptoPrimitives: XCryptoService): Promise<CryptoStrategies.KeyGenerationRequestResult>;
56
56
  /**
57
- * Verifies if the public keys of a data owner which will be the delegate of a new exchange key do actually belong to the person the data owner
58
- * represents. This method is not called when the delegate would be the current data owner for the api.
57
+ * Verifies if the public keys of a data owner which will be the delegate of new exchange data do actually belong to
58
+ * the person the data owner represents; if you do not override this method the public keys of the delegate are
59
+ * obtained from the cardinal backend and are fully trusted.
59
60
  *
60
- * The user will have to obtain the verified public keys of the delegate from outside iCure, for example by email with another hcp, by checking the
61
- * personal website of the other user, or by scanning verification qr codes at the doctor office...
61
+ * Note that this method is not called when:
62
+ * - The delegate id the current SDK delegator actor
63
+ * - The delegate is a parent type data owner linked from the current SDK delegator actor.
64
+ * - The SDK is creating exchange data to a simple-type group of data owners (in that case [getDelegatesPublicKeys] is used)
65
+ *
66
+ * There are two approaches you can use for verification of public keys: a separate service not controlled by iCure,
67
+ * or interaction with the end user.
68
+ *
69
+ * For example this method may ask the end user to compare the public keys with verified public keys of the delegate
70
+ * obtained from out of iCure, such as an email, the personal website of the other user, or by scanning verification
71
+ * qr codes at the doctor office.
72
+ *
73
+ * As long as one of the public keys is verified the creation of a new exchange key will succeed.
74
+ *
75
+ * If no public key is verified the operation will fail.
62
76
  *
63
- * As long as one of the public keys is verified the creation of a new exchange key will succeed. If no public key is verified the operation will
64
- * fail.
65
77
  * @param delegate the potential data owner delegate.
66
78
  * @param publicKeys public keys requiring verification, in spki hex-encoded format.
67
79
  * @param cryptoPrimitives cryptographic primitives you can use to support the process.
68
- * @param groupId the id of the data owner's group, or null if the data owner is in the same group as the current user
80
+ * @param groupId the id of the delegate data owner's group, or null if the data owner is in the same group as the current user
69
81
  * @return all verified public keys, in spki hex-encoded format.
70
82
  */
71
83
  verifyDelegatePublicKeys(delegate: CryptoActorStubWithType, publicKeys: Array<SpkiHexString>, cryptoPrimitives: XCryptoService, groupId: string | undefined): Promise<Array<SpkiHexString>>;
84
+ /**
85
+ * Similarly to [verifyDelegatePublicKeys] this method can be used if you don't want the SDK to fully trust the
86
+ * public keys coming from the cardinal backend, however this method is only called when creating exchange data for
87
+ * a simple-type data owner group, which may require to get validated public keys for many data owners.
88
+ *
89
+ * In that case interaction with the end-user is undesired, and it would be better instead to have a dedicated
90
+ * service separated from cardinal that provides the public keys of your cardinal data owners.
91
+ *
92
+ * Note that:
93
+ * - Returning null means the SDK will retrieve public keys from the cardinal backend and fully trust them.
94
+ * - If this method does not return null, it must provide at least a key for each delegate
95
+ * - Unlike [verifyDelegatePublicKeys] this method might be called even for delegates that are parent of the current
96
+ * SDK delegator actor.
97
+ * - The keys returned by this method will not be checked against the cardinal backend; if there are any
98
+ * inconsistencies the SDK might create invalid exchange data.
99
+ *
100
+ * @param delegates delegates for which the public keys are required.
101
+ * @param groupId the id of the delegate data owners' group, or null if their group is the same as the current user
102
+ */
103
+ getDelegatesPublicKeys(delegates: Array<string>, groupId: string | undefined): Promise<{
104
+ [delegateId: string]: {
105
+ [publicKey: SpkiHexString]: RsaEncryptionAlgorithm;
106
+ };
107
+ } | undefined>;
72
108
  /**
73
109
  * Specifies if a data owner requires anonymous delegations, i.e. his id should not appear unencrypted in new secure
74
110
  * delegations.
@@ -51,23 +51,57 @@ export class CryptoStrategies {
51
51
  return Promise.resolve(CryptoStrategies.KeyGenerationRequestResult.Allow);
52
52
  }
53
53
  /**
54
- * Verifies if the public keys of a data owner which will be the delegate of a new exchange key do actually belong to the person the data owner
55
- * represents. This method is not called when the delegate would be the current data owner for the api.
54
+ * Verifies if the public keys of a data owner which will be the delegate of new exchange data do actually belong to
55
+ * the person the data owner represents; if you do not override this method the public keys of the delegate are
56
+ * obtained from the cardinal backend and are fully trusted.
56
57
  *
57
- * The user will have to obtain the verified public keys of the delegate from outside iCure, for example by email with another hcp, by checking the
58
- * personal website of the other user, or by scanning verification qr codes at the doctor office...
58
+ * Note that this method is not called when:
59
+ * - The delegate id the current SDK delegator actor
60
+ * - The delegate is a parent type data owner linked from the current SDK delegator actor.
61
+ * - The SDK is creating exchange data to a simple-type group of data owners (in that case [getDelegatesPublicKeys] is used)
62
+ *
63
+ * There are two approaches you can use for verification of public keys: a separate service not controlled by iCure,
64
+ * or interaction with the end user.
65
+ *
66
+ * For example this method may ask the end user to compare the public keys with verified public keys of the delegate
67
+ * obtained from out of iCure, such as an email, the personal website of the other user, or by scanning verification
68
+ * qr codes at the doctor office.
69
+ *
70
+ * As long as one of the public keys is verified the creation of a new exchange key will succeed.
71
+ *
72
+ * If no public key is verified the operation will fail.
59
73
  *
60
- * As long as one of the public keys is verified the creation of a new exchange key will succeed. If no public key is verified the operation will
61
- * fail.
62
74
  * @param delegate the potential data owner delegate.
63
75
  * @param publicKeys public keys requiring verification, in spki hex-encoded format.
64
76
  * @param cryptoPrimitives cryptographic primitives you can use to support the process.
65
- * @param groupId the id of the data owner's group, or null if the data owner is in the same group as the current user
77
+ * @param groupId the id of the delegate data owner's group, or null if the data owner is in the same group as the current user
66
78
  * @return all verified public keys, in spki hex-encoded format.
67
79
  */
68
80
  verifyDelegatePublicKeys(delegate, publicKeys, cryptoPrimitives, groupId) {
69
81
  return Promise.resolve(publicKeys);
70
82
  }
83
+ /**
84
+ * Similarly to [verifyDelegatePublicKeys] this method can be used if you don't want the SDK to fully trust the
85
+ * public keys coming from the cardinal backend, however this method is only called when creating exchange data for
86
+ * a simple-type data owner group, which may require to get validated public keys for many data owners.
87
+ *
88
+ * In that case interaction with the end-user is undesired, and it would be better instead to have a dedicated
89
+ * service separated from cardinal that provides the public keys of your cardinal data owners.
90
+ *
91
+ * Note that:
92
+ * - Returning null means the SDK will retrieve public keys from the cardinal backend and fully trust them.
93
+ * - If this method does not return null, it must provide at least a key for each delegate
94
+ * - Unlike [verifyDelegatePublicKeys] this method might be called even for delegates that are parent of the current
95
+ * SDK delegator actor.
96
+ * - The keys returned by this method will not be checked against the cardinal backend; if there are any
97
+ * inconsistencies the SDK might create invalid exchange data.
98
+ *
99
+ * @param delegates delegates for which the public keys are required.
100
+ * @param groupId the id of the delegate data owners' group, or null if their group is the same as the current user
101
+ */
102
+ getDelegatesPublicKeys(delegates, groupId) {
103
+ return Promise.resolve(undefined);
104
+ }
71
105
  /**
72
106
  * Specifies if a data owner requires anonymous delegations, i.e. his id should not appear unencrypted in new secure
73
107
  * delegations.
@@ -48,6 +48,12 @@ if (typeof Math.clz32 === 'undefined') {
48
48
  };
49
49
  }(Math.log, Math.LN2);
50
50
  }
51
+ if (typeof String.prototype.startsWith === 'undefined') {
52
+ Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
53
+ position = position || 0;
54
+ return this.lastIndexOf(searchString, position) === position;
55
+ }});
56
+ }
51
57
  if (typeof String.prototype.endsWith === 'undefined') {
52
58
  Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) {
53
59
  var subjectString = this.toString();
@@ -59,12 +65,6 @@ if (typeof String.prototype.endsWith === 'undefined') {
59
65
  return lastIndex !== -1 && lastIndex === position;
60
66
  }});
61
67
  }
62
- if (typeof String.prototype.startsWith === 'undefined') {
63
- Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
64
- position = position || 0;
65
- return this.lastIndexOf(searchString, position) === position;
66
- }});
67
- }
68
68
  //endregion
69
69
  //region block: imports
70
70
  var imul_0 = Math.imul;
@@ -93,8 +93,8 @@ initMetadataForInterface(Entry, 'Entry');
93
93
  initMetadataForInterface(KtMap, 'Map');
94
94
  initMetadataForInterface(KtSet, 'Set', VOID, VOID, [Collection]);
95
95
  initMetadataForInterface(MutableIterable, 'MutableIterable');
96
- initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, MutableIterable, Collection]);
97
- initMetadataForInterface(KtMutableList, 'MutableList', VOID, VOID, [KtList, MutableIterable, Collection]);
96
+ initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, Collection, MutableIterable]);
97
+ initMetadataForInterface(KtMutableList, 'MutableList', VOID, VOID, [KtList, Collection, MutableIterable]);
98
98
  initMetadataForInterface(KtMutableMap, 'MutableMap', VOID, VOID, [KtMap]);
99
99
  initMetadataForCompanion(Companion_0);
100
100
  initMetadataForClass(Enum, 'Enum', VOID, VOID, [Comparable]);
@@ -115,7 +115,7 @@ initMetadataForInterface(AutoCloseable, 'AutoCloseable');
115
115
  initMetadataForInterface(Comparator, 'Comparator');
116
116
  initMetadataForObject(Unit, 'Unit');
117
117
  initMetadataForClass(AbstractCollection, 'AbstractCollection', VOID, VOID, [Collection]);
118
- initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [MutableIterable, Collection]);
118
+ initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [Collection, MutableIterable]);
119
119
  initMetadataForClass(IteratorImpl, 'IteratorImpl');
120
120
  initMetadataForClass(ListIteratorImpl, 'ListIteratorImpl', VOID, IteratorImpl);
121
121
  initMetadataForClass(AbstractMutableList, 'AbstractMutableList', VOID, AbstractMutableCollection, [KtMutableList]);
@@ -128,7 +128,7 @@ initMetadataForCompanion(Companion_2);
128
128
  initMetadataForClass(ArrayList, 'ArrayList', ArrayList_init_$Create$, AbstractMutableList, [KtMutableList, RandomAccess]);
129
129
  initMetadataForClass(HashMap, 'HashMap', HashMap_init_$Create$, AbstractMutableMap, [KtMutableMap]);
130
130
  initMetadataForClass(HashMapKeys, 'HashMapKeys', VOID, AbstractMutableSet, [KtMutableSet]);
131
- initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [MutableIterable, Collection]);
131
+ initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [Collection, MutableIterable]);
132
132
  initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [KtMutableSet]);
133
133
  initMetadataForClass(HashMapEntrySet, 'HashMapEntrySet', VOID, HashMapEntrySetBase);
134
134
  initMetadataForClass(HashMapKeysDefault$iterator$1);
@@ -1325,6 +1325,22 @@ function contains_4(_this__u8e3s4, element) {
1325
1325
  return _this__u8e3s4.q1(element);
1326
1326
  return indexOf_4(_this__u8e3s4, element) >= 0;
1327
1327
  }
1328
+ function minus(_this__u8e3s4, elements) {
1329
+ var other = convertToListIfNotCollection(elements);
1330
+ if (other.r())
1331
+ return toList_1(_this__u8e3s4);
1332
+ // Inline function 'kotlin.collections.filterNot' call
1333
+ // Inline function 'kotlin.collections.filterNotTo' call
1334
+ var destination = ArrayList_init_$Create$();
1335
+ var _iterator__ex2g4s = _this__u8e3s4.t();
1336
+ while (_iterator__ex2g4s.u()) {
1337
+ var element = _iterator__ex2g4s.v();
1338
+ if (!other.q1(element)) {
1339
+ destination.j1(element);
1340
+ }
1341
+ }
1342
+ return destination;
1343
+ }
1328
1344
  function intersect(_this__u8e3s4, other) {
1329
1345
  var otherCollection = convertToListIfNotCollection(other);
1330
1346
  // Inline function 'kotlin.collections.mutableSetOf' call
@@ -1620,7 +1636,7 @@ function plus_5(_this__u8e3s4, elements) {
1620
1636
  addAll(result, elements);
1621
1637
  return result;
1622
1638
  }
1623
- function minus(_this__u8e3s4, element) {
1639
+ function minus_0(_this__u8e3s4, element) {
1624
1640
  var result = LinkedHashSet_init_$Create$_1(mapCapacity(_this__u8e3s4.m1()));
1625
1641
  var removed = false;
1626
1642
  // Inline function 'kotlin.collections.filterTo' call
@@ -1640,7 +1656,7 @@ function minus(_this__u8e3s4, element) {
1640
1656
  }
1641
1657
  return result;
1642
1658
  }
1643
- function minus_0(_this__u8e3s4, elements) {
1659
+ function minus_1(_this__u8e3s4, elements) {
1644
1660
  var other = convertToListIfNotCollection(elements);
1645
1661
  if (other.r())
1646
1662
  return toSet_0(_this__u8e3s4);
@@ -9823,7 +9839,7 @@ function plus_10(_this__u8e3s4, pair) {
9823
9839
  function toMutableMap(_this__u8e3s4) {
9824
9840
  return LinkedHashMap_init_$Create$_1(_this__u8e3s4);
9825
9841
  }
9826
- function minus_1(_this__u8e3s4, key) {
9842
+ function minus_2(_this__u8e3s4, key) {
9827
9843
  // Inline function 'kotlin.apply' call
9828
9844
  var this_0 = toMutableMap(_this__u8e3s4);
9829
9845
  // Inline function 'kotlin.collections.minusAssign' call
@@ -17470,9 +17486,10 @@ export {
17470
17486
  mapCapacity as mapCapacity1h45rc3eh9p2l,
17471
17487
  mapOf as mapOf2zpbbmyqk8xpf,
17472
17488
  mapOf_0 as mapOf1xd03cq9cnmy8,
17473
- minus_1 as minus1f3bieyodk5vw,
17474
- minus_0 as minus165a8u1e0x1lu,
17475
- minus as minus27abgkurcn6u0,
17489
+ minus_2 as minus1f3bieyodk5vw,
17490
+ minus_1 as minus165a8u1e0x1lu,
17491
+ minus as minus2znw4oicpx34e,
17492
+ minus_0 as minus27abgkurcn6u0,
17476
17493
  mutableListOf as mutableListOf6oorvk2mtdmp,
17477
17494
  mutableSetOf as mutableSetOf3lxrr4fe5z3v8,
17478
17495
  plus_9 as plus2m1vv33moko5t,
@@ -235,11 +235,6 @@ initMetadataForClass(BufferedChannelIterator, 'BufferedChannelIterator', VOID, V
235
235
  initMetadataForCoroutine($sendCOROUTINE$, CoroutineImpl);
236
236
  initMetadataForCoroutine($receiveCOROUTINE$, CoroutineImpl);
237
237
  initMetadataForCoroutine($receiveCatchingCOROUTINE$, CoroutineImpl);
238
- function close$default(cause, $super) {
239
- cause = cause === VOID ? null : cause;
240
- return $super === VOID ? this.e1e(cause) : $super.e1e.call(this, cause);
241
- }
242
- initMetadataForInterface(SendChannel, 'SendChannel', VOID, VOID, VOID, [1]);
243
238
  function cancel$default_0(cause, $super) {
244
239
  cause = cause === VOID ? null : cause;
245
240
  var tmp;
@@ -252,7 +247,12 @@ function cancel$default_0(cause, $super) {
252
247
  return tmp;
253
248
  }
254
249
  initMetadataForInterface(ReceiveChannel, 'ReceiveChannel', VOID, VOID, VOID, [0]);
255
- initMetadataForClass(BufferedChannel, 'BufferedChannel', VOID, VOID, [SendChannel, ReceiveChannel], [1, 4, 0, 3]);
250
+ function close$default(cause, $super) {
251
+ cause = cause === VOID ? null : cause;
252
+ return $super === VOID ? this.e1e(cause) : $super.e1e.call(this, cause);
253
+ }
254
+ initMetadataForInterface(SendChannel, 'SendChannel', VOID, VOID, VOID, [1]);
255
+ initMetadataForClass(BufferedChannel, 'BufferedChannel', VOID, VOID, [ReceiveChannel, SendChannel], [1, 4, 0, 3]);
256
256
  initMetadataForClass(WaiterEB, 'WaiterEB');
257
257
  initMetadataForClass(ReceiveCatching, 'ReceiveCatching', VOID, VOID, [Waiter]);
258
258
  initMetadataForObject(Factory, 'Factory');
@@ -262,7 +262,7 @@ initMetadataForCompanion(Companion);
262
262
  initMetadataForClass(ChannelResult, 'ChannelResult');
263
263
  initMetadataForClass(ClosedReceiveChannelException, 'ClosedReceiveChannelException', VOID, NoSuchElementException);
264
264
  initMetadataForClass(ClosedSendChannelException, 'ClosedSendChannelException', VOID, IllegalStateException);
265
- initMetadataForClass(ChannelCoroutine, 'ChannelCoroutine', VOID, AbstractCoroutine, [SendChannel, ReceiveChannel], [1, 0]);
265
+ initMetadataForClass(ChannelCoroutine, 'ChannelCoroutine', VOID, AbstractCoroutine, [ReceiveChannel, SendChannel], [1, 0]);
266
266
  initMetadataForClass(ConflatedBufferedChannel, 'ConflatedBufferedChannel', VOID, BufferedChannel, VOID, [1, 0]);
267
267
  initMetadataForInterface(ProducerScope, 'ProducerScope', VOID, VOID, [CoroutineScope, SendChannel], [1]);
268
268
  initMetadataForClass(ProducerCoroutine, 'ProducerCoroutine', VOID, ChannelCoroutine, [ProducerScope], [1, 0]);
@@ -13,7 +13,6 @@ export declare class PaginatedDocumentKeyIdPair {
13
13
  *
14
14
  * The document identifier to start the next page from, used to disambiguate when multiple
15
15
  * documents share the same key.
16
- * Always null for requests that use grouped reduced views.
17
16
  */
18
17
  startKeyDocId: string | undefined;
19
18
  constructor(partial: Partial<PaginatedDocumentKeyIdPair>);
@@ -16,7 +16,6 @@ export class PaginatedDocumentKeyIdPair {
16
16
  *
17
17
  * The document identifier to start the next page from, used to disambiguate when multiple
18
18
  * documents share the same key.
19
- * Always null for requests that use grouped reduced views.
20
19
  */
21
20
  this.startKeyDocId = undefined;
22
21
  if ('startKey' in partial)
@@ -59,7 +59,7 @@ export declare class HealthElementAsserter {
59
59
  * party is named by
60
60
  * [localAsserterIdentifier]. Carries no [AsserterTypeDto].
61
61
  */
62
- externalAsserterIdentifier: Identifier | undefined;
62
+ externalAsserterIdentifier: HealthElementAsserter.ExternalAsserterIdentifier | undefined;
63
63
  constructor(partial: Partial<HealthElementAsserter>);
64
64
  toJSON(): object;
65
65
  static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): HealthElementAsserter;
@@ -88,4 +88,33 @@ export declare namespace HealthElementAsserter {
88
88
  toJSON(): object;
89
89
  static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): LocalAsserterIdentifier;
90
90
  }
91
+ /**
92
+ *
93
+ *
94
+ * The party making the assertion, when it has no record in this iCure instance.
95
+ *
96
+ * The party is named by a business [identifier] issued by another system: a national registry
97
+ * number, an entry in
98
+ * the sending hospital's directory, and so on. Because the record lives elsewhere there is no
99
+ * [AsserterTypeDto]
100
+ * here - the kind of a record we do not store is not knowable to us. The wrapper around the
101
+ * [IdentifierDto] mirrors
102
+ * [LocalAsserterIdentifier] on the other branch, and is where anything specific to an external
103
+ * asserter would go:
104
+ * [IdentifierDto] itself is shared by every `identifiers` field in the model and cannot carry it.
105
+ */
106
+ class ExternalAsserterIdentifier {
107
+ /**
108
+ *
109
+ *
110
+ * The business identifier of the party in the system that issued it. `system` names that issuing
111
+ * system and
112
+ * `value` is the party's identifier within it; together they are what makes the party
113
+ * resolvable.
114
+ */
115
+ identifier: Identifier;
116
+ constructor(partial: Partial<ExternalAsserterIdentifier> & Pick<ExternalAsserterIdentifier, "identifier">);
117
+ toJSON(): object;
118
+ static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): ExternalAsserterIdentifier;
119
+ }
91
120
  }
@@ -83,7 +83,7 @@ export class HealthElementAsserter {
83
83
  const jCpy = Object.assign({}, json);
84
84
  const res = new HealthElementAsserter({
85
85
  localAsserterIdentifier: expectObject(extractEntry(jCpy, 'localAsserterIdentifier', false, path), true, ignoreUnknownKeys, [...path, ".localAsserterIdentifier"], HealthElementAsserter.LocalAsserterIdentifier.fromJSON),
86
- externalAsserterIdentifier: expectObject(extractEntry(jCpy, 'externalAsserterIdentifier', false, path), true, ignoreUnknownKeys, [...path, ".externalAsserterIdentifier"], Identifier.fromJSON),
86
+ externalAsserterIdentifier: expectObject(extractEntry(jCpy, 'externalAsserterIdentifier', false, path), true, ignoreUnknownKeys, [...path, ".externalAsserterIdentifier"], HealthElementAsserter.ExternalAsserterIdentifier.fromJSON),
87
87
  });
88
88
  if (!ignoreUnknownKeys) {
89
89
  const unused = Object.keys(jCpy);
@@ -128,4 +128,44 @@ export class HealthElementAsserter {
128
128
  }
129
129
  }
130
130
  HealthElementAsserter.LocalAsserterIdentifier = LocalAsserterIdentifier;
131
+ /**
132
+ *
133
+ *
134
+ * The party making the assertion, when it has no record in this iCure instance.
135
+ *
136
+ * The party is named by a business [identifier] issued by another system: a national registry
137
+ * number, an entry in
138
+ * the sending hospital's directory, and so on. Because the record lives elsewhere there is no
139
+ * [AsserterTypeDto]
140
+ * here - the kind of a record we do not store is not knowable to us. The wrapper around the
141
+ * [IdentifierDto] mirrors
142
+ * [LocalAsserterIdentifier] on the other branch, and is where anything specific to an external
143
+ * asserter would go:
144
+ * [IdentifierDto] itself is shared by every `identifiers` field in the model and cannot carry it.
145
+ */
146
+ class ExternalAsserterIdentifier {
147
+ constructor(partial) {
148
+ this.identifier = partial.identifier;
149
+ }
150
+ toJSON() {
151
+ const res = {};
152
+ res['identifier'] = this.identifier.toJSON();
153
+ return res;
154
+ }
155
+ static fromJSON(json, ignoreUnknownKeys = false, path = ['ExternalAsserterIdentifier']) {
156
+ if (typeof json != 'object')
157
+ throw new Error(`Expected json object at path ${path.join("")}`);
158
+ const jCpy = Object.assign({}, json);
159
+ const res = new ExternalAsserterIdentifier({
160
+ identifier: expectObject(extractEntry(jCpy, 'identifier', true, path), false, ignoreUnknownKeys, [...path, ".identifier"], Identifier.fromJSON),
161
+ });
162
+ if (!ignoreUnknownKeys) {
163
+ const unused = Object.keys(jCpy);
164
+ if (unused.length > 0)
165
+ throw new Error(`Unexpected key(s) for json object ExternalAsserterIdentifier at path ${path.join("")}: ${unused}`);
166
+ }
167
+ return res;
168
+ }
169
+ }
170
+ HealthElementAsserter.ExternalAsserterIdentifier = ExternalAsserterIdentifier;
131
171
  })(HealthElementAsserter || (HealthElementAsserter = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/cardinal-sdk",
3
- "version": "3.0.0-PREVIEW-2",
3
+ "version": "3.0.0-PREVIEW-3",
4
4
  "main": "cardinal-sdk-ts.mjs",
5
5
  "types": "cardinal-sdk-ts.d.mts",
6
6
  "devDependencies": {