@nsshunt/stsfhirclient 1.0.33 → 1.0.35
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/stsfhirclient.mjs +24 -13
- package/dist/stsfhirclient.mjs.map +1 -1
- package/dist/stsfhirclient.umd.js +24 -13
- package/dist/stsfhirclient.umd.js.map +1 -1
- package/package.json +10 -10
- package/types/FhirClient.d.ts +2 -2
- package/types/FhirClient.d.ts.map +1 -1
|
@@ -12,7 +12,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
12
12
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13
13
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
14
14
|
|
|
15
|
-
var _options, _DUMMY_USER, _invokeMethods, _maxRetries, _sleepDuration, _NoRetryStatusCodes, _stsfhirapiroot, _LogDebugMessage, _LogErrorMessage, _HandleError, _InvokeResourceAPI, _TestMode, ___InvokeResourceAPI;
|
|
15
|
+
var _options, _DUMMY_USER, _invokeMethods, _maxRetries, _sleepDuration, _NoRetryStatusCodes, _stsfhirapiroot, _LogDebugMessage, _LogErrorMessage, _HandleError, _InvokeResourceAPI, _TestMode, ___InvokeResourceAPI, _BuildQueryString;
|
|
16
16
|
const byteToHex = [];
|
|
17
17
|
for (let i = 0; i < 256; ++i) {
|
|
18
18
|
byteToHex.push((i + 256).toString(16).slice(1));
|
|
@@ -1613,7 +1613,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1613
1613
|
}
|
|
1614
1614
|
return responseCode;
|
|
1615
1615
|
});
|
|
1616
|
-
__privateAdd(this, _InvokeResourceAPI, async (url, httpVerb, domainResource, filters, errorCb) => {
|
|
1616
|
+
__privateAdd(this, _InvokeResourceAPI, async (url, httpVerb, domainResource, filters, searchParams, errorCb) => {
|
|
1617
1617
|
const id = v4();
|
|
1618
1618
|
__privateGet(this, _invokeMethods)[id] = {
|
|
1619
1619
|
id,
|
|
@@ -1623,6 +1623,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1623
1623
|
httpVerb,
|
|
1624
1624
|
domainResource,
|
|
1625
1625
|
filters,
|
|
1626
|
+
searchParams,
|
|
1626
1627
|
errorCb
|
|
1627
1628
|
};
|
|
1628
1629
|
const InvokeAPI = async (id2) => {
|
|
@@ -1713,16 +1714,25 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1713
1714
|
});
|
|
1714
1715
|
__publicField(this, "GetResource", async (resource, id, filters, errorCb) => {
|
|
1715
1716
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}/${id}`;
|
|
1716
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "get", null, filters, errorCb);
|
|
1717
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "get", null, filters, null, errorCb);
|
|
1717
1718
|
if (response) {
|
|
1718
1719
|
return response.data;
|
|
1719
1720
|
} else {
|
|
1720
1721
|
return null;
|
|
1721
1722
|
}
|
|
1722
1723
|
});
|
|
1723
|
-
|
|
1724
|
-
const url =
|
|
1725
|
-
const
|
|
1724
|
+
__privateAdd(this, _BuildQueryString, (baseUrl, queryParams) => {
|
|
1725
|
+
const url = new URL(baseUrl);
|
|
1726
|
+
const searchParams = new URLSearchParams(queryParams);
|
|
1727
|
+
url.search = searchParams.toString();
|
|
1728
|
+
return url.toString();
|
|
1729
|
+
});
|
|
1730
|
+
__publicField(this, "GetResources", async (resource, filters, searchParams, errorCb) => {
|
|
1731
|
+
let url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}`;
|
|
1732
|
+
if (searchParams) {
|
|
1733
|
+
url = __privateGet(this, _BuildQueryString).call(this, url, searchParams);
|
|
1734
|
+
}
|
|
1735
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "get", null, filters, searchParams, errorCb);
|
|
1726
1736
|
if (response) {
|
|
1727
1737
|
return response.data;
|
|
1728
1738
|
} else {
|
|
@@ -1731,7 +1741,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1731
1741
|
});
|
|
1732
1742
|
__publicField(this, "CreateResource", async (resource, domainResource, errorCb) => {
|
|
1733
1743
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}`;
|
|
1734
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "post", domainResource, null, errorCb);
|
|
1744
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "post", domainResource, null, null, errorCb);
|
|
1735
1745
|
if (response) {
|
|
1736
1746
|
if (response.status === StatusCodes.CREATED) {
|
|
1737
1747
|
return response.data;
|
|
@@ -1745,7 +1755,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1745
1755
|
});
|
|
1746
1756
|
__publicField(this, "UpdateResource", async (resource, domainResource, errorCb) => {
|
|
1747
1757
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}/${domainResource.id}`;
|
|
1748
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "put", domainResource, null, errorCb);
|
|
1758
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "put", domainResource, null, null, errorCb);
|
|
1749
1759
|
if (response) {
|
|
1750
1760
|
return response.data;
|
|
1751
1761
|
} else {
|
|
@@ -1754,7 +1764,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1754
1764
|
});
|
|
1755
1765
|
__publicField(this, "UpdateResources", async (resource, domainResources, errorCb) => {
|
|
1756
1766
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}`;
|
|
1757
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "put", domainResources, null, errorCb);
|
|
1767
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "put", domainResources, null, null, errorCb);
|
|
1758
1768
|
if (response) {
|
|
1759
1769
|
return response.data;
|
|
1760
1770
|
} else {
|
|
@@ -1763,7 +1773,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1763
1773
|
});
|
|
1764
1774
|
__publicField(this, "PatchResource", async (resource, domainResource, errorCb) => {
|
|
1765
1775
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}/${domainResource.id}`;
|
|
1766
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "patch", domainResource, null, errorCb);
|
|
1776
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "patch", domainResource, null, null, errorCb);
|
|
1767
1777
|
if (response) {
|
|
1768
1778
|
return response.data;
|
|
1769
1779
|
} else {
|
|
@@ -1772,7 +1782,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1772
1782
|
});
|
|
1773
1783
|
__publicField(this, "PatchResources", async (resource, domainResources, errorCb) => {
|
|
1774
1784
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}`;
|
|
1775
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "patch", domainResources, null, errorCb);
|
|
1785
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "patch", domainResources, null, null, errorCb);
|
|
1776
1786
|
if (response) {
|
|
1777
1787
|
return response.data;
|
|
1778
1788
|
} else {
|
|
@@ -1781,7 +1791,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1781
1791
|
});
|
|
1782
1792
|
__publicField(this, "DeleteResource", async (resource, id, errorCb) => {
|
|
1783
1793
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}/${id}`;
|
|
1784
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "delete", null, null, errorCb);
|
|
1794
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "delete", null, null, null, errorCb);
|
|
1785
1795
|
if (response) {
|
|
1786
1796
|
return response.data;
|
|
1787
1797
|
} else {
|
|
@@ -1790,7 +1800,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1790
1800
|
});
|
|
1791
1801
|
__publicField(this, "DeleteResources", async (resource, domainResources, errorCb) => {
|
|
1792
1802
|
const url = `${__privateGet(this, _options).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/${resource}`;
|
|
1793
|
-
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "delete", domainResources, null, errorCb);
|
|
1803
|
+
const response = await __privateGet(this, _InvokeResourceAPI).call(this, url, "delete", domainResources, null, null, errorCb);
|
|
1794
1804
|
if (response) {
|
|
1795
1805
|
return response.data;
|
|
1796
1806
|
} else {
|
|
@@ -1831,6 +1841,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
1831
1841
|
_InvokeResourceAPI = new WeakMap();
|
|
1832
1842
|
_TestMode = new WeakMap();
|
|
1833
1843
|
___InvokeResourceAPI = new WeakMap();
|
|
1844
|
+
_BuildQueryString = new WeakMap();
|
|
1834
1845
|
exports2.FhirClient = FhirClient;
|
|
1835
1846
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
1836
1847
|
});
|