From 6287a8499d900ba87c396467033487fb9d941383 Mon Sep 17 00:00:00 2001 From: Florian Katsch Date: Tue, 20 Oct 2026 10:19:03 +0200 Subject: [PATCH 1/4] fix missaligned csv fields --- inst/csv/OMOP_CDMv5.3_Field_Level.csv | 3 +-- inst/csv/OMOP_CDMv6.0_Field_Level.csv | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/inst/csv/OMOP_CDMv5.3_Field_Level.csv b/inst/csv/OMOP_CDMv5.3_Field_Level.csv index aba25463..6830ecae 100644 --- a/inst/csv/OMOP_CDMv5.3_Field_Level.csv +++ b/inst/csv/OMOP_CDMv5.3_Field_Level.csv @@ -101,8 +101,7 @@ drug_exposure,refills,No,integer,This is only filled in when the record is comin drug_exposure,quantity,No,float,NA,"To find the dose form of a drug the RELATIONSHIP table can be used where the relationship_id is 'Has dose form'. If liquid, quantity stands for the total amount dispensed or ordered of ingredient in the units given by the drug_strength table. If the unit from the source data does not align with the unit in the DRUG_STRENGTH table the quantity should be converted to the correct unit given in DRUG_STRENGTH. For clinical drugs with fixed dose forms (tablets etc.) the quantity is the number of units/tablets/capsules prescribed or dispensed (can be partial, but then only 1/2 or 1/3, not 0.01). Clinical drugs with divisible dose forms (injections) the quantity is the amount of ingredient the patient got. For example, if the injection is 2mg/mL but the patient got 80mL then quantity is reported as 160. Quantified clinical drugs with divisible dose forms (prefilled syringes), the quantity is the amount of ingredient similar to clinical drugs. Please see [how to calculate drug dose](https://ohdsi.github.io/CommonDataModel/drug_dose.html) for more information. ",No,No,NA,NA,NA,NA -drug_exposure,days_supply,No,integer,NA,The number of days of supply of the medication as recorded in the original prescription or dispensing record. Days supply can differ from actual drug duration (i.e. prescribed days supply vs actual exposure).\,"\The field should be left empty if the source data does not contain a verbatim days_supply, and should not be calculated from other fields.

Negative values are not allowed. If the source has negative days supply the record should be dropped as it is unknown if the patient actually took the drug. Several actions are possible: 1) record is not trustworthy and we remove the record entirely. 2) we trust the record and leave days_supply empty or 3) record needs to be combined with other record (e.g. reversal of prescription). High values (>365 days) should be investigated. If considered an error in the source data (e.g. typo), the value needs to be excluded to prevent creation of unrealistic long eras.",No,No,NA,NA,NA -NA,,,,,,,,,,, +drug_exposure,days_supply,No,integer,The number of days of supply of the medication as recorded in the original prescription or dispensing record. Days supply can differ from actual drug duration (i.e. prescribed days supply vs actual exposure).,"The field should be left empty if the source data does not contain a verbatim days_supply, and should not be calculated from other fields.

