* @author Brady Miller * @copyright Copyright (c) 2014 Rod Roark * @copyright Copyright (c) 2017-2019 Brady Miller * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ require_once("../globals.php"); require_once("$srcdir/patient.inc"); require_once("$srcdir/options.inc.php"); require_once("portal.inc.php"); use OpenEMR\Core\Header; // Consider this a step towards converting the insurance form to layout-based. // Faking it here makes things easier. // Also note that some fields like SSN and most of the subscriber employer // items have been omitted because they are not relevant for claims. // $insurance_layout = array( array('field_id' => 'type', 'title' => 'Type', 'uor' => '2', 'data_type' => '1', 'list_id' => 'insurance_types', 'edit_options' => '', ), array('field_id' => 'date', 'title' => 'Effective Date', 'uor' => '2', 'data_type' => '4', // Text-date 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'provider', 'title' => 'Provider', 'uor' => '2', 'data_type' => '16', // Insurance Providers 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'plan_name', 'title' => 'Plan Name', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'policy_number', 'title' => 'Policy Number', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'group_number', 'title' => 'Group Number', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_employer', 'title' => 'Group Name', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_lname', 'title' => 'Subscriber Last Name', 'uor' => '2', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_fname', 'title' => 'Subscriber First Name', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_mname', 'title' => 'Subscriber Middle Name', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_DOB', 'title' => 'Subscriber DOB', 'uor' => '2', 'data_type' => '4', // Text-date 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_sex', 'title' => 'Subscriber Sex', 'uor' => '2', 'data_type' => '1', // List 'list_id' => 'sex', 'edit_options' => '', ), array('field_id' => 'subscriber_relationship', 'title' => 'Subscriber Relationship', 'uor' => '2', 'data_type' => '1', // List 'list_id' => 'sub_relation', 'edit_options' => '', ), array('field_id' => 'subscriber_street', 'title' => 'Subscriber Street', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_city', 'title' => 'Subscriber City', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_state', 'title' => 'Subscriber State', 'uor' => '1', 'data_type' => '1', // List 'list_id' => 'state', 'edit_options' => '', ), array('field_id' => 'subscriber_postal_code', 'title' => 'Subscriber Zip', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), array('field_id' => 'subscriber_phone', 'title' => 'Subscriber Phone', 'uor' => '1', 'data_type' => '2', // Text 'list_id' => '', 'edit_options' => '', ), ); $postid = intval($_REQUEST['postid']); if ($_POST['bn_save']) { $newdata = array(); $ptid = intval($_POST['ptid']); foreach ($insurance_layout as $frow) { $data_type = $frow['data_type']; $field_id = $frow['field_id']; $newdata[$field_id] = get_layout_form_value($frow); } newInsuranceData( $ptid, $newdata['type'], $newdata['provider'], $newdata['policy_number'], $newdata['group_number'], $newdata['plan_name'], $newdata['subscriber_lname'], $newdata['subscriber_mname'], $newdata['subscriber_fname'], $newdata['subscriber_relationship'], '', // subscriber_ss $newdata['subscriber_DOB'], $newdata['subscriber_street'], $newdata['subscriber_postal_code'], $newdata['subscriber_city'], $newdata['subscriber_state'], '', // subscriber_country $newdata['subscriber_phone'], $newdata['subscriber_employer'], '', // subscriber_employer_street '', // subscriber_employer_city '', // subscriber_employer_postal_code '', // subscriber_employer_state '', // subscriber_employer_country '', // copay $newdata['subscriber_sex'], $newdata['date'], 'TRUE', // accept_assignment '' // policy_type ); // Finally, delete the request from the portal. $result = cms_portal_call(array('action' => 'delpost', 'postid' => $postid)); if ($result['errmsg']) { die(text($result['errmsg'])); } echo "\n"; exit(); } // Get the portal request data. if (!$postid) { die(xlt('Request ID is missing!')); } $result = cms_portal_call(array('action' => 'getpost', 'postid' => $postid)); if ($result['errmsg']) { die(text($result['errmsg'])); } // Look up the patient in OpenEMR. $ptid = lookup_openemr_patient($result['post']['user']); ?>
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; } ?>
" . text($field_title) . ""; echo generate_display_field($lorow, $currvalue); echo ""; generate_form_field($lorow, $newvalue); echo "

' />   ' onclick="window.history.back()" />