Skip to content
Snippets Groups Projects

Feature/import data pdp

Merged Carlos Vega requested to merge feature/import_data_pdp into master
All threads resolved!

Fixes #261 (closed), #203 (closed), #254 (closed)

Also important commit that must be merged (or at least cherry picked) since it fixes and error on the Voucher Tables: 5e979b18

I think it's done unless we need to make more changes to the data itself, like, adding the flags etc. Which we can do on the website instead of using the program, unless we want a more general program for importing information. Right now I would consider the program basically ad-hoc for this specific case. Since some information must be hardcoded like the VouchersTypes or the format of the Voucher References to get the issue date and voucher type.

Added excluded property to studySubject model. Regarding this, I saw a comment which says: "Marking a subject resigned or deceased cannot be undone.". Why not? and, should resigned option have the same behaviour?

Edited by Carlos Vega

Merge request reports

Pipeline #7261 passed

Pipeline passed for 7532d799 on feature/import_data_pdp

Test coverage 92.19% from 1 job
Approval is optional

Merged by Piotr GawronPiotr Gawron 6 years ago (Nov 5, 2018 1:20pm UTC)

Merge details

Pipeline #7269 passed

Pipeline passed for c566f950 on master

Test coverage 92.17% from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Carlos Vega added 1 commit

    added 1 commit

    • 45c9f15c - added signals to Subject and StudySubjet. These signals fire after an instance…

    Compare with previous version

  • I just added a commit for issue #203 (closed) adding signals to Subject and StudySubject models. These signals fire after an instance is saved (post_save but could also be pre_save) and check if the subject is excluded, resigned or dead and then call the methods that finish all the appointments and visits. I think is safer than doing it on the forms or other parts of the code.

    I guess it could be useful to clean up the other places where the methods mark_as_resigned, mark_as_excluded and mark_as_deceased are called since these signals replace that behaviour.

  • Carlos Vega changed the description

    changed the description

  • Carlos Vega assigned to @carlos.vega

    assigned to @carlos.vega

  • Regarding your comment. Signals could have some side effects please check this "bug": #195 (closed). It shouldn't happen in this case though.

  • Carlos Vega added 1 commit

    added 1 commit

    • 122fb33f - added default location to study subjects

    Compare with previous version

  • Added default location. Some fields from studySubject not added during the import:

    datetime_contact_reminder 
    screening_number 
    mpower_id 
    referral_letter 
    health_partner_feedback_agreement 
    screening 
    diagnosis 
    year_of_diagnosis 
    information_sent 
    pd_in_family 
    Edited by Carlos Vega
  • Added excluded property to studySubject model. Regarding this, I saw a comment which says: "Marking a subject resigned or deceased cannot be undone.". Why not? and, should resigned option have the same behaviour?

    In the long run it should be possible to undo it, but the problem that I was facing at the time is that when subject is marked as deceased/resigned visit are closed and appointments are canceled. And the thing is that after returning subject to life we should probably restore appointments visits. However those appointments visit might be in the past or might not be valid anymore ...

  • I see. I vote for removing the visits or mark them as closed so they should add a new visit etc. It's costly for the user but a frequent use case that the subject is excluded/resigned and comes back. Not to say if it's dead... :fearful::ghost:

    Should I change the signal syntax from post_save.connect(set_as_deceased, sender=Subject) to @receiver(post_save, sender=Subject) ? I think it's more intuitive and clean. And is how the visit signal is done.

    Regarding your comment. Signals could have some side effects please check this "bug": #195 (closed). It shouldn't happen in this case though.

    Regarding the visit signal, I think the signal could check if there are any previous visits and resort the visit number replacing the number so that they are sort in chronological order. BTW, what is this visit number used for?

  • Carlos Vega added 7 commits

    added 7 commits

    Compare with previous version

  • Carlos Vega added 2 commits

    added 2 commits

    • 417b78a9 - format
    • 434decb4 - WIP. Trying some clean ops before install with apt-get to avoid unauthenticated errors

    Compare with previous version

  • Carlos Vega added 1 commit

    added 1 commit

    • 1cbd6cb5 - WIP. Trying some clean ops before install with apt-get to avoid unauthenticated errors

    Compare with previous version

  • Carlos Vega added 1 commit

    added 1 commit

    • e1660436 - WIP. Added --allow-unauthenticated apt-get to avoid unauthenticated errors

    Compare with previous version

  • Carlos Vega added 1 commit

    added 1 commit

    Compare with previous version

  • Carlos Vega resolved all discussions

    resolved all discussions

  • Piotr Gawron mentioned in commit c566f950

    mentioned in commit c566f950

  • merged

  • Carlos Vega removed milestone

    removed milestone

  • Please register or sign in to reply
    Loading