[HttpGet] // Doctor/nurse public ActionResult EditMedicalRecord(int recordId) { if (!isAuthorizedAccess(EmployeeRole.Doctor, EmployeeRole.Nurse)) { ViewBag.ErrorMessage = ACCESS_DENIED_MSG; return(View("~/Views/Shared/Error.cshtml")); } var record = Db.MedicalRecords.Find(recordId); if (record != null) { var patient = Db.Accounts.Find(record.PatientId); var model = new MedicalRecordModel { RecordId = recordId, Weight = record.Weight, Height = record.Height, BloodPressure = record.BloodPressure, Pulse = record.Pulse, Description = record.Description, Date = record.Date, LabResult = record.LabResult, PathologyReport = record.PathologyReport, RadiologyReport = record.RadiologyReport, AllegyInformation = record.AllegyInformation, PatientId = record.PatientId }; model.PatientName = (patient != null) ? patient.Firstname + " " + patient.Lastname : "Unknown Patient"; model.DateString = string.Format("{0}-{1:00}-{2:00}", record.Date.Year, record.Date.Month, record.Date.Day); return(View("InputMedicalRecord", model)); } return(RedirectToAction("SearchPatient", new { actionType = "view" })); }
public MedicalInfoViewModel(int animalID) { AnimalID = animalID; MedicalRecord = new MedicalRecordModel(); NewMedicalRecord = new MedicalRecordModel(); MedicalCost = new CostModel(); NewMedicalCost = new CostModel(); }
public HistoricalMedicalRecordsViewModel(PhysicianShellViewModel containingVm, string patientId, Physician physician) { this.containingVm = containingVm; this.medicalRecordM = new MedicalRecordModel(patientId, physician); MedicalRecordsCollection = new ObservableCollection <MedicalRecord>(medicalRecordM.MedicalRecordsList); BackCommand = new BackCommand(this); EditingItemCommand = new EditingItemCommand(this); this.physician = physician; this.patientId = patientId; }
public void ClearNewMedicalRecord() { NewMedicalRecord = new MedicalRecordModel(); NewMedicalCost = new CostModel(); NotifyOfPropertyChange(() => NewMedicalRecord); NotifyOfPropertyChange(() => NewMedicalCost); NotifyOfPropertyChange(() => NewRecordName); NotifyOfPropertyChange(() => NewDescription); NotifyOfPropertyChange(() => NewVet); NotifyOfPropertyChange(() => NewDate); NotifyOfPropertyChange(() => NewPrice); }
private async Task GetData() { IsWorking = true; await Task.Delay(150); await Task.Run(() => { AnimalMedicalRecords = MedicalRecordModel.GetAnimalMedicalRecords(AnimalID); }); IsWorking = false; }
private async Task LoadData() { IsWorking = true; await Task.Delay(150); await Task.Run(() => { AnimalMedicalRecords = MedicalRecordModel.GetAnimalMedicalRecords(AnimalID); VetList = PersonModel.ReturnVets(); NewVetList = PersonModel.ReturnVets(); }); IsWorking = false; }
public AddMedicalRecordViewModel(PhysicianShellViewModel containingVm, string patientId, Physician physicianUser, MedicalRecord medicalRecordExists = null) { if (medicalRecordExists == null) { this.medicalRecordModel = new MedicalRecordModel(patientId, physicianUser); } else { this.medicalRecordModel = new MedicalRecordModel(patientId, physicianUser, medicalRecordExists); } this.containingVm = containingVm; AddToDbCommand = new AddToDbCommand(this); this.patientId = patientId; this.physicianUser = physicianUser; }
public ActionResult InputMedicalRecord(MedicalRecordModel record) { if (ModelState.IsValid) { // New Record if (record.RecordId == 0) { var date = DateTime.Parse(record.DateString); Db.MedicalRecords.Add(new MedicalRecord { Weight = record.Weight, Height = record.Height, BloodPressure = record.BloodPressure, Pulse = record.Pulse, Description = record.Description, Date = date, LabResult = record.LabResult, PathologyReport = record.PathologyReport, RadiologyReport = record.RadiologyReport, AllegyInformation = record.AllegyInformation, PatientId = record.PatientId }); } else // Update record { var medicalRecord = Db.MedicalRecords.Where(rec => rec.Id == record.RecordId).FirstOrDefault(); if (medicalRecord != null) { var date = DateTime.Parse(record.DateString); medicalRecord.Date = date; medicalRecord.Weight = record.Weight; medicalRecord.Height = record.Height; medicalRecord.BloodPressure = record.BloodPressure; medicalRecord.Pulse = record.Pulse; medicalRecord.Description = record.Description; medicalRecord.LabResult = record.LabResult; medicalRecord.PathologyReport = record.PathologyReport; medicalRecord.RadiologyReport = record.RadiologyReport; medicalRecord.AllegyInformation = record.AllegyInformation; medicalRecord.PatientId = record.PatientId; } } Db.SaveChanges(); return(RedirectToAction("PatientMedicalRecords", "Staff", new { patientId = record.PatientId })); } // model error return(View(record)); }
public void DeleteRecord() { MessageBoxResult result = MessageBox.Show("Opravdu chcete vymazat zvolený záznam?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { CostModel.MarkAsDeleted((int)SelectedMedicalRecord.CostID); MedicalRecordModel.MarkAsDeleted((int)SelectedMedicalRecord.ID); MedicalCost = new CostModel(); MedicalRecord = new MedicalRecordModel(); SelectedMedicalRecord = null; Filter(); } }
public async void Restore() { if (Since == null || To == null || (Since > To)) { MessageBox.Show("Zvolte prosím platné datum."); } else { IsWorking = true; await Task.Delay(150); await Task.Run(() => { AdoptionModel.RestoreDeleted((DateTime)Since, (DateTime)To); AnimalModel.RestoreDeleted((DateTime)Since, (DateTime)To); BreedModel.RestoreDeleted((DateTime)Since, (DateTime)To); CoatTypeModel.RestoreDeleted((DateTime)Since, (DateTime)To); CostModel.RestoreDeleted((DateTime)Since, (DateTime)To); DeathModel.RestoreDeleted((DateTime)Since, (DateTime)To); DiaryModel.RestoreDeleted((DateTime)Since, (DateTime)To); DonationModel.RestoreDeleted((DateTime)Since, (DateTime)To); EscapeModel.RestoreDeleted((DateTime)Since, (DateTime)To); FurColorModel.RestoreDeleted((DateTime)Since, (DateTime)To); IncidentModel.RestoreDeleted((DateTime)Since, (DateTime)To); PersonModel.RestoreDeleted((DateTime)Since, (DateTime)To); MedicalRecordModel.RestoreDeleted((DateTime)Since, (DateTime)To); SpeciesModel.RestoreDeleted((DateTime)Since, (DateTime)To); StayModel.RestoreDeleted((DateTime)Since, (DateTime)To); WalkModel.RestoreDeleted((DateTime)Since, (DateTime)To); }); ComboBoxSettings(); IsWorking = false; MessageBox.Show("Záznamy od " + Since + " do " + To + " obnoveny."); } }