public void addVitalSign(string type, VitalSign s) { if (!VitalSign.IsValidType(type)) { throw new Exception("Invalid Vital Sign: " + type); } if (theSigns.ContainsKey(type)) { throw new Exception("Set already contains " + type); } theSigns.Add(type, s); if (type == VitalSign.BLOOD_PRESSURE) { string[] parts = StringUtils.split(s.Value1, StringUtils.SLASH); if (parts.Length == 2) { VitalSign vs = new VitalSign(); vs.Type = new ObservationType("", VitalSign.VITAL_SIGN, VitalSign.SYSTOLIC_BP); vs.Timestamp = s.Timestamp; vs.Value1 = parts[0]; vs.Units = s.Units; vs.Qualifiers = s.Qualifiers; theSigns.Add(VitalSign.SYSTOLIC_BP, vs); vs = new VitalSign(); vs.Type = new ObservationType("", VitalSign.VITAL_SIGN, VitalSign.DIASTOLIC_BP); vs.Timestamp = s.Timestamp; vs.Value1 = parts[1]; vs.Units = s.Units; vs.Qualifiers = s.Qualifiers; theSigns.Add(VitalSign.DIASTOLIC_BP, vs); } } }
public VitalSignTO(VitalSign mdo) { if (mdo.Observer != null) { this.observer = new AuthorTO(mdo.Observer); } if (mdo.Recorder != null) { this.recorder = new AuthorTO(mdo.Recorder); } this.timestamp = mdo.Timestamp; if (mdo.Facility != null) { this.facility = new TaggedText(mdo.Facility.Id, mdo.Facility.Name); } if (mdo.Location != null) { this.location = new HospitalLocationTO(mdo.Location); } if (mdo.Type != null) { this.type = new ObservationTypeTO(mdo.Type); } this.comment = mdo.Comment; this.value1 = mdo.Value1; this.value2 = mdo.Value2; this.units = mdo.Units; this.qualifiers = mdo.Qualifiers; }
public TaggedVitalSignArray(string tag, VitalSign mdo) { this.tag = tag; if (mdo == null) { this.count = 0; return; } this.vitals = new VitalSignTO[1]; this.vitals[0] = new VitalSignTO(mdo); this.count = 1; }
public TaggedVitalSignArray(string tag, VitalSign[] mdos) { this.tag = tag; if (mdos == null) { this.count = 0; return; } this.vitals = new VitalSignTO[mdos.Length]; for (int i = 0; i < mdos.Length; i++) { this.vitals[i] = new VitalSignTO(mdos[i]); } this.count = vitals.Length; }