ndhm-hrp 2.1.70 → 2.1.71
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.
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import Header from "./header";
|
|
2
2
|
export interface STATUS_RESPONSES_HEALTH_INFORMATION_NOTIFY {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
careContextReference: string;
|
|
4
|
+
hiStatus: "DELIVERED" | "OK" | "ERRORED";
|
|
5
|
+
description: string;
|
|
6
6
|
}
|
|
7
7
|
export default class HealthInformation extends Header {
|
|
8
8
|
constructor(_baseUrl: string, _accessToken: string);
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* HIP on transfer of data would send sessionStatus - one of [TRANSFERRED, FAILED]
|
|
12
|
-
* HIP would also send hiStatus for each careContextReference - on of [DELIVERED, ERRORED]
|
|
13
|
-
* HIU on receipt of data would send sessionStatus - one of [TRANSFERRED, FAILED]. For example, FAILED when if data was not sent or if invalid data was sent
|
|
14
|
-
* HIU would also send hiStatus for each careContextReference - one of [OK, ERRORED]
|
|
10
|
+
* Request for Health information against a consent id. CM would generate a transactionId against each consent and pass it as trnasaction context / correlation id to the HIP and also return the same to HIU via /on-request.
|
|
15
11
|
* @param config
|
|
16
12
|
* @returns
|
|
17
13
|
*/
|
|
@@ -27,5 +23,19 @@ export default class HealthInformation extends Header {
|
|
|
27
23
|
errMessage?: string;
|
|
28
24
|
statusResponses: STATUS_RESPONSES_HEALTH_INFORMATION_NOTIFY[];
|
|
29
25
|
}) => Promise<any>;
|
|
26
|
+
cmRequest: (config: {
|
|
27
|
+
healthId: string;
|
|
28
|
+
consentId: string;
|
|
29
|
+
dateRange: {
|
|
30
|
+
from: string;
|
|
31
|
+
to: string;
|
|
32
|
+
};
|
|
33
|
+
publicKey: string;
|
|
34
|
+
expireDate: string;
|
|
35
|
+
nounce: string;
|
|
36
|
+
dataPushUrl: string;
|
|
37
|
+
errCode?: any;
|
|
38
|
+
errMessage?: any;
|
|
39
|
+
}) => Promise<any>;
|
|
30
40
|
}
|
|
31
41
|
//# sourceMappingURL=health-information.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health-information.d.ts","sourceRoot":"","sources":["../../src/classes/health-information.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,MAAM,WAAW,0CAA0C;IACzD,
|
|
1
|
+
{"version":3,"file":"health-information.d.ts","sourceRoot":"","sources":["../../src/classes/health-information.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,MAAM,WAAW,0CAA0C;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,MAAM;gBACvC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAIlD;;;;OAIG;IACH,MAAM,WAAkB;QACtB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,KAAK,GAAG,KAAK,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,aAAa,GAAG,QAAQ,CAAC;QACxC,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,0CAA0C,EAAE,CAAC;KAC/D,kBA0CC;IAEF,SAAS,WAAkB;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE;YACT,IAAI,EAAE,MAAM,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;SACZ,CAAC;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,UAAU,CAAC,EAAE,GAAG,CAAC;KAClB,kBA6CC;CACH"}
|
|
@@ -19,11 +19,7 @@ class HealthInformation extends header_1.default {
|
|
|
19
19
|
constructor(_baseUrl, _accessToken) {
|
|
20
20
|
super(_baseUrl, _accessToken);
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* HIP on transfer of data would send sessionStatus - one of [TRANSFERRED, FAILED]
|
|
24
|
-
* HIP would also send hiStatus for each careContextReference - on of [DELIVERED, ERRORED]
|
|
25
|
-
* HIU on receipt of data would send sessionStatus - one of [TRANSFERRED, FAILED]. For example, FAILED when if data was not sent or if invalid data was sent
|
|
26
|
-
* HIU would also send hiStatus for each careContextReference - one of [OK, ERRORED]
|
|
22
|
+
* Request for Health information against a consent id. CM would generate a transactionId against each consent and pass it as trnasaction context / correlation id to the HIP and also return the same to HIU via /on-request.
|
|
27
23
|
* @param config
|
|
28
24
|
* @returns
|
|
29
25
|
*/
|
|
@@ -34,20 +30,63 @@ class HealthInformation extends header_1.default {
|
|
|
34
30
|
const body = {
|
|
35
31
|
requestId: (0, uuid_1.v4)(),
|
|
36
32
|
timestamp: new Date().toISOString(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
notification: {
|
|
34
|
+
consentId: config.consentId,
|
|
35
|
+
transactionId: config.transactionId,
|
|
36
|
+
doneAt: new Date().toISOString(),
|
|
37
|
+
notifier: {
|
|
38
|
+
type: config.notifer,
|
|
39
|
+
id: config.notifierId,
|
|
44
40
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
}
|
|
41
|
+
statusNotification: {
|
|
42
|
+
sessionStatus: config.sessionStatus,
|
|
43
|
+
hipId: config.hipId,
|
|
44
|
+
statusResponses: config.statusResponses,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
if (config.errCode) {
|
|
49
|
+
body.error = {
|
|
50
|
+
code: config.errCode,
|
|
51
|
+
message: config.errMessage || "Error occured",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const res = yield new request_1.default().request({
|
|
55
|
+
headers: headers,
|
|
56
|
+
method: "POST",
|
|
57
|
+
requestBody: body,
|
|
58
|
+
url: url,
|
|
59
|
+
});
|
|
60
|
+
return body;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.log(error);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this.cmRequest = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
try {
|
|
68
|
+
const headers = this.headers(config.healthId);
|
|
69
|
+
const url = `${this.baseUrl}gateway/v0.5/health-information/cm/request`;
|
|
70
|
+
const body = {
|
|
71
|
+
requestId: (0, uuid_1.v4)(),
|
|
72
|
+
timestamp: new Date().toISOString(),
|
|
73
|
+
hiRequest: {
|
|
74
|
+
consent: {
|
|
75
|
+
id: config.consentId,
|
|
76
|
+
dateRange: config.dateRange,
|
|
77
|
+
dataPushUrl: config.dataPushUrl,
|
|
78
|
+
keyMaterial: {
|
|
79
|
+
cryptoAlg: "ECDH",
|
|
80
|
+
curve: "Curve25519",
|
|
81
|
+
dhPublicKey: {
|
|
82
|
+
expiry: config.expireDate,
|
|
83
|
+
parameters: "Curve25519/32byte random key",
|
|
84
|
+
keyValue: config.publicKey,
|
|
85
|
+
},
|
|
86
|
+
nonce: config.nounce,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
51
90
|
};
|
|
52
91
|
if (config.errCode) {
|
|
53
92
|
body.error = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health-information.js","sourceRoot":"","sources":["../../src/classes/health-information.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,+BAAoC;AACpC,wDAAgC;AAQhC,MAAqB,iBAAkB,SAAQ,gBAAM;IACnD,YAAY,QAAgB,EAAE,YAAoB;QAChD,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAGhC
|
|
1
|
+
{"version":3,"file":"health-information.js","sourceRoot":"","sources":["../../src/classes/health-information.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,+BAAoC;AACpC,wDAAgC;AAQhC,MAAqB,iBAAkB,SAAQ,gBAAM;IACnD,YAAY,QAAgB,EAAE,YAAoB;QAChD,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAGhC;;;;WAIG;QACH,WAAM,GAAG,CAAO,MAWf,EAAE,EAAE;YACH,IAAI;gBACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC9C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,wCAAwC,CAAC;gBAEpE,MAAM,IAAI,GAAQ;oBAChB,SAAS,EAAE,IAAA,SAAM,GAAE;oBACnB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACnC,YAAY,EAAE;wBACZ,SAAS,EAAE,MAAM,CAAC,SAAS;wBAC3B,aAAa,EAAE,MAAM,CAAC,aAAa;wBACnC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAChC,QAAQ,EAAE;4BACR,IAAI,EAAE,MAAM,CAAC,OAAO;4BACpB,EAAE,EAAE,MAAM,CAAC,UAAU;yBACtB;wBACD,kBAAkB,EAAE;4BAClB,aAAa,EAAE,MAAM,CAAC,aAAa;4BACnC,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,eAAe,EAAE,MAAM,CAAC,eAAe;yBACxC;qBACF;iBACF,CAAC;gBAEF,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