c2-clinical 1.0.83 → 1.0.84
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.
|
@@ -15,7 +15,7 @@ class BuildFormulaFlowItem {
|
|
|
15
15
|
const variables = [...new Set(matches)];
|
|
16
16
|
for (const variable of variables) {
|
|
17
17
|
const variablePure = variable.match(/\$\{([^}]+)\}/) ?? [];
|
|
18
|
-
const questionAnswered = answers.find((a) => a.reference
|
|
18
|
+
const questionAnswered = answers.find((a) => a.reference?.code === variablePure[1]);
|
|
19
19
|
if (questionAnswered?.answer !== undefined && questionAnswered?.answer !== "") {
|
|
20
20
|
formula = formula.replaceAll(variable, questionAnswered?.answer);
|
|
21
21
|
}
|
package/dist/models/Answer.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
2
|
import { IDefault } from "./Default";
|
|
3
|
+
import { IFormUnit, IRequestGraphicData, IValidationQuestion } from "./form/FormUnit";
|
|
3
4
|
export interface IAnswer extends IDefault {
|
|
4
|
-
reference: IFormUnit;
|
|
5
|
+
reference: IFormUnit | Types.ObjectId;
|
|
5
6
|
validations: IValidationQuestion[];
|
|
6
7
|
requestGraphicData: IRequestGraphicData[];
|
|
7
8
|
answer: any;
|
package/package.json
CHANGED