Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging appointment delete in calendar #1116

Merged
merged 2 commits into from
May 23, 2018

Conversation

apooravc
Copy link
Contributor

@apooravc apooravc commented May 12, 2018

Issues which this PR deals with:

  1. When user selects "Deleted" status and saves, status is logged but the appointment isn't deleted off calendar.

  2. When user clicks on delete in add-edit-event panel, appointment is deleted off calendar but it is not logged in patient-tracker and patient-tracker-element tables.

Status "Deleted" is added in database.sql file.

@teryhill This first commit attempts on addressing 2nd point. Currently, the issue with it is that "event_date" is passed as NULL upon clicking delete to manage-tracker-status which makes the control flow to go into block at line 204 instead of block at line 218 in patient_tracker and it results in 2 inserts (one in each table) made when clicking delete with one NULL apptdate value coming up in patient-tracker table instead of one update (into patient-tracker) and one insert (into patient-tracker-element). If I pass the date manually, it works by updating lastseq in patient-tracker table in correct id, eid, pid and creating a new record with corresponding id, status "Deleted" and seq updated.

@apooravc
Copy link
Contributor Author

Features implemented in these 2 commits:

  1. When user clicks on Delete in event panel, lastseq is updated (increased by 1) in patient-tracker table (no new record added) corresponding to the selected appt. and a new record is added corresponding to the selected appt. in patient-tracker-element table with seq increased by 1 and status as "Deleted".

  2. When user selects status as "Deleted" and clicks on Save in event panel, the corresponding appointment is deleted from libreehr-postcalendar-events and removed from calendar. The two table updates, mentioned in 1st, were already happening in this case.

Recurring appointments case:
When user makes a recurring appt., it is not logged in patient-tracker or patient-tracker-element (like a single/non-recurring appt. does with date/time/eid/pid etc.). It is logged in libreehr-postcalendar-events with eid.

In case of deletion, it is logged (as a new record with status "Deleted", seq as "1" in tracker-element and as a new record with lastseq as "1" in tracker table) only when:

  1. User clicks on Delete, and selects applying changes to "all".
  2. User selects "Deleted" status, clicks on Save, and selects applying changes to "all".

@teryhill please have a look.

@apooravc apooravc changed the title WIP: Logging appointment delete in calendar Logging appointment delete in calendar May 20, 2018
@tmccormi tmccormi self-requested a review May 23, 2018 20:47
@aethelwulffe aethelwulffe self-requested a review May 23, 2018 20:47
Copy link
Contributor

@aethelwulffe aethelwulffe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document the feature change...somewhere...if we have any docs on using the calendar at all :)

@tmccormi tmccormi merged commit fed8f5d into LibreHealthIO:master May 23, 2018
@teryhill
Copy link
Contributor

It causes an error just an FYI

@tmccormi
Copy link

would you be a bit more specific, Art tested it live on line with me before we merged and it worked fine. You do have to run the sql_upgrade....

@teryhill
Copy link
Contributor

teryhill commented May 23, 2018 via email

@tmccormi
Copy link

Error? Screen shot? or are you just saying we should revert?

@teryhill
Copy link
Contributor

No to the revert. I will fix it in a commit I am doing to change the provider tab some. It only happens when you delete a provider event

image

@teryhill
Copy link
Contributor

oops I committed the fix directly to master. Sorry it was just a provider zero fix. @tmccormi

@tmccormi
Copy link

you da man!

@apooravc apooravc deleted the log-appt-delete branch July 13, 2018 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants