public static int AddDiag(int code, string diagnosis, int mis) { List <Diagnosis> diag = SELECTDiagnosis(); var max = diag.Max(p => p.codeDiagnosis); string path = AppDomain.CurrentDomain.BaseDirectory + "Hospital/Diagnosises.txt"; using (StreamWriter sw = File.AppendText(path)) { Diagnosis s = new Diagnosis(); s.codeDiagnosis = max + 1; s.diagnosis = diagnosis; s.codeDepartment = code; s.misDays = mis; sw.WriteLine(s.ToString()); } return(1); }
public static Diagnosis SELECTDiagnosisByCode(int mis) { Diagnosis d = new Diagnosis(); string path = AppDomain.CurrentDomain.BaseDirectory + "Hospital/Diagnosises.txt"; using (StreamReader sr = File.OpenText(path)) { string text; while ((text = sr.ReadLine()) != null) { var data = text.Split(", "); if (int.Parse(data[0]) == mis) { d.codeDiagnosis = int.Parse(data[0]); d.codeDepartment = int.Parse(data[1]); d.diagnosis = data[2]; d.misDays = int.Parse(data[3]); } } } return(d); }
public int CalculateCountOfDiagnosis(Diagnosis diagnosis) { return(departaments.Sum(departament => departament.CalculateCountOfDiagnosis(diagnosis))); }
Diagnosis diagnose() { Diagnosis diagnose = new Diagnosis(); return diagnose; }
public int CalculateCountOfDiagnosis(Diagnosis diagnosis) { return(pacients.Where(pacient => pacient.IsDiagnosisExists(diagnosis)).Count()); }
Treatment(Diagnosis diagnose) { }
public bool IsDiagnosisExists(Diagnosis diagnosis) { return(diagnoses.Contains(diagnosis)); }