コード例 #1
0
 public static IEnumerable <IHrItemObject> GetOrderedEntities(this HealthRecord hr)
 {
     Contract.Requires(hr != null);
     return(from item in hr.HrItems
            orderby item.Ord
            select item.Entity);
 }
コード例 #2
0
 public static IEnumerable <ConfWithHio> GetOrderedCHIOs(this HealthRecord hr)
 {
     Contract.Requires(hr != null);
     return(from item in hr.HrItems
            orderby item.Ord
            select item.GetConfindenceHrItemObject());
 }
コード例 #3
0
ファイル: HealthRecord.cs プロジェクト: sm-g/diagnosis
        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);
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
ファイル: Patient.cs プロジェクト: sm-g/diagnosis
 public virtual void RemoveHealthRecord(HealthRecord hr)
 {
     if (healthRecords.Remove(hr))
     {
         hr.OnDelete();
         OnHealthRecordsChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, hr));
     }
 }
コード例 #6
0
ファイル: Contracts.cs プロジェクト: sm-g/diagnosis
        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)));
        }
コード例 #7
0
ファイル: Patient.cs プロジェクト: sm-g/diagnosis
        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);
        }
コード例 #8
0
 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)));
 }
コード例 #9
0
 public static IEnumerable <ConfWithHio> GetCHIOs(this HealthRecord hr)
 {
     Contract.Requires(hr != null);
     return(hr.HrItems.Select(x => x.GetConfindenceHrItemObject()));
 }
コード例 #10
0
 public static Course GetCourse(this HealthRecord hr)
 {
     Contract.Requires(hr != null);
     return(hr.Course ?? (hr.Appointment != null ? hr.Appointment.Course : null));
 }
コード例 #11
0
 public static Patient GetPatient(this HealthRecord hr)
 {
     Contract.Requires(hr != null);
     return(hr.Patient ?? (hr.Course != null ? hr.Course.Patient : hr.Appointment.Course.Patient));
 }
コード例 #12
0
 public HealthRecordEventArgs(HealthRecord hr)
 {
     this.hr = hr;
 }
コード例 #13
0
ファイル: Word.cs プロジェクト: sm-g/diagnosis
 protected internal virtual void RemoveHr(HealthRecord hr)
 {
     // при удалении записи слова не удаляются отдельно
     // при удалении элемента слово уже удалено
     healthRecords.Remove(hr);
 }
コード例 #14
0
ファイル: Word.cs プロジェクト: sm-g/diagnosis
 protected internal virtual void AddHr(HealthRecord hr)
 {
     Contract.Requires(hr != null);
     Contract.Requires(hr.Words.Contains(this));
     healthRecords.Add(hr);
 }
コード例 #15
0
ファイル: Doctor.cs プロジェクト: sm-g/diagnosis
 protected internal virtual void RemoveHr(HealthRecord hr)
 {
     Contract.Requires(hr != null);
     Contract.Requires(hr.Doctor == this);
     healthRecords.Remove(hr);
 }