OHDSI / Eunomia

An R package that facilitates access to a variety of OMOP CDM sample data sets.
https://ohdsi.github.io/Eunomia/
42 stars 11 forks source link

Does the order of columns matter in the CDM specification? #55

Closed ablack3 closed 1 year ago

ablack3 commented 1 year ago

Should the column order of a CDM match the order in the specification or can the columns be in any order and still be considered a valid CDM?

In Eunomia GiBleed I see that the column order in the condition_occurrence table does not match the column order in the 5.3 specification. Is this an error or can columns be in any order in a CDM?

image

https://ohdsi.github.io/CommonDataModel/cdm53.html#CONDITION_OCCURRENCE

library(DatabaseConnector)
con <- connect(Eunomia::getEunomiaConnectionDetails())
#> Connecting using SQLite driver
querySql(con, "select * from main.condition_occurrence limit 0")
#>  [1] CONDITION_OCCURRENCE_ID       PERSON_ID                    
#>  [3] CONDITION_CONCEPT_ID          CONDITION_START_DATE         
#>  [5] CONDITION_START_DATETIME      CONDITION_END_DATE           
#>  [7] CONDITION_END_DATETIME        CONDITION_TYPE_CONCEPT_ID    
#>  [9] STOP_REASON                   PROVIDER_ID                  
#> [11] VISIT_OCCURRENCE_ID           VISIT_DETAIL_ID              
#> [13] CONDITION_SOURCE_VALUE        CONDITION_SOURCE_CONCEPT_ID  
#> [15] CONDITION_STATUS_SOURCE_VALUE CONDITION_STATUS_CONCEPT_ID  
#> <0 rows> (or 0-length row.names)
disconnect(con)
packageVersion("Eunomia")
#> [1] '1.0.2'

Created on 2023-07-19 with reprex v2.0.2

CONDITION_STATUS_CONCEPT_ID comes at the end but in the specification it comes before STOP_REASON.

clairblacketer commented 1 year ago

Hi @ablack3 so since we only look for the presence of columns in the DQD and we allow data partners to add their own site-specific columns, I personally do not think we should mandate a particular order to deem a CDM valid.

ablack3 commented 1 year ago

Good to know. Thanks @clairblacketer!