OHDSI / ETL-CDMBuilder

ETL-CDMBuilder is a repo containing a .NET Core application to perform ETL to OMOP CDM for multiple databases
Apache License 2.0
50 stars 30 forks source link

Invalid column name 'DXVER' and issue related to mscorlib #13

Closed pkumar81 closed 7 years ago

pkumar81 commented 7 years ago

I downloaded the latest version of ETL-CDMBuilder and when I executed 'org.ohdsi.cdm.presentation.buildingmanager.exe', the first 3 steps of the building process 'CDM database creation', 'Chunks creation', and 'Lookup creation' ran successfully, but the fourth step 'Conversion from RAW to CDM' gave the following errors - 'One or more errors occurred. mscorlib' and 'Invalid column name 'DXVER'.

I had used the following builder settings: Vendor: Truven MDCR v5 Number of batches: 1 Batch Size: 100 MaxDegreeOfParallelism: 1

Also, I checked all tables in Truven database and no table has the DXVER column. Could you please tell me what needs to be changed to fix these issues?

The following information is from Building Manager:

Builder: MUSE1
Time: Oct 12 2016 11:34AM
Error: Exception Found:
Type: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
Stacktrace:    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
   at org.ohdsi.cdm.framework.core.Base.ChunkBuilder.Load()
   at org.ohdsi.cdm.presentation.builderprocess.Program.Build(BuilderController builderController)
  Inner Exception Found:
  Type: System.Data.SqlClient.SqlException
  Message: Invalid column name 'DXVER'.
  Source: .Net SqlClient Data Provider
  Stacktrace:    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at org.ohdsi.cdm.framework.core.Base.ChunkBuilder.<>c__DisplayClass9.<Load>b__4(QueryDefinition queryDefinition)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

Thanks, Praveen

ericaVoss commented 7 years ago

How old is your copy of Truven?

This was a new addition that helps you know the difference between a record with ICD9s (DXVER=9) or ICD10s (DXVER=0). DXVER was added in the 2015 data year, so everything 2014 and prior can be assumed to be DXVER=9. An easy fix would be to create the column and set it all to 9 (assuming your data is older).

bradanton commented 7 years ago

DXVER column should exists in following tables: 1)FACILITY_HEADER 2)INPATIENT_ADMISSIONS 3)INPATIENT_SERVICES 4)OUTPATIENT_SERVICES

pkumar81 commented 7 years ago

Thank you for the response. Adding DXVER column to the tables (FACILITY_HEADER, INPATIENT_ADMISSIONS, INPATIENT_SERVICES, OUTPATIENT_SERVICES) solved the error - "Invalid column name 'DXVER' ", but I am still getting the error related to 'mscorlib' (Type: System.AggregateException and Type: System.NullReferenceException)

I am using the following builder settings: Vendor: Truven CCAE v5 Number of batches: 1 Batch Size: 1000 MaxDegreeOfParallelism: 1

Could you please tell me if I need to do any change in the above parameters to fix this error?

Builder: MUSE1
Time: Oct 12 2016  4:30PM
Error: Exception Found:
Type: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
Stacktrace:    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
   at org.ohdsi.cdm.framework.core.Base.ChunkBuilder.Build()
   at org.ohdsi.cdm.presentation.builderprocess.Program.Build(BuilderController builderController)
  Inner Exception Found:
  Type: System.NullReferenceException
  Message: Object reference not set to an instance of an object.
  Source: org.ohdsi.cdm.builders.truven_v5
  Stacktrace:    at org.ohdsi.cdm.builders.truven_v5.Truvenv5PersonBuilder.GetFachdidKey(IEntity entity)
   at org.ohdsi.cdm.builders.truven_v5.Truvenv5PersonBuilder.<JoinVisitOccurrences>d__68`1.MoveNext()
   at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.GroupedEnumerable`3.GetEnumerator()
   at org.ohdsi.cdm.builders.truven_v5.Truvenv5PersonBuilder.BuildConditionOccurrences(ConditionOccurrence[] conditionOccurrences, Dictionary`2 vo, ObservationPeriod[] op)
   at org.ohdsi.cdm.builders.truven_v5.Truvenv5PersonBuilder.Build()
   at org.ohdsi.cdm.framework.core.Base.ChunkBuilder.<Build>b__b(KeyValuePair`2 cd)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )
bradanton commented 7 years ago

Hi Praveen,

Thank you for details, I am investigating the issue.

Thanks, Anton

ChristopheLambert commented 7 years ago

Hi Guys,

You have updated the DLLs in the repository, but have not committed the associated source code fixes -- making it hard for us to help out with bug fixing. Can you post the corrected code?

Thanks, Christophe

ericaVoss commented 7 years ago

Done, checked in.

bradanton commented 7 years ago

Hi Praveen,

I am trying to find out the cause of issue, could you please tell me which records do you have in visit lookup in vocabulary database, query below:

SELECT DISTINCT [CONCEPT_CODE], [CONCEPT_ID] FROM dbo.[CONCEPT] WHERE VOCABULARY_ID = 'Visit'

Thanks, Anton

pkumar81 commented 7 years ago

CONCEPT_CODE CONCEPT_ID ER 9203 IP 9201 LTCP 42898160 OP 9202

pkumar81 commented 7 years ago

Today I restarted the SQL Server and the application ETL-CDM Builder didn't throw any exception error. All the steps from 'CDM database creation' to 'Copying Vocabulary' worked fine. It seems that restarting the SQL server fixed those exception errors.