Skip to content

Commit

Permalink
🔧 fix(ApeReportViewer.vue): remove unnecessary console.warn statement…
Browse files Browse the repository at this point in the history
…s and fix typo in comment

🔧 fix(EncounterPage.vue): remove unnecessary console.warn statement and fix typo in comment
The unnecessary console.warn statements have been removed from the code. Additionally, a typo in a comment has been fixed.
  • Loading branch information
jofftiquez committed Sep 12, 2023
1 parent 8522a90 commit e377965
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
30 changes: 14 additions & 16 deletions src/components/pme/ApeReportViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ export default {
// 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') {
// TODO: remove this. Replace with an inital logic to prefill the
// values from the medical records.
answer = value.answer || matchedToken.format(dataSource?.value);
}
// to force the value to be capitalized
Expand All @@ -438,26 +440,22 @@ export default {
const tokens = selectedApeReportTemplate.value?.match(regex) || [];
const values = encounterApeReport.value?.values || tokens.map(token => ({ id: token, answer: '' }));
const data = tokens.map(token => {
const id = token;
const found = values.find(value => {
// console.warn('token', token);
// console.warn('value.id', value.id);
return value.id === token;
});
console.warn('found', found);
const element = document.getElementById(found?.id);
const answer = element?.value || found?.answer || '';
return {
id,
answer,
};
});
const data = tokens
.map(token => {
const id = token;
const element = document.getElementById(id);
const answer = element?.value;
return {
id,
answer,
};
})
.filter(item => item.answer); // Filter out objects with falsy answers
return {
values: data,
template: apeFormTemplate?.value?.id,
report: apeFormTemplate.value?.template,
report: apeFormTemplate?.value?.template,
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/pme/EncounterPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,13 @@ export default {
console.warn('existing', existing?.apeReport);
if (existing?.apeReport?.id) {
console.warn('payload: update', payload);
if (status === 'done') payload.done = true;
if (status === 'classified') payload.classify = true;
if (status === 'completed') payload.finalize = true;
await sdk.service('medical-records').update(encounterApeReport.value?.id, payload);
} else {
// TODO: Perform copying of value from medical records to
// encounter ape report values
console.warn('payload: create', payload);
payload.type = 'ape-report';
payload.encounter = encounter.value?.id;
Expand Down

0 comments on commit e377965

Please sign in to comment.