public static EpicrisisModel EpicrisisModel(InformeEpicrisisDTO dto) { EpicrisisModel model = new EpicrisisModel { Cama = dto.Cama, CMPDoctor = dto.CMPDoctor, complicaciones = dto.complicaciones, CondEgres = dto.CondEgres, Doctor = dto.Doctor, Especialidad = dto.Especialidad, Evolucion = dto.Evolucion, ExamenesAuxil = dto.ExamenesAuxil, FecEgres = dto.FecEgres, FIngreso = dto.FIngreso, HIngreso = dto.HIngreso, HorEgres = dto.HorEgres, Procedimientos = dto.Procedimientos, ResumenEnfeAct = dto.ResumenEnfeAct, TiempoEstancia = dto.TiempoEstancia, Tratamiento = dto.Tratamiento, diagnosticos = (dto.diagnosticos != null) ? listarDiagnostico(dto.diagnosticos) : new List <DiagnosticosModel>() }; return(model); }
private void clickedEpicris(object sender, RoutedEventArgs e) { MedicalModel model = rtfTemplate.AddFromFileDbFileRtfFirstView(pacient.FirstViewFile); EpicrisisModel epModel = new EpicrisisModel { Anamnes = model.Anamnes, Age = pacient.Age, Name = pacient.Name, Diagnos = model.Diagnos, StatusPraesens = model.StatusPraesens }; EpicrisisPage epPage = new EpicrisisPage(epModel, pacient.Id); epPage.Show(); }
private void saveToDoctemplateAction(object sender, RoutedEventArgs e) { DocTemplateService dC = new DocTemplateService(); EpicrisisModel md = MedicalGrid.DataContext as EpicrisisModel; dC.CopyFileFirstViewToDocFirstView(md.Name); dC.AddToTemplateEpicrisDoc(md); Added = false; var targetWindow = Application.Current.Windows.Cast <Window>(). FirstOrDefault(w => w is PacientPageAll) as PacientPageAll; targetWindow.Change = "loh"; }
}// doc public void AddToTemplateEpicrisDoc(EpicrisisModel model) { Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application(); word.Visible = false; var document = word.Documents.Open(tS.MainPath + $"{model.Name}\\{model.Name}выписка.docx"); tS.ReplaceWords("{name}", model.Name, document); tS.ReplaceWords("{Anamnes}", model.Anamnes, document); tS.ReplaceWords("{StatusPraesens}", model.StatusPraesens, document); tS.ReplaceWords("{DeliveryDate}", model.DeliveryDate, document); tS.ReplaceWords("{Diagnos}", model.Diagnos, document); tS.ReplaceWords("{treatment}", model.Treatment, document); tS.ReplaceWords("{recomendation}", model.Recomendation, document); tS.ReplaceWords("{Researches}", model.Researches, document); tS.ReplaceWords("{SecondDiagnos}", model.SecondDiagnos, document); document.Save(); document.Close(); word.Quit(); }
} // метод для получения текста и системного файла с информацией об первичном осмотре public void SavePacientEpicrisis(EpicrisisModel md, int id) { string text = "Больной " + md.Name + " end" + "\n" + "\n" + "ПриПоступлении: " + md.DeliveryDate + " end" + "\n" + "ОсновнойДиагноз: " + md.Diagnos + " end" + "СопутствующийДиагноз: " + md.SecondDiagnos + " end" + "\n" + "Анамнез: " + md.Anamnes + " end" + "\n" + "ОбщийСтатус: " + md.StatusPraesens + " end" + "Обследования: " + md.Researches + " end" + "\n" + "ПроведенноеЛечение: " + md.Treatment + " end" + "\n" + "Рекомендации: " + md.Recomendation + " end" + "\n"; string name = md.Name; var path = tS.TemplatePath + $"{name}выписка.rtf"; if (id != 0) { db.PacientsDb.Where(p => p.Id == id).FirstOrDefault().EpicrisisFile = path; //var pacient = db.PacientsDb.Where(p => p.Id == id).FirstOrDefault(); //pacient.EpicrisisFile = path; //db.PacientsDb.Add(pacient); db.SaveChanges(); } else { db.PacientsDb.Add(new DbPacientModel { Name = md.Name, Age = md.Age, Diagnos = md.Diagnos, FirstViewFile = path }); db.SaveChanges(); } if (!File.Exists(tS.TemplatePath + $"{name}выписка.rtf")) { FileStream fileStream = new FileStream(tS.TemplatePath + $"{name}выписка.rtf", FileMode.CreateNew); StreamWriter writer = new StreamWriter(fileStream); writer.Write(text); writer.Close(); fileStream.Close(); } else { File.WriteAllText(tS.TemplatePath + $"{name}выписка.rtf", string.Empty); FileStream fileStream = new FileStream(tS.TemplatePath + $"{name}выписка.rtf", FileMode.Open); StreamWriter writer = new StreamWriter(fileStream); writer.Write(text); writer.Close(); fileStream.Close(); } }// метод для сохранения системного файла содержащего выписной эпикриз
private void Clicked(object sender, MouseButtonEventArgs e) { if (myListView.SelectedItem.ToString() == "Первичный осмотр") { MedicalModel model = rtfTemplate.AddFromFileDbFileRtfFirstView(pacient.FirstViewFile); model.Age = pacient.Age; model.Name = pacient.Name; PacientPage pp = new PacientPage(model, pacient.Id); pp.Show(); } if (myListView.SelectedItem.ToString() == "Выписной эпикриз") { EpicrisisModel model = rtfTemplate.AddFromFileDbFileRtfEpicris(pacient.EpicrisisFile); model.Age = pacient.Age; model.Name = pacient.Name; EpicrisisPage ep = new EpicrisisPage(model, pacient.Id); ep.Show(); ep.OnChanged += PacientPageAll_OnChanged2; } }
public EpicrisisModel AddFromFileDbFileRtfEpicris(string path) { string str = string.Empty; using (System.IO.StreamReader reader = System.IO.File.OpenText(path)) { str = reader.ReadToEnd(); } string[] needTxt = str.Split(new char[] { ' ', '\n', '\r' }); EpicrisisModel md = new EpicrisisModel { Recomendation = GetDataFromDoc("Рекомендации:", "end", needTxt), Treatment = GetDataFromDoc("ПроведенноеЛечение:", "end", needTxt), Researches = GetDataFromDoc("Обследования:", "end", needTxt), SecondDiagnos = GetDataFromDoc("СопутствующийДиагноз:", "end", needTxt), DeliveryDate = GetDataFromDoc("ПриПоступлении:", "end", needTxt), Anamnes = GetDataFromDoc("Анамнез:", "end", needTxt), StatusPraesens = GetDataFromDoc("ОбщийСтатус:", "end", needTxt), Diagnos = GetDataFromDoc("ОсновнойДиагноз:", "end", needTxt) }; return(md); } //RtfTemplateService
public EpicrisisPage(EpicrisisModel model, int pacientId) { InitializeComponent(); Id = pacientId; MedicalGrid.DataContext = model; }