@icure/api 8.5.3 → 8.5.5

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,21 @@
1
+ /**
2
+ * iCure Data Stack API Documentation
3
+ * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
4
+ *
5
+ * OpenAPI spec version: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by the swagger code generator program.
9
+ * https://github.com/swagger-api/swagger-codegen.git
10
+ * Do not edit the class manually.
11
+ */
12
+ import { AbstractFilterHealthcareParty } from '../../icc-api/model/AbstractFilterHealthcareParty';
13
+ export declare class HealthcarePartyByIdentifiersFilter extends AbstractFilterHealthcareParty {
14
+ $type: string;
15
+ constructor(json: JSON | any);
16
+ identifiers?: Array<{
17
+ system: string;
18
+ value: string;
19
+ }>;
20
+ desc?: string;
21
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HealthcarePartyByIdentifiersFilter = void 0;
4
+ /**
5
+ * iCure Data Stack API Documentation
6
+ * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
7
+ *
8
+ * OpenAPI spec version: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by the swagger code generator program.
12
+ * https://github.com/swagger-api/swagger-codegen.git
13
+ * Do not edit the class manually.
14
+ */
15
+ const AbstractFilterHealthcareParty_1 = require("../../icc-api/model/AbstractFilterHealthcareParty");
16
+ class HealthcarePartyByIdentifiersFilter extends AbstractFilterHealthcareParty_1.AbstractFilterHealthcareParty {
17
+ constructor(json) {
18
+ super(json);
19
+ this.$type = 'HealthcarePartyByIdentifiersFilter';
20
+ Object.assign(this, json);
21
+ }
22
+ }
23
+ exports.HealthcarePartyByIdentifiersFilter = HealthcarePartyByIdentifiersFilter;
24
+ //# sourceMappingURL=HealthcarePartyByIdentifiersFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HealthcarePartyByIdentifiersFilter.js","sourceRoot":"","sources":["../../../icc-x-api/filters/HealthcarePartyByIdentifiersFilter.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,qGAAiG;AAEjG,MAAa,kCAAmC,SAAQ,6DAA6B;IAEnF,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAA;QAFb,UAAK,GAAW,oCAAoC,CAAA;QAIlD,MAAM,CAAC,MAAM,CAAC,IAA0C,EAAE,IAAI,CAAC,CAAA;IACjE,CAAC;CAIF;AAVD,gFAUC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { AbstractFilterHealthcareParty } from '../../icc-api/model/AbstractFilterHealthcareParty'\n\nexport class HealthcarePartyByIdentifiersFilter extends AbstractFilterHealthcareParty {\n $type: string = 'HealthcarePartyByIdentifiersFilter'\n constructor(json: JSON | any) {\n super(json)\n\n Object.assign(this as HealthcarePartyByIdentifiersFilter, json)\n }\n\n identifiers?: Array<{system: string; value: string}>\n desc?: string\n}\n"]}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * iCure Data Stack API Documentation
3
+ * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
4
+ *
5
+ * OpenAPI spec version: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by the swagger code generator program.
9
+ * https://github.com/swagger-api/swagger-codegen.git
10
+ * Do not edit the class manually.
11
+ */
12
+ import { AbstractFilterHealthcareParty } from '../../icc-api/model/AbstractFilterHealthcareParty';
13
+ export declare class HealthcarePartyByNationalIdentifierFilter extends AbstractFilterHealthcareParty {
14
+ $type: string;
15
+ constructor(json: JSON | any);
16
+ searchValue?: string;
17
+ descending?: boolean;
18
+ desc?: string;
19
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HealthcarePartyByNationalIdentifierFilter = void 0;
4
+ /**
5
+ * iCure Data Stack API Documentation
6
+ * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
7
+ *
8
+ * OpenAPI spec version: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by the swagger code generator program.
12
+ * https://github.com/swagger-api/swagger-codegen.git
13
+ * Do not edit the class manually.
14
+ */
15
+ const AbstractFilterHealthcareParty_1 = require("../../icc-api/model/AbstractFilterHealthcareParty");
16
+ class HealthcarePartyByNationalIdentifierFilter extends AbstractFilterHealthcareParty_1.AbstractFilterHealthcareParty {
17
+ constructor(json) {
18
+ super(json);
19
+ this.$type = 'HealthcarePartyByNationalIdentifierFilter';
20
+ Object.assign(this, json);
21
+ }
22
+ }
23
+ exports.HealthcarePartyByNationalIdentifierFilter = HealthcarePartyByNationalIdentifierFilter;
24
+ //# sourceMappingURL=HealthcarePartyByNationalIdentifierFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HealthcarePartyByNationalIdentifierFilter.js","sourceRoot":"","sources":["../../../icc-x-api/filters/HealthcarePartyByNationalIdentifierFilter.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,qGAAiG;AAEjG,MAAa,yCAA0C,SAAQ,6DAA6B;IAE1F,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAA;QAFb,UAAK,GAAW,2CAA2C,CAAA;QAIzD,MAAM,CAAC,MAAM,CAAC,IAAiD,EAAE,IAAI,CAAC,CAAA;IACxE,CAAC;CAKF;AAXD,8FAWC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { AbstractFilterHealthcareParty } from '../../icc-api/model/AbstractFilterHealthcareParty'\n\nexport class HealthcarePartyByNationalIdentifierFilter extends AbstractFilterHealthcareParty {\n $type: string = 'HealthcarePartyByNationalIdentifierFilter'\n constructor(json: JSON | any) {\n super(json)\n\n Object.assign(this as HealthcarePartyByNationalIdentifierFilter, json)\n }\n\n searchValue?: string\n descending?: boolean\n desc?: string\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { AbstractFilterService } from '../../icc-api/model/AbstractFilterService';
2
+ export declare class ServiceByHcPartyCodePrefixFilter extends AbstractFilterService {
3
+ readonly $type: 'ServiceByHcPartyCodePrefixFilter';
4
+ constructor(base: {
5
+ healthcarePartyId: string;
6
+ codeType: string;
7
+ codeCodePrefix: string;
8
+ desc?: string;
9
+ });
10
+ desc: string | undefined;
11
+ healthcarePartyId: string;
12
+ codeType: string;
13
+ codeCodePrefix: string;
14
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceByHcPartyCodePrefixFilter = void 0;
4
+ const AbstractFilterService_1 = require("../../icc-api/model/AbstractFilterService");
5
+ class ServiceByHcPartyCodePrefixFilter extends AbstractFilterService_1.AbstractFilterService {
6
+ constructor(base) {
7
+ super({ desc: base.desc });
8
+ this.$type = 'ServiceByHcPartyCodePrefixFilter';
9
+ this.healthcarePartyId = base.healthcarePartyId;
10
+ this.codeType = base.codeType;
11
+ this.codeCodePrefix = base.codeCodePrefix;
12
+ }
13
+ }
14
+ exports.ServiceByHcPartyCodePrefixFilter = ServiceByHcPartyCodePrefixFilter;
15
+ //# sourceMappingURL=ServiceByHcPartyCodePrefixFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServiceByHcPartyCodePrefixFilter.js","sourceRoot":"","sources":["../../../icc-x-api/filters/ServiceByHcPartyCodePrefixFilter.ts"],"names":[],"mappings":";;;AAAA,qFAAiF;AAEjF,MAAa,gCAAiC,SAAQ,6CAAqB;IAEzE,YAAY,IAA4F;QACtG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAFnB,UAAK,GAAuC,kCAAkC,CAAA;QAGrF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;QAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;IAC3C,CAAC;CAMF;AAbD,4EAaC","sourcesContent":["import { AbstractFilterService } from '../../icc-api/model/AbstractFilterService'\n\nexport class ServiceByHcPartyCodePrefixFilter extends AbstractFilterService {\n readonly $type: 'ServiceByHcPartyCodePrefixFilter' = 'ServiceByHcPartyCodePrefixFilter'\n constructor(base: { healthcarePartyId: string; codeType: string; codeCodePrefix: string; desc?: string }) {\n super({ desc: base.desc })\n this.healthcarePartyId = base.healthcarePartyId\n this.codeType = base.codeType\n this.codeCodePrefix = base.codeCodePrefix\n }\n\n desc: string | undefined\n healthcarePartyId: string\n codeType: string\n codeCodePrefix: string\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { AbstractFilterService } from '../../icc-api/model/AbstractFilterService';
2
+ export declare class ServiceByHcPartyTagPrefixFilter extends AbstractFilterService {
3
+ readonly $type: 'ServiceByHcPartyTagPrefixFilter';
4
+ constructor(base: {
5
+ healthcarePartyId: string;
6
+ tagType: string;
7
+ tagCodePrefix: string;
8
+ desc?: string;
9
+ });
10
+ desc: string | undefined;
11
+ healthcarePartyId: string;
12
+ tagType: string;
13
+ tagCodePrefix: string;
14
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceByHcPartyTagPrefixFilter = void 0;
4
+ const AbstractFilterService_1 = require("../../icc-api/model/AbstractFilterService");
5
+ class ServiceByHcPartyTagPrefixFilter extends AbstractFilterService_1.AbstractFilterService {
6
+ constructor(base) {
7
+ super({ desc: base.desc });
8
+ this.$type = 'ServiceByHcPartyTagPrefixFilter';
9
+ this.healthcarePartyId = base.healthcarePartyId;
10
+ this.tagType = base.tagType;
11
+ this.tagCodePrefix = base.tagCodePrefix;
12
+ }
13
+ }
14
+ exports.ServiceByHcPartyTagPrefixFilter = ServiceByHcPartyTagPrefixFilter;
15
+ //# sourceMappingURL=ServiceByHcPartyTagPrefixFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServiceByHcPartyTagPrefixFilter.js","sourceRoot":"","sources":["../../../icc-x-api/filters/ServiceByHcPartyTagPrefixFilter.ts"],"names":[],"mappings":";;;AAAA,qFAAiF;AAEjF,MAAa,+BAAgC,SAAQ,6CAAqB;IAExE,YAAY,IAA0F;QACpG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAFnB,UAAK,GAAsC,iCAAiC,CAAA;QAGnF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;QAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC3B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;IACzC,CAAC;CAMF;AAbD,0EAaC","sourcesContent":["import { AbstractFilterService } from '../../icc-api/model/AbstractFilterService'\n\nexport class ServiceByHcPartyTagPrefixFilter extends AbstractFilterService {\n readonly $type: 'ServiceByHcPartyTagPrefixFilter' = 'ServiceByHcPartyTagPrefixFilter'\n constructor(base: { healthcarePartyId: string; tagType: string; tagCodePrefix: string; desc?: string }) {\n super({ desc: base.desc })\n this.healthcarePartyId = base.healthcarePartyId\n this.tagType = base.tagType\n this.tagCodePrefix = base.tagCodePrefix\n }\n\n desc: string | undefined\n healthcarePartyId: string\n tagType: string\n tagCodePrefix: string\n}\n"]}
@@ -46,6 +46,8 @@ export * from './HealthElementByIdsFilter';
46
46
  export * from './HealthcarePartyByIdsFilter';
47
47
  export * from './HealthcarePartyByNameFilter';
48
48
  export * from './HealthcarePartyByTagCodeFilter';
49
+ export * from './HealthcarePartyByIdentifiersFilter';
50
+ export * from './HealthcarePartyByIdsFilter';
49
51
  export * from './IntersectionFilter';
50
52
  export * from './InvoiceByHcPartyCodeDateFilter';
51
53
  export * from './PatientByHcPartyAndActiveFilter';
@@ -54,6 +54,8 @@ __exportStar(require("./HealthElementByIdsFilter"), exports);
54
54
  __exportStar(require("./HealthcarePartyByIdsFilter"), exports);
55
55
  __exportStar(require("./HealthcarePartyByNameFilter"), exports);
56
56
  __exportStar(require("./HealthcarePartyByTagCodeFilter"), exports);
57
+ __exportStar(require("./HealthcarePartyByIdentifiersFilter"), exports);
58
+ __exportStar(require("./HealthcarePartyByIdsFilter"), exports);
57
59
  __exportStar(require("./IntersectionFilter"), exports);
58
60
  __exportStar(require("./InvoiceByHcPartyCodeDateFilter"), exports);
59
61
  __exportStar(require("./PatientByHcPartyAndActiveFilter"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../icc-x-api/filters/filters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAiD;AAOjD,6DAAyD;AACzD,+CAA2C;AAC3C,yDAAqD;AACrD,uFAAmF;AACnF,yFAAqF;AACrF,+FAA2F;AAC3F,qFAAiF;AACjF,yGAAqG;AACrG,2FAAuF;AAEvF,uCAAsC;AACtC,qEAAiE;AACjE,uHAAmH;AACnH,6DAAyD;AACzD,uGAAmG;AAGnG,qEAAiE;AAgBjE,mDAAgC;AAChC,qDAAkC;AAClC,uDAAoC;AACpC,+DAA4C;AAC5C,mDAAgC;AAChC,oDAAiC;AACjC,wEAAqD;AACrD,qDAAkC;AAClC,mDAAgC;AAChC,2DAAwC;AACxC,6EAA0D;AAC1D,sEAAmD;AACnD,8DAA2C;AAC3C,0DAAuC;AACvC,sDAAmC;AACnC,iEAA8C;AAC9C,4EAAyD;AACzD,kFAA+D;AAC/D,wEAAqD;AAC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AAiB,EAAE,IAAI,CAAC,KAAK;YAC7B,YAAY,EAAE,IAAI;SACnB,CAAC,EACJ,IAAI,CAAC,KAAK,CACX,CACsB,CAAA;IAC3B,CAAC;IAED,KAAK;;QACH,OAAO,CAAA,MAAA,IAAI,CAAC,cAAc,oDAAI,KAAI,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAA;IACtD,CAAC;CACF","sourcesContent":["import { ConstantFilter } from './ConstantFilter'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { AbstractFilterPatient } from '../../icc-api/model/AbstractFilterPatient'\nimport { AbstractFilterContact } from '../../icc-api/model/AbstractFilterContact'\nimport { AbstractFilterService } from '../../icc-api/model/AbstractFilterService'\nimport { Service } from '../../icc-api/model/Service'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { IntersectionFilter } from './IntersectionFilter'\nimport { UnionFilter } from './UnionFilter'\nimport { ComplementFilter } from './ComplementFilter'\nimport { PatientByHcPartyAndActiveFilter } from './PatientByHcPartyAndActiveFilter'\nimport { PatientByHcPartyAndAddressFilter } from './PatientByHcPartyAndAddressFilter'\nimport { PatientByHcPartyAndExternalIdFilter } from './PatientByHcPartyAndExternalIdFilter'\nimport { PatientByHcPartyAndSsinsFilter } from './PatientByHcPartyAndSsinsFilter'\nimport { PatientByHcPartyDateOfBirthBetweenFilter } from './PatientByHcPartyDateOfBirthBetweenFilter'\nimport { PatientByHcPartyDateOfBirthFilter } from './PatientByHcPartyDateOfBirthFilter'\n\nimport { add, format } from 'date-fns'\nimport { PatientByHcPartyFilter } from './PatientByHcPartyFilter'\nimport { PatientByHcPartyGenderEducationProfessionFilter } from './PatientByHcPartyGenderEducationProfessionFilter'\nimport { PatientByIdsFilter } from './PatientByIdsFilter'\nimport { PatientByHcPartyNameContainsFuzzyFilter } from './PatientByHcPartyNameContainsFuzzyFilter'\n\nimport GenderEnum = Patient.GenderEnum\nimport { ContactByHcPartyFilter } from './ContactByHcPartyFilter'\nimport { Device } from '../../icc-api/model/Device'\nimport { AbstractFilterDevice } from '../../icc-api/model/AbstractFilterDevice'\nimport { MaintenanceTask } from '../../icc-api/model/MaintenanceTask'\nimport { AbstractFilterMaintenanceTask } from '../../icc-api/model/AbstractFilterMaintenanceTask'\nimport { Code } from '../../icc-api/model/Code'\nimport { AbstractFilterCode } from '../../icc-api/model/AbstractFilterCode'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { AbstractFilterHealthElement } from '../../icc-api/model/AbstractFilterHealthElement'\nimport { Invoice } from '../../icc-api/model/Invoice'\nimport { AbstractFilterInvoice } from '../../icc-api/model/AbstractFilterInvoice'\nimport { User } from '../../icc-api/model/User'\nimport { AbstractFilterUser } from '../../icc-api/model/AbstractFilterUser'\nimport { HealthcareParty } from '../../icc-api/model/HealthcareParty'\nimport { AbstractFilterHealthcareParty } from '../../icc-api/model/AbstractFilterHealthcareParty'\n\nexport * from './AllCodesFilter'\nexport * from './AllDevicesFilter'\nexport * from './AllDocumentsFilter'\nexport * from './AllHealthcarePartiesFilter'\nexport * from './AllUsersFilter'\nexport * from './CodeByIdsFilter'\nexport * from './CodeByRegionTypeLabelLanguageFilter'\nexport * from './ComplementFilter'\nexport * from './ConstantFilter'\nexport * from './ContactByHcPartyFilter'\nexport * from './ContactByHcPartyPatientTagCodeDateFilter'\nexport * from './ContactByHcPartyTagCodeDateFilter'\nexport * from './ContactByServiceIdsFilter'\nexport * from './DeviceByHcPartyFilter'\nexport * from './DeviceByIdsFilter'\nexport * from './HealthElementByHcPartyFilter'\nexport * from './HealthElementByHcPartyIdentifiersFilter'\nexport * from './HealthElementByHcPartySecretForeignKeysFilter'\nexport * from './HealthElementByHcPartyTagCodeFilter'\nexport * from './HealthElementByIdsFilter'\nexport * from './HealthcarePartyByIdsFilter'\nexport * from './HealthcarePartyByNameFilter'\nexport * from './HealthcarePartyByTagCodeFilter'\nexport * from './IntersectionFilter'\nexport * from './InvoiceByHcPartyCodeDateFilter'\nexport * from './PatientByHcPartyAndActiveFilter'\nexport * from './PatientByHcPartyAndAddressFilter'\nexport * from './PatientByHcPartyAndExternalIdFilter'\nexport * from './PatientByHcPartyAndIdentifiersFilter'\nexport * from './PatientByHcPartyAndSsinFilter'\nexport * from './PatientByHcPartyAndSsinsFilter'\nexport * from './PatientByHcPartyDateOfBirthBetweenFilter'\nexport * from './PatientByHcPartyDateOfBirthFilter'\nexport * from './PatientByHcPartyFilter'\nexport * from './PatientByHcPartyGenderEducationProfessionFilter'\nexport * from './PatientByHcPartyNameContainsFuzzyFilter'\nexport * from './PatientByHcPartyNameFilter'\nexport * from './PatientByIdsFilter'\nexport * from './ServiceByContactsAndSubcontactsFilter'\nexport * from './ServiceByHcPartyFilter'\nexport * from './ServiceByHcPartyIdentifiersFilter'\nexport * from './ServiceByHcPartyHealthElementIdsFilter'\nexport * from './ServiceByHcPartyTagCodeDateFilter'\nexport * from './ServiceByIdsFilter'\nexport * from './ServiceBySecretForeignKeys'\nexport * from './UnionFilter'\nexport * from './UserByIdsFilter'\nexport * from './MaintenanceTaskByHcPartyAndIdentifiersFilter'\nexport * from './MaintenanceTaskByHcPartyAndTypeFilter'\nexport * from './MaintenanceTaskByIdsFilter'\nexport * from './MaintenanceTaskAfterDateFilter'\nexport * from './TopicByHcPartyFilter'\nexport * from './TopicByParticipantFilter'\nexport * from './MessageByHcPartyFilter'\nexport * from './MessageByHcPartyTransportGuidFilter'\nexport * from './LatestMessageByHcPartyTransportGuidFilter'\n\nexport class Filter {\n public static patient(): PatientFilterBuilder {\n return new PatientFilterBuilder()\n }\n}\n\nexport type AbstractFilter<T> =\n | (T extends Patient\n ? AbstractFilterPatient\n : T extends Contact\n ? AbstractFilterContact\n : T extends Service\n ? AbstractFilterService\n : T extends HealthcareParty\n ? AbstractFilterHealthcareParty\n : T extends Device\n ? AbstractFilterDevice\n : T extends MaintenanceTask\n ? AbstractFilterMaintenanceTask\n : T extends Code\n ? AbstractFilterCode\n : T extends HealthElement\n ? AbstractFilterHealthElement\n : T extends Invoice\n ? AbstractFilterInvoice\n : T extends User\n ? AbstractFilterUser\n : never)\n | ConstantFilter<T>\n | IntersectionFilter<T>\n | UnionFilter<T>\n | ComplementFilter<T>\n\nconst f: AbstractFilterContact = new ComplementFilter<Contact>(new ContactByHcPartyFilter({}), new ContactByHcPartyFilter({}))\n\nabstract class FilterBuilder<T> {\n // This is the current generator for the filter, when we call build(), filterProvider() is going to be called\n filterProvider?: () => AbstractFilter<T>\n // This is the method that is called each time we chain a filter to another filter. The default behaviour is to\n // return a FilterBuilder with the provider set to the last element in the chain, except when we use combination\n // operators like or()/and()/… . After one of those, the composer is set to a function that will return a FilterBuilder\n\n protected constructor(\n filterProvider?: () => AbstractFilter<T>,\n composer?: (thisFilterBuilder: FilterBuilder<T>, otherFilterBuilder: FilterBuilder<T>) => FilterBuilder<T>\n ) {\n this.filterProvider = filterProvider\n composer && (this.composer = composer)\n }\n\n // that combines the existing filterBuilder with the filter definition we just added.\n composer: (thisFilterBuilder: FilterBuilder<T>, otherFilterBuilder: FilterBuilder<T>) => FilterBuilder<T> = (\n thisFilterBuilder: FilterBuilder<T>,\n otherFilterBuilder: FilterBuilder<T>\n ) => otherFilterBuilder\n\n abstract build(): AbstractFilter<T>\n\n abstract clone(\n filterProvider?: () => AbstractFilter<T>,\n composer?: (thisFilterBuilder: FilterBuilder<T>, otherFilterBuilder: FilterBuilder<T>) => FilterBuilder<T>\n ): FilterBuilder<T>\n\n listOf(elements: T[]): FilterBuilder<T> {\n return this.clone(() => new ConstantFilter<T>(elements) as AbstractFilter<T>)\n }\n\n /**\n * There are two ways of doing and, or, …\n *\n * 1) for (...) or (...) we use the syntax ... .or((builder) => builder...)\n * ex: youngerThan(65).or((b) => b.olderThan(18).and().gender(M)) means any gender < 65 or male > 18\n * 2) for ((...) or ...) we use the syntax ... .or().…\n * ex: youngerThan(65).or().olderThan(18).and().gender(M) means males between 18 and 65\n *\n * When 1) is used we do not have to wait for anything to provide a resolved builder that can later be combined with extra elements in the chain.\n * In other words, we can build the current filter chain up to the or/and/… and we can build what is inside the or/and/… brackets and we can set\n * the filterProvider of the returned Builder to () => UnionFilter([leftHand.build(), innerBrackets.build()]).\n *\n * When 2) is used, things get more tricky because we will have to do an or/and/… between what we have on the leftHand and with what we do not have\n * yet on the right hand. What we do in that situation is to set the filterProvider() to undefined because calling build() without having provided a\n * rightHand doesn't make sense. We set a composer that is going to be called the next time we chain a filter.\n *\n * @param filterBuilderFactory\n */\n\n and(filterBuilderFactory?: (it: FilterBuilder<T>) => FilterBuilder<T>): FilterBuilder<T> {\n const combiner = (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () =>\n new IntersectionFilter<T>([leftHandFilter, rightHandFilter]) as AbstractFilter<T>\n\n return filterBuilderFactory ? this.makeEagerLeftRightFilterBuilder(filterBuilderFactory, combiner) : this.makeLazyLeftRightFilterBuilder(combiner)\n }\n\n or(filterBuilderFactory?: (it: FilterBuilder<T>) => FilterBuilder<T>): FilterBuilder<T> {\n const combiner = (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () =>\n new UnionFilter<T>([leftHandFilter, rightHandFilter]) as AbstractFilter<T>\n\n return filterBuilderFactory ? this.makeEagerLeftRightFilterBuilder(filterBuilderFactory, combiner) : this.makeLazyLeftRightFilterBuilder(combiner)\n }\n\n minus(filterBuilderFactory?: (it: FilterBuilder<T>) => FilterBuilder<T>): FilterBuilder<T> {\n const combiner = (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () =>\n new ComplementFilter<T>(leftHandFilter, rightHandFilter) as AbstractFilter<T>\n\n return filterBuilderFactory ? this.makeEagerLeftRightFilterBuilder(filterBuilderFactory, combiner) : this.makeLazyLeftRightFilterBuilder(combiner)\n }\n\n private makeLazyLeftRightFilterBuilder(\n leftHandRightHandFiltersCombiner: (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () => AbstractFilter<T>\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const leftHandFilterBuilder: FilterBuilder<T> = this\n const leftHandFilter = leftHandFilterBuilder.build() // Freeze the leftHand filter\n\n return leftHandFilterBuilder.filterProvider\n ? this.clone(\n undefined, //filter provider is indeterminate until we have performed a composition\n (unused: FilterBuilder<T>, rightHandFilterBuilder: FilterBuilder<T>) => {\n // because we freeze the leftHand in the state it is right now, we are not going to use its value when the composition occurs\n const rightHandFilter = rightHandFilterBuilder.build()\n\n return rightHandFilter\n ? this.clone(leftHandRightHandFiltersCombiner(leftHandFilter, rightHandFilter), rightHandFilterBuilder.composer)\n : rightHandFilterBuilder //Can this happen ?\n }\n )\n : this\n }\n\n private makeEagerLeftRightFilterBuilder(\n rightHandFilterBuilderFactory: (it: FilterBuilder<T>) => FilterBuilder<T>,\n leftHandRightHandFiltersCombiner: (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () => AbstractFilter<T>\n ) {\n const rightHandFilterBuilder = rightHandFilterBuilderFactory(this)\n return this.filterProvider ? this.clone(leftHandRightHandFiltersCombiner(this.build(), rightHandFilterBuilder.build())) : this\n }\n}\n\nclass PatientFilterBuilder extends FilterBuilder<Patient> {\n hcpId?: string\n\n constructor(\n filterProvider?: () => AbstractFilter<Patient>,\n hcpId?: string,\n composer?: (thisFilterBuilder: FilterBuilder<Patient>, otherFilterBuilder: FilterBuilder<Patient>) => FilterBuilder<Patient>\n ) {\n super(filterProvider, composer)\n this.hcpId = hcpId\n }\n\n clone(\n filterProvider?: () => AbstractFilter<Patient>,\n composer?: (thisFilterBuilder: FilterBuilder<Patient>, otherFilterBuilder: FilterBuilder<Patient>) => FilterBuilder<Patient>\n ): FilterBuilder<Patient> {\n return new PatientFilterBuilder(filterProvider, this.hcpId, composer)\n }\n\n listOf(elements: Patient[]): PatientFilterBuilder {\n return new PatientFilterBuilder(() => new ConstantFilter<Patient>(elements) as AbstractFilter<Patient>)\n }\n\n and(filterBuilderFactory?: (it: PatientFilterBuilder) => PatientFilterBuilder): PatientFilterBuilder {\n return super.and(filterBuilderFactory as any) as PatientFilterBuilder\n }\n\n or(filterBuilderFactory?: (it: PatientFilterBuilder) => PatientFilterBuilder): PatientFilterBuilder {\n return super.or(filterBuilderFactory as any) as PatientFilterBuilder\n }\n\n minus(filterBuilderFactory?: (it: PatientFilterBuilder) => PatientFilterBuilder): PatientFilterBuilder {\n return super.minus(filterBuilderFactory as any) as PatientFilterBuilder\n }\n\n forHcp(hcpId: string): PatientFilterBuilder {\n return this.composer(this, new PatientFilterBuilder(this.filterProvider, hcpId)) as PatientFilterBuilder\n }\n\n all(): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyFilter({ healthcarePartyId: this.hcpId }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n activePatients(): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyAndActiveFilter({ healthcarePartyId: this.hcpId, active: true }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n inactivePatients(): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyAndActiveFilter({ healthcarePartyId: this.hcpId, active: false }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n byAddress(searchString?: string, postalCode?: string, houseNumber?: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyAndAddressFilter({\n healthcarePartyId: this.hcpId,\n searchString,\n postalCode,\n houseNumber,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n withExternalId(externalId: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyAndExternalIdFilter({\n healthcarePartyId: this.hcpId,\n externalId: externalId,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n withSsins(ssins: string[]): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyAndSsinsFilter({ healthcarePartyId: this.hcpId, ssins: ssins }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n withDateOfBirthBetween(from?: number, to?: number): PatientFilterBuilder {\n return this.composer(\n this,\n this.clone(\n () =>\n new PatientByHcPartyDateOfBirthBetweenFilter({\n healthcarePartyId: this.hcpId,\n minDateOfBirth: from,\n maxDateOfBirth: to,\n })\n )\n ) as PatientFilterBuilder\n }\n\n byDateOfBirth(dateOfBirth: number): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyDateOfBirthFilter({\n healthcarePartyId: this.hcpId,\n dateOfBirth: dateOfBirth,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n olderThan(age: number): PatientFilterBuilder {\n return this.withDateOfBirthBetween(10000101, parseInt(format(add(new Date(), { years: -age }), 'yyyyMMdd')))\n }\n\n youngerThan(age: number): PatientFilterBuilder {\n return this.withDateOfBirthBetween(parseInt(format(add(new Date(), { years: -age }), 'yyyyMMdd')), 99991231)\n }\n\n byGenderEducationProfession(gender?: GenderEnum, education?: string, profession?: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyGenderEducationProfessionFilter({\n healthcarePartyId: this.hcpId,\n gender: gender,\n education: education,\n profession: profession,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n byIds(ids: string[]): PatientFilterBuilder {\n return this.composer(this, new PatientFilterBuilder(() => new PatientByIdsFilter({ ids: ids }), this.hcpId)) as PatientFilterBuilder\n }\n\n searchByName(name: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyNameContainsFuzzyFilter({\n healthcarePartyId: this.hcpId,\n searchString: name,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n build(): AbstractFilter<Patient> {\n return this.filterProvider?.() || this.all().build()\n }\n}\n"]}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../icc-x-api/filters/filters.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AAoB,CACtB,GAAG,EAAE,CACH,IAAI,iGAA+C,CAAC;YAClD,iBAAiB,EAAE,IAAI,CAAC,KAAK;YAC7B,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,SAAS;YACpB,UAAU,EAAE,UAAU;SACvB,CAAC,EACJ,IAAI,CAAC,KAAK,CACX,CACsB,CAAA;IAC3B,CAAC;IAED,KAAK,CAAC,GAAa;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,oBAAoB,CAAC,GAAG,EAAE,CAAC,IAAI,uCAAkB,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAyB,CAAA;IACtI,CAAC;IAED,YAAY,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,QAAQ,CAClB,IAAI,EACJ,IAAI,oBAAoB,CACtB,GAAG,EAAE,CACH,IAAI,iFAAuC,CAAC;YAC1C,iBAAiB,EAAE,IAAI,CAAC,KAAK;YAC7B,YAAY,EAAE,IAAI;SACnB,CAAC,EACJ,IAAI,CAAC,KAAK,CACX,CACsB,CAAA;IAC3B,CAAC;IAED,KAAK;;QACH,OAAO,CAAA,MAAA,IAAI,CAAC,cAAc,oDAAI,KAAI,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAA;IACtD,CAAC;CACF","sourcesContent":["import { ConstantFilter } from './ConstantFilter'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { AbstractFilterPatient } from '../../icc-api/model/AbstractFilterPatient'\nimport { AbstractFilterContact } from '../../icc-api/model/AbstractFilterContact'\nimport { AbstractFilterService } from '../../icc-api/model/AbstractFilterService'\nimport { Service } from '../../icc-api/model/Service'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { IntersectionFilter } from './IntersectionFilter'\nimport { UnionFilter } from './UnionFilter'\nimport { ComplementFilter } from './ComplementFilter'\nimport { PatientByHcPartyAndActiveFilter } from './PatientByHcPartyAndActiveFilter'\nimport { PatientByHcPartyAndAddressFilter } from './PatientByHcPartyAndAddressFilter'\nimport { PatientByHcPartyAndExternalIdFilter } from './PatientByHcPartyAndExternalIdFilter'\nimport { PatientByHcPartyAndSsinsFilter } from './PatientByHcPartyAndSsinsFilter'\nimport { PatientByHcPartyDateOfBirthBetweenFilter } from './PatientByHcPartyDateOfBirthBetweenFilter'\nimport { PatientByHcPartyDateOfBirthFilter } from './PatientByHcPartyDateOfBirthFilter'\n\nimport { add, format } from 'date-fns'\nimport { PatientByHcPartyFilter } from './PatientByHcPartyFilter'\nimport { PatientByHcPartyGenderEducationProfessionFilter } from './PatientByHcPartyGenderEducationProfessionFilter'\nimport { PatientByIdsFilter } from './PatientByIdsFilter'\nimport { PatientByHcPartyNameContainsFuzzyFilter } from './PatientByHcPartyNameContainsFuzzyFilter'\n\nimport GenderEnum = Patient.GenderEnum\nimport { ContactByHcPartyFilter } from './ContactByHcPartyFilter'\nimport { Device } from '../../icc-api/model/Device'\nimport { AbstractFilterDevice } from '../../icc-api/model/AbstractFilterDevice'\nimport { MaintenanceTask } from '../../icc-api/model/MaintenanceTask'\nimport { AbstractFilterMaintenanceTask } from '../../icc-api/model/AbstractFilterMaintenanceTask'\nimport { Code } from '../../icc-api/model/Code'\nimport { AbstractFilterCode } from '../../icc-api/model/AbstractFilterCode'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { AbstractFilterHealthElement } from '../../icc-api/model/AbstractFilterHealthElement'\nimport { Invoice } from '../../icc-api/model/Invoice'\nimport { AbstractFilterInvoice } from '../../icc-api/model/AbstractFilterInvoice'\nimport { User } from '../../icc-api/model/User'\nimport { AbstractFilterUser } from '../../icc-api/model/AbstractFilterUser'\nimport { HealthcareParty } from '../../icc-api/model/HealthcareParty'\nimport { AbstractFilterHealthcareParty } from '../../icc-api/model/AbstractFilterHealthcareParty'\n\nexport * from './AllCodesFilter'\nexport * from './AllDevicesFilter'\nexport * from './AllDocumentsFilter'\nexport * from './AllHealthcarePartiesFilter'\nexport * from './AllUsersFilter'\nexport * from './CodeByIdsFilter'\nexport * from './CodeByRegionTypeLabelLanguageFilter'\nexport * from './ComplementFilter'\nexport * from './ConstantFilter'\nexport * from './ContactByHcPartyFilter'\nexport * from './ContactByHcPartyPatientTagCodeDateFilter'\nexport * from './ContactByHcPartyTagCodeDateFilter'\nexport * from './ContactByServiceIdsFilter'\nexport * from './DeviceByHcPartyFilter'\nexport * from './DeviceByIdsFilter'\nexport * from './HealthElementByHcPartyFilter'\nexport * from './HealthElementByHcPartyIdentifiersFilter'\nexport * from './HealthElementByHcPartySecretForeignKeysFilter'\nexport * from './HealthElementByHcPartyTagCodeFilter'\nexport * from './HealthElementByIdsFilter'\nexport * from './HealthcarePartyByIdsFilter'\nexport * from './HealthcarePartyByNameFilter'\nexport * from './HealthcarePartyByTagCodeFilter'\nexport * from './HealthcarePartyByIdentifiersFilter'\nexport * from './HealthcarePartyByIdsFilter'\nexport * from './IntersectionFilter'\nexport * from './InvoiceByHcPartyCodeDateFilter'\nexport * from './PatientByHcPartyAndActiveFilter'\nexport * from './PatientByHcPartyAndAddressFilter'\nexport * from './PatientByHcPartyAndExternalIdFilter'\nexport * from './PatientByHcPartyAndIdentifiersFilter'\nexport * from './PatientByHcPartyAndSsinFilter'\nexport * from './PatientByHcPartyAndSsinsFilter'\nexport * from './PatientByHcPartyDateOfBirthBetweenFilter'\nexport * from './PatientByHcPartyDateOfBirthFilter'\nexport * from './PatientByHcPartyFilter'\nexport * from './PatientByHcPartyGenderEducationProfessionFilter'\nexport * from './PatientByHcPartyNameContainsFuzzyFilter'\nexport * from './PatientByHcPartyNameFilter'\nexport * from './PatientByIdsFilter'\nexport * from './ServiceByContactsAndSubcontactsFilter'\nexport * from './ServiceByHcPartyFilter'\nexport * from './ServiceByHcPartyIdentifiersFilter'\nexport * from './ServiceByHcPartyHealthElementIdsFilter'\nexport * from './ServiceByHcPartyTagCodeDateFilter'\nexport * from './ServiceByIdsFilter'\nexport * from './ServiceBySecretForeignKeys'\nexport * from './UnionFilter'\nexport * from './UserByIdsFilter'\nexport * from './MaintenanceTaskByHcPartyAndIdentifiersFilter'\nexport * from './MaintenanceTaskByHcPartyAndTypeFilter'\nexport * from './MaintenanceTaskByIdsFilter'\nexport * from './MaintenanceTaskAfterDateFilter'\nexport * from './TopicByHcPartyFilter'\nexport * from './TopicByParticipantFilter'\nexport * from './MessageByHcPartyFilter'\nexport * from './MessageByHcPartyTransportGuidFilter'\nexport * from './LatestMessageByHcPartyTransportGuidFilter'\n\nexport class Filter {\n public static patient(): PatientFilterBuilder {\n return new PatientFilterBuilder()\n }\n}\n\nexport type AbstractFilter<T> =\n | (T extends Patient\n ? AbstractFilterPatient\n : T extends Contact\n ? AbstractFilterContact\n : T extends Service\n ? AbstractFilterService\n : T extends HealthcareParty\n ? AbstractFilterHealthcareParty\n : T extends Device\n ? AbstractFilterDevice\n : T extends MaintenanceTask\n ? AbstractFilterMaintenanceTask\n : T extends Code\n ? AbstractFilterCode\n : T extends HealthElement\n ? AbstractFilterHealthElement\n : T extends Invoice\n ? AbstractFilterInvoice\n : T extends User\n ? AbstractFilterUser\n : never)\n | ConstantFilter<T>\n | IntersectionFilter<T>\n | UnionFilter<T>\n | ComplementFilter<T>\n\nconst f: AbstractFilterContact = new ComplementFilter<Contact>(new ContactByHcPartyFilter({}), new ContactByHcPartyFilter({}))\n\nabstract class FilterBuilder<T> {\n // This is the current generator for the filter, when we call build(), filterProvider() is going to be called\n filterProvider?: () => AbstractFilter<T>\n // This is the method that is called each time we chain a filter to another filter. The default behaviour is to\n // return a FilterBuilder with the provider set to the last element in the chain, except when we use combination\n // operators like or()/and()/… . After one of those, the composer is set to a function that will return a FilterBuilder\n\n protected constructor(\n filterProvider?: () => AbstractFilter<T>,\n composer?: (thisFilterBuilder: FilterBuilder<T>, otherFilterBuilder: FilterBuilder<T>) => FilterBuilder<T>\n ) {\n this.filterProvider = filterProvider\n composer && (this.composer = composer)\n }\n\n // that combines the existing filterBuilder with the filter definition we just added.\n composer: (thisFilterBuilder: FilterBuilder<T>, otherFilterBuilder: FilterBuilder<T>) => FilterBuilder<T> = (\n thisFilterBuilder: FilterBuilder<T>,\n otherFilterBuilder: FilterBuilder<T>\n ) => otherFilterBuilder\n\n abstract build(): AbstractFilter<T>\n\n abstract clone(\n filterProvider?: () => AbstractFilter<T>,\n composer?: (thisFilterBuilder: FilterBuilder<T>, otherFilterBuilder: FilterBuilder<T>) => FilterBuilder<T>\n ): FilterBuilder<T>\n\n listOf(elements: T[]): FilterBuilder<T> {\n return this.clone(() => new ConstantFilter<T>(elements) as AbstractFilter<T>)\n }\n\n /**\n * There are two ways of doing and, or, …\n *\n * 1) for (...) or (...) we use the syntax ... .or((builder) => builder...)\n * ex: youngerThan(65).or((b) => b.olderThan(18).and().gender(M)) means any gender < 65 or male > 18\n * 2) for ((...) or ...) we use the syntax ... .or().…\n * ex: youngerThan(65).or().olderThan(18).and().gender(M) means males between 18 and 65\n *\n * When 1) is used we do not have to wait for anything to provide a resolved builder that can later be combined with extra elements in the chain.\n * In other words, we can build the current filter chain up to the or/and/… and we can build what is inside the or/and/… brackets and we can set\n * the filterProvider of the returned Builder to () => UnionFilter([leftHand.build(), innerBrackets.build()]).\n *\n * When 2) is used, things get more tricky because we will have to do an or/and/… between what we have on the leftHand and with what we do not have\n * yet on the right hand. What we do in that situation is to set the filterProvider() to undefined because calling build() without having provided a\n * rightHand doesn't make sense. We set a composer that is going to be called the next time we chain a filter.\n *\n * @param filterBuilderFactory\n */\n\n and(filterBuilderFactory?: (it: FilterBuilder<T>) => FilterBuilder<T>): FilterBuilder<T> {\n const combiner = (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () =>\n new IntersectionFilter<T>([leftHandFilter, rightHandFilter]) as AbstractFilter<T>\n\n return filterBuilderFactory ? this.makeEagerLeftRightFilterBuilder(filterBuilderFactory, combiner) : this.makeLazyLeftRightFilterBuilder(combiner)\n }\n\n or(filterBuilderFactory?: (it: FilterBuilder<T>) => FilterBuilder<T>): FilterBuilder<T> {\n const combiner = (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () =>\n new UnionFilter<T>([leftHandFilter, rightHandFilter]) as AbstractFilter<T>\n\n return filterBuilderFactory ? this.makeEagerLeftRightFilterBuilder(filterBuilderFactory, combiner) : this.makeLazyLeftRightFilterBuilder(combiner)\n }\n\n minus(filterBuilderFactory?: (it: FilterBuilder<T>) => FilterBuilder<T>): FilterBuilder<T> {\n const combiner = (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () =>\n new ComplementFilter<T>(leftHandFilter, rightHandFilter) as AbstractFilter<T>\n\n return filterBuilderFactory ? this.makeEagerLeftRightFilterBuilder(filterBuilderFactory, combiner) : this.makeLazyLeftRightFilterBuilder(combiner)\n }\n\n private makeLazyLeftRightFilterBuilder(\n leftHandRightHandFiltersCombiner: (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () => AbstractFilter<T>\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const leftHandFilterBuilder: FilterBuilder<T> = this\n const leftHandFilter = leftHandFilterBuilder.build() // Freeze the leftHand filter\n\n return leftHandFilterBuilder.filterProvider\n ? this.clone(\n undefined, //filter provider is indeterminate until we have performed a composition\n (unused: FilterBuilder<T>, rightHandFilterBuilder: FilterBuilder<T>) => {\n // because we freeze the leftHand in the state it is right now, we are not going to use its value when the composition occurs\n const rightHandFilter = rightHandFilterBuilder.build()\n\n return rightHandFilter\n ? this.clone(leftHandRightHandFiltersCombiner(leftHandFilter, rightHandFilter), rightHandFilterBuilder.composer)\n : rightHandFilterBuilder //Can this happen ?\n }\n )\n : this\n }\n\n private makeEagerLeftRightFilterBuilder(\n rightHandFilterBuilderFactory: (it: FilterBuilder<T>) => FilterBuilder<T>,\n leftHandRightHandFiltersCombiner: (leftHandFilter: AbstractFilter<T>, rightHandFilter: AbstractFilter<T>) => () => AbstractFilter<T>\n ) {\n const rightHandFilterBuilder = rightHandFilterBuilderFactory(this)\n return this.filterProvider ? this.clone(leftHandRightHandFiltersCombiner(this.build(), rightHandFilterBuilder.build())) : this\n }\n}\n\nclass PatientFilterBuilder extends FilterBuilder<Patient> {\n hcpId?: string\n\n constructor(\n filterProvider?: () => AbstractFilter<Patient>,\n hcpId?: string,\n composer?: (thisFilterBuilder: FilterBuilder<Patient>, otherFilterBuilder: FilterBuilder<Patient>) => FilterBuilder<Patient>\n ) {\n super(filterProvider, composer)\n this.hcpId = hcpId\n }\n\n clone(\n filterProvider?: () => AbstractFilter<Patient>,\n composer?: (thisFilterBuilder: FilterBuilder<Patient>, otherFilterBuilder: FilterBuilder<Patient>) => FilterBuilder<Patient>\n ): FilterBuilder<Patient> {\n return new PatientFilterBuilder(filterProvider, this.hcpId, composer)\n }\n\n listOf(elements: Patient[]): PatientFilterBuilder {\n return new PatientFilterBuilder(() => new ConstantFilter<Patient>(elements) as AbstractFilter<Patient>)\n }\n\n and(filterBuilderFactory?: (it: PatientFilterBuilder) => PatientFilterBuilder): PatientFilterBuilder {\n return super.and(filterBuilderFactory as any) as PatientFilterBuilder\n }\n\n or(filterBuilderFactory?: (it: PatientFilterBuilder) => PatientFilterBuilder): PatientFilterBuilder {\n return super.or(filterBuilderFactory as any) as PatientFilterBuilder\n }\n\n minus(filterBuilderFactory?: (it: PatientFilterBuilder) => PatientFilterBuilder): PatientFilterBuilder {\n return super.minus(filterBuilderFactory as any) as PatientFilterBuilder\n }\n\n forHcp(hcpId: string): PatientFilterBuilder {\n return this.composer(this, new PatientFilterBuilder(this.filterProvider, hcpId)) as PatientFilterBuilder\n }\n\n all(): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyFilter({ healthcarePartyId: this.hcpId }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n activePatients(): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyAndActiveFilter({ healthcarePartyId: this.hcpId, active: true }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n inactivePatients(): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyAndActiveFilter({ healthcarePartyId: this.hcpId, active: false }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n byAddress(searchString?: string, postalCode?: string, houseNumber?: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyAndAddressFilter({\n healthcarePartyId: this.hcpId,\n searchString,\n postalCode,\n houseNumber,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n withExternalId(externalId: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyAndExternalIdFilter({\n healthcarePartyId: this.hcpId,\n externalId: externalId,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n withSsins(ssins: string[]): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(() => new PatientByHcPartyAndSsinsFilter({ healthcarePartyId: this.hcpId, ssins: ssins }), this.hcpId)\n ) as PatientFilterBuilder\n }\n\n withDateOfBirthBetween(from?: number, to?: number): PatientFilterBuilder {\n return this.composer(\n this,\n this.clone(\n () =>\n new PatientByHcPartyDateOfBirthBetweenFilter({\n healthcarePartyId: this.hcpId,\n minDateOfBirth: from,\n maxDateOfBirth: to,\n })\n )\n ) as PatientFilterBuilder\n }\n\n byDateOfBirth(dateOfBirth: number): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyDateOfBirthFilter({\n healthcarePartyId: this.hcpId,\n dateOfBirth: dateOfBirth,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n olderThan(age: number): PatientFilterBuilder {\n return this.withDateOfBirthBetween(10000101, parseInt(format(add(new Date(), { years: -age }), 'yyyyMMdd')))\n }\n\n youngerThan(age: number): PatientFilterBuilder {\n return this.withDateOfBirthBetween(parseInt(format(add(new Date(), { years: -age }), 'yyyyMMdd')), 99991231)\n }\n\n byGenderEducationProfession(gender?: GenderEnum, education?: string, profession?: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyGenderEducationProfessionFilter({\n healthcarePartyId: this.hcpId,\n gender: gender,\n education: education,\n profession: profession,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n byIds(ids: string[]): PatientFilterBuilder {\n return this.composer(this, new PatientFilterBuilder(() => new PatientByIdsFilter({ ids: ids }), this.hcpId)) as PatientFilterBuilder\n }\n\n searchByName(name: string): PatientFilterBuilder {\n return this.composer(\n this,\n new PatientFilterBuilder(\n () =>\n new PatientByHcPartyNameContainsFuzzyFilter({\n healthcarePartyId: this.hcpId,\n searchString: name,\n }),\n this.hcpId\n )\n ) as PatientFilterBuilder\n }\n\n build(): AbstractFilter<Patient> {\n return this.filterProvider?.() || this.all().build()\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/api",
3
- "version": "8.5.3",
3
+ "version": "8.5.5",
4
4
  "description": "Typescript version of iCure standalone API client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",