-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from chronic-care/develop
Updates for 3.2.0
- Loading branch information
Showing
56 changed files
with
48,597 additions
and
15,223 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 55 additions & 92 deletions
147
src/app/active-diagnosis-panel/active-diagnosis-panel.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,83 @@ | ||
tr.mat-table { | ||
vertical-align: top; | ||
min-width: 500px; | ||
::ng-deep .header-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
width: 100%; | ||
padding: 10px; | ||
background: none !important; | ||
} | ||
|
||
tr.mat-header-row { | ||
min-height: 48px; | ||
height: 48px !important; | ||
::ng-deep .group-header { | ||
font-size: 2em; | ||
color: #4a148c !important; | ||
margin: 0; | ||
border: none !important; | ||
background: none !important; | ||
text-align: left !important; | ||
display: inline !important; | ||
} | ||
|
||
tr.mat-row { | ||
min-height: 24px; | ||
height: 24px !important; | ||
.filter-container { | ||
display: flex; | ||
align-items: center; | ||
margin-top: 10px; | ||
width: 100%; | ||
justify-content: space-between; | ||
} | ||
|
||
.mat-column-checked { | ||
word-wrap: break-word !important; | ||
white-space: unset !important; | ||
flex: 0 0 10% !important; | ||
width: 10% !important; | ||
overflow-wrap: break-word; | ||
word-wrap: break-word; | ||
|
||
word-break: break-word; | ||
|
||
-ms-hyphens: auto; | ||
-moz-hyphens: auto; | ||
-webkit-hyphens: auto; | ||
hyphens: auto; | ||
.filter-icon { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.mat-column-condition{ | ||
word-wrap: break-word !important; | ||
white-space: unset !important; | ||
flex: 0 0 60% !important; | ||
width: 60% !important; | ||
overflow-wrap: break-word; | ||
word-wrap: break-word; | ||
|
||
word-break: break-word; | ||
|
||
-ms-hyphens: auto; | ||
-moz-hyphens: auto; | ||
-webkit-hyphens: auto; | ||
hyphens: auto; | ||
.filter-search { | ||
display: flex; | ||
align-items: center; | ||
flex-grow: 1; | ||
margin-left: 10px; | ||
} | ||
|
||
.mat-column-rxfilter{ | ||
word-wrap: break-word !important; | ||
white-space: unset !important; | ||
flex: 0 0 5% !important; | ||
width: 5% !important; | ||
overflow-wrap: break-word; | ||
word-wrap: break-word; | ||
.filter-button { | ||
color: #1e88e5; | ||
font-weight: bold; | ||
} | ||
|
||
word-break: break-word; | ||
.filter-search input { | ||
width: 30%; | ||
border: none; | ||
border-bottom: 2px solid #ccc; | ||
padding: 5px; | ||
} | ||
|
||
-ms-hyphens: auto; | ||
-moz-hyphens: auto; | ||
-webkit-hyphens: auto; | ||
hyphens: auto; | ||
table.mat-table { | ||
width: 100%; | ||
border-collapse: collapse; | ||
} | ||
|
||
.mat-column-trend{ | ||
word-wrap: break-word !important; | ||
white-space: unset !important; | ||
flex: 0 0 5% !important; | ||
width: 5% !important; | ||
overflow-wrap: break-word; | ||
word-wrap: break-word; | ||
th.mat-header-cell, td.mat-cell { | ||
text-align: left; | ||
min-width: 200px; | ||
border: none !important; | ||
} | ||
|
||
word-break: break-word; | ||
th.mat-header-cell { | ||
font-weight: bold; | ||
font-size: 1.1em; | ||
border-bottom: 1px solid #ccc; /* Add bottom border to header cells */ | ||
} | ||
|
||
-ms-hyphens: auto; | ||
-moz-hyphens: auto; | ||
-webkit-hyphens: auto; | ||
hyphens: auto; | ||
tr.mat-header-row, tr.mat-row { | ||
border-bottom: 1px solid #ccc; /* Add bottom border to each row and header row */ | ||
} | ||
|
||
.mat-column-date{ | ||
.mat-column-condition, .mat-column-firstOnset, .mat-column-firstRecorded { | ||
word-wrap: break-word !important; | ||
white-space: unset !important; | ||
flex: 0 0 20% !important; | ||
width: 20% !important; | ||
overflow-wrap: break-word; | ||
word-wrap: break-word; | ||
|
||
word-break: break-word; | ||
|
||
-ms-hyphens: auto; | ||
-moz-hyphens: auto; | ||
-webkit-hyphens: auto; | ||
hyphens: auto; | ||
} | ||
|
||
th.mat-header-cell, td.mat-cell { | ||
text-align: left; | ||
border: 1px solid #CCC; | ||
|
||
} | ||
|
||
.app-active-diagnosis-panel { | ||
width: 100%; | ||
height: 100%; | ||
vertical-align: top; | ||
/* horiz-align: left; */ | ||
} | ||
|
||
.mat-expansion-panel-header-title { | ||
margin-right: 0; | ||
} | ||
|
||
table.mat-table { | ||
width: 100%; | ||
} | ||
|
||
table.mat-table th, table.mat-table td { | ||
border-left: none !important; | ||
border-right: none !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 35 additions & 34 deletions
69
src/app/active-diagnosis-panel/active-diagnosis-panel.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,67 @@ | ||
import { Component, OnInit, ViewChild } from '@angular/core'; | ||
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core'; | ||
import { DataService } from '../services/data.service'; | ||
import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; | ||
import { DiagnosisDialogComponent } from '../diagnosis-dialog/diagnosis-dialog.component'; | ||
import { Router } from '@angular/router'; | ||
import { MatSort, Sort } from '@angular/material/sort'; | ||
import { MatSort } from '@angular/material/sort'; | ||
import { MatTableDataSource } from '@angular/material/table'; | ||
import moment from 'moment'; | ||
import { MatPaginator } from '@angular/material/paginator'; | ||
|
||
import moment from 'moment'; | ||
|
||
@Component({ | ||
selector: 'app-active-diagnosis-panel', | ||
templateUrl: './active-diagnosis-panel.component.html', | ||
styleUrls: ['./active-diagnosis-panel.component.css'] | ||
}) | ||
export class ActiveDiagnosisPanelComponent implements OnInit { | ||
displayedColumns: string[] = ['code', 'rxfilter', 'trend', 'firstOnset', 'firstRecorded']; | ||
dataSource: any; | ||
export class ActiveDiagnosisPanelComponent implements OnInit, AfterViewInit { | ||
displayedColumns: string[] = ['code', 'asserter', 'firstOnset', 'firstRecorded']; | ||
dataSource: MatTableDataSource<any>; | ||
showFilter: any = false; | ||
|
||
@ViewChild(MatSort) sort: MatSort; | ||
@ViewChild(MatPaginator) paginator: MatPaginator; | ||
|
||
constructor(public dataservice: DataService, private dialog: MatDialog, private router: Router) { } | ||
constructor(public dataservice: DataService) {} | ||
|
||
ngOnInit(): void { | ||
this.dataSource = new MatTableDataSource(this.dataservice.conditions.activeConditions); | ||
// Convert date strings to Date objects | ||
const conditionsWithConvertedDates = this.dataservice.conditions.activeConditions.map(condition => ({ | ||
...condition, | ||
firstOnsetAsDate: moment(condition.firstOnsetAsText, 'MMM DD, YYYY').toDate(), | ||
firstRecordedAsDate: moment(condition.firstRecordedAsText, 'MMM DD, YYYY').toDate() | ||
})); | ||
|
||
// console.log("Converted Dates:", conditionsWithConvertedDates); | ||
|
||
this.dataSource = new MatTableDataSource(conditionsWithConvertedDates); | ||
|
||
this.dataSource.sortingDataAccessor = (item, property): string | number => { | ||
switch (property) { | ||
case "firstRecorded": return moment(item[property]).isValid() ? moment(item[property]).unix() : item[property]; | ||
case 'firstOnset': return moment(item[property]).isValid() ? moment(item[property]).unix() : item[property]; | ||
case 'code': return item[property].text.toUpperCase(); | ||
default: return item[property]; | ||
case "firstRecorded": | ||
return item.firstRecordedAsDate ? item.firstRecordedAsDate.getTime() : item.firstRecordedAsText; | ||
case 'firstOnset': | ||
return item.firstOnsetAsDate ? item.firstOnsetAsDate.getTime() : item.firstOnsetAsText; | ||
case 'code': | ||
return item[property].text.toUpperCase(); | ||
default: | ||
return item[property]; | ||
} | ||
}; | ||
} | ||
|
||
ngAfterViewInit() { | ||
ngAfterViewInit(): void { | ||
this.dataSource.sort = this.sort; | ||
this.dataSource.paginator = this.paginator; | ||
} | ||
|
||
applyFilter(event: Event): void { | ||
const filterValue = (event.target as HTMLInputElement).value.trim().toLowerCase(); | ||
|
||
openDialog(row) { | ||
const dialogConfig = new MatDialogConfig(); | ||
dialogConfig.disableClose = true; | ||
dialogConfig.autoFocus = true; | ||
dialogConfig.hasBackdrop = true; | ||
dialogConfig.width = '90%'; | ||
// dialogConfig.height = '1000px'; | ||
dialogConfig.data = { | ||
name: this.dataservice.demographic.name, | ||
condition: row.code.text, | ||
history: row.history | ||
this.dataSource.filterPredicate = (data: any, filter: string): boolean => { | ||
return data.code.text.toLowerCase().includes(filter); | ||
}; | ||
this.dialog.open(DiagnosisDialogComponent, dialogConfig); | ||
} | ||
|
||
switchToHM() { | ||
this.router.navigate(['/maint'], { queryParamsHandling: 'merge' }); | ||
this.dataSource.filter = filterValue; | ||
} | ||
|
||
switchToHS() { | ||
this.router.navigate(['/status'], { queryParamsHandling: 'merge' }); | ||
toggleFilter(): void { | ||
this.showFilter = !this.showFilter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.