Negative values are not allowed. If the source has negative days supply the record should be dropped as it is unknown if the patient actually took the drug. Several actions are possible: 1) record is not trustworthy and we remove the record entirely. 2) we trust the record and leave days_supply empty or 3) record needs to be combined with other record (e.g. reversal of prescription). High values (>365 days) should be investigated. If considered an error in the source data (e.g. typo), the value needs to be excluded to prevent creation of unrealistic long eras.",No,No,NA,NA,NA,NA drug_exposure,sig,No,varchar(MAX),This is the verbatim instruction for the drug as written by the provider.,"Put the written out instructions for the drug as it is verbatim in the source, if available.",No,No,NA,NA,NA,NA drug_exposure,route_concept_id,No,integer,NA,The standard CONCEPT_ID that the ROUTE_SOURCE_VALUE maps to in the route domain. This is meant to represent the route of administration of the drug. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Route&standardConcept=Standard&page=1&pageSize=15&query=),No,Yes,CONCEPT,CONCEPT_ID,Route,NA drug_exposure,lot_number,No,varchar(50),An identifier assigned to a particular quantity or lot of drug product from the manufacturer.,NA,No,No,NA,NA,NA,NA diff --git a/inst/csv/OMOP_CDMv6.0_Field_Level.csv b/inst/csv/OMOP_CDMv6.0_Field_Level.csv index fecd8264..a9294e6e 100644 --- a/inst/csv/OMOP_CDMv6.0_Field_Level.csv +++ b/inst/csv/OMOP_CDMv6.0_Field_Level.csv @@ -101,8 +101,7 @@ drug_exposure,refills,No,integer,This is only filled in when the record is comin drug_exposure,quantity,No,float,NA,"To find the dose form of a drug the RELATIONSHIP table can be used where the relationship_id is 'Has dose form'. If liquid, quantity stands for the total amount dispensed or ordered of ingredient in the units given by the drug_strength table. If the unit from the source data does not align with the unit in the DRUG_STRENGTH table the quantity should be converted to the correct unit given in DRUG_STRENGTH. For clinical drugs with fixed dose forms (tablets etc.) the quantity is the number of units/tablets/capsules prescribed or dispensed (can be partial, but then only 1/2 or 1/3, not 0.01). Clinical drugs with divisible dose forms (injections) the quantity is the amount of ingredient the patient got. For example, if the injection is 2mg/mL but the patient got 80mL then quantity is reported as 160. Quantified clinical drugs with divisible dose forms (prefilled syringes), the quantity is the amount of ingredient similar to clinical drugs. Please see [how to calculate drug dose](https://ohdsi.github.io/CommonDataModel/drug_dose.html) for more information. ",No,No,NA,NA,NA,NA -drug_exposure,days_supply,No,integer,NA,The number of days of supply of the medication as recorded in the original prescription or dispensing record. Days supply can differ from actual drug duration (i.e. prescribed days supply vs actual exposure).\,"\The field should be left empty if the source data does not contain a verbatim days_supply, and should not be calculated from other fields.

Negative values are not allowed. If the source has negative days supply the record should be dropped as it is unknown if the patient actually took the drug. Several actions are possible: 1) record is not trustworthy and we remove the record entirely. 2) we trust the record and leave days_supply empty or 3) record needs to be combined with other record (e.g. reversal of prescription). High values (>365 days) should be investigated. If considered an error in the source data (e.g. typo), the value needs to be excluded to prevent creation of unrealistic long eras.",No,No,NA,NA,NA -NA,,,,,,,,,,, +drug_exposure,days_supply,No,integer,The number of days of supply of the medication as recorded in the original prescription or dispensing record. Days supply can differ from actual drug duration (i.e. prescribed days supply vs actual exposure).,"The field should be left empty if the source data does not contain a verbatim days_supply, and should not be calculated from other fields.

