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