@medplum/core 0.9.20 → 0.9.21

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
@@ -6960,6 +6960,56 @@ class MedplumClient extends EventTarget {
6960
6960
  this.invalidateSearches(resourceType);
6961
6961
  return this.delete(this.fhirUrl(resourceType, id));
6962
6962
  }
6963
+ /**
6964
+ * Executes a batch or transaction of FHIR operations.
6965
+ *
6966
+ * Example:
6967
+ *
6968
+ * ```typescript
6969
+ * await medplum.executeBatch({
6970
+ * "resourceType": "Bundle",
6971
+ * "type": "transaction",
6972
+ * "entry": [
6973
+ * {
6974
+ * "fullUrl": "urn:uuid:61ebe359-bfdc-4613-8bf2-c5e300945f0a",
6975
+ * "resource": {
6976
+ * "resourceType": "Patient",
6977
+ * "name": [{ "use": "official", "given": ["Alice"], "family": "Smith" }],
6978
+ * "gender": "female",
6979
+ * "birthDate": "1974-12-25"
6980
+ * },
6981
+ * "request": {
6982
+ * "method": "POST",
6983
+ * "url": "Patient"
6984
+ * }
6985
+ * },
6986
+ * {
6987
+ * "fullUrl": "urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059",
6988
+ * "resource": {
6989
+ * "resourceType": "Patient",
6990
+ * "identifier": [{ "system": "http:/example.org/fhir/ids", "value": "234234" }],
6991
+ * "name": [{ "use": "official", "given": ["Bob"], "family": "Jones" }],
6992
+ * "gender": "male",
6993
+ * "birthDate": "1974-12-25"
6994
+ * },
6995
+ * "request": {
6996
+ * "method": "POST",
6997
+ * "url": "Patient",
6998
+ * "ifNoneExist": "identifier=http:/example.org/fhir/ids|234234"
6999
+ * }
7000
+ * }
7001
+ * ]
7002
+ * });
7003
+ * ```
7004
+ *
7005
+ * See The FHIR "batch/transaction" section for full details: https://hl7.org/fhir/http.html#transaction
7006
+ *
7007
+ * @param bundle The FHIR batch/transaction bundle.
7008
+ * @returns The FHIR batch/transaction response bundle.
7009
+ */
7010
+ executeBatch(bundle) {
7011
+ return this.post('fhir/R4', bundle);
7012
+ }
6963
7013
  /**
6964
7014
  * Sends an email using the Medplum Email API.
6965
7015
  *