ndhm-hrp 2.1.52 → 2.1.55

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.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/lib/classes/abha.d.ts +0 -61
  3. package/lib/classes/abha.d.ts.map +0 -1
  4. package/lib/classes/abha.js +0 -98
  5. package/lib/classes/abha.js.map +0 -1
  6. package/lib/classes/consent-flow.d.ts +0 -19
  7. package/lib/classes/consent-flow.d.ts.map +0 -1
  8. package/lib/classes/consent-flow.js +0 -72
  9. package/lib/classes/consent-flow.js.map +0 -1
  10. package/lib/classes/discovery.d.ts +0 -24
  11. package/lib/classes/discovery.d.ts.map +0 -1
  12. package/lib/classes/discovery.js +0 -75
  13. package/lib/classes/discovery.js.map +0 -1
  14. package/lib/classes/header.d.ts +0 -41
  15. package/lib/classes/header.d.ts.map +0 -1
  16. package/lib/classes/header.js +0 -59
  17. package/lib/classes/header.js.map +0 -1
  18. package/lib/classes/link.d.ts +0 -115
  19. package/lib/classes/link.d.ts.map +0 -1
  20. package/lib/classes/link.js +0 -180
  21. package/lib/classes/link.js.map +0 -1
  22. package/lib/classes/profile.d.ts +0 -16
  23. package/lib/classes/profile.d.ts.map +0 -1
  24. package/lib/classes/profile.js +0 -64
  25. package/lib/classes/profile.js.map +0 -1
  26. package/lib/classes/register.d.ts +0 -38
  27. package/lib/classes/register.d.ts.map +0 -1
  28. package/lib/classes/register.js +0 -87
  29. package/lib/classes/register.js.map +0 -1
  30. package/lib/classes/request.d.ts +0 -9
  31. package/lib/classes/request.d.ts.map +0 -1
  32. package/lib/classes/request.js +0 -39
  33. package/lib/classes/request.js.map +0 -1
  34. package/lib/classes/userAuth.d.ts +0 -50
  35. package/lib/classes/userAuth.d.ts.map +0 -1
  36. package/lib/classes/userAuth.js +0 -91
  37. package/lib/classes/userAuth.js.map +0 -1
  38. package/lib/index.d.ts +0 -9
  39. package/lib/index.d.ts.map +0 -1
  40. package/lib/index.js +0 -21
  41. package/lib/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ndhm-hrp",
3
- "version": "2.1.52",
3
+ "version": "2.1.55",
4
4
  "description": "This is ndhm-hpr",
5
5
  "main": "lib/index.js",
