Menu

#395 Invalid duration can be set in Patient Appointment

Development_Release
closed-fixed
nobody
2
2015-08-01
2015-04-22
Tudor Popa
No

Summary:
When you create a new appointment for a patient, the duration can be set to a negative value (like -30 minutes). After that it shows in calendar screen like a 15 minutes appointment.

Steps to reproduce:
Enter Calendar screen, select the Provider, create an entry on a new calendar cell, complete all the necessary details of the appointment such as category, facility, patient, provider etc. and set duration to -30 minutes (or any other negative value), then click on Save

The new appointment is saved and its representation on the calendar is as a 15 minute appointment.

1 Attachments

Discussion

  • Ray Magauran

    Ray Magauran - 2015-06-01

    Change line 205 in /interface/main/add_edit_event.php from:

    $duration = $_POST['form_duration'];
    to
    $duration = abs($_POST['form_duration']);

    abs() convert a number to its absolute form, ie. how far is it from zero, and is always a positive number.

    So if $_POST['form_duration']="-30" is entered,
    $duration= abs($_POST['form_duration']) = "30",
    and it shows up correctly as a 30 minute appointment in the calendar.

     
  • Brady Miller

    Brady Miller - 2015-06-11

    Hi Ray,

    After get more comfortable with command line git, this will be a nice beginner project to work on doing:

    1. Create a branch for just this issue.
    2. Create commit with only these changes.
    3. Push the branch to github.

    -brady
    OpenEMR

     
  • Brady Miller

    Brady Miller - 2015-08-01

    Hi Dragon,

    Thanks for the contribution! Just committed your commit to the codebase.

    -brady
    OpenEMR

     
  • Brady Miller

    Brady Miller - 2015-08-01
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB