-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release-2.8.0
- Loading branch information
Showing
8 changed files
with
146 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 12 additions & 7 deletions
19
...resources/db/migration/oracle/V2.8.0.20200122173000__insert_cohort_sample_permissions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
...in/resources/db/migration/sqlserver/V2.8.0.202012220000__fix_generation_view_try_cast.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
DROP VIEW ${ohdsiSchema}.cc_generation; | ||
DROP VIEW ${ohdsiSchema}.estimation_analysis_generation; | ||
DROP VIEW ${ohdsiSchema}.pathway_analysis_generation; | ||
DROP VIEW ${ohdsiSchema}.prediction_analysis_generation; | ||
DROP VIEW ${ohdsiSchema}.user_import_job_history; | ||
|
||
GO | ||
|
||
CREATE VIEW ${ohdsiSchema}.cc_generation as ( | ||
SELECT | ||
-- Spring batch based | ||
job.job_execution_id id, | ||
job.create_time start_time, | ||
job.end_time end_time, | ||
job.status status, | ||
job.exit_message exit_message, | ||
TRY_CAST(cc_id_param.string_val AS INTEGER) cc_id, | ||
TRY_CAST(source_param.string_val AS INTEGER) source_id, | ||
-- Generation info based | ||
gen_info.hash_code hash_code, | ||
gen_info.created_by_id created_by_id | ||
FROM ${ohdsiSchema}.batch_job_execution job | ||
JOIN ${ohdsiSchema}.batch_job_execution_params cc_id_param | ||
ON job.job_execution_id = cc_id_param.job_execution_id AND cc_id_param.key_name = 'cohort_characterization_id' | ||
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' | ||
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info | ||
ON job.job_execution_id = gen_info.job_execution_id | ||
); | ||
GO | ||
|
||
CREATE VIEW ${ohdsiSchema}.estimation_analysis_generation as | ||
SELECT | ||
job.job_execution_id id, | ||
job.create_time start_time, | ||
job.end_time end_time, | ||
job.status status, | ||
job.exit_message exit_message, | ||
TRY_CAST(estimation_id_param.string_val AS INTEGER) estimation_id, | ||
TRY_CAST(source_param.string_val AS INTEGER) source_id, | ||
passwd_param.string_val update_password, | ||
-- Generation info based | ||
gen_info.hash_code hash_code, | ||
gen_info.created_by_id created_by_id, | ||
-- Execution info based | ||
exec_info.id analysis_execution_id | ||
FROM ${ohdsiSchema}.batch_job_execution job | ||
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' | ||
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' | ||
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' | ||
LEFT JOIN ${ohdsiSchema}.ee_analysis_status exec_info ON job.job_execution_id = exec_info.job_execution_id | ||
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info ON job.job_execution_id = gen_info.job_execution_id; | ||
GO | ||
|
||
CREATE VIEW ${ohdsiSchema}.pathway_analysis_generation as | ||
(SELECT | ||
job.job_execution_id id, | ||
job.create_time start_time, | ||
job.end_time end_time, | ||
job.status status, | ||
job.exit_message exit_message, | ||
TRY_CAST(pa_id_param.string_val AS INTEGER) pathway_analysis_id, | ||
TRY_CAST(source_param.string_val AS INTEGER) source_id, | ||
-- Generation info based | ||
gen_info.hash_code hash_code, | ||
gen_info.created_by_id created_by_id | ||
FROM ${ohdsiSchema}.batch_job_execution job | ||
JOIN ${ohdsiSchema}.batch_job_execution_params pa_id_param | ||
ON job.job_execution_id = pa_id_param.job_execution_id AND pa_id_param.key_name = 'pathway_analysis_id' | ||
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' | ||
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info | ||
ON job.job_execution_id = gen_info.job_execution_id); | ||
GO | ||
|
||
CREATE VIEW ${ohdsiSchema}.prediction_analysis_generation as | ||
SELECT | ||
job.job_execution_id id, | ||
job.create_time start_time, | ||
job.end_time end_time, | ||
job.status status, | ||
job.exit_message exit_message, | ||
TRY_CAST(plp_id_param.string_val AS INTEGER) prediction_id, | ||
TRY_CAST(source_param.string_val AS INTEGER) source_id, | ||
passwd_param.string_val update_password, | ||
-- Generation info based | ||
gen_info.hash_code hash_code, | ||
gen_info.created_by_id created_by_id, | ||
-- Execution info based | ||
exec_info.id analysis_execution_id | ||
FROM ${ohdsiSchema}.batch_job_execution job | ||
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' | ||
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' | ||
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' | ||
LEFT JOIN ${ohdsiSchema}.ee_analysis_status exec_info ON job.job_execution_id = exec_info.job_execution_id | ||
LEFT JOIN ${ohdsiSchema}.analysis_generation_info gen_info ON job.job_execution_id = gen_info.job_execution_id; | ||
GO | ||
|
||
|
||
CREATE VIEW ${ohdsiSchema}.user_import_job_history | ||
AS | ||
SELECT | ||
job.job_execution_id as id, | ||
job.start_time as start_time, | ||
job.end_time as end_time, | ||
job.status as status, | ||
job.exit_code as exit_code, | ||
job.exit_message as exit_message, | ||
name_param.STRING_VAL as job_name, | ||
TRY_CAST(user_import_param.string_val AS INTEGER) user_import_id, | ||
author_param.STRING_VAL as author | ||
FROM | ||
${ohdsiSchema}.BATCH_JOB_EXECUTION job | ||
JOIN ${ohdsiSchema}.BATCH_JOB_INSTANCE instance ON instance.JOB_INSTANCE_ID = job.JOB_INSTANCE_ID | ||
JOIN ${ohdsiSchema}.batch_job_execution_params name_param | ||
ON job.job_execution_id = name_param.job_execution_id AND name_param.KEY_NAME = 'jobName' | ||
JOIN ${ohdsiSchema}.batch_job_execution_params user_import_param | ||
ON job.job_execution_id = user_import_param.job_execution_id AND user_import_param.key_name = 'user_import_id' | ||
JOIN ${ohdsiSchema}.BATCH_JOB_EXECUTION_PARAMS author_param | ||
ON job.JOB_EXECUTION_ID = author_param.JOB_EXECUTION_ID AND author_param.KEY_NAME = 'jobAuthor' | ||
WHERE | ||
instance.JOB_NAME = 'usersImport'; | ||
GO |