6
6
  "directories": {
@@ -1,61 +0,0 @@
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
- mobileNumber: string;
14
- txnId: string;
15
- }>;
16
- generateMobileOtp: (mobile: string, txnId: string) => Promise<{
17
- mobileNumber: string;
18
- txnId: string;
19
- }>;
20
- verifyMobileOtp: (otp: string, txnId: string) => Promise<{
21
- mobileNumber: string;
22
- txnId: string;
23
- }>;
24
- createHealthIdWithPreVerified: (options: {
25
- email?: string;
26
- firstName?: string;
27
- healthId: string;
28
- lastName?: string;
29
- middleName?: string;
30
- password: string;
31
- profilePhoto?: string;
32
- txnId: string;
33
- }) => Promise<{
34
- authMethods: ["AADHAAR_OTP"];
35
- dayOfBirth: string;
36
- districtCode: string;
37
- districtName: string;
38
- email: string;
39
- firstName: string;
40
- gender: string;
41
- healthId: string;
42
- healthIdNumber: string;
43
- kycPhoto: string;
44
- lastName: string;
45
- middleName: string;
46
- mobile: string;
47
- monthOfBirth: string;
48
- name: string;
49
- new: true;
50
- stateCode: string;
51
- stateName: string;
52
- tags: {
53
- additionalProp1: string;
54
- additionalProp2: string;
55
- additionalProp3: string;
56
- };
57
- token: string;
58
- yearOfBirth: string;
59
- }>;
60
- }
61
- //# sourceMappingURL=abha.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abha.d.ts","sourceRoot":"","sources":["../../src/classes/abha.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO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M,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"}
@@ -1,98 +0,0 @@
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(JSON.stringify(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(JSON.stringify(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(JSON.stringify(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(JSON.stringify(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(JSON.stringify(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
@@ -1 +0,0 @@
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,CAAC;YACtE,MAAM,IAAI,GAAG;gBACX,OAAO,EAAE,OAAO;aACjB,CAAC;YAEF,MAAM,GAAG,GAAG,MAAM,IAAI,iBAAO,EAAE,CAAC,OAAO,CAAC;gBACtC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,MAAM;gBACd,WAAW,EAAE,IAAI;gBACjB,GAAG,EAAE,GAAG;aACT,CAAC,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAA,CAAC;QAEF,oBAAe,GAAG,CAAO,OAIxB,EAGE,EAAE;YACH,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,oCAAoC,CAAC;YAEpE,MAAM,IAAI,GAAG;gBACX,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC;YAEF,MAAM,GAAG,GAAG,MAAM,IAAI,iBAAO,EAAE,CAAC,OAAO,CAAC;gBACtC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,MAAM;gBACd,WAAW,EAAE,IAAI;gBACjB,GAAG,EA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AAE,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,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAA,CAAC;QAEF,kCAA6B,GAAG,CAAO,OAStC,EA0BE,EAAE;YACH,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,wDAAwD,CAAC;YAExF,MAAM,IAAI,GAAG,OAAO,CAAC;YAErB,MAAM,GAAG,GAAG,MAAM,IAAI,iBAAO,EAAE,CAAC,OAAO,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,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAA,CAAC;QAzJA,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;CAqJF;AA/JD,6BA+JC"}
@@ -1,19 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,72 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"consent-flow.js","sourceRoot":"","sources":["../../src/classes/consent-flow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,+BAAoC;AACpC,wDAAgC;AAEhC,MAAqB,WAAY,SAAQ,gBAAM;IAC7C,YAAY,QAAgB,EAAE,YAAoB;QAChD,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEhC;;;;;;WAMG;QACH,gBAAW,GAAG,CAAO,MAMpB,EAAE,EAAE;YACH,IAAI;gBACF,MAAM,OAAO,GAAG,IAAI,CAAC,OA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
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
@@ -1 +0,0 @@
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"}
@@ -1,75 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,41 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/classes/header.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB;;OAEG;IACI,OAAO,EAAE,MAAM,CAA8B;IACpD;;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"}
@@ -1,59 +0,0 @@
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
- * this is request url for gateway consent manger
13
- */
14
- this.baseUrl = "https://dev.abdm.gov.in/";
15
- /**
16
- * cmid header in request
17
- */
18
- this.xCmId = "";
19
- /**
20
- * actual header object in request
21
- */
22
- this.headersObject = {};
23
- this.accessToken = _accessToken;
24
- this.baseUrl = baseUrl;
25
- }
26
- /**
27
- * header is reset from class wide variables set
28
- * i.e accessToken and xCmId:
29
- */
30
- headers(healthId) {
31
- this.setXCmId(healthId);
32
- this.headersObject = {
33
- "Content-Type": "application/json",
34
- Authorization: `Bearer ${this.accessToken}`,
35
- "X-CM-ID": this.xCmId,
36
- };
37
- return this.headersObject;
38
- }
39
- /**
40
- * This sets the cmid from healthid
41
- * @param healthId healthid with CM id has ro passed
42
- */
43
- setXCmId(healthId) {
44
- let index = healthId.lastIndexOf("@");
45
- this.xCmId = healthId.substring(index + 1);
46
- }
47
- /**
48
- *
49
- * @returns this tbase url of class
50
- */
51
- getBaseUrl() {
52
- return this.baseUrl;
53
- }
54
- getXCmId() {
55
- return this.xCmId;
56
- }
57
- }
58
- exports.default = Header;
59
- //# sourceMappingURL=header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/classes/header.ts"],"names":[],"mappings":";;AAAA,sCAAsC;AACtC,MAAqB,MAAM;IAmBzB;;;;OAIG;IACH,YAAY,OAAe,EAAE,YAAoB;QAvBjD;;WAEG;QACI,YAAO,GAAW,0BAA0B,CAAC;QACpD;;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;AA/DD,yBA+DC"}
@@ -1,115 +0,0 @@
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
- //# sourceMappingURL=link.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/classes/link.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,aAAK,QAAQ,GACT,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,oBAAoB,GACpB,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM;gBAC1B,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAIlD;;;;OAIG;IACH,UAAU,WAAkB;QAC1B,QAAQ,EAAE,MAAM,CAAC;QACjB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,SAAS,EAAE,MAAM,CAAC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