@openmrs/ngx-formentry 3.2.1-pre.218 → 3.2.1-pre.224

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.
@@ -14432,8 +14432,10 @@
14432
14432
  if (node instanceof LeafNode ||
14433
14433
  (node instanceof GroupNode && node.question.extras.type === 'complex-obs')) {
14434
14434
  ___default["default"].each(obsArray, function (item) {
14435
- if (item.concept &&
14436
- item.concept.uuid === node.question.extras.questionOptions.concept) {
14435
+ var _a, _b;
14436
+ var questionId = _this.getQuestionIdFromFormFieldPath(item.formFieldPath);
14437
+ if ((questionId && questionId === ((_b = (_a = node === null || node === void 0 ? void 0 : node.question) === null || _a === void 0 ? void 0 : _a.extras) === null || _b === void 0 ? void 0 : _b.id)) ||
14438
+ (!questionId && item.concept && item.concept.uuid === node.question.extras.questionOptions.concept)) {
14437
14439
  found.push(item);
14438
14440
  }
14439
14441
  });
@@ -14570,10 +14572,25 @@
14570
14572
  }
14571
14573
  };
14572
14574
  ObsAdapterHelper.prototype.comparePath = function (first, second) {
14575
+ var _a, _b;
14573
14576
  if (!first || !second) {
14574
14577
  return -1;
14575
14578
  }
14576
- return Number(first.formFieldPath) - Number(second.formFieldPath);
14579
+ var firstNumber;
14580
+ if ((_a = first.formFieldPath) === null || _a === void 0 ? void 0 : _a.includes('~')) {
14581
+ firstNumber = first.formFieldPath.split('~', 1)[1];
14582
+ }
14583
+ else {
14584
+ firstNumber = first.formFieldPath;
14585
+ }
14586
+ var secondNumber;
14587
+ if ((_b = second.formFieldPath) === null || _b === void 0 ? void 0 : _b.includes('~')) {
14588
+ secondNumber = second.formFieldPath.split('~', 1)[1];
14589
+ }
14590
+ else {
14591
+ secondNumber = second.formFieldPath;
14592
+ }
14593
+ return Number(firstNumber) - Number(secondNumber);
14577
14594
  };
14578
14595
  ObsAdapterHelper.prototype.setNodeValue = function (node, obs) {
14579
14596
  switch (this.getObsNodeType(node)) {
@@ -14674,6 +14691,11 @@
14674
14691
  this.obsIndex++;
14675
14692
  return obs;
14676
14693
  };
14694
+ ObsAdapterHelper.prototype.getQuestionIdFromFormFieldPath = function (formFieldPath) {
14695
+ if (formFieldPath === null || formFieldPath === void 0 ? void 0 : formFieldPath.includes('~')) {
14696
+ return formFieldPath.split('~', 1)[0];
14697
+ }
14698
+ };
14677
14699
  ObsAdapterHelper.prototype.getSimpleObsPayload = function (node) {
14678
14700
  // check for empty values first
14679
14701
  if (this.isEmpty(node.control.value)) {