public PatientAppointmentDisplay GetExistingPatientAppointment(string patientId, DateTime appointmentDate, int serviceAreaId, int reasonId) { PatientAppointmentDisplay appointmentDisplay = new PatientAppointmentDisplay(); PatientAppointment appointment = new PatientAppointment(); try { var patientAppointment = new PatientAppointmentManager(); int id = Convert.ToInt32(patientId); appointment = patientAppointment.GetByPatientId(id).FirstOrDefault(n => n.AppointmentDate.Date == appointmentDate.Date && n.ServiceAreaId == serviceAreaId && n.ReasonId == reasonId); if (appointment != null) { appointmentDisplay = Mapappointments(appointment); } else { return(null); } } catch (Exception e) { Msg = e.Message; } return(appointmentDisplay); }
/***** Appointment List shows Current date Appointment ========> ******/ private void TodayAppointmentList(string getDate) { //string today = "2018-11-10"; BLL.AppointmentListBll bll = new BLL.AppointmentListBll(); PatientAppointment oPatientAppointment = new PatientAppointment(); oPatientAppointment.AppointDate = getDate; DataTable appoinListDt = bll.GetAppointmentList(oPatientAppointment); if (appoinListDt != null) { if (appoinListDt.Rows.Count > 0) { lblEmptyMsg.Text = ""; GVAppointmentList.DataSource = appoinListDt; GVAppointmentList.DataBind(); } else { GVAppointmentList.DataSource = null; // GVAppointmentList.Columns.Clear(); GVAppointmentList.DataBind(); lblEmptyMsg.Text = "No Appointment History Found !!!"; } } else { GVAppointmentList.DataSource = null; // GVAppointmentList.Columns.Clear(); GVAppointmentList.DataBind(); lblEmptyMsg.Text = "Really ? Nice Try. Now Input Valid Date !"; } }
public VisitHistory(PatientAppointment CurrentPatient) { InitializeComponent(); this.CurrentPatient = CurrentPatient; this.DataContext = CurrentPatient; var Appointments = Query.GetAppointmentsByChartNumber(CurrentPatient.PatientInfo.ChartNumber); HistoryDT = new DataTable(); HistoryDT.Columns.Add("Date", typeof(string)); HistoryDT.Columns.Add("Time", typeof(string)); HistoryDT.Columns.Add("Duration", typeof(string)); HistoryDT.Columns.Add("Specialty", typeof(string)); HistoryDT.Columns.Add("Doctor", typeof(string)); HistoryDT.Columns.Add("Clinic", typeof(string)); foreach (var Appointment in Appointments) { DataRow dRow = HistoryDT.NewRow(); dRow["Date"] = Appointment.Date.ToString("MM/dd/yyyy"); dRow["Time"] = Appointment.Date.ToString("HH:mm"); dRow["Duration"] = Appointment.Duration.ToString(); dRow["Specialty"] = Appointment.Slot.DoctorInfo.Specialty; dRow["Doctor"] = Appointment.Slot.DoctorInfo.Name; dRow["Clinic"] = Appointment.Slot.ClinicInfo.Name; HistoryDT.Rows.Add(dRow); } HistoryTable.ItemsSource = HistoryDT.DefaultView; ComboBox_Clinic.ItemsSource = Query.GetClinicNames(); }
public ActionResult SavePreventativeServices(MCHPreventativeService data) { data.UserId = (int)Session["UserId"]; data.BranchId = 1; data.DateAdded = DateTime.Now; db.MCHPreventativeServices.Add(data); if (db.SaveChanges() > 0) { var pa = new PatientAppointment(); pa.User = data.UserId; pa.Date_of_Appointment = data.NextVisit; pa.Explanation = data.Vaccine; pa.OPD_IPD = data.OPDNo; db.PatientAppointments.Add(pa); db.SaveChanges(); } return(RedirectToAction("PreventativeServices", new { id = data.OPDNo })); }
public SqlException Create(PatientAppointment PA) { //insert string insert = "INSERT INTO PatientAppointment (AppointmentNumber, DateOfAppointment, AppointmentRoom, PatientNumber)" + " VALUES(@AppointmentNumber, @DateOfAppointment, @AppointmentRoom, @PatientNumber)"; //create sql command, insert query, preparing quries, create parameterized quieries, // 1. declare command object with parameter + insert query SqlCommand cmd = InitializeDatabase.CreateSqlCommand(insert); // 2. define parameters used in command object List<SqlParameter> prm = new List<SqlParameter>() { new SqlParameter("@AppointmentNumber", SqlDbType.Int) {Value = PA.AppointmentNumber}, new SqlParameter("@DateOfAppointment", SqlDbType.DateTime) {Value = PA.DateOfAppointment}, new SqlParameter("@AppointmentRoom", SqlDbType.NVarChar) {Value = PA.AppointmentRoom}, new SqlParameter("@PatientNumber", SqlDbType.Int) {Value = PA.PatientNumber}, }; // 3. add new parameter to command object cmd.Parameters.AddRange(prm.ToArray()); //run SqlException res = InitializeDatabase.RunSqlCommand(cmd); return res; }
public ActionResult SaveFamilyPlanning(MCHFamilyPlaning data) { data.UserId = (int)Session["UserId"]; data.DateAdded = DateTime.Now; data.BranchId = 1; db.MCHFamilyPlanings.Add(data); if (db.SaveChanges() > 0) { var pa = new PatientAppointment(); pa.User = data.UserId; pa.Date_of_Appointment = data.NextVisit.Value; pa.Explanation = data.ContraceptiveAdministered; pa.OPD_IPD = data.OPDNo; db.PatientAppointments.Add(pa); db.SaveChanges(); } return(RedirectToAction("FamilyPlanning", new { id = data.OPDNo })); }
public async Task <Result <AddPatientAppointmentResponse> > Handle(AddPatientAppointmentCommand request, CancellationToken cancellationToken) { try { var appointmentStatusId = _commontUnitOfWork.Repository <LookupItem>() .Get(x => x.Name == "Pending").SingleOrDefault()?.Id; int?appointmentReasonId = _commontUnitOfWork.Repository <LookupItem>() .Get(x => x.Name == request.AppointmentReason).SingleOrDefault()?.Id; var patientAppointment = new PatientAppointment(request.PatientId, request.PatientMasterVisitId, request.ServiceAreaId, request.AppointmentDate, (int)appointmentReasonId, (int)appointmentStatusId, request.DifferentiatedCareId, request.StatusDate, request.CreatedBy, request.Description); await _commontUnitOfWork.Repository <PatientAppointment>().AddAsync(patientAppointment); await _commontUnitOfWork.SaveAsync(); return(Result <AddPatientAppointmentResponse> .Valid(new AddPatientAppointmentResponse { AppointmentId = patientAppointment.Id })); } catch (Exception ex) { Log.Error(ex, $"An error occured while adding patient referral information for patientId {request.PatientId}"); return(Result <AddPatientAppointmentResponse> .Invalid(ex.Message)); } }
public int AddPatientAppointments(PatientAppointment p, bool sendEvent = true) { int returnVal = 0; try { if (p.CreatedBy == 0) { p.CreatedBy = SessionManager.UserId; } } catch { } PatientAppointment appointment = new PatientAppointment() { PatientId = p.PatientId, PatientMasterVisitId = p.PatientMasterVisitId, AppointmentDate = p.AppointmentDate, Description = p.Description, ReasonId = p.ReasonId, DifferentiatedCareId = p.DifferentiatedCareId, ServiceAreaId = p.ServiceAreaId, StatusId = p.StatusId, StatusDate = DateTime.Now, CreatedBy = p.CreatedBy }; var sameDayAppointmentExists = _appointment.GetAppointmentByType(p.PatientId, p.PatientMasterVisitId, p.AppointmentDate, p.ReasonId); if (sameDayAppointmentExists.Count > 0) { sameDayAppointmentExists[0].Description = p.Description; sameDayAppointmentExists[0].DifferentiatedCareId = p.DifferentiatedCareId; sameDayAppointmentExists[0].ServiceAreaId = p.ServiceAreaId; sameDayAppointmentExists[0].StatusId = p.StatusId; _appointment.UpdatePatientAppointments(sameDayAppointmentExists[0]); } else { returnVal = _appointment.AddPatientAppointments(appointment); } if (returnVal > 0 && sendEvent) { PatientLookupManager patientLookup = new PatientLookupManager(); var patient = patientLookup.GetPatientDetailSummary(p.PatientId); MessageEventArgs args = new MessageEventArgs() { FacilityId = patient.FacilityId, EntityId = returnVal, PatientId = appointment.PatientId, MessageType = MessageType.AppointmentScheduling, EventOccurred = "Patient Appointment Scheduled" }; Publisher.RaiseEventAsync(this, args).ConfigureAwait(false); } return(returnVal); }
public string AddPatientAppointment(int patientId, int patientMasterVisitId, DateTime appointmentDate, string description, int reasonId, int serviceAreaId, int statusId, int differentiatedCareId, int userId) { PatientAppointment patientAppointment = new PatientAppointment() { PatientId = patientId, PatientMasterVisitId = patientMasterVisitId, AppointmentDate = appointmentDate, Description = description, DifferentiatedCareId = differentiatedCareId, ReasonId = reasonId, ServiceAreaId = serviceAreaId, StatusId = statusId, CreatedBy = userId, CreateDate = DateTime.Now }; try { var appointment = new PatientAppointmentManager(); Result = appointment.AddPatientAppointments(patientAppointment); if (Result > 0) { Msg = "Patient appointment Added Successfully!"; } } catch (Exception e) { Msg = e.Message; } return(Msg); }
public static List <PatientAppointment> GetUserAppointHistory(string userId) { List <PatientAppointment> lstAppointmentData = new List <PatientAppointment>(); PatientAppointment oPatientAppointment; DatabaseConnection con = new DatabaseConnection(); string sql = @"SELECT UserProfile_T.name, Appointment_T.* FROM UserProfile_T, Appointment_T WHERE user_id = patient_user_id AND patient_user_id = '" + userId + "' ORDER BY appointment_id DESC"; try { SqlCommand cmd = new SqlCommand(sql, con.GetSqlConnection()); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { oPatientAppointment = new PatientAppointment(); oPatientAppointment.Id = Convert.ToInt32(dr["appointment_id"]); oPatientAppointment.DoctorName = Convert.ToString(dr["name"]); oPatientAppointment.AppointDate = Convert.ToString(dr["appoint_date"]); oPatientAppointment.ReserveDate = Convert.ToString(dr["reserve_date"]); oPatientAppointment.VisitTime = Convert.ToDecimal(dr["visit_time"]); oPatientAppointment.AppointSuccess = Convert.ToInt32(dr["appoint_success"]); lstAppointmentData.Add(oPatientAppointment); } } catch (Exception r) { lstAppointmentData = null; } finally { con.CloseConnection(); } return(lstAppointmentData); }
/*****Save Patient Appointment ******/ public bool PatientAppointData(UserProfile oUserProfile, PatientAppointment oPatientAppointment) { DAL.PatientAppointmentDal dal = new DAL.PatientAppointmentDal(); bool appointConfirmation = dal.saveAppointment(oUserProfile, oPatientAppointment); return(appointConfirmation); }
public ActionResult DeleteConfirmed(int id) { PatientAppointment patientAppointment = db.PatientAppointments.Find(id); db.PatientAppointments.Remove(patientAppointment); db.SaveChanges(); return(RedirectToAction("Index")); }
public DataTable GetAppointmentList(PatientAppointment oPatientAppointment) { DAL.AppointmentListDal dal = new DAL.AppointmentListDal(); //string serialNo = dal.GetSerialNo(oPatientAppointment); DataTable appointmentList = dal.AppointLisFromDB(oPatientAppointment); return(appointmentList); }
public PatientAppointment GetPatientAppointments(int id) { using (UnitOfWork unitOfWork = new UnitOfWork(new GreencardContext())) { PatientAppointment appointment = unitOfWork.PatientAppointmentRepository.GetById(id); unitOfWork.Dispose(); return(appointment); } }
public bool Validate(PatientAppointment appointment) { if (appointment == null) { throw new ArgumentNullException("appointment"); } //perform some logic here return(true); }
public void DeletePatientAppointments(int id) { using (UnitOfWork unitOfWork = new UnitOfWork(new GreencardContext())) { PatientAppointment appointment = unitOfWork.PatientAppointmentRepository.GetById(id); unitOfWork.PatientAppointmentRepository.Remove(appointment); unitOfWork.Complete(); unitOfWork.Dispose(); } }
public int UpdatePatientAppointments(PatientAppointment p) { using (UnitOfWork unitOfWork = new UnitOfWork(new GreencardContext())) { unitOfWork.PatientAppointmentRepository.Update(p); _result = unitOfWork.Complete(); unitOfWork.Dispose(); return(_result); } }
public AddToOpenList(PatientAppointment CurrentPatient) { InitializeComponent(); this.DataContext = CurrentPatient; this.CurrentPatient = CurrentPatient; cb_Clinic.ItemsSource = Query.GetClinicNames(); cb_Doctor.ItemsSource = Query.GetDoctorNames(); cb_Specialty.ItemsSource = Query.GetSpecialties(); }
public PatientPreferences(PatientAppointment CurrentPatient) { InitializeComponent(); this.DataContext = CurrentPatient; this.CurrentPatient = CurrentPatient; this.ComboBox_Clinic.ItemsSource = Query.GetClinicNames(); this.ComboBox_Doctor.ItemsSource = Query.GetDoctorNames(); this.ComboBox_Speciality.ItemsSource = Query.GetSpecialties(); }
private void AddAppointmentToOpenList(object sender, RoutedEventArgs e) { DataRow Selected = (((FrameworkElement)sender).DataContext as DataRowView).Row; PatientAppointment SelectedPatient = Query.GetAppointment(Convert.ToInt32(Selected["ID"])); AddToOpenList PopupWindow = new AddToOpenList(SelectedPatient); PopupWindow.ShowDialog(); RefreshGrids(); }
// Details button click even handler // Opens new window with information regarding patient // For Scheduling Grid private void DetailsViewSchedulingGrid_Click(object sender, RoutedEventArgs e) { PatientAppointment SelectedPatient = ((FrameworkElement)sender).DataContext as PatientAppointment; // creating and displaying a new scheduling window based on the object selected Window SchedulingWindow = new PatientScheduling(SelectedPatient); this.Hide(); SchedulingWindow.ShowDialog(); this.RefreshGrids(); this.Show(); }
public void MakeAppointment(Patient patient, Department department, string docName, DateTime dateTime) { PatientAppointment patientAppointment = new PatientAppointment(); patientAppointment.patient = patient; patientAppointment.department = department; patientAppointment.DateTime = dateTime; patientAppointment.doctorName = docName; patientAppointments.Add(patientAppointment); emailsender.SendEmail(); sms.SendSMS(); }
public PatientAppointment selectByPk1(String pttId) { PatientAppointment cop1 = new PatientAppointment(); DataTable dt = new DataTable(); String sql = "select pApm.* " + "From " + pApm.table + " pApm " + "Where pApm." + pApm.pkField + " ='" + pttId + "' "; dt = conn.selectData(conn.conn, sql); cop1 = setPatient(dt); return(cop1); }
public void LoadPatientAppt() { DateTime dt = DateTime.MinValue; long id = 0; Guid patientGuid = Guid.Empty; PatientAppointment patientAppointmentInformation = new PatientAppointment(); PatientAppointmentInformationTableManager patApptMgr = new PatientAppointmentInformationTableManager(); if ((Session["EditPatientAppt"] != null) && (Session["EditPatientAppt"].ToString() == "true")) { patientAppointmentInformation.ApptId = Guid.Parse(Session[CommonDefinitions.CommonDefinitions.PATIENT_HISTORY_GUID].ToString()); patientAppointmentInformation = patApptMgr.FindPatientAppointment(patientAppointmentInformation); if (!string.IsNullOrEmpty(patientAppointmentInformation.PulseRLU.Trim())) { RLU.SelectedValue = patientAppointmentInformation.PulseRLU.Trim(); } if (!string.IsNullOrEmpty(patientAppointmentInformation.PulseSP.Trim())) { SP.SelectedValue = patientAppointmentInformation.PulseSP.Trim(); } if (!string.IsNullOrEmpty(patientAppointmentInformation.PulseKD1.Trim())) { KD1.SelectedValue = patientAppointmentInformation.PulseKD1.Trim(); } if (!string.IsNullOrEmpty(patientAppointmentInformation.PulseLHT.Trim())) { LHT.SelectedValue = patientAppointmentInformation.PulseLHT.Trim(); } if (!string.IsNullOrEmpty(patientAppointmentInformation.PulseLV.Trim())) { LV.SelectedValue = patientAppointmentInformation.PulseLV.Trim(); } if (!string.IsNullOrEmpty(patientAppointmentInformation.PulseKD2.Trim())) { KD2.SelectedValue = patientAppointmentInformation.PulseKD2.Trim(); } ImageBefore.ImageUrl = patientAppointmentInformation.ImageBeforeTherapy; ImageAfter.ImageUrl = patientAppointmentInformation.ImageAfterTherapy; txtBoxTherapyPerformed.Text = patientAppointmentInformation.OilsAndTherapy; txtBoxSessionGoals.Text = patientAppointmentInformation.SessionGoals; } }
// GET: PatientAppointment/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PatientAppointment patientAppointment = db.PatientAppointments.Find(id); if (patientAppointment == null) { return(HttpNotFound()); } return(View(patientAppointment)); }
// For Appointments Grid private void DetailsViewAppointmentsGrid_Click(object sender, RoutedEventArgs e) { DataRow Selected = (((FrameworkElement)sender).DataContext as DataRowView).Row; PatientAppointment SelectedPatient = Query.GetAppointment(Convert.ToInt32(Selected["ID"])); // creating and displaying a new scheduling window based on the object selected Window SchedulingWindow = new PatientScheduling(SelectedPatient); this.Hide(); SchedulingWindow.ShowDialog(); this.RefreshGrids(); this.Show(); }
private void AutoFillAppointments(int AppointmentId) { PatientAppointmentManager appointmentmgr = new PatientAppointmentManager(); PatientAppointment pa = appointmentmgr.GetPatientAppointment(AppointmentId); AppointmentDate.Text = pa.AppointmentDate.ToString("dd-MMM-yyy"); //AppointmentDate.Text = ""; ServiceArea.SelectedValue = pa.ServiceAreaId.ToString(); Reason.SelectedValue = pa.ReasonId.ToString(); DifferentiatedCare.SelectedValue = pa.DifferentiatedCareId.ToString(); description.Text = pa.Description.ToString(); status.SelectedValue = pa.StatusId.ToString(); UpdateAppointmentDate = pa.AppointmentDate.ToString("dd-MMM-yyy"); }
public String insertPatientAppointment(PatientAppointment p, String userId) { String re = ""; if (p.t_patient_appointment_id.Equals("")) { re = insert(p, userId); } else { re = update(p, userId); } return(re); }
public ActionResult Edit([Bind(Include = "Id,Name,LastName,Address,Email,TimeId,OptionId,GenderId,TitleId,Date,Symptoms,Cellphone,Cellphone2,StudentNumber,ID_Number,Comorbidity,PractId")] PatientAppointment patientAppointment) { if (ModelState.IsValid) { db.Entry(patientAppointment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GenderId = new SelectList(db.Genders, "Id", "Name", patientAppointment.GenderId); ViewBag.OptionId = new SelectList(db.HealthOptions, "Id", "CheckUpOption", patientAppointment.OptionId); ViewBag.PractId = new SelectList(db.MedicalPractitioners, "Id", "Name", patientAppointment.PractId); ViewBag.TimeId = new SelectList(db.TimePreferences, "Id", "TimePreference1", patientAppointment.TimeId); ViewBag.TitleId = new SelectList(db.UserTitles, "Id", "TitleName", patientAppointment.TitleId); return(View(patientAppointment)); }
public void SaveAppt() { PatientAppointment patientAppointmentInformation = new PatientAppointment(); PatientAppointmentInformationTableManager patApptMgr = new PatientAppointmentInformationTableManager(); patientAppointmentInformation.ApptId = Guid.Empty; if (Session[CommonDefinitions.CommonDefinitions.PATIENT_HISTORY_GUID] != null) { patientAppointmentInformation.ApptId = Guid.Parse(Session[CommonDefinitions.CommonDefinitions.PATIENT_HISTORY_GUID].ToString()); } patientAppointmentInformation.PatientId = Int32.Parse(Session[CommonDefinitions.CommonDefinitions.PATIENT_ID].ToString()); patientAppointmentInformation.AppointmentDate = DateTime.Parse(Session[CommonDefinitions.CommonDefinitions.PATIENT_APPT_START_DATE_TIME].ToString()); string therapist = Session[CommonDefinitions.CommonDefinitions.THERAPIST_NAME].ToString(); patientAppointmentInformation.TherapistId = Guid.Parse(Session[therapist.ToUpper().ToString()].ToString()); if (Session["UploadImageBefore"] != null) { patientAppointmentInformation.ImageBeforeTherapy = Session["UploadImageBefore"].ToString(); } else { patientAppointmentInformation.ImageBeforeTherapy = ""; } if (Session["UploadImageAfter"] != null) { patientAppointmentInformation.ImageAfterTherapy = Session["UploadImageAfter"].ToString(); } else { patientAppointmentInformation.ImageAfterTherapy = ""; } patientAppointmentInformation.OilsAndTherapy = txtBoxTherapyPerformed.Text; patientAppointmentInformation.SessionGoals = txtBoxSessionGoals.Text; patientAppointmentInformation.PulseKD1 = KD1.Text; patientAppointmentInformation.PulseKD2 = KD2.Text; patientAppointmentInformation.PulseLHT = LHT.Text; patientAppointmentInformation.PulseLV = LV.Text; patientAppointmentInformation.PulseRLU = RLU.Text; patientAppointmentInformation.PulseSP = SP.Text; patApptMgr.Update(patientAppointmentInformation); }