ndhm-hrp 2.1.55 → 2.1.56
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/lib/classes/abha.d.ts +58 -0
- package/lib/classes/abha.d.ts.map +1 -0
- package/lib/classes/abha.js +98 -0
- package/lib/classes/abha.js.map +1 -0
- package/lib/classes/consent-flow.d.ts +19 -0
- package/lib/classes/consent-flow.d.ts.map +1 -0
- package/lib/classes/consent-flow.js +72 -0
- package/lib/classes/consent-flow.js.map +1 -0
- package/lib/classes/discovery.d.ts +24 -0
- package/lib/classes/discovery.d.ts.map +1 -0
- package/lib/classes/discovery.js +75 -0
- package/lib/classes/discovery.js.map +1 -0
- package/lib/classes/header.d.ts +41 -0
- package/lib/classes/header.d.ts.map +1 -0
- package/lib/classes/header.js +55 -0
- package/lib/classes/header.js.map +1 -0
- package/lib/classes/link.d.ts +115 -0
- package/lib/classes/link.d.ts.map +1 -0
- package/lib/classes/link.js +180 -0
- package/lib/classes/link.js.map +1 -0
- package/lib/classes/profile.d.ts +16 -0
- package/lib/classes/profile.d.ts.map +1 -0
- package/lib/classes/profile.js +64 -0
- package/lib/classes/profile.js.map +1 -0
- package/lib/classes/register.d.ts +38 -0
- package/lib/classes/register.d.ts.map +1 -0
- package/lib/classes/register.js +87 -0
- package/lib/classes/register.js.map +1 -0
- package/lib/classes/request.d.ts +9 -0
- package/lib/classes/request.d.ts.map +1 -0
- package/lib/classes/request.js +39 -0
- package/lib/classes/request.js.map +1 -0
- package/lib/classes/userAuth.d.ts +50 -0
- package/lib/classes/userAuth.d.ts.map +1 -0
- package/lib/classes/userAuth.js +91 -0
- package/lib/classes/userAuth.js.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export default class AbhaNumber {
|
|
2
|
+
private abhaBaseUrl;
|
|
3
|
+
private headers;
|
|
4
|
+
constructor(_accessToken: string, abhaBaseUrl: string);
|
|
5
|
+
generatAadhaareOTP: (aadhaar: number) => Promise<{
|
|
6
|
+
txnId: string;
|
|
7
|
+
}>;
|
|
8
|
+
aadharVerifyOtp: (options: {
|
|
9
|
+
otp: string;
|
|
10
|
+
txnId: string;
|
|
11
|
+
restrictions?: string;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
txnId: string;
|
|
14
|
+
}>;
|
|
15
|
+
generateMobileOtp: (mobile: string, txnId: string) => Promise<{
|
|
16
|
+
txnId: string;
|
|
17
|
+
}>;
|
|
18
|
+
verifyMobileOtp: (otp: string, txnId: string) => Promise<{
|
|
19
|
+
txnId: string;
|
|
20
|
+
}>;
|
|
21
|
+
createHealthIdWithPreVerified: (options: {
|
|
22
|
+
email: string;
|
|
23
|
+
firstName: string;
|
|
24
|
+
healthId: string;
|
|
25
|
+
lastName: string;
|
|
26
|
+
middleName: string;
|
|
27
|
+
password: string;
|
|
28
|
+
profilePhoto: string;
|
|
29
|
+
txnId: string;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
authMethods: ["AADHAAR_OTP"];
|
|
32
|
+
dayOfBirth: string;
|
|
33
|
+
districtCode: string;
|
|
34
|
+
districtName: string;
|
|
35
|
+
email: string;
|
|
36
|
+
firstName: string;
|
|
37
|
+
gender: string;
|
|
38
|
+
healthId: string;
|
|
39
|
+
healthIdNumber: string;
|
|
40
|
+
kycPhoto: string;
|
|
41
|
+
lastName: string;
|
|
42
|
+
middleName: string;
|
|
43
|
+
mobile: string;
|
|
44
|
+
monthOfBirth: string;
|
|
45
|
+
name: string;
|
|
46
|
+
new: true;
|
|
47
|
+
stateCode: string;
|
|
48
|
+
stateName: string;
|
|
49
|
+
tags: {
|
|
50
|
+
additionalProp1: string;
|
|
51
|
+
additionalProp2: string;
|
|
52
|
+
additionalProp3: string;
|
|
53
|
+
};
|
|
54
|
+
token: string;
|
|
55
|
+
yearOfBirth: string;
|
|
56
|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EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,MAAM,CAAC;QACb,GAAG,EAAE,IAAI,CAAC;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE;YACJ,eAAe,EAAE,MAAM,CAAC;YACxB,eAAe,EAAE,MAAM,CAAC;YACxB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAcA;CACH"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const request_1 = __importDefault(require("./request"));
|
|
16
|
+
class AbhaNumber {
|
|
17
|
+
constructor(_accessToken, abhaBaseUrl) {
|
|
18
|
+
this.generatAadhaareOTP = (aadhaar) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const url = `${this.abhaBaseUrl}/v1/registration/aadhaar/generateOtp`;
|
|
20
|
+
const body = {
|
|
21
|
+
aadhaar: aadhaar,
|
|
22
|
+
};
|
|
23
|
+
const res = yield new request_1.default().request({
|
|
24
|
+
headers: this.headers,
|
|
25
|
+
method: "POST",
|
|
26
|
+
requestBody: body,
|
|
27
|
+
url: url,
|
|
28
|
+
});
|
|
29
|
+
const ret = JSON.parse(JSON.stringify(res));
|
|
30
|
+
return JSON.parse(ret.body);
|
|
31
|
+
});
|
|
32
|
+
this.aadharVerifyOtp = (options) => __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const url = `${this.abhaBaseUrl}/v1/registration/aadhaar/verifyOTP`;
|
|
34
|
+
const body = {
|
|
35
|
+
otp: options.otp,
|
|
36
|
+
restrictions: options.restrictions,
|
|
37
|
+
txnId: options.txnId,
|
|
38
|
+
};
|
|
39
|
+
const res = yield new request_1.default().request({
|
|
40
|
+
headers: this.headers,
|
|
41
|
+
method: "POST",
|
|
42
|
+
requestBody: body,
|
|
43
|
+
url: url,
|
|
44
|
+
});
|
|
45
|
+
const ret = JSON.parse(JSON.stringify(res));
|
|
46
|
+
return JSON.parse(ret.body);
|
|
47
|
+
});
|
|
48
|
+
this.generateMobileOtp = (mobile, txnId) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const url = `${this.abhaBaseUrl}/v1/registration/aadhaar/generateMobileOTP`;
|
|
50
|
+
const body = {
|
|
51
|
+
mobile: mobile,
|
|
52
|
+
txnId: txnId,
|
|
53
|
+
};
|
|
54
|
+
const res = yield new request_1.default().request({
|
|
55
|
+
headers: this.headers,
|
|
56
|
+
method: "POST",
|
|
57
|
+
requestBody: body,
|
|
58
|
+
url: url,
|
|
59
|
+
});
|
|
60
|
+
const ret = JSON.parse(JSON.stringify(res));
|
|
61
|
+
return JSON.parse(ret.body);
|
|
62
|
+
});
|
|
63
|
+
this.verifyMobileOtp = (otp, txnId) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const url = `${this.abhaBaseUrl}/v1/registration/aadhaar/verifyMobileOTP`;
|
|
65
|
+
const body = {
|
|
66
|
+
otp: otp,
|
|
67
|
+
txnId: txnId,
|
|
68
|
+
};
|
|
69
|
+
const res = yield new request_1.default().request({
|
|
70
|
+
headers: this.headers,
|
|
71
|
+
method: "POST",
|
|
72
|
+
requestBody: body,
|
|
73
|
+
url: url,
|
|
74
|
+
});
|
|
75
|
+
const ret = JSON.parse(JSON.stringify(res));
|
|
76
|
+
return JSON.parse(ret.body);
|
|
77
|
+
});
|
|
78
|
+
this.createHealthIdWithPreVerified = (options) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const url = `${this.abhaBaseUrl}/v1/registration/aadhaar/createHealthIdWithPreVerified`;
|
|
80
|
+
const body = options;
|
|
81
|
+
const res = yield new request_1.default().request({
|
|
82
|
+
headers: this.headers,
|
|
83
|
+
method: "POST",
|
|
84
|
+
requestBody: body,
|
|
85
|
+
url: url,
|
|
86
|
+
});
|
|
87
|
+
const ret = JSON.parse(JSON.stringify(res));
|
|
88
|
+
return JSON.parse(ret.body);
|
|
89
|
+
});
|
|
90
|
+
this.headers = {
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
Authorization: `Bearer ${_accessToken}`,
|
|
93
|
+
};
|
|
94
|
+
this.abhaBaseUrl = abhaBaseUrl;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.default = AbhaNumber;
|
|
98
|
+
//# sourceMappingURL=abha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abha.js","sourceRoot":"","sources":["../../src/classes/abha.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,wDAAgC;AAGhC,MAAqB,UAAU;IAI7B,YAAY,YAAoB,EAAE,WAAmB;QAQrD,uBAAkB,GAAG,CACnB,OAAe,EAGd,EAAE;YACH,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,sCAAsC,C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,CAAC;gBACtC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,MAAM;gBACd,WAAW,EAAE,IAAI;gBACjB,GAAG,EAAE,GAAG;aACT,CAAC,CAAC;YAEH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAA,CAAC;QAtJA,IAAI,CAAC,OAAO,GAAG;YACb,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,YAAY,EAAE;SACxC,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CAkJF;AA5JD,6BA4JC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Header from "./header";
|
|
2
|
+
export default class ConsentFlow extends Header {
|
|
3
|
+
constructor(_baseUrl: string, _accessToken: string);
|
|
4
|
+
/**
|
|
5
|
+
* This API is called by HIP as acknowledgement to notification of consents, in cases of consent revocation and expiration.
|
|
6
|
+
* @param config.healthId: string; phradddress or ABHA addrress of patient
|
|
7
|
+
* @param config.consentId: string; consent id recive by notify callback
|
|
8
|
+
* @param config.requestId: string; request id as recived by notify callback
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
onhipNotify: (config: {
|
|
12
|
+
healthId: string;
|
|
13
|
+
consentId: string;
|
|
14
|
+
requestId: string;
|
|
15
|
+
errCode?: string;
|
|
16
|
+
errMessage?: string;
|
|
17
|
+
}) => Promise<any>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=consent-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent-flow.d.ts","sourceRoot":"","sources":["../../src/classes/consent-flow.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM;gBACjC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAGlD;;;;;;OAMG;IACH,WAAW,WAAkB;QAC3B,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,kBA8CC;CACH"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const header_1 = __importDefault(require("./header"));
|
|
16
|
+
const uuid_1 = require("uuid");
|
|
17
|
+
const request_1 = __importDefault(require("./request"));
|
|
18
|
+
class ConsentFlow extends header_1.default {
|
|
19
|
+
constructor(_baseUrl, _accessToken) {
|
|
20
|
+
super(_baseUrl, _accessToken);
|
|
21
|
+
/**
|
|
22
|
+
* This API is called by HIP as acknowledgement to notification of consents, in cases of consent revocation and expiration.
|
|
23
|
+
* @param config.healthId: string; phradddress or ABHA addrress of patient
|
|
24
|
+
* @param config.consentId: string; consent id recive by notify callback
|
|
25
|
+
* @param config.requestId: string; request id as recived by notify callback
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
this.onhipNotify = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
const headers = this.headers(config.healthId);
|
|
31
|
+
const url = `${this.baseUrl}gateway/v0.5/consents/hip/on-notify`;
|
|
32
|
+
const devurl = `https://webhook.site/2bbc9a81-e5ec-4555-bb83-c211974df004/gateway/v0.5/consents/hip/on-notify`;
|
|
33
|
+
const body = {
|
|
34
|
+
requestId: (0, uuid_1.v4)(),
|
|
35
|
+
timestamp: new Date().toISOString(),
|
|
36
|
+
acknowledgement: {
|
|
37
|
+
status: "OK",
|
|
38
|
+
consentId: config.consentId,
|
|
39
|
+
},
|
|
40
|
+
resp: {
|
|
41
|
+
requestId: config.requestId,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
if (config.errCode) {
|
|
45
|
+
body.error = {
|
|
46
|
+
code: config.errCode,
|
|
47
|
+
message: config.errMessage || "Error occured",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const res = yield new request_1.default().request({
|
|
51
|
+
headers: headers,
|
|
52
|
+
method: "POST",
|
|
53
|
+
requestBody: body,
|
|
54
|
+
url: url,
|
|
55
|
+
});
|
|
56
|
+
console.log(res);
|
|
57
|
+
yield new request_1.default().request({
|
|
58
|
+
headers: headers,
|
|
59
|
+
method: "POST",
|
|
60
|
+
requestBody: body,
|
|
61
|
+
url: devurl,
|
|
62
|
+
});
|
|
63
|
+
return body;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.log(error);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.default = ConsentFlow;
|
|
72
|
+
//# sourceMappingURL=consent-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent-flow.js","sourceR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,OAAO,EAAE,OAAO;oBAChB,MAAM,EAAE,MAAM;oBACd,WAAW,EAAE,IAAI;oBACjB,GAAG,EAAE,MAAM;iBACZ,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC;aACX;YAAC,OAAO,KAAK,EAAE;gBAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;aACf;QAEH,CAAC,CAAA,CAAC;IA5DF,CAAC;CA6DF;AAhED,8BAgEC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Header from "./header";
|
|
2
|
+
export default class Discovery extends Header {
|
|
3
|
+
constructor(_baseUrl: string, _accessToken: string);
|
|
4
|
+
/**
|
|
5
|
+
* Result of patient care-context discovery request at HIP end. If a matching patient found with zero or more care contexts associated, it is specified as result attribute. If the prior discovery request, resulted in errors then it is specified in the error attribute. Reasons of errors can be
|
|
6
|
+
* @param config body
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
onDiscovery: (config: {
|
|
10
|
+
transactionId: string;
|
|
11
|
+
patientReferenceNumber: string;
|
|
12
|
+
patientDisplay: string;
|
|
13
|
+
careContexts: {
|
|
14
|
+
referenceNumber: string;
|
|
15
|
+
display: string;
|
|
16
|
+
}[];
|
|
17
|
+
matchedBy: string[];
|
|
18
|
+
errCode?: string;
|
|
19
|
+
errMessage?: string;
|
|
20
|
+
requestId: string;
|
|
21
|
+
healthId: string;
|
|
22
|
+
}) => Promise<any>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/classes/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM;gBAC/B,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAGlD;;;;OAIG;IACH,WAAW,WAAkB;QAC3B,aAAa,EAAE,MAAM,CAAC;QACtB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE;YAAE,eAAe,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC7D,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,kBAoDC;CACH"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const header_1 = __importDefault(require("./header"));
|
|
16
|
+
const uuid_1 = require("uuid");
|
|
17
|
+
const request_1 = __importDefault(require("./request"));
|
|
18
|
+
class Discovery extends header_1.default {
|
|
19
|
+
constructor(_baseUrl, _accessToken) {
|
|
20
|
+
super(_baseUrl, _accessToken);
|
|
21
|
+
/**
|
|
22
|
+
* Result of patient care-context discovery request at HIP end. If a matching patient found with zero or more care contexts associated, it is specified as result attribute. If the prior discovery request, resulted in errors then it is specified in the error attribute. Reasons of errors can be
|
|
23
|
+
* @param config body
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
this.onDiscovery = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const headers = this.headers(config.healthId);
|
|
28
|
+
const url = `${this.baseUrl}gateway/v0.5/care-contexts/on-discover`;
|
|
29
|
+
// const phrurl =
|
|
30
|
+
// "https://phrdev.ndhm.gov.in/gateway/v0.5/care-contexts/on-discover";
|
|
31
|
+
// const devurl = `https://webhook.site/2bbc9a81-e5ec-4555-bb83-c211974df004/gateway/v0.5/care-contexts/on-discover`;
|
|
32
|
+
const body = {
|
|
33
|
+
requestId: (0, uuid_1.v4)(),
|
|
34
|
+
timestamp: new Date().toISOString(),
|
|
35
|
+
transactionId: config.transactionId,
|
|
36
|
+
patient: {
|
|
37
|
+
referenceNumber: config.patientReferenceNumber,
|
|
38
|
+
display: config.patientDisplay,
|
|
39
|
+
careContexts: config.careContexts,
|
|
40
|
+
matchedBy: config.matchedBy,
|
|
41
|
+
},
|
|
42
|
+
resp: {
|
|
43
|
+
requestId: config.requestId,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
if (config.errCode) {
|
|
47
|
+
body.error = {
|
|
48
|
+
code: config.errCode,
|
|
49
|
+
message: config.errMessage || "Error occured",
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
yield new request_1.default().request({
|
|
53
|
+
headers: headers,
|
|
54
|
+
method: "POST",
|
|
55
|
+
requestBody: body,
|
|
56
|
+
url: url,
|
|
57
|
+
});
|
|
58
|
+
// await new Request().request({
|
|
59
|
+
// headers: headers,
|
|
60
|
+
// method: "POST",
|
|
61
|
+
// requestBody: body,
|
|
62
|
+
// url: phrurl,
|
|
63
|
+
// });
|
|
64
|
+
// await new Request().request({
|
|
65
|
+
// headers: headers,
|
|
66
|
+
// method: "POST",
|
|
67
|
+
// requestBody: body,
|
|
68
|
+
// url: devurl,
|
|
69
|
+
// });
|
|
70
|
+
return body;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.default = Discovery;
|
|
75
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/classes/discovery.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,+BAAoC;AACpC,wDAAgC;AAEhC,MAAqB,SAAU,SAAQ,gBAAM;IAC3C,YAAY,QAAgB,EAAE,YAAoB;QAChD,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEhC;;;;WAIG;QACH,gBAAW,GAAG,CAAO,MAUpB,EAAE,EAAE;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,wCAAwC,CAAC;YACpE,iBAAiB;YACjB,uEAAuE;YACvE,qHAAqH;YACrH,MAAM,IAAI,GAAQ;gBAChB,SAAS,EAAE,IAAA,SAAM,GAAE;gBACnB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACnC,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,OAAO,EAAE;oBACP,eAAe,EAAE,MAAM,CAAC,sBAAsB;oBAC9C,OAAO,EAAE,MAAM,CAAC,cAAc;oBAC9B,YAAY,EAAE,MAAM,CAAC,YAAY;oBACjC,SAAS,EAAE,MAAM,CAAC,SAAS;iBAC5B;gBAED,IAAI,EAAE;oBACJ,SAAS,EAAE,MAAM,CAAC,SAAS;iBAC5B;aACF,CAAC;YACF,IAAI,MAAM,CAAC,OAAO,EAAE;gBAClB,IAAI,CAAC,KAAK,GAAG;oBACX,IAAI,EAAE,MAAM,CAAC,OAAO;oBACpB,OAAO,EAAE,MAAM,CAAC,UAAU,IAAI,eAAe;iBAC9C,CAAC;aACH;YAED,MAAM,IAAI,iBAAO,EAAE,CAAC,OAAO,CAAC;gBAC1B,OAAO,EAAE,OAAO;gBAChB,MAAM,EAAE,MAAM;gBACd,WAAW,EAAE,IAAI;gBACjB,GAAG,EAAE,GAAG;aACT,CAAC,CAAC;YAEH,gCAAgC;YAChC,sBAAsB;YACtB,oBAAoB;YACpB,uBAAuB;YACvB,iBAAiB;YACjB,MAAM;YAIN,gCAAgC;YAChC,sBAAsB;YACtB,oBAAoB;YACpB,uBAAuB;YACvB,iBAAiB;YACjB,MAAM;YAEN,OAAO,IAAI,CAAC;QACd,CAAC,CAAA,CAAC;IApEF,CAAC;CAqEF;AAxED,4BAwEC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default class Header {
|
|
2
|
+
/**
|
|
3
|
+
* this is request url for gateway consent manger
|
|
4
|
+
*/
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
/**
|
|
7
|
+
* cmid header in request
|
|
8
|
+
*/
|
|
9
|
+
xCmId: string;
|
|
10
|
+
/**
|
|
11
|
+
* actual header object in request
|
|
12
|
+
*/
|
|
13
|
+
private headersObject;
|
|
14
|
+
/**
|
|
15
|
+
* access token form client id and client token
|
|
16
|
+
*/
|
|
17
|
+
protected accessToken: string;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param baseUrl this is gateway url for sendng request
|
|
21
|
+
* @param _accessToken dervied from cleant is and client secret
|
|
22
|
+
*/
|
|
23
|
+
constructor(baseUrl: string, _accessToken: string);
|
|
24
|
+
/**
|
|
25
|
+
* header is reset from class wide variables set
|
|
26
|
+
* i.e accessToken and xCmId:
|
|
27
|
+
*/
|
|
28
|
+
headers(healthId: string): any;
|
|
29
|
+
/**
|
|
30
|
+
* This sets the cmid from healthid
|
|
31
|
+
* @param healthId healthid with CM id has ro passed
|
|
32
|
+
*/
|
|
33
|
+
setXCmId(healthId: string): void;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @returns this tbase url of class
|
|
37
|
+
*/
|
|
38
|
+
getBaseUrl(): string;
|
|
39
|
+
getXCmId(): string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/classes/header.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB;;OAEG;IAEI,OAAO,EAAE,MAAM,CAAE;IACxB;;OAEG;IACI,KAAK,EAAE,MAAM,CAAM;IAE1B;;OAEG;IACH,OAAO,CAAC,aAAa,CAAM;IAC3B;;OAEG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAKjD;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG;IAU9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAKzB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// import { X_CM_ID } from "./config";
|
|
4
|
+
class Header {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param baseUrl this is gateway url for sendng request
|
|
8
|
+
* @param _accessToken dervied from cleant is and client secret
|
|
9
|
+
*/
|
|
10
|
+
constructor(baseUrl, _accessToken) {
|
|
11
|
+
/**
|
|
12
|
+
* cmid header in request
|
|
13
|
+
*/
|
|
14
|
+
this.xCmId = "";
|
|
15
|
+
/**
|
|
16
|
+
* actual header object in request
|
|
17
|
+
*/
|
|
18
|
+
this.headersObject = {};
|
|
19
|
+
this.accessToken = _accessToken;
|
|
20
|
+
this.baseUrl = baseUrl;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* header is reset from class wide variables set
|
|
24
|
+
* i.e accessToken and xCmId:
|
|
25
|
+
*/
|
|
26
|
+
headers(healthId) {
|
|
27
|
+
this.setXCmId(healthId);
|
|
28
|
+
this.headersObject = {
|
|
29
|
+
"Content-Type": "application/json",
|
|
30
|
+
Authorization: `Bearer ${this.accessToken}`,
|
|
31
|
+
"X-CM-ID": this.xCmId,
|
|
32
|
+
};
|
|
33
|
+
return this.headersObject;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* This sets the cmid from healthid
|
|
37
|
+
* @param healthId healthid with CM id has ro passed
|
|
38
|
+
*/
|
|
39
|
+
setXCmId(healthId) {
|
|
40
|
+
let index = healthId.lastIndexOf("@");
|
|
41
|
+
this.xCmId = healthId.substring(index + 1);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @returns this tbase url of class
|
|
46
|
+
*/
|
|
47
|
+
getBaseUrl() {
|
|
48
|
+
return this.baseUrl;
|
|
49
|
+
}
|
|
50
|
+
getXCmId() {
|
|
51
|
+
return this.xCmId;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.default = Header;
|
|
55
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/classes/header.ts"],"names":[],"mappings":";;AAAA,sCAAsC;AACtC,MAAqB,MAAM;IAoBzB;;;;OAIG;IACH,YAAY,OAAe,EAAE,YAAoB;QAnBjD;;WAEG;QACI,UAAK,GAAW,EAAE,CAAC;QAE1B;;WAEG;QACK,kBAAa,GAAG,EAAE,CAAC;QAYzB,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,QAAgB;QACtB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG;YACnB,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;YAC3C,SAAS,EAAE,IAAI,CAAC,KAAK;SACtB,CAAC;QACF,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAgB;QACvB,IAAI,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAhED,yBAgEC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import Header from "./header";
|
|
2
|
+
declare type HI_TYPES = "OPConsultation" | "DiagnosticReport" | "Prescription" | "ImmunizationRecord" | "DischargeSummary" | "HealthDocumentRecord" | "WellnessRecord";
|
|
3
|
+
export default class Link extends Header {
|
|
4
|
+
constructor(_baseUrl: string, _accessToken: string);
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param config healthis with Xcmid
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
AddContext: (config: {
|
|
11
|
+
healthId: string;
|
|
12
|
+
careContextAccessToken: string;
|
|
13
|
+
patientId: string;
|
|
14
|
+
patinetDisplay: string;
|
|
15
|
+
careContextId: string;
|
|
16
|
+
careContextDisplay: string;
|
|
17
|
+
}) => Promise<{
|
|
18
|
+
requestId: string;
|
|
19
|
+
timestamp: string;
|
|
20
|
+
link: {
|
|
21
|
+
accessToken: string;
|
|
22
|
+
patient: {
|
|
23
|
+
referenceNumber: string;
|
|
24
|
+
display: string;
|
|
25
|
+
careContexts: {
|
|
26
|
+
referenceNumber: string;
|
|
27
|
+
display: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Result of patient care-context link request from HIP end. This happens in context of previous discovery of patient found at HIP end, therefore the link requests ought to be in reference to the patient reference and care-context references previously returned by the HIP. The correlation of discovery and link request is maintained through the transactionId. HIP should have
|
|
34
|
+
* @param config
|
|
35
|
+
*
|
|
36
|
+
* Validated transactionId in the request to check whether there was a discovery done previously, and the link request corresponds to returned patient care care context references
|
|
37
|
+
Before returning the response, HIP should have sent an authentication request to the patient(eg: OTP verification)
|
|
38
|
+
HIP should communicate the mode of authentication of a successful request
|
|
39
|
+
HIP subsequently should expect the token passed via /link/confirm against the link.referenceNumber passed in this call
|
|
40
|
+
The error section in the body, represents the potential errors that may have occurred. Possible reasons:
|
|
41
|
+
|
|
42
|
+
Patient reference number is invalid
|
|
43
|
+
Care context reference numbers are invalid
|
|
44
|
+
*/
|
|
45
|
+
onInit: (config: {
|
|
46
|
+
healthId: string;
|
|
47
|
+
transactionId: string;
|
|
48
|
+
referenceNumber: string;
|
|
49
|
+
communicationHint: string;
|
|
50
|
+
communicationExpiry?: string;
|
|
51
|
+
requestId: string;
|
|
52
|
+
error?: {
|
|
53
|
+
code: number;
|
|
54
|
+
message: string;
|
|
55
|
+
};
|
|
56
|
+
}) => Promise<any>;
|
|
57
|
+
/***
|
|
58
|
+
* Returns a list of linked care contexts with patient reference number.
|
|
59
|
+
Validated and linked account reference number
|
|
60
|
+
Validated that the token sent from Consent Manager is same as the one generated by HIP
|
|
61
|
+
Verified that same Consent Manager which made the link request is sending the token
|
|
62
|
+
Results of unmasked linked care contexts with patient reference number
|
|
63
|
+
*/
|
|
64
|
+
onConfirm: (config: {
|
|
65
|
+
healthId: string;
|
|
66
|
+
careContextAccessToken: string;
|
|
67
|
+
requestId: string;
|
|
68
|
+
patientReferenceNumber: string;
|
|
69
|
+
patinetDisplay: string;
|
|
70
|
+
careContexts: {
|
|
71
|
+
referenceNumber: string;
|
|
72
|
+
display: string;
|
|
73
|
+
}[];
|
|
74
|
+
error?: {
|
|
75
|
+
code: number;
|
|
76
|
+
message: string;
|
|
77
|
+
};
|
|
78
|
+
}) => Promise<any>;
|
|
79
|
+
/**
|
|
80
|
+
*This API is called by HIP only when there is new health data is added/created for a patient and under a care context that is already linked with patient's Health Account. HIP can send following things in this API to notify the Consent Manager about the new health data added:
|
|
81
|
+
* @param config
|
|
82
|
+
* @healthId Patient's Identifier for which the new health data is added (It can be ABDM address or phr address)
|
|
83
|
+
* @careContextReference Care Context reference under which the new health data is added
|
|
84
|
+
* @patientReference Patient's reference (An identifier with which the patient is registered on HIP)
|
|
85
|
+
* @hiTypes Types of health information documents that have been added ("DiagnosticReportRecord" | "DischargeSummaryRecord" | "HealthDocumentRecord" | "ImmunizationRecord" | "OPConsultRecord" | "PrescriptionRecord" | "WellnessRecord")
|
|
86
|
+
* @date in iso format at UTC A date when the health information was created/added on the HIP Note: This API shouldn't be called if the new heath data of is added/created under new care context.
|
|
87
|
+
*/
|
|
88
|
+
notify: (config: {
|
|
89
|
+
healthId: string;
|
|
90
|
+
patientReference: any;
|
|
91
|
+
careContextReference: any;
|
|
92
|
+
hiTypes: HI_TYPES[];
|
|
93
|
+
date: string;
|
|
94
|
+
hipId: string;
|
|
95
|
+
}) => Promise<{
|
|
96
|
+
requestId: string;
|
|
97
|
+
timestamp: string;
|
|
98
|
+
notification: {
|
|
99
|
+
patient: {
|
|
100
|
+
id: string;
|
|
101
|
+
};
|
|
102
|
+
careContext: {
|
|
103
|
+
patientReference: any;
|
|
104
|
+
careContextReference: any;
|
|
105
|
+
};
|
|
106
|
+
hiTypes: HI_TYPES[];
|
|
107
|
+
date: string;
|
|
108
|
+
hip: {
|
|
109
|
+
id: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMapping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