From d85cf1c382166fdbb70f5b9050c3b0895b185973 Mon Sep 17 00:00:00 2001 From: Shivani Mehendarge Date: Fri, 12 Mar 2021 18:12:19 -0800 Subject: [PATCH] Display only unique entities in the Summary and remove save session and search buttons --- app/src/components/ExportPane.js | 12 +++++++++++- app/src/components/Header.js | 5 +++-- app/src/home.js | 5 +++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/src/components/ExportPane.js b/app/src/components/ExportPane.js index d570b56..19bbfcd 100755 --- a/app/src/components/ExportPane.js +++ b/app/src/components/ExportPane.js @@ -16,6 +16,8 @@ const getFormattedCategorySummary = (category, filteredResults) => { if (isMedicalCondition || isMedication) { const conceptProperty = isMedicalCondition ? 'ICD10CMConcepts' : 'RxNormConcepts'; + const uniqueSelectedConceptCodes = []; + return filteredResults .map((result) => { const text = result.Text; @@ -24,8 +26,16 @@ const getFormattedCategorySummary = (category, filteredResults) => { if (!concepts) return text; const selectedConcept = getSelectedConcept(result); + + if ( + uniqueSelectedConceptCodes.some((concept) => concept.Code === selectedConcept.Code && concept.text === text) + ) + return null; + uniqueSelectedConceptCodes.push({ Code: selectedConcept.Code, text: text }); + return `${text}|${selectedConcept.Code}|${selectedConcept.Description}`; }) + .filter((result) => result !== null) .join('\n'); } @@ -36,7 +46,7 @@ const getFormattedCategorySummary = (category, filteredResults) => { : 'N/A'; }; -const SUMMARY_CATEGORIES = ['MEDICATION', 'ANATOMY', 'MEDICAL_CONDITION', 'TEST_TREATMENT_PROCEDURE']; +const SUMMARY_CATEGORIES = ['MEDICATION', 'MEDICAL_CONDITION', 'TEST_TREATMENT_PROCEDURE']; const SUMMARY_CATEGORIES_SET = new Set(SUMMARY_CATEGORIES); const getFormattedCategorySummaries = (results) => { diff --git a/app/src/components/Header.js b/app/src/components/Header.js index 55a8f0b..5019c8d 100755 --- a/app/src/components/Header.js +++ b/app/src/components/Header.js @@ -39,11 +39,12 @@ export default function Header({
- {stage !== STAGE_SEARCH_EXPORT && stage !== STAGE_SEARCH && ( + {/* This hides the Search button in the header that allows to Search for saved sessions. + {stage !== STAGE_SEARCH_EXPORT && stage !== STAGE_SEARCH && ( - )} + )} */} {stage === STAGE_SEARCH && (
- {(stage === STAGE_TRANSCRIBED || stage === STAGE_SOAP_REVIEW) && ( + {/* This hides the Save session button that appears after the transcription is complete */} + {/* {(stage === STAGE_TRANSCRIBED || stage === STAGE_SOAP_REVIEW) && ( - )} + )} */} ); }