Esempio n. 1
0
        private void LoadRecordSymbols(Dictionary<string,object> symbols,Record record)
        {
            AddSymbol(symbols,record.Name,record);

            foreach( Item item in record.Items )
            {
                AddSymbol(symbols,item.Name,item);

                foreach( ValueSet vs in item.ValueSets )
                    AddSymbol(symbols,vs.Name,vs);
            }
        }
Esempio n. 2
0
 private void PrefixRecord(DataDictionary dict, string prefix, Record r)
 {
     PrefixDictObjectName(dict, prefix, r);
     r.Items.ForEach(i => PrefixItem(dict, prefix, i));
 }
Esempio n. 3
0
        private string LoadRecord()
        {
            _record = new Record(_level);

            string line;

            while( ( line = ReadTrimmedLine() ) != null && !IsHeader(line) )
            {
                string argument,value;

                ParseLine(line,out argument,out value);

                if( AssignSharedComponents(_record,argument,value) )
                {
                }

                else if( argument.Equals(DataDictionaryElements.RECORD_TYPE,StringComparison.InvariantCultureIgnoreCase) )
                    _record.RecordType = QuotedStringToString(value);

                else if( argument.Equals(DataDictionaryElements.RECORD_REQUIRED,StringComparison.InvariantCultureIgnoreCase) )
                    _record.Required = value.Equals(DataDictionaryElements.DICT_YES,StringComparison.InvariantCultureIgnoreCase);

                else if( argument.Equals(DataDictionaryElements.RECORD_MAX,StringComparison.InvariantCultureIgnoreCase) )
                    _record.MaxOccs = Int32.Parse(value,CultureInfo.InvariantCulture);

                else if( argument.Equals(DataDictionaryElements.RECORD_LEN,StringComparison.InvariantCultureIgnoreCase) )
                    _record.Length = Int32.Parse(value,CultureInfo.InvariantCulture);

                else if( argument.Equals(DataDictionaryElements.DICT_OCCLABEL,StringComparison.InvariantCultureIgnoreCase) )
                    ProcessOccurrenceLabel(_record.OccurrenceLabels,_record.MaxOccs,value);

                else
                    throw new DataDictionaryReaderException(line);
            }

            _level.AddRecord(_record);

            return line;
        }
Esempio n. 4
0
 public void AddRecord(Record record)
 {
     _records.Add(record);
 }
Esempio n. 5
0
        public Level(DataDictionary parent,int levelNum)
        {
            _parent = parent;
            _records = new List<Record>();
            LevelNum = levelNum;

            _ids = new Record(this);
            _ids.Name = String.Format("_IDS{0}",LevelNum - 1);
            _ids.Label = "(Id Items)";
        }
Esempio n. 6
0
 public Item(Record record)
 {
     _parent = record;
     _valuesets = new List<ValueSet>();
     _subitems = new List<Item>();
     _occurrenceLabels = new List<string>();
     Start = 1;
     Length = 1;
     Numeric = true;
     Subitem = false;
     Occurrences = 1;
     Decimal = 0;
     DecChar = false;
     ZeroFill = false;
 }
Esempio n. 7
0
        private void SaveRecord(Record record)
        {
            _tw.WriteLine();

            _tw.WriteLine(DataDictionaryElements.DICT_RECORD);
            SaveSharedComponents(record);

            char quoteChar = record.RecordType.IndexOf('\'') < 0 ? '\'' : '"';
            SaveOption(DataDictionaryElements.RECORD_TYPE,quoteChar + record.RecordType + quoteChar);

            if( !record.Required )
                SaveOption(DataDictionaryElements.RECORD_REQUIRED,record.Required);

            if( record.MaxOccs != 1 )
                SaveOption(DataDictionaryElements.RECORD_MAX,record.MaxOccs);

            SaveOption(DataDictionaryElements.RECORD_LEN,record.Length);

            if( record.MaxOccs != 1 )
                SaveOccurrenceLabels(record.OccurrenceLabels);

            foreach( Item item in record.Items )
                SaveItem(item);
        }