gbook / nidb

NeuroInformatics Database
GNU General Public License v3.0
26 stars 8 forks source link

Incorrect datetime value: ' ' for column 'series_datetime' #56

Closed andersonwinkler closed 6 years ago

andersonwinkler commented 6 years ago

When parsing DICOMs it got stuck on a string for series_datetime:

[...]
[07/07/2018 09:31:39][pid 27975] [REDACTED] - MRI Procedure Limited
[07/07/2018 09:31:39][pid 27975] [select (SELECT count(*) FROM `projects` WHERE project_costcenter = 'MRI Procedure Limited') 'projectcount', (SELECT count(*) FROM `subjects` a left join subject_altuid b on a.subject_id = b.subject_id WHERE a.uid in ('[REDACTED]','[REDACTED]') or a.uid = SHA1('[REDACTED]') or b.altuid in ('[REDACTED]','[REDACTED]') or b.altuid = SHA1('[REDACTED]')) 'subjectcount']
[07/07/2018 09:31:39][pid 27975] Checking if the subject exists by UID [[REDACTED]] or AltUID [[REDACTED]]
[07/07/2018 09:31:39][pid 27975] Found [[REDACTED],315] using [SELECT a.subject_id, a.uid FROM `subjects` a left join subject_altuid b on a.subject_id = b.subject_id WHERE a.uid in ('[REDACTED]','[REDACTED]') or a.uid = SHA1('[REDACTED]') or b.altuid in ('[REDACTED]','[REDACTED]') or b.altuid = SHA1('[REDACTED]')]
[07/07/2018 09:31:39][pid 27975] Adding alternate UID [[REDACTED]]
[07/07/2018 09:31:39][pid 27975] Checking to see if this subject [315] is part of a family
[07/07/2018 09:31:39][pid 27975] This subject is part of a family [315]
[07/07/2018 09:31:39][pid 27975] Subject is enrolled in this project [1]: enrollment [315]
[07/07/2018 09:31:39][pid 27975] [select study_id, study_num from studies where enrollment_id = 315 and (study_num = '[REDACTED]' or ((study_datetime between date_sub('[REDACTED] 09:08:32', interval 30 second) and date_add('[REDACTED] 09:08:32', interval 30 second)) and study_modality = 'MR' and study_site = '[REDACTED]'))]
[07/07/2018 09:31:39][pid 27975] Checking if this study exists: enrollmentID [315] study(accession)Number [[REDACTED]] StudyDateTime [[REDACTED] 09:08:32] Modality [MR] StationName [[REDACTED]]
[07/07/2018 09:31:39][pid 27975] [select instance_id from projects where project_id = (select project_id from enrollment where enrollment_id = (select enrollment_id from studies where study_id = 1222))]
[07/07/2018 09:31:39][pid 27975] SQL returned [1] rows
[07/07/2018 09:31:39][pid 27975] Found instance ID [1] comparing to import instance ID [NULL]
[07/07/2018 09:31:39][pid 27975] [update studies set study_modality = 'MR', study_datetime = '[REDACTED] 09:08:32', study_ageatscan = '025', study_height = '0', study_weight = '84.6', study_desc = 'MRI Procedure Limited', study_operator = '', study_performingphysician = '', study_site = '[REDACTED]', study_nidbsite = NULL, study_institution = 'NIH FMRIF - ', study_status = 'complete' where study_id = 1222]
[07/07/2018 09:31:39][pid 27975] StudyID [1222] exists, updating
[07/07/2018 09:31:39][pid 27975] SQL Error: 'insert into mr_series (study_id, series_datetime, series_desc, series_protocol, series_sequencename, series_num, series_tr, series_te, series_flip, phaseencodedir, phaseencodeangle, PhaseEncodingDirectionPositive, series_spacingx, series_spacingy, series_spacingz, series_fieldstrength, img_rows, img_cols, img_slices, series_ti, percent_sampling, percent_phasefov, acq_matrix, slicethickness, slicespacing, bandwidth, image_type, image_comments, bold_reps, numfiles, series_notes, data_type, series_status, series_createdby, series_createdate) values (1222, ' ', 'Screen Save', 'MAP_The Present (Back pr', '', '20002', '0', '0', '0', '', NULL, NULL, '0', '', '0', '0', '512', '512', '3', 0, '0', '0', '', '0', '0', '0', 'DERIVED\SECONDARY\SCREEN SAVE', '', '1', '3', '', 'dicom', 'complete', 'parsedicom', now())' in statement [[File: parsedicom.pl Line: 1069]Incorrect datetime value: ' ' for column 'series_datetime' at row 1]
[07/07/2018 09:31:39][pid 27975] Emaillib is [Email-Send-SMTP-Gmail]
[07/07/2018 09:31:39][pid 27975] Using the Email::Send::SMTP::Gmail module
gbook commented 6 years ago

Fixed. Sorry for the delay!