public List <string> AllCodesToBeMapped(string fileName, string segmentType, int field, int component) { List <string> CDMCodes = new List <string>(); string[] cdmCodes = File.ReadAllLines(fileName); foreach (string code in cdmCodes) { CDMCode currentCDMCode = new CDMCode(); string[] CDMCodeLineArray = code.Split('\t').ToArray(); if (segmentType == CDMCodeLineArray[0] && field.ToString() == CDMCodeLineArray[1] && component.ToString() == CDMCodeLineArray[2]) { CDMCodes.Add(CDMCodeLineArray[3].ToString()); } } return(CDMCodes); }
public List <CDMCode> AllCodesToBeMapped(string fileName)//--this returns all codes { List <CDMCode> CDMCodes = new List <CDMCode>(); string[] cdmCodes = File.ReadAllLines(fileName); foreach (string code in cdmCodes) { CDMCode currentCDMCode = new CDMCode(); string[] CDMCodeLineArray = code.Split('\t').ToArray(); currentCDMCode.Segment = CDMCodeLineArray[0]; currentCDMCode.Field = CDMCodeLineArray[1]; currentCDMCode.Component = CDMCodeLineArray[2]; currentCDMCode.CodeValue = CDMCodeLineArray[3]; currentCDMCode.TextDescription = CDMCodeLineArray[4]; CDMCodes.Add(currentCDMCode); } return(CDMCodes); }
public List <CDMCode> AllCodesToBeMapped(string fileName, string segmentType, int field) { List <CDMCode> CDMCodes = new List <CDMCode>(); string[] cdmCodes = File.ReadAllLines(fileName); foreach (string code in cdmCodes) { CDMCode currentCDMCode = new CDMCode(); string[] CDMCodeLineArray = code.Split('\t').ToArray(); if (segmentType == CDMCodeLineArray[0] && field.ToString() == CDMCodeLineArray[1]) { currentCDMCode.Segment = CDMCodeLineArray[0]; currentCDMCode.Field = CDMCodeLineArray[1]; currentCDMCode.Component = CDMCodeLineArray[2]; currentCDMCode.CodeValue = CDMCodeLineArray[3]; currentCDMCode.TextDescription = CDMCodeLineArray[4]; CDMCodes.Add(currentCDMCode); } } return(CDMCodes); }