Modifying Superbill

Hi, so I am working on modifying the superbill to allow for a search by insurance provider. I have been working on this issue and have two questions:
1)Is the information found in newpatientdata function in the patient.inc file placed in the patient_data file? (stupid question, but just want to be sure).
2)How do I modify what information is placed in the patient_data file?

hi @jedirex92, could you upload a pic of the superbill that you’d like to modify? (not sure where in openemr you’re working) thank you

Here is the superbill I am trying to modify. I am trying to create a search option to search for patients by insurance provider’s name. I tried modifying one of the other functions to allow for this, but it did nothing. Below is a screenshot of the superbill I wish to modify and the code I used for the search by insurance provider function
FIG1:Superbill to modify screenshot


FIG2:Copy of getpatientinsurance function I used to attempt to retrieve and display patient’s information
function getPatientInsurance($provider = “%”,$given = “pid, subscriber_lname, subscriber_fname, subscriber_mname, providerID, DATE_FORMAT(subscriber_DOB,’%m/%d/%Y’) as DOB_TS”, $orderby = “subscriber_lname ASC, subscriber_fname ASC”, $limit = “all”, $start = “0”)
{
** $sqlBindArray = array();**
** $where = “provider LIKE ? “;**
** array_push($sqlBindArray, $provider.”%”);**
** if (!empty($GLOBALS[‘pt_restrict_field’]) && $GLOBALS[‘pt_restrict_by_id’]) {**
** if ($_SESSION{“authUser”} != ‘admin’ || $GLOBALS[‘pt_restrict_admin’]) {**
** $where .= “AND ( patient_data.” . add_escape_custom($GLOBALS[‘pt_restrict_field’]) .**
** " = ( SELECT facility_id FROM users WHERE username = ?) OR patient_data." .**
** add_escape_custom($GLOBALS[‘pt_restrict_field’]) . " = ‘’ ) ";**
** array_push($sqlBindArray, $_SESSION{“authUser”});**
** }**
** }**

** $sql=“SELECT $given FROM insurance_data WHERE $where ORDER BY $orderby”;**
** if ($limit != “all”) {**
** $sql .= " limit " . escape_limit($start) . ", " . escape_limit($limit);**
** }**

** $rez = sqlStatement($sql, $sqlBindArray);**

** $returnval=array();**
** for ($iter=0; $row=sqlFetchArray($rez); $iter++) {**
** $returnval[$iter] = $row;**
** }**

** _set_patient_inc_count($limit, count($returnval), $where, $sqlBindArray);**
** return $returnval;**
}

Hi @jedirex92, maybe you have notices turned on for debugging but it can interfere with the application, https://www.open-emr.org/wiki/index.php/FAQ#What_are_the_correct_PHP_settings_.28can_be_found_in_the_php.ini_file.29.3F

So I tested out this script with another version of the application and I still got no results. To be fair I just got a series of columns with this (,) inputted into every available space. This other version has debugging turned off.

hmm, this doesn’t look right. What’s the period on patient_data?