From 52636c58b05c96f3ff66572d8509c404a3227c5e Mon Sep 17 00:00:00 2001 From: Charlotte Raillere Date: Tue, 25 Jun 2013 16:17:28 +0200 Subject: [PATCH] Check for platform in category code for gene expression data loading --- Postgres/GPL 1.0/TM_CZ/I2B2_PROCESS_MRNA_DATA.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Postgres/GPL 1.0/TM_CZ/I2B2_PROCESS_MRNA_DATA.sql b/Postgres/GPL 1.0/TM_CZ/I2B2_PROCESS_MRNA_DATA.sql index 51a999c..020e16d 100644 --- a/Postgres/GPL 1.0/TM_CZ/I2B2_PROCESS_MRNA_DATA.sql +++ b/Postgres/GPL 1.0/TM_CZ/I2B2_PROCESS_MRNA_DATA.sql @@ -233,6 +233,20 @@ BEGIN select tm_cz.cz_end_audit (jobID, 'FAIL') into rtnCd; return -16; end if; + + -- check if there is the PLATFORM property for all category codes + + select count(*) into pCount + from tm_lz.lt_src_mrna_subj_samp_map + where category_cd not like '%PLATFORM%'; + + if pCount > 0 then + select tm_cz.cz_write_audit(jobId,databaseName,procedureName,'Category code does not contain PLATFORM property',0,pCount,'Done') into rtnCd; + select tm_cz.cz_error_handler (jobID, procedureName, '-1', 'Application raised error') into rtnCd; + select tm_cz.cz_end_audit (jobID, 'FAIL') into rtnCd; + return -16; + end if; + -- Get root_node from topNode