Skip to content

Commit 029e12c

Browse files
committed
Merge branch 'master' into release-2.8.0
2 parents 9aaa915 + 6b3796f commit 029e12c

8 files changed

+146
-58
lines changed

pom.xml

+4-44
Original file line numberDiff line numberDiff line change
@@ -439,50 +439,10 @@
439439
</build>
440440

441441
<repositories>
442-
<repository>
443-
<id>central</id>
444-
<url>https://repo.maven.apache.org/maven2</url>
445-
</repository>
446442
<repository>
447443
<id>ohdsi</id>
448444
<name>repo.ohdsi.org</name>
449-
<url>http://repo.ohdsi.org:8085/nexus/content/repositories/releases</url>
450-
</repository>
451-
<repository>
452-
<id>ohdsi.thirdparty</id>
453-
<name>repo.ohdsi.org</name>
454-
<url>http://repo.ohdsi.org:8085/nexus/content/repositories/thirdparty</url>
455-
</repository>
456-
<repository>
457-
<id>ohdsi.snapshots</id>
458-
<name>repo.ohdsi.org-snapshots</name>
459-
<url>http://repo.ohdsi.org:8085/nexus/content/repositories/snapshots</url>
460-
<releases>
461-
<enabled>false</enabled>
462-
</releases>
463-
<snapshots>
464-
<enabled>true</enabled>
465-
</snapshots>
466-
</repository>
467-
<repository>
468-
<id>springsource.releases</id>
469-
<name>SpringSource GA Repository</name>
470-
<url>https://repo.springsource.org/release</url>
471-
<releases>
472-
<enabled>true</enabled>
473-
</releases>
474-
<snapshots>
475-
<enabled>false</enabled>
476-
</snapshots>
477-
</repository>
478-
<repository>
479-
<id>redshift</id>
480-
<url>http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release</url>
481-
</repository>
482-
<repository>
483-
<id>miredot</id>
484-
<name>Miredot Releases</name>
485-
<url>http://nexus.qmino.com/content/repositories/miredot</url>
445+
<url>http://repo.ohdsi.org:8085/nexus/content/groups/public</url>
486446
</repository>
487447
</repositories>
488448

@@ -993,9 +953,9 @@
993953
</properties>
994954
<dependencies>
995955
<dependency>
996-
<groupId>com.oracle</groupId>
997-
<artifactId>ojdbc6</artifactId>
998-
<version>12.1.0.1</version>
956+
<groupId>com.oracle.database.jdbc</groupId>
957+
<artifactId>ojdbc8</artifactId>
958+
<version>19.8.0.0</version>
999959
</dependency>
1000960
</dependencies>
1001961
</profile>

