@icure/cardinal-sdk 2.12.1 → 2.13.0

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.
@@ -0,0 +1,49 @@
1
+ import { AsserterType } from './AsserterType.mjs';
2
+ /**
3
+ *
4
+ *
5
+ * The party asserting that the patient has the healthcare element this asserter is attached to.
6
+ *
7
+ * This is the FHIR-style *asserter* concept: it does not say who recorded or authored the
8
+ * healthcare element, it says
9
+ * on whose word the healthcare element is held to be true. A patient may self-report an allergy, a
10
+ * family member may
11
+ * report a condition on behalf of the patient, and a physician may assert a diagnosis: all three
12
+ * are asserters, and the
13
+ * same healthcare element may carry more than one of them.
14
+ *
15
+ * The two fields must agree: [asserterType] declares which kind of entity [asserterId] points at.
16
+ * [AsserterTypeDto]
17
+ * bounds the vocabulary, but nothing enforces the *pairing* - the field is encrypted, so the
18
+ * server never sees the
19
+ * values and cannot validate or repair them; that invariant is owned by the SDK.
20
+ *
21
+ * Note on organisations: an organisation (hospital, practice, care home, ...) is not a distinct
22
+ * asserter type.
23
+ * Organisations are stored as healthcare party records, distinguished from individual
24
+ * practitioners by tags set by the
25
+ * client, so an organisation asserter is an entry with `asserterType =
26
+ * AsserterTypeDto.healthcareParty` whose
27
+ * [asserterId] points to such a record. The association between a practitioner and the
28
+ * organisation they were acting
29
+ * for at the time of the assertion is deliberately NOT modelled here.
30
+ */
31
+ export declare class HealthElementAsserter {
32
+ /**
33
+ *
34
+ * The id of the entity making the assertion. Which entity it refers to is given by [asserterType].
35
+ *
36
+ */
37
+ asserterId: string;
38
+ /**
39
+ *
40
+ *
41
+ * The kind of entity [asserterId] refers to. This is the kind of entity, not the role the party
42
+ * played - do not
43
+ * confuse it with ParticipantTypeDto.
44
+ */
45
+ asserterType: AsserterType;
46
+ constructor(partial: Partial<HealthElementAsserter> & Pick<HealthElementAsserter, "asserterId" | "asserterType">);
47
+ toJSON(): object;
48
+ static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): HealthElementAsserter;
49
+ }
@@ -0,0 +1,59 @@
1
+ // auto-generated file
2
+ import { expectString, expectStringEnum, extractEntry } from '../../internal/JsonDecodeUtils.mjs';
3
+ import { AsserterType } from './AsserterType.mjs';
4
+ /**
5
+ *
6
+ *
7
+ * The party asserting that the patient has the healthcare element this asserter is attached to.
8
+ *
9
+ * This is the FHIR-style *asserter* concept: it does not say who recorded or authored the
10
+ * healthcare element, it says
11
+ * on whose word the healthcare element is held to be true. A patient may self-report an allergy, a
12
+ * family member may
13
+ * report a condition on behalf of the patient, and a physician may assert a diagnosis: all three
14
+ * are asserters, and the
15
+ * same healthcare element may carry more than one of them.
16
+ *
17
+ * The two fields must agree: [asserterType] declares which kind of entity [asserterId] points at.
18
+ * [AsserterTypeDto]
19
+ * bounds the vocabulary, but nothing enforces the *pairing* - the field is encrypted, so the
20
+ * server never sees the
21
+ * values and cannot validate or repair them; that invariant is owned by the SDK.
22
+ *
23
+ * Note on organisations: an organisation (hospital, practice, care home, ...) is not a distinct
24
+ * asserter type.
25
+ * Organisations are stored as healthcare party records, distinguished from individual
26
+ * practitioners by tags set by the
27
+ * client, so an organisation asserter is an entry with `asserterType =
28
+ * AsserterTypeDto.healthcareParty` whose
29
+ * [asserterId] points to such a record. The association between a practitioner and the
30
+ * organisation they were acting
31
+ * for at the time of the assertion is deliberately NOT modelled here.
32
+ */
33
+ export class HealthElementAsserter {
34
+ constructor(partial) {
35
+ this.asserterId = partial.asserterId;
36
+ this.asserterType = partial.asserterType;
37
+ }
38
+ toJSON() {
39
+ const res = {};
40
+ res['asserterId'] = this.asserterId;
41
+ res['asserterType'] = this.asserterType;
42
+ return res;
43
+ }
44
+ static fromJSON(json, ignoreUnknownKeys = false, path = ['HealthElementAsserter']) {
45
+ if (typeof json != 'object')
46
+ throw new Error(`Expected json object at path ${path.join("")}`);
47
+ const jCpy = Object.assign({}, json);
48
+ const res = new HealthElementAsserter({
49
+ asserterId: expectString(extractEntry(jCpy, 'asserterId', true, path), false, [...path, ".asserterId"]),
50
+ asserterType: expectStringEnum(extractEntry(jCpy, 'asserterType', true, path), false, [...path, ".asserterType"], AsserterType, 'AsserterType'),
51
+ });
52
+ if (!ignoreUnknownKeys) {
53
+ const unused = Object.keys(jCpy);
54
+ if (unused.length > 0)
55
+ throw new Error(`Unexpected key(s) for json object HealthElementAsserter at path ${path.join("")}: ${unused}`);
56
+ }
57
+ return res;
58
+ }
59
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ *
3
+ * A directed, qualified link from one healthcare element to another. Links should be created in a
4
+ * single direction:
5
+ * the reverse link can be found through a view.
6
+ * /
7
+ */
8
+ export declare class HealthElementQualifiedLink {
9
+ /**
10
+ *
11
+ * The qualification of the link. Free string; using the names of LinkQualification entries is
12
+ * encouraged but not enforced.
13
+ */
14
+ type: string;
15
+ /**
16
+ *
17
+ * A caller-chosen correlation id that groups related links across entities.
18
+ */
19
+ associationId: string | undefined;
20
+ /**
21
+ *
22
+ * The id of the linked healthcare element.
23
+ */
24
+ healthElementId: string;
25
+ constructor(partial: Partial<HealthElementQualifiedLink> & Pick<HealthElementQualifiedLink, "type" | "healthElementId">);
26
+ toJSON(): object;
27
+ static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): HealthElementQualifiedLink;
28
+ }
@@ -0,0 +1,46 @@
1
+ // auto-generated file
2
+ import { expectString, extractEntry } from '../../internal/JsonDecodeUtils.mjs';
3
+ /**
4
+ *
5
+ * A directed, qualified link from one healthcare element to another. Links should be created in a
6
+ * single direction:
7
+ * the reverse link can be found through a view.
8
+ * /
9
+ */
10
+ export class HealthElementQualifiedLink {
11
+ constructor(partial) {
12
+ /**
13
+ *
14
+ * A caller-chosen correlation id that groups related links across entities.
15
+ */
16
+ this.associationId = undefined;
17
+ this.type = partial.type;
18
+ if ('associationId' in partial)
19
+ this.associationId = partial.associationId;
20
+ this.healthElementId = partial.healthElementId;
21
+ }
22
+ toJSON() {
23
+ const res = {};
24
+ res['type'] = this.type;
25
+ if (this.associationId != undefined)
26
+ res['associationId'] = this.associationId;
27
+ res['healthElementId'] = this.healthElementId;
28
+ return res;
29
+ }
30
+ static fromJSON(json, ignoreUnknownKeys = false, path = ['HealthElementQualifiedLink']) {
31
+ if (typeof json != 'object')
32
+ throw new Error(`Expected json object at path ${path.join("")}`);
33
+ const jCpy = Object.assign({}, json);
34
+ const res = new HealthElementQualifiedLink({
35
+ type: expectString(extractEntry(jCpy, 'type', true, path), false, [...path, ".type"]),
36
+ associationId: expectString(extractEntry(jCpy, 'associationId', false, path), true, [...path, ".associationId"]),
37
+ healthElementId: expectString(extractEntry(jCpy, 'healthElementId', true, path), false, [...path, ".healthElementId"]),
38
+ });
39
+ if (!ignoreUnknownKeys) {
40
+ const unused = Object.keys(jCpy);
41
+ if (unused.length > 0)
42
+ throw new Error(`Unexpected key(s) for json object HealthElementQualifiedLink at path ${path.join("")}: ${unused}`);
43
+ }
44
+ return res;
45
+ }
46
+ }
@@ -17,4 +17,4 @@ import { TimePicker } from './TimePicker.mjs';
17
17
  * validation rules, and optional codification and tagging.
