Hi Marcel,
Glad to hear about your Achilles demonstration. For the moment, Heracles will continue to be dependent on being able to access a database. The reason for this is that while Achilles is designed to be run once per dataset, Heracles may be run hundreds of times for different cohorts. Thus storage as offline JSON files is not an optimal solution.
That said, we will continue to work to speed up Heracles’ queries. And if members of the community want to create an offline version, then that would be a great way to learn about OHDSI applications.
I looked over your logfile and would like to get input from @schuemie and @Patrick_Ryan as to whether this is a SQL problem or a Postgres translation problem. It seems to relate to the CASTs in the queries.
All the errors are the same:
operator does not exist: character varying < integer
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Example:
select
--hr1.cohort_definition_id,
hr1.index_year as X_CALENDAR_YEAR,
c1.concept_name as SERIES_NAME,
cast(hr1.age_decile*10 as varchar) || '-' || cast((hr1.age_decile+1)*10-1 as varchar) as TRELLIS_NAME,
hr1.count_value as NUM_PERSONS,
ROUND(CAST(1000*(1.0*hr1.count_value / t1.count_value) AS NUMERIC),5) as Y_PREVALENCE_1000PP
from (select cohort_definition_id,
cast(stratum_1 as integer) as index_year,
cast(stratum_2 as integer) as gender_concept_id,
cast(stratum_3 as integer) as age_decile,
count_value
from public.heracles_results
where analysis_id in (1814)
and cohort_definition_id in (1)
and stratum_2 in (8507,8532)
and stratum_3 >= 0
--and stratum_4 <10
) hr1
inner join
(
select cast(stratum_1 as integer) as index_year,
cast(stratum_2 as integer) as gender_concept_id,
cast(stratum_3 as integer) as age_decile,
count_value
from public.heracles_results
where analysis_id = 116
and cohort_definition_id in (1)
) t1
on hr1.index_year = t1.index_year
and hr1.gender_concept_id = t1.gender_concept_id
and hr1.age_decile = t1.age_decile
inner join
cdm.concept c1
on hr1.gender_concept_id = c1.concept_id
]; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.