src/main/java/org/ohdsi/webapi/cohortsample/CohortSample.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class CohortSample extends CommonEntity<Integer> {
5151
@Column(name = "gender_concept_ids")
5252
private String genderConceptIds;
5353

54-
@Column
54+
@Column(name = "\"size\"")
5555
private int size;
5656

5757
@Transient

src/main/java/org/ohdsi/webapi/util/PreparedSqlRender.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.function.Function;
88
import java.util.regex.Matcher;
99
import java.util.regex.Pattern;
10-
import org.apache.commons.lang.StringUtils;
10+
import org.apache.commons.lang3.StringUtils;
1111
import org.ohdsi.webapi.source.Source;
1212

1313
public class PreparedSqlRender {

src/main/resources/db/migration/oracle/V2.8.0.20200109100200__cohort_sample_tables.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CREATE TABLE ${ohdsiSchema}.cohort_sample(
55
name VARCHAR(255) NOT NULL,
66
cohort_definition_id NUMBER(10) NOT NULL,
77
source_id NUMBER(10) NOT NULL,
8-
size NUMBER(9) NOT NULL,
8+
"size" NUMBER(9) NOT NULL,
99
age_min NUMBER(4),
1010
age_max NUMBER(4),
1111
age_mode VARCHAR(24),

src/main/resources/db/migration/oracle/V2.8.0.20200122173000__insert_cohort_sample_permissions.sql

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
2-
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:get', 'List cohort samples'),
3-
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:*:get', 'Get single cohort samples'),
4-
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:*:delete', 'Delete cohort sample'),
5-
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:delete', 'Delete all cohort samples of a cohort.'),
6-
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:post', 'Create cohort sample')
7-
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:*:refresh:post', 'Refresh cohort sample');
2+
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:get', 'List cohort samples');
3+
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
4+
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:*:get', 'Get single cohort samples');
5+
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
6+
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:*:delete', 'Delete cohort sample');
7+
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
8+
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:delete', 'Delete all cohort samples of a cohort.');
9+
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
10+
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:post', 'Create cohort sample');
11+
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
12+
(${ohdsiSchema}.sec_permission_id_seq.nextval, 'cohortsample:*:*:*:refresh:post', 'Refresh cohort sample');
813

914
INSERT INTO ${ohdsiSchema}.sec_role_permission(id, role_id, permission_id)
10-
SELECT NEXT VALUE FOR ${ohdsiSchema}.sec_role_permission_sequence, sr.id, sp.id
15+
SELECT ${ohdsiSchema}.sec_role_permission_sequence.nextval, sr.id, sp.id
1116
FROM ${ohdsiSchema}.sec_permission SP, ${ohdsiSchema}.sec_role sr
1217
WHERE sp.value IN (
1318
'cohortsample:*:*:get',

src/main/resources/db/migration/oracle/V2.8.0.20200130124345__fe_analysis_aggregate.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ INSERT INTO ${ohdsiSchema}.fe_analysis_aggregate(id, name, domain, agg_function,
9494
INSERT INTO ${ohdsiSchema}.fe_analysis_aggregate(id, name, domain, agg_function, criteria_columns, expression, join_table, join_type, join_condition, is_default, missing_means_zero) VALUES
9595
(${ohdsiSchema}.fe_aggregate_sequence.nextval, 'Gap days (min)', 'DRUG_ERA', 'MIN', 'GAP_DAYS', 'gap_days', null, null, null, 0, 0);
9696
INSERT INTO ${ohdsiSchema}.fe_analysis_aggregate(id, name, domain, agg_function, criteria_columns, expression, join_table, join_type, join_condition, is_default, missing_means_zero) VALUES
97-
(${ohdsiSchema}.fe_aggregate_sequence.nextval, 'Gap days (average)', 'DRUG_ERA', 'AVG', 'GAP_DAYS', 'gap_days', null, null, null, 0, 0;
97+
(${ohdsiSchema}.fe_aggregate_sequence.nextval, 'Gap days (average)', 'DRUG_ERA', 'AVG', 'GAP_DAYS', 'gap_days', null, null, null, 0, 0);
9898
INSERT INTO ${ohdsiSchema}.fe_analysis_aggregate(id, name, domain, agg_function, criteria_columns, expression, join_table, join_type, join_condition, is_default, missing_means_zero) VALUES
9999
(${ohdsiSchema}.fe_aggregate_sequence.nextval, 'Condition occurrence count', 'CONDITION_ERA', null, 'ERA_OCCURRENCES', 'era_occurrences', null, null, null, 0, 0);
100100
INSERT INTO ${ohdsiSchema}.fe_analysis_aggregate(id, name, domain, agg_function, criteria_columns, expression, join_table, join_type, join_condition, is_default, missing_means_zero) VALUES

src/main/resources/db/migration/oracle/V2.8.0.20201022120031__concept_ancestor_and_descendants.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ ALTER TABLE ${ohdsiSchema}.sec_permission ADD for_role_id INTEGER;
22

33
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, for_role_id)
44
SELECT ${ohdsiSchema}.sec_permission_id_seq.nextval,
5-
REPLACE(''vocabulary:%s:concept:*:ancestorAndDescendant:get'', ''%s'', REPLACE(REPLACE(value, ''source:'', ''''), '':access'', '''')),
5+
REPLACE('vocabulary:%s:concept:*:ancestorAndDescendant:get', '%s', REPLACE(REPLACE(value, 'source:', ''), ':access', '')),
66
role_id
77
FROM ${ohdsiSchema}.sec_permission sp
88
JOIN ${ohdsiSchema}.sec_role_permission srp on sp.id = srp.permission_id
9-
WHERE sp.value LIKE ''source:%:access'';
9+
WHERE sp.value LIKE 'source:%:access';
1010

1111
INSERT INTO ${ohdsiSchema}.sec_role_permission (id, role_id, permission_id)
1212
SELECT ${ohdsiSchema}.sec_role_permission_sequence.nextval, sp.for_role_id, sp.id
1313
FROM ${ohdsiSchema}.sec_permission sp
1414
WHERE sp.for_role_id IS NOT NULL;
1515

16-
ALTER TABLE ${ohdsiSchema}.sec_permission DROP COLUMN for_role_id;
16+
ALTER TABLE ${ohdsiSchema}.sec_permission DROP COLUMN for_role_id;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
DROP VIEW ${ohdsiSchema}.cc_generation;
2+
DROP VIEW ${ohdsiSchema}.estimation_analysis_generation;
3+
DROP VIEW ${ohdsiSchema}.pathway_analysis_generation;
4+
DROP VIEW ${ohdsiSchema}.prediction_analysis_generation;
5+
DROP VIEW ${ohdsiSchema}.user_import_job_history;
6+
7+
GO
8+
9+
CREATE VIEW ${ohdsiSchema}.cc_generation as (
10+
SELECT
11+
-- Spring batch based
12+
job.job_execution_id id,
13+
job.create_time start_time,
14+
job.end_time end_time,
15+
job.status status,
16+
job.exit_message exit_message,
17+
TRY_CAST(cc_id_param.string_val AS INTEGER) cc_id,
18+
TRY_CAST(source_param.string_val AS INTEGER) source_id,
19+
-- Generation info based
20+
gen_info.hash_code hash_code,
21+
gen_info.created_by_id created_by_id
22+
FROM ${ohdsiSchema}.batch_job_execution job
23+
JOIN ${ohdsiSchema}.batch_job_execution_params cc_id_param
24+
ON job.job_execution_id = cc_id_param.job_execution_id AND cc_id_param.key_name = 'cohort_characterization_id'
25+
JOIN ${ohdsiSchema}.batch_job_execution_params source_param
26+
ON job.job_execution_id = source_param.job_execution_id AND source_param.key_name = 'source_id'
27+
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info
28+
ON job.job_execution_id = gen_info.job_execution_id
29+
);
30+
GO
31+
32+
CREATE VIEW ${ohdsiSchema}.estimation_analysis_generation as
33+
SELECT
34+
job.job_execution_id id,
35+
job.create_time start_time,
36+
job.end_time end_time,
37+
job.status status,
38+
job.exit_message exit_message,
39+
TRY_CAST(estimation_id_param.string_val AS INTEGER) estimation_id,
40+
TRY_CAST(source_param.string_val AS INTEGER) source_id,
41+
passwd_param.string_val update_password,
42+
-- Generation info based
43+
gen_info.hash_code hash_code,
44+
gen_info.created_by_id created_by_id,
45+
-- Execution info based
46+
exec_info.id analysis_execution_id
47+
FROM ${ohdsiSchema}.batch_job_execution job
48+
JOIN ${ohdsiSchema}.batch_job_execution_params estimation_id_param ON job.job_execution_id = estimation_id_param.job_execution_id AND estimation_id_param.key_name = 'estimation_analysis_id'
49+
JOIN ${ohdsiSchema}.batch_job_execution_params source_param ON job.job_execution_id = source_param.job_execution_id AND source_param.key_name = 'source_id'
50+
JOIN ${ohdsiSchema}.batch_job_execution_params passwd_param ON job.job_execution_id = passwd_param.job_execution_id AND passwd_param.key_name = 'update_password'
51+
LEFT JOIN ${ohdsiSchema}.ee_analysis_status exec_info ON job.job_execution_id = exec_info.job_execution_id
52+
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info ON job.job_execution_id = gen_info.job_execution_id;
53+
GO
54+
55+
CREATE VIEW ${ohdsiSchema}.pathway_analysis_generation as
56+
(SELECT
57+
job.job_execution_id id,
58+
job.create_time start_time,
59+
job.end_time end_time,
60+
job.status status,
61+
job.exit_message exit_message,
62+
TRY_CAST(pa_id_param.string_val AS INTEGER) pathway_analysis_id,
63+
TRY_CAST(source_param.string_val AS INTEGER) source_id,
64+
-- Generation info based
65+
gen_info.hash_code hash_code,
66+
gen_info.created_by_id created_by_id
67+
FROM ${ohdsiSchema}.batch_job_execution job
68+
JOIN ${ohdsiSchema}.batch_job_execution_params pa_id_param
69+
ON job.job_execution_id = pa_id_param.job_execution_id AND pa_id_param.key_name = 'pathway_analysis_id'
70+
JOIN ${ohdsiSchema}.batch_job_execution_params source_param
71+
ON job.job_execution_id = source_param.job_execution_id AND source_param.key_name = 'source_id'
72+
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info
73+
ON job.job_execution_id = gen_info.job_execution_id);
74+
GO
75+
76+
CREATE VIEW ${ohdsiSchema}.prediction_analysis_generation as
77+
SELECT
78+
job.job_execution_id id,
79+
job.create_time start_time,
80+
job.end_time end_time,
81+
job.status status,
82+
job.exit_message exit_message,
83+
TRY_CAST(plp_id_param.string_val AS INTEGER) prediction_id,
84+
TRY_CAST(source_param.string_val AS INTEGER) source_id,
85+
passwd_param.string_val update_password,
86+
-- Generation info based
87+
gen_info.hash_code hash_code,
88+
gen_info.created_by_id created_by_id,
89+
-- Execution info based
90+
exec_info.id analysis_execution_id
91+
FROM ${ohdsiSchema}.batch_job_execution job
92+
JOIN ${ohdsiSchema}.batch_job_execution_params plp_id_param ON job.job_execution_id = plp_id_param.job_execution_id AND plp_id_param.key_name = 'prediction_analysis_id'
93+
JOIN ${ohdsiSchema}.batch_job_execution_params source_param ON job.job_execution_id = source_param.job_execution_id AND source_param.key_name = 'source_id'
94+
JOIN ${ohdsiSchema}.batch_job_execution_params passwd_param ON job.job_execution_id = passwd_param.job_execution_id AND passwd_param.key_name = 'update_password'
95+
LEFT JOIN ${ohdsiSchema}.ee_analysis_status exec_info ON job.job_execution_id = exec_info.job_execution_id
96+
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info ON job.job_execution_id = gen_info.job_execution_id;
97+
GO
98+
99+
100+
CREATE VIEW ${ohdsiSchema}.user_import_job_history
101+
AS
102+
SELECT
103+
job.job_execution_id as id,
104+
job.start_time as start_time,
105+
job.end_time as end_time,
106+
job.status as status,
107+
job.exit_code as exit_code,
108+
job.exit_message as exit_message,
109+
name_param.STRING_VAL as job_name,
110+
TRY_CAST(user_import_param.string_val AS INTEGER) user_import_id,
111+
author_param.STRING_VAL as author
112+
FROM
113+
${ohdsiSchema}.BATCH_JOB_EXECUTION job
114+
JOIN ${ohdsiSchema}.BATCH_JOB_INSTANCE instance ON instance.JOB_INSTANCE_ID = job.JOB_INSTANCE_ID
115+
JOIN ${ohdsiSchema}.batch_job_execution_params name_param
116+
ON job.job_execution_id = name_param.job_execution_id AND name_param.KEY_NAME = 'jobName'
117+
JOIN ${ohdsiSchema}.batch_job_execution_params user_import_param
118+
ON job.job_execution_id = user_import_param.job_execution_id AND user_import_param.key_name = 'user_import_id'
119+
JOIN ${ohdsiSchema}.BATCH_JOB_EXECUTION_PARAMS author_param
120+
ON job.JOB_EXECUTION_ID = author_param.JOB_EXECUTION_ID AND author_param.KEY_NAME = 'jobAuthor'
121+
WHERE
122+
instance.JOB_NAME = 'usersImport';
123+
GO

0 commit comments

Comments
 (0)