@medplum/mock 2.0.1 → 2.0.3
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.cjs +17 -15
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/cjs/index.min.cjs.map +1 -1
- package/dist/cjs/repo.d.ts +1 -1
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.min.mjs.map +1 -1
- package/dist/esm/index.mjs +15 -13
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/repo.d.ts +1 -1
- package/dist/types/repo.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@medplum/core'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@medplum/core', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.medplum = global.medplum || {}, global.medplum.mock = {}), global.medplum.core, global
|
|
5
|
-
})(this, (function (exports, core,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@medplum/core'), require('rfc6902')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@medplum/core', 'rfc6902'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.medplum = global.medplum || {}, global.medplum.mock = {}), global.medplum.core, global.rfc6902));
|
|
5
|
+
})(this, (function (exports, core, rfc6902) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const ExampleAccessPolicy = {
|
|
8
8
|
resourceType: 'AccessPolicy',
|
|
@@ -16595,17 +16595,14 @@
|
|
|
16595
16595
|
}
|
|
16596
16596
|
async patchResource(resourceType, id, patch) {
|
|
16597
16597
|
const resource = this.readResource(resourceType, id);
|
|
16598
|
-
|
|
16599
|
-
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
const message = patchError.message?.split('\n')?.[0] || 'JSONPatch error';
|
|
16605
|
-
throw core.badRequest(message);
|
|
16598
|
+
const patchErrors = rfc6902.applyPatch(resource, patch);
|
|
16599
|
+
for (const error of patchErrors) {
|
|
16600
|
+
if (error) {
|
|
16601
|
+
const message = error.message?.split('\n')?.[0] || 'JSONPatch error';
|
|
16602
|
+
throw core.badRequest(message);
|
|
16603
|
+
}
|
|
16606
16604
|
}
|
|
16607
|
-
|
|
16608
|
-
return this.updateResource(patchedResource);
|
|
16605
|
+
return this.updateResource(resource);
|
|
16609
16606
|
}
|
|
16610
16607
|
readResource(resourceType, id) {
|
|
16611
16608
|
const resource = __classPrivateFieldGet(this, _MemoryRepository_resources, "f")?.[resourceType]?.[id];
|
|
@@ -16688,7 +16685,11 @@
|
|
|
16688
16685
|
menu: [
|
|
16689
16686
|
{
|
|
16690
16687
|
title: 'Favorites',
|
|
16691
|
-
link: [
|
|
16688
|
+
link: [
|
|
16689
|
+
{ name: 'Patients', target: '/Patient' },
|
|
16690
|
+
{ name: 'Active Orders', target: '/ServiceRequest?status=active' },
|
|
16691
|
+
{ name: 'Completed Orders', target: '/ServiceRequest?status=completed' },
|
|
16692
|
+
],
|
|
16692
16693
|
},
|
|
16693
16694
|
{
|
|
16694
16695
|
title: 'Admin',
|
|
@@ -16749,6 +16750,7 @@
|
|
|
16749
16750
|
}
|
|
16750
16751
|
return Promise.resolve({
|
|
16751
16752
|
ok: true,
|
|
16753
|
+
status: response?.resourceType === 'OperationOutcome' ? core.getStatus(response) : 200,
|
|
16752
16754
|
blob: () => Promise.resolve(response),
|
|
16753
16755
|
json: () => Promise.resolve(response),
|
|
16754
16756
|
});
|