ndhm-hrp 2.1.69 → 2.1.70
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/patients.d.ts +23 -0
- package/lib/classes/patients.d.ts.map +1 -0
- package/lib/classes/patients.js +67 -0
- package/lib/classes/patients.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Header from "./header";
|
|
2
|
+
export default class Patients 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
|
+
smsNotify2: (config: {
|
|
12
|
+
healthId: "unknown@sbx" | "unknown@abdm";
|
|
13
|
+
phoneNo: string;
|
|
14
|
+
patientName?: string;
|
|
15
|
+
careContextInfo: string;
|
|
16
|
+
deeplinkUrl?: string;
|
|
17
|
+
facilityName?: string;
|
|
18
|
+
hipid: string;
|
|
19
|
+
errCode?: string;
|
|
20
|
+
errMessage?: string;
|
|
21
|
+
}) => Promise<any>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=patients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patients.d.ts","sourceRoot":"","sources":["../../src/classes/patients.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM;gBAC9B,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAGlD;;;;;;OAMG;IACH,UAAU,WAAkB;QAC1B,QAAQ,EAAG,aAAa,GAAG,cAAc,CAAA;QACzC,OAAO,EAAC,MAAM,CAAA;QACd,WAAW,CAAC,EAAC,MAAM,CAAA;QACnB,eAAe,EAAC,MAAM,CAAA;QACtB,WAAW,CAAC,EAAC,MAAM,CAAA;QACnB,YAAY,CAAC,EAAC,MAAM,CAAA;QACpB,KAAK,EAAC,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,kBAyCC;CASH"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 Patients 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.smsNotify2 = (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/patients/sms/notify2`;
|
|
32
|
+
const body = {
|
|
33
|
+
requestId: (0, uuid_1.v4)(),
|
|
34
|
+
timestamp: new Date().toISOString(),
|
|
35
|
+
"notification": {
|
|
36
|
+
"phoneNo": config.phoneNo,
|
|
37
|
+
"receiverName": config.patientName,
|
|
38
|
+
"careContextInfo": config.careContextInfo,
|
|
39
|
+
"deeplinkUrl": config.deeplinkUrl,
|
|
40
|
+
"hip": {
|
|
41
|
+
"name": config.facilityName,
|
|
42
|
+
"id": config.hipid
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
if (config.errCode) {
|
|
47
|
+
body.error = {
|
|
48
|
+
code: config.errCode,
|
|
49
|
+
message: config.errMessage || "Error occured",
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const res = yield new request_1.default().request({
|
|
53
|
+
headers: headers,
|
|
54
|
+
method: "POST",
|
|
55
|
+
requestBody: body,
|
|
56
|
+
url: url,
|
|
57
|
+
});
|
|
58
|
+
return body;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.log(error);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.default = Patients;
|
|
67
|
+
//# sourceMappingURL=patients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patients.js","sourceRoot":"","sources":["../../src/classes/patients.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,+BAAoC;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AAC,CAAA,CAAC;IA3DF,CAAC;CAoEF;AAvED,2BAuEC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import ConsentFlow from "./classes/consent-flow";
|
|
|
6
6
|
import Profile from "./classes/profile";
|
|
7
7
|
import AbhaNumber from "./classes/abha";
|
|
8
8
|
import DataFlow from "./classes/data-flow";
|
|
9
|
+
import Patients from "./classes/patients";
|
|
9
10
|
import HealthInformation, { STATUS_RESPONSES_HEALTH_INFORMATION_NOTIFY } from "./classes/health-information";
|
|
10
11
|
import ConsentRequest, { PurposeArray, CONSENTFLOW_REQUEST_INIT } from "./classes/consent-request";
|
|
11
|
-
export { Register, UserAuth, Link, Discovery, ConsentFlow, Profile, AbhaNumber, DataFlow, HealthInformation, STATUS_RESPONSES_HEALTH_INFORMATION_NOTIFY, ConsentRequest, PurposeArray, CONSENTFLOW_REQUEST_INIT };
|
|
12
|
+
export { Register, UserAuth, Link, Discovery, ConsentFlow, Profile, AbhaNumber, DataFlow, HealthInformation, STATUS_RESPONSES_HEALTH_INFORMATION_NOTIFY, ConsentRequest, Patients, PurposeArray, CONSENTFLOW_REQUEST_INIT };
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,UAAU,MAAM,gBAAgB,CAAC;AACxC,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,iBAAiB,EAAE,EAAC,0CAA0C,EAAC,MAAM,8BAA8B,CAAC;AAC3G,OAAO,cAAc,EAAE,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,2BAA2B,CAAC;AAEjG,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,EACX,OAAO,EACP,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,0CAA0C,EAC1C,cAAc,EACd,YAAY,EACZ,wBAAwB,EACzB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,UAAU,MAAM,gBAAgB,CAAC;AACxC,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,iBAAiB,EAAE,EAAC,0CAA0C,EAAC,MAAM,8BAA8B,CAAC;AAC3G,OAAO,cAAc,EAAE,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,2BAA2B,CAAC;AAEjG,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,EACX,OAAO,EACP,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,0CAA0C,EAC1C,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,wBAAwB,EACzB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.PurposeArray = exports.ConsentRequest = exports.HealthInformation = exports.DataFlow = exports.AbhaNumber = exports.Profile = exports.ConsentFlow = exports.Discovery = exports.Link = exports.UserAuth = exports.Register = void 0;
|
|
25
|
+
exports.PurposeArray = exports.Patients = exports.ConsentRequest = exports.HealthInformation = exports.DataFlow = exports.AbhaNumber = exports.Profile = exports.ConsentFlow = exports.Discovery = exports.Link = exports.UserAuth = exports.Register = void 0;
|
|
26
26
|
const register_1 = __importDefault(require("./classes/register"));
|
|
27
27
|
exports.Register = register_1.default;
|
|
28
28
|
const userAuth_1 = __importDefault(require("./classes/userAuth"));
|
|
@@ -39,6 +39,8 @@ const abha_1 = __importDefault(require("./classes/abha"));
|
|
|
39
39
|
exports.AbhaNumber = abha_1.default;
|
|
40
40
|
const data_flow_1 = __importDefault(require("./classes/data-flow"));
|
|
41
41
|
exports.DataFlow = data_flow_1.default;
|
|
42
|
+
const patients_1 = __importDefault(require("./classes/patients"));
|
|
43
|
+
exports.Patients = patients_1.default;
|
|
42
44
|
const health_information_1 = __importDefault(require("./classes/health-information"));
|
|
43
45
|
exports.HealthInformation = health_information_1.default;
|
|
44
46
|
const consent_request_1 = __importStar(require("./classes/consent-request"));
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAA0C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAA0C;AAaxC,mBAbK,kBAAQ,CAaL;AAZV,kEAA0C;AAaxC,mBAbK,kBAAQ,CAaL;AAZV,0DAAkC;AAahC,eAbK,cAAI,CAaL;AAZN,oEAA4C;AAa1C,oBAbK,mBAAS,CAaL;AAZX,0EAAiD;AAa/C,sBAbK,sBAAW,CAaL;AAZb,gEAAwC;AAatC,kBAbK,iBAAO,CAaL;AAZT,0DAAwC;AAatC,qBAbK,cAAU,CAaL;AAZZ,oEAA2C;AAazC,mBAbK,mBAAQ,CAaL;AAZV,kEAA0C;AAgBxC,mBAhBK,kBAAQ,CAgBL;AAfV,sFAA2G;AAYzG,4BAZK,4BAAiB,CAYL;AAXnB,6EAAiG;AAa/F,yBAbK,yBAAc,CAaL;AAEd,6FAfsB,8BAAY,OAetB"}
|