@healthcloudai/hc-settings-connector 0.0.6 → 0.0.8
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/README.md +18 -1
- package/dist/index.cjs +57 -57
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +57 -57
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -728,4 +728,21 @@ The client returns the raw backend response from the authenticated `PUT` request
|
|
|
728
728
|
- `updateDrivingLicense()` and `submitDrivingLicense()` send `{ "Data": { "Image": "..." } }` to the resolved EHR patient route.
|
|
729
729
|
- `submitDrivingLicense()` is a backward-compatible alias of `updateDrivingLicense()`.
|
|
730
730
|
- `getInsurances()`, `updateDrivingLicense()`, and `submitDrivingLicense()` internally resolve the current patient's `EHR`.
|
|
731
|
-
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
## API Key
|
|
734
|
+
|
|
735
|
+
All outgoing requests from `HCSettingsClient` can include an optional API key header.
|
|
736
|
+
|
|
737
|
+
```ts
|
|
738
|
+
const apiKey = process.env.HEALTHCLOUD_API_KEY;
|
|
739
|
+
|
|
740
|
+
if (apiKey) {
|
|
741
|
+
settingsClient.setApiKey("x-api-key", apiKey);
|
|
742
|
+
}
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
- Header name should be `x-api-key`.
|
|
746
|
+
- API key is optional unless required by the backend.
|
|
747
|
+
- If not set, behavior remains unchanged and the header is omitted.
|
|
748
|
+
- The API key is also included on the internal patient header lookup used to resolve the active `EHR`.
|
package/dist/index.cjs
CHANGED
|
@@ -34,16 +34,20 @@ var HCSettingsClient = class {
|
|
|
34
34
|
this.http = httpClient;
|
|
35
35
|
this.auth = authClient;
|
|
36
36
|
}
|
|
37
|
+
setApiKey(headerName, value) {
|
|
38
|
+
this.apiKeyHeaderName = headerName;
|
|
39
|
+
this.apiKeyValue = value;
|
|
40
|
+
}
|
|
37
41
|
async getUserInfo() {
|
|
38
42
|
return this.http.get(
|
|
39
|
-
`${this.
|
|
40
|
-
this.
|
|
43
|
+
`${this.getBaseUrl()}/patient/header`,
|
|
44
|
+
this.getAuthHeaders()
|
|
41
45
|
);
|
|
42
46
|
}
|
|
43
47
|
async getDashboard() {
|
|
44
48
|
return this.http.get(
|
|
45
|
-
`${this.
|
|
46
|
-
this.
|
|
49
|
+
`${this.getBaseUrl()}/patient/dashboard`,
|
|
50
|
+
this.getAuthHeaders()
|
|
47
51
|
);
|
|
48
52
|
}
|
|
49
53
|
async getUserImageCannedUrl(extension) {
|
|
@@ -54,12 +58,9 @@ var HCSettingsClient = class {
|
|
|
54
58
|
}
|
|
55
59
|
};
|
|
56
60
|
const response = await this.http.put(
|
|
57
|
-
`${this.
|
|
61
|
+
`${this.getBaseUrl()}/patient/image/cannedurl`,
|
|
58
62
|
payload,
|
|
59
|
-
|
|
60
|
-
...this.auth.getAuthHeader(),
|
|
61
|
-
"Content-Type": "application/json"
|
|
62
|
-
}
|
|
63
|
+
this.getJsonHeaders()
|
|
63
64
|
);
|
|
64
65
|
return (_a = response.Data) != null ? _a : response;
|
|
65
66
|
}
|
|
@@ -71,12 +72,9 @@ var HCSettingsClient = class {
|
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
const response = await this.http.put(
|
|
74
|
-
`${this.
|
|
75
|
+
`${this.getBaseUrl()}/patient/id/cannedurl`,
|
|
75
76
|
payload,
|
|
76
|
-
|
|
77
|
-
...this.auth.getAuthHeader(),
|
|
78
|
-
"Content-Type": "application/json"
|
|
79
|
-
}
|
|
77
|
+
this.getJsonHeaders()
|
|
80
78
|
);
|
|
81
79
|
return (_a = response.Data) != null ? _a : response;
|
|
82
80
|
}
|
|
@@ -88,12 +86,9 @@ var HCSettingsClient = class {
|
|
|
88
86
|
}
|
|
89
87
|
};
|
|
90
88
|
const response = await this.http.put(
|
|
91
|
-
`${this.
|
|
89
|
+
`${this.getBaseUrl()}/patient/insurance/cannedurl`,
|
|
92
90
|
payload,
|
|
93
|
-
|
|
94
|
-
...this.auth.getAuthHeader(),
|
|
95
|
-
"Content-Type": "application/json"
|
|
96
|
-
}
|
|
91
|
+
this.getJsonHeaders()
|
|
97
92
|
);
|
|
98
93
|
return (_a = response.Data) != null ? _a : response;
|
|
99
94
|
}
|
|
@@ -105,12 +100,9 @@ var HCSettingsClient = class {
|
|
|
105
100
|
}
|
|
106
101
|
};
|
|
107
102
|
return this.http.post(
|
|
108
|
-
`${this.
|
|
103
|
+
`${this.getBaseUrl()}/patient/capture`,
|
|
109
104
|
payload,
|
|
110
|
-
|
|
111
|
-
...this.auth.getAuthHeader(),
|
|
112
|
-
"Content-Type": "application/json"
|
|
113
|
-
}
|
|
105
|
+
this.getJsonHeaders()
|
|
114
106
|
);
|
|
115
107
|
}
|
|
116
108
|
async captureDrivingLicense(fileKey) {
|
|
@@ -121,12 +113,9 @@ var HCSettingsClient = class {
|
|
|
121
113
|
}
|
|
122
114
|
};
|
|
123
115
|
return this.http.post(
|
|
124
|
-
`${this.
|
|
116
|
+
`${this.getBaseUrl()}/patient/capture`,
|
|
125
117
|
payload,
|
|
126
|
-
|
|
127
|
-
...this.auth.getAuthHeader(),
|
|
128
|
-
"Content-Type": "application/json"
|
|
129
|
-
}
|
|
118
|
+
this.getJsonHeaders()
|
|
130
119
|
);
|
|
131
120
|
}
|
|
132
121
|
async captureInsurance(fileKey) {
|
|
@@ -137,12 +126,9 @@ var HCSettingsClient = class {
|
|
|
137
126
|
}
|
|
138
127
|
};
|
|
139
128
|
return this.http.post(
|
|
140
|
-
`${this.
|
|
129
|
+
`${this.getBaseUrl()}/patient/capture`,
|
|
141
130
|
payload,
|
|
142
|
-
|
|
143
|
-
...this.auth.getAuthHeader(),
|
|
144
|
-
"Content-Type": "application/json"
|
|
145
|
-
}
|
|
131
|
+
this.getJsonHeaders()
|
|
146
132
|
);
|
|
147
133
|
}
|
|
148
134
|
async submitInsurance(payload) {
|
|
@@ -150,18 +136,15 @@ var HCSettingsClient = class {
|
|
|
150
136
|
Data: payload
|
|
151
137
|
};
|
|
152
138
|
return this.http.put(
|
|
153
|
-
`${this.
|
|
139
|
+
`${this.getBaseUrl()}/patient/coverage`,
|
|
154
140
|
requestPayload,
|
|
155
|
-
|
|
156
|
-
...this.auth.getAuthHeader(),
|
|
157
|
-
"Content-Type": "application/json"
|
|
158
|
-
}
|
|
141
|
+
this.getJsonHeaders()
|
|
159
142
|
);
|
|
160
143
|
}
|
|
161
144
|
async getInsurances() {
|
|
162
145
|
return this.http.get(
|
|
163
146
|
await this.buildEhrPatientUrl("insurances"),
|
|
164
|
-
this.
|
|
147
|
+
this.getAuthHeaders()
|
|
165
148
|
);
|
|
166
149
|
}
|
|
167
150
|
async updateDrivingLicense(payload) {
|
|
@@ -171,10 +154,7 @@ var HCSettingsClient = class {
|
|
|
171
154
|
return this.http.put(
|
|
172
155
|
await this.buildEhrPatientUrl("drivinglicense"),
|
|
173
156
|
requestPayload,
|
|
174
|
-
|
|
175
|
-
...this.auth.getAuthHeader(),
|
|
176
|
-
"Content-Type": "application/json"
|
|
177
|
-
}
|
|
157
|
+
this.getJsonHeaders()
|
|
178
158
|
);
|
|
179
159
|
}
|
|
180
160
|
async submitDrivingLicense(payload) {
|
|
@@ -188,12 +168,9 @@ var HCSettingsClient = class {
|
|
|
188
168
|
}
|
|
189
169
|
};
|
|
190
170
|
const response = await this.http.put(
|
|
191
|
-
`${this.
|
|
171
|
+
`${this.getBaseUrl()}/patient/image/url`,
|
|
192
172
|
payload,
|
|
193
|
-
|
|
194
|
-
...this.auth.getAuthHeader(),
|
|
195
|
-
"Content-Type": "application/json"
|
|
196
|
-
}
|
|
173
|
+
this.getJsonHeaders()
|
|
197
174
|
);
|
|
198
175
|
return (_a = response.Data) != null ? _a : response;
|
|
199
176
|
}
|
|
@@ -202,31 +179,54 @@ var HCSettingsClient = class {
|
|
|
202
179
|
Data: {}
|
|
203
180
|
};
|
|
204
181
|
return this.http.put(
|
|
205
|
-
`${this.
|
|
182
|
+
`${this.getBaseUrl()}/patient/deactivate`,
|
|
206
183
|
payload,
|
|
207
|
-
|
|
208
|
-
...this.auth.getAuthHeader(),
|
|
209
|
-
"Content-Type": "application/json"
|
|
210
|
-
}
|
|
184
|
+
this.getJsonHeaders()
|
|
211
185
|
);
|
|
212
186
|
}
|
|
213
187
|
async buildEhrPatientUrl(path) {
|
|
214
188
|
const ehr = await this.getResolvedEhr();
|
|
215
|
-
return `${this.
|
|
189
|
+
return `${this.getBaseUrl()}/ehr/${ehr}/patient/${path}`;
|
|
216
190
|
}
|
|
217
191
|
async getResolvedEhr() {
|
|
218
192
|
var _a, _b, _c;
|
|
219
193
|
if (this.resolvedEhr) {
|
|
220
194
|
return this.resolvedEhr;
|
|
221
195
|
}
|
|
222
|
-
const userInfo = await this.
|
|
196
|
+
const userInfo = await this.http.get(
|
|
197
|
+
`${this.getBaseUrl()}/patient/header`,
|
|
198
|
+
this.getAuthHeaders()
|
|
199
|
+
);
|
|
223
200
|
const ehr = ((_b = (_a = userInfo == null ? void 0 : userInfo.Data) == null ? void 0 : _a.EHR) == null ? void 0 : _b.trim()) || ((_c = userInfo == null ? void 0 : userInfo.EHR) == null ? void 0 : _c.trim());
|
|
224
201
|
if (!ehr) {
|
|
225
|
-
throw new Error("Could not resolve EHR from
|
|
202
|
+
throw new Error("Could not resolve EHR from patient header response.");
|
|
226
203
|
}
|
|
227
204
|
this.resolvedEhr = ehr;
|
|
228
205
|
return ehr;
|
|
229
206
|
}
|
|
207
|
+
getBaseUrl() {
|
|
208
|
+
return this.auth.getBaseUrl();
|
|
209
|
+
}
|
|
210
|
+
getAuthHeaders() {
|
|
211
|
+
return {
|
|
212
|
+
...this.auth.getAuthHeader(),
|
|
213
|
+
...this.getApiKeyHeader()
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
getJsonHeaders() {
|
|
217
|
+
return {
|
|
218
|
+
...this.getAuthHeaders(),
|
|
219
|
+
"Content-Type": "application/json"
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
getApiKeyHeader() {
|
|
223
|
+
if (!this.apiKeyHeaderName || !this.apiKeyValue) {
|
|
224
|
+
return {};
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
"x-api-key": this.apiKeyValue
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
// src/errors.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -69,7 +69,10 @@ declare class HCSettingsClient {
|
|
|
69
69
|
private http;
|
|
70
70
|
private auth;
|
|
71
71
|
private resolvedEhr;
|
|
72
|
+
private apiKeyHeaderName?;
|
|
73
|
+
private apiKeyValue?;
|
|
72
74
|
constructor(httpClient: HttpClient, authClient: HCLoginClient);
|
|
75
|
+
setApiKey(headerName: string, value: string): void;
|
|
73
76
|
getUserInfo(): Promise<any>;
|
|
74
77
|
getDashboard(): Promise<any>;
|
|
75
78
|
getUserImageCannedUrl(extension: string): Promise<UserImage>;
|
|
@@ -86,6 +89,10 @@ declare class HCSettingsClient {
|
|
|
86
89
|
deactivateUser(): Promise<any>;
|
|
87
90
|
private buildEhrPatientUrl;
|
|
88
91
|
private getResolvedEhr;
|
|
92
|
+
private getBaseUrl;
|
|
93
|
+
private getAuthHeaders;
|
|
94
|
+
private getJsonHeaders;
|
|
95
|
+
private getApiKeyHeader;
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
declare class ConfigError extends Error {
|
package/dist/index.d.ts
CHANGED
|
@@ -69,7 +69,10 @@ declare class HCSettingsClient {
|
|
|
69
69
|
private http;
|
|
70
70
|
private auth;
|
|
71
71
|
private resolvedEhr;
|
|
72
|
+
private apiKeyHeaderName?;
|
|
73
|
+
private apiKeyValue?;
|
|
72
74
|
constructor(httpClient: HttpClient, authClient: HCLoginClient);
|
|
75
|
+
setApiKey(headerName: string, value: string): void;
|
|
73
76
|
getUserInfo(): Promise<any>;
|
|
74
77
|
getDashboard(): Promise<any>;
|
|
75
78
|
getUserImageCannedUrl(extension: string): Promise<UserImage>;
|
|
@@ -86,6 +89,10 @@ declare class HCSettingsClient {
|
|
|
86
89
|
deactivateUser(): Promise<any>;
|
|
87
90
|
private buildEhrPatientUrl;
|
|
88
91
|
private getResolvedEhr;
|
|
92
|
+
private getBaseUrl;
|
|
93
|
+
private getAuthHeaders;
|
|
94
|
+
private getJsonHeaders;
|
|
95
|
+
private getApiKeyHeader;
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
declare class ConfigError extends Error {
|
package/dist/index.js
CHANGED
|
@@ -5,16 +5,20 @@ var HCSettingsClient = class {
|
|
|
5
5
|
this.http = httpClient;
|
|
6
6
|
this.auth = authClient;
|
|
7
7
|
}
|
|
8
|
+
setApiKey(headerName, value) {
|
|
9
|
+
this.apiKeyHeaderName = headerName;
|
|
10
|
+
this.apiKeyValue = value;
|
|
11
|
+
}
|
|
8
12
|
async getUserInfo() {
|
|
9
13
|
return this.http.get(
|
|
10
|
-
`${this.
|
|
11
|
-
this.
|
|
14
|
+
`${this.getBaseUrl()}/patient/header`,
|
|
15
|
+
this.getAuthHeaders()
|
|
12
16
|
);
|
|
13
17
|
}
|
|
14
18
|
async getDashboard() {
|
|
15
19
|
return this.http.get(
|
|
16
|
-
`${this.
|
|
17
|
-
this.
|
|
20
|
+
`${this.getBaseUrl()}/patient/dashboard`,
|
|
21
|
+
this.getAuthHeaders()
|
|
18
22
|
);
|
|
19
23
|
}
|
|
20
24
|
async getUserImageCannedUrl(extension) {
|
|
@@ -25,12 +29,9 @@ var HCSettingsClient = class {
|
|
|
25
29
|
}
|
|
26
30
|
};
|
|
27
31
|
const response = await this.http.put(
|
|
28
|
-
`${this.
|
|
32
|
+
`${this.getBaseUrl()}/patient/image/cannedurl`,
|
|
29
33
|
payload,
|
|
30
|
-
|
|
31
|
-
...this.auth.getAuthHeader(),
|
|
32
|
-
"Content-Type": "application/json"
|
|
33
|
-
}
|
|
34
|
+
this.getJsonHeaders()
|
|
34
35
|
);
|
|
35
36
|
return (_a = response.Data) != null ? _a : response;
|
|
36
37
|
}
|
|
@@ -42,12 +43,9 @@ var HCSettingsClient = class {
|
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
const response = await this.http.put(
|
|
45
|
-
`${this.
|
|
46
|
+
`${this.getBaseUrl()}/patient/id/cannedurl`,
|
|
46
47
|
payload,
|
|
47
|
-
|
|
48
|
-
...this.auth.getAuthHeader(),
|
|
49
|
-
"Content-Type": "application/json"
|
|
50
|
-
}
|
|
48
|
+
this.getJsonHeaders()
|
|
51
49
|
);
|
|
52
50
|
return (_a = response.Data) != null ? _a : response;
|
|
53
51
|
}
|
|
@@ -59,12 +57,9 @@ var HCSettingsClient = class {
|
|
|
59
57
|
}
|
|
60
58
|
};
|
|
61
59
|
const response = await this.http.put(
|
|
62
|
-
`${this.
|
|
60
|
+
`${this.getBaseUrl()}/patient/insurance/cannedurl`,
|
|
63
61
|
payload,
|
|
64
|
-
|
|
65
|
-
...this.auth.getAuthHeader(),
|
|
66
|
-
"Content-Type": "application/json"
|
|
67
|
-
}
|
|
62
|
+
this.getJsonHeaders()
|
|
68
63
|
);
|
|
69
64
|
return (_a = response.Data) != null ? _a : response;
|
|
70
65
|
}
|
|
@@ -76,12 +71,9 @@ var HCSettingsClient = class {
|
|
|
76
71
|
}
|
|
77
72
|
};
|
|
78
73
|
return this.http.post(
|
|
79
|
-
`${this.
|
|
74
|
+
`${this.getBaseUrl()}/patient/capture`,
|
|
80
75
|
payload,
|
|
81
|
-
|
|
82
|
-
...this.auth.getAuthHeader(),
|
|
83
|
-
"Content-Type": "application/json"
|
|
84
|
-
}
|
|
76
|
+
this.getJsonHeaders()
|
|
85
77
|
);
|
|
86
78
|
}
|
|
87
79
|
async captureDrivingLicense(fileKey) {
|
|
@@ -92,12 +84,9 @@ var HCSettingsClient = class {
|
|
|
92
84
|
}
|
|
93
85
|
};
|
|
94
86
|
return this.http.post(
|
|
95
|
-
`${this.
|
|
87
|
+
`${this.getBaseUrl()}/patient/capture`,
|
|
96
88
|
payload,
|
|
97
|
-
|
|
98
|
-
...this.auth.getAuthHeader(),
|
|
99
|
-
"Content-Type": "application/json"
|
|
100
|
-
}
|
|
89
|
+
this.getJsonHeaders()
|
|
101
90
|
);
|
|
102
91
|
}
|
|
103
92
|
async captureInsurance(fileKey) {
|
|
@@ -108,12 +97,9 @@ var HCSettingsClient = class {
|
|
|
108
97
|
}
|
|
109
98
|
};
|
|
110
99
|
return this.http.post(
|
|
111
|
-
`${this.
|
|
100
|
+
`${this.getBaseUrl()}/patient/capture`,
|
|
112
101
|
payload,
|
|
113
|
-
|
|
114
|
-
...this.auth.getAuthHeader(),
|
|
115
|
-
"Content-Type": "application/json"
|
|
116
|
-
}
|
|
102
|
+
this.getJsonHeaders()
|
|
117
103
|
);
|
|
118
104
|
}
|
|
119
105
|
async submitInsurance(payload) {
|
|
@@ -121,18 +107,15 @@ var HCSettingsClient = class {
|
|
|
121
107
|
Data: payload
|
|
122
108
|
};
|
|
123
109
|
return this.http.put(
|
|
124
|
-
`${this.
|
|
110
|
+
`${this.getBaseUrl()}/patient/coverage`,
|
|
125
111
|
requestPayload,
|
|
126
|
-
|
|
127
|
-
...this.auth.getAuthHeader(),
|
|
128
|
-
"Content-Type": "application/json"
|
|
129
|
-
}
|
|
112
|
+
this.getJsonHeaders()
|
|
130
113
|
);
|
|
131
114
|
}
|
|
132
115
|
async getInsurances() {
|
|
133
116
|
return this.http.get(
|
|
134
117
|
await this.buildEhrPatientUrl("insurances"),
|
|
135
|
-
this.
|
|
118
|
+
this.getAuthHeaders()
|
|
136
119
|
);
|
|
137
120
|
}
|
|
138
121
|
async updateDrivingLicense(payload) {
|
|
@@ -142,10 +125,7 @@ var HCSettingsClient = class {
|
|
|
142
125
|
return this.http.put(
|
|
143
126
|
await this.buildEhrPatientUrl("drivinglicense"),
|
|
144
127
|
requestPayload,
|
|
145
|
-
|
|
146
|
-
...this.auth.getAuthHeader(),
|
|
147
|
-
"Content-Type": "application/json"
|
|
148
|
-
}
|
|
128
|
+
this.getJsonHeaders()
|
|
149
129
|
);
|
|
150
130
|
}
|
|
151
131
|
async submitDrivingLicense(payload) {
|
|
@@ -159,12 +139,9 @@ var HCSettingsClient = class {
|
|
|
159
139
|
}
|
|
160
140
|
};
|
|
161
141
|
const response = await this.http.put(
|
|
162
|
-
`${this.
|
|
142
|
+
`${this.getBaseUrl()}/patient/image/url`,
|
|
163
143
|
payload,
|
|
164
|
-
|
|
165
|
-
...this.auth.getAuthHeader(),
|
|
166
|
-
"Content-Type": "application/json"
|
|
167
|
-
}
|
|
144
|
+
this.getJsonHeaders()
|
|
168
145
|
);
|
|
169
146
|
return (_a = response.Data) != null ? _a : response;
|
|
170
147
|
}
|
|
@@ -173,31 +150,54 @@ var HCSettingsClient = class {
|
|
|
173
150
|
Data: {}
|
|
174
151
|
};
|
|
175
152
|
return this.http.put(
|
|
176
|
-
`${this.
|
|
153
|
+
`${this.getBaseUrl()}/patient/deactivate`,
|
|
177
154
|
payload,
|
|
178
|
-
|
|
179
|
-
...this.auth.getAuthHeader(),
|
|
180
|
-
"Content-Type": "application/json"
|
|
181
|
-
}
|
|
155
|
+
this.getJsonHeaders()
|
|
182
156
|
);
|
|
183
157
|
}
|
|
184
158
|
async buildEhrPatientUrl(path) {
|
|
185
159
|
const ehr = await this.getResolvedEhr();
|
|
186
|
-
return `${this.
|
|
160
|
+
return `${this.getBaseUrl()}/ehr/${ehr}/patient/${path}`;
|
|
187
161
|
}
|
|
188
162
|
async getResolvedEhr() {
|
|
189
163
|
var _a, _b, _c;
|
|
190
164
|
if (this.resolvedEhr) {
|
|
191
165
|
return this.resolvedEhr;
|
|
192
166
|
}
|
|
193
|
-
const userInfo = await this.
|
|
167
|
+
const userInfo = await this.http.get(
|
|
168
|
+
`${this.getBaseUrl()}/patient/header`,
|
|
169
|
+
this.getAuthHeaders()
|
|
170
|
+
);
|
|
194
171
|
const ehr = ((_b = (_a = userInfo == null ? void 0 : userInfo.Data) == null ? void 0 : _a.EHR) == null ? void 0 : _b.trim()) || ((_c = userInfo == null ? void 0 : userInfo.EHR) == null ? void 0 : _c.trim());
|
|
195
172
|
if (!ehr) {
|
|
196
|
-
throw new Error("Could not resolve EHR from
|
|
173
|
+
throw new Error("Could not resolve EHR from patient header response.");
|
|
197
174
|
}
|
|
198
175
|
this.resolvedEhr = ehr;
|
|
199
176
|
return ehr;
|
|
200
177
|
}
|
|
178
|
+
getBaseUrl() {
|
|
179
|
+
return this.auth.getBaseUrl();
|
|
180
|
+
}
|
|
181
|
+
getAuthHeaders() {
|
|
182
|
+
return {
|
|
183
|
+
...this.auth.getAuthHeader(),
|
|
184
|
+
...this.getApiKeyHeader()
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
getJsonHeaders() {
|
|
188
|
+
return {
|
|
189
|
+
...this.getAuthHeaders(),
|
|
190
|
+
"Content-Type": "application/json"
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
getApiKeyHeader() {
|
|
194
|
+
if (!this.apiKeyHeaderName || !this.apiKeyValue) {
|
|
195
|
+
return {};
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
"x-api-key": this.apiKeyValue
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
201
|
};
|
|
202
202
|
|
|
203
203
|
// src/errors.ts
|