@openmrs/ngx-formentry 3.1.2-pre.200 → 3.1.2-pre.207
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/bundles/openmrs-ngx-formentry.umd.js +26 -1
- package/bundles/openmrs-ngx-formentry.umd.js.map +1 -1
- package/esm2015/form-entry/helpers/js-expression-helper.js +27 -2
- package/fesm2015/openmrs-ngx-formentry.js +26 -1
- package/fesm2015/openmrs-ngx-formentry.js.map +1 -1
- package/form-entry/helpers/js-expression-helper.d.ts +4 -0
- package/package.json +1 -1
|
@@ -2114,6 +2114,29 @@
|
|
|
2114
2114
|
var obsValue = (_a = findObs(rawEncounter === null || rawEncounter === void 0 ? void 0 : rawEncounter.obs, uuid)) === null || _a === void 0 ? void 0 : _a.value;
|
|
2115
2115
|
return !!targetControl ? targetControl : typeof obsValue === 'object' ? obsValue.uuid : !!obsValue ? obsValue : null;
|
|
2116
2116
|
};
|
|
2117
|
+
JsExpressionHelper.prototype.doesNotMatchExpression = function (regexString, val) {
|
|
2118
|
+
if (!val || ['undefined', 'null', ''].includes(val.toString())) {
|
|
2119
|
+
return true;
|
|
2120
|
+
}
|
|
2121
|
+
var pattern = new RegExp(regexString);
|
|
2122
|
+
if (!pattern.test(val)) {
|
|
2123
|
+
return true;
|
|
2124
|
+
}
|
|
2125
|
+
return false;
|
|
2126
|
+
};
|
|
2127
|
+
JsExpressionHelper.prototype.calcGravida = function (parityTerm, parityAbortion) {
|
|
2128
|
+
var gravida = 0;
|
|
2129
|
+
if (Number.isInteger(parityTerm)) {
|
|
2130
|
+
gravida += parityTerm + 1;
|
|
2131
|
+
}
|
|
2132
|
+
if (Number.isInteger(parityAbortion)) {
|
|
2133
|
+
gravida += parityAbortion + 1;
|
|
2134
|
+
}
|
|
2135
|
+
if (Number.isInteger(parityTerm) && Number.isInteger(parityAbortion)) {
|
|
2136
|
+
gravida = parityTerm + parityAbortion + 1;
|
|
2137
|
+
}
|
|
2138
|
+
return gravida;
|
|
2139
|
+
};
|
|
2117
2140
|
Object.defineProperty(JsExpressionHelper.prototype, "helperFunctions", {
|
|
2118
2141
|
get: function () {
|
|
2119
2142
|
var helper = this;
|
|
@@ -2127,7 +2150,9 @@
|
|
|
2127
2150
|
isEmpty: helper.isEmpty,
|
|
2128
2151
|
arrayContains: helper.arrayContains,
|
|
2129
2152
|
extractRepeatingGroupValues: helper.extractRepeatingGroupValues,
|
|
2130
|
-
getObsFromControlOrEncounter: helper.getObsFromControlOrEncounter
|
|
2153
|
+
getObsFromControlOrEncounter: helper.getObsFromControlOrEncounter,
|
|
2154
|
+
doesNotMatchExpression: helper.doesNotMatchExpression,
|
|
2155
|
+
calcGravida: helper.calcGravida
|
|
2131
2156
|
};
|
|
2132
2157
|
},
|
|
2133
2158
|
enumerable: false,
|