Appt Visit Catg is being lost on new encntr

tmccormi wrote on Friday, March 02, 2012:

  - ID: 3496133 Last Update: Tracker Item Submitted ( tmccormi )
Details:
Step to recreate on 4.1.0 (and 4.1.1-dev)
1) Create a new appt, selecting a visit catg that is NOT 'Office Visit", on a day that does not already have an encounter
2) Open the Appt and change the status to '@arrived", a new encounter will be created
3) Open the new encounter and selected edit - Observe the the Visit Catg is now “Office Visit” instead of what was selected in the appt.

yehster wrote on Friday, March 02, 2012:

The code which creates an encounter from the calendar simply ignores the pc_catid.

            addForm($encounter, "New Patient Encounter",
                    sqlInsert("INSERT INTO form_encounter SET " .
                        "date = '$event_date', " .
                        "onset_date = '$event_date', " .
                        "reason = '" . formData("form_comments") . "', " .
                        "facility = '$facility', " .
                        // "facility_id = '$facility_id', " .
                        "facility_id = '" . (int)$_POST['facility'] . "', " .
                        "billing_facility = '" . (int)$_POST['billing_facility'] . "', " .
                        "provider_id = '" . (int)$_POST['form_provider'] . "', " .
                        "pid = '" . $_POST['form_pid'] . "', " .
                        "encounter = '$encounter'"
                    ),
                    "newpatient", $_POST['form_pid'], "1", "NOW()", $username
                );

tmccormi wrote on Saturday, March 03, 2012:

Fixed and push to SF master …

d3d4dbc Catg from Appt passes to New Encounter when autocreate is on
M       interface/main/calendar/add_edit_event.php

Tony

bradymiller wrote on Saturday, March 03, 2012:

Nice,
Will include this in the next patch.
-brady