From c9512f66eaa31bcfb3aed6d3dea8cfd284dcee8b Mon Sep 17 00:00:00 2001 From: Avanti Patil Date: Sun, 27 Feb 2022 16:18:40 +0530 Subject: [PATCH 1/3] -get lab orders fixed in clinical module -print medication add into clinical medication -OPD-Examination add for Examination change -Hide Medication from order module -changes for medication print page --- .../DanpheEMR.DalLayer/BillingDbContext.cs | 3 + .../Controllers/Billing/BillingController.cs | 3 +- .../OPD-Examination.component.html | 128 +++++++++++++ .../OPD-Examination.component.ts | 178 ++++++++++++++++++ .../src/app/clinical-notes/notes.module.ts | 4 +- .../shared/OPD-Examination.model.ts | 9 + .../home-medication-list.component.ts | 8 +- .../dashboard/doctor-dashboard.component.ts | 18 +- .../doctors/dashboard/doctor-dashboard.html | 5 + .../order/order-requisition.component.ts | 1 + .../src/app/orders/order/print-order.ts | 52 ++++- .../grid-column-settings.constant.ts | 3 +- .../clinical-view/HomeMedicationList.html | 5 + .../src/app/view/order-view/OrderMain.html | 16 +- .../app/view/order-view/PrintMedications.html | 46 ++--- 15 files changed, 440 insertions(+), 39 deletions(-) create mode 100644 Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.html create mode 100644 Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.ts create mode 100644 Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/shared/OPD-Examination.model.ts diff --git a/Code/Components/DanpheEMR.DalLayer/BillingDbContext.cs b/Code/Components/DanpheEMR.DalLayer/BillingDbContext.cs index bccc9c7a..349a55d6 100644 --- a/Code/Components/DanpheEMR.DalLayer/BillingDbContext.cs +++ b/Code/Components/DanpheEMR.DalLayer/BillingDbContext.cs @@ -92,6 +92,8 @@ public BillingDbContext(string conn) : base(conn) this.AuditDisabled = true; } + public DbSet IntegrationName { get; set; } + protected override void OnModelCreating(DbModelBuilder modelBuilder) { @@ -171,6 +173,7 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) modelBuilder.Entity().ToTable("CFG_PrinterSettings"); modelBuilder.Entity().ToTable("Lab_MST_LabVendors"); + modelBuilder.Entity().ToTable("ServiceDepartment_MST_IntegrationName"); } //Sud: 14sept'18 -- diff --git a/Code/Websites/DanpheEMR/Controllers/Billing/BillingController.cs b/Code/Websites/DanpheEMR/Controllers/Billing/BillingController.cs index ae321b4d..2fdc646d 100644 --- a/Code/Websites/DanpheEMR/Controllers/Billing/BillingController.cs +++ b/Code/Websites/DanpheEMR/Controllers/Billing/BillingController.cs @@ -3661,7 +3661,8 @@ public string Post() srvDepartment = (from billItem in billingDbContext.BillItemPrice join srvDept in billingDbContext.ServiceDepartment on billItem.ServiceDepartmentId equals srvDept.ServiceDepartmentId join dept in billingDbContext.Departments on srvDept.DepartmentId equals dept.DepartmentId - where (dept.DepartmentName.ToLower() == req.DepartmentName.ToLower() + join sd in billingDbContext.IntegrationName on srvDept.IntegrationName.ToLower() equals sd.IntegrationName.ToLower() + where (sd.IntegrationName.ToLower() == req.DepartmentName.ToLower() && billItem.ItemName.ToLower() == req.ItemName.ToLower()) select srvDept).FirstOrDefault(); } diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.html b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.html new file mode 100644 index 00000000..33f4d0d8 --- /dev/null +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.html @@ -0,0 +1,128 @@ + +
+ + + + + + + +
+
+ + + + +
+
+
+
+

Instructions

