FeatureExtraction icon indicating copy to clipboard operation
FeatureExtraction copied to clipboard

Temporal annual distribution functionality

Open alex-odysseus opened this issue 1 year ago • 2 comments

Supporting https://github.com/OHDSI/WebAPI/issues/2331 to enable temporal annual distribution extending the existing temporal functionality

Temporal annual distribution will be effective for Feature Analyses specified in newly added PrespecTemporalAnnualAnalysis.csv

The idea of the functionality is to extract an underlying year for a Covariate of interest so that it can be easily grouped by in Cohort Characterization result visualization in WebAPI / ATLAS

Minor refactoring using Stream and StreamSupport classes

Standard Java formatting applied in a few places (hopefully acceptable)

Referencing SqlRender 1.18.1 in pom.xml

Targeting feature for 3.7.0 (for an unknown reason there is still 3.5.1-SNAPSHOT in 'develop' pom.xml even though 3.6.0 has been officially released

alex-odysseus avatar Aug 28 '24 20:08 alex-odysseus

@anthonysena Anthony, I can't assign reviewers, please do so

alex-odysseus avatar Aug 28 '24 20:08 alex-odysseus

@alex-odysseus thanks for reviewing this with me on Atlas/WebAPI WG call. Here are some specific tasks from our discussion:

  • Remove inst/csv/PrespecTemporalAnnualAnalysis.csv as it is redundant with the analyses already defined in the package.
  • Add an annualPrevalence parameter to the getDbCovariateData function to expose the ability to compute the annual prevalence. Make sure this is passed to the Java layer so it can properly pass this to the SQL layer...
  • Tidy up the Java class based on the feedback above. For the createQuerySql function of that class, expose an annualPrevalence parameter to enable passing in the parameter from R and the SkeletonCohortCharacterization layers respectively.

anthonysena avatar Sep 10 '24 14:09 anthonysena

The main outstanding issue is that R-CMD-Check is not passing, so we can merge this in once the errors are cleared.

chrisknoll avatar Feb 11 '25 17:02 chrisknoll

I'll also note that this will be a Java-only enabled feature until we find a use-case for this in the R side.

anthonysena avatar Feb 11 '25 17:02 anthonysena

Anthony, could you please check why some of the tests are still failing, for example test-GetCohortBasedCovariates? @anthonysena

Or test-FeatureExtractionInternal onLoad is expected to be silent

Is it possible that a version of SqlRender has an impact?

alex-odysseus avatar Feb 24 '25 19:02 alex-odysseus

Anthony, Finally, I found a bug, thanks to tests! @anthonysena

So only one is failing, please help

── Failure ('test-FeatureExtractionInternal.R:6:3'): Test .onLoad() ──────────── FeatureExtraction:::.onLoad(libname = "FeatureExtraction", pkgname = "FeatureExtraction") produced warnings.

alex-odysseus avatar Feb 24 '25 20:02 alex-odysseus

Nicely done @alex-odysseus! So for the last error, this is due to the jarChecksum.txt being out-of-date. Could you update it using the following code: https://github.com/OHDSI/FeatureExtraction/blob/main/extras/PackageMaintenance.R#L87-L88 and then commit the updated inst/csv/jarChecksum.txt?

anthonysena avatar Feb 28 '25 14:02 anthonysena

Anthony and Chris, I am getting a strange error, when I use a simple Java program to generate a checksum


import org.ohdsi.featureExtraction.JarChecksum;

public class JarChecksumGenerator {

	public static void main(String[] args) {
		System.out.println(JarChecksum.computeJarChecksum());

	}

}
java.io.FileNotFoundException: <my-source-folder-here>\FeatureExtraction\target\classes (Access is denied)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:106)
	at org.ohdsi.featureExtraction.JarChecksum.computeJarChecksum(JarChecksum.java:29)
	at JarChecksumGenerator.main(JarChecksumGenerator.java:6)

Could you, please, try to generate it on your end? @anthonysena @chrisknoll

alex-odysseus avatar Mar 04 '25 21:03 alex-odysseus

Hi @anthonysena @chrisknoll , could you please take a look (I`ve generated the checksum for the jar file) and merge if windows/ubuntu images check is sufficient (mac failed due to a memory limit issue) and if you have no other objections. Thank you.

oleg-odysseus avatar Mar 17 '25 17:03 oleg-odysseus

@oleg-odysseus this looks good and the Mac error has been noted in #294 so I think we're set to merge this. Let me just tag @ginberg for awareness and we'll work to get this into a release.

anthonysena avatar Mar 18 '25 14:03 anthonysena