Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display only unique entities in the Summary and remove buttons #68

Open
wants to merge 1 commit into
base: mainline
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}