@dmptool/utils 1.0.18 → 1.0.20
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/maDMP.js +6 -6
- package/package.json +1 -1
package/dist/maDMP.js
CHANGED
|
@@ -377,7 +377,7 @@ const loadNarrativeTemplateInfo = async (rdsConnectionParams, planId) => {
|
|
|
377
377
|
const narrative = {
|
|
378
378
|
id: results[0].templateId,
|
|
379
379
|
title: results[0].templateTitle,
|
|
380
|
-
description: results[0].templateDescription,
|
|
380
|
+
description: results[0].templateDescription !== null ? results[0].templateDescription : undefined,
|
|
381
381
|
version: results[0].templateVersion,
|
|
382
382
|
section: [],
|
|
383
383
|
};
|
|
@@ -391,22 +391,22 @@ const loadNarrativeTemplateInfo = async (rdsConnectionParams, planId) => {
|
|
|
391
391
|
curSection = {
|
|
392
392
|
id: row.sectionId,
|
|
393
393
|
title: row.sectionTitle,
|
|
394
|
-
description: row.sectionDescription,
|
|
395
|
-
order: row.sectionOrder,
|
|
394
|
+
description: row.sectionDescription !== null ? row.sectionDescription : undefined,
|
|
395
|
+
order: row.sectionOrder !== null ? row.sectionOrder : 0,
|
|
396
396
|
question: [],
|
|
397
397
|
};
|
|
398
398
|
narrative.section.push(curSection);
|
|
399
399
|
}
|
|
400
|
-
const hasAnswer = row.
|
|
400
|
+
const hasAnswer = row.answerJSON !== undefined && row.answerJSON !== null;
|
|
401
401
|
// Every row in the results represents a single question/answer pair
|
|
402
402
|
curSection.question.push({
|
|
403
403
|
id: row.questionId,
|
|
404
404
|
text: row.questionText,
|
|
405
|
-
order: row.questionOrder,
|
|
405
|
+
order: row.questionOrder !== null ? row.questionOrder : 0,
|
|
406
406
|
answer: hasAnswer
|
|
407
407
|
? {
|
|
408
408
|
id: row.answerId,
|
|
409
|
-
json: JSON.parse(row.
|
|
409
|
+
json: JSON.parse(row.answerJSON)
|
|
410
410
|
}
|
|
411
411
|
: undefined
|
|
412
412
|
});
|
package/package.json
CHANGED