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]); } }
public void Fill(bool forLookup) { _genderConcepts = new GenderLookup(); _genderConcepts.Load(); _pregnancyConcepts = new PregnancyConcepts(); using (var client = new AmazonS3Client(Settings.Current.S3AwsAccessKeyId, Settings.Current.S3AwsSecretAccessKey, Amazon.RegionEndpoint.USEast1)) { foreach (var qd in Settings.Current.Building.SourceQueryDefinitions) { Load(client, qd.ConditionOccurrence); Load(client, qd.DrugExposure); Load(client, qd.ProcedureOccurrence); Load(client, qd.Observation); Load(client, qd.VisitOccurrence); //Load(client, qd.CareSites); //Load(client, qd.Providers); Load(client, qd.Death); Load(client, qd.Measurement); Load(client, qd.DeviceExposure); Load(client, qd.Note); Load(client, qd.VisitCost); Load(client, qd.ProcedureCost); Load(client, qd.DeviceCost); Load(client, qd.ObservationCost); Load(client, qd.MeasurementCost); Load(client, qd.DrugCost); } var lookup = new Lookup(); var prefix = $"{Settings.Current.Building.Vendor}/{Settings.Current.Building.Id}/Lookups/PregnancyDrug.txt"; Console.WriteLine(Settings.Current.Bucket + "/" + prefix); lookup.Fill(client, Settings.Current.Bucket, prefix); _lookups.Add("PregnancyDrug", lookup); } }
/// <summary> /// Fill vocabulary for source to conceptId mapping /// </summary> /// <param name="forLookup">true - fill vocab. for: CareSites, Providers, Locations; false - rest of us</param> public void Fill(bool forLookup, bool readFromS3) { _genderConcepts = new GenderLookup(); _genderConcepts.Load(); _pregnancyConcepts = new PregnancyConcepts(); foreach (var qd in Settings.Current.Building.SourceQueryDefinitions) { if (forLookup) { Load(qd.CareSites); Load(qd.Providers); Load(qd.Locations); } else { Load(qd.Persons); Load(qd.ConditionOccurrence); Load(qd.DrugExposure); Load(qd.ProcedureOccurrence); Load(qd.Observation); Load(qd.VisitOccurrence); Load(qd.VisitDetail); Load(qd.Death); Load(qd.Measurement); Load(qd.DeviceExposure); Load(qd.Note); Load(qd.VisitCost); Load(qd.ProcedureCost); Load(qd.DeviceCost); Load(qd.ObservationCost); Load(qd.MeasurementCost); Load(qd.DrugCost); } } LoadPregnancyDrug(); }
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]); } } }