-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorReport.txt
More file actions
70 lines (57 loc) · 1.92 KB
/
errorReport.txt
File metadata and controls
70 lines (57 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
DBMS:
postgresql
Error:
org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
Position: 681
SQL:
CREATE TEMP TABLE qualified_events
AS
WITH primary_events (event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id) AS (
-- Begin Primary Events
select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id
FROM
(
select E.person_id, E.start_date, E.end_date,
row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC) ordinal,
OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id
FROM
(
) E
JOIN onek.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date
WHERE (OP.OBSERVATION_PERIOD_START_DATE + 0*INTERVAL'1 day') <= E.START_DATE AND (E.START_DATE + 0*INTERVAL'1 day') <= OP.OBSERVATION_PERIOD_END_DATE
) P
WHERE P.ordinal = 1
-- End Primary Events
)
SELECT
event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id
FROM
(
select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id
FROM primary_events pe
) QE
R version:
R version 3.6.1 (2019-07-05)
Platform:
x86_64-w64-mingw32
Attached base packages:
- graphics
- grDevices
- utils
- datasets
- stats
- methods
- base
Other attached packages:
- DatabaseConnector (2.4.1)
- SkeletonDescriptiveStudy (0.1.0)
- magrittr (1.5)
- forcats (0.4.0)
- stringr (1.4.0)
- dplyr (0.8.3)
- purrr (0.3.2)
- readr (1.3.1)
- tidyr (0.8.3)
- tibble (2.1.3)
- ggplot2 (3.2.0)
- tidyverse (1.2.1)