Most exports don't include study time

Issue #488 resolved
Ed McDonagh created an issue

This can be very useful and should be included.

However, due to the use of write_row, it is difficult to have a date and a time in the same row and have them formatted sensibly.

I propose therefore replacing the date column with a date-time column. I don't know if this is likely to cause problems for existing users?

Comments (43)

  1. Ed McDonagh reporter

    Not as simple as I had thought - if the user has the appropriate rights and the data is stored, date of birth is another field on each sheet. This should not have a time component.

  2. Luuk

    Maybe I misunderstand, but isn't it possible to create multiple cell formats and apply these to the different columns? Actually the same as done with Patient ID and Accession Number?

  3. Ed McDonagh reporter

    At a cell by cell level, you can set the format for each cell. But we are writing the whole row at once by writing a list of values. With the patient ID and accession number, we can make sure the variable types are correct before adding them to the list. But the dates and times are Date, Time and DateTime objects, and we can only set the 'date' format once for the row.

    I think. This is all off the top of my head.

  4. Luuk

    I think you can set the format for a entire column (before adding data). I'll give it a try and let you know.

  5. Ed McDonagh reporter

    Hi @LuukO. I can't remember why this one didn't get reviewed at the time. Can you please change the PR from develop to Issue488MostExportsDontIncludeStudyTime. I've created that branch from a commit close to where you made the original PR, as it won't merge cleanly with the current develop. I can then bring it up to date and test it. Alternatively, you could make it work with current develop and we can PR it to an up to date branch to review. Up to you, but I don't mind sorting it out.

    Thanks

    Ed

  6. Ed McDonagh reporter

    I'm pleased to say @LuukO is right - this does work. I'll expand it to the other exports before merging it in.

  7. Ed McDonagh reporter

    Split sheet name generation off into function. Adapted generate_sheets to work for CT and DX. Made use of the common functions for CT xlsx export. Refs #488

    → <<cset 68745cb0d8a4>>

  8. Ed McDonagh reporter

    Moved creation of temporary xlsx file and writing of final xlsx and csv files to export_common. Need to do creation of csv file function, and then tackle mammo. Refs #488 vaguely!

    → <<cset 853de62f92e9>>

  9. Log in to comment