<th align='left'><?php echo xlt('Field'); ?> </th> <th align='left'><?php echo xlt('Current Value'); ?> </th> <th align='left'><?php echo xlt('New Value'); ?> </th> </tr> <?php $insrow = getInsuranceData($pid, $result['fields']['type']); foreach ($insurance_layout as $lorow) { $data_type = $lorow['data_type']; $field_id = $lorow['field_id']; $list_id = $lorow['list_id']; $field_title = $lorow['title']; $currvalue = ''; if (isset($insrow[$field_id])) { $currvalue = $insrow[$field_id]; } $newvalue = ''; if (isset($result['fields'][$field_id])) { $newvalue = trim($result['fields'][$field_id]); } // Translate $newvalue for certain field types including lists. if ($newvalue !== '') {
$patient = getPatientData($p_id); $xml_array['status'] = 0; $xml_array['reason'] = "Success patient processing record"; if ($patient) { $xml_array['Patient']['demographics'] = $patient; $ethencity_query = "SELECT option_id, title FROM list_options WHERE list_id = 'ethnicity' AND `option_id` = ?"; $patientData = $patient["ethnicity"]; $ethencity_result = sqlQuery($ethencity_query, array($patientData)); if ($ethencity_result) { $xml_array['Patient']['demographics']['ethnicityvalue'] = $ethencity_result['title']; } else { $xml_array['Patient']['demographics']['ethnicityvalue'] = ''; } $p_insurance = getInsuranceData($p_id); $s_insurance = getInsuranceData($p_id, 'secondary'); $o_insurance = getInsuranceData($p_id, 'tertiary'); if ($p_insurance || $s_insurance) { $xml_array['Patient']['insurancelist']['status'] = 0; $xml_array['Patient']['insurancelist']['insuranceitem-1'] = $p_insurance; $xml_array['Patient']['insurancelist']['insuranceitem-2'] = $s_insurance; $xml_array['Patient']['insurancelist']['insuranceitem-3'] = $o_insurance; } else { $xml_array['Patient']['insurancelist']['status'] = 1; $xml_array['Patient']['insurancelist']['reason'] = 'No insurance data found'; } $patient_hisory = getHistoryData($p_id); if ($patient_hisory) { $xml_array['Patient']['history']['status'] = 0; $xml_array['Patient']['history'] = $patient_hisory; } else { $xml_array['Patient']['history']['status'] = 1;
} ++$item_count; generate_form_field($frow, $currvalue); } end_group(); ?> <?php if (!$GLOBALS['simplified_demographics']) { $insurancei = getInsuranceProviders(); $pid = 0; $insurance_headings = array(xl("Primary Insurance Provider"), xl("Secondary Insurance Provider"), xl("Tertiary Insurance provider")); $insurance_info = array(); $insurance_info[1] = getInsuranceData($pid, "primary"); $insurance_info[2] = getInsuranceData($pid, "secondary"); $insurance_info[3] = getInsuranceData($pid, "tertiary"); echo "<br /><span class='bold'><input type='checkbox' name='form_cb_ins' value='1' " . "onclick='return divclick(this,\"div_ins\");'"; if ($display_style == 'block') { echo " checked"; } echo " /><b>" . xl('Insurance') . "</b></span>\n"; echo "<div id='div_ins' class='section' style='display:{$display_style};'>\n"; for ($i = 1; $i <= 3; $i++) { $result3 = $insurance_info[$i]; ?> <table border="0"> <tr> <td valign='top' colspan='2'> <span class='required'><?php echo $insurance_headings[$i - 1] . ":"; ?>
public static function batch_despatch($var, $func, $data_credentials) { global $pid; if (UserService::valid($data_credentials)) { require_once "../../library/invoice_summary.inc.php"; require_once "../../library/options.inc.php"; require_once "../../library/acl.inc"; require_once "../../library/patient.inc"; if ($func == 'ar_responsible_party') { $patient_id = $pid; $encounter_id = $var['encounter']; $x['ar_responsible_party'] = ar_responsible_party($patient_id, $encounter_id); return UserService::function_return_to_xml($x); } elseif ($func == 'getInsuranceData') { $type = $var['type']; $given = $var['given']; $x = getInsuranceData($pid, $type, $given); return UserService::function_return_to_xml($x); } elseif ($func == 'generate_select_list') { $tag_name = $var['tag_name']; $list_id = $var['list_id']; $currvalue = $var['currvalue']; $title = $var['title']; $empty_name = $var['empty_name']; $class = $var['class']; $onchange = $var['onchange']; $x['generate_select_list'] = generate_select_list($tag_name, $list_id, $currvalue, $title, $empty_name, $class, $onchange); return UserService::function_return_to_xml($x); } elseif ($func == 'xl_layout_label') { $constant = $var['constant']; $x['xl_layout_label'] = xl_layout_label($constant); return UserService::function_return_to_xml($x); } elseif ($func == 'generate_form_field') { $frow = $var['frow']; $currvalue = $var['currvalue']; ob_start(); generate_form_field($frow, $currvalue); $x['generate_form_field'] = ob_get_contents(); ob_end_clean(); return UserService::function_return_to_xml($x); } elseif ($func == 'getInsuranceProviders') { $i = $var['i']; $provider = $var['provider']; $insurancei = getInsuranceProviders(); $x = $insurancei; return $x; } elseif ($func == 'get_layout_form_value') { $frow = $var['frow']; $_POST = $var['post_array']; $x['get_layout_form_value'] = get_layout_form_value($frow); return UserService::function_return_to_xml($x); } elseif ($func == 'updatePatientData') { $patient_data = $var['patient_data']; $create = $var['create']; updatePatientData($pid, $patient_data, $create); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'updateEmployerData') { $employer_data = $var['employer_data']; $create = $var['create']; updateEmployerData($pid, $employer_data, $create); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'newHistoryData') { newHistoryData($pid); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'newInsuranceData') { $_POST = $var[0]; foreach ($var as $key => $value) { if ($key >= 3) { $var[$key] = formData($value); } if ($key >= 1) { $parameters[$key] = $var[$key]; } } $parameters[12] = fixDate($parameters[12]); $parameters[27] = fixDate($parameters[27]); call_user_func_array('newInsuranceData', $parameters); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'generate_layout_validation') { $form_id = $var['form_id']; ob_start(); generate_layout_validation($form_id); $x = ob_get_clean(); return $x; } } else { throw new SoapFault("Server", "credentials failed"); } }
$o_insurance_company = $_POST['o_provider']; $o_subscriber_employer_status = $_POST['o_subscriber_employer']; $o_group_number = $_POST['o_group_number']; $o_plan_name = $_POST['o_plan_name']; $o_subscriber_relationship = $_POST['o_subscriber_relationship']; $o_insurance_id = $_POST['o_insurance_id']; $image_data = isset($_POST['image_data']) ? $_POST['image_data'] : ''; if ($userId = validateToken($token)) { $user = getUsername($userId); $acl_allow = acl_check('patients', 'demo', $user); if ($acl_allow) { $postData = array('id' => $id, 'title' => $title, 'fname' => $firstname, 'lname' => $lastname, 'mname' => $middlename, 'sex' => $sex, 'status' => $status, 'drivers_license' => $drivers_lincense, 'contact_relationship' => $contact_relationship, 'phone_biz' => $phone_biz, 'phone_cell' => $phone_cell, 'phone_contact' => $phone_contact, 'phone_home' => $phone_home, 'DOB' => $dob, 'language' => $language, 'financial' => $financial, 'street' => $street, 'postal_code' => $postal_code, 'city' => $city, 'state' => $state, 'country_code' => $country_code, 'ss' => $ss, 'occupation' => $occupation, 'email' => $email, 'race' => $race, 'ethnicity' => $ethnicity, 'usertext1' => $usertext1, 'genericname1' => $nickname, 'mothersname' => $mothersname, 'guardiansname' => $guardiansname); updatePatientData($patientId, $postData, $create = false); $primary_insurace_data = getInsuranceData($patientId); $secondary_insurace_data = getInsuranceData($patientId, 'secondary'); $other_insurace_data = getInsuranceData($patientId, 'tertiary'); $p_insurace_data = array('provider' => $p_insurance_company, 'group_number' => $p_group_number, 'plan_name' => $p_plan_name, 'subscriber_employer' => $p_subscriber_employer_status, 'subscriber_relationship' => $p_subscriber_relationship, 'policy_number' => $p_insurance_id); if ($primary_insurace_data) { updateInsuranceData($primary_insurace_data['id'], $p_insurace_data); } else { newInsuranceData($patientId, $type = "primary", $p_insurance_company, $policy_number = $p_insurance_id, $group_number = $p_group_number, $plan_name = $p_plan_name, $subscriber_lname = "", $subscriber_mname = "", $subscriber_fname = "", $subscriber_relationship = $p_subscriber_relationship, $subscriber_ss = "", $subscriber_DOB = "", $subscriber_street = "", $subscriber_postal_code = "", $subscriber_city = "", $subscriber_state = "", $subscriber_country = "", $subscriber_phone = "", $subscriber_employer = $p_subscriber_employer_status, $subscriber_employer_street = "", $subscriber_employer_city = "", $subscriber_employer_postal_code = "", $subscriber_employer_state = "", $subscriber_employer_country = "", $copay = "", $subscriber_sex = "", $effective_date = "0000-00-00", $accept_assignment = "TRUE"); } $s_insurace_data = array('provider' => $s_insurance_company, 'group_number' => $s_group_number, 'plan_name' => $s_plan_name, 'subscriber_employer' => $s_subscriber_employer_status, 'subscriber_relationship' => $s_subscriber_relationship, 'policy_number' => $s_insurance_id); if ($secondary_insurace_data) { updateInsuranceData($secondary_insurace_data['id'], $s_insurace_data); } else { newInsuranceData($patientId, $type = "secondary", $s_insurance_company, $policy_number = $s_insurance_id, $group_number = $s_group_number, $plan_name = $s_plan_name, $subscriber_lname = "", $subscriber_mname = "", $subscriber_fname = "", $subscriber_relationship = $s_subscriber_relationship, $subscriber_ss = "", $subscriber_DOB = "", $subscriber_street = "", $subscriber_postal_code = "", $subscriber_city = "", $subscriber_state = "", $subscriber_country = "", $subscriber_phone = "", $subscriber_employer = $s_subscriber_employer_status, $subscriber_employer_street = "", $subscriber_employer_city = "", $subscriber_employer_postal_code = "", $subscriber_employer_state = "", $subscriber_employer_country = "", $copay = "", $subscriber_sex = "", $effective_date = "0000-00-00", $accept_assignment = "TRUE"); } $o_insurace_data = array('provider' => $o_insurance_company, 'group_number' => $o_group_number, 'plan_name' => $o_plan_name, 'subscriber_employer' => $o_subscriber_employer_status, 'subscriber_relationship' => $o_subscriber_relationship, 'policy_number' => $o_insurance_id); if ($other_insurace_data) { updateInsuranceData($other_insurace_data['id'], $o_insurace_data);
$to_url = "<td> <a href = {$web_root}" . "/controller.php?document&retrieve&patient_id={$pid}&document_id={$doc_id}" . "/tmp{$extension}" . " onclick=top.restoreSession(); class='image_modal'>" . " <img src = {$web_root}" . "/controller.php?document&retrieve&patient_id={$pid}&document_id={$doc_id}" . " width=100 alt='{$doc_catg}:{$image_file}'> </a> </td> <td valign='center'>" . htmlspecialchars($doc_catg) . '<br /> ' . htmlspecialchars($image_file) . "</td>"; } else { $to_url = "<td> <a href='" . $web_root . "/controller.php?document&retrieve" . "&patient_id={$pid}&document_id={$doc_id}'" . " onclick='top.restoreSession()' class='css_button_small'>" . "<span>" . htmlspecialchars(xl("View"), ENT_QUOTES) . "</a> " . htmlspecialchars("{$doc_catg} - {$image_file}", ENT_QUOTES) . "</span> </td>"; } echo "<table><tr>"; echo $to_url; echo "</tr></table>"; } // Determine if the Vitals form is in use for this site. $tmp = sqlQuery("SELECT count(*) AS count FROM registry WHERE " . "directory = 'vitals' AND state = 1"); $vitals_is_registered = $tmp['count']; // Get patient/employer/insurance information. // $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD"); $result2 = getEmployerData($pid); $result3 = getInsuranceData($pid, "primary", "copay, provider, DATE_FORMAT(`date`,'%Y-%m-%d') as effdate"); $insco_name = ""; if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco $insco_name = getInsuranceProvider($result3['provider']); } ?> <html> <head> <?php html_header_show(); ?> <link rel="stylesheet" href="<?php echo $css_header; ?>
<a href="javascript:auto_populate_employer_address();" class=link_submit><?php xl('Copy Values', 'e'); ?> </a> </form> <?php if (isset($_GET[set_pid])) { if (!isset($_POST[insurance])) { $insurance = "primary"; } else { $insurance = $_POST[insurance]; } $result = getPatientData($_GET[set_pid]); // $result2 = getEmployerData($_GET{set_pid}); // not used! $result3 = getInsuranceData($_GET[set_pid], $insurance); ?> <script language=javascript> <!-- function auto_populate_employer_address(){ var df = opener.document.demographics_form; df.i<?php echo $browsenum; ?> subscriber_fname.value='<?php echo $result3[subscriber_fname]; ?> '; df.i<?php echo $browsenum;
$provider_id = $userId; $patientId = 1; $pid = 1; sqlStatement("lock tables patient_data read"); $result = sqlQuery("select max(pid)+1 as pid from patient_data"); sqlStatement("unlock tables"); if ($result['pid'] > 1) { $patientId = $result['pid']; $pid = $result['pid']; } $postData = array('title' => $title, 'fname' => $firstname, 'lname' => $lastname, 'mname' => $middlename, 'sex' => $sex, 'status' => $status, 'drivers_license' => $drivers_lincense, 'contact_relationship' => $contact_relationship, 'phone_biz' => $phone_biz, 'phone_cell' => $phone_cell, 'phone_contact' => $phone_contact, 'phone_home' => $phone_home, 'DOB' => $dob, 'language' => $language, 'financial' => $financial, 'street' => $street, 'postal_code' => $postal_code, 'city' => $city, 'state' => $state, 'country_code' => $country_code, 'ss' => $ss, 'occupation' => $occupation, 'email' => $email, 'race' => $race, 'ethnicity' => $ethnicity, 'pubpid' => $pid, 'usertext1' => $usertext1, 'genericname1' => $nickname, 'mothersname' => $mothersname, 'guardiansname' => $guardiansname, 'providerID' => $provider_id, 'ref_providerID' => 0, 'financial_review' => '0000-00-00 00:00:00', 'hipaa_allowsms' => '', 'hipaa_allowemail' => '', 'deceased_date' => '0000-00-00 00:0'); $p_id = updatePatientData($patientId, $postData, $create = true); if ($p_id) { $primary_insurace_data = getInsuranceData($p_id); $secondary_insurace_data = getInsuranceData($p_id, 'secondary'); $other_insurace_data = getInsuranceData($p_id, 'tertiary'); $p_insurace_data = array('provider' => $p_insurance_company, 'group_number' => $p_group_number, 'plan_name' => $p_plan_name, 'subscriber_employer' => $p_subscriber_employer_status, 'subscriber_relationship' => $p_subscriber_relationship, 'policy_number' => $p_insurance_id); if ($primary_insurace_data) { updateInsuranceData($primary_insurace_data['id'], $p_insurace_data); } else { newInsuranceData($patientId, $type = "primary", $p_insurance_company, $policy_number = $p_insurance_id, $group_number = $p_group_number, $plan_name = $p_plan_name, $subscriber_lname = "", $subscriber_mname = "", $subscriber_fname = "", $subscriber_relationship = $p_subscriber_relationship, $subscriber_ss = "", $subscriber_DOB = "", $subscriber_street = "", $subscriber_postal_code = "", $subscriber_city = "", $subscriber_state = "", $subscriber_country = "", $subscriber_phone = "", $subscriber_employer = $p_subscriber_employer_status, $subscriber_employer_street = "", $subscriber_employer_city = "", $subscriber_employer_postal_code = "", $subscriber_employer_state = "", $subscriber_employer_country = "", $copay = "", $subscriber_sex = "", $effective_date = "0000-00-00", $accept_assignment = "TRUE"); } $s_insurace_data = array('provider' => $s_insurance_company, 'group_number' => $s_group_number, 'plan_name' => $s_plan_name, 'subscriber_employer' => $s_subscriber_employer_status, 'subscriber_relationship' => $s_subscriber_relationship, 'policy_number' => $s_insurance_id); if ($secondary_insurace_data) { updateInsuranceData($secondary_insurace_data['id'], $s_insurace_data); } else { newInsuranceData($p_id, $type = "secondary", $s_insurance_company, $policy_number = $s_insurance_id, $group_number = $s_group_number, $plan_name = $s_plan_name, $subscriber_lname = "", $subscriber_mname = "", $subscriber_fname = "", $subscriber_relationship = $s_subscriber_relationship, $subscriber_ss = "", $subscriber_DOB = "", $subscriber_street = "", $subscriber_postal_code = "", $subscriber_city = "", $subscriber_state = "", $subscriber_country = "", $subscriber_phone = "", $subscriber_employer = $s_subscriber_employer_status, $subscriber_employer_street = "", $subscriber_employer_city = "", $subscriber_employer_postal_code = "", $subscriber_employer_state = "", $subscriber_employer_country = "", $copay = "", $subscriber_sex = "", $effective_date = "0000-00-00", $accept_assignment = "TRUE"); } $o_insurace_data = array('provider' => $o_insurance_company, 'group_number' => $o_group_number, 'plan_name' => $o_plan_name, 'subscriber_employer' => $o_subscriber_employer_status, 'subscriber_relationship' => $o_subscriber_relationship, 'policy_number' => $o_insurance_id); if ($other_insurace_data) { updateInsuranceData($other_insurace_data['id'], $o_insurace_data);