/// <summary> /// Gets the instance. /// </summary> /// <param name="context">The context.</param> /// <returns></returns> public static ClinicRegistryManager GetInstance(HPCareDBContext context) { Patient patient = context.Users.Find(HttpContext.Current.Session["patientId"]) as Patient; //get information about the current clinic logged in CurrentUserId currentStaff = new CurrentUserId(); int currentIdStaff = currentStaff.AccessDatabase(HttpContext.Current.User.Identity.Name); //Users staff = currentStaff.ReturnCurrentUser(currentIdStaff); Staff staff = context.Users.Find(currentIdStaff) as Staff; if (singletonInstance == null) { // singletonInstance = new ClinicRegistryManager { ClinicRegistryManagerId = AccessDatabase(patient, staff, context).ClinicRegistryManagerId }; singletonInstance = new ClinicRegistryManager { Clinic_patient = patient, Staff_doctor = staff }; Visit visit = new Visit { Visit_Date = DateTime.Today.Date, Visit_Hour = DateTime.Now.TimeOfDay }; context.VisitManagers.Add(new VisitManager { visit = visit, PatientVisitRegistry = singletonInstance }); context.SaveChanges(); } return(context.ClinicRegistryManagers.Find(singletonInstance.ClinicRegistryManagerId)); }
/// <summary> /// Initializes a new instance of the <see cref="impPatient"/> class. /// </summary> /// <param name="db">The database.</param> public impPatient(HPCareDBContext db) { this.db = db; allergyList = new List <AllergiesViewModel>(); riskList = new List <RiskFactorsViewModel>(); historyList = new List <FamilyHistoryViewModel>(); patientInformationList = new List <PatientInformationViewModel>(); patientMcdtHistory = new List <McdtViewModel>(); patientMedicationHistory = new List <MedicationHistoryVm>(); }
public List <UsersSearchVM> SearchUsers(HPCareDBContext context) { List <Users> users = context.Users.ToList(); List <UsersSearchVM> usersVM = new List <UsersSearchVM>(); UsersSearchVM vm = null; foreach (Users user in users) { vm = new UsersSearchVM { Name = user.Name, Address = user.Address, Email = user.Email, User_identification = user.User_identification, Type = setUserType(user.UserType) }; usersVM.Add(vm); } return(usersVM); }
public ObservationController() { db = new HPCareDBContext(); impObservations = new ImpObservations(db); }
public impLabExams(HPCareDBContext db) { this.db = db; listMcdtVM = new List <McdtViewModel>(); currentUser = new CurrentUserId(); }
public bool IsFirstVist(HPCareDBContext context) { Patient patient = context.Users.Find(HttpContext.Current.Session["patientId"]) as Patient; return(patient.Address == null); }
public ImpObservations(HPCareDBContext db) { this.db = db; }
public ImpPatientDiagnosisHistory(HPCareDBContext db, bool state) { this.db = db; this.state = state; }
public ImpRegularExamsHistory(HPCareDBContext db) { this.db = db; patient = db.Users.Find(HttpContext.Current.Session["patientId"]) as Patient; listRegularExam = new List <RegularExamsVM>(); }
public ImpMedicationHistory() { db = new HPCareDBContext(); patient = db.Users.Find(HttpContext.Current.Session["patientId"]) as Patient; }
public ImpMedication(HPCareDBContext db) { this.db = db; }
public ImpTreatmentPlan(HPCareDBContext db) { patient = db.Users.Find(HttpContext.Current.Session["patientId"]) as Patient; this.db = db; }
/// <summary> /// Initializes a new instance of the <see cref="impStaff"/> class. /// </summary> /// <param name="db">The database.</param> public impStaff(HPCareDBContext db) { this.db = db; current = new CurrentUserId(); staffList = new List <StaffViewModel>(); }
public ImpMCDTs(HPCareDBContext db) { this.db = new HPCareDBContext(); }
public ImpTherapy(HPCareDBContext context) { this.context = context; }
public AccountController() { context = new HPCareDBContext(); }
public impDiagnosis(HPCareDBContext db) { this.db = db; }