Closed anthonysena closed 1 year ago
I believe this is the problem:
Based on this definition
subsetDef2 <- CohortGenerator::createCohortSubsetDefinition(
name ="Male Only",
definitionId = 2,
subsetOperators = list(
CohortGenerator::createDemographicSubset(id = 4,
name = "Male",
gender = 8507)
)
)
My code defines definitionId == 2
above and when adding the subset to the cohortDefinitionSet, it adds the subset definition to position 2 in the list thus creating an empty 1st element causing the problem.
Using the new subset feature from #73, I'm running into the following problem when retrieving the subset definitions. Here is a reproducible example:
Created on 2023-02-28 with reprex v2.0.2
This is happening in this code block:
https://github.com/OHDSI/CohortGenerator/blob/5437d9877d8864ac6c24138cd5f96af0f14f6195/R/SubsetDefinitions.R#L438-L441
where
subsetDef
is NULL thus theclone
function does not exist.It appears that the list created by: https://github.com/OHDSI/CohortGenerator/blob/develop/R/SubsetDefinitions.R#L321 has a lot of extra entries that are NULL when the expectation is that the list() enumerates the subset definitions in use. Just noting this issue before I dive into the investigation.