Skip to content

Commit

Permalink
Merge pull request #53 from chronic-care/develop
Browse files Browse the repository at this point in the history
Updates for 3.2.0
  • Loading branch information
swmuir authored Sep 20, 2024
2 parents fd60379 + 1d9d833 commit 06d8ea9
Show file tree
Hide file tree
Showing 56 changed files with 48,597 additions and 15,223 deletions.
29,687 changes: 29,676 additions & 11 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ecareplanner",
"version": "3.1.7",
"version": "3.2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -18,7 +18,7 @@
"@angular/compiler": "^10.2.1",
"@angular/core": "^10.2.1",
"@angular/fire": "^6.0.2",
"@angular/flex-layout": "^10.0.0-beta.32",
"@angular/flex-layout": "10.0.0-beta.32",
"@angular/forms": "^10.2.1",
"@angular/material": "^10.2.6",
"@angular/platform-browser": "^10.2.1",
Expand All @@ -35,6 +35,8 @@
"chartjs-plugin-annotation": "^0.5.7",
"classlist.js": "^1.1.20150312",
"clone": "^2.1.2",
"e-care-common-data-services": "^1.2.11",
"ecareplanner": "file:",
"firebase": "^7.24.0",
"flex-layout-srcs": "github:angular/flex-layout",
"json-schema-to-typescript": "^8.2.0",
Expand All @@ -45,8 +47,7 @@
"react-dom": "^16.13.1",
"rxjs": "~6.6.3",
"tslib": "^2.0.0",
"zone.js": "~0.10.2",
"e-care-common-data-services": "^1.2.10"
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/architect": "^0.1001.0",
Expand Down
147 changes: 55 additions & 92 deletions src/app/active-diagnosis-panel/active-diagnosis-panel.component.css
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;
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
<mat-panel-title class="group-header">Active Diagnoses</mat-panel-title>
<div class="header-container">
<mat-panel-title class="group-header">Problem List</mat-panel-title>
<div class="filter-container">
<div class="filter-icon">
<button mat-button class="filter-button" (click)="toggleFilter()">
<mat-icon>search</mat-icon>
SEARCH
</button>
</div>
<div class="filter-search" *ngIf="showFilter">
<input matInput (keyup)="applyFilter($event)" placeholder="Search Active diagnosis">
</div>
</div>
</div>

<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="code">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Condition</th>
<td style="cursor: pointer;" (click)="openDialog(condition)" mat-cell *matCellDef="let condition">
{{condition.code.text}}
</td>
</ng-container>
<ng-container matColumnDef="rxfilter">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let condition" (click)="$event.stopPropagation()">
<mat-icon *ngIf="condition.profileId!=null" (click)="switchToHM()" style="cursor: pointer;"
matTooltip="Switch to Health Maintenance using this codition as a focus"
aria-label="Selection to change to the Health Maintance and Intervention tab using this condition as a focus">
local_pharmacy</mat-icon>
</td>
<td mat-cell *matCellDef="let condition">{{condition.code.text}}</td>
</ng-container>
<!-- Trend Filter -->
<ng-container matColumnDef="trend">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let condition" (click)="$event.stopPropagation()">
<mat-icon *ngIf="condition.profileId != null" (click)="switchToHS()" style="cursor: pointer;"
matTooltip="Switch to Heath Status using this condition as a focus"
aria-label="Selection to change to the the Health Status Evaluation and Outcomes using this condition as a focus">
timeline</mat-icon>
</td>
<ng-container matColumnDef="asserter">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Recording Clinician</th>
<td mat-cell *matCellDef="let condition">{{condition.asserter | nullCheck }}</td>
</ng-container>
<!-- Date -->
<ng-container matColumnDef="firstOnset">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Date of Initial Diagnosis</th>
<td mat-cell *matCellDef="let condition">{{condition.firstOnsetAsText | nullCheck }}</td>
Expand All @@ -37,8 +33,4 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator *ngIf="dataservice.conditions.activeConditions.length > 10" [pageSizeOptions]="[5, 10, 20,30]"
[pageSize]="20" showFirstLastButtons></mat-paginator>


<!-- <button>Mark selected as inactive</button> -->
<mat-paginator [pageSizeOptions]="[5, 10, 20, 30]" showFirstLastButtons></mat-paginator>
69 changes: 35 additions & 34 deletions src/app/active-diagnosis-panel/active-diagnosis-panel.component.ts
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;
}
}
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import { MedicationDialogComponent } from './medication-dialog/medication-dialog
import { GoalDialogComponent } from './goals-dialog/goal-dialog.component';
import { ActiveOrdersPanelComponent } from './active-orders-panel/active-orders-panel.component';
import { WarningPopupComponent } from './warning-popup/warning-popup.component';
import { AssessmentSectionComponent } from './assessment-section/assessment-section.component';

const routes: Routes = []; // sets up routes constant where you define your routes

Expand Down Expand Up @@ -105,7 +106,8 @@ const routes: Routes = []; // sets up routes constant where you define your rout
ConsolidatedGoalsComponent,
Testgraph1Component,
NullCheckPipe,
WarningPopupComponent
WarningPopupComponent,
AssessmentSectionComponent
],
imports: [
MatSortModule,
Expand Down
Loading

0 comments on commit 06d8ea9

Please sign in to comment.