gov.va.medora.mdo.VitalSign.IsValidType C# (CSharp) Метод

IsValidType() публичный статический Метод

public static IsValidType ( string type ) : bool
type string
Результат bool
        public static bool IsValidType(string type)
        {
            for (int i = 0; i < validTypes.Length; i++)
            {
                if (type == validTypes[i])
                {
                    return true;
                }
            }
            return false;
        }

Usage Example

Пример #1
0
        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);
                }
            }
        }