Hi I’m implementing the PatientLevelPrediction package and some of the sql commands encountered an error while running. I believe the error is due to my misunderstanding of how the result-cohort is supposed to be set up.
For example: I encountered the following error as getDbPlpData() was called and subsequently dbSendUpdate() caused the error. I am not sure where exactly the cohor_definition_id column is supposed to be set up. But overall I want to check that I have my database set up correctly before I attempt to run again. Could someone guide me through the process of setting up the correct cohorts/schemas in the database?
BMS:
postgresql
Error:
execute JDBC update query failed in dbSendUpdate (ERROR: column "cohort_definition_id" does not exist
Position: 216)
SQL:
CREATE TEMP TABLE cohort_person
AS
SELECT
ROW_NUMBER() OVER (ORDER BY subject_id, cohort_start_date) AS row_id,
cohort_definition_id,
subject_id,
cohort_start_date,
cohort_end_date
FROM
(
SELECT DISTINCT cohort_definition_id,
subject_id,
cohort_start_date,
CASE
WHEN ( cohort_end_date + 0) > observation_period_end_date THEN observation_period_end_date
ELSE ( cohort_end_date + 0)
END AS cohort_end_date
FROM public.rehospitalization cohort
INNER JOIN observation_period
ON cohort.subject_id = observation_period.person_id
WHERE cohort_start_date >= observation_period_start_date
AND cohort_start_date <= observation_period_end_date
AND cohort_definition_id IN (1)
AND cohort_start_date >= ( observation_period_start_date + 183)
) unique_periods
R version:
R version 3.2.3 (2015-12-10)
Platform:
x86_64-redhat-linux-gnu
Attached base packages:
- methods
- stats
graphics
- grDevices
- utils
- datasets
- base
Other attached packages:
- SqlRender (1.1.3)
- PatientLevelPrediction (1.1.0)
- Cyclops (1.2.0)
- DatabaseConnector (1.3.0)
- RJDBC (0.2-5)
- rJava (0.9-8)
- DBI (0.3.1)