Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prediction protocol does not work #366

Open
egillax opened this issue Oct 21, 2024 · 1 comment
Open

Prediction protocol does not work #366

egillax opened this issue Oct 21, 2024 · 1 comment

Comments

@egillax
Copy link

egillax commented Oct 21, 2024

After fixing #365 locally when trying to generate prediction report/protocol (after pressing view Report on a modelDesign) I get the following error:

FreeMarker template error: The following has evaluated to null or missing: ==> primaryCriteria [in template "cohortExpression.ftl" at line 17, column 8]

with the following java stack trace:

freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
	at freemarker.core.UnexpectedTypeException.newDescriptionBuilder(UnexpectedTypeException.java:85)
	at freemarker.core.UnexpectedTypeException.<init>(UnexpectedTypeException.java:48)
	at freemarker.core.NonHashException.<init>(NonHashException.java:49)
	at freemarker.core.Dot._eval(Dot.java:48)
	at freemarker.core.Expression.eval(Expression.java:101)
	at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:99)
	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.process(Environment.java:313)
	at freemarker.template.Template.process(Template.java:383)
	at org.ohdsi.circe.cohortdefinition.printfriendly.MarkdownRender.renderCohort(MarkdownRender.java:43)
	at org.ohdsi.circe.cohortdefinition.printfriendly.MarkdownRender.renderCohort(MarkdownRender.java:52)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at RJavaTools.invokeMethod(RJavaTools.java:399)

the following line from the stacktrace at org.ohdsi.circe.cohortdefinition.printfriendly.MarkdownRender.renderCohort(MarkdownRender.java:43) seems to indicate this is coming from the following line in inst/patient-level-prediction-document/plp-participants.Rmd

markdown <- tryCatch(
  {CirceR::cohortPrintFriendly(target$expression)}, 
  error = function(e) return('')
)

In the intermediate files I also see the from the generated output that it failed in plp-participants.Rmd

@egillax
Copy link
Author

egillax commented Oct 21, 2024

Would it also be possible to add a test for the plp report so this won't regress when this is fixed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant