Skip to content

Commit

Permalink
Display only unique entities in the Summary and remove save session a…
Browse files Browse the repository at this point in the history
…nd search buttons
  • Loading branch information
ShivaniMehendarge committed Mar 15, 2021
1 parent dffb8e0 commit d85cf1c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
12 changes: 11 additions & 1 deletion app/src/components/ExportPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}

Expand All @@ -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) => {
Expand Down
5 changes: 3 additions & 2 deletions app/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ export default function Header({
</Heading>
</div>
<div className={s.right}>
{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 && (
<button className={s.search} onClick={onSearch}>
Search
</button>
)}
)} */}
{stage === STAGE_SEARCH && (
<button onClick={onHome}>
<span />
Expand Down
5 changes: 3 additions & 2 deletions app/src/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -1053,11 +1053,12 @@ export default function Home() {
)}
</div>

{(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) && (
<Button className={s.SaveButton} onClick={handleSave} id={'i' + stage}>
Save Session
</Button>
)}
)} */}
</div>
);
}

0 comments on commit d85cf1c

Please sign in to comment.