Skip to content

Commit

Permalink
last header no longer has hr
Browse files Browse the repository at this point in the history
  • Loading branch information
jessewashburn committed Jan 3, 2025
1 parent 6c42dee commit b376345
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/app/health/health-event-dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ <h4 class="primary-text-color" i18n>Conditions</h4>
<p>{{conditions}}</p>
</ng-container>
<h4 class="primary-text-color" *ngIf="hasConditionAndTreatment" i18n>Other Notes</h4>
<div *ngIf="event.notes"><p><b i18n>Observations & Notes: </b><td-markdown [content]="event.notes"></td-markdown></p><hr></div>
<div *ngIf="event.diagnosis"><p><b i18n>Diagnosis: </b><td-markdown [content]="event.diagnosis"></td-markdown></p><hr></div>
<div *ngIf="event.treatments"><p><b i18n>Treatments: </b><td-markdown [content]="event.treatments"></td-markdown></p><hr></div>
<div *ngIf="event.medications"><p><b i18n>Medications: </b><td-markdown [content]="event.medications"></td-markdown></p><hr></div>
<div *ngIf="event.immunizations"><p><b i18n>Immunizations: </b><td-markdown [content]="event.immunizations"></td-markdown></p><hr></div>
<div *ngIf="event.allergies"><p><b i18n>Allergies: </b><td-markdown [content]="event.allergies"></td-markdown></p><hr></div>
<div *ngIf="event.xrays"><p><b i18n>X-rays: </b><td-markdown [content]="event.xrays"></td-markdown></p><hr></div>
<div *ngIf="event.tests"><p><b i18n>Lab Tests: </b><td-markdown [content]="event.tests"></td-markdown></p><hr></div>
<div *ngIf="event.notes"><p><b i18n>Observations & Notes: </b><td-markdown [content]="event.notes"></td-markdown></p><hr *ngIf="!isLastSection('notes')"></div>
<div *ngIf="event.diagnosis"><p><b i18n>Diagnosis: </b><td-markdown [content]="event.diagnosis"></td-markdown></p><hr *ngIf="!isLastSection('diagnosis')"></div>
<div *ngIf="event.treatments"><p><b i18n>Treatments: </b><td-markdown [content]="event.treatments"></td-markdown></p><hr *ngIf="!isLastSection('treatments')"></div>
<div *ngIf="event.medications"><p><b i18n>Medications: </b><td-markdown [content]="event.medications"></td-markdown></p><hr *ngIf="!isLastSection('medications')"></div>
<div *ngIf="event.immunizations"><p><b i18n>Immunizations: </b><td-markdown [content]="event.immunizations"></td-markdown></p><hr *ngIf="!isLastSection('immunizations')"></div>
<div *ngIf="event.allergies"><p><b i18n>Allergies: </b><td-markdown [content]="event.allergies"></td-markdown></p><hr *ngIf="!isLastSection('allergies')"></div>
<div *ngIf="event.xrays"><p><b i18n>X-rays: </b><td-markdown [content]="event.xrays"></td-markdown></p><hr *ngIf="!isLastSection('xrays')"></div>
<div *ngIf="event.tests"><p><b i18n>Lab Tests: </b><td-markdown [content]="event.tests"></td-markdown></p><hr *ngIf="!isLastSection('tests')"></div>
<div *ngIf="event.referrals"><p><b i18n>Referrals: </b><td-markdown [content]="event.referrals"></td-markdown></p></div>
</mat-dialog-content>
<mat-dialog-actions>
Expand Down
31 changes: 31 additions & 0 deletions src/app/health/health-event-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,35 @@ export class HealthEventDialogComponent implements OnInit, OnDestroy {
this.seconds = parseInt(seconds, 10) < 10 ? '0' + seconds : seconds;
}

hasMultipleSections(): boolean {
const sections = [
this.event.notes,
this.event.diagnosis,
this.event.treatments,
this.event.medications,
this.event.immunizations,
this.event.allergies,
this.event.xrays,
this.event.tests,
this.event.referrals
];
return sections.filter(section => section).length > 1;
}

isLastSection(section: string): boolean {
const sections = [
'notes',
'diagnosis',
'treatments',
'medications',
'immunizations',
'allergies',
'xrays',
'tests',
'referrals'
];
const activeSections = sections.filter(sec => this.event[sec]);
return activeSections[activeSections.length - 1] === section;
}

}

0 comments on commit b376345

Please sign in to comment.