Skip to content

Commit

Permalink
added CdmEtlReference to CdmSource
Browse files Browse the repository at this point in the history
  • Loading branch information
bradanton committed Mar 22, 2024
1 parent c5f5e62 commit 210050b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using org.ohdsi.cdm.framework.common.Enums;
using org.ohdsi.cdm.framework.common.Omop;
using org.ohdsi.cdm.framework.common.Omop;
using System;
using System.Collections.Generic;
using System.Data;
Expand All @@ -17,11 +16,11 @@ public CdmSourceDataReader54(Vendors vendor)
_enumerator = new List<CdmSource> { new(vendor) }.GetEnumerator();
}

public CdmSourceDataReader54(Vendors vendor, DateTime sourceReleaseDate, string vocabularyVersion)
public CdmSourceDataReader54(Vendors vendor, DateTime sourceReleaseDate, string vocabularyVersion, string cdmEtlReference)
{
_enumerator = new List<CdmSource>
{
new(vendor) {SourceReleaseDate = sourceReleaseDate, VocabularyVersion = vocabularyVersion}
new(vendor) {SourceReleaseDate = sourceReleaseDate, VocabularyVersion = vocabularyVersion, CdmEtlReference = cdmEtlReference}
}.GetEnumerator();
}

Expand Down
29 changes: 14 additions & 15 deletions sources/Framework/org.ohdsi.cdm.framework.common3/Omop/CdmSource.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.7.306" />
<PackageReference Include="AWSSDK.S3" Version="3.7.307" />
<PackageReference Include="CsvHelper" Version="31.0.2" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.3" />
<PackageReference Include="MySqlConnector" Version="2.3.5" />
<PackageReference Include="MySqlConnector" Version="2.3.6" />
<PackageReference Include="Npgsql" Version="8.0.2" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="System.Data.Odbc" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@ class Options

[Option("new", Required = true)]
public bool? CreateNewBuildingId { get; set; }

[Option("etl_ref")]
public string cdmEtlReference { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static int Main(string[] arguments)

bool skipCdmsource = true;

string cdmEtlReference = string.Empty;

var r = Parser.Default.ParseArguments<Options>(arguments)
.WithParsed<Options>(o =>
{
Expand All @@ -70,6 +72,7 @@ static int Main(string[] arguments)
createNewBuildingId = o.CreateNewBuildingId.Value;
skipCdmsource = o.CdmSource.Value;
resumeChunkCreation = o.ResumeChunk.Value;
cdmEtlReference = o.cdmEtlReference;
});

if (r.Tag.ToString() != "Parsed")
Expand Down Expand Up @@ -266,7 +269,7 @@ static int Main(string[] arguments)

if (Settings.Current.Building.Cdm == CdmVersions.V54)
{
var reader = new CdmSourceDataReader54(vendor, DateTime.Parse(sourceReleaseDate), vocabularyVersion);
var reader = new CdmSourceDataReader54(vendor, DateTime.Parse(sourceReleaseDate), vocabularyVersion, cdmEtlReference);
using var stream = reader.GetStreamCsv();
SaveToS3(stream, 0, "cdmCSV", "CDM_SOURCE", "gz", vendor, Settings.Current.Building.Id.Value);
}
Expand Down

0 comments on commit 210050b

Please sign in to comment.