Hi,
I see in my logs when creating an encounter and a form to go with it the following SQL.
“DELETE FROM issue_encounter WHERE pid = ‘1’ AND encounter = ‘9’”
Yet this table is blank and never written to, the query always has 0 rows affected.
Is there something I’m missing related to triggers or auditing or anything?
Is there any reason it can’t be removed? I’m asking to help out, and also because I’m making an API for Android to use these queries for similar functonality from android tablet.
The code in question comes from:
interface/forms/newpatient/save.php
When maintaining patient issues, rather than try to synchronize existing data, old data is simply erased and all the the rows are recreated.
// Update the list of issues associated with this encounter.
sqlStatement("DELETE FROM issue_encounter WHERE " .
"pid = '$pid' AND encounter = '$encounter'");
if (is_array($_POST['issues'])) {
foreach ($_POST['issues'] as $issue) {
$query = "INSERT INTO issue_encounter ( " .
"pid, list_id, encounter " .
") VALUES ( " .
"'$pid', '$issue', '$encounter'" .
")";
sqlStatement($query);
}
}