ndhm-hrp 2.1.43 → 2.1.46
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/profile.d.ts +16 -0
- package/lib/classes/profile.d.ts.map +1 -0
- package/lib/classes/profile.js +57 -0
- package/lib/classes/profile.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,16 @@
|
|
|
1
|
+
import Header from "./header";
|
|
2
|
+
export default class Profile 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
|
+
onProfile: (config: {
|
|
10
|
+
errCode?: string;
|
|
11
|
+
errMessage?: string;
|
|
12
|
+
requestId: string;
|
|
13
|
+
healthId: string;
|
|
14
|
+
}) => Promise<any>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/classes/profile.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,MAAM;gBAC7B,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAGlD;;;;OAIG;IACH,SAAS,WAAkB;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,kBA6BC;CACH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 Profile 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.onProfile = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const headers = this.headers(config.healthId);
|
|
28
|
+
const url = `${this.baseUrl}gateway/v0.5/patients/profile/on-share`;
|
|
29
|
+
const body = {
|
|
30
|
+
requestId: (0, uuid_1.v4)(),
|
|
31
|
+
timestamp: new Date().toISOString(),
|
|
32
|
+
acknowledgement: {
|
|
33
|
+
status: "SUCCESS",
|
|
34
|
+
healthId: config.healthId,
|
|
35
|
+
},
|
|
36
|
+
resp: {
|
|
37
|
+
requestId: config.requestId,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
if (config.errCode) {
|
|
41
|
+
body.error = {
|
|
42
|
+
code: config.errCode,
|
|
43
|
+
message: config.errMessage || "Error occured",
|
|
44
|
+
};
|
|
45
|
+
yield new request_1.default().request({
|
|
46
|
+
headers: headers,
|
|
47
|
+
method: "POST",
|
|
48
|
+
requestBody: body,
|
|
49
|
+
url: url,
|
|
50
|
+
});
|
|
51
|
+
return body;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = Profile;
|
|
57
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/classes/profile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,+BAAoC;AACpC,wDAAgC;AAEhC,MAAqB,OAAQ,SAAQ,gBAAM;IACzC,YAAY,QAAgB,EAAE,YAAoB;QAChD,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEhC;;;;WAIG;QACH,cAAS,GAAG,CAAO,MAKlB,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,MAAM,IAAI,GAAQ;gBAChB,SAAS,EAAE,IAAA,SAAM,GAAE;gBACnB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACnC,eAAe,EAAE;oBACf,MAAM,EAAE,SAAS;oBACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;iBAC1B;gBACD,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;gBAEF,MAAM,IAAI,iBAAO,EAAE,CAAC,OAAO,CAAC;oBAC1B,OAAO,EAAE,OAAO;oBAChB,MAAM,EAAE,MAAM;oBACd,WAAW,EAAE,IAAI;oBACjB,GAAG,EAAE,GAAG;iBACT,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC;aACb;QACH,CAAC,CAAA,CAAC;IAxCF,CAAC;CAyCF;AA5CD,0BA4CC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ import UserAuth from "./classes/userAuth";
|
|
|
3
3
|
import Link from "./classes/link";
|
|
4
4
|
import Discovery from "./classes/discovery";
|
|
5
5
|
import ConsentFlow from "./classes/consent-flow";
|
|
6
|
-
|
|
6
|
+
import Profile from "./classes/profile";
|
|
7
|
+
export { Register, UserAuth, Link, Discovery, ConsentFlow, Profile };
|
|
7
8
|
//# 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;
|
|
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;AAExC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ConsentFlow = exports.Discovery = exports.Link = exports.UserAuth = exports.Register = void 0;
|
|
6
|
+
exports.Profile = exports.ConsentFlow = exports.Discovery = exports.Link = exports.UserAuth = exports.Register = void 0;
|
|
7
7
|
const register_1 = __importDefault(require("./classes/register"));
|
|
8
8
|
exports.Register = register_1.default;
|
|
9
9
|
const userAuth_1 = __importDefault(require("./classes/userAuth"));
|
|
@@ -14,4 +14,6 @@ const discovery_1 = __importDefault(require("./classes/discovery"));
|
|
|
14
14
|
exports.Discovery = discovery_1.default;
|
|
15
15
|
const consent_flow_1 = __importDefault(require("./classes/consent-flow"));
|
|
16
16
|
exports.ConsentFlow = consent_flow_1.default;
|
|
17
|
+
const profile_1 = __importDefault(require("./classes/profile"));
|
|
18
|
+
exports.Profile = profile_1.default;
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
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;AAOjC,mBAPF,kBAAQ,CAOE;AANjB,kEAA0C;AAMvB,mBANZ,kBAAQ,CAMY;AAL3B,0DAAkC;AAKL,eALtB,cAAI,CAKsB;AAJjC,oEAA4C;AAIT,oBAJ5B,mBAAS,CAI4B;AAH5C,0EAAiD;AAGH,sBAHvC,sBAAW,CAGuC;AAFzD,gEAAwC;AAEmB,kBAFpD,iBAAO,CAEoD"}
|