@medplum/core 0.9.11 → 0.9.12

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/esm/index.js CHANGED
@@ -1218,7 +1218,7 @@ const PATCH_CONTENT_TYPE = 'application/json-patch+json';
1218
1218
  * Search for a `Patient` by name:
1219
1219
  *
1220
1220
  * ```typescript
1221
- * const bundle = await medplum.search('Patient?name=Alice');
1221
+ * const bundle = await medplum.search('Patient', 'name=Alice');
1222
1222
  * console.log(bundle.total);
1223
1223
  * ```
1224
1224
  */
@@ -1500,7 +1500,9 @@ class MedplumClient extends EventTarget {
1500
1500
  */
1501
1501
  fhirSearchUrl(resourceType, query) {
1502
1502
  const url = this.fhirUrl(resourceType);
1503
- url.search = query.toString();
1503
+ if (query) {
1504
+ url.search = query.toString();
1505
+ }
1504
1506
  return url;
1505
1507
  }
1506
1508
  /**
@@ -1509,21 +1511,7 @@ class MedplumClient extends EventTarget {
1509
1511
  * Example using a FHIR search string:
1510
1512
  *
1511
1513
  * ```typescript
1512
- * const bundle = await client.search('Patient?name=Alice');
1513
- * console.log(bundle);
1514
- * ```
1515
- *
1516
- * Example using a structured search:
1517
- *
1518
- * ```typescript
1519
- * const bundle = await client.search({
1520
- * resourceType: 'Patient',
1521
- * filters: [{
1522
- * code: 'name',
1523
- * operator: 'eq',
1524
- * value: 'Alice',
1525
- * }]
1526
- * });
1514
+ * const bundle = await client.search('Patient', 'name=Alice');
1527
1515
  * console.log(bundle);
1528
1516
  * ```
1529
1517
  *
@@ -1568,7 +1556,7 @@ class MedplumClient extends EventTarget {
1568
1556
  * Example using a FHIR search string:
1569
1557
  *
1570
1558
  * ```typescript
1571
- * const patient = await client.searchOne('Patient?identifier=123');
1559
+ * const patient = await client.searchOne('Patient', 'identifier=123');
1572
1560
  * console.log(patient);
1573
1561
  * ```
1574
1562
  *
@@ -1602,7 +1590,7 @@ class MedplumClient extends EventTarget {
1602
1590
  * Example using a FHIR search string:
1603
1591
  *
1604
1592
  * ```typescript
1605
- * const patients = await client.searchResources('Patient?name=Alice');
1593
+ * const patients = await client.searchResources('Patient', 'name=Alice');
1606
1594
  * console.log(patients);
1607
1595
  * ```
1608
1596
  *