ndhm-hrp 2.1.1 → 2.1.5
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/discovery.d.ts +5 -7
- package/lib/classes/discovery.d.ts.map +1 -1
- package/lib/classes/discovery.js +23 -37
- package/lib/classes/discovery.js.map +1 -1
- package/lib/classes/link.d.ts +41 -0
- package/lib/classes/link.d.ts.map +1 -1
- package/lib/classes/link.js +40 -0
- package/lib/classes/link.js.map +1 -1
- package/lib/classes/register.d.ts +7 -1
- package/lib/classes/register.d.ts.map +1 -1
- package/lib/classes/register.js +12 -0
- package/lib/classes/register.js.map +1 -1
- package/package.json +2 -2
- package/lib/classes/patient.d.ts +0 -27
- package/lib/classes/patient.d.ts.map +0 -1
- package/lib/classes/patient.js +0 -83
- package/lib/classes/patient.js.map +0 -1
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
export default class Discovery extends Header {
|
|
3
|
-
constructor(_baseUrl: string, _accessToken: string);
|
|
1
|
+
export default class Discovery {
|
|
4
2
|
onDiscovery: (config: {
|
|
5
3
|
transactionId: string;
|
|
6
4
|
patientReferenceNumber: string;
|
|
7
5
|
patientDisplay: string;
|
|
8
6
|
careContexts: {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
referenceNumber: string;
|
|
8
|
+
display: string;
|
|
11
9
|
}[];
|
|
12
10
|
matchedBy: string[];
|
|
13
11
|
errCode: string;
|
|
14
12
|
errMessage: string;
|
|
15
13
|
requestId: string;
|
|
16
|
-
}) =>
|
|
14
|
+
}) => {
|
|
17
15
|
requestId: string;
|
|
18
16
|
timestamp: string;
|
|
19
17
|
transactionId: string;
|
|
@@ -33,6 +31,6 @@ export default class Discovery extends Header {
|
|
|
33
31
|
resp: {
|
|
34
32
|
requestId: string;
|
|
35
33
|
};
|
|
36
|
-
}
|
|
34
|
+
};
|
|
37
35
|
}
|
|
38
36
|
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/classes/discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/classes/discovery.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,SAAS;IAM5B,WAAW,WAAY;QACrB,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,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB;;;;;;;;iCALkC,MAAM;yBAAW,MAAM;;;;;;;;;;;MA2BxD;CACH"}
|
package/lib/classes/discovery.js
CHANGED
|
@@ -1,48 +1,34 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const header_1 = __importDefault(require("./header"));
|
|
16
3
|
const uuid_1 = require("uuid");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.
|
|
22
|
-
|
|
4
|
+
class Discovery {
|
|
5
|
+
constructor() {
|
|
6
|
+
// private baseUrl: string;
|
|
7
|
+
// constructor(_baseUrl: string) {
|
|
8
|
+
// this.baseUrl = _baseUrl;
|
|
9
|
+
// }
|
|
10
|
+
this.onDiscovery = (config) => {
|
|
11
|
+
// const url = `${this.baseUrl}gateway/v0.5/care-contexts/on-discover`;
|
|
23
12
|
const body = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
requestId: (0, uuid_1.v4)(),
|
|
14
|
+
timestamp: new Date().toISOString(),
|
|
15
|
+
transactionId: config.transactionId,
|
|
16
|
+
patient: {
|
|
17
|
+
referenceNumber: config.patientReferenceNumber,
|
|
18
|
+
display: config.patientDisplay,
|
|
19
|
+
careContexts: config.careContexts,
|
|
20
|
+
matchedBy: config.matchedBy,
|
|
32
21
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
error: {
|
|
23
|
+
code: config.errCode,
|
|
24
|
+
message: config.errMessage,
|
|
25
|
+
},
|
|
26
|
+
resp: {
|
|
27
|
+
requestId: config.requestId,
|
|
36
28
|
},
|
|
37
|
-
"resp": {
|
|
38
|
-
"requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
39
|
-
}
|
|
40
29
|
};
|
|
41
|
-
yield new request_1.default().request({
|
|
42
|
-
"headers": this.headers(config.patientReferenceNumber), "method": "POST", "requestBody": body, "url": url
|
|
43
|
-
});
|
|
44
30
|
return body;
|
|
45
|
-
}
|
|
31
|
+
};
|
|
46
32
|
}
|
|
47
33
|
}
|
|
48
34
|
exports.default = Discovery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/classes/discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/classes/discovery.ts"],"names":[],"mappings":";;AACA,+BAAoC;AAGpC,MAAqB,SAAS;IAA9B;QACE,2BAA2B;QAC3B,kCAAkC;QAClC,6BAA6B;QAC7B,IAAI;QAEJ,gBAAW,GAAG,CAAC,MASd,EAAE,EAAE;YACH,uEAAuE;YACvE,MAAM,IAAI,GAAG;gBACX,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;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,MAAM,CAAC,OAAO;oBACpB,OAAO,EAAE,MAAM,CAAC,UAAU;iBAC3B;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,MAAM,CAAC,SAAS;iBAC5B;aACF,CAAC;YAEF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;CAAA;AAtCD,4BAsCC"}
|
package/lib/classes/link.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import Header from "./header";
|
|
2
|
+
declare type HI_TYPES = "DiagnosticReportRecord" | "DischargeSummaryRecord" | "HealthDocumentRecord" | "ImmunizationRecord" | "OPConsultRecord" | "PrescriptionRecord" | "WellnessRecord";
|
|
2
3
|
export default class Link extends Header {
|
|
3
4
|
constructor(_baseUrl: string, _accessToken: string);
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param config healthis with Xcmid
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
4
10
|
AddContext: (config: {
|
|
5
11
|
healthId: string;
|
|
6
12
|
careContextAccessToken: string;
|
|
@@ -23,5 +29,40 @@ export default class Link extends Header {
|
|
|
23
29
|
};
|
|
24
30
|
};
|
|
25
31
|
}>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param config
|
|
35
|
+
* @healthId Patient's Identifier for which the new health data is added (It can be ABDM id or ABDM number)
|
|
36
|
+
* @careContextReference Care Context reference under which the new health data is added
|
|
37
|
+
* @patientReference Patient's reference (An identifier with which the patient is registered on HIP)
|
|
38
|
+
* @hiTypes Types of health information documents that have been added ("DiagnosticReportRecord" | "DischargeSummaryRecord" | "HealthDocumentRecord" | "ImmunizationRecord" | "OPConsultRecord" | "PrescriptionRecord" | "WellnessRecord")
|
|
39
|
+
* @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.
|
|
40
|
+
*/
|
|
41
|
+
notify: (config: {
|
|
42
|
+
healthId: string;
|
|
43
|
+
patientReference: any;
|
|
44
|
+
careContextReference: any;
|
|
45
|
+
hiTypes: HI_TYPES[];
|
|
46
|
+
date: string;
|
|
47
|
+
hipId: string;
|
|
48
|
+
}) => Promise<{
|
|
49
|
+
requestId: string;
|
|
50
|
+
timestamp: string;
|
|
51
|
+
notification: {
|
|
52
|
+
patient: {
|
|
53
|
+
id: string;
|
|
54
|
+
};
|
|
55
|
+
careContext: {
|
|
56
|
+
patientReference: any;
|
|
57
|
+
careContextReference: any;
|
|
58
|
+
};
|
|
59
|
+
hiTypes: HI_TYPES[];
|
|
60
|
+
date: string;
|
|
61
|
+
hip: {
|
|
62
|
+
id: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}>;
|
|
26
66
|
}
|
|
67
|
+
export {};
|
|
27
68
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/classes/link.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM;gBACxB,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAIlD,UAAU,WAAkB;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/classes/link.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,aAAK,QAAQ,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,sBAAsB,GAAG,oBAAoB,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,gBAAgB,CAAA;AAEjL,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM;gBACxB,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAIlD;;;;OAIG;IACH,UAAU,WAAkB;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,sBAAsB,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;OA6B7K;IACD;;;;;;;;OAQG;IAEH,MAAM,WAAkB;QACpB,QAAQ,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,GAAG,CAAC;QAAC,oBAAoB,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KACvH;;;;;;;;;;;;;;;;;OA8BA;CAGJ"}
|
package/lib/classes/link.js
CHANGED
|
@@ -18,6 +18,11 @@ const header_1 = __importDefault(require("./header"));
|
|
|
18
18
|
class Link extends header_1.default {
|
|
19
19
|
constructor(_baseUrl, _accessToken) {
|
|
20
20
|
super(_baseUrl, _accessToken);
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param config healthis with Xcmid
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
21
26
|
this.AddContext = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
22
27
|
const headers = this.headers(config.healthId);
|
|
23
28
|
const url = `${this.baseUrl}gateway/v0.5/links/link/add-contexts`;
|
|
@@ -43,6 +48,41 @@ class Link extends header_1.default {
|
|
|
43
48
|
});
|
|
44
49
|
return body;
|
|
45
50
|
});
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param config
|
|
54
|
+
* @healthId Patient's Identifier for which the new health data is added (It can be ABDM id or ABDM number)
|
|
55
|
+
* @careContextReference Care Context reference under which the new health data is added
|
|
56
|
+
* @patientReference Patient's reference (An identifier with which the patient is registered on HIP)
|
|
57
|
+
* @hiTypes Types of health information documents that have been added ("DiagnosticReportRecord" | "DischargeSummaryRecord" | "HealthDocumentRecord" | "ImmunizationRecord" | "OPConsultRecord" | "PrescriptionRecord" | "WellnessRecord")
|
|
58
|
+
* @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.
|
|
59
|
+
*/
|
|
60
|
+
this.notify = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const headers = this.headers(config.healthId);
|
|
62
|
+
const url = `${this.baseUrl}gateway/v0.5/links/link/notify`;
|
|
63
|
+
const body = {
|
|
64
|
+
"requestId": (0, uuid_1.v4)(),
|
|
65
|
+
"timestamp": new Date().toISOString(),
|
|
66
|
+
"notification": {
|
|
67
|
+
"patient": {
|
|
68
|
+
"id": config.healthId
|
|
69
|
+
},
|
|
70
|
+
"careContext": {
|
|
71
|
+
"patientReference": config.patientReference,
|
|
72
|
+
"careContextReference": config.careContextReference
|
|
73
|
+
},
|
|
74
|
+
"hiTypes": config.hiTypes,
|
|
75
|
+
"date": config.date,
|
|
76
|
+
"hip": {
|
|
77
|
+
"id": config.hipId
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
yield new request_1.default().request({
|
|
82
|
+
"headers": headers, "method": "POST", "requestBody": body, "url": url
|
|
83
|
+
});
|
|
84
|
+
return body;
|
|
85
|
+
});
|
|
46
86
|
}
|
|
47
87
|
}
|
|
48
88
|
exports.default = Link;
|
package/lib/classes/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/classes/link.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,wDAAgC;AAChC,sDAA8B;
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/classes/link.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,wDAAgC;AAChC,sDAA8B;AAI9B,MAAqB,IAAK,SAAQ,gBAAM;IACpC,YAAY,QAAgB,EAAE,YAAoB;QAC9C,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAGjC;;;;WAIG;QACH,eAAU,GAAG,CAAO,MAA0J,EAAE,EAAE;YAE9K,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC7C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,sCAAsC,CAAA;YACjE,MAAM,IAAI,GAAG;gBACT,WAAW,EAAE,IAAA,SAAM,GAAE;gBACrB,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACrC,MAAM,EAAE;oBACJ,aAAa,EAAE,MAAM,CAAC,sBAAsB;oBAC5C,SAAS,EAAE;wBACP,iBAAiB,EAAE,MAAM,CAAC,SAAS;wBACnC,SAAS,EAAE,MAAM,CAAC,cAAc;wBAChC,cAAc,EAAE;4BACZ;gCACI,iBAAiB,EAAE,MAAM,CAAC,aAAa;gCACvC,SAAS,EAAE,MAAM,CAAC,kBAAkB;6BACvC;yBACJ;qBACJ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
28
|
"active": boolean;
|
|
29
|
-
"alias":
|
|
29
|
+
"alias": any;
|
|
30
30
|
}) => Promise<any>;
|
|
31
|
+
registerAndGetAccessToken: (config: {
|
|
32
|
+
endpointUrl: string;
|
|
33
|
+
facilityId: string;
|
|
34
|
+
facilityName: string;
|
|
35
|
+
facilityType: string;
|
|
36
|
+
}) => Promise<string>;
|
|
31
37
|
}
|
|
32
38
|
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/classes/register.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,OAAO,CAAS;gBAEZ,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAmC;IAMpG;;;OAGG;IACH,cAAc,QAAa,QAAQ,GAAG,CAAC,CAetC;IAED;;;;;OAKG;IACH,mBAAmB,gBAAuB,MAAM,eAAe,MAAM,KAAG,QAAQ,GAAG,CAAC,CAYnF;IAED;;;;;OAKG;IACH,gBAAgB,gBAAuB,MAAM,UAAU;QACnD,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAA;QACd,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,OAAO,CAAA;QACjB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/classes/register.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,OAAO,CAAS;gBAEZ,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAmC;IAMpG;;;OAGG;IACH,cAAc,QAAa,QAAQ,GAAG,CAAC,CAetC;IAED;;;;;OAKG;IACH,mBAAmB,gBAAuB,MAAM,eAAe,MAAM,KAAG,QAAQ,GAAG,CAAC,CAYnF;IAED;;;;;OAKG;IACH,gBAAgB,gBAAuB,MAAM,UAAU;QACnD,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAA;QACd,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,OAAO,CAAA;QACjB,OAAO,EAAE,GAAG,CAAA;KACf,KAAG,QAAQ,GAAG,CAAC,CAiBf;IAED,yBAAyB,WAAkB;QACvC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KACtF,KAAG,QAAQ,MAAM,CAAC,CAclB;CAIJ"}
|
package/lib/classes/register.js
CHANGED
|
@@ -66,6 +66,18 @@ class Register {
|
|
|
66
66
|
"headers": headers, "requestBody": body, method: "PUT", "url": url
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
|
+
this.registerAndGetAccessToken = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const accesstoken = (yield this.getAccessToken().then(res => JSON.parse(res))).accessToken;
|
|
71
|
+
yield this.updateHealthcareUrl(accesstoken, config.endpointUrl);
|
|
72
|
+
yield this.registerFacility(accesstoken, {
|
|
73
|
+
"active": true,
|
|
74
|
+
"alias": ["Eg"],
|
|
75
|
+
"id": config.facilityId,
|
|
76
|
+
"name": config.facilityName,
|
|
77
|
+
"type": config.facilityType
|
|
78
|
+
});
|
|
79
|
+
return accesstoken;
|
|
80
|
+
});
|
|
69
81
|
this.clientID = _cleintId;
|
|
70
82
|
this.clinetSecrete = _clientSecrete;
|
|
71
83
|
this.baseUrl = _baseUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/classes/register.ts"],"names":[],"mappings":";;;;;;;;;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AAC,UAAU;gBACvB,MAAM,EAAE,MAAM,CAAC,YAAY;gBAC3B,MAAM,EAAE,MAAM,CAAC,YAAY;aAC9B,CAAC,CAAA;YACN,OAAO,WAAW,CAAC;QAEvB,CAAC,CAAA,CAAA;QA7FG,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,cAAc,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC5B,CAAC;CA8FJ;AAvGD,2BAuGC"}
|
package/package.json
CHANGED
package/lib/classes/patient.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare type purpose = "KYC" | "LINK" | "KYC_AND_LINK";
|
|
2
|
-
declare type hipType = "HIP" | "HIU";
|
|
3
|
-
declare type xCmId = "sbx" | "ndhm";
|
|
4
|
-
export default class Patient {
|
|
5
|
-
private baseUrl;
|
|
6
|
-
constructor(_baseUrl: string);
|
|
7
|
-
hipVerifyPatinetByHealthId: (config: {
|
|
8
|
-
accessToken: string;
|
|
9
|
-
healthId: string;
|
|
10
|
-
hipId: string;
|
|
11
|
-
hipType: hipType;
|
|
12
|
-
purpose: purpose;
|
|
13
|
-
xCmId: xCmId;
|
|
14
|
-
}) => Promise<any>;
|
|
15
|
-
hipPPatinetInit: (config: {
|
|
16
|
-
accessToken: string;
|
|
17
|
-
healthId: string;
|
|
18
|
-
hipId: string;
|
|
19
|
-
hipType: hipType;
|
|
20
|
-
purpose: purpose;
|
|
21
|
-
heathId: string;
|
|
22
|
-
authMode: string;
|
|
23
|
-
xCmId: xCmId;
|
|
24
|
-
}) => Promise<any>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=patient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../src/classes/patient.ts"],"names":[],"mappings":"AAKA,aAAK,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,cAAc,CAAA;AAC9C,aAAK,OAAO,GAAG,KAAK,GAAG,KAAK,CAAA;AAC5B,aAAK,KAAK,GAAG,KAAK,GAAG,MAAM,CAAA;AAC3B,MAAM,CAAC,OAAO,OAAO,OAAO;IACxB,OAAO,CAAC,OAAO,CAAS;gBACZ,QAAQ,EAAE,MAAM;IAI5B,0BAA0B,WAAmB;QACxC,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,OAAO,CAAC;QACjB,SAAU,OAAO,CAAC;QAClB,OAAQ,KAAK,CAAA;KACb,KAAG,QAAQ,GAAG,CAAC,CAwCf;IAEL,eAAe,WAAkB;QAC7B,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,OAAO,CAAA;QAChB,SAAU,OAAO,CAAA;QACjB,OAAO,EAAG,MAAM,CAAA;QAChB,QAAQ,EAAG,MAAM,CAAC;QAClB,OAAQ,KAAK,CAAA;KAChB,KAAG,QAAQ,GAAG,CAAC,CAgCX;CAEJ"}
|
package/lib/classes/patient.js
DELETED
|
@@ -1,83 +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 uuid_1 = require("uuid");
|
|
16
|
-
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
class Patient {
|
|
18
|
-
constructor(_baseUrl) {
|
|
19
|
-
this.hipVerifyPatinetByHealthId = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
try {
|
|
21
|
-
const url = `${this.baseUrl}gateway/v0.5/users/auth/fetch-modes`;
|
|
22
|
-
const headers = {
|
|
23
|
-
"Content-Type": "application/json",
|
|
24
|
-
"Authorization": `Bearer ${config.accessToken}`,
|
|
25
|
-
"X-CM-ID": config.xCmId
|
|
26
|
-
};
|
|
27
|
-
const requestBody = {
|
|
28
|
-
"requestId": (0, uuid_1.v4)(),
|
|
29
|
-
"timestamp": new Date().toISOString(),
|
|
30
|
-
"query": {
|
|
31
|
-
"id": config.healthId,
|
|
32
|
-
"purpose": config.purpose,
|
|
33
|
-
"requester": {
|
|
34
|
-
"type": config.hipType,
|
|
35
|
-
"id": config.hipId
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const body = JSON.stringify(requestBody);
|
|
40
|
-
let result = yield (0, axios_1.default)({
|
|
41
|
-
"headers": headers,
|
|
42
|
-
"url": url,
|
|
43
|
-
"data": body,
|
|
44
|
-
"method": "POST"
|
|
45
|
-
}).then(res => res.data);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
this.hipPPatinetInit = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
const url = `${this.baseUrl}gateway/v0.5/users/auth/init`;
|
|
53
|
-
const headers = {
|
|
54
|
-
"Content-Type": "application/json",
|
|
55
|
-
"Authorization": `Bearer ${config.accessToken}`,
|
|
56
|
-
"X-CM-ID": config.xCmId
|
|
57
|
-
};
|
|
58
|
-
const requestBody = {
|
|
59
|
-
"requestId": (0, uuid_1.v4)(),
|
|
60
|
-
"timestamp": new Date().toISOString(),
|
|
61
|
-
"query": {
|
|
62
|
-
"id": config.healthId,
|
|
63
|
-
"purpose": config.purpose,
|
|
64
|
-
"authMode": config.authMode,
|
|
65
|
-
"requester": {
|
|
66
|
-
"type": config.hipType,
|
|
67
|
-
"id": config.hipId,
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const body = JSON.stringify(requestBody);
|
|
72
|
-
let result = yield (0, axios_1.default)({
|
|
73
|
-
"headers": headers,
|
|
74
|
-
"url": url,
|
|
75
|
-
"data": body,
|
|
76
|
-
"method": "POST"
|
|
77
|
-
}).then(res => res.data);
|
|
78
|
-
});
|
|
79
|
-
this.baseUrl = _baseUrl;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.default = Patient;
|
|
83
|
-
//# sourceMappingURL=patient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"patient.js","sourceRoot":"","sources":["../../src/classes/patient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,+BAAoC;AACpC,kDAA2B;AAK3B,MAAqB,OAAO;IAExB,YAAY,QAAgB;QAI5B,+BAA0B,GAAG,CAAO,MAO/B,EAAgB,EAAE;YACf,IAAI;gBACA,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,qCAAqC,CAAC;gBACjE,MAAM,OAAO,GAAG;oBACZ,cAAc,EAAE,kBAAkB;oBAClC,eAAe,EAAE,UAAU,MAAM,CAAC,WAAW,EAAE;oBAC/C,SAAS,EAAE,MAAM,CAAC,KAAK;iBAC1B,CAAA;gBACD,MAAM,WAAW,GAAG;oBAChB,WAAW,EAAE,IAAA,SAAM,GAAE;oBACrB,WAAW,EAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACtC,OAAO,EAAE;wBACL,IAAI,EAAE,MA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