@oystehr/sdk 3.0.1 → 3.0.2
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 +45 -1
- 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/resources/classes/fhir-ext.d.ts +13 -0
- package/dist/cjs/resources/classes/fhir.d.ts +2 -0
- package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +1 -1
- package/dist/cjs/resources/types/fhir.d.ts +6 -3
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/resources/classes/fhir-ext.d.ts +13 -0
- package/dist/esm/resources/classes/fhir-ext.js +44 -2
- package/dist/esm/resources/classes/fhir-ext.js.map +1 -1
- package/dist/esm/resources/classes/fhir.d.ts +2 -0
- package/dist/esm/resources/classes/fhir.js +3 -1
- package/dist/esm/resources/classes/fhir.js.map +1 -1
- package/dist/esm/resources/types/ZambdaCreateParams.d.ts +1 -1
- package/dist/esm/resources/types/fhir.d.ts +6 -3
- package/package.json +1 -1
- package/src/resources/classes/fhir-ext.ts +69 -1
- package/src/resources/classes/fhir.ts +2 -0
- package/src/resources/types/ZambdaCreateParams.ts +1 -1
- package/src/resources/types/fhir.ts +4 -3
- package/dist/cjs/fhir/fhir-types.d.ts +0 -9
- package/dist/cjs/fhir/index.d.ts +0 -2
- package/dist/cjs/fhir/utils.d.ts +0 -14
- package/dist/esm/fhir/fhir-types.d.ts +0 -9
- package/dist/esm/fhir/index.d.ts +0 -2
- package/dist/esm/fhir/utils.d.ts +0 -14
- package/src/fhir/fhir-types.ts +0 -15
- package/src/fhir/index.ts +0 -2
- package/src/fhir/utils.ts +0 -68
package/dist/cjs/index.cjs
CHANGED
|
@@ -590,7 +590,7 @@ function search(params, request) {
|
|
|
590
590
|
}, {});
|
|
591
591
|
}
|
|
592
592
|
const requestBundle = yield this.fhirRequest(`/${resourceType}/_search`, 'POST')(paramMap, Object.assign(Object.assign({}, request), { contentType: 'application/x-www-form-urlencoded' }));
|
|
593
|
-
const bundle = Object.assign(Object.assign({}, requestBundle), { unbundle: function () {
|
|
593
|
+
const bundle = Object.assign(Object.assign({}, requestBundle), { entry: requestBundle.entry, unbundle: function () {
|
|
594
594
|
var _a, _b;
|
|
595
595
|
return (_b = (_a = this.entry) === null || _a === void 0 ? void 0 : _a.map((entry) => entry.resource).filter((entry) => entry !== undefined)) !== null && _b !== void 0 ? _b : [];
|
|
596
596
|
} });
|
|
@@ -694,6 +694,48 @@ function bundleRequest(type) {
|
|
|
694
694
|
}
|
|
695
695
|
const batch = bundleRequest('batch');
|
|
696
696
|
const transaction = bundleRequest('transaction');
|
|
697
|
+
function formatAddress(address, options) {
|
|
698
|
+
const builder = [];
|
|
699
|
+
if (address.line) {
|
|
700
|
+
builder.push(...address.line);
|
|
701
|
+
}
|
|
702
|
+
if (address.city || address.state || address.postalCode) {
|
|
703
|
+
const cityStateZip = [];
|
|
704
|
+
if (address.city) {
|
|
705
|
+
cityStateZip.push(address.city);
|
|
706
|
+
}
|
|
707
|
+
if (address.state) {
|
|
708
|
+
cityStateZip.push(address.state);
|
|
709
|
+
}
|
|
710
|
+
if (address.postalCode) {
|
|
711
|
+
cityStateZip.push(address.postalCode);
|
|
712
|
+
}
|
|
713
|
+
builder.push(cityStateZip.join(', '));
|
|
714
|
+
}
|
|
715
|
+
if (address.use && ((options === null || options === void 0 ? void 0 : options.all) || (options === null || options === void 0 ? void 0 : options.use))) {
|
|
716
|
+
builder.push('[' + address.use + ']');
|
|
717
|
+
}
|
|
718
|
+
return builder.join((options === null || options === void 0 ? void 0 : options.lineSeparator) || ', ').trim();
|
|
719
|
+
}
|
|
720
|
+
function formatHumanName(name, options) {
|
|
721
|
+
const builder = [];
|
|
722
|
+
if (name.prefix && (options === null || options === void 0 ? void 0 : options.prefix) !== false) {
|
|
723
|
+
builder.push(...name.prefix);
|
|
724
|
+
}
|
|
725
|
+
if (name.given) {
|
|
726
|
+
builder.push(...name.given);
|
|
727
|
+
}
|
|
728
|
+
if (name.family) {
|
|
729
|
+
builder.push(name.family);
|
|
730
|
+
}
|
|
731
|
+
if (name.suffix && (options === null || options === void 0 ? void 0 : options.suffix) !== false) {
|
|
732
|
+
builder.push(...name.suffix);
|
|
733
|
+
}
|
|
734
|
+
if (name.use && ((options === null || options === void 0 ? void 0 : options.all) || (options === null || options === void 0 ? void 0 : options.use))) {
|
|
735
|
+
builder.push('[' + name.use + ']');
|
|
736
|
+
}
|
|
737
|
+
return builder.join(' ').trim();
|
|
738
|
+
}
|
|
697
739
|
|
|
698
740
|
// AUTOGENERATED -- DO NOT EDIT
|
|
699
741
|
class Fhir extends SDKResource {
|
|
@@ -714,6 +756,8 @@ class Fhir extends SDKResource {
|
|
|
714
756
|
this.history = history;
|
|
715
757
|
this.batch = batch;
|
|
716
758
|
this.transaction = transaction;
|
|
759
|
+
this.formatAddress = formatAddress;
|
|
760
|
+
this.formatHumanName = formatHumanName;
|
|
717
761
|
}
|
|
718
762
|
}
|
|
719
763
|
|