@medplum/core 0.9.21 → 0.9.24
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/dist/cjs/index.js +132 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +131 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/types/client.d.ts +111 -8
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils.d.ts +11 -0
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -617,6 +617,17 @@
|
|
|
617
617
|
(category === undefined || interval.category === category);
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
|
+
/**
|
|
621
|
+
* Tries to find an observation reference range for the given patient and condition names.
|
|
622
|
+
* @param definition The observation definition.
|
|
623
|
+
* @param patient The patient.
|
|
624
|
+
* @param names The condition names.
|
|
625
|
+
* @returns The observation interval if found; otherwise undefined.
|
|
626
|
+
*/
|
|
627
|
+
function findObservationReferenceRange(definition, patient, names) {
|
|
628
|
+
var _a;
|
|
629
|
+
return (_a = definition.qualifiedInterval) === null || _a === void 0 ? void 0 : _a.find((interval) => observationIntervalMatchesPatient(interval, patient) && names.includes(interval.condition));
|
|
630
|
+
}
|
|
620
631
|
/**
|
|
621
632
|
* Returns true if the patient matches the observation interval.
|
|
622
633
|
* @param interval The observation interval.
|
|
@@ -6190,6 +6201,7 @@
|
|
|
6190
6201
|
* Returns the current base URL for all API requests.
|
|
6191
6202
|
* By default, this is set to `https://api.medplum.com/`.
|
|
6192
6203
|
* This can be overridden by setting the `baseUrl` option when creating the client.
|
|
6204
|
+
* @category HTTP
|
|
6193
6205
|
* @returns The current base URL for all API requests.
|
|
6194
6206
|
*/
|
|
6195
6207
|
getBaseUrl() {
|
|
@@ -6197,6 +6209,7 @@
|
|
|
6197
6209
|
}
|
|
6198
6210
|
/**
|
|
6199
6211
|
* Clears all auth state including local storage and session storage.
|
|
6212
|
+
* @category Authentication
|
|
6200
6213
|
*/
|
|
6201
6214
|
clear() {
|
|
6202
6215
|
__classPrivateFieldGet(this, _MedplumClient_storage, "f").clear();
|
|
@@ -6209,6 +6222,7 @@
|
|
|
6209
6222
|
}
|
|
6210
6223
|
/**
|
|
6211
6224
|
* Invalidates any cached values or cached requests for the given URL.
|
|
6225
|
+
* @category Caching
|
|
6212
6226
|
* @param url The URL to invalidate.
|
|
6213
6227
|
*/
|
|
6214
6228
|
invalidateUrl(url) {
|
|
@@ -6217,6 +6231,7 @@
|
|
|
6217
6231
|
}
|
|
6218
6232
|
/**
|
|
6219
6233
|
* Invalidates all cached search results or cached requests for the given resourceType.
|
|
6234
|
+
* @category Caching
|
|
6220
6235
|
* @param resourceType The resource type to invalidate.
|
|
6221
6236
|
*/
|
|
6222
6237
|
invalidateSearches(resourceType) {
|
|
@@ -6234,6 +6249,7 @@
|
|
|
6234
6249
|
* For common operations, we recommend using higher level methods
|
|
6235
6250
|
* such as `readResource()`, `search()`, etc.
|
|
6236
6251
|
*
|
|
6252
|
+
* @category HTTP
|
|
6237
6253
|
* @param url The target URL.
|
|
6238
6254
|
* @param options Optional fetch options.
|
|
6239
6255
|
* @returns Promise to the response content.
|
|
@@ -6255,6 +6271,7 @@
|
|
|
6255
6271
|
* For common operations, we recommend using higher level methods
|
|
6256
6272
|
* such as `createResource()`.
|
|
6257
6273
|
*
|
|
6274
|
+
* @category HTTP
|
|
6258
6275
|
* @param url The target URL.
|
|
6259
6276
|
* @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
|
|
6260
6277
|
* @param contentType The content type to be included in the "Content-Type" header.
|
|
@@ -6279,6 +6296,7 @@
|
|
|
6279
6296
|
* For common operations, we recommend using higher level methods
|
|
6280
6297
|
* such as `updateResource()`.
|
|
6281
6298
|
*
|
|
6299
|
+
* @category HTTP
|
|
6282
6300
|
* @param url The target URL.
|
|
6283
6301
|
* @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
|
|
6284
6302
|
* @param contentType The content type to be included in the "Content-Type" header.
|
|
@@ -6303,6 +6321,7 @@
|
|
|
6303
6321
|
* For common operations, we recommend using higher level methods
|
|
6304
6322
|
* such as `patchResource()`.
|
|
6305
6323
|
*
|
|
6324
|
+
* @category HTTP
|
|
6306
6325
|
* @param url The target URL.
|
|
6307
6326
|
* @param operations Array of JSONPatch operations.
|
|
6308
6327
|
* @param options Optional fetch options.
|
|
@@ -6318,10 +6337,12 @@
|
|
|
6318
6337
|
/**
|
|
6319
6338
|
* Makes an HTTP DELETE request to the specified URL.
|
|
6320
6339
|
*
|
|
6340
|
+
*
|
|
6321
6341
|
* This is a lower level method for custom requests.
|
|
6322
6342
|
* For common operations, we recommend using higher level methods
|
|
6323
6343
|
* such as `deleteResource()`.
|
|
6324
6344
|
*
|
|
6345
|
+
* @category HTTP
|
|
6325
6346
|
* @param url The target URL.
|
|
6326
6347
|
* @param options Optional fetch options.
|
|
6327
6348
|
* @returns Promise to the response content.
|
|
@@ -6332,18 +6353,53 @@
|
|
|
6332
6353
|
return __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_request).call(this, 'DELETE', url, options);
|
|
6333
6354
|
}
|
|
6334
6355
|
/**
|
|
6335
|
-
*
|
|
6336
|
-
*
|
|
6356
|
+
* Initiates a new user flow.
|
|
6357
|
+
*
|
|
6358
|
+
* This method is part of the two different user registration flows:
|
|
6359
|
+
* 1) New Practitioner and new Project
|
|
6360
|
+
* 2) New Patient registration
|
|
6361
|
+
*
|
|
6362
|
+
* @category Authentication
|
|
6363
|
+
* @param registerRequest Register request including email and password.
|
|
6364
|
+
* @returns Promise to the authentication response.
|
|
6365
|
+
*/
|
|
6366
|
+
startNewUser(registerRequest) {
|
|
6367
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6368
|
+
yield __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_startPkce).call(this);
|
|
6369
|
+
return this.post('auth/newuser', Object.assign(Object.assign({}, registerRequest), { codeChallengeMethod: 'S256', codeChallenge: __classPrivateFieldGet(this, _MedplumClient_storage, "f").getString('codeChallenge') }));
|
|
6370
|
+
});
|
|
6371
|
+
}
|
|
6372
|
+
/**
|
|
6373
|
+
* Initiates a new project flow.
|
|
6374
|
+
*
|
|
6375
|
+
* This requires a partial login from `startNewUser` or `startNewGoogleUser`.
|
|
6376
|
+
*
|
|
6377
|
+
* @param registerRequest Register request including email and password.
|
|
6378
|
+
* @param login The partial login to complete. This should come from the `startNewUser` method.
|
|
6379
|
+
* @returns Promise to the authentication response.
|
|
6380
|
+
*/
|
|
6381
|
+
startNewProject(registerRequest, login) {
|
|
6382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6383
|
+
return this.post('auth/newproject', Object.assign(Object.assign({}, registerRequest), login));
|
|
6384
|
+
});
|
|
6385
|
+
}
|
|
6386
|
+
/**
|
|
6387
|
+
* Initiates a new patient flow.
|
|
6388
|
+
*
|
|
6389
|
+
* This requires a partial login from `startNewUser` or `startNewGoogleUser`.
|
|
6390
|
+
*
|
|
6391
|
+
* @param registerRequest Register request including email and password.
|
|
6392
|
+
* @param login The partial login to complete. This should come from the `startNewUser` method.
|
|
6337
6393
|
* @returns Promise to the authentication response.
|
|
6338
6394
|
*/
|
|
6339
|
-
|
|
6395
|
+
startNewPatient(registerRequest, login) {
|
|
6340
6396
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6341
|
-
|
|
6342
|
-
yield this.setActiveLogin(response);
|
|
6397
|
+
return this.post('auth/newpatient', Object.assign(Object.assign({}, registerRequest), login));
|
|
6343
6398
|
});
|
|
6344
6399
|
}
|
|
6345
6400
|
/**
|
|
6346
6401
|
* Initiates a user login flow.
|
|
6402
|
+
* @category Authentication
|
|
6347
6403
|
* @param loginRequest Login request including email and password.
|
|
6348
6404
|
* @returns Promise to the authentication response.
|
|
6349
6405
|
*/
|
|
@@ -6358,6 +6414,7 @@
|
|
|
6358
6414
|
* Tries to sign in with Google authentication.
|
|
6359
6415
|
* The response parameter is the result of a Google authentication.
|
|
6360
6416
|
* See: https://developers.google.com/identity/gsi/web/guides/handle-credential-responses-js-functions
|
|
6417
|
+
* @category Authentication
|
|
6361
6418
|
* @param loginRequest Login request including Google credential response.
|
|
6362
6419
|
* @returns Promise to the authentication response.
|
|
6363
6420
|
*/
|
|
@@ -6371,6 +6428,7 @@
|
|
|
6371
6428
|
/**
|
|
6372
6429
|
* Signs out locally.
|
|
6373
6430
|
* Does not invalidate tokens with the server.
|
|
6431
|
+
* @category Authentication
|
|
6374
6432
|
*/
|
|
6375
6433
|
signOut() {
|
|
6376
6434
|
this.clear();
|
|
@@ -6380,6 +6438,7 @@
|
|
|
6380
6438
|
* Tries to sign in the user.
|
|
6381
6439
|
* Returns true if the user is signed in.
|
|
6382
6440
|
* This may result in navigating away to the sign in page.
|
|
6441
|
+
* @category Authentication
|
|
6383
6442
|
*/
|
|
6384
6443
|
signInWithRedirect() {
|
|
6385
6444
|
const urlParams = new URLSearchParams(window.location.search);
|
|
@@ -6395,6 +6454,7 @@
|
|
|
6395
6454
|
/**
|
|
6396
6455
|
* Tries to sign out the user.
|
|
6397
6456
|
* See: https://docs.aws.amazon.com/cognito/latest/developerguide/logout-endpoint.html
|
|
6457
|
+
* @category Authentication
|
|
6398
6458
|
*/
|
|
6399
6459
|
signOutWithRedirect() {
|
|
6400
6460
|
window.location.assign(__classPrivateFieldGet(this, _MedplumClient_logoutUrl, "f"));
|
|
@@ -6402,6 +6462,7 @@
|
|
|
6402
6462
|
/**
|
|
6403
6463
|
* Builds a FHIR URL from a collection of URL path components.
|
|
6404
6464
|
* For example, `buildUrl('/Patient', '123')` returns `fhir/R4/Patient/123`.
|
|
6465
|
+
* @category HTTP
|
|
6405
6466
|
* @param path The path component of the URL.
|
|
6406
6467
|
* @returns The well-formed FHIR URL.
|
|
6407
6468
|
*/
|
|
@@ -6410,6 +6471,8 @@
|
|
|
6410
6471
|
}
|
|
6411
6472
|
/**
|
|
6412
6473
|
* Builds a FHIR search URL from a search query or structured query object.
|
|
6474
|
+
* @category HTTP
|
|
6475
|
+
* @category Search
|
|
6413
6476
|
* @param query The FHIR search query or structured query object.
|
|
6414
6477
|
* @returns The well-formed FHIR URL.
|
|
6415
6478
|
*/
|
|
@@ -6457,6 +6520,7 @@
|
|
|
6457
6520
|
*
|
|
6458
6521
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6459
6522
|
*
|
|
6523
|
+
* @category Search
|
|
6460
6524
|
* @param query The search query as either a string or a structured search object.
|
|
6461
6525
|
* @returns Promise to the search result bundle.
|
|
6462
6526
|
*/
|
|
@@ -6479,6 +6543,7 @@
|
|
|
6479
6543
|
*
|
|
6480
6544
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6481
6545
|
*
|
|
6546
|
+
* @category Search
|
|
6482
6547
|
* @param query The search query as either a string or a structured search object.
|
|
6483
6548
|
* @returns Promise to the search result bundle.
|
|
6484
6549
|
*/
|
|
@@ -6511,6 +6576,7 @@
|
|
|
6511
6576
|
*
|
|
6512
6577
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6513
6578
|
*
|
|
6579
|
+
* @category Search
|
|
6514
6580
|
* @param query The search query as either a string or a structured search object.
|
|
6515
6581
|
* @returns Promise to the search result bundle.
|
|
6516
6582
|
*/
|
|
@@ -6528,6 +6594,8 @@
|
|
|
6528
6594
|
/**
|
|
6529
6595
|
* Searches a ValueSet resource using the "expand" operation.
|
|
6530
6596
|
* See: https://www.hl7.org/fhir/operation-valueset-expand.html
|
|
6597
|
+
*
|
|
6598
|
+
* @category Search
|
|
6531
6599
|
* @param system The ValueSet system url.
|
|
6532
6600
|
* @param filter The search string.
|
|
6533
6601
|
* @returns Promise to expanded ValueSet.
|
|
@@ -6540,6 +6608,7 @@
|
|
|
6540
6608
|
}
|
|
6541
6609
|
/**
|
|
6542
6610
|
* Returns a cached resource if it is available.
|
|
6611
|
+
* @category Caching
|
|
6543
6612
|
* @param resourceType The FHIR resource type.
|
|
6544
6613
|
* @param id The FHIR resource ID.
|
|
6545
6614
|
* @returns The resource if it is available in the cache; undefined otherwise.
|
|
@@ -6551,6 +6620,7 @@
|
|
|
6551
6620
|
}
|
|
6552
6621
|
/**
|
|
6553
6622
|
* Returns a cached resource if it is available.
|
|
6623
|
+
* @category Caching
|
|
6554
6624
|
* @param resourceType The FHIR resource type.
|
|
6555
6625
|
* @param id The FHIR resource ID.
|
|
6556
6626
|
* @returns The resource if it is available in the cache; undefined otherwise.
|
|
@@ -6578,6 +6648,7 @@
|
|
|
6578
6648
|
*
|
|
6579
6649
|
* See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
|
|
6580
6650
|
*
|
|
6651
|
+
* @category Caching
|
|
6581
6652
|
* @param resourceType The FHIR resource type.
|
|
6582
6653
|
* @param id The resource ID.
|
|
6583
6654
|
* @returns The resource if available; undefined otherwise.
|
|
@@ -6600,6 +6671,7 @@
|
|
|
6600
6671
|
*
|
|
6601
6672
|
* See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
|
|
6602
6673
|
*
|
|
6674
|
+
* @category Read
|
|
6603
6675
|
* @param reference The FHIR reference object.
|
|
6604
6676
|
* @returns The resource if available; undefined otherwise.
|
|
6605
6677
|
*/
|
|
@@ -6618,6 +6690,7 @@
|
|
|
6618
6690
|
* Returns a cached schema for a resource type.
|
|
6619
6691
|
* If the schema is not cached, returns undefined.
|
|
6620
6692
|
* It is assumed that a client will call requestSchema before using this method.
|
|
6693
|
+
* @category Schema
|
|
6621
6694
|
* @param resourceType The FHIR resource type.
|
|
6622
6695
|
* @returns The schema if immediately available, undefined otherwise.
|
|
6623
6696
|
* @deprecated Use globalSchema instead.
|
|
@@ -6628,6 +6701,7 @@
|
|
|
6628
6701
|
/**
|
|
6629
6702
|
* Requests the schema for a resource type.
|
|
6630
6703
|
* If the schema is already cached, the promise is resolved immediately.
|
|
6704
|
+
* @category Schema
|
|
6631
6705
|
* @param resourceType The FHIR resource type.
|
|
6632
6706
|
* @returns Promise to a schema with the requested resource type.
|
|
6633
6707
|
*/
|
|
@@ -6689,6 +6763,7 @@
|
|
|
6689
6763
|
*
|
|
6690
6764
|
* See the FHIR "history" operation for full details: https://www.hl7.org/fhir/http.html#history
|
|
6691
6765
|
*
|
|
6766
|
+
* @category Read
|
|
6692
6767
|
* @param resourceType The FHIR resource type.
|
|
6693
6768
|
* @param id The resource ID.
|
|
6694
6769
|
* @returns Promise to the resource history.
|
|
@@ -6708,6 +6783,7 @@
|
|
|
6708
6783
|
*
|
|
6709
6784
|
* See the FHIR "vread" operation for full details: https://www.hl7.org/fhir/http.html#vread
|
|
6710
6785
|
*
|
|
6786
|
+
* @category Read
|
|
6711
6787
|
* @param resourceType The FHIR resource type.
|
|
6712
6788
|
* @param id The resource ID.
|
|
6713
6789
|
* @returns The resource if available; undefined otherwise.
|
|
@@ -6715,6 +6791,12 @@
|
|
|
6715
6791
|
readVersion(resourceType, id, vid) {
|
|
6716
6792
|
return this.get(this.fhirUrl(resourceType, id, '_history', vid));
|
|
6717
6793
|
}
|
|
6794
|
+
/**
|
|
6795
|
+
*
|
|
6796
|
+
* @category Read
|
|
6797
|
+
* @param id The Patient Id
|
|
6798
|
+
* @returns A Bundle of all Resources related to the Patient
|
|
6799
|
+
*/
|
|
6718
6800
|
readPatientEverything(id) {
|
|
6719
6801
|
return this.get(this.fhirUrl('Patient', id, '$everything'));
|
|
6720
6802
|
}
|
|
@@ -6738,6 +6820,7 @@
|
|
|
6738
6820
|
*
|
|
6739
6821
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
6740
6822
|
*
|
|
6823
|
+
* @category Create
|
|
6741
6824
|
* @param resource The FHIR resource to create.
|
|
6742
6825
|
* @returns The result of the create operation.
|
|
6743
6826
|
*/
|
|
@@ -6782,6 +6865,7 @@
|
|
|
6782
6865
|
*
|
|
6783
6866
|
* See the FHIR "conditional create" operation for full details: https://www.hl7.org/fhir/http.html#ccreate
|
|
6784
6867
|
*
|
|
6868
|
+
* @category Create
|
|
6785
6869
|
* @param resource The FHIR resource to create.
|
|
6786
6870
|
* @param query The search query for an equivalent resource.
|
|
6787
6871
|
* @returns The result of the create operation.
|
|
@@ -6810,6 +6894,7 @@
|
|
|
6810
6894
|
*
|
|
6811
6895
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
6812
6896
|
*
|
|
6897
|
+
* @category Create
|
|
6813
6898
|
* @param data The binary data to upload.
|
|
6814
6899
|
* @param filename Optional filename for the binary.
|
|
6815
6900
|
* @param contentType Content type for the binary.
|
|
@@ -6840,6 +6925,7 @@
|
|
|
6840
6925
|
*
|
|
6841
6926
|
* See the pdfmake document definition for full details: https://pdfmake.github.io/docs/0.1/document-definition-object/
|
|
6842
6927
|
*
|
|
6928
|
+
* @category Media
|
|
6843
6929
|
* @param docDefinition The PDF document definition.
|
|
6844
6930
|
* @returns The result of the create operation.
|
|
6845
6931
|
*/
|
|
@@ -6857,6 +6943,7 @@
|
|
|
6857
6943
|
*
|
|
6858
6944
|
* This is a convenience method to handle commmon cases where a `Communication` resource is created with a `payload`.
|
|
6859
6945
|
*
|
|
6946
|
+
* @category Create
|
|
6860
6947
|
* @param resource The FHIR resource to comment on.
|
|
6861
6948
|
* @param text The text of the comment.
|
|
6862
6949
|
* @returns The result of the create operation.
|
|
@@ -6907,6 +6994,7 @@
|
|
|
6907
6994
|
*
|
|
6908
6995
|
* See the FHIR "update" operation for full details: https://www.hl7.org/fhir/http.html#update
|
|
6909
6996
|
*
|
|
6997
|
+
* @category Write
|
|
6910
6998
|
* @param resource The FHIR resource to update.
|
|
6911
6999
|
* @returns The result of the update operation.
|
|
6912
7000
|
*/
|
|
@@ -6938,6 +7026,7 @@
|
|
|
6938
7026
|
*
|
|
6939
7027
|
* See the JSONPatch specification for full details: https://tools.ietf.org/html/rfc6902
|
|
6940
7028
|
*
|
|
7029
|
+
* @category Write
|
|
6941
7030
|
* @param resourceType The FHIR resource type.
|
|
6942
7031
|
* @param id The resource ID.
|
|
6943
7032
|
* @param operations The JSONPatch operations.
|
|
@@ -6958,6 +7047,7 @@
|
|
|
6958
7047
|
*
|
|
6959
7048
|
* See the FHIR "delete" operation for full details: https://www.hl7.org/fhir/http.html#delete
|
|
6960
7049
|
*
|
|
7050
|
+
* @category Delete
|
|
6961
7051
|
* @param resourceType The FHIR resource type.
|
|
6962
7052
|
* @param id The resource ID.
|
|
6963
7053
|
* @returns The result of the delete operation.
|
|
@@ -7009,7 +7099,7 @@
|
|
|
7009
7099
|
* ```
|
|
7010
7100
|
*
|
|
7011
7101
|
* See The FHIR "batch/transaction" section for full details: https://hl7.org/fhir/http.html#transaction
|
|
7012
|
-
*
|
|
7102
|
+
* @category Batch
|
|
7013
7103
|
* @param bundle The FHIR batch/transaction bundle.
|
|
7014
7104
|
* @returns The FHIR batch/transaction response bundle.
|
|
7015
7105
|
*/
|
|
@@ -7049,7 +7139,7 @@
|
|
|
7049
7139
|
* ```
|
|
7050
7140
|
*
|
|
7051
7141
|
* See options here: https://nodemailer.com/extras/mailcomposer/
|
|
7052
|
-
*
|
|
7142
|
+
* @category Media
|
|
7053
7143
|
* @param options The MailComposer options.
|
|
7054
7144
|
* @returns Promise to the operation outcome.
|
|
7055
7145
|
*/
|
|
@@ -7097,6 +7187,7 @@
|
|
|
7097
7187
|
*
|
|
7098
7188
|
* See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
|
|
7099
7189
|
*
|
|
7190
|
+
* @category Read
|
|
7100
7191
|
* @param query The GraphQL query.
|
|
7101
7192
|
* @param operationName Optional GraphQL operation name.
|
|
7102
7193
|
* @param variables Optional GraphQL variables.
|
|
@@ -7106,9 +7197,16 @@
|
|
|
7106
7197
|
graphql(query, operationName, variables, options) {
|
|
7107
7198
|
return this.post(this.fhirUrl('$graphql'), { query, operationName, variables }, JSON_CONTENT_TYPE, options);
|
|
7108
7199
|
}
|
|
7200
|
+
/**
|
|
7201
|
+
* @category Authentication
|
|
7202
|
+
* @returns The Login State
|
|
7203
|
+
*/
|
|
7109
7204
|
getActiveLogin() {
|
|
7110
7205
|
return __classPrivateFieldGet(this, _MedplumClient_storage, "f").getObject('activeLogin');
|
|
7111
7206
|
}
|
|
7207
|
+
/**
|
|
7208
|
+
* @category Authentication
|
|
7209
|
+
*/
|
|
7112
7210
|
setActiveLogin(login) {
|
|
7113
7211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7114
7212
|
__classPrivateFieldSet(this, _MedplumClient_accessToken, login.accessToken, "f");
|
|
@@ -7122,25 +7220,43 @@
|
|
|
7122
7220
|
yield __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_refreshProfile).call(this);
|
|
7123
7221
|
});
|
|
7124
7222
|
}
|
|
7223
|
+
/**
|
|
7224
|
+
* @category Authentication
|
|
7225
|
+
*/
|
|
7125
7226
|
getAccessToken() {
|
|
7126
7227
|
return __classPrivateFieldGet(this, _MedplumClient_accessToken, "f");
|
|
7127
7228
|
}
|
|
7229
|
+
/**
|
|
7230
|
+
* @category Authentication
|
|
7231
|
+
*/
|
|
7128
7232
|
setAccessToken(accessToken) {
|
|
7129
7233
|
__classPrivateFieldSet(this, _MedplumClient_accessToken, accessToken, "f");
|
|
7130
7234
|
__classPrivateFieldSet(this, _MedplumClient_refreshToken, undefined, "f");
|
|
7131
7235
|
__classPrivateFieldSet(this, _MedplumClient_profile, undefined, "f");
|
|
7132
7236
|
__classPrivateFieldSet(this, _MedplumClient_config, undefined, "f");
|
|
7133
7237
|
}
|
|
7238
|
+
/**
|
|
7239
|
+
* @category Authentication
|
|
7240
|
+
*/
|
|
7134
7241
|
getLogins() {
|
|
7135
7242
|
var _a;
|
|
7136
7243
|
return (_a = __classPrivateFieldGet(this, _MedplumClient_storage, "f").getObject('logins')) !== null && _a !== void 0 ? _a : [];
|
|
7137
7244
|
}
|
|
7245
|
+
/**
|
|
7246
|
+
* @category Authentication
|
|
7247
|
+
*/
|
|
7138
7248
|
isLoading() {
|
|
7139
7249
|
return !!__classPrivateFieldGet(this, _MedplumClient_profilePromise, "f");
|
|
7140
7250
|
}
|
|
7251
|
+
/**
|
|
7252
|
+
* @category User Profile
|
|
7253
|
+
*/
|
|
7141
7254
|
getProfile() {
|
|
7142
7255
|
return __classPrivateFieldGet(this, _MedplumClient_profile, "f");
|
|
7143
7256
|
}
|
|
7257
|
+
/**
|
|
7258
|
+
* @category User Profile
|
|
7259
|
+
*/
|
|
7144
7260
|
getProfileAsync() {
|
|
7145
7261
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7146
7262
|
if (__classPrivateFieldGet(this, _MedplumClient_profilePromise, "f")) {
|
|
@@ -7149,11 +7265,16 @@
|
|
|
7149
7265
|
return this.getProfile();
|
|
7150
7266
|
});
|
|
7151
7267
|
}
|
|
7268
|
+
/**
|
|
7269
|
+
* @category User Profile
|
|
7270
|
+
*/
|
|
7152
7271
|
getUserConfiguration() {
|
|
7153
7272
|
return __classPrivateFieldGet(this, _MedplumClient_config, "f");
|
|
7154
7273
|
}
|
|
7155
7274
|
/**
|
|
7156
7275
|
* Downloads the URL as a blob.
|
|
7276
|
+
*
|
|
7277
|
+
* @category Read
|
|
7157
7278
|
* @param url The URL to request.
|
|
7158
7279
|
* @returns Promise to the response body as a blob.
|
|
7159
7280
|
*/
|
|
@@ -7194,6 +7315,7 @@
|
|
|
7194
7315
|
/**
|
|
7195
7316
|
* Starts a new OAuth2 client credentials flow.
|
|
7196
7317
|
* See: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
|
|
7318
|
+
* @category Authentication
|
|
7197
7319
|
* @param clientId The client ID.
|
|
7198
7320
|
* @param clientSecret The client secret.
|
|
7199
7321
|
* @returns Promise that resolves to the client profile.
|
|
@@ -7401,6 +7523,7 @@
|
|
|
7401
7523
|
};
|
|
7402
7524
|
/**
|
|
7403
7525
|
* Returns the base URL for the current page.
|
|
7526
|
+
* @category HTTP
|
|
7404
7527
|
*/
|
|
7405
7528
|
function getBaseUrl() {
|
|
7406
7529
|
return window.location.protocol + '//' + window.location.host + '/';
|
|
@@ -10701,6 +10824,7 @@
|
|
|
10701
10824
|
exports.fhirPathIs = fhirPathIs;
|
|
10702
10825
|
exports.fhirPathNot = fhirPathNot;
|
|
10703
10826
|
exports.findObservationInterval = findObservationInterval;
|
|
10827
|
+
exports.findObservationReferenceRange = findObservationReferenceRange;
|
|
10704
10828
|
exports.formatAddress = formatAddress;
|
|
10705
10829
|
exports.formatFamilyName = formatFamilyName;
|
|
10706
10830
|
exports.formatGivenName = formatGivenName;
|
|
@@ -10739,6 +10863,7 @@
|
|
|
10739
10863
|
exports.notFound = notFound;
|
|
10740
10864
|
exports.notModified = notModified;
|
|
10741
10865
|
exports.parseFhirPath = parseFhirPath;
|
|
10866
|
+
exports.parseJWTPayload = parseJWTPayload;
|
|
10742
10867
|
exports.parseSearchDefinition = parseSearchDefinition;
|
|
10743
10868
|
exports.preciseEquals = preciseEquals;
|
|
10744
10869
|
exports.preciseGreaterThan = preciseGreaterThan;
|