Negative values are not allowed. If the source has negative days supply the record should be dropped as it is unknown if the patient actually took the drug. Several actions are possible: 1) record is not trustworthy and we remove the record entirely. 2) we trust the record and leave days_supply empty or 3) record needs to be combined with other record (e.g. reversal of prescription). High values (>365 days) should be investigated. If considered an error in the source data (e.g. typo), the value needs to be excluded to prevent creation of unrealistic long eras.",No,No,NA,NA,NA,NA drug_exposure,sig,No,varchar(MAX),This is the verbatim instruction for the drug as written by the provider.,"Put the written out instructions for the drug as it is verbatim in the source, if available.",No,No,NA,NA,NA,NA drug_exposure,route_concept_id,No,integer,NA,The standard CONCEPT_ID that the ROUTE_SOURCE_VALUE maps to in the route domain. This is meant to represent the route of administration of the drug. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Route&standardConcept=Standard&page=1&pageSize=15&query=),No,Yes,CONCEPT,CONCEPT_ID,Route,NA drug_exposure,lot_number,No,varchar(50),An identifier assigned to a particular quantity or lot of drug product from the manufacturer.,NA,No,No,NA,NA,NA,NA From 1fb2ca9de3bff2ad55ae3111c14dddafcce041b3 Mon Sep 17 00:00:00 2001 From: Florian Katsch Date: Tue, 20 Oct 2026 13:35:54 +0200 Subject: [PATCH 2/4] fix vocabulary PK --- inst/csv/OMOP_CDMv5.4_Field_Level.csv | 2 +- inst/csv/OMOP_CDMv5.5_Field_Level.csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/csv/OMOP_CDMv5.4_Field_Level.csv b/inst/csv/OMOP_CDMv5.4_Field_Level.csv index a6d0d4b2..b7297aa1 100644 --- a/inst/csv/OMOP_CDMv5.4_Field_Level.csv +++ b/inst/csv/OMOP_CDMv5.4_Field_Level.csv @@ -440,7 +440,7 @@ Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",NA,FALSE,FALSE,NA,NA,NA,NA vocabulary,vocabulary_id,TRUE,varchar(20),"A unique identifier for each Vocabulary, such -as ICD9CM, SNOMED, Visit.",NA,FALSE,FALSE,NA,NA,NA,NA +as ICD9CM, SNOMED, Visit.",NA,TRUE,FALSE,NA,NA,NA,NA vocabulary,vocabulary_name,TRUE,varchar(255),"The name describing the vocabulary, for example, International Classification of Diseases, Ninth Revision, Clinical diff --git a/inst/csv/OMOP_CDMv5.5_Field_Level.csv b/inst/csv/OMOP_CDMv5.5_Field_Level.csv index 9e38ce5f..8db8cc98 100644 --- a/inst/csv/OMOP_CDMv5.5_Field_Level.csv +++ b/inst/csv/OMOP_CDMv5.5_Field_Level.csv @@ -446,7 +446,7 @@ concept,invalid_reason,false,varchar(1),"Reason the Concept was invalidated. Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",NA,false,false,NA,NA,NA,NA -vocabulary,vocabulary_id,false,varchar(20),"A unique identifier for each Vocabulary, such +vocabulary,vocabulary_id,true,varchar(20),"A unique identifier for each Vocabulary, such as ICD9CM, SNOMED, Visit.",NA,true,false,NA,NA,NA,NA vocabulary,vocabulary_name,true,varchar(255),"The name describing the vocabulary, for example, International Classification of From 9419cbd2e70599ded4a9f580415a41493042c1c4 Mon Sep 17 00:00:00 2001 From: Florian Katsch Date: Thu, 29 Oct 2026 10:23:02 +0100 Subject: [PATCH 3/4] revert changes to OMOP_CDMv5.4_Field_Level.csv --- inst/csv/OMOP_CDMv5.4_Field_Level.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/csv/OMOP_CDMv5.4_Field_Level.csv b/inst/csv/OMOP_CDMv5.4_Field_Level.csv index b7297aa1..1d20ebe3 100644 --- a/inst/csv/OMOP_CDMv5.4_Field_Level.csv +++ b/inst/csv/OMOP_CDMv5.4_Field_Level.csv @@ -440,7 +440,7 @@ Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",NA,FALSE,FALSE,NA,NA,NA,NA vocabulary,vocabulary_id,TRUE,varchar(20),"A unique identifier for each Vocabulary, such -as ICD9CM, SNOMED, Visit.",NA,TRUE,FALSE,NA,NA,NA,NA +as ICD9CM, SNOMED, Visit.",NA,FALSE,FALSE,NA,NA,NA,NA vocabulary,vocabulary_name,TRUE,varchar(255),"The name describing the vocabulary, for example, International Classification of Diseases, Ninth Revision, Clinical @@ -549,4 +549,4 @@ cohort_definition,cohort_definition_description,FALSE,varchar(MAX),A complete de cohort_definition,definition_type_concept_id,TRUE,integer,Type defining what kind of Cohort Definition the record represents and how the syntax may be executed.,NA,FALSE,TRUE,CONCEPT,CONCEPT_ID,NA,NA cohort_definition,cohort_definition_syntax,FALSE,varchar(MAX),Syntax or code to operationalize the Cohort Definition.,NA,FALSE,FALSE,NA,NA,NA,NA cohort_definition,subject_concept_id,TRUE,integer,"This field contains a Concept that represents the domain of the subjects that are members of the cohort (e.g., Person, Provider, Visit).",NA,FALSE,TRUE,CONCEPT,CONCEPT_ID,NA,NA -cohort_definition,cohort_initiation_date,FALSE,date,A date to indicate when the Cohort was initiated in the COHORT table.,NA,FALSE,FALSE,NA,NA,NA,NA \ No newline at end of file +cohort_definition,cohort_initiation_date,FALSE,date,A date to indicate when the Cohort was initiated in the COHORT table.,NA,FALSE,FALSE,NA,NA,NA,NA From dce8d2e13109513bb29d6538e401c1abd4bcecfb Mon Sep 17 00:00:00 2001 From: Florian Katsch Date: Tue, 17 Nov 2026 09:31:26 +0100 Subject: [PATCH 4/4] revert unintendend newline at end of file --- inst/csv/OMOP_CDMv5.4_Field_Level.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/csv/OMOP_CDMv5.4_Field_Level.csv b/inst/csv/OMOP_CDMv5.4_Field_Level.csv index 1d20ebe3..a6d0d4b2 100644 --- a/inst/csv/OMOP_CDMv5.4_Field_Level.csv +++ b/inst/csv/OMOP_CDMv5.4_Field_Level.csv @@ -549,4 +549,4 @@ cohort_definition,cohort_definition_description,FALSE,varchar(MAX),A complete de cohort_definition,definition_type_concept_id,TRUE,integer,Type defining what kind of Cohort Definition the record represents and how the syntax may be executed.,NA,FALSE,TRUE,CONCEPT,CONCEPT_ID,NA,NA cohort_definition,cohort_definition_syntax,FALSE,varchar(MAX),Syntax or code to operationalize the Cohort Definition.,NA,FALSE,FALSE,NA,NA,NA,NA cohort_definition,subject_concept_id,TRUE,integer,"This field contains a Concept that represents the domain of the subjects that are members of the cohort (e.g., Person, Provider, Visit).",NA,FALSE,TRUE,CONCEPT,CONCEPT_ID,NA,NA -cohort_definition,cohort_initiation_date,FALSE,date,A date to indicate when the Cohort was initiated in the COHORT table.,NA,FALSE,FALSE,NA,NA,NA,NA +cohort_definition,cohort_initiation_date,FALSE,date,A date to indicate when the Cohort was initiated in the COHORT table.,NA,FALSE,FALSE,NA,NA,NA,NA \ No newline at end of file