当前位置: 首页>>代码示例>>C#>>正文


C# IDataReader.GetLong方法代码示例

本文整理汇总了C#中IDataReader.GetLong方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetLong方法的具体用法?C# IDataReader.GetLong怎么用?C# IDataReader.GetLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDataReader的用法示例。


在下文中一共展示了IDataReader.GetLong方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetConcepts

        public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
        {
            var id = string.IsNullOrEmpty(Id) ? KeyMaster.GetCareSiteId() : int.Parse(reader[Id].ToString());

             yield return new CareSite
                         {
                            Id = id,
                            LocationId = reader.GetLong(LocationId).Value,
                            PlaceOfSvcSourceValue = reader.GetString(PlaceOfSvcSourceValue),
                            SourceValue = id.ToString()
                         };
        }
开发者ID:bradanton,项目名称:ETL-CDMBuilder,代码行数:12,代码来源:CareSiteDefinition.cs

示例2: GetConcepts

        public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
        {
            var personId = reader.GetLong(PersonId);

             var startDate = reader.GetDateTime(StartDate);
             var endDate = reader.GetDateTime(EndDate);

             if (personId.HasValue)
             {
            Dictionary<string, string> additionalFields = null;
            if (AdditionalFields != null)
            {
               additionalFields = new Dictionary<string, string>(AdditionalFields.Length);
               foreach (var additionalField in AdditionalFields)
               {
                  additionalFields.Add(additionalField.ToLower(), reader.GetString(additionalField));
               }
            }

            var payerSourceValue = reader.GetString(PayerSource);
            if (string.IsNullOrWhiteSpace(payerSourceValue))
               payerSourceValue = null;

            yield return new PayerPlanPeriod
                            {
                               PersonId = personId.Value,
                               StartDate = startDate,
                               EndDate = endDate,
                               PayerSourceValue = payerSourceValue,
                               PlanSourceValue = reader.GetString(PlanSource),
                               FamilySourceValue = reader.GetString(FamilySource),
                               VisitOccurrenceId = reader.GetLong(VisitOccurrenceId),
                               AdditionalFields = additionalFields
                            };
             }
        }
开发者ID:bradanton,项目名称:ETL-CDMBuilder,代码行数:36,代码来源:PayerPlanPeriodDefinition.cs

示例3: GetConcepts

        public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
        {
            var visitOccurrences = base.GetConcepts(concept, reader, keyMaster).ToList();

             if(visitOccurrences.Count > 0)
             {
            var id = reader.GetLong(Id);
            var visitOccurrence = new VisitOccurrence((Entity) visitOccurrences[0])
                                     {
                                        CareSiteId = reader.GetInt(CareSiteId) ?? 0
                                     };
            if(id.HasValue)
            {
               visitOccurrence.Id = id.Value;
            }
            else
            {
               visitOccurrence.IdUndefined = true;
            }

            yield return visitOccurrence;
             }
        }
开发者ID:bradanton,项目名称:ETL-CDMBuilder,代码行数:23,代码来源:VisitOccurrenceDefinition.cs

示例4: GetConcepts

        public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
        {
            long id;
             var idUndefined = false;
             if (string.IsNullOrEmpty(Id))
             {
            id = KeyMaster.GetProviderId();
            idUndefined = true;
             }
             else
             {
            id = reader.GetLong(Id).Value;
             }

             if (concept == null)
             {
            yield return new Provider
               {
                  Id = id,
                  CareSiteId = reader.GetInt(CareSiteId) ?? 0,
                  ProviderSourceValue = reader.GetString(ProviderSourceValue),
                  SourceValue = reader.GetString(SpecialtySourceValue)
               };
             }
             else
             {
            var conceptField = concept.Fields[0];

            var source = reader.GetString(conceptField.Key) ?? reader.GetString(conceptField.SourceKey);

            if (source != null && source.Length == 0)
               source = null;

            var specialtyConceptIds = concept.GetValues(Vocabulary, conceptField, reader).ToList();
            long? specialtyConcept = null;

            //(Unknown Physician Specialty)
            long defaultConceptId = 38004514;

            if (conceptField.DefaultConceptId.HasValue)
            {
               defaultConceptId = conceptField.DefaultConceptId.Value;
            }

            if (specialtyConceptIds.Count > 0)
            {
               specialtyConcept = specialtyConceptIds[0].ConceptId;
            }

            yield return new Provider
               {
                  Id = id,
                  IdUndefined = idUndefined,
                  CareSiteId = reader.GetInt(CareSiteId) ?? 0,
                  ConceptId = specialtyConcept.HasValue ? specialtyConcept.Value : defaultConceptId,
                  ProviderSourceValue = reader.GetString(ProviderSourceValue),
                  SourceValue =
                     string.IsNullOrEmpty(conceptField.SourceKey) ? source : reader.GetString(conceptField.SourceKey)
               };
             }
        }