+
+
+
+ +
+
+
+ +
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+ +
+ \ No newline at end of file diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.ts new file mode 100644 index 00000000..ef8e61d8 --- /dev/null +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/OPDExamination/OPD-Examination.component.ts @@ -0,0 +1,178 @@ +import { Component, Output, EventEmitter, Input } from "@angular/core"; +import * as moment from 'moment/moment'; +import { Patient } from "../../patients/shared/patient.model"; +import { Visit } from "../../appointments/shared/visit.model"; +import { NotesModel } from "../shared/notes.model"; +import { PatientClinicalDetail } from "../../clinical/shared/patient-clinical-details.vmodel"; +import { AssessmentAndPlanModel, DiagnosisOrderVM } from "../shared/assessment-and-plan.model"; +import { VisitService } from "../../appointments/shared/visit.service"; +import { MessageboxService } from "../../shared/messagebox/messagebox.service"; +import { CoreService } from "../../core/shared/core.service"; +import { NoteTemplateBLService } from "../shared/note-template.bl.service"; +import { PatientService } from "../../patients/shared/patient.service"; +import { PatientOrderListModel } from "../../clinical/shared/order-list.model"; +import { OPDExaminationModel } from "../shared/OPD-Examination.model"; + +@Component({ + selector: "OPD-Examination", + templateUrl: "./OPD-Examination.component.html", +}) + +export class OPDExaminationComponent{ + public pat: Patient = new Patient(); + public patVisit: Visit = new Visit(); + public date: string = null; + public selectedDepartment: any = null; + public notes: NotesModel = new NotesModel(); + public FollowUp = { + Number: 0, + Unit: 'Days', + } + public clinicalDetail: PatientClinicalDetail = new PatientClinicalDetail(); + + @Output() + public outPutHpNote: EventEmitter = new EventEmitter(); + public assessment: AssessmentAndPlanModel = new AssessmentAndPlanModel(); + public showAP: boolean = false; + public APeditMode: boolean = false; + public assessmentForEdit: any; + public showSOnotes: boolean = false; + public showExamination : boolean = true; + constructor(public visitService: VisitService, + public msgBoxServ: MessageboxService, + public coreService: CoreService, + public notetemplateBLService: NoteTemplateBLService, + public patientService: PatientService) { + this.pat = this.patientService.globalPatient; + this.patVisit = this.visitService.globalVisit, + this.date = moment().format("YYYY-MM-DD,h:mm:ss a"); + + } + @Input('OPD-Examination') + public opdExamination: OPDExaminationModel = new OPDExaminationModel(); + @Output("Examination") + Examination: EventEmitter = new EventEmitter(); + @Input('editHpNote') + public set HpNote(hpNote: any) { + if (this.notetemplateBLService.NotesId != 0) { + //this.editMode = true; + this.notes = hpNote; + console.log("notes in hp component, edit input:"); + console.log(this.notes); + + // get assessment orders + this.GetAllOrders(this.notes.NotesId); + this.APeditMode = true; + this.showSOnotes = true; + + } else { + this.showSOnotes = true; + this.showAP = true; + } + } + + public GetAllOrders(NoteId) { + this.notetemplateBLService.GetAllOrdersByNoteId(NoteId) + .subscribe(res => { + if (res.Status = "OK") { + + var diagnosis: any = res.Results; + + console.log("diagnosis Temp:"); + console.log(diagnosis); + + var DiagnosisOrdersList: Array = []; + + diagnosis[0].DiagnosisOrdersList.forEach(item => { + + + var OrdersList: Array = []; + + + item.AllIcdLabOrders.forEach(lab => { + var Order: PatientOrderListModel = new PatientOrderListModel(); + Order.Order = lab; OrdersList.push(Order); + }); + item.AllIcdImagingOrders.forEach(img => { + var Order: PatientOrderListModel = new PatientOrderListModel(); + Order.Order = img; OrdersList.push(Order); + }); + + item.AllIcdPrescriptionOrders.forEach(med => { + var Order: PatientOrderListModel = new PatientOrderListModel(); + Order.Order = med; + Order.Dosage = med.Dosage; + Order.Frequency = med.Frequency; + Order.Duration = med.HowManyDays; + OrdersList.push(Order); + }); + + + var DiagnosisOrders: DiagnosisOrderVM = new DiagnosisOrderVM(); + + DiagnosisOrders.DiagnosisId = item.DiagnosisId; + DiagnosisOrders.ICD = item.ICD[0]; + DiagnosisOrders.IsEditable = item.IsEditable; + DiagnosisOrders.OrdersList = OrdersList; + + DiagnosisOrdersList.push(DiagnosisOrders); + + }); + + console.log("Generated DiagnosisOrdersList:"); + console.log(DiagnosisOrdersList); + + this.assessment.DiagnosisOrdersList = DiagnosisOrdersList; + this.assessment.NotesId = diagnosis[0].NotesId; + this.assessment.PatientId = diagnosis[0].PatientId; + this.assessment.PatientVisitId = diagnosis[0].PatientVisitId; + + console.log("new diagnosis:"); + console.log(this.assessment); + + //var length = Object.keys(this.diagnosis).length + //console.log(length); + + //var test: any; + //test = Object.keys(this.diagnosis1).map(key => this.diagnosis1[key]); + //console.log("test:"); + //console.log(test); + + //this.assessmentForEdit = { editMode: false, assessment: this.assessment } + this.showAP = true; + } + }); + } + + FocusOut() { + //console.log(this.notes.EmergencyNote); + this.outPutHpNote.emit(this.notes); + } + + CallBackSubjective($event) { + this.notes.SubjectiveNote = $event.subjectivenote; + //console.log(this.notes.EmergencyNote.SubjectiveNote); + this.outPutHpNote.emit(this.notes); + } + + CallBackObjective($event) { + this.notes.ObjectiveNote = $event.objectivenote; + //console.log(this.notes.EmergencyNote.ObjectiveNote); + this.outPutHpNote.emit(this.notes); + } + + CallBackAssesmentAndPlan(data) { + console.log("from assessment orders:"); + console.log(data); + this.notes.ClinicalDiagnosis = data; + this.outPutHpNote.emit(this.notes); + } + Close() { + this.showExamination=false; + this.Examination.emit({ action: "balance-History"}); + // this.patientInfo = null; + } +} + + + diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/notes.module.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/notes.module.ts index 768fb65e..534fc4bd 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/notes.module.ts +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/notes.module.ts @@ -28,6 +28,7 @@ import { ViewHistoryAndPhysicalNoteComponent } from './templates/history-and-phy import { ViewEmergencyNoteComponent } from './templates/emergency-note/view-emergency-note.component'; import { ClinicalPrescriptionNoteComponent } from './prescription-note/clinical-prescription-note.component'; import { ViewClinicalPrescriptionNoteComponent } from './prescription-note/view-clinical-prescription-note.component'; +import { OPDExaminationComponent } from './OPDExamination/OPD-Examination.component'; @NgModule({ @@ -65,7 +66,8 @@ import { ViewClinicalPrescriptionNoteComponent } from './prescription-note/view- ViewHistoryAndPhysicalNoteComponent, ViewEmergencyNoteComponent, ClinicalPrescriptionNoteComponent, - ViewClinicalPrescriptionNoteComponent + ViewClinicalPrescriptionNoteComponent, + OPDExaminationComponent ] }) diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/shared/OPD-Examination.model.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/shared/OPD-Examination.model.ts new file mode 100644 index 00000000..5e32d0a7 --- /dev/null +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical-notes/shared/OPD-Examination.model.ts @@ -0,0 +1,9 @@ +export class OPDExaminationModel { + public PatientId: number = 0; + public PatientVisitId: number = 0; + public CreatedBy: number = null; + public CreatedOn: string = null; + public ModifiedBy: number = null; + public ModifiedOn: string = null; + public IsActive: boolean = true; +} \ No newline at end of file diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical/medications/home-medication-list.component.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical/medications/home-medication-list.component.ts index a52a3487..1b2c7d44 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical/medications/home-medication-list.component.ts +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/clinical/medications/home-medication-list.component.ts @@ -5,6 +5,8 @@ import { MessageboxService } from '../../shared/messagebox/messagebox.service'; import { HomeMedication } from "../shared/home-medication.model"; import { HttpClient} from '@angular/common/http'; import * as moment from 'moment/moment'; +import { Router } from "@angular/router"; +import { Patient } from "../../patients/shared/patient.model"; @Component({ templateUrl: "../../view/clinical-view/HomeMedicationList.html" // "/ClinicalView/HomeMedication" }) @@ -18,7 +20,7 @@ export class HomeMedicationListComponent { constructor(public patientService: PatientService, public medicationBLService: MedicationBLService, public changeDetector: ChangeDetectorRef, - public msgBoxServ: MessageboxService, public http: HttpClient) { + public msgBoxServ: MessageboxService, public http: HttpClient,public router: Router) { this.GetHomeMedicationList(); } //get the list of surgical history of the selected patient. @@ -62,4 +64,8 @@ export class HomeMedicationListComponent { this.homemedications.push($event.homeMedication); } } + public currPat: Patient = new Patient(); + printMedications() { + this.router.navigate(['/Doctors/PatientOverviewMain/Orders/PrintMedication']); + } } \ No newline at end of file diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.component.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.component.ts index 2bd8c7f6..7dbb716f 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.component.ts +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.component.ts @@ -26,6 +26,7 @@ import { GridEmitModel } from "../../shared/danphe-grid/grid-emit.model"; import { SecurityService } from '../../security/shared/security.service'; import { DanpheCache, MasterType } from '../../shared/danphe-cache-service-utility/cache-services'; import { Employee } from '../../employee/shared/employee.model'; +import { OPDExaminationModel } from '../../clinical-notes/shared/OPD-Examination.model'; @Component({ templateUrl: "./doctor-dashboard.html" // "/DoctorsView/DoctorDashboard" }) @@ -65,6 +66,8 @@ export class DoctorDashboardComponent implements OnDestroy { public patientVisitType: string = "all"; private appointmentList: any; public Timer: any = null; + public showExamination :boolean = false; + public opdExamination: OPDExaminationModel = new OPDExaminationModel(); constructor( _patientService: PatientService, _visitServ: VisitService, @@ -316,11 +319,24 @@ export class DoctorDashboardComponent implements OnDestroy { } break; + case "Examination": + { + this.Examination($event.Data); + //this.showExamination= true; + } + break; default: break; } } - + Examination(selectedVisit: Visit) { + this.SelectVisit(selectedVisit); + this.showExamination = true; + } + CallBackExamination($event){ + this.showExamination = false; + + } loadDocDeptVisitList() { for (var i in this.DateValidator.controls) { this.DateValidator.controls[i].markAsDirty(); diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.html b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.html index 1a3fe72b..d2326714 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.html +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/doctors/dashboard/doctor-dashboard.html @@ -157,3 +157,8 @@

Re-assign this patient

+ + + diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/order-requisition.component.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/order-requisition.component.ts index a5e1c056..8d68bc42 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/order-requisition.component.ts +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/order-requisition.component.ts @@ -475,6 +475,7 @@ export class OrderRequisitionsComponent { currReq.DiagnosisId = null; currReq.VisitType = this.currPatVisitContext.VisitType; currReq.WardName = this.currPatVisitContext.Current_WardBed; + currReq.OrderDateTime = this.currTime retLabReqList.push(currReq); }); } diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/print-order.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/print-order.ts index 5cf87276..e938e27b 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/print-order.ts +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/orders/order/print-order.ts @@ -1,7 +1,12 @@ -import { Component } from '@angular/core'; +import { Component, Output } from '@angular/core'; import { Router } from '@angular/router'; import { PatientService } from '../../patients/shared/patient.service'; import { Patient } from '../../patients/shared/patient.model'; +import { MedicationBLService } from '../../clinical/shared/medication.bl.service'; +import { MessageboxService } from '../../shared/messagebox/messagebox.service'; +import { HomeMedication } from '../../clinical/shared/home-medication.model'; +import { EventEmitter } from 'events'; +import { CoreService } from '../../core/shared/core.service'; @Component({ templateUrl: "../../view/order-view/PrintMedications.html" // "/OrderView/PrintMedications" @@ -9,12 +14,36 @@ import { Patient } from '../../patients/shared/patient.model'; export class PrintMedicationsComponent { public currPat: Patient = new Patient(); - constructor(public router: Router, public patService: PatientService) { + public medicine: Array = new Array(); + public hospitalName :string = ''; + public address :string = ''; + public email :string = ''; + public tel :string = ''; + public pan :string = ''; + constructor(public patientService: PatientService, + public router: Router, public patService: PatientService, + public medicationBLService: MedicationBLService, + public msgBoxServ: MessageboxService, + public coreService : CoreService) { this.currPat = this.patService.getGlobal(); + this.GetCustomerHeaderParameter(); + this.GetMedication(); + } +GetMedication(){ + let patientId = this.patientService.getGlobal().PatientId; + this.medicationBLService.GetHomeMedicationList(patientId) + .subscribe(res => { + if (res.Status == "OK") { + this.medicine = res.Results; + } + else { + this.msgBoxServ.showMessage("failed", ['Failed to Load Home Medication List for this Patient.'], res.ErrorMessage); + } + }); +} - - print() { +print() { let popupWinindow; var printContents = document.getElementById("medicinePrintpage").innerHTML; popupWinindow = window.open('', '_blank', 'width=1600,height=700,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no'); @@ -23,5 +52,20 @@ export class PrintMedicationsComponent { popupWinindow.document.write('' + printContents + ''); popupWinindow.document.close(); } +Back(){ + this.router.navigate(['/Doctors/PatientOverviewMain/Clinical/HomeMedication']); +} +GetCustomerHeaderParameter() { + try { + let headerInfo = JSON.parse(this.coreService.Parameters.filter(a => a.ParameterName == 'CustomerHeader')[0]["ParameterValue"]); + this.hospitalName = headerInfo.hospitalName; + this.address = headerInfo.address; + this.email = headerInfo.email; + this.tel = headerInfo.tel; + this.pan = headerInfo.pan; + } catch (ex) { + + } +} } \ No newline at end of file diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/shared/danphe-grid/grid-column-settings.constant.ts b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/shared/danphe-grid/grid-column-settings.constant.ts index 65c80fdb..26992581 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/shared/danphe-grid/grid-column-settings.constant.ts +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/shared/danphe-grid/grid-column-settings.constant.ts @@ -3021,7 +3021,8 @@ return template; - `, + + `, }, ]; //View Clinical-notes Template diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/clinical-view/HomeMedicationList.html b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/clinical-view/HomeMedicationList.html index 3ca0f9b4..09edff40 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/clinical-view/HomeMedicationList.html +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/clinical-view/HomeMedicationList.html @@ -61,6 +61,11 @@ [show-homemedication-add]="showMedicationAddBox" (callback-addupdate)="CallBackAddUpdate($event)"> + diff --git a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/order-view/OrderMain.html b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/order-view/OrderMain.html index 887ac40b..a9b548f4 100644 --- a/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/order-view/OrderMain.html +++ b/Code/Websites/DanpheEMR/wwwroot/DanpheApp/src/app/view/order-view/OrderMain.html @@ -72,7 +72,7 @@ width: 100%; border: 1px solid #f3f3f3; margin-bottom: 15px; - border-radius: 5px !important;" + border-radius: 5px !important; } .cstm-pt-title { background: transparent; @@ -121,7 +121,7 @@ -
+
@@ -216,7 +216,7 @@ {{res.OrderStatus}} - + {{req.ImagingTypeName}} {{req.ImagingItemName}}   {{req.ImagingDate | DanpheDateTime:'datename':'DD.MM.YYYY HH:mm'}} @@ -262,7 +262,7 @@ - + @@ -332,11 +332,11 @@
-
+