diff --git a/src/components/pme/ApeReportViewer.vue b/src/components/pme/ApeReportViewer.vue index 9381d8c..97ab881 100644 --- a/src/components/pme/ApeReportViewer.vue +++ b/src/components/pme/ApeReportViewer.vue @@ -405,10 +405,17 @@ export default { */ if (!matchedToken?.readonly) { const label = generateLabelFromId(value.id); - let element = ``; + + // NOTE: What's the priority? The value from the encounter or the value from the data source? + let answer = value.answer; + if (matchedToken.dataSource === 'medical-records') { + answer = matchedToken.format(dataSource?.value); + } + + let element = ``; switch (matchedToken?.inputType) { case 'textarea': { - element = ``; + element = ``; } } report = report.replace(`{${value.id}}`, element); @@ -470,17 +477,6 @@ export default { return item || { choices: [] }; } - onMounted(() => { - // const link = document.createElement('link'); - // link.setAttribute('rel', 'stylesheet'); - // link.setAttribute('href', 'https://necolas.github.io/normalize.css/8.0.1/normalize.css'); - // const paperView = document.getElementById('paper-view'); - // console.warn('paperView', paperView); - // console.warn('link', link); - // paperView.appendChild(link); - // document.head.appendChild(link); - }); - return { apeEncounter, apeReportCreatedAt,