18
18
  * /
19
19
  */
20
- export type Field = DropdownField | RadioButton | DatePicker | TimePicker | DateTimePicker | NumberField | TextField | CheckBox | MultipleChoice | MeasureField;
20
+ export type Field = DropdownField | TimePicker | RadioButton | DatePicker | MeasureField | TextField | DateTimePicker | MultipleChoice | CheckBox | NumberField;
@@ -15,15 +15,15 @@ export var StructureElement;
15
15
  function fromJSON(json, ignoreUnknownKeys = false, path = ['StructureElement']) {
16
16
  switch (json.$ktClass) {
17
17
  case 'com.icure.cardinal.sdk.model.embed.form.template.DropdownField': return DropdownField.fromJSON(json, ignoreUnknownKeys);
18
+ case 'com.icure.cardinal.sdk.model.embed.form.template.TimePicker': return TimePicker.fromJSON(json, ignoreUnknownKeys);
18
19
  case 'com.icure.cardinal.sdk.model.embed.form.template.RadioButton': return RadioButton.fromJSON(json, ignoreUnknownKeys);
19
20
  case 'com.icure.cardinal.sdk.model.embed.form.template.DatePicker': return DatePicker.fromJSON(json, ignoreUnknownKeys);
20
- case 'com.icure.cardinal.sdk.model.embed.form.template.TimePicker': return TimePicker.fromJSON(json, ignoreUnknownKeys);
21
- case 'com.icure.cardinal.sdk.model.embed.form.template.DateTimePicker': return DateTimePicker.fromJSON(json, ignoreUnknownKeys);
22
- case 'com.icure.cardinal.sdk.model.embed.form.template.NumberField': return NumberField.fromJSON(json, ignoreUnknownKeys);
21
+ case 'com.icure.cardinal.sdk.model.embed.form.template.MeasureField': return MeasureField.fromJSON(json, ignoreUnknownKeys);
23
22
  case 'com.icure.cardinal.sdk.model.embed.form.template.TextField': return TextField.fromJSON(json, ignoreUnknownKeys);
24
- case 'com.icure.cardinal.sdk.model.embed.form.template.CheckBox': return CheckBox.fromJSON(json, ignoreUnknownKeys);
23
+ case 'com.icure.cardinal.sdk.model.embed.form.template.DateTimePicker': return DateTimePicker.fromJSON(json, ignoreUnknownKeys);
25
24
  case 'com.icure.cardinal.sdk.model.embed.form.template.MultipleChoice': return MultipleChoice.fromJSON(json, ignoreUnknownKeys);
26
- case 'com.icure.cardinal.sdk.model.embed.form.template.MeasureField': return MeasureField.fromJSON(json, ignoreUnknownKeys);
25
+ case 'com.icure.cardinal.sdk.model.embed.form.template.CheckBox': return CheckBox.fromJSON(json, ignoreUnknownKeys);
26
+ case 'com.icure.cardinal.sdk.model.embed.form.template.NumberField': return NumberField.fromJSON(json, ignoreUnknownKeys);
27
27
  case 'com.icure.cardinal.sdk.model.embed.form.template.FieldsGroup': return FieldsGroup.fromJSON(json, ignoreUnknownKeys);
28
28
  default: throw new Error('Unexpected discriminator for StructureElement: ' + json.$ktClass);
29
29
  }
@@ -9,7 +9,7 @@ import { OrPredicate } from './OrPredicate.mjs';
9
9
  * chain.
10
10
  * /
11
11
  */
12
- export type Predicate = NotPredicate | AndPredicate | AlwaysPredicate | OrPredicate | KeyValuePredicate;
12
+ export type Predicate = KeyValuePredicate | AlwaysPredicate | NotPredicate | AndPredicate | OrPredicate;
13
13
  export declare namespace Predicate {
14
14
  function fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): Predicate;
15
15
  }
