Populate `patient_table_relationship` from Siemens Zee comment field

Issue #432 resolved
Ed McDonagh created an issue

Proper field is not supplied in the RDSR, but the position is supplied in the comment field.

A quick review suggests that this comment is not currently stored in the database (so cannot be retrospectively populated).

Required for and refs #61

Comments (16)

  1. Ed McDonagh reporter

    Code exists elsewhere in rdsr.py to extract the II Diameter from other comment fields, making use of the XML style of the comment. See for example line 241

  2. Ed McDonagh reporter

    I think from a brief look at the RDSR that the comment field is at the root, ie the GeneralStudyModuleAttr level. We don't have a comment field in that model, but I don't think we need to actually record the comment, we just need to read it, extract the patient orientation information and store that in the appropriate place.

  3. Ed McDonagh reporter

    Something along the lines of:

    if orientation.strip().lower() == 'hfs':
        event.patient_table_relationship_cid = get_or_create_cid('F-10470', 'headfirst')
        event.patient_orientation_cid = get_or_create_cid('F-10450', 'recumbent')
        event.patient_orientation_modifier_cid = get_or_create_cid('F-10340', 'supine')
    

    The codes and meanings can be found in the tables linked from the Irradiation Event X-Ray Data template.

    We'd need to go through and populate those fields for each exposure too, as it's a per-exposure field. And assume that they patient doesn't get moved. I'm not sure if you can change the orientation mid-procedure anyway?

  4. Jonathan Cole

    Great.

    How do I get the value back out?

    irrad.irradeventxraysourcedata_set.get().patient_orientation_cid.codeValue
    

    ?

  5. Ed McDonagh reporter

    I am happy to confirm that the skin maps generated and displayed by branch merge432andskin match the relative positions and angles irradiated on my phantom for both the head first supine and head first prone studies. The foot first supine does not display, though it may be that I didn't leave enough length for the legs at the top of the table, and therefore the assumptions leave all the irradiation in the legs which are not modelled.

    The tool tips also work, displaying dose to 2 significant figures.

    @dplatten and @jacole, if you don't object I propose to merge this branch into develop and delete the other two branches. Any further development for this feature can then be branched from develop.

  6. David Platten

    @edmcdonagh, there's still a issue432orientationzee branch that seems to say it is slightly ahead of develop, but it doesn't show any differences. Is the issue432orientationzee branch the same as develop?

  7. Ed McDonagh reporter

    I think so. It might be to do with the fact develop was merged into issue432orientationzee, so develop doesn't have that commit.

    Everything from this branch was merged into develop back in October, so I think we should delete it now.

  8. David Platten

    @edmcdonagh, the commits in this issue do seem to be present in develop. Looks like we just need to add this issue to the changes files.

  9. Log in to comment