@icure/api 8.0.15 → 8.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/model/Content.js +4 -0
- package/icc-api/model/Content.js.map +1 -1
- package/icc-api/model/Measure.d.ts +2 -2
- package/icc-api/model/Measure.js +2 -2
- package/icc-api/model/Measure.js.map +1 -1
- package/icc-api/model/Service.js.map +1 -1
- package/package.json +1 -1
- package/test/icc-x-api/icc-contact-x-api.js +16 -16
- package/test/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/test/support/CSM-87.d.ts +0 -1
- package/test/support/CSM-87.js +2 -30
- package/test/support/CSM-87.js.map +1 -1
package/icc-api/model/Content.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.Content = void 0;
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
const Measure_1 = require("./Measure");
|
|
16
|
+
const Service_1 = require("./Service");
|
|
16
17
|
/**
|
|
17
18
|
* Information contained in the service. Content is localized, using ISO language code as key
|
|
18
19
|
*/
|
|
@@ -23,6 +24,9 @@ class Content {
|
|
|
23
24
|
if (!!(json === null || json === void 0 ? void 0 : json.measureValue)) {
|
|
24
25
|
this.measureValue = new Measure_1.Measure(json.measureValue);
|
|
25
26
|
}
|
|
27
|
+
if (!!(json === null || json === void 0 ? void 0 : json.compoundValue)) {
|
|
28
|
+
this.compoundValue = json.compoundValue.map((service) => new Service_1.Service(service));
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
32
|
exports.Content = Content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../icc-api/model/Content.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,uCAAmC;
|
|
1
|
+
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../icc-api/model/Content.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,uCAAmC;AAEnC,uCAAmC;AAGnC;;GAEG;AACH,+CAAuC;AACvC,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,EACJ,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAA,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAC7E,CAAA;QAED,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAA,EAAE;YACxB,IAAI,CAAC,YAAY,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;SACnD;QAED,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,CAAA,EAAE;YACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,OAAmB,EAAE,EAAE,CAAC,IAAI,iBAAO,CAAC,OAAO,CAAC,CAAC,CAAA;SAC3F;IACH,CAAC;CAqBF;AApCD,0BAoCC","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 { Measure } from './Measure'\nimport { Medication } from './Medication'\nimport { Service } from './Service'\nimport { TimeSeries } from './TimeSeries'\n\n/**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\nimport { b64_2ab } from './ModelHelper'\nexport class Content {\n constructor(json: JSON | any) {\n Object.assign(\n this as Content,\n json,\n !!json?.binaryValue ? { binaryValue: b64_2ab(json.binaryValue) } : undefined,\n )\n\n if (!!json?.measureValue) {\n this.measureValue = new Measure(json.measureValue)\n }\n\n if (!!json?.compoundValue) {\n this.compoundValue = json.compoundValue.map((service: JSON | any) => new Service(service))\n }\n }\n\n stringValue?: string\n numberValue?: number\n booleanValue?: boolean\n instantValue?: number\n /**\n * Value as date. The format could have a all three (day, month and year) or values on any of these three, whatever is known.\n */\n fuzzyDateValue?: number\n binaryValue?: ArrayBuffer\n /**\n * Linked document.\n */\n documentId?: string\n measureValue?: Measure\n medicationValue?: Medication\n timeSeries?: TimeSeries\n compoundValue?: Array<Service>\n ratio?: Array<Measure>\n range?: Array<Measure>\n}\n"]}
|
|
@@ -13,7 +13,7 @@ import { CodeStub } from './CodeStub';
|
|
|
13
13
|
import { ReferenceRange } from "./ReferenceRange";
|
|
14
14
|
export declare class Measure {
|
|
15
15
|
/**
|
|
16
|
-
* We delete min and max from the json and create a
|
|
16
|
+
* We delete min and max from the json and create a referenceRanges from it
|
|
17
17
|
* Since this is a shallow copy, deletion of min and max will have no effect on the original json since it's the top level fields
|
|
18
18
|
*
|
|
19
19
|
* @param json
|
|
@@ -32,5 +32,5 @@ export declare class Measure {
|
|
|
32
32
|
/**
|
|
33
33
|
* Reference range for the measure
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
referenceRanges?: Array<ReferenceRange>;
|
|
36
36
|
}
|
package/icc-api/model/Measure.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.Measure = void 0;
|
|
|
4
4
|
const ReferenceRange_1 = require("./ReferenceRange");
|
|
5
5
|
class Measure {
|
|
6
6
|
/**
|
|
7
|
-
* We delete min and max from the json and create a
|
|
7
|
+
* We delete min and max from the json and create a referenceRanges from it
|
|
8
8
|
* Since this is a shallow copy, deletion of min and max will have no effect on the original json since it's the top level fields
|
|
9
9
|
*
|
|
10
10
|
* @param json
|
|
@@ -12,7 +12,7 @@ class Measure {
|
|
|
12
12
|
constructor(json) {
|
|
13
13
|
const measureValue = Object.assign({}, json);
|
|
14
14
|
if (!!(measureValue === null || measureValue === void 0 ? void 0 : measureValue.min) || !!(measureValue === null || measureValue === void 0 ? void 0 : measureValue.max)) {
|
|
15
|
-
measureValue.
|
|
15
|
+
measureValue.referenceRanges = [
|
|
16
16
|
new ReferenceRange_1.ReferenceRange({
|
|
17
17
|
low: measureValue.min,
|
|
18
18
|
high: measureValue.max
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Measure.js","sourceRoot":"","sources":["../../../icc-api/model/Measure.ts"],"names":[],"mappings":";;;AAYA,qDAA+C;AAE/C,MAAa,OAAO;IAClB;;;;;OAKG;IACH,YAAY,IAAgB;QAC1B,MAAM,YAAY,qBAAO,IAAI,CAAC,CAAA;QAE9B,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,EAAE;YAC9C,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"Measure.js","sourceRoot":"","sources":["../../../icc-api/model/Measure.ts"],"names":[],"mappings":";;;AAYA,qDAA+C;AAE/C,MAAa,OAAO;IAClB;;;;;OAKG;IACH,YAAY,IAAgB;QAC1B,MAAM,YAAY,qBAAO,IAAI,CAAC,CAAA;QAE9B,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,EAAE;YAC9C,YAAY,CAAC,eAAe,GAAG;gBAC7B,IAAI,+BAAc,CAAC;oBACjB,GAAG,EAAE,YAAY,CAAC,GAAG;oBACrB,IAAI,EAAE,YAAY,CAAC,GAAG;iBACvB,CAAC;aACH,CAAA;YACM,YAAY,aAAZ,YAAY,4BAAZ,YAAY,CAAE,GAAG,CAAA;YACjB,YAAY,aAAZ,YAAY,4BAAZ,YAAY,CAAE,GAAG,CAAA;SACzB;QAED,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,YAAY,CAAC,CAAA;IAC9C,CAAC;CAgBF;AAtCD,0BAsCC","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 { CodeStub } from './CodeStub'\nimport {ReferenceRange} from \"./ReferenceRange\"\n\nexport class Measure {\n /**\n * We delete min and max from the json and create a referenceRanges from it\n * Since this is a shallow copy, deletion of min and max will have no effect on the original json since it's the top level fields\n *\n * @param json\n */\n constructor(json: JSON | any) {\n const measureValue = {...json}\n\n if (!!measureValue?.min || !!measureValue?.max) {\n measureValue.referenceRanges = [\n new ReferenceRange({\n low: measureValue.min,\n high: measureValue.max\n })\n ]\n delete measureValue?.min\n delete measureValue?.max\n }\n\n Object.assign(this as Measure, measureValue)\n }\n\n value?: number\n ref?: number\n severity?: number\n severityCode?: string\n evolution?: number\n unit?: string\n sign?: string\n unitCodes?: Array<CodeStub>\n comment?: string\n comparator?: string\n /**\n * Reference range for the measure\n */\n referenceRanges?: Array<ReferenceRange>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../icc-api/model/Service.ts"],"names":[],"mappings":";;;AAaA,uCAAmC;
|
|
1
|
+
{"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../icc-api/model/Service.ts"],"names":[],"mappings":";;;AAaA,uCAAmC;AAKnC;;GAEG;AACH,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,CACL,CAAA;QAED,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE;YAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,iBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAC9E,CAAA;SACF;IACH,CAAC;CAoIF;AAhJD,0BAgJC","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 { Annotation } from './Annotation'\nimport { CodeStub } from './CodeStub'\nimport { Content } from './Content'\nimport { Delegation } from './Delegation'\nimport { Identifier } from './Identifier'\nimport { SecurityMetadata } from './SecurityMetadata'\n\n/**\n * This entity represents a Service. A Service is created in the course a contact. Services include subjective information provided by the patient, such as complaints, reason for visit, feelings, etc. or objective information like bio-metric measures (blood pressure, temperature, heart beat, etc.), or physical exam description, diagnosis, prescription, integration of lab reports from another healthcare party, action plan, etc. Any action performed by the healthcare party which is relevant for the healthcare element of a patient is considered a service. The services can be linked to healthcare elements or other structuring elements of the medical record\n */\nexport class Service {\n constructor(json: JSON | any) {\n Object.assign(\n this as Service,\n json\n )\n\n if (!!this.content) {\n this.content = Object.fromEntries(\n Object.entries(this.content).map(([key, value]) => [key, new Content(value)])\n )\n }\n }\n\n /**\n * The Id of the Service. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * The transactionId is used when a single service had to be split into parts for technical reasons. Several services with the same non null transaction id form one single service\n */\n transactionId?: string\n identifier?: Array<Identifier>\n /**\n * Id of the contact during which the service is provided\n */\n contactId?: string\n /**\n * List of IDs of all sub-contacts that link the service to structural elements. Only used when the Service is emitted outside of its contact\n */\n subContactIds?: Array<string>\n /**\n * List of IDs of all plans of actions (healthcare approaches) as a part of which the Service is provided. Only used when the Service is emitted outside of its contact\n */\n plansOfActionIds?: Array<string>\n /**\n * List of IDs of all healthcare elements for which the service is provided. Only used when the Service is emitted outside of its contact\n */\n healthElementsIds?: Array<string>\n /**\n * List of Ids of all forms linked to the Service. Only used when the Service is emitted outside of its contact.\n */\n formIds?: Array<string>\n /**\n * The secret patient key, encrypted in the patient document, in clear here.\n */\n secretForeignKeys?: Array<string>\n /**\n * The public patient key, encrypted here for separate Crypto Actors.\n */\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * The delegations giving access to connected healthcare information.\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * The contact secret encryption key used to encrypt the secured properties (like services for example), encrypted for separate Crypto Actors.\n */\n encryptionKeys?: { [key: string]: Array<Delegation> }\n /**\n * Description / Unambiguous qualification (LOINC code) of the type of information contained in the service. Could be a code to qualify temperature, complaint, diagnostic, ...\n */\n label?: string\n dataClassName?: string\n /**\n * Used for sorting services inside an upper object (A contact, a transaction, a FHIR bundle, ...)\n */\n index?: number\n /**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\n content?: { [key: string]: Content }\n encryptedContent?: string\n textIndexes?: { [key: string]: string }\n /**\n * The date (YYYYMMDDhhmmss) when the Service is noted to have started and also closes on the same date\n */\n valueDate?: number\n /**\n * The date (YYYYMMDDhhmmss) of the start of the Service\n */\n openingDate?: number\n /**\n * The date (YYYYMMDDhhmmss) marking the end of the Service\n */\n closingDate?: number\n /**\n * Id of the form used during the Service\n */\n formId?: string\n /**\n * The timestamp (unix epoch in ms) of creation of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n created?: number\n /**\n * The date (unix epoch in ms) of the latest modification of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n modified?: number\n /**\n * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * The id of the User that has created this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n author?: string\n /**\n * The id of the HealthcareParty that is responsible for this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n responsible?: string\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n /**\n * Text, comments on the Service provided\n */\n comment?: string\n status?: number\n /**\n * List of invoicing codes\n */\n invoicingCodes?: Array<string>\n /**\n * Comments - Notes recorded by a HCP about this service\n */\n notes?: Array<Annotation>\n /**\n * Links towards related services (possibly in other contacts)\n */\n qualifiedLinks?: { [key: string]: { [key: string]: string } }\n /**\n * A code is an item from a codification system that qualifies the content of this entity. SNOMED-CT, ICPC-2 or ICD-10 codifications systems can be used for codes\n */\n codes?: Array<CodeStub>\n /**\n * A tag is an item from a codification system that qualifies an entity as being member of a certain class, whatever the value it might have taken. If the tag qualifies the content of a field, it means that whatever the content of the field, the tag will always apply. For example, the label of a field is qualified using a tag. LOINC is a codification system typically used for tags.\n */\n tags?: Array<CodeStub>\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n securityMetadata?: SecurityMetadata\n}\n"]}
|
package/package.json
CHANGED
|
@@ -189,21 +189,21 @@ describe('icc-x-contact-api Tests', () => {
|
|
|
189
189
|
(0, chai_1.expect)(retrieved.details).to.be.equal(encryptedField);
|
|
190
190
|
(0, chai_1.expect)((yield api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id);
|
|
191
191
|
}));
|
|
192
|
-
it('Instanciation of old Measure should be mapped to new Measure with
|
|
192
|
+
it('Instanciation of old Measure should be mapped to new Measure with referenceRanges', () => {
|
|
193
193
|
const oldMeasure = {
|
|
194
194
|
min: 0,
|
|
195
195
|
max: 10,
|
|
196
196
|
};
|
|
197
197
|
const newMeasure = new Measure_1.Measure(Object.assign({}, oldMeasure));
|
|
198
|
-
(0, chai_1.expect)(newMeasure.
|
|
199
|
-
(0, chai_1.expect)(newMeasure.
|
|
200
|
-
(0, chai_1.expect)(newMeasure.
|
|
201
|
-
(0, chai_1.expect)(newMeasure.
|
|
202
|
-
(0, chai_1.expect)(newMeasure.
|
|
198
|
+
(0, chai_1.expect)(newMeasure.referenceRanges).to.not.be.undefined;
|
|
199
|
+
(0, chai_1.expect)(newMeasure.referenceRanges).to.not.undefined;
|
|
200
|
+
(0, chai_1.expect)(newMeasure.referenceRanges).to.have.length(1);
|
|
201
|
+
(0, chai_1.expect)(newMeasure.referenceRanges[0].low).to.be.equal(oldMeasure.min);
|
|
202
|
+
(0, chai_1.expect)(newMeasure.referenceRanges[0].high).to.be.equal(oldMeasure.max);
|
|
203
203
|
(0, chai_1.expect)(Object.keys(newMeasure)).to.not.contain('min');
|
|
204
204
|
(0, chai_1.expect)(Object.keys(newMeasure)).to.not.contain('max');
|
|
205
205
|
});
|
|
206
|
-
it('Instanciation of Service with old Measure should be mapped to new Measure with
|
|
206
|
+
it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRanges', () => {
|
|
207
207
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
208
208
|
const serviceJson = {
|
|
209
209
|
id: 'serviceId',
|
|
@@ -228,14 +228,14 @@ describe('icc-x-contact-api Tests', () => {
|
|
|
228
228
|
};
|
|
229
229
|
const service = new Service_1.Service(JSON.parse(JSON.stringify(serviceJson)));
|
|
230
230
|
(0, chai_1.expect)((_b = (_a = service.content) === null || _a === void 0 ? void 0 : _a.en) === null || _b === void 0 ? void 0 : _b.measureValue).to.not.be.undefined;
|
|
231
|
-
(0, chai_1.expect)((_e = (_d = (_c = service.content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.
|
|
232
|
-
(0, chai_1.expect)((_h = (_g = (_f = service.content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.
|
|
233
|
-
(0, chai_1.expect)((_l = (_k = (_j = service.content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.
|
|
234
|
-
(0, chai_1.expect)((_p = (_o = (_m = service.content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.
|
|
231
|
+
(0, chai_1.expect)((_e = (_d = (_c = service.content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRanges).to.not.be.undefined;
|
|
232
|
+
(0, chai_1.expect)((_h = (_g = (_f = service.content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRanges).to.have.length(1);
|
|
233
|
+
(0, chai_1.expect)((_l = (_k = (_j = service.content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRanges[0].low).to.be.equal(serviceJson.content.en.measureValue.min);
|
|
234
|
+
(0, chai_1.expect)((_p = (_o = (_m = service.content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRanges[0].high).to.be.equal(serviceJson.content.en.measureValue.max);
|
|
235
235
|
(0, chai_1.expect)(Object.keys((_r = (_q = service.content) === null || _q === void 0 ? void 0 : _q.en) === null || _r === void 0 ? void 0 : _r.measureValue)).to.not.contain('min');
|
|
236
236
|
(0, chai_1.expect)(Object.keys((_t = (_s = service.content) === null || _s === void 0 ? void 0 : _s.en) === null || _t === void 0 ? void 0 : _t.measureValue)).to.not.contain('max');
|
|
237
237
|
});
|
|
238
|
-
it('Instanciation of Contact with old Measure should be mapped to new Measure with
|
|
238
|
+
it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRanges', () => {
|
|
239
239
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
240
240
|
const contactJson = {
|
|
241
241
|
id: 'contactId',
|
|
@@ -268,10 +268,10 @@ describe('icc-x-contact-api Tests', () => {
|
|
|
268
268
|
(0, chai_1.expect)(contact.services).to.not.be.undefined;
|
|
269
269
|
(0, chai_1.expect)(contact.services).to.have.length(1);
|
|
270
270
|
(0, chai_1.expect)((_b = (_a = contact.services[0].content) === null || _a === void 0 ? void 0 : _a.en) === null || _b === void 0 ? void 0 : _b.measureValue).to.not.be.undefined;
|
|
271
|
-
(0, chai_1.expect)((_e = (_d = (_c = contact.services[0].content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.
|
|
272
|
-
(0, chai_1.expect)((_h = (_g = (_f = contact.services[0].content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.
|
|
273
|
-
(0, chai_1.expect)((_l = (_k = (_j = contact.services[0].content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.
|
|
274
|
-
(0, chai_1.expect)((_p = (_o = (_m = contact.services[0].content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.
|
|
271
|
+
(0, chai_1.expect)((_e = (_d = (_c = contact.services[0].content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRanges).to.not.be.undefined;
|
|
272
|
+
(0, chai_1.expect)((_h = (_g = (_f = contact.services[0].content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRanges).to.have.length(1);
|
|
273
|
+
(0, chai_1.expect)((_l = (_k = (_j = contact.services[0].content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRanges[0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min);
|
|
274
|
+
(0, chai_1.expect)((_p = (_o = (_m = contact.services[0].content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRanges[0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max);
|
|
275
275
|
(0, chai_1.expect)(Object.keys((_r = (_q = contact.services[0].content) === null || _q === void 0 ? void 0 : _q.en) === null || _r === void 0 ? void 0 : _r.measureValue)).to.not.contain('min');
|
|
276
276
|
(0, chai_1.expect)(Object.keys((_t = (_s = contact.services[0].content) === null || _s === void 0 ? void 0 : _s.en) === null || _t === void 0 ? void 0 : _t.measureValue)).to.not.contain('max');
|
|
277
277
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icc-contact-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-contact-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA8B;AAE9B,4BAAyB;AAEzB,+CAA+G;AAC/G,yDAAqD;AACrD,+BAAqC;AACrC,mCAAmC;AACnC,oDAAuH;AACvH,mDAA+C;AAC/C,yDAAqD;AACrD,yDAAqD;AACrD,yDAAqD;AAErD,qEAAiE;AACjE,+DAA2D;AAC3D,iEAA6D;AAC7D,+EAA2E;AAC3E,2HAAuH;AACvH,mDAAmE;AACnE,yDAAqD;AACrD,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAElC,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AAEjB,IAAA,cAAM,EAAC;;QACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;QACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uBAAe,GAAE,CAAC,CAAA;IACpD,CAAC;CAAA,CAAC,CAAA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AC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1F,IAAA,aAAM,EAAC,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,OAAO,CAAC,QAAS,CAAC,CAAC,CAAC,CAAC,OAAO,0CAAE,EAAE,0CAAE,YAAa,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC5F,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { before } from 'mocha'\n\nimport 'isomorphic-fetch'\n\nimport { EntityWithDelegationTypeName, IccContactXApi, IccHelementXApi, IccPatientXApi } from '../../icc-x-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { assert, expect } from 'chai'\nimport { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { Code } from '../../icc-api/model/Code'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { Service } from '../../icc-api/model/Service'\nimport { Content } from '../../icc-api/model/Content'\nimport { User } from '../../icc-api/model/User'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { SubContact } from '../../icc-api/model/SubContact'\nimport { ServiceLink } from '../../icc-api/model/ServiceLink'\nimport { FilterChainService } from '../../icc-api/model/FilterChainService'\nimport { ServiceByHcPartyHealthElementIdsFilter } from '../../icc-x-api/filters/ServiceByHcPartyHealthElementIdsFilter'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { Measure } from '../../icc-api/model/Measure'\nimport initApi = TestUtils.initApi\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\nbefore(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n})\n\nasync function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User) {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n}\n\nasync function createHealthElement(healthElementApi: IccHelementXApi, hcpUser: User, patient: Patient) {\n return healthElementApi.createHealthElementWithUser(\n hcpUser,\n await healthElementApi.newInstance(\n hcpUser,\n patient,\n new HealthElement({\n id: randomUUID(),\n note: 'My secret note',\n tags: [\n new Code({\n id: 'ICURE|MY-CODE|1',\n code: 'MY-CODE',\n type: 'ICURE',\n version: '1',\n }),\n ],\n }),\n { confidential: true }\n )\n )\n}\n\nfunction createBasicContact(contactApiForHcp: IccContactXApi, hcpUser: User, patient: Patient) {\n return contactApiForHcp.newInstance(\n hcpUser,\n patient,\n new Contact({\n id: randomUUID(),\n services: [\n contactApiForHcp.service().newInstance(\n hcpUser,\n new Service({\n id: randomUUID(),\n valueDate: 20220203111034,\n content: { en: new Content({ numberValue: 53.5 }) },\n tags: [\n new Code({\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n }),\n ],\n })\n ),\n ],\n descr: 'Weight value',\n }),\n { confidential: true }\n )\n}\n\ndescribe('icc-x-contact-api Tests', () => {\n it('CreateContactWithUser Success for HCP', async () => {\n // Given\n const { userApi: userApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, cryptoApi } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient)\n\n // When\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // Then\n const readContact = await contactApiForHcp.getContactWithUser(hcpUser, createdContact.id!)\n expect(readContact).to.not.be.undefined\n expect(readContact).to.not.be.null\n expect(readContact.openingDate).to.not.be.undefined\n expect(readContact.openingDate).to.not.be.null\n expect(readContact.groupId).to.not.be.undefined\n expect(readContact.groupId).to.not.be.null\n expect(readContact.responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.id).to.be.equal(contactToCreate.id)\n expect(readContact.descr).to.be.equal(contactToCreate.descr)\n expect(readContact.services![0].responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.services![0].id).to.be.equal(contactToCreate.services![0].id)\n expect(readContact.services![0].valueDate).to.be.equal(contactToCreate.services![0].valueDate)\n expect(readContact.services![0].tags![0].id).to.be.equal(contactToCreate.services![0].tags![0].id!)\n expect(await cryptoApi.xapi.encryptionKeysOf({ entity: readContact, type: EntityWithDelegationTypeName.Contact }, undefined)).to.have.length(1)\n const decryptedPatientIds = await contactApiForHcp.decryptPatientIdOf(readContact)\n expect(decryptedPatientIds).to.have.length(1)\n expect(decryptedPatientIds[0]).to.equal(patient.id)\n })\n\n it('Filter Services By HealthElementId - Success', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, new Contact(contactToCreate))) as Contact\n assert(createdContact != null)\n\n // When\n const foundServices = await contactApiForHcp.filterServicesBy(\n undefined,\n undefined,\n new FilterChainService({\n filter: new ServiceByHcPartyHealthElementIdsFilter({\n healthcarePartyId: hcpUser.healthcarePartyId!,\n healthElementIds: [healthElement!.id!],\n }),\n })\n )\n\n // Then\n assert(foundServices.rows!.length == 1)\n assert(foundServices.rows![0].id == createdContact.services![0].id)\n assert(foundServices.rows![0].healthElementsIds!.find((heId) => heId == healthElement!.id!) != undefined)\n })\n\n it('contacts findBy for HCP GET and POSt', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n dataOwnerApi: dataOwnerApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n cryptoApi: cryptoApiForHcp,\n } = await initApi(env, hcp1Username)\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = (await createPatient(patientApiForHcp, hcpUser)) as Patient\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // When\n const foundContats = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, false)\n const foundContatsUsingPost = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, true)\n\n // Then\n assert(foundContats.length == 1, 'Found items should be 1')\n assert(foundContats[0].id == contactToCreate.id, 'Found item should be the same as the created one')\n\n assert(foundContatsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundContatsUsingPost[0].id == createdContact.id, 'Found item using post should be the same as the created one')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const encryptedField = 'Something encrypted'\n const entity = await api1.calendarItemApi.createCalendarItemWithHcParty(\n user1,\n await api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField })\n )\n expect(entity.details).to.be.equal(encryptedField)\n await api2.calendarItemApi\n .getCalendarItemWithUser(user2, entity.id)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.calendarItemApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id)\n expect(retrieved.details).to.be.equal(encryptedField)\n expect((await api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n\n it('Instanciation of old Measure should be mapped to new Measure with referenceRange', () => {\n const oldMeasure = {\n min: 0,\n max: 10,\n }\n\n const newMeasure = new Measure({ ...oldMeasure })\n\n expect(newMeasure.referenceRange).to.not.be.undefined\n expect(newMeasure.referenceRange).to.not.undefined\n expect(newMeasure.referenceRange).to.have.length(1)\n expect(newMeasure.referenceRange![0].low).to.be.equal(oldMeasure.min)\n expect(newMeasure.referenceRange![0].high).to.be.equal(oldMeasure.max)\n\n expect(Object.keys(newMeasure)).to.not.contain('min')\n expect(Object.keys(newMeasure)).to.not.contain('max')\n })\n\n it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRange', () => {\n const serviceJson = {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n }\n\n const service = new Service(JSON.parse(JSON.stringify(serviceJson)))\n\n expect(service.content?.en?.measureValue).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRange).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRange).to.have.length(1)\n expect(service.content?.en?.measureValue?.referenceRange![0].low).to.be.equal(serviceJson.content.en.measureValue.min)\n expect(service.content?.en?.measureValue?.referenceRange![0].high).to.be.equal(serviceJson.content.en.measureValue.max)\n\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('max')\n })\n\n it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRange', () => {\n const contactJson = {\n id: 'contactId',\n services: [\n {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n },\n ],\n descr: 'Weight value',\n }\n\n const contact = new Contact(JSON.parse(JSON.stringify(contactJson)))\n\n expect(contact.services).to.not.be.undefined\n expect(contact.services).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRange).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRange).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue?.referenceRange![0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min)\n expect(contact.services![0].content?.en?.measureValue?.referenceRange![0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max)\n\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('max')\n })\n})\n"]}
|
|
1
|
+
{"version":3,"file":"icc-contact-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-contact-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA8B;AAE9B,4BAAyB;AAEzB,+CAA+G;AAC/G,yDAAqD;AACrD,+BAAqC;AACrC,mCAAmC;AACnC,oDAAuH;AACvH,mDAA+C;AAC/C,yDAAqD;AACrD,yDAAqD;AACrD,yDAAqD;AAErD,qEAAiE;AACjE,+DAA2D;AAC3D,iEAA6D;AAC7D,+EAA2E;AAC3E,2HAAuH;AACvH,mDAAmE;AACnE,yDAAqD;AACrD,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAElC,IAAA,4BAAe,EAAC,K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,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QAEjJ,IAAA,aAAM,EAAC,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,OAAO,CAAC,QAAS,CAAC,CAAC,CAAC,CAAC,OAAO,0CAAE,EAAE,0CAAE,YAAa,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1F,IAAA,aAAM,EAAC,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,OAAO,CAAC,QAAS,CAAC,CAAC,CAAC,CAAC,OAAO,0CAAE,EAAE,0CAAE,YAAa,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC5F,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { before } from 'mocha'\n\nimport 'isomorphic-fetch'\n\nimport { EntityWithDelegationTypeName, IccContactXApi, IccHelementXApi, IccPatientXApi } from '../../icc-x-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { assert, expect } from 'chai'\nimport { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { Code } from '../../icc-api/model/Code'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { Service } from '../../icc-api/model/Service'\nimport { Content } from '../../icc-api/model/Content'\nimport { User } from '../../icc-api/model/User'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { SubContact } from '../../icc-api/model/SubContact'\nimport { ServiceLink } from '../../icc-api/model/ServiceLink'\nimport { FilterChainService } from '../../icc-api/model/FilterChainService'\nimport { ServiceByHcPartyHealthElementIdsFilter } from '../../icc-x-api/filters/ServiceByHcPartyHealthElementIdsFilter'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { Measure } from '../../icc-api/model/Measure'\nimport initApi = TestUtils.initApi\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\nbefore(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n})\n\nasync function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User) {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n}\n\nasync function createHealthElement(healthElementApi: IccHelementXApi, hcpUser: User, patient: Patient) {\n return healthElementApi.createHealthElementWithUser(\n hcpUser,\n await healthElementApi.newInstance(\n hcpUser,\n patient,\n new HealthElement({\n id: randomUUID(),\n note: 'My secret note',\n tags: [\n new Code({\n id: 'ICURE|MY-CODE|1',\n code: 'MY-CODE',\n type: 'ICURE',\n version: '1',\n }),\n ],\n }),\n { confidential: true }\n )\n )\n}\n\nfunction createBasicContact(contactApiForHcp: IccContactXApi, hcpUser: User, patient: Patient) {\n return contactApiForHcp.newInstance(\n hcpUser,\n patient,\n new Contact({\n id: randomUUID(),\n services: [\n contactApiForHcp.service().newInstance(\n hcpUser,\n new Service({\n id: randomUUID(),\n valueDate: 20220203111034,\n content: { en: new Content({ numberValue: 53.5 }) },\n tags: [\n new Code({\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n }),\n ],\n })\n ),\n ],\n descr: 'Weight value',\n }),\n { confidential: true }\n )\n}\n\ndescribe('icc-x-contact-api Tests', () => {\n it('CreateContactWithUser Success for HCP', async () => {\n // Given\n const { userApi: userApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, cryptoApi } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient)\n\n // When\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // Then\n const readContact = await contactApiForHcp.getContactWithUser(hcpUser, createdContact.id!)\n expect(readContact).to.not.be.undefined\n expect(readContact).to.not.be.null\n expect(readContact.openingDate).to.not.be.undefined\n expect(readContact.openingDate).to.not.be.null\n expect(readContact.groupId).to.not.be.undefined\n expect(readContact.groupId).to.not.be.null\n expect(readContact.responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.id).to.be.equal(contactToCreate.id)\n expect(readContact.descr).to.be.equal(contactToCreate.descr)\n expect(readContact.services![0].responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.services![0].id).to.be.equal(contactToCreate.services![0].id)\n expect(readContact.services![0].valueDate).to.be.equal(contactToCreate.services![0].valueDate)\n expect(readContact.services![0].tags![0].id).to.be.equal(contactToCreate.services![0].tags![0].id!)\n expect(await cryptoApi.xapi.encryptionKeysOf({ entity: readContact, type: EntityWithDelegationTypeName.Contact }, undefined)).to.have.length(1)\n const decryptedPatientIds = await contactApiForHcp.decryptPatientIdOf(readContact)\n expect(decryptedPatientIds).to.have.length(1)\n expect(decryptedPatientIds[0]).to.equal(patient.id)\n })\n\n it('Filter Services By HealthElementId - Success', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, new Contact(contactToCreate))) as Contact\n assert(createdContact != null)\n\n // When\n const foundServices = await contactApiForHcp.filterServicesBy(\n undefined,\n undefined,\n new FilterChainService({\n filter: new ServiceByHcPartyHealthElementIdsFilter({\n healthcarePartyId: hcpUser.healthcarePartyId!,\n healthElementIds: [healthElement!.id!],\n }),\n })\n )\n\n // Then\n assert(foundServices.rows!.length == 1)\n assert(foundServices.rows![0].id == createdContact.services![0].id)\n assert(foundServices.rows![0].healthElementsIds!.find((heId) => heId == healthElement!.id!) != undefined)\n })\n\n it('contacts findBy for HCP GET and POSt', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n dataOwnerApi: dataOwnerApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n cryptoApi: cryptoApiForHcp,\n } = await initApi(env, hcp1Username)\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = (await createPatient(patientApiForHcp, hcpUser)) as Patient\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // When\n const foundContats = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, false)\n const foundContatsUsingPost = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, true)\n\n // Then\n assert(foundContats.length == 1, 'Found items should be 1')\n assert(foundContats[0].id == contactToCreate.id, 'Found item should be the same as the created one')\n\n assert(foundContatsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundContatsUsingPost[0].id == createdContact.id, 'Found item using post should be the same as the created one')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const encryptedField = 'Something encrypted'\n const entity = await api1.calendarItemApi.createCalendarItemWithHcParty(\n user1,\n await api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField })\n )\n expect(entity.details).to.be.equal(encryptedField)\n await api2.calendarItemApi\n .getCalendarItemWithUser(user2, entity.id)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.calendarItemApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id)\n expect(retrieved.details).to.be.equal(encryptedField)\n expect((await api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n\n it('Instanciation of old Measure should be mapped to new Measure with referenceRanges', () => {\n const oldMeasure = {\n min: 0,\n max: 10,\n }\n\n const newMeasure = new Measure({ ...oldMeasure })\n\n expect(newMeasure.referenceRanges).to.not.be.undefined\n expect(newMeasure.referenceRanges).to.not.undefined\n expect(newMeasure.referenceRanges).to.have.length(1)\n expect(newMeasure.referenceRanges![0].low).to.be.equal(oldMeasure.min)\n expect(newMeasure.referenceRanges![0].high).to.be.equal(oldMeasure.max)\n\n expect(Object.keys(newMeasure)).to.not.contain('min')\n expect(Object.keys(newMeasure)).to.not.contain('max')\n })\n\n it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRanges', () => {\n const serviceJson = {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n }\n\n const service = new Service(JSON.parse(JSON.stringify(serviceJson)))\n\n expect(service.content?.en?.measureValue).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRanges).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRanges).to.have.length(1)\n expect(service.content?.en?.measureValue?.referenceRanges![0].low).to.be.equal(serviceJson.content.en.measureValue.min)\n expect(service.content?.en?.measureValue?.referenceRanges![0].high).to.be.equal(serviceJson.content.en.measureValue.max)\n\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('max')\n })\n\n it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRanges', () => {\n const contactJson = {\n id: 'contactId',\n services: [\n {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n },\n ],\n descr: 'Weight value',\n }\n\n const contact = new Contact(JSON.parse(JSON.stringify(contactJson)))\n\n expect(contact.services).to.not.be.undefined\n expect(contact.services).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges![0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min)\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges![0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max)\n\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('max')\n })\n})\n"]}
|
package/test/support/CSM-87.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'isomorphic-fetch';
|
package/test/support/CSM-87.js
CHANGED
|
@@ -8,40 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const icc_x_api_1 = require("../../icc-x-api");
|
|
13
|
-
const crypto_1 = require("crypto");
|
|
14
|
-
require("isomorphic-fetch");
|
|
15
|
-
const test_utils_1 = require("../utils/test_utils");
|
|
16
|
-
const icc_api_1 = require("../../icc-api");
|
|
17
|
-
(0, test_utils_1.setLocalStorage)(fetch);
|
|
18
|
-
class DiocaneCryptoStrategies {
|
|
19
|
-
generateNewKeyForDataOwner(self, cryptoPrimitives) {
|
|
20
|
-
return Promise.resolve(false);
|
|
21
|
-
}
|
|
22
|
-
recoverAndVerifySelfHierarchyKeys(keysData, cryptoPrimitives) {
|
|
23
|
-
return Promise.resolve(Object.fromEntries(keysData.map(({ dataOwner }) => [dataOwner.dataOwner.id, { recoveredKeys: {}, keyAuthenticity: {} }])));
|
|
24
|
-
}
|
|
25
|
-
verifyDelegatePublicKeys(delegate, publicKeys, cryptoPrimitives) {
|
|
26
|
-
return Promise.resolve(publicKeys);
|
|
27
|
-
}
|
|
28
|
-
dataOwnerRequiresAnonymousDelegation(dataOwner) {
|
|
29
|
-
return dataOwner.type !== 'hcp';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
11
|
describe('CSM-87', function () {
|
|
33
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
13
|
it('An hcp should be able to load his key with `loadKeyPairsAsJwkInBrowserLocalStorage` and then create shamir partitions for himself', function () {
|
|
35
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const testapp = availableGroupsInfo.filter(g => { var _a; return ((_a = g.groupId) === null || _a === void 0 ? void 0 : _a.startsWith('ms-testapppatient')) == true; });
|
|
39
|
-
return Promise.resolve(currentGroupId);
|
|
40
|
-
// if (testapp.length != 1) throw new Error(`Found ${JSON.stringify(testapp)}`)
|
|
41
|
-
// return Promise.resolve(testapp[0].groupId!)
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
console.log("Hello");
|
|
15
|
+
// This test does not apply to v7 or higher: it was a bug related to a specific method
|
|
16
|
+
this.skip();
|
|
45
17
|
});
|
|
46
18
|
});
|
|
47
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSM-87.js","sourceRoot":"","sources":["../../../test/support/CSM-87.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CSM-87.js","sourceRoot":"","sources":["../../../test/support/CSM-87.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,QAAQ,CAAC,QAAQ,EAAE;;QACjB,EAAE,CAAC,mIAAmI,EAAE;;gBACtI,sFAAsF;gBACtF,IAAI,CAAC,IAAI,EAAE,CAAA;YACb,CAAC;SAAA,CAAC,CAAA;IACJ,CAAC;CAAA,CAAC,CAAA","sourcesContent":["describe('CSM-87', async function () {\n it('An hcp should be able to load his key with `loadKeyPairsAsJwkInBrowserLocalStorage` and then create shamir partitions for himself', async function () {\n // This test does not apply to v7 or higher: it was a bug related to a specific method\n this.skip()\n })\n})\n"]}
|