@@ -8,11 +8,11 @@ export var Predicate;
8
8
  (function (Predicate) {
9
9
  function fromJSON(json, ignoreUnknownKeys = false, path = ['Predicate']) {
10
10
  switch (json.$ktClass) {
11
+ case 'com.icure.cardinal.sdk.model.filter.predicate.KeyValuePredicate': return KeyValuePredicate.fromJSON(json, ignoreUnknownKeys);
12
+ case 'com.icure.cardinal.sdk.model.filter.predicate.AlwaysPredicate': return AlwaysPredicate.fromJSON(json, ignoreUnknownKeys);
11
13
  case 'com.icure.cardinal.sdk.model.filter.predicate.NotPredicate': return NotPredicate.fromJSON(json, ignoreUnknownKeys);
12
14
  case 'com.icure.cardinal.sdk.model.filter.predicate.AndPredicate': return AndPredicate.fromJSON(json, ignoreUnknownKeys);
13
- case 'com.icure.cardinal.sdk.model.filter.predicate.AlwaysPredicate': return AlwaysPredicate.fromJSON(json, ignoreUnknownKeys);
14
15
  case 'com.icure.cardinal.sdk.model.filter.predicate.OrPredicate': return OrPredicate.fromJSON(json, ignoreUnknownKeys);
15
- case 'com.icure.cardinal.sdk.model.filter.predicate.KeyValuePredicate': return KeyValuePredicate.fromJSON(json, ignoreUnknownKeys);
16
16
  default: throw new Error('Unexpected discriminator for Predicate: ' + json.$ktClass);
17
17
  }
18
18
  }