开发者ID:bradanton,项目名称:ETL-CDMBuilder,代码行数:61,代码来源:ProviderDefinition.cs

示例5: GetConcepts

        public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
        {
            var locationSourceValue = reader.GetString(Location);
             int? locationId = null;
             if (!string.IsNullOrEmpty(Location))
             {
            locationId = Vocabulary.LookupLocation(locationSourceValue);
             }

             var observationPeriodGap = 32;
             if(!string.IsNullOrEmpty(ObservationPeriodGap))
             {
            observationPeriodGap = int.Parse(ObservationPeriodGap);
             }

             var genderSource = reader.GetString(Gender);
             var genderConceptId = Vocabulary.LookupGender(genderSource);

             var personId = reader.GetLong(PersonId);
             if(personId.HasValue)
             {
            yield return new Person
                            {
                               ObservationPeriodGap = observationPeriodGap,
                               PersonId = personId.Value,
                               StartDate = reader.GetDateTime(StartDate),
                               EndDate = reader.GetDateTime(EndDate),
                               PersonSourceValue = reader.GetString(PersonSourceValue),
                               GenderSourceValue = genderSource,
                               GenderConceptId = genderConceptId,
                               LocationId = locationId,
                               YearOfBirth = reader.GetInt(YearOfBirth),
                               MonthOfBirth = reader.GetInt(MonthOfBirth),
                               DayOfBirth = reader.GetInt(DayOfBirth),
                               LocationSourceValue = locationSourceValue,
                               CareSiteId = reader.GetInt(CareSiteId),
                               EthnicitySourceValue = reader.GetString(Ethnicity),
                               EthnicityConceptId = reader.GetInt(EthnicityConceptId) ?? 0,
                               RaceSourceValue = reader.GetString(Race),
                               RaceConceptId = reader.GetInt(RaceConceptId) ?? 0,
                               ProviderId = reader.GetInt(ProviderId)
                            };
             }
        }
开发者ID:bradanton,项目名称:ETL-CDMBuilder,代码行数:44,代码来源:PersonDefinition.cs

示例6: GetConcepts

        public virtual IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
        {
            var personId = reader.GetLong(PersonId);

             if (personId.HasValue)
             {
            var startDate = reader.GetDateTime(StartDate);
            var endDate = startDate;
            if (!string.IsNullOrEmpty(EndDate))
               endDate = reader.GetDateTime(EndDate);

            Dictionary<string, string> additionalFields = null;
            if (AdditionalFields != null)
            {
               additionalFields = new Dictionary<string, string>(AdditionalFields.Length);
               foreach (var additionalField in AdditionalFields)
               {
                  additionalFields.Add(additionalField.ToLower(), reader.GetString(additionalField));
               }
            }

            foreach (var field in concept.Fields)
            {
               var sourceValue = field.DefaultSource;
               if (string.IsNullOrEmpty(sourceValue))
                  sourceValue = reader.GetString(field.Key);

               if (!field.IsNullable && string.IsNullOrEmpty(sourceValue) && field.DefaultConceptId == null && field.ConceptId == null)
                  continue;

               // Used when: field.Key used for conceptId mapping and
               // field.SourceKey used for SourceValue (by default field.Key and field.SourceKey are identical)
               if (!string.IsNullOrEmpty(field.SourceKey))
                  sourceValue = reader.GetString(field.SourceKey);

               if(!string.IsNullOrEmpty(concept.SourceLookup))
               {
                  var source = Vocabulary.LookupSource(sourceValue, concept.SourceLookup);
                  if (!string.IsNullOrEmpty(source))
                     sourceValue = source;
               }

               foreach (var lookupValue in concept.GetValues(Vocabulary, field, reader))
               {
                  var cId = lookupValue.ConceptId;
                  if (!cId.HasValue && field.DefaultConceptId.HasValue)
                     cId = field.DefaultConceptId;

                  if (!concept.IdRequired || cId.HasValue)
                  {
                     yield return new Entity
                     {
                        IsUnique = IsUnique,
                        PersonId = personId.Value,
                        SourceValue = sourceValue,
                        ConceptId = cId.HasValue ? cId.Value : 0,
                        TypeConceptId = concept.GetTypeId(field, reader),
                        StartDate = startDate,
                        EndDate = endDate == DateTime.MinValue ? (DateTime?) null : endDate,
                        ProviderId = reader.GetInt(ProviderId),
                        ProviderKey = reader.GetString(ProviderIdKey),
                        VisitOccurrenceId = reader.GetLong(VisitOccurrenceId),
                        AdditionalFields = additionalFields,
                        ValidStartDate = lookupValue.ValidStartDate,
                        ValidEndDate = lookupValue.ValidEndDate
                     };
                  }
               }
            }
             }
        }
开发者ID:bradanton,项目名称:ETL-CDMBuilder,代码行数:71,代码来源:EntityDefinition.cs


注:本文中的IDataReader.GetLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。