cutright / DVH-Analytics

A DICOM Database Application for Radiation Oncology
Other
82 stars 30 forks source link

Adv Feature: Update DB from CSV #117

Closed cutright closed 3 years ago

cutright commented 3 years ago

New feature in v0.9.0 branch. If you create a CSV file like the following:

table,column,value,condition dvhs,toxicity_grade,0,mrn = 'ANON123' AND institutional_roi = 'Bladder' dvhs,toxicity_grade,2,mrn = 'ANON456' AND institutional_roi = 'Bladder'

Then DVHA can process each row as parameters for DVH_SQL.update

image

https://github.com/cutright/DVH-Analytics/blob/c5eb6b03f46a11f1903096961be7effe5d56b1c7/dvha/db/sql_connector.py#L682-L694

I'll add more in the manual, but this should make sense to SQL users.

Refer to this .sql file for schema info: https://github.com/cutright/DVH-Analytics/blob/v0.9.0/dvha/db/create_tables.sql

Currently this is not threaded and you just get a Please Wait dialog. So... please be patient and wait for it to finish :)

cutright commented 3 years ago

I moved the logic over to dvha.models.database_editor, applied threading, and added a progress bar.

cutright commented 3 years ago

to be released in v0.9.0