public virtual void PopCurrentLocation() { DateTime previousCurrentDate = DateTime.MinValue; VisitLocation current = null; VisitLocation previousCurrent = null; foreach (VisitLocation vl in this.Locations) { if (vl.Role == VisitLocationRole.CR) { if (vl.EndTime == null) { current = vl; } else if (vl.EndTime > previousCurrentDate) { previousCurrent = vl; } } } if (current != null && previousCurrent != null) { this.Locations.Remove(current); previousCurrent.EndTime = null; } else { } }
public void CopyFrom(VisitLocation vl) { this.Role = vl.Role; this.Location = vl.Location; this.StartTime = vl.StartTime; this.EndTime = vl.EndTime; }
public virtual void CopyFrom(Visit v) { this.VisitNumber.Id = v.VisitNumber.Id; this.VisitNumber.AssigningAuthority = v.VisitNumber.AssigningAuthority; this.Status = v.Status; this.AdmitTime = v.AdmitTime; this.PatientClass = v.PatientClass; this.PatientType = v.PatientType; this.AdmissionType = v.AdmissionType; this.Facility = v.Facility; this.DischargeTime = v.DischargeTime; this.DischargeDisposition = v.DischargeDisposition; this.VipIndicator = v.VipIndicator; //this.AmbulatoryStatus = v.AmbulatoryStatus; this.PreadmitNumber = v.PreadmitNumber; foreach (AmbulatoryStatusEnum a in v.AmbulatoryStatuses) { this.AmbulatoryStatuses.Add(a); } foreach (VisitPractitioner vp in v.Practitioners) { VisitPractitioner practitioner = new VisitPractitioner(); practitioner.CopyFrom(vp); this.Practitioners.Add(practitioner); } foreach (VisitLocation vl in v.Locations) { VisitLocation location = new VisitLocation(); location.CopyFrom(vl); this.Locations.Add(location); } ExtendedPropertyUtils.Update(this.ExtendedProperties, v.ExtendedProperties); }
private static VisitLocationDetail CreateVisitLocationDetail(VisitLocation vl, IPersistenceContext context) { var detail = new VisitLocationDetail { Location = new LocationAssembler().CreateLocationSummary(vl.Location), Room = vl.Room, Bed = vl.Bed, Role = EnumUtils.GetEnumValueInfo(vl.Role, context), StartTime = vl.StartTime, EndTime = vl.EndTime }; return detail; }