@medplum/core 0.9.20 → 0.9.23
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 +169 -6
- 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 +169 -7
- 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 +158 -7
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils.d.ts +3 -0
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -6184,6 +6184,7 @@ class MedplumClient extends EventTarget {
|
|
|
6184
6184
|
* Returns the current base URL for all API requests.
|
|
6185
6185
|
* By default, this is set to `https://api.medplum.com/`.
|
|
6186
6186
|
* This can be overridden by setting the `baseUrl` option when creating the client.
|
|
6187
|
+
* @category HTTP
|
|
6187
6188
|
* @returns The current base URL for all API requests.
|
|
6188
6189
|
*/
|
|
6189
6190
|
getBaseUrl() {
|
|
@@ -6191,6 +6192,7 @@ class MedplumClient extends EventTarget {
|
|
|
6191
6192
|
}
|
|
6192
6193
|
/**
|
|
6193
6194
|
* Clears all auth state including local storage and session storage.
|
|
6195
|
+
* @category Authentication
|
|
6194
6196
|
*/
|
|
6195
6197
|
clear() {
|
|
6196
6198
|
__classPrivateFieldGet(this, _MedplumClient_storage, "f").clear();
|
|
@@ -6203,6 +6205,7 @@ class MedplumClient extends EventTarget {
|
|
|
6203
6205
|
}
|
|
6204
6206
|
/**
|
|
6205
6207
|
* Invalidates any cached values or cached requests for the given URL.
|
|
6208
|
+
* @category Caching
|
|
6206
6209
|
* @param url The URL to invalidate.
|
|
6207
6210
|
*/
|
|
6208
6211
|
invalidateUrl(url) {
|
|
@@ -6211,6 +6214,7 @@ class MedplumClient extends EventTarget {
|
|
|
6211
6214
|
}
|
|
6212
6215
|
/**
|
|
6213
6216
|
* Invalidates all cached search results or cached requests for the given resourceType.
|
|
6217
|
+
* @category Caching
|
|
6214
6218
|
* @param resourceType The resource type to invalidate.
|
|
6215
6219
|
*/
|
|
6216
6220
|
invalidateSearches(resourceType) {
|
|
@@ -6228,6 +6232,7 @@ class MedplumClient extends EventTarget {
|
|
|
6228
6232
|
* For common operations, we recommend using higher level methods
|
|
6229
6233
|
* such as `readResource()`, `search()`, etc.
|
|
6230
6234
|
*
|
|
6235
|
+
* @category HTTP
|
|
6231
6236
|
* @param url The target URL.
|
|
6232
6237
|
* @param options Optional fetch options.
|
|
6233
6238
|
* @returns Promise to the response content.
|
|
@@ -6249,6 +6254,7 @@ class MedplumClient extends EventTarget {
|
|
|
6249
6254
|
* For common operations, we recommend using higher level methods
|
|
6250
6255
|
* such as `createResource()`.
|
|
6251
6256
|
*
|
|
6257
|
+
* @category HTTP
|
|
6252
6258
|
* @param url The target URL.
|
|
6253
6259
|
* @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
|
|
6254
6260
|
* @param contentType The content type to be included in the "Content-Type" header.
|
|
@@ -6273,6 +6279,7 @@ class MedplumClient extends EventTarget {
|
|
|
6273
6279
|
* For common operations, we recommend using higher level methods
|
|
6274
6280
|
* such as `updateResource()`.
|
|
6275
6281
|
*
|
|
6282
|
+
* @category HTTP
|
|
6276
6283
|
* @param url The target URL.
|
|
6277
6284
|
* @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
|
|
6278
6285
|
* @param contentType The content type to be included in the "Content-Type" header.
|
|
@@ -6297,6 +6304,7 @@ class MedplumClient extends EventTarget {
|
|
|
6297
6304
|
* For common operations, we recommend using higher level methods
|
|
6298
6305
|
* such as `patchResource()`.
|
|
6299
6306
|
*
|
|
6307
|
+
* @category HTTP
|
|
6300
6308
|
* @param url The target URL.
|
|
6301
6309
|
* @param operations Array of JSONPatch operations.
|
|
6302
6310
|
* @param options Optional fetch options.
|
|
@@ -6312,10 +6320,12 @@ class MedplumClient extends EventTarget {
|
|
|
6312
6320
|
/**
|
|
6313
6321
|
* Makes an HTTP DELETE request to the specified URL.
|
|
6314
6322
|
*
|
|
6323
|
+
*
|
|
6315
6324
|
* This is a lower level method for custom requests.
|
|
6316
6325
|
* For common operations, we recommend using higher level methods
|
|
6317
6326
|
* such as `deleteResource()`.
|
|
6318
6327
|
*
|
|
6328
|
+
* @category HTTP
|
|
6319
6329
|
* @param url The target URL.
|
|
6320
6330
|
* @param options Optional fetch options.
|
|
6321
6331
|
* @returns Promise to the response content.
|
|
@@ -6326,18 +6336,53 @@ class MedplumClient extends EventTarget {
|
|
|
6326
6336
|
return __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_request).call(this, 'DELETE', url, options);
|
|
6327
6337
|
}
|
|
6328
6338
|
/**
|
|
6329
|
-
*
|
|
6330
|
-
*
|
|
6339
|
+
* Initiates a new user flow.
|
|
6340
|
+
*
|
|
6341
|
+
* This method is part of the two different user registration flows:
|
|
6342
|
+
* 1) New Practitioner and new Project
|
|
6343
|
+
* 2) New Patient registration
|
|
6344
|
+
*
|
|
6345
|
+
* @category Authentication
|
|
6346
|
+
* @param registerRequest Register request including email and password.
|
|
6331
6347
|
* @returns Promise to the authentication response.
|
|
6332
6348
|
*/
|
|
6333
|
-
|
|
6349
|
+
startNewUser(registerRequest) {
|
|
6334
6350
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6335
|
-
|
|
6336
|
-
|
|
6351
|
+
yield __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_startPkce).call(this);
|
|
6352
|
+
return this.post('auth/newuser', Object.assign(Object.assign({}, registerRequest), { codeChallengeMethod: 'S256', codeChallenge: __classPrivateFieldGet(this, _MedplumClient_storage, "f").getString('codeChallenge') }));
|
|
6353
|
+
});
|
|
6354
|
+
}
|
|
6355
|
+
/**
|
|
6356
|
+
* Initiates a new project flow.
|
|
6357
|
+
*
|
|
6358
|
+
* This requires a partial login from `startNewUser` or `startNewGoogleUser`.
|
|
6359
|
+
*
|
|
6360
|
+
* @param registerRequest Register request including email and password.
|
|
6361
|
+
* @param login The partial login to complete. This should come from the `startNewUser` method.
|
|
6362
|
+
* @returns Promise to the authentication response.
|
|
6363
|
+
*/
|
|
6364
|
+
startNewProject(registerRequest, login) {
|
|
6365
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6366
|
+
return this.post('auth/newproject', Object.assign(Object.assign({}, registerRequest), login));
|
|
6367
|
+
});
|
|
6368
|
+
}
|
|
6369
|
+
/**
|
|
6370
|
+
* Initiates a new patient flow.
|
|
6371
|
+
*
|
|
6372
|
+
* This requires a partial login from `startNewUser` or `startNewGoogleUser`.
|
|
6373
|
+
*
|
|
6374
|
+
* @param registerRequest Register request including email and password.
|
|
6375
|
+
* @param login The partial login to complete. This should come from the `startNewUser` method.
|
|
6376
|
+
* @returns Promise to the authentication response.
|
|
6377
|
+
*/
|
|
6378
|
+
startNewPatient(registerRequest, login) {
|
|
6379
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6380
|
+
return this.post('auth/newpatient', Object.assign(Object.assign({}, registerRequest), login));
|
|
6337
6381
|
});
|
|
6338
6382
|
}
|
|
6339
6383
|
/**
|
|
6340
6384
|
* Initiates a user login flow.
|
|
6385
|
+
* @category Authentication
|
|
6341
6386
|
* @param loginRequest Login request including email and password.
|
|
6342
6387
|
* @returns Promise to the authentication response.
|
|
6343
6388
|
*/
|
|
@@ -6352,6 +6397,7 @@ class MedplumClient extends EventTarget {
|
|
|
6352
6397
|
* Tries to sign in with Google authentication.
|
|
6353
6398
|
* The response parameter is the result of a Google authentication.
|
|
6354
6399
|
* See: https://developers.google.com/identity/gsi/web/guides/handle-credential-responses-js-functions
|
|
6400
|
+
* @category Authentication
|
|
6355
6401
|
* @param loginRequest Login request including Google credential response.
|
|
6356
6402
|
* @returns Promise to the authentication response.
|
|
6357
6403
|
*/
|
|
@@ -6365,6 +6411,7 @@ class MedplumClient extends EventTarget {
|
|
|
6365
6411
|
/**
|
|
6366
6412
|
* Signs out locally.
|
|
6367
6413
|
* Does not invalidate tokens with the server.
|
|
6414
|
+
* @category Authentication
|
|
6368
6415
|
*/
|
|
6369
6416
|
signOut() {
|
|
6370
6417
|
this.clear();
|
|
@@ -6374,6 +6421,7 @@ class MedplumClient extends EventTarget {
|
|
|
6374
6421
|
* Tries to sign in the user.
|
|
6375
6422
|
* Returns true if the user is signed in.
|
|
6376
6423
|
* This may result in navigating away to the sign in page.
|
|
6424
|
+
* @category Authentication
|
|
6377
6425
|
*/
|
|
6378
6426
|
signInWithRedirect() {
|
|
6379
6427
|
const urlParams = new URLSearchParams(window.location.search);
|
|
@@ -6389,6 +6437,7 @@ class MedplumClient extends EventTarget {
|
|
|
6389
6437
|
/**
|
|
6390
6438
|
* Tries to sign out the user.
|
|
6391
6439
|
* See: https://docs.aws.amazon.com/cognito/latest/developerguide/logout-endpoint.html
|
|
6440
|
+
* @category Authentication
|
|
6392
6441
|
*/
|
|
6393
6442
|
signOutWithRedirect() {
|
|
6394
6443
|
window.location.assign(__classPrivateFieldGet(this, _MedplumClient_logoutUrl, "f"));
|
|
@@ -6396,6 +6445,7 @@ class MedplumClient extends EventTarget {
|
|
|
6396
6445
|
/**
|
|
6397
6446
|
* Builds a FHIR URL from a collection of URL path components.
|
|
6398
6447
|
* For example, `buildUrl('/Patient', '123')` returns `fhir/R4/Patient/123`.
|
|
6448
|
+
* @category HTTP
|
|
6399
6449
|
* @param path The path component of the URL.
|
|
6400
6450
|
* @returns The well-formed FHIR URL.
|
|
6401
6451
|
*/
|
|
@@ -6404,6 +6454,8 @@ class MedplumClient extends EventTarget {
|
|
|
6404
6454
|
}
|
|
6405
6455
|
/**
|
|
6406
6456
|
* Builds a FHIR search URL from a search query or structured query object.
|
|
6457
|
+
* @category HTTP
|
|
6458
|
+
* @category Search
|
|
6407
6459
|
* @param query The FHIR search query or structured query object.
|
|
6408
6460
|
* @returns The well-formed FHIR URL.
|
|
6409
6461
|
*/
|
|
@@ -6451,6 +6503,7 @@ class MedplumClient extends EventTarget {
|
|
|
6451
6503
|
*
|
|
6452
6504
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6453
6505
|
*
|
|
6506
|
+
* @category Search
|
|
6454
6507
|
* @param query The search query as either a string or a structured search object.
|
|
6455
6508
|
* @returns Promise to the search result bundle.
|
|
6456
6509
|
*/
|
|
@@ -6473,6 +6526,7 @@ class MedplumClient extends EventTarget {
|
|
|
6473
6526
|
*
|
|
6474
6527
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6475
6528
|
*
|
|
6529
|
+
* @category Search
|
|
6476
6530
|
* @param query The search query as either a string or a structured search object.
|
|
6477
6531
|
* @returns Promise to the search result bundle.
|
|
6478
6532
|
*/
|
|
@@ -6505,6 +6559,7 @@ class MedplumClient extends EventTarget {
|
|
|
6505
6559
|
*
|
|
6506
6560
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6507
6561
|
*
|
|
6562
|
+
* @category Search
|
|
6508
6563
|
* @param query The search query as either a string or a structured search object.
|
|
6509
6564
|
* @returns Promise to the search result bundle.
|
|
6510
6565
|
*/
|
|
@@ -6522,6 +6577,8 @@ class MedplumClient extends EventTarget {
|
|
|
6522
6577
|
/**
|
|
6523
6578
|
* Searches a ValueSet resource using the "expand" operation.
|
|
6524
6579
|
* See: https://www.hl7.org/fhir/operation-valueset-expand.html
|
|
6580
|
+
*
|
|
6581
|
+
* @category Search
|
|
6525
6582
|
* @param system The ValueSet system url.
|
|
6526
6583
|
* @param filter The search string.
|
|
6527
6584
|
* @returns Promise to expanded ValueSet.
|
|
@@ -6534,6 +6591,7 @@ class MedplumClient extends EventTarget {
|
|
|
6534
6591
|
}
|
|
6535
6592
|
/**
|
|
6536
6593
|
* Returns a cached resource if it is available.
|
|
6594
|
+
* @category Caching
|
|
6537
6595
|
* @param resourceType The FHIR resource type.
|
|
6538
6596
|
* @param id The FHIR resource ID.
|
|
6539
6597
|
* @returns The resource if it is available in the cache; undefined otherwise.
|
|
@@ -6545,6 +6603,7 @@ class MedplumClient extends EventTarget {
|
|
|
6545
6603
|
}
|
|
6546
6604
|
/**
|
|
6547
6605
|
* Returns a cached resource if it is available.
|
|
6606
|
+
* @category Caching
|
|
6548
6607
|
* @param resourceType The FHIR resource type.
|
|
6549
6608
|
* @param id The FHIR resource ID.
|
|
6550
6609
|
* @returns The resource if it is available in the cache; undefined otherwise.
|
|
@@ -6572,6 +6631,7 @@ class MedplumClient extends EventTarget {
|
|
|
6572
6631
|
*
|
|
6573
6632
|
* See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
|
|
6574
6633
|
*
|
|
6634
|
+
* @category Caching
|
|
6575
6635
|
* @param resourceType The FHIR resource type.
|
|
6576
6636
|
* @param id The resource ID.
|
|
6577
6637
|
* @returns The resource if available; undefined otherwise.
|
|
@@ -6594,6 +6654,7 @@ class MedplumClient extends EventTarget {
|
|
|
6594
6654
|
*
|
|
6595
6655
|
* See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
|
|
6596
6656
|
*
|
|
6657
|
+
* @category Read
|
|
6597
6658
|
* @param reference The FHIR reference object.
|
|
6598
6659
|
* @returns The resource if available; undefined otherwise.
|
|
6599
6660
|
*/
|
|
@@ -6612,6 +6673,7 @@ class MedplumClient extends EventTarget {
|
|
|
6612
6673
|
* Returns a cached schema for a resource type.
|
|
6613
6674
|
* If the schema is not cached, returns undefined.
|
|
6614
6675
|
* It is assumed that a client will call requestSchema before using this method.
|
|
6676
|
+
* @category Schema
|
|
6615
6677
|
* @param resourceType The FHIR resource type.
|
|
6616
6678
|
* @returns The schema if immediately available, undefined otherwise.
|
|
6617
6679
|
* @deprecated Use globalSchema instead.
|
|
@@ -6622,6 +6684,7 @@ class MedplumClient extends EventTarget {
|
|
|
6622
6684
|
/**
|
|
6623
6685
|
* Requests the schema for a resource type.
|
|
6624
6686
|
* If the schema is already cached, the promise is resolved immediately.
|
|
6687
|
+
* @category Schema
|
|
6625
6688
|
* @param resourceType The FHIR resource type.
|
|
6626
6689
|
* @returns Promise to a schema with the requested resource type.
|
|
6627
6690
|
*/
|
|
@@ -6683,6 +6746,7 @@ class MedplumClient extends EventTarget {
|
|
|
6683
6746
|
*
|
|
6684
6747
|
* See the FHIR "history" operation for full details: https://www.hl7.org/fhir/http.html#history
|
|
6685
6748
|
*
|
|
6749
|
+
* @category Read
|
|
6686
6750
|
* @param resourceType The FHIR resource type.
|
|
6687
6751
|
* @param id The resource ID.
|
|
6688
6752
|
* @returns Promise to the resource history.
|
|
@@ -6702,6 +6766,7 @@ class MedplumClient extends EventTarget {
|
|
|
6702
6766
|
*
|
|
6703
6767
|
* See the FHIR "vread" operation for full details: https://www.hl7.org/fhir/http.html#vread
|
|
6704
6768
|
*
|
|
6769
|
+
* @category Read
|
|
6705
6770
|
* @param resourceType The FHIR resource type.
|
|
6706
6771
|
* @param id The resource ID.
|
|
6707
6772
|
* @returns The resource if available; undefined otherwise.
|
|
@@ -6709,6 +6774,12 @@ class MedplumClient extends EventTarget {
|
|
|
6709
6774
|
readVersion(resourceType, id, vid) {
|
|
6710
6775
|
return this.get(this.fhirUrl(resourceType, id, '_history', vid));
|
|
6711
6776
|
}
|
|
6777
|
+
/**
|
|
6778
|
+
*
|
|
6779
|
+
* @category Read
|
|
6780
|
+
* @param id The Patient Id
|
|
6781
|
+
* @returns A Bundle of all Resources related to the Patient
|
|
6782
|
+
*/
|
|
6712
6783
|
readPatientEverything(id) {
|
|
6713
6784
|
return this.get(this.fhirUrl('Patient', id, '$everything'));
|
|
6714
6785
|
}
|
|
@@ -6732,6 +6803,7 @@ class MedplumClient extends EventTarget {
|
|
|
6732
6803
|
*
|
|
6733
6804
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
6734
6805
|
*
|
|
6806
|
+
* @category Create
|
|
6735
6807
|
* @param resource The FHIR resource to create.
|
|
6736
6808
|
* @returns The result of the create operation.
|
|
6737
6809
|
*/
|
|
@@ -6776,6 +6848,7 @@ class MedplumClient extends EventTarget {
|
|
|
6776
6848
|
*
|
|
6777
6849
|
* See the FHIR "conditional create" operation for full details: https://www.hl7.org/fhir/http.html#ccreate
|
|
6778
6850
|
*
|
|
6851
|
+
* @category Create
|
|
6779
6852
|
* @param resource The FHIR resource to create.
|
|
6780
6853
|
* @param query The search query for an equivalent resource.
|
|
6781
6854
|
* @returns The result of the create operation.
|
|
@@ -6804,6 +6877,7 @@ class MedplumClient extends EventTarget {
|
|
|
6804
6877
|
*
|
|
6805
6878
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
6806
6879
|
*
|
|
6880
|
+
* @category Create
|
|
6807
6881
|
* @param data The binary data to upload.
|
|
6808
6882
|
* @param filename Optional filename for the binary.
|
|
6809
6883
|
* @param contentType Content type for the binary.
|
|
@@ -6834,6 +6908,7 @@ class MedplumClient extends EventTarget {
|
|
|
6834
6908
|
*
|
|
6835
6909
|
* See the pdfmake document definition for full details: https://pdfmake.github.io/docs/0.1/document-definition-object/
|
|
6836
6910
|
*
|
|
6911
|
+
* @category Media
|
|
6837
6912
|
* @param docDefinition The PDF document definition.
|
|
6838
6913
|
* @returns The result of the create operation.
|
|
6839
6914
|
*/
|
|
@@ -6851,6 +6926,7 @@ class MedplumClient extends EventTarget {
|
|
|
6851
6926
|
*
|
|
6852
6927
|
* This is a convenience method to handle commmon cases where a `Communication` resource is created with a `payload`.
|
|
6853
6928
|
*
|
|
6929
|
+
* @category Create
|
|
6854
6930
|
* @param resource The FHIR resource to comment on.
|
|
6855
6931
|
* @param text The text of the comment.
|
|
6856
6932
|
* @returns The result of the create operation.
|
|
@@ -6901,6 +6977,7 @@ class MedplumClient extends EventTarget {
|
|
|
6901
6977
|
*
|
|
6902
6978
|
* See the FHIR "update" operation for full details: https://www.hl7.org/fhir/http.html#update
|
|
6903
6979
|
*
|
|
6980
|
+
* @category Write
|
|
6904
6981
|
* @param resource The FHIR resource to update.
|
|
6905
6982
|
* @returns The result of the update operation.
|
|
6906
6983
|
*/
|
|
@@ -6932,6 +7009,7 @@ class MedplumClient extends EventTarget {
|
|
|
6932
7009
|
*
|
|
6933
7010
|
* See the JSONPatch specification for full details: https://tools.ietf.org/html/rfc6902
|
|
6934
7011
|
*
|
|
7012
|
+
* @category Write
|
|
6935
7013
|
* @param resourceType The FHIR resource type.
|
|
6936
7014
|
* @param id The resource ID.
|
|
6937
7015
|
* @param operations The JSONPatch operations.
|
|
@@ -6952,6 +7030,7 @@ class MedplumClient extends EventTarget {
|
|
|
6952
7030
|
*
|
|
6953
7031
|
* See the FHIR "delete" operation for full details: https://www.hl7.org/fhir/http.html#delete
|
|
6954
7032
|
*
|
|
7033
|
+
* @category Delete
|
|
6955
7034
|
* @param resourceType The FHIR resource type.
|
|
6956
7035
|
* @param id The resource ID.
|
|
6957
7036
|
* @returns The result of the delete operation.
|
|
@@ -6960,6 +7039,56 @@ class MedplumClient extends EventTarget {
|
|
|
6960
7039
|
this.invalidateSearches(resourceType);
|
|
6961
7040
|
return this.delete(this.fhirUrl(resourceType, id));
|
|
6962
7041
|
}
|
|
7042
|
+
/**
|
|
7043
|
+
* Executes a batch or transaction of FHIR operations.
|
|
7044
|
+
*
|
|
7045
|
+
* Example:
|
|
7046
|
+
*
|
|
7047
|
+
* ```typescript
|
|
7048
|
+
* await medplum.executeBatch({
|
|
7049
|
+
* "resourceType": "Bundle",
|
|
7050
|
+
* "type": "transaction",
|
|
7051
|
+
* "entry": [
|
|
7052
|
+
* {
|
|
7053
|
+
* "fullUrl": "urn:uuid:61ebe359-bfdc-4613-8bf2-c5e300945f0a",
|
|
7054
|
+
* "resource": {
|
|
7055
|
+
* "resourceType": "Patient",
|
|
7056
|
+
* "name": [{ "use": "official", "given": ["Alice"], "family": "Smith" }],
|
|
7057
|
+
* "gender": "female",
|
|
7058
|
+
* "birthDate": "1974-12-25"
|
|
7059
|
+
* },
|
|
7060
|
+
* "request": {
|
|
7061
|
+
* "method": "POST",
|
|
7062
|
+
* "url": "Patient"
|
|
7063
|
+
* }
|
|
7064
|
+
* },
|
|
7065
|
+
* {
|
|
7066
|
+
* "fullUrl": "urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059",
|
|
7067
|
+
* "resource": {
|
|
7068
|
+
* "resourceType": "Patient",
|
|
7069
|
+
* "identifier": [{ "system": "http:/example.org/fhir/ids", "value": "234234" }],
|
|
7070
|
+
* "name": [{ "use": "official", "given": ["Bob"], "family": "Jones" }],
|
|
7071
|
+
* "gender": "male",
|
|
7072
|
+
* "birthDate": "1974-12-25"
|
|
7073
|
+
* },
|
|
7074
|
+
* "request": {
|
|
7075
|
+
* "method": "POST",
|
|
7076
|
+
* "url": "Patient",
|
|
7077
|
+
* "ifNoneExist": "identifier=http:/example.org/fhir/ids|234234"
|
|
7078
|
+
* }
|
|
7079
|
+
* }
|
|
7080
|
+
* ]
|
|
7081
|
+
* });
|
|
7082
|
+
* ```
|
|
7083
|
+
*
|
|
7084
|
+
* See The FHIR "batch/transaction" section for full details: https://hl7.org/fhir/http.html#transaction
|
|
7085
|
+
* @category Batch
|
|
7086
|
+
* @param bundle The FHIR batch/transaction bundle.
|
|
7087
|
+
* @returns The FHIR batch/transaction response bundle.
|
|
7088
|
+
*/
|
|
7089
|
+
executeBatch(bundle) {
|
|
7090
|
+
return this.post('fhir/R4', bundle);
|
|
7091
|
+
}
|
|
6963
7092
|
/**
|
|
6964
7093
|
* Sends an email using the Medplum Email API.
|
|
6965
7094
|
*
|
|
@@ -6993,7 +7122,7 @@ class MedplumClient extends EventTarget {
|
|
|
6993
7122
|
* ```
|
|
6994
7123
|
*
|
|
6995
7124
|
* See options here: https://nodemailer.com/extras/mailcomposer/
|
|
6996
|
-
*
|
|
7125
|
+
* @category Media
|
|
6997
7126
|
* @param options The MailComposer options.
|
|
6998
7127
|
* @returns Promise to the operation outcome.
|
|
6999
7128
|
*/
|
|
@@ -7041,6 +7170,7 @@ class MedplumClient extends EventTarget {
|
|
|
7041
7170
|
*
|
|
7042
7171
|
* See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
|
|
7043
7172
|
*
|
|
7173
|
+
* @category Read
|
|
7044
7174
|
* @param query The GraphQL query.
|
|
7045
7175
|
* @param operationName Optional GraphQL operation name.
|
|
7046
7176
|
* @param variables Optional GraphQL variables.
|
|
@@ -7050,9 +7180,16 @@ class MedplumClient extends EventTarget {
|
|
|
7050
7180
|
graphql(query, operationName, variables, options) {
|
|
7051
7181
|
return this.post(this.fhirUrl('$graphql'), { query, operationName, variables }, JSON_CONTENT_TYPE, options);
|
|
7052
7182
|
}
|
|
7183
|
+
/**
|
|
7184
|
+
* @category Authentication
|
|
7185
|
+
* @returns The Login State
|
|
7186
|
+
*/
|
|
7053
7187
|
getActiveLogin() {
|
|
7054
7188
|
return __classPrivateFieldGet(this, _MedplumClient_storage, "f").getObject('activeLogin');
|
|
7055
7189
|
}
|
|
7190
|
+
/**
|
|
7191
|
+
* @category Authentication
|
|
7192
|
+
*/
|
|
7056
7193
|
setActiveLogin(login) {
|
|
7057
7194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7058
7195
|
__classPrivateFieldSet(this, _MedplumClient_accessToken, login.accessToken, "f");
|
|
@@ -7066,25 +7203,43 @@ class MedplumClient extends EventTarget {
|
|
|
7066
7203
|
yield __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_refreshProfile).call(this);
|
|
7067
7204
|
});
|
|
7068
7205
|
}
|
|
7206
|
+
/**
|
|
7207
|
+
* @category Authentication
|
|
7208
|
+
*/
|
|
7069
7209
|
getAccessToken() {
|
|
7070
7210
|
return __classPrivateFieldGet(this, _MedplumClient_accessToken, "f");
|
|
7071
7211
|
}
|
|
7212
|
+
/**
|
|
7213
|
+
* @category Authentication
|
|
7214
|
+
*/
|
|
7072
7215
|
setAccessToken(accessToken) {
|
|
7073
7216
|
__classPrivateFieldSet(this, _MedplumClient_accessToken, accessToken, "f");
|
|
7074
7217
|
__classPrivateFieldSet(this, _MedplumClient_refreshToken, undefined, "f");
|
|
7075
7218
|
__classPrivateFieldSet(this, _MedplumClient_profile, undefined, "f");
|
|
7076
7219
|
__classPrivateFieldSet(this, _MedplumClient_config, undefined, "f");
|
|
7077
7220
|
}
|
|
7221
|
+
/**
|
|
7222
|
+
* @category Authentication
|
|
7223
|
+
*/
|
|
7078
7224
|
getLogins() {
|
|
7079
7225
|
var _a;
|
|
7080
7226
|
return (_a = __classPrivateFieldGet(this, _MedplumClient_storage, "f").getObject('logins')) !== null && _a !== void 0 ? _a : [];
|
|
7081
7227
|
}
|
|
7228
|
+
/**
|
|
7229
|
+
* @category Authentication
|
|
7230
|
+
*/
|
|
7082
7231
|
isLoading() {
|
|
7083
7232
|
return !!__classPrivateFieldGet(this, _MedplumClient_profilePromise, "f");
|
|
7084
7233
|
}
|
|
7234
|
+
/**
|
|
7235
|
+
* @category User Profile
|
|
7236
|
+
*/
|
|
7085
7237
|
getProfile() {
|
|
7086
7238
|
return __classPrivateFieldGet(this, _MedplumClient_profile, "f");
|
|
7087
7239
|
}
|
|
7240
|
+
/**
|
|
7241
|
+
* @category User Profile
|
|
7242
|
+
*/
|
|
7088
7243
|
getProfileAsync() {
|
|
7089
7244
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7090
7245
|
if (__classPrivateFieldGet(this, _MedplumClient_profilePromise, "f")) {
|
|
@@ -7093,11 +7248,16 @@ class MedplumClient extends EventTarget {
|
|
|
7093
7248
|
return this.getProfile();
|
|
7094
7249
|
});
|
|
7095
7250
|
}
|
|
7251
|
+
/**
|
|
7252
|
+
* @category User Profile
|
|
7253
|
+
*/
|
|
7096
7254
|
getUserConfiguration() {
|
|
7097
7255
|
return __classPrivateFieldGet(this, _MedplumClient_config, "f");
|
|
7098
7256
|
}
|
|
7099
7257
|
/**
|
|
7100
7258
|
* Downloads the URL as a blob.
|
|
7259
|
+
*
|
|
7260
|
+
* @category Read
|
|
7101
7261
|
* @param url The URL to request.
|
|
7102
7262
|
* @returns Promise to the response body as a blob.
|
|
7103
7263
|
*/
|
|
@@ -7138,6 +7298,7 @@ class MedplumClient extends EventTarget {
|
|
|
7138
7298
|
/**
|
|
7139
7299
|
* Starts a new OAuth2 client credentials flow.
|
|
7140
7300
|
* See: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
|
|
7301
|
+
* @category Authentication
|
|
7141
7302
|
* @param clientId The client ID.
|
|
7142
7303
|
* @param clientSecret The client secret.
|
|
7143
7304
|
* @returns Promise that resolves to the client profile.
|
|
@@ -7345,6 +7506,7 @@ _MedplumClient_fetch = new WeakMap(), _MedplumClient_createPdf = new WeakMap(),
|
|
|
7345
7506
|
};
|
|
7346
7507
|
/**
|
|
7347
7508
|
* Returns the base URL for the current page.
|
|
7509
|
+
* @category HTTP
|
|
7348
7510
|
*/
|
|
7349
7511
|
function getBaseUrl() {
|
|
7350
7512
|
return window.location.protocol + '//' + window.location.host + '/';
|
|
@@ -10587,5 +10749,5 @@ function simplifyExpression(input) {
|
|
|
10587
10749
|
return result;
|
|
10588
10750
|
}
|
|
10589
10751
|
|
|
10590
|
-
export { AndAtom, ArithemticOperatorAtom, AsAtom, COMPONENT_SEPARATOR, ConcatAtom, ContainsAtom, DEFAULT_SEARCH_COUNT, DotAtom, EmptySetAtom, EqualsAtom, EquivalentAtom, FIELD_SEPARATOR, FhirPathAtom, FunctionAtom, Hl7Field, Hl7Message, Hl7Segment, InAtom, IndexerAtom, IsAtom, LRUCache, LiteralAtom, MedplumClient, NotEqualsAtom, NotEquivalentAtom, OperationOutcomeError, Operator, OrAtom, PropertyType, ReadablePromise, SEGMENT_SEPARATOR, SearchParameterType, SymbolAtom, UnaryOperatorAtom, UnionAtom, XorAtom, accessDenied, allOk, arrayBufferToBase64, arrayBufferToHex, assertOk, badRequest, booleanToTypedValue, buildTypeName, calculateAge, calculateAgeString, capitalize, createReference, createSchema, createTypeSchema, created, deepEquals$1 as deepEquals, evalFhirPath, evalFhirPathTyped, fhirPathArrayEquals, fhirPathArrayEquivalent, fhirPathEquals, fhirPathEquivalent, fhirPathIs, fhirPathNot, findObservationInterval, formatAddress, formatFamilyName, formatGivenName, formatHumanName, formatSearchQuery, getCodeBySystem, getDateProperty, getDisplayString, getExpressionForResourceType, getExtensionValue, getIdentifier, getImageSrc, getPropertyDisplayName, getQuestionnaireAnswers, getReferenceString, getSearchParameterDetails, getStatus, getTypedPropertyValue, globalSchema, gone, indexSearchParameter, indexStructureDefinition, indexStructureDefinitionBundle, isGone, isLowerCase, isNotFound, isObject$1 as isObject, isOk, isPeriod, isProfileResource, isQuantity, isQuantityEquivalent, isStringArray, isUUID, matchesRange, notFound, notModified, parseFhirPath, parseSearchDefinition, preciseEquals, preciseGreaterThan, preciseGreaterThanOrEquals, preciseLessThan, preciseLessThanOrEquals, removeDuplicates, resolveId, setCodeBySystem, stringify, toJsBoolean, toTypedValue, tokenize };
|
|
10752
|
+
export { AndAtom, ArithemticOperatorAtom, AsAtom, COMPONENT_SEPARATOR, ConcatAtom, ContainsAtom, DEFAULT_SEARCH_COUNT, DotAtom, EmptySetAtom, EqualsAtom, EquivalentAtom, FIELD_SEPARATOR, FhirPathAtom, FunctionAtom, Hl7Field, Hl7Message, Hl7Segment, InAtom, IndexerAtom, IsAtom, LRUCache, LiteralAtom, MedplumClient, NotEqualsAtom, NotEquivalentAtom, OperationOutcomeError, Operator, OrAtom, PropertyType, ReadablePromise, SEGMENT_SEPARATOR, SearchParameterType, SymbolAtom, UnaryOperatorAtom, UnionAtom, XorAtom, accessDenied, allOk, arrayBufferToBase64, arrayBufferToHex, assertOk, badRequest, booleanToTypedValue, buildTypeName, calculateAge, calculateAgeString, capitalize, createReference, createSchema, createTypeSchema, created, deepEquals$1 as deepEquals, evalFhirPath, evalFhirPathTyped, fhirPathArrayEquals, fhirPathArrayEquivalent, fhirPathEquals, fhirPathEquivalent, fhirPathIs, fhirPathNot, findObservationInterval, formatAddress, formatFamilyName, formatGivenName, formatHumanName, formatSearchQuery, getCodeBySystem, getDateProperty, getDisplayString, getExpressionForResourceType, getExtensionValue, getIdentifier, getImageSrc, getPropertyDisplayName, getQuestionnaireAnswers, getReferenceString, getSearchParameterDetails, getStatus, getTypedPropertyValue, globalSchema, gone, indexSearchParameter, indexStructureDefinition, indexStructureDefinitionBundle, isGone, isLowerCase, isNotFound, isObject$1 as isObject, isOk, isPeriod, isProfileResource, isQuantity, isQuantityEquivalent, isStringArray, isUUID, matchesRange, notFound, notModified, parseFhirPath, parseJWTPayload, parseSearchDefinition, preciseEquals, preciseGreaterThan, preciseGreaterThanOrEquals, preciseLessThan, preciseLessThanOrEquals, removeDuplicates, resolveId, setCodeBySystem, stringify, toJsBoolean, toTypedValue, tokenize };
|
|
10591
10753
|
//# sourceMappingURL=index.js.map
|