Skip to content

Commit

Permalink
Added support to check time from global properties
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgaspardev committed Dec 13, 2024
1 parent 30c0450 commit e3566ec
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class ClinicalNotesComponent implements OnInit {
@Input() provider: any;
@Input() clinicConfigurations: any;
@Input() forms: any[];
@Input() clearingFormTime?: number;
savingObservations$: Observable<boolean>;
ordersUpdates$: Observable<any>;

Expand All @@ -46,7 +47,7 @@ export class ClinicalNotesComponent implements OnInit {
currentCustomFormName: string;
formData: any;
searchingText: string;
clearingFormTime: number;

atLeastOneFieldHasData: boolean = false;
currentFormHasRequiredData: boolean = false;
dependedFormHasData: boolean = false;
Expand All @@ -64,7 +65,6 @@ export class ClinicalNotesComponent implements OnInit {
) {}

ngOnInit(): void {
this.clearingFormTime = 0.5;
this.clinicConfigurations = {
...this.clinicConfigurations,
forms: keyBy(
Expand All @@ -90,7 +90,7 @@ export class ClinicalNotesComponent implements OnInit {
(key) => this.clinicalObservations[key]?.latest
);
const concepts = identifyConceptsFromFormattedForm(this.currentCustomForm);
this.loadGlobalProperty();
// this.loadGlobalProperty();
// this.currentFormHasRequiredData =
// (
// Object.keys(this.clinicalObservations).filter(
Expand Down Expand Up @@ -187,17 +187,6 @@ export class ClinicalNotesComponent implements OnInit {
}
}

async loadGlobalProperty() {
try {
const globalProperty = await this.globalSettingService.getSpecificGlobalProperties("ed9dac4a-5b2a-4a5f-8ee2-ca0d88b08506").toPromise();
const minutes = parseInt(globalProperty?.value ?? "0", 10);
this.clearingFormTime = isNaN(minutes / 60) ? 0.5 : minutes / 60;
} catch (error) {
console.error("Error occurred:", error);
this.clearingFormTime = 0.5;
}
}

onCloseMessage(event: Event): void {
event.stopPropagation();
this.showMessage = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,33 @@
<mat-icon>arrow_back</mat-icon>
Back to Client List
</button>
<a mat-icon-button class="mr-4" (click)="toggleSideBarMenu($event)">

<div class="row">
<div *ngFor="let form of dashboardParams?.forms" class="form-button-wrapper">
<button
class="buttonstyle"
mat-stroked-button
[ngClass]="{
'selected-form':
(selectedForm &&
!showHistoryDetails &&
selectedForm?.uuid === form?.uuid) ||
(!selectedForm &&
!showHistoryDetails &&
dashboardParams?.forms[0] &&
dashboardParams?.forms[0]?.uuid === form?.uuid)
}"
(click)="getSelectedForm($event, form)"
>
{{ form?.name }}
</button>
</div>
</div>


<!-- <a mat-icon-button class="mr-4" (click)="toggleSideBarMenu($event)">
<mat-icon>menu</mat-icon>
</a>
</a> -->
<ng-container *ngIf="!useSideBar"> </ng-container>
</div>

Expand Down Expand Up @@ -509,6 +533,7 @@
[shouldUseOwnFormSelection]="false"
[clinicConfigurations]="clinicConfigurations"
[provider]="dashboardParams?.provider"
[clearingFormTime]="clearingFormTime"
(updateConsultationOrder)="onUpdateConsultationOrder()"
[selectedForm]="
selectedForm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ button:hover {
button {
outline: none !important;
}
.buttonstyle{
margin-left: 10px;
}

.patient-dashboard-container {
padding-bottom: 5px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import { GoogleAnalyticsService } from "src/app/google-analytics.service";
import { SharedRemotePatientHistoryModalComponent } from "../../dialogs/shared-remote-patient-history-modal/shared-remote-patient-history-modal.component";
import { MatRadioChange } from "@angular/material/radio";
import { LocationService } from "src/app/core/services";
import { GlobalSettingService } from "../../resources/global-setting/services";

@Component({
selector: "app-shared-patient-dashboard",
Expand Down Expand Up @@ -156,6 +157,7 @@ export class SharedPatientDashboardComponent implements OnInit {
tabsToShow: string[] = ["LABORATORY", "PROCEDURE", "RADIOLOGY"];
currentFormDetails: any = {};
useSideBar: boolean = false;
clearingFormTime: number = 0.5;

selectedHistoryCategory: string = "local";

Expand All @@ -171,6 +173,7 @@ export class SharedPatientDashboardComponent implements OnInit {
private userService: UserService,
private conceptService: ConceptsService,
private billingService: BillingService,
private globalSettingService: GlobalSettingService,
private googleAnalyticsService: GoogleAnalyticsService,
private locationService: LocationService
) {
Expand All @@ -187,7 +190,6 @@ export class SharedPatientDashboardComponent implements OnInit {
obs?.concept?.uuid === this.visitEndingControlStatusesConceptUuid
) || [])[0]?.valueObject;
}
// console.log("Active visit are .............................................",this.activeVisit);
this.onStartConsultation(this.activeVisit);
this.store.dispatch(loadOrderTypes());
this.orderTypes$ = this.store.select(getAllOrderTypes);
Expand Down Expand Up @@ -366,9 +368,19 @@ export class SharedPatientDashboardComponent implements OnInit {
event.stopPropagation();
this.useSideBar = !this.useSideBar;
}
async loadGlobalProperty() {
try {
const globalProperty = await this.globalSettingService.getSpecificGlobalProperties("ed9dac4a-5b2a-4a5f-8ee2-ca0d88b08506").toPromise();
const minutes = parseInt(globalProperty?.value ?? "0", 10);
this.clearingFormTime = isNaN(minutes / 60) ? 0.5 : minutes / 60;
console.log("time received :",this.clearingFormTime);
} catch (error) {
console.error("Error occurred:", error);
this.clearingFormTime = 0.5;
}
}

onToggleVitalsSummary(event: Event): void {
console.log("data tracing ...............");
console.log(event);
event.stopPropagation();
this.trackActionForAnalytics(`View Vitals: Open`);
Expand All @@ -377,6 +389,7 @@ export class SharedPatientDashboardComponent implements OnInit {

getSelectedForm(event: Event, form: any): void {
this.trackActionForAnalytics(`${form?.name}: Open`);
this.loadGlobalProperty();
this.readyForClinicalNotes = false;
if (event) {
event.stopPropagation();
Expand Down

0 comments on commit e3566ec

Please sign in to comment.