{"action":"created","issue":{"url":"https://api.github.com/repos/aces/Loris/issues/3803","repository_url":"https://api.github.com/repos/aces/Loris","labels_url":"https://api.github.com/repos/aces/Loris/issues/3803/labels{/name}","comments_url":"https://api.github.com/repos/aces/Loris/issues/3803/comments","events_url":"https://api.github.com/repos/aces/Loris/issues/3803/events","html_url":"https://github.com/aces/Loris/pull/3803","id":340328292,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNzY2ODgw","number":3803,"title":"[imaging browser] Insert scan type in mri_violations_log when caveat set to true","user":{"login":"cmadjar","id":1402456,"node_id":"MDQ6VXNlcjE0MDI0NTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1402456?v=4","gravatar_id":"","url":"https://api.github.com/users/cmadjar","html_url":"https://github.com/cmadjar","followers_url":"https://api.github.com/users/cmadjar/followers","following_url":"https://api.github.com/users/cmadjar/following{/other_user}","gists_url":"https://api.github.com/users/cmadjar/gists{/gist_id}","starred_url":"https://api.github.com/users/cmadjar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmadjar/subscriptions","organizations_url":"https://api.github.com/users/cmadjar/orgs","repos_url":"https://api.github.com/users/cmadjar/repos","events_url":"https://api.github.com/users/cmadjar/events{/privacy}","received_events_url":"https://api.github.com/users/cmadjar/received_events","type":"User","site_admin":false},"labels":[{"id":152299721,"node_id":"MDU6TGFiZWwxNTIyOTk3MjE=","url":"https://api.github.com/repos/aces/Loris/labels/Add%20to%20Release%20Notes","name":"Add to Release Notes","color":"66ff66","default":false},{"id":152305414,"node_id":"MDU6TGFiZWwxNTIzMDU0MTQ=","url":"https://api.github.com/repos/aces/Loris/labels/Bug%20Fix","name":"Bug Fix","color":"f7c6c7","default":false},{"id":289061896,"node_id":"MDU6TGFiZWwyODkwNjE4OTY=","url":"https://api.github.com/repos/aces/Loris/labels/Document%20for%20Release","name":"Document for Release","color":"F0FFFF","default":false},{"id":153844577,"node_id":"MDU6TGFiZWwxNTM4NDQ1Nzc=","url":"https://api.github.com/repos/aces/Loris/labels/SQL","name":"SQL","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aces/Loris/milestones/21","html_url":"https://github.com/aces/Loris/milestone/21","labels_url":"https://api.github.com/repos/aces/Loris/milestones/21/labels","id":2855054,"node_id":"MDk6TWlsZXN0b25lMjg1NTA1NA==","number":21,"title":"20.0.0","description":"","creator":{"login":"ridz1208","id":15268287,"node_id":"MDQ6VXNlcjE1MjY4Mjg3","avatar_url":"https://avatars3.githubusercontent.com/u/15268287?v=4","gravatar_id":"","url":"https://api.github.com/users/ridz1208","html_url":"https://github.com/ridz1208","followers_url":"https://api.github.com/users/ridz1208/followers","following_url":"https://api.github.com/users/ridz1208/following{/other_user}","gists_url":"https://api.github.com/users/ridz1208/gists{/gist_id}","starred_url":"https://api.github.com/users/ridz1208/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridz1208/subscriptions","organizations_url":"https://api.github.com/users/ridz1208/orgs","repos_url":"https://api.github.com/users/ridz1208/repos","events_url":"https://api.github.com/users/ridz1208/events{/privacy}","received_events_url":"https://api.github.com/users/ridz1208/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":180,"state":"open","created_at":"2017-10-20T19:10:53Z","updated_at":"2018-07-18T19:45:24Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-07-11T17:02:16Z","updated_at":"2018-07-23T20:52:48Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/aces/Loris/pulls/3803","html_url":"https://github.com/aces/Loris/pull/3803","diff_url":"https://github.com/aces/Loris/pull/3803.diff","patch_url":"https://github.com/aces/Loris/pull/3803.patch"},"body":"## Purpose of the PR:\r\nThis pull request fix a bug found when testing the MRI violations module that actually comes from the imaging browser module.\r\n\r\n## Description of the bug:\r\nWhen the user sets the Caveat to TRUE on the view session page of the imaging browser, the `Scan_type` was not being inserted into the `mri_violations_log` table with the rest of the entry. \r\n\r\n## This PR includes:\r\n- the bug fix to the view session page of the imaging browser module\r\n- a script to back populate `Scan_type` entries in the `mri_violations_log` table when possible (meaning when only one `Scan_type` was found in the `files` table for a given `SeriesUID`\r\n\r\n## How to test this PR:\r\n\r\n### make sure you can replicate the bug on 20.0-release branch\r\n\r\n1.  go to a view session page of the imaging browser; set Caveat to TRUE for some images and save the QC\r\n2. go to the MRI violation module, look for the entries for the proper patient name and the 'type of problem' set to 'Protocol Violation'. Click on the Protocol Violation link to go to the following page and make sure Scan type is empty for Headers corresponding to \"Manual Caveat Set by $user\" as shown in the screenshot below:\r\n\r\n![screen shot 2018-07-11 at 9 46 16 am](https://user-images.githubusercontent.com/1402456/42587461-c88f400e-8508-11e8-832a-871dd7f29b52.png)\r\n\r\n### checkout the branch of this PR\r\n\r\n3. repeat step 1. above\r\n4. repeat step 2. above and make sure that the Scan type has been properly set for the new entries in the violation checks\r\n\r\n### test the script called `Update_scan_type_of_mri_violations_log_when_manual_caveat.php` in `tools/single_use`\r\n\r\n5. before testing, make sure you have the followings in your mri_violations_log table:\r\n- at least one entry with `Header like \"Manual Caveat Set by%\"`, Scan_type=NULL and a valid `SeriesUID` (meaning a `SeriesUID` that can be found in the `files` table and associated to only one `AcquisitionProtocolID`)\r\n- at least one entry with `Header like \"Manual Caveat Set by%\"`, `Scan_type=NULL` and a `SeriesUID` that cannot be found in the `files` table\r\n- at least one entry with `Header like \"Manual Caveat Set by%\"`, `Scan_type=NULL` and a `SeriesUID` that returns more than one `AcquisitionProtocolID` from the `files` table\r\n- at least one entry with `Header like \"Manual Caveat Set by%\"` and `Scan_type` NOT NULL\r\n6. Checks that the script properly updates the Scan type field in `mri_violations_log` and writes out proper message for the different cases mentioned in 5. \r\n\r\nSee also: Redmine ticket: https://redmine.cbrain.mcgill.ca/issues/14890\r\n"},"comment":{"url":"https://api.github.com/repos/aces/Loris/issues/comments/407197289","html_url":"https://github.com/aces/Loris/pull/3803#issuecomment-407197289","issue_url":"https://api.github.com/repos/aces/Loris/issues/3803","id":407197289,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzE5NzI4OQ==","user":{"login":"ridz1208","id":15268287,"node_id":"MDQ6VXNlcjE1MjY4Mjg3","avatar_url":"https://avatars3.githubusercontent.com/u/15268287?v=4","gravatar_id":"","url":"https://api.github.com/users/ridz1208","html_url":"https://github.com/ridz1208","followers_url":"https://api.github.com/users/ridz1208/followers","following_url":"https://api.github.com/users/ridz1208/following{/other_user}","gists_url":"https://api.github.com/users/ridz1208/gists{/gist_id}","starred_url":"https://api.github.com/users/ridz1208/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridz1208/subscriptions","organizations_url":"https://api.github.com/users/ridz1208/orgs","repos_url":"https://api.github.com/users/ridz1208/repos","events_url":"https://api.github.com/users/ridz1208/events{/privacy}","received_events_url":"https://api.github.com/users/ridz1208/received_events","type":"User","site_admin":false},"created_at":"2018-07-23T20:52:48Z","updated_at":"2018-07-23T20:52:48Z","author_association":"CONTRIBUTOR","body":"@MounaSafiHarab @nicolasbrossard I would like your eyes on this one\r\n"}}
{"actor":{"display_login":"ridz1208"}}