Another option is to add the new reports to the allReports, and within the specific the set of reports that we generate you add an additional CDM version check. For example if specimen report was a cdmv5 only report:
if ("SPECIMEN" %in% reports)
{
if (cdmVersion == 5)
{
generateSpecimenTreemap(conn, connectionDetails$dbms, cdmSchema, outputPath, cdmVersion)
generateSpecimenReports(conn, connectionDetails$dbms, cdmSchema, outputPath, cdmVersion)
}
}
We would still have a challenge of showing the report options in Achilles for the v5 version vs. the v4 version. Or, we always show all reports and if you are on a V4 cdm those pages will return nothing.
-Chris