public static CodeDictionary <int> GetControllerTypes() { CodeDictionary <int> ret = new CodeDictionary <int>(); ret.Add(1, "MVC"); ret.Add(2, "API"); return(ret); }
public static CodeDictionary <int> GetChargeTypes() { CodeDictionary <int> ret = new CodeDictionary <int>(); ret.Add(1, "检验项目"); ret.Add(2, "检查项目"); ret.Add(3, "药品明细"); return(ret); }
public static CodeDictionary <string> GetGenders() { CodeDictionary <string> ret = new CodeDictionary <string>(); ret.Add("0", Lang.Male); ret.Add("1", Lang.Female); //ret.Add("3", Lang.Unknown); return(ret); }
public static CodeDictionary <string> GetUnits() { CodeDictionary <string> ret = new CodeDictionary <string>(); ret.Add("01", "支"); ret.Add("02", "瓶"); ret.Add("03", "克"); ret.Add("04", "次"); return(ret); }
public static CodeDictionary <string> GetIDTypes() { CodeDictionary <string> ret = new CodeDictionary <string>(); ret.Add("0", Lang.IDCard); ret.Add("1", Lang.ResidentsBooklet); ret.Add("2", Lang.Passport); ret.Add("3", Lang.MilitaryOfficer); ret.Add("4", Lang.DriverLicense); ret.Add("5", Lang.HKMacaoPass); ret.Add("6", Lang.TaiwanPass); ret.Add("7", Lang.HMTIDCard); ret.Add("99", Lang.Other); return(ret); }
public static CodeDictionary <string> GetDoctorTitles() { if (Positions == null) { Positions = new CodeDictionary <string>(); foreach (EnumDoctorTitle type in Enum.GetValues(typeof(EnumDoctorTitle))) { Positions.Add(((int)type).ToString(), type.GetEnumDescript()); } } return(Positions); }
public static CodeDictionary <string> GetDiseases() { CodeDictionary <string> ret = new CodeDictionary <string>(); ret.Add("01", "高血压"); ret.Add("02", "高血脂"); ret.Add("03", "糖尿病"); ret.Add("04", "冠心病"); ret.Add("05", "恶性肿瘤"); ret.Add("06", "结核病"); ret.Add("07", "心律失常"); ret.Add("08", "其他"); return(ret); }
public static CodeDictionary <string> GetRelationships() { CodeDictionary <string> ret = new CodeDictionary <string>(); ret.Add("00", Lang.Myself); ret.Add("01", Lang.Spouse); ret.Add("02", Lang.Father); ret.Add("03", Lang.Mother); ret.Add("04", Lang.Son); ret.Add("05", Lang.Daughter); ret.Add("06", Lang.Other); return(ret); }
public static void Decompress(Stream input, long length, Stream output, Endian endian) { var dictionary = new CodeDictionary(); long remaining = length; while (remaining > 0) { var blockLength = input.ReadValueU32(endian); var bytes = input.ReadBytes(blockLength); var reader = new BitReader(bytes); byte[] line; byte lastValue; int previousIndex = reader.ReadInt32(dictionary.CodeLength); line = dictionary.Decode(previousIndex, out lastValue); output.WriteBytes(line); remaining -= line.Length; while (reader.Position < reader.Length) { if (dictionary.Count + 1 >= CodeDictionary.Capacity) { dictionary.Reset(); previousIndex = reader.ReadInt32(dictionary.CodeLength); line = dictionary.Decode(previousIndex, out lastValue); output.WriteBytes(line); remaining -= line.Length; continue; } dictionary.UpdateCodeLength(); var index = reader.ReadInt32(dictionary.CodeLength); if (index == dictionary.Count) { if (previousIndex != -1) { dictionary.Add(lastValue, previousIndex); } line = dictionary.Decode(index, out lastValue); output.WriteBytes(line); remaining -= line.Length; } else { if (index > dictionary.Count) { throw new InvalidOperationException(); } line = dictionary.Decode(index, out lastValue); output.WriteBytes(line); remaining -= line.Length; if (previousIndex != -1) { dictionary.Add(lastValue, previousIndex); } } previousIndex = index; } if (reader.Position != reader.Length) { throw new InvalidOperationException(); } } if (remaining < 0) { throw new InvalidOperationException(); } }