From 08bee7fe2a4b6f361db7fdf874bfd4ee3661ca3f Mon Sep 17 00:00:00 2001 From: Katy Sadowski Date: Tue, 11 Jun 2024 20:52:30 -0400 Subject: [PATCH] fix descendant concept bug in sqlonly --- R/sqlOnly.R | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/R/sqlOnly.R b/R/sqlOnly.R index fa4cf286..cb794868 100644 --- a/R/sqlOnly.R +++ b/R/sqlOnly.R @@ -231,7 +231,19 @@ cdmFieldName ) } else if (checkLevel == "CONCEPT") { - if (is.na(unitConceptId)) { + if (is.na(unitConceptId) && + grepl(",", conceptId)) { + thresholdFilter <- sprintf( + "conceptChecks$%s[conceptChecks$cdmTableName == '%s' & + conceptChecks$cdmFieldName == '%s' & + conceptChecks$conceptId == '%s']", + thresholdField, + cdmTableName, + cdmFieldName, + conceptId + ) + } else if (is.na(unitConceptId) && + !grepl(",", conceptId)) { thresholdFilter <- sprintf( "conceptChecks$%s[conceptChecks$cdmTableName == '%s' & conceptChecks$cdmFieldName == '%s' &