public void Initialize() { var folder = Settings.Current.Builder.Folder; lookups = new Dictionary <string, MultiLookup>(); sourceLookups = new Dictionary <string, SourceLookup>(); rfLookups = new Dictionary <string, ReferenceFileLookup>(); genderConcepts = new GenderLookup(); genderConcepts.Load(); ingredientLevel = string.IsNullOrEmpty(folder) ? new MultiLookup(Settings.Current.Building.VocabularyConnectionString, @"Common\Lookups\IngredientLevel.sql") : new MultiLookup(Settings.Current.Building.VocabularyConnectionString, Path.Combine(folder, @"Common\Lookups\IngredientLevel.sql")); ingredientLevel.Load(); foreach (var qd in Settings.Current.Building.SourceQueryDefinitions) { if (qd.Persons != null) { foreach (var d in qd.Persons) { d.Vocabulary = this; } } Load(folder, qd.ConditionOccurrence); Load(folder, qd.DrugExposure); Load(folder, qd.ProcedureOccurrence); Load(folder, qd.Observation); Load(folder, qd.VisitOccurrence); Load(folder, qd.CareSites); Load(folder, qd.Providers); Load(folder, qd.ProcedureCost); Load(folder, qd.Death); } locationConcepts = new EntityLookup <Location>(Settings.Current.Building.DestinationConnectionString); var location = Settings.Current.Building.CommonQueryDefinitions.FirstOrDefault(qd => qd.Locations != null); if (location != null) { locationConcepts.Load(location, location.Locations[0]); } }
public void Initialize() { var folder = Settings.Current.Builder.Folder; lookups = new Dictionary<string, MultiLookup>(); sourceLookups = new Dictionary<string, SourceLookup>(); rfLookups = new Dictionary<string, ReferenceFileLookup>(); genderConcepts = new GenderLookup(); genderConcepts.Load(); ingredientLevel = string.IsNullOrEmpty(folder) ? new MultiLookup(Settings.Current.Building.VocabularyConnectionString, @"Common\Lookups\IngredientLevel.sql") : new MultiLookup(Settings.Current.Building.VocabularyConnectionString, Path.Combine(folder, @"Common\Lookups\IngredientLevel.sql")); ingredientLevel.Load(); foreach (var qd in Settings.Current.Building.SourceQueryDefinitions) { if (qd.Persons != null) { foreach (var d in qd.Persons) { d.Vocabulary = this; } } Load(folder, qd.ConditionOccurrence); Load(folder, qd.DrugExposure); Load(folder, qd.ProcedureOccurrence); Load(folder, qd.Observation); Load(folder, qd.VisitOccurrence); Load(folder, qd.CareSites); Load(folder, qd.Providers); Load(folder, qd.ProcedureCost); Load(folder, qd.Death); } locationConcepts = new EntityLookup<Location>(Settings.Current.Building.DestinationConnectionString); var location = Settings.Current.Building.CommonQueryDefinitions.FirstOrDefault(qd => qd.Locations != null); if (location != null) { locationConcepts.Load(location, location.Locations[0]); } }
private void Load(string folder, IEnumerable<EntityDefinition> definitions) { if (definitions == null) return; foreach (var ed in definitions) { ed.Vocabulary = this; if (ed.Concepts == null) continue; foreach (var c in ed.Concepts) { if (!string.IsNullOrEmpty(c.SourceLookup)) { if (!sourceLookups.ContainsKey(c.SourceLookup)) { var lookupFolder = c.SourceLookup; if (!string.IsNullOrEmpty(folder)) lookupFolder = Path.Combine(folder, c.SourceLookup); var lookup = new SourceLookup(Settings.Current.Building.VocabularyConnectionString, lookupFolder); lookup.Load(); sourceLookups.Add(c.SourceLookup, lookup); } } if (c.ConceptIdMappers == null) continue; foreach (var conceptIdMapper in c.ConceptIdMappers) { if (!string.IsNullOrEmpty(conceptIdMapper.Lookup)) { if (!lookups.ContainsKey(conceptIdMapper.Lookup)) { var lookupFolder = conceptIdMapper.Lookup; if (!string.IsNullOrEmpty(folder)) lookupFolder = Path.Combine(folder, conceptIdMapper.Lookup); var lookup = new MultiLookup(Settings.Current.Building.VocabularyConnectionString, lookupFolder); lookup.Load(); lookups.Add(conceptIdMapper.Lookup, lookup); } } if (string.IsNullOrEmpty(conceptIdMapper.File)) continue; if (lookups.ContainsKey(conceptIdMapper.File)) continue; var lookupFileLocation = conceptIdMapper.File; if (!string.IsNullOrEmpty(folder)) { lookupFileLocation = Path.Combine(folder, conceptIdMapper.File); } var rfLookup = new ReferenceFileLookup(lookupFileLocation); rfLookup.Load(); rfLookups.Add(conceptIdMapper.File, rfLookup); } } } }
private void Load(string folder, IEnumerable <EntityDefinition> definitions) { if (definitions == null) { return; } foreach (var ed in definitions) { ed.Vocabulary = this; if (ed.Concepts == null) { continue; } foreach (var c in ed.Concepts) { if (!string.IsNullOrEmpty(c.SourceLookup)) { if (!sourceLookups.ContainsKey(c.SourceLookup)) { var lookupFolder = c.SourceLookup; if (!string.IsNullOrEmpty(folder)) { lookupFolder = Path.Combine(folder, c.SourceLookup); } var lookup = new SourceLookup(Settings.Current.Building.VocabularyConnectionString, lookupFolder, Settings.Current.Building.VocabularySchemaName); lookup.Load(); sourceLookups.Add(c.SourceLookup, lookup); } } if (c.ConceptIdMappers == null) { continue; } foreach (var conceptIdMapper in c.ConceptIdMappers) { if (!string.IsNullOrEmpty(conceptIdMapper.Lookup)) { if (!lookups.ContainsKey(conceptIdMapper.Lookup)) { var lookupFolder = conceptIdMapper.Lookup; if (!string.IsNullOrEmpty(folder)) { lookupFolder = Path.Combine(folder, conceptIdMapper.Lookup); } var lookup = new MultiLookup(GetConnectionString(lookupFolder), lookupFolder, GetSchemaName(lookupFolder)); lookup.Load(); lookups.Add(conceptIdMapper.Lookup, lookup); } } if (string.IsNullOrEmpty(conceptIdMapper.File)) { continue; } if (lookups.ContainsKey(conceptIdMapper.File)) { continue; } var lookupFileLocation = conceptIdMapper.File; if (!string.IsNullOrEmpty(folder)) { lookupFileLocation = Path.Combine(folder, conceptIdMapper.File); } if (!rfLookups.ContainsKey(conceptIdMapper.File)) { var rfLookup = new ReferenceFileLookup(lookupFileLocation); rfLookup.Load(); rfLookups.Add(conceptIdMapper.File, rfLookup); } } if (c.SourceConceptIdMappers != null) { foreach (var conceptIdMapper in c.SourceConceptIdMappers) { if (!string.IsNullOrEmpty(conceptIdMapper.Lookup)) { if (!lookups.ContainsKey(conceptIdMapper.Lookup)) { var lookupFolder = conceptIdMapper.Lookup; if (!string.IsNullOrEmpty(folder)) { lookupFolder = Path.Combine(folder, conceptIdMapper.Lookup); } var lookup = new MultiLookup(GetConnectionString(lookupFolder), lookupFolder, GetSchemaName(lookupFolder)); lookup.Load(); lookups.Add(conceptIdMapper.Lookup, lookup); } } } } } } }
public void Initialize() { var folder = Settings.Current.Builder.Folder; lookups = new Dictionary <string, MultiLookup>(); sourceLookups = new Dictionary <string, SourceLookup>(); rfLookups = new Dictionary <string, ReferenceFileLookup>(); genderConcepts = new GenderLookup(); genderConcepts.Load(); var ingredientLevelFile = Settings.Current.Building.CDM.GetAttribute <IngredientLevelFileAttribute>().Value; var vendorIngredientLevelFile = Settings.Current.Building.Vendor.GetAttribute <IngredientLevelFileAttribute>(); if (vendorIngredientLevelFile != null) { ingredientLevelFile = vendorIngredientLevelFile.Value; } ingredientLevel = string.IsNullOrEmpty(folder) ? new MultiLookup(Settings.Current.Building.VocabularyConnectionString, @"Common\Lookups\" + ingredientLevelFile, Settings.Current.Building.VocabularySchemaName) : new MultiLookup(Settings.Current.Building.VocabularyConnectionString, Path.Combine(folder, @"Common\Lookups\" + ingredientLevelFile), Settings.Current.Building.VocabularySchemaName); ingredientLevel.Load(); foreach (var qd in Settings.Current.Building.SourceQueryDefinitions) { if (qd.Persons != null) { foreach (var d in qd.Persons) { d.Vocabulary = this; } } Load(folder, qd.ConditionOccurrence); Load(folder, qd.DrugExposure); Load(folder, qd.ProcedureOccurrence); Load(folder, qd.Observation); Load(folder, qd.VisitOccurrence); Load(folder, qd.CareSites); Load(folder, qd.Providers); Load(folder, qd.Death); Load(folder, qd.Measurement); Load(folder, qd.DeviceExposure); Load(folder, qd.Note); Load(folder, qd.VisitCost); Load(folder, qd.ProcedureCost); Load(folder, qd.DeviceCost); Load(folder, qd.ObservationCost); Load(folder, qd.MeasurementCost); Load(folder, qd.DrugCost); } locationConcepts = new EntityLookup <Location>(Settings.Current.Building.DestinationConnectionString, Settings.Current.Building.DestinationSchemaName); var location = Settings.Current.Building.CommonQueryDefinitions.FirstOrDefault(qd => qd.Locations != null); if (location != null) { //if (Settings.Current.Building.DestinationEngine.Database == Database.Redshift) //{ // locationConcepts.LoadFromS3(location, location.Locations[0], "LOCATION.txt", new Dictionary<string, int> // { // {"LOCATION_ID", 0}, // {"STATE", 1}, // {"LOCATION_SOURCE_VALUE", 2} // }); //} //else { locationConcepts.Load(location, location.Locations[0]); } } }