public static IEnumerable <IHrItemObject> GetOrderedEntities(this HealthRecord hr) { Contract.Requires(hr != null); return(from item in hr.HrItems orderby item.Ord select item.Entity); }
public static IEnumerable <ConfWithHio> GetOrderedCHIOs(this HealthRecord hr) { Contract.Requires(hr != null); return(from item in hr.HrItems orderby item.Ord select item.GetConfindenceHrItemObject()); }
public virtual int CompareTo(HealthRecord other) { // не сравниваем содержимое записи if (other == null) { return(-1); } int res = Holder.CompareTo(other.Holder); if (res != 0) { return(res); } res = Ord.CompareTo(other.Ord); if (res != 0) { return(res); } res = UpdatedAt.CompareTo(other.UpdatedAt); if (res != 0) { return(res); } res = Doctor.CompareTo(other.Doctor); return(res); }
public HrItem(HealthRecord hr, IHrItemObject hio) { Contract.Requires(hr != null); Contract.Requires(hio != null); HealthRecord = hr; if (hio is Word) { Word = hio as Word; } else if (hio is Measure) { Measure = hio as Measure; Word = Measure.Word; } else if (hio is IcdDisease) { Disease = hio as IcdDisease; } else if (hio is Comment) { Comment = hio as Comment; } else { throw new NotImplementedException(); } }
public virtual void RemoveHealthRecord(HealthRecord hr) { if (healthRecords.Remove(hr)) { hr.OnDelete(); OnHealthRecordsChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, hr)); } }
void IHrsHolder.RemoveHealthRecord(HealthRecord hr) { IHrsHolder test = this; Contract.Ensures(test.HealthRecords.Count() <= Contract.OldValue(test.HealthRecords.Count())); Contract.Ensures(!test.HealthRecords.Contains(hr)); Contract.Ensures(hr.Words.All(x => !x.HealthRecords.Contains(hr))); }
public virtual HealthRecord AddHealthRecord(Doctor author) { var hr = new HealthRecord(this, author); healthRecords.Add(hr); author.AddHr(hr); OnHealthRecordsChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, hr)); return(hr); }
public static IEnumerable <Confindencable <Word> > GetCWordsNotFromMeasure(this HealthRecord hr) { Contract.Requires(hr != null); return(hr.HrItems.Where(x => x.Entity is Word).Select(x => x.Word.AsConfidencable(x.Confidence))); }
public static IEnumerable <ConfWithHio> GetCHIOs(this HealthRecord hr) { Contract.Requires(hr != null); return(hr.HrItems.Select(x => x.GetConfindenceHrItemObject())); }
public static Course GetCourse(this HealthRecord hr) { Contract.Requires(hr != null); return(hr.Course ?? (hr.Appointment != null ? hr.Appointment.Course : null)); }
public static Patient GetPatient(this HealthRecord hr) { Contract.Requires(hr != null); return(hr.Patient ?? (hr.Course != null ? hr.Course.Patient : hr.Appointment.Course.Patient)); }
public HealthRecordEventArgs(HealthRecord hr) { this.hr = hr; }
protected internal virtual void RemoveHr(HealthRecord hr) { // при удалении записи слова не удаляются отдельно // при удалении элемента слово уже удалено healthRecords.Remove(hr); }
protected internal virtual void AddHr(HealthRecord hr) { Contract.Requires(hr != null); Contract.Requires(hr.Words.Contains(this)); healthRecords.Add(hr); }
protected internal virtual void RemoveHr(HealthRecord hr) { Contract.Requires(hr != null); Contract.Requires(hr.Doctor == this); healthRecords.Remove(hr); }