ndhm-hrp 2.1.43 → 2.1.44

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.
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ndhm-hrp",
3
- "version": "2.1.43",
3
+ "version": "2.1.44",
4
4
  "description": "This is ndhm-hpr",
5
5
  "main": "lib/index.js",
6
6
  "directories": {