3275 lines
167 KiB
PHP
Executable File

<style type="text/css">
.required:after {
content:"*";
color:red;
}
</style>
<style type="text/css">
.app-content .wizard > .steps > ul > li.active .step {
background-color: #666EE8;
border-color: #666EE8;
color: #fff;
}
/*.border-error{border:1px solid red;}*/
</style>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<div class="app-content content">
<section class="content-wrapper">
<div class="row">
<div class="col-12">
<div class="card">
<!-- <div class="card-header">
<div class="row">
<div class="col-md-12">
<header class="panel-heading font-weight-bold">
<?php if($pdata->form_status >=5){ ?>
<h3 class="font-weight-bold"><?php echo lang('Edit Referral'); ?></h3>
<?php }else{ ?>
<h3 class="font-weight-bold"><?php echo lang('Add Referral'); ?></h3>
<?php } ?>
</header>
</div>
</div>
</div> -->
<div class="card-header card-header-title-part card_mrgn">
<div class="row">
<div class="col-md-12">
<header class="panel-heading font-weight-bold">
<?php if($pdata->form_status >=5){ ?>
<h3><?php echo lang('Edit Referral'); ?></h3>
<?php }else{ ?>
<h3><?php echo lang('Add Referral'); ?></h3>
<?php } ?>
</header>
</div>
</div>
</div>
<hr class="mt-0 mb-0" />
<div class="col-md-12 panel-body mt-2">
<?php if ($pdata->progress != null) { ?>
<label>Completion Percentage (<span id="progress_lbl">0</span>%)</label>
<div class="progress">
<div class="progress-bar" id="progress_bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
</div>
<?php } ?>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<?php
$tab1 = '';
$tab2 = '';
$tab3 = '';
$tabPane1 = '';
$tabPane2 = '';
$tabPane3 = '';
if($pdata->form_status >=5){
if(!isset($_SESSION['editRef_stat'])){
$tab1 = 'active';
$tab2 = '';
$tab3 = '';
$tab4 = '';
$tab5 = '';
$tabPane1 = 'active in show';
$tabPane2 = '';
$tabPane3 = '';
$tabPane5 = '';
$tabPane6 = '';
}
if(isset($_SESSION['editRef_stat']) && $_SESSION['editRef_stat']=='step1'){
$tab1 = '';
$tab2 = 'active';
$tab3 = '';
$tab4 = '';
$tab5 = '';
$tabPane1 = '';
$tabPane2 = 'active in show';
$tabPane3 = '';
$tabPane5 = '';
$tabPane6 = '';
}
if(isset($_SESSION['editRef_stat']) && $_SESSION['editRef_stat']=='step2'){
$tab1 = '';
$tab2 = '';
$tab3 = 'active';
$tab4 = '';
$tab5 = '';
$tabPane1 = '';
$tabPane2 = '';
$tabPane3 = 'active in show';
$tabPane4 = '';
$tabPane5 = '';
}
if(isset($_SESSION['editRef_stat']) && $_SESSION['editRef_stat']=='step'){
$tab1 = '';
$tab2 = '';
$tab3 = '';
$tab4 = 'active';
$tab5 = '';
$tabPane1 = '';
$tabPane2 = '';
$tabPane3 = '';
$tabPane4 = 'active in show';
$tabPane5 = '';
}
if(isset($_SESSION['editRef_stat']) && $_SESSION['editRef_stat']=='step4'){
$tab1 = '';
$tab2 = '';
$tab3 = '';
$tab4 = '';
$tab5 = 'active';
$tabPane1 = '';
$tabPane2 = '';
$tabPane3 = '';
$tabPane4 = '';
$tabPane5 = 'active in show';
}
}
else{
if(!isset($pdata->form_status)){
$tab1 = 'active';
$tab2 = 'disabled';
$tab3 = 'disabled';
$tab4 = 'disabled';
$tab5 = 'disabled';
$tabPane1 = 'active in show';
$tabPane2 = '';
$tabPane3 = '';
$tabPane4 = '';
$tabPane5 = '';
}
if(isset($pdata->form_status) && $pdata->form_status=='0'){
$tab1 = 'active';
$tab2 = 'disabled';
$tab3 = 'disabled';
$tab4 = 'disabled';
$tab5 = 'disabled';
$tabPane1 = 'active in show';
$tabPane2 = '';
$tabPane3 = '';
$tabPane4 = '';
$tabPane5 = '';
}
if(isset($pdata->form_status) && $pdata->form_status=='1'){
$tab1 = '';
$tab2 = 'active';
$tab3 = '';
$tab4 = '';
$tab5 = '';
$tabPane1 = '';
$tabPane2 = 'active in show';
$tabPane3 = '';
$tabPane4 = '';
$tabPane5 = '';
}
if(isset($pdata->form_status) && $pdata->form_status=='2'){
$tab1 = '';
$tab2 = '';
$tab3 = 'active';
$tab4 = '';
$tab5 = '';
$tabPane1 = '';
$tabPane2 = '';
$tabPane3 = 'active in show';
$tabPane4 = '';
$tabPane5 = '';
}
if(isset($pdata->form_status) && $pdata->form_status=='3'){
$tab1 = '';
$tab2 = '';
$tab3 = '';
$tab4 = 'active';
$tab5 = '';
$tabPane1 = '';
$tabPane2 = '';
$tabPane3 = '';
$tabPane4 = 'active in show';
$tabPane5 = '';
}
if(isset($pdata->form_status) && $pdata->form_status=='4'){
$tab1 = '';
$tab2 = '';
$tab3 = '';
$tab4 = '';
$tab5 = 'active';
$tabPane1 = '';
$tabPane2 = '';
$tabPane3 = '';
$tabPane4 = '';
$tabPane5 = 'active in show';
}
if(isset($pdata->form_status) && $pdata->form_status>='5'){
$tab1 = 'active';
$tab2 = '';
$tab3 = '';
$tab4 = '';
$tab5 = '';
$tabPane1 = 'active in show';
$tabPane2 = '';
$tabPane3 = '';
$tabPane4 = '';
$tabPane5 = '';
}
}
$tabStat = [];
if(!empty($pdata)){
$tabStat = json_decode($pdata->from_tab_status);
}
?>
<!-- for password change of patient -->
<?php
if($pdata->main_id!="")
{
?>
<div class="row">
<div class="col-lg-12">
<a href="<?php echo base_url(); ?>referral/ChangePassword/<?php echo base64_enc($pdata->main_id);?>" class=" float-right">
<?php echo lang('Change Password of this Patient');?>
</a>
</div>
</div>
<?php
}
?>
<!-- password changing ended here -->
<!-- widzed -->
<ul class="nav nav-tabs nav-linetriangle no-hover-bg" id="myTab" role="tablist" style="border-bottom-color: #1e9ef1;margin-bottom: 20px; border-radius: 0px;">
<li class="nav-item <?php echo $tab1;?>">
<a class="nav-link <?php echo $tab1;?>" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-selected="true">
<?php
if(!in_array('1', $tabStat))
{
?>
<i class="la la-exclamation-circle" style="color: orange;"></i>
<?php
}
else
{
?>
<i class="la la-check" style="color: green;"></i>
<?php
}
?>
General Information
</a>
</li>
<li class="nav-item <?php echo $tab2; ?>">
<a class="nav-link <?php echo $tab2; ?>" id="patient-authorization-tab" data-toggle="tab" href="#patient_authorization" role="tab" aria-selected="false">
<?php
if(!in_array('2', $tabStat))
{
?>
<i class="la la-exclamation-circle" style="color: orange;"></i>
<?php
}
else
{
?>
<i class="la la-check" style="color: green;"></i>
<?php
}
?>
Patient Authorization &amp; Consents
</a>
</li>
<li class="nav-item <?php echo $tab3; ?>">
<a class="nav-link <?php echo $tab3; ?>" id="service-tab" data-toggle="tab" href="#service_need" role="tab" aria-selected="false">
<?php
if(!in_array('3', $tabStat))
{
?>
<i class="la la-exclamation-circle" style="color: orange;"></i>
<?php
}
else
{
?>
<i class="la la-check" style="color: green;"></i>
<?php
}
?>
Service Needed
</a>
</li>
<li class="nav-item <?php echo $tab4; ?>">
<a class="nav-link <?php echo $tab4; ?>" id="payer-tab" data-toggle="tab" href="#payer_need" role="tab" aria-selected="false">
<?php
if(!in_array('4', $tabStat))
{
?>
<i class="la la-exclamation-circle" style="color: orange;"></i>
<?php
}
else
{
?>
<i class="la la-check" style="color: green;"></i>
<?php
}
?>
Payer Information
</a>
</li>
<li class="nav-item <?php echo $tab5; ?>">
<a class="nav-link <?php echo $tab5; ?>" id="mdorder-tab" data-toggle="tab" href="#mdorder" role="tab" aria-selected="true">
<?php
if(!in_array('5', $tabStat))
{
?>
<i class="la la-exclamation-circle" style="color: orange;"></i>
<?php
}
else
{
?>
<i class="la la-check" style="color: green;"></i>
<?php
}
?>
Medical Information
</a>
</li>
</ul>
<!-- End of widzed -->
<!-- basic_info tab -->
<div class="tab-content px-1 pt-1" id="myTabContent">
<div class="tab-pane fade <?php echo $tabPane1;?> " id="home" role="tabpanel" aria-labelledby="home-tab" style="padding: 20px; border: 1px solid #ccc; margin-bottom: 15px; border-radius: 5px;">
<form role="form" action="<?php echo base_url(); ?>referral/editReferal?pid=<?php echo $pid; ?>" method="post" enctype="multipart/form-data" name="newGenInfo" onsubmit="return validateForm1()">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
<input type="hidden" name="pid" value="<?=$pid?>">
<input type="hidden" name="tabPgs" value="10">
<input type="hidden" name="fromType" value="addRef">
<div class="form-group">
<input type="hidden" name="form_status" value="1">
<input type="hidden" name="form_mode" value="<?php if($pdata->form_status>0) echo 'Edit'; else echo 'Add'; ?>">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Referral Type'); ?><span class="danger">*</span></label>
<select class="form-control" name="referal_type" id="inputGroupSelect01" required>
<option value="" selected >Choose</option>
<option <?php echo ($pdata->referral_type == 'New')?'selected':'selected' ; ?> value="New">New</option>
<option <?php echo ($pdata->referral_type == 'Restart')?'selected':'' ; ?> value="Restart">Restart</option>
</select>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3">
<?php echo lang('Referral Source'); ?>
<span class="danger">*</span>
</label>
<select class="form-control required" id="ref_info" name="pt_refrance_type" required="">
<!-- <option value="New Patient" disabled>New Patient</option> -->
<option value="Reffered by Patient">Referred by Patient</option>
<option value="Reffered by Vendor">Referred by Vendor</option>
</select>
</div>
</div>
<div class="col-md-4" id="ref_by_ptn" style="display: none;">
<div class="form-group">
<label for="lastName3">
<?php echo lang('Referral Patient Id'); ?>
<span class="danger">*</span>
</label>
<!-- <input type="text" class="form-control required" id="ref_pt_id" name="pt_refrance_value" value="<?php echo $pdata->reference_id; ?>"> -->
<select class="form-control required" id="ref_pt_id" name="pt_refrance_value" >
<option value="" selected>Choose</option>
<?php foreach ($patientList as $value) { ?>
<option <?php echo ($pdata->reference_id == $value->id)?'selected':'' ; ?> value="<?php echo $value->id; ?>"><?php echo $value->first_name." ".$value->last_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-4" id="ref_by_vendor" style="display: none;">
<div class="form-group">
<label for="lastName3">
<?php echo lang('Vendor'); ?>
<span class="danger">*</span>
</label>
<select class="form-control required" id="ref_vnd_id" name="vend_refrance_value">
<option value="" selected>Choose</option>
<?php foreach ($vendorList as $value) { ?>
<option <?php echo ($pdata->reference_id == $value->id)?'selected':'' ; ?> value="<?php echo $value->id; ?>"><?php echo $value->vedor_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<script type="text/javascript">
$(function(){
$("#ref_info").change(function(){
var selVal = $(this).val();
if(selVal == 'Reffered by Patient')
{
$("#ref_pt_id").attr("required", "true");
$("#ref_vnd_id").removeAttr('required');
$("#ref_vnd_id").val("");
$("#ref_by_ptn").show();
$("#ref_by_vendor").hide();
}
else if(selVal == 'Reffered by Vendor'){
$("#ref_vnd_id").attr("required", "true");
$("#ref_pt_id").removeAttr('required');
$("#ref_by_ptn").hide();
$("#ref_by_vendor").show();
}
else{
$("#ref_vnd_id").removeAttr('required');
$("#ref_pt_id").removeAttr('required');
$("#ref_by_ptn").hide();
$("#ref_by_vendor").hide();
}
})
var refInfo = "<?php echo $pdata->reference_information; ?>";
// $("#id_100 select").val("val2");
$('#ref_info').val(refInfo).trigger('change');
});
</script>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('Referral Receive Date'); ?></label>
<input type="date" class="form-control" name="referal_recive_date" id="referalRecDate" value="<?php if($pdata->referral_date!= ''){ echo $pdata->referral_date; } else { echo date('Y-m-d'); }; ?>" required>
</div>
<div class="col-lg-4">
<label class="required">
<?php echo lang('Distance (in miles)'); ?>
</label>
<select class="form-control required" name="distance" required>
<option value="" selected>Choose</option>
<option value="5" <?php if($pdata->distance=="5"){echo "selected";}?>>within 5 miles</option>
<option value="10" <?php if($pdata->distance=="10"){echo "selected";}?>>within 10 miles</option>
<option value="15" <?php if($pdata->distance=="15"){echo "selected";}?>>within 15 miles</option>
<option value="20" <?php if($pdata->distance=="20"){echo "selected";}?>>within 20 miles</option>
<option value="30" <?php if($pdata->distance=="30"){echo "selected";}?>>within 30 miles</option>
<option value="31" <?php if($pdata->distance=="31"){echo "selected";}?>>more than 30 miles</option>
</select>
</div>
<div class="col-md-4">
<label for="firstName3">
<?php echo lang('Level of Service Needed'); ?>
<span class="danger">*</span>
</label>
<select class="form-control required" name="level_service" id="level_service" required="">
<option value="" selected>Choose</option>
<?php foreach ($lvlService as $value) { ?>
<option <?php echo ($pdata->level_of_service == $value->id)?'selected':'' ; ?> value="<?php echo $value->id; ?>" attr_name="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
<div class="col-lg-4">
<label><?php echo lang('Date of Birth'); ?></label>
<input type="date" class="form-control" name="dob" value="<?php echo $pdata->dob; ?>" id='ptdob'>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
</div>
</div>
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('First name'); ?>
</label>
<input type="text" class="form-control" name="fname" id="fname" value="<?php echo $pdata->first_name; ?>" value="<?php echo $pdata->first_name; ?>" required="">
<div class="txt-red" id="fname_Error" style="color:red;font-size: 12.5px !important;"></div>
</div>
<div class="col-lg-4">
<label class="required"><?php echo lang('Last name'); ?></label>
<input type="text" class="form-control" name="lname" id="lname" value="<?php echo $pdata->last_name; ?>" value="<?php echo $pdata->last_name; ?>" required="">
<div class="txt-red" id="lname_Error" style="color:red;font-size: 12.5px !important;"></div>
</div>
<!-- commented on 29-09-2021 -->
<!-- <div class="col-lg-4">
<label ><?php echo lang('email'); ?></label>
<label class="pull-right"><?php echo lang('Do not have'); ?>&nbsp;&nbsp;<input type="checkbox" name="donothave" id="donothave"></label>
<input type="email" class="form-control" name="email" id="refEmailId" value="<?php echo $pdata->patient_email;?>" placeholder="">
</div> -->
<!-- commenting ending here -->
<!-- new added on 29-09-2021 -->
<div class="form-group col-md-4">
<label class="required-field required">
<?php echo lang('email');?>
</label>
<?php
if($pdata->form_status<1)
{
?>
<label class="pull-right"><?php echo lang('Do not have'); ?>&nbsp;&nbsp;
<input type="checkbox" name="donothave" id="donothave">
</label>
<?php
}
?>
<div class="input-group">
<input type="email" class="form-control" name="email" id="refEmailId" value="<?php if(!empty($setval)){echo set_value('email');}if(!empty($pdata->patient_email)){echo $pdata->patient_email;} ?>" placeholder="" required data-error="Please enter a valid email."
<?php if($pdata->form_status >=1){echo "readonly";}?>>
<div class="input-group-append" id="emailcheckTab" style="display:none;">
<span class="input-group-text" >
<span id="emailChecking" style="display:none">
<i class="la la-hourglass-start" style="color:blue;"></i>
</span>
<span id="emailAvailable" style="display:none">
<i class="la la-check" style="color:green;">Available</i>
</span>
<span id="emailNA" style="display:none">
<i class="la la-close" style="color:red;">Not-Available</i>
</span>
</span>
</div>
</div>
<div class="help-block with-errors"></div>
</div>
<!-- new added ending here -->
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Telephone'); ?></label>
<span class="danger">*</span>
<input type="text" class="form-control onlyNumber" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" name="telephone" id="telephone" value='<?php echo $pdata->telephone; ?>' placeholder="" required>
</div>
<!-- <div class="form-group col-md-4">
<label class="required-field required">
<?php echo lang('Telephone'); ?>
</label>
<div class="input-group">
<input type="text" class="form-control onlyNumber" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" name="telephone" id="telId" value="<?php if(!empty($setval)){echo set_value('telephone');}if(!empty($pdata->telephone)){echo $pdata->telephone;} ?>" placeholder="" required>
<div class="input-group-append" id="telcheckTab" style="display:none;">
<span class="input-group-text" >
<span id="telChecking" style="display:none">
<i class="la la-hourglass-start" style="color:blue;"></i>
</span>
<span id="telAvailable" style="display:none">
<i class="la la-check" style="color:green;">Available</i>
</span>
<span id="telNA" style="display:none">
<i class="la la-close" style="color:red;">Exist-Already</i>
</span>
</span>
</div>
</div>
<div class="help-block with-errors"></div>
</div> -->
<div class="col-lg-4">
<label><?php echo lang('Telephone 2'); ?></label>
<input type="text" class="form-control onlyNumber" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" name="cellphone" id="cellphone" value='<?php echo $pdata->cellphone; ?>' placeholder="" >
</div>
<div class="col-lg-4">
<label><?php echo lang('Referral Mode of Contact'); ?></label>
<select class="form-control" name="referal_contact" id="inputGroupSelect01">
<option value="" selected>Choose</option>
<option <?php echo ($pdata->referral_contact == 'Address')?'selected':'' ; ?> value="Address">Address</option>
<option <?php echo ($pdata->referral_contact == 'Email')?'selected':'' ; ?> value="Email">Email</option>
<option <?php echo ($pdata->referral_contact == 'Fax')?'selected':'' ; ?> value="Fax">Fax</option>
<option <?php echo ($pdata->referral_contact == 'Phone')?'selected':'' ; ?> value="Phone">Phone</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<!-- <div class="col-lg-6">
<label class="required"><?php echo lang('Cell phone'); ?></label>
<input type="text" class="form-control onlyNumber" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" name="cellphone" value='<?php echo $pdata->cellphone; ?>' placeholder="" required="">
</div> -->
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('Gender'); ?></label>
<div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="gender" id="Male" value="Male" <?php echo ($pdata->gender == 'Male')?'checked':'' ; ?> required>
<label class="form-check-label" for="Male">
Male
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="gender" id="Female" value="Female" <?php echo ($pdata->gender == 'Female')?'checked':'' ; ?> required>
<label class="form-check-label" for="Female">
Female
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="gender" id="Others" value="Others" <?php echo ($pdata->gender == 'Others')?'checked':'' ; ?> required>
<label class="form-check-label" for="Others">
Other
</label>
</div>
</div>
</div>
<?php $dbData = explode(',', $pdata->primary_language); ?>
<div class="col-lg-4 languages_frm form-group">
<label><?php echo lang('Language Preferances'); ?></label>
<span class="danger">*</span>
<select class="form-control multiselect-class" name="pnalguage[]" id="selectlp" multiple required style="width:100%">
<?php foreach ($langs as $value) { ?>
<option <?php echo (in_array($value->id, $dbData))? 'selected' : '' ; ?> value="<?php echo $value->id; ?>" attr_name="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
<div class="col-lg-4">
<label for="exampleInputEmail1"><?php echo lang('Social Security Number'); ?></label>
<div class="input-group">
<!-- <div class="input-group-prepend">
<span class="input-group-text" id="">XXX - XX -</span>
</div>
-->
<input type="hidden" name="socsec" id="socsec" value="<?php echo $pdata->soc_sec_no; ?>">
<input type="text" class="form-control onlyNumber" id="socsec_outer" onblur="socialSecurity(this.value,this)" onkeyup="socialSecurity(this.value,this)" value="<?php echo $pdata->soc_sec_no; ?>" minlength="4" maxlength="9">
</div>
</div>
</div>
</div>
<?php
$HtFI = explode(',', $pdata->height);
$Htf = $HtFI[0];
$Hti = $HtFI[1];
?>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Marital Status'); ?></label>
<select class="form-control" name="merital_stat" id="inputGroupSelect01" name="pnalguage">
<option selected disabled>Choose</option>
<option <?php echo ($pdata->marital_stat == 'Married')?'selected':'' ; ?> value="Married">Married</option>
<option <?php echo ($pdata->marital_stat == 'Unmarried')?'selected':'' ; ?> value="Unmarried">Unmarried</option>
</select>
</div>
<div class="col-lg-4">
<label for="firstName3"><?php echo lang('Height (Feet/Inch)'); ?></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="">Feet</span>
</div>
<select class="form-control" name="height" data-error="Please enter a valid height.">
<option value="" selected disabled>Select</option>
<?php for($i=1;$i<10;$i++){ ?>
<option value="<?php echo $i; ?>" <?php if($Htf==$i) echo 'selected'; ?>><?php echo $i; ?></option>
<?php } ?>
</select>
<div class="input-group-prepend">
<span class="input-group-text" id="">inch</span>
</div>
<select class="form-control" name="heightInch" required data-error="Please enter a valid height.">
<option value="" selected disabled>Select</option>
<?php for($i=0;$i<12;$i++){ ?>
<option value="<?php echo $i; ?>" <?php if($Hti==$i) echo 'selected'; ?>><?php echo $i; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-4">
<label><?php echo lang('Weight (lbs)'); ?>
<small class="txt-red weight-criteria" hidden="">**weight should be between (1 - 300) lbs</small>
</label>
<!-- <input type="text" class="form-control onlyNumber" name="weight" id="exampleInputEmail1" value=<?php echo $pdata->weight; ?>> -->
<input type="number" min="1" max="300" step="1" autocomplete="off" class="form-control onlyNumber border-error" name="weight" id="weight" value=<?php if($pdata->weight){echo $pdata->weight;}else{echo "1";} ?>>
<div class="txt-red" id="weight_Error" style="color:red;font-size: 12.5px !important;"></div>
</div>
</div>
</div>
<?php
$HtFI = explode(',', $pdata->height);
$Htf = $HtFI[0];
$Hti = $HtFI[1];
?>
<div class="form-group">
<div class="row">
</div>
</div>
<div class="row">
<div class="col-md-12">
<label for="firstName3">
<h3><?php echo lang('Address'); ?></h3>
</label>
</div>
<?php
$pAdata = json_decode($pdata->address);
// echo "<pre>"; print_r($pAdata);
?>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('House Number and Street Name'); ?>
</label>
<input type="hidden" id="check_p_address" value="<?php if(isset($pAdata->Zipcode)){ echo 'checked'; } ?>" >
<input type="hidden" name="lang1" id="lang1">
<input type="hidden" name="long1" id="long1">
<input type="text" class="form-control" name="address1" id="address1" value="<?php echo $pAdata->address; ?>" >
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('Apartment # (if applicable)'); ?>
</label>
<input type="text" class="form-control" name="AddrApartment1" id="apt1" value="<?php echo $pAdata->Apartment; ?>">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('City'); ?>
</label>
<input type="text" class="form-control" name="addrCity1" id="city1" value="<?php echo $pAdata->City; ?>" required="" readonly>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('State'); ?>
</label>
<input type="text" class="form-control" name="addrState1" id="state1" value="<?php echo $pAdata->State; ?>" readonly>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('County'); ?>
</label>
<input type="text" class="form-control" name="addrCounty1" id="county1" value="<?php echo $pAdata->County; ?>" readonly>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="firstName3"><?php echo lang('Zip Code'); ?>
</label>
<input type="text" class="form-control" name="addrZipcode1" id="zipcode1" value="<?php echo $pAdata->Zipcode; ?>" minlenght="5" maxlength="5">
</div>
</div>
<div class="col-md-1 mt-2">
<div class="form-group">
<img src="<?php echo base_url(); ?>uploads/ajax-loader.gif" id="check_parmanent_address_loader1" Style="display:none;">
<button type="button" class="btn btn-info pull-right" id="check_parmanent_address_btn1" value="1" onclick="check_parmanent_address(this);"><?php echo lang('Check'); ?></button>
</div>
</div>
</div>
<?php
$pAltAdata = json_decode($pdata->alt_address);
?>
<div class="row">
<div class="col-md-12">
<label for="firstName3">
<h3><?php echo lang('Alternating Billing Address'); ?></h3>
</label>
<label for="same_emergency" class="pull-right"><?php echo lang("Same as Permanent Address"); ?>
&nbsp;&nbsp;
<input type="checkbox" id="same_address">
</label>
</div>
<div class="col-md-4">
<div class="form-group">
<!-- <input type="hidden" name="lang2" id="lang2">
<input type="hidden" name="long2" id="long2"> -->
<label for="firstName3"><?php echo lang('House Number and Street Name'); ?>
</label>
<input type="text" class="form-control" name="alt_address" id="address2" value="<?php echo $pAltAdata->address; ?>">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('Apartment # (if applicable)'); ?>
</label>
<input type="text" class="form-control" name="altApartment" id="apt2" value="<?php echo $pAltAdata->Apartment; ?>">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('City'); ?>
</label>
<input type="text" class="form-control" name="AltCity" id="city2" value="<?php echo $pAltAdata->City; ?>" readonly>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('State'); ?>
</label>
<input type="text" class="form-control" name="altState" id="state2" value="<?php echo $pAltAdata->State; ?>" readonly>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('County'); ?>
</label>
<input type="text" class="form-control" name="altCounty" id="county2" value="<?php echo $pAltAdata->County; ?>" readonly>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="firstName3"><?php echo lang('Zip Code'); ?>
</label>
<input type="text" class="form-control" name="altZipcode" id="zipcode2" value="<?php echo $pAltAdata->Zipcode; ?>" minlenght="5" maxlength="5">
</div>
</div>
<div class="col-md-1 mt-2">
<div class="form-group">
<img src="<?php echo base_url(); ?>uploads/ajax-loader.gif" id="check_parmanent_address_loader2" Style="display:none;">
<button type="button" class="btn btn-info pull-right" id="check_parmanent_address_btn2" value="2" onclick="check_parmanent_address(this);"><?php echo lang('Check'); ?></button>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-12">
<label><?php echo lang('Direction'); ?></label>
<textarea class="form-control" name="direction" id="exampleInputEmail1" ><?php echo $pdata->direction; ?></textarea>
</div>
</div>
</div>
<div class="col-md-12 form-group row mt-1">
<button type="submit" name="submit" id="submitBtn" value="gen_info" class="btn btn-info"><?php echo lang('submit'); ?></button>
</div>
</form>
</div>
<script>
$("#same_address").click(function(){
if($(this).is(":checked")){
var address1=$("#address1").val();
var state1=$("#state1").val();
var apt1=$("#apt1").val();
var county1=$("#county1").val();
var city1=$("#city1").val();
var zipcode1=$("#zipcode1").val();
// var check_p_address=$("#check_p_address").val();
// alert(check_p_address);
if(address1!=""){
$("#address2").val(address1);
$("#state2").val(state1);
$("#apt2").val(apt1);
$("#county2").val(county1);
$("#city2").val(city1);
$("#zipcode2").val(zipcode1);
}else{
Swal.fire({
position: 'center',
icon: 'error',
title: 'Please check parmanent address.',
showConfirmButton: false,
timer: 1500
});
$(this).prop('checked', false);
}
}
else{
$("#address2").val("");
$("#state2").val("");
$("#county2").val("");
$("#city2").val("");
$("#zipcode2").val("");
$("#apt2").val("");
}
});
</script>
<!-- patient agreement -->
<div class="tab-pane fade <?php echo $tabPane2; ?>" id="patient_authorization" role="tabpanel" aria-labelledby="patient-authorization-tab" style="padding: 20px; border: 1px solid #ccc; margin-bottom: 15px; border-radius: 5px;">
<form role="form" action="<?php echo base_url(); ?>referral/editReferal?pid=<?php echo $_GET['pid']; ?>" method="post" enctype="multipart/form-data" name="patientAgreementFrom" onsubmit="return validateForm4()" >
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
<input type="hidden" name="pid" value="<?=$pid?>">
<input type="hidden" name="form_status" value="2">
<input type="hidden" name="tabPgs" value="10">
<input type="hidden" name="fromType" value="addRef">
<input type="hidden" name="form_mode" value="<?php if($pdata->form_status>2) echo 'Edit'; else echo 'Add'; ?>">
<!-- <hr class="my-2"> -->
<h4 class="font-weight-bold">Advance Directive</h4>
<hr class="my-2">
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Advance Directive'); ?></label>
<div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="advanceDirective" id="Advance_yes" value="YES" <?php echo ($idata->AdvDirective == 'YES')?'checked':'' ; ?>>
<label class="form-check-label" for="Advance_yes">
YES
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="advanceDirective" id="Advance_no" value="NO" <?php echo ($idata->AdvDirective == 'NO')?'checked':'' ; ?>>
<label class="form-check-label" for="Advance_no">
NO
</label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('IF YES'); ?></label>
<select class="form-control" name="advanceDirectiveIfyes" id="advanceDirectiveIfyes">
<option value="" selected>Choose</option>
<option <?php if($idata->AdvDirectiveIfYes == "Do not resuscitate") echo 'selected'; ?> value="Do not Resuticate">Do not Resuticate</option>
<option <?php if($idata->AdvDirectiveIfYes == "Living Will") echo 'selected'; ?> value="Living Will">Living Will</option>
<option <?php if($idata->AdvDirectiveIfYes == "Health Care Proxy") echo 'selected'; ?> value="Health Care Proxy">Health Care Proxy</option>
<option <?php if($idata->AdvDirectiveIfYes == "New York Health Care Proxy") echo 'selected'; ?> value="New York Health Care Proxy">New York Health Care Proxy</option>
<option <?php if($idata->AdvDirectiveIfYes == "Other") echo 'selected'; ?> value="Other">Other</option>
<!-- <option <?php if($idata->AdvDirectiveIfYes == "File Upload") echo 'selected'; ?> value="file-upload" disabled>File Upload</option> -->
</select>
</div>
<div class="col-lg-4">
<label><?php echo lang('Date Received'); ?></label>
<input type="date" class="form-control not_future" name="advDateREcived" id="advDateREcived" placeholder="" value="<?php echo $idata->AdvDirectiveDateRecived; ?>" >
</div>
<div class="col-lg-4">
<label><?php echo lang('DNR'); ?></label>
<input type="text" class="form-control" name="advDNR" id="advDNR" value="<?php echo $idata->advDnr; ?>" placeholder="" >
<div class="txt-red" id="advDNR_Error" style="color:red;font-size: 12.5px !important;"></div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4" id="advUploadFIle" style="display: none;">
<label><?php echo lang('Upload file'); ?></label>
<input type="file" class="form-control" name="advUploadFIle" placeholder="">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Date Effective'); ?></label>
<input type="date" class="form-control" name="advDateEffective" id="advDateEffective" value="<?php echo $idata->AdvDirectiveDateRecived; ?>">
</div>
<div class="col-lg-4">
<label><?php echo lang('Physician'); ?></label>
<input type="text" class="form-control" name="advDateREcived" id="advDateREcived" value="<?php echo $idata->AdvDirectiveEffective; ?>">
</div>
</div>
</div>
<!-- advance directive -->
<hr class="my-2">
<h4 class="font-weight-bold">Emergency contact</h4>
<hr class="my-2">
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('First Name'); ?>
<small class="txt-red weight-criteria-fname" hidden="">**Name should not contain</small>
</label>
<input type="text" class="form-control" name="emgNamefname" id="exampleInputEmail1" value="<?php echo $idata->emgContactFirstName; ?>">
</div>
<div class="col-lg-4">
<label><?php echo lang('Last Name'); ?></label>
<input type="text" class="form-control" name="emgNamelname" id="exampleInputEmail1" value="<?php echo $idata->emgContactLastName; ?>">
</div>
<div class="col-lg-4">
<label><?php echo lang('Relationship to the Patient'); ?></label>
<!-- <input type="text" class="form-control" name="emgRelationtoPt" id="exampleInputEmail1" value="<?php echo $idata->emgContactRelation; ?>"> -->
<?php $dbData = explode(',', $dataIns->emgContactRelation); ?>
<select class="form-control" name="emgRelationtoPt" >
<option value="" disabled="">Choose</option>
<?php foreach ($relationList as $value) { ?>
<option <?php echo (in_array($value->id, $dbData))? 'selected' : '' ; ?> value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-12">
<label for="firstName3">
<h3 class="font-weight-bold" ><?php echo lang('Address'); ?></h3>
</label>
</div>
<?php $iAdata = json_decode($idata->emgContactAddress); ?>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('House Number and Street Name'); ?>
<!-- <span class="danger">*</span> -->
</label>
<!-- <input type="hidden" name="lang2" id="lang2">
<input type="hidden" name="long2" id="long2"> -->
<input type="text" class="form-control" name="address3" id="address3" value="<?php echo $iAdata->address; ?>" >
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('Apartment # (if applicable)'); ?>
</label>
<input type="text" class="form-control" name="AddrApartment3" id="AddrApartment3" value="<?php echo $iAdata->Apartment; ?>">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('City'); ?>
<!-- <span class="danger">*</span> -->
</label>
<input type="text" class="form-control" name="addrCity3" id="city3" value="<?php echo $iAdata->City; ?>" readonly>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('State'); ?>
<!-- <span class="danger">*</span> -->
</label>
<input type="text" class="form-control" name="addrState3" id="state3" value="<?php echo $iAdata->State; ?>" readonly>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="firstName3"><?php echo lang('County'); ?>
<!-- <span class="danger">*</span> -->
</label>
<input type="text" class="form-control" name="addrCounty3" id="county3" value="<?php echo $iAdata->County; ?>" readonly>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="firstName3"><?php echo lang('Zip code'); ?>
<!-- <span class="danger">*</span> -->
</label>
<input type="text" class="form-control" name="addrZipcode3" id="zipcode3" value="<?php echo $iAdata->Zipcode; ?>" minlenght="5" maxlength="5">
</div>
</div>
<div class="col-md-1 mt-2">
<div class="form-group">
<img src="<?php echo base_url(); ?>uploads/ajax-loader.gif" id="check_parmanent_address_loader3" Style="display:none;">
<button type="button" class="btn btn-info pull-right" id="check_parmanent_address_btn3" value="3" onclick="check_parmanent_address(this);"><?php echo lang('Check'); ?></button>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Telephone'); ?></label>
<input type="text" class="form-control form-control onlyNumber" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" name="emgTelephone" id="exampleInputEmail1" value="<?php echo $idata->emgContactTelephone; ?>">
</div>
<div class="col-lg-4">
<label><?php echo lang('Other Number'); ?></label>
<input type="text" class="form-control form-control onlyNumber" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" name="emgOtrNumber" id="exampleInputEmail1" value="<?php echo $idata->emgContactOteNo; ?>">
</div>
<div class="col-lg-4">
<label><?php echo lang('Email'); ?></label>
<input type="text" class="form-control" name="emgEmail" id="emgEmailId" value="<?php echo $idata->emgContactEmail; ?>">
<div class="txt-red" id="emgEmailId_Error" style="color:red;font-size: 12.5px !important;"></div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Lives with Patient'); ?></label>
<!-- <input type="text" class="form-control" name="emglivesWithPatient" id="exampleInputEmail1" value="<?php echo $idata->emgContactLiveswithPatient; ?>"> -->
<div class="col-lg-4">
<!-- <label><?php echo lang('Access to home'); ?></label> -->
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="emglivesWithPatient" id="Lives_yes" value="YES" <?php echo ($idata->emgContactLiveswithPatient == 'YES')?'checked':'' ; ?>>
<label class="form-check-label" for="Lives_yes">
YES
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="emglivesWithPatient" id="Lives_no" value="NO" <?php echo ($idata->emgContactLiveswithPatient == 'NO')?'checked':'' ; ?>>
<label class="form-check-label" for="Lives_no">
NO
</label>
</div>
</div>
</div>
<div class="col-lg-4">
<!-- <label><?php echo lang('Access to home'); ?></label> -->
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="emgAccessTohome" id="Have_keys" value="Have keys" <?php echo ($idata->emgContactAccessToHome == 'Have keys')?'checked':'' ; ?> >
<label class="form-check-label" for="Have_keys">
Have keys
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="emgAccessTohome" id="Access_to_home" value="Access to home" <?php echo ($idata->emgContactAccessToHome == 'Access to home')?'checked':'' ; ?> >
<label class="form-check-label" for="Access_to_home">
Access to home
</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
</div>
</div>
<!-- emergency contact -->
<hr class="my-2">
<div class="form-group pull-right">
<label><?php echo lang('Same as general'); ?>
&nbsp;&nbsp;<input type="checkbox" name="" id="designateSame">
</label>
</div>
<h4 class="font-weight-bold">Designate Other</h4>
<hr class="my-2">
<script type="text/javascript">
$("#designateSame").click(function(){
if($('#designateSame').prop('checked')){
document.forms["patientAgreementFrom"]["dg_fname"].value = document.forms["newGenInfo"]["fname"].value;
document.forms["patientAgreementFrom"]["dg_lname"].value = document.forms["newGenInfo"]["lname"].value;
document.forms["patientAgreementFrom"]["dg_telephone"].value = document.forms["newGenInfo"]["telephone"].value;
document.forms["patientAgreementFrom"]["dg_cell"].value = document.forms["newGenInfo"]["cellphone"].value;
}else{
document.forms["patientAgreementFrom"]["dg_fname"].value = "";
document.forms["patientAgreementFrom"]["dg_lname"].value = "";
document.forms["patientAgreementFrom"]["dg_telephone"].value = "";
document.forms["patientAgreementFrom"]["dg_cell"].value = "";
}
});
</script>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('First name'); ?></label>
<input type="text" class="form-control" name="dg_fname" value='<?php echo $pdata->designate_first_name; ?>'>
</div>
<div class="col-lg-4">
<label><?php echo lang('Last name'); ?></label>
<input type="text" class="form-control" name="dg_lname" value='<?php echo $pdata->designate_last_name; ?>' placeholder="">
</div>
<div class="col-lg-4">
<label><?php echo lang('Telephone'); ?></label>
<input type="text" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" class="form-control onlyNumber" name="dg_telephone" value='<?php echo $pdata->designate_telephone; ?>'>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Other Telephone'); ?></label>
<input type="text" onkeyup="USformatPhoneNumber(this.value,this)" minlength="10" maxlength="10" class="form-control onlyNumber" name="dg_cell" value='<?php echo $pdata->designate_cell; ?>'>
</div>
<div class="col-lg-4">
<label><?php echo lang('Email'); ?></label>
<input type="email" class="form-control" name="dg_email" value='<?php echo $pdata->designate_email; ?>'>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
</div>
</div>
<div class="row">
<div class="col-12 mb-2">
<a class="badge badge-primary btn-sm badge_new_btn pull-right" target="_blank" href="<?=base_url()?>referral/patientAgreementForm?pid=<?=$pdata->id?>" style="padding: 5px 5px 7px !important;"> <i class="la la-link"></i><?=lang('Download patient agreement form')?></a>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<hr class="mt-0 mb-0" />
</div>
<div class="card-body">
<!-- <div class="row">
<div class=" col-md-12">
<label class="required" for="patient_agreement_Document_Verified"><?php echo lang('Document Verified'); ?></label>
<input type="checkbox" name="patient_agreement_Document_Verified" class="form-group" id="patient_agreement_Document_Verified" value="Verified" <?php echo ($pdata->patient_auth_stat == '1')?'checked' : ''; ?>>
</div>
</div> -->
<div class="row">
<div class=" col-md-12" id="msgActivation">
</div>
</div>
<?php foreach ($PAGDdocs as $trd){
$documents_type = $trd->documents_type;
$patient_id = $trd->patient_id;
?>
<div class="form-group">
<div class="row">
<div class="col-lg-6">
<a class="img-icon dwnload" data-docType="<?=$documents_type?>" data-userid="<?=$patient_id?>">
<i class="fa fa-download" aria-hidden="true" style="font-size:24px;"></i>
</a><?=$trd->originalfilename?>
<input type="hidden" value="<?=$trd->originalfilename?>" id="imageval">
</div>
<div class="col-lg-4">
<!-- <input type="text" class="form-control" name="otherDoc_remarks" value="<?=$trd->remarks?>"> -->
<p class="form-control"> <?=$trd->remarks?> </p>
</div>
<div class="col-lg-2" style="position: relative;top: 8px;">
<a href="<?=base_url()?>referral/documentDelete?fid=<?=$trd->id?>&redirect=referral/referralFrom/<?php echo $pid; ?>" class="badge badge-pill badge-danger white">Delete</a>
</div>
</div>
</div>
<?php } ?>
<div class="row">
<div class=" col-md-12" id="agreementVerifiedDocument">
</div>
</div>
<div class="row">
<div class=" col-md-12">
<label class="required" for="patient_agreement_Document_Verified"><?php echo lang('Document Verified'); ?></label>
<input type="checkbox" name="patient_agreement_Document_Verified" class="form-group" id="patient_agreement_Document_Verified" value="Verified" <?php echo ($pdata->patient_auth_stat == '1')?'checked' : ''; ?>>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12 form-group">
<button type="submit" name="submit" value="patientAgreement" id="patientAgreementBtn" class="btn btn-info <?php echo ($pdata->patient_auth_stat != '1')?'disabled' : ''; ?>" <?php echo ($pdata->patient_auth_stat != '1')?'disabled' : ''; ?>><?php echo lang('submit'); ?></button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- patient agreement -->
<!-- services tab -->
<div class="tab-pane fade <?php echo $tabPane3; ?>" id="service_need" role="tabpanel" aria-labelledby="service-tab" style="padding: 20px; border: 1px solid #ccc; margin-bottom: 15px; border-radius: 5px;">
<form role="form" action="<?php echo base_url(); ?>referral/editReferal?pid=<?=$pid?>" method="post" name="referalFrom" onsubmit="return validateForm3()" enctype="multipart/form-data">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
<div class="form-group">
<input type="hidden" name="pid" value="<?=$pid?>">
<input type="hidden" name="form_status" value="3">
<input type="hidden" name="tabPgs" value="20">
<input type="hidden" name="fromType" value="addRef">
<input type="hidden" name="form_mode" value="<?php if($pdata->form_status>3) echo 'Edit'; else echo 'Add'; ?>">
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Level of care needed'); ?></label>
<select class="form-control" name="level_care" id="inputGroupSelect01">
<option >Choose</option>
<option <?php echo ($pdata->level_of_care == '1')?'selected':'' ; ?> value="1">1 High</option>
<option <?php echo ($pdata->level_of_care == '2')?'selected':'' ; ?> value="2">2</option>
<option <?php echo ($pdata->level_of_care == '3')?'selected':'' ; ?> value="3">3</option>
<option <?php echo ($pdata->level_of_care == '4')?'selected':'' ; ?> value="4">4</option>
<option <?php echo ($pdata->level_of_care == '5')?'selected':'' ; ?> value="5">5 Low</option>
</select>
</div>
<div class="col-md-4">
<label for="firstName3">
<?php echo lang('Service Activity/Therapy Needed'); ?>
<span class="danger">*</span>
</label>
<!-- <?php var_dump($serviceActivityTherapy); ?> -->
<!-- <select class="form-control required" name="service_activity" id="service_activity" required="">
<option value="" selected>Choose...</option>
<option value="Lab Draw">Lab Draw</option>
<?php
foreach($serviceActivityTherapy as $datas)
{
?>
<?php $saTypeVal=($pdata->service_type_required=='Service')? $pdata->service_ids : $pdata->therapy_ids ;?>
<option <?php echo ($pdata->service_type_required.'~'.$saTypeVal == $datas['value'])?'selected':'' ; ?>
value="<?=$datas['value']?>">
<?=$saTypeVal?>
</option>
<?php
}
?>
</select> -->
<select class="form-control required" name="service_activity" id="service_activity" required="">
<option>Choose Any One</option>
<?php
foreach($type_of_service_need as $s_head){
?>
<optgroup label="<?=$s_head->service_head_name?>" value="<?=$s_head->id?>">
<?php
foreach($s_head->data as $ques){
?>
<option value="<?=$ques->id?>" <?php if($ques->id==$pdata->service_ids){echo "selected";}?>>
<?=$ques->service_name?>
</option>
<?php
}
?>
</optgroup>
<?php
}
?>
</select>
</div>
<?php $dbData = explode(',', $pdata->type_access); // var_dump($dbData); ?>
<div class="col-lg-4">
<div class="form-group">
<label><?php echo lang('Type of access'); ?></label>
<select class="form-control select3" name="type_access[]" id="inputGroupSelect01" multiple>
<option value="" disabled>Choose</option>
<?php foreach ($accessType as $value) { ?>
<option <?php echo (in_array($value->id, $dbData))? 'selected' : '' ; ?> value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
</div>
<?php $dbData = explode(',', $pdata->type_access); // var_dump($dbData); ?>
<div class="form-group">
<div class="row">
<!-- <div class="col-lg-6">
<label><?php echo lang('Corresponding Requirements'); ?></label>
<input type="text" class="form-control" name="correspondingRequirment" value="<?php echo $pdata->correspondingRequirment; ?>">
</div> -->
</div>
</div>
<!-- <hr class="my-1">
<h4 class="font-weight-bold">Medication</h4>
<hr class="my-1"> -->
<!-- <div class="form-group">
<div class="row">
<div class="col-lg-4">
<div class="form-group">
<label><?php echo lang('Name'); ?></label>
<select class="form-control" name="medication_name" id="inputGroupSelect01">
<option value="">Choose...</option>
</select>
</div>
</div>
<div class="col-lg-4">
<label><?php echo lang('Frequency'); ?></label>
<select class="form-control" name="medication_frequency" id="inputGroupSelect01">
<option value="">Choose...</option>
</select>
</div>
<div class="col-lg-4">
<label><?php echo lang('Route'); ?></label>
<select class="form-control" name="medication_route" id="inputGroupSelect01">
<option value="">Choose...</option>
</select>
</div>
</div>
</div> -->
<script type="text/javascript">
$("#service_activity").change(function(){
if ($(this).val() == 'Lab Draw')
{
$("#forLabDraw").show();
}
else
{
$("#forLabDraw").hide();
}
});
</script>
<div id="forLabDraw" style="display: none;">
<hr class="my-1">
<h4 class="font-weight-bold">Lab Company</h4>
<hr class="my-1">
<div class="form-group">
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Lab Company'); ?></label>
<select class="form-control" name="lab_company" id="inputGroupSelect01">
<option value="">Choose</option>
<option value="">LabCorp</option>
<option value="">Quest</option>
<option value="">Other</option>
</select>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Type of Labs Required'); ?></label>
<select class="form-control" name="Type_lab_required" id="inputGroupSelect01">
<option value="">Choose</option>
<option value="">Quest</option>
<option value="">Other</option>
</select>
</div>
</div>
</div>
</div>
<hr class="my-1">
<h4 class="font-weight-bold">Lab Frequency</h4>
<hr class="my-1">
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<div class="form-group">
<label><?php echo lang('Intervals'); ?></label>
<select class="form-control" name="Intervals" id="inputGroupSelect01">
<option value="">Choose</option>
<option value="Intervals are Daily">Intervals are Daily</option>
<option value="Weekly">Weekly</option>
<option value="Once a Week">Once a Week</option>
</select>
</div>
</div>
<div class="col-lg-4">
<label><?php echo lang('Day'); ?></label>
<select class="form-control" name="Day" id="inputGroupSelect01">
<option value="">Choose</option>
</select>
</div>
<div class="col-lg-4">
<label><?php echo lang('Time'); ?></label>
<select class="form-control" name="Time" id="inputGroupSelect01">
<option value="">Choose</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Patient seen by MD'); ?></label>
<input type="date" class="form-control" name="patient_seen_by_MD" value="<?php echo $pdata->patient_seen_by_MD; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Current Lab Work'); ?></label>
<div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" <?php echo ($pdata->new_order == 'YES')?'checked':'' ; ?> name="current_lab_work" id="radio" value="YES">
<label class="form-check-label" for="YES">
YES
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" <?php echo ($pdata->new_order == 'NO')?'checked':'' ; ?> name="current_lab_work" id="radio" value="NO">
<label class="form-check-label" for="NO">
NO
</label>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Lab Order'); ?></label>
<input type="text" class="form-control" name="lab_order" value="<?php echo $pdata->lab_order; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label><?php echo lang('Additional Lab Orders'); ?></label>
<input type="text" class="form-control" name="additional_lab_order" value="<?php echo $pdata->additional_lab_order; ?>" placeholder="">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Lab Frequency'); ?></label>
<select class="form-control" name="lab_frequency" id="inputGroupSelect01">
<option <?php echo ($pdata->lab_frequency == 'Weekly')?'selected':'' ; ?> value="Weekly">Weekly</option>
<option <?php echo ($pdata->lab_frequency == 'Every 2 weeks')?'selected':'' ; ?> value="Every 2 weeks">Every 2 weeks</option>
<option <?php echo ($pdata->lab_frequency == 'Every other week')?'selected':'' ; ?> value="Every other week">Every other week</option>
<option <?php echo ($pdata->lab_frequency == 'Every 6 months')?'selected':'' ; ?> value="Every 6 months">Every 6 months</option>
</select>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Other Lab Frequency'); ?></label>
<input type="text" class="form-control" name="other_lab_frequency" value="<?php echo $pdata->other_lab_frequency; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Tube'); ?></label>
<select class="form-control" name="tube_type" id="inputGroupSelect01">
<option value="" selected>Choose</option>
<?php foreach ($tubes as $value) { ?>
<option <?php echo ($pdata->tube_type == $value->name)?'selected':'' ; ?> value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Formula'); ?></label>
<input type="text" class="form-control" name="formula"
value="<?php echo $pdata->formula; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Flush With (Water)'); ?></label>
<select class="form-control" name="flush_with" id="inputGroupSelect01">
<option value="" selected>Choose</option>
<?php for($i = 10; $i<=240; $i++) { ?>
<option <?php echo ($pdata->flush_with == $i)?'selected':'' ; ?> value="<?=$i?>"><?php echo $i; ?> ML</option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Flush Frequency'); ?></label>
<div>
<div class="form-check form-check form-check-inline">
<input class="form-check-input" <?php echo ($pdata->flush_frequency == 'Before Feed')?'checked':'' ; ?> name="flush_frequency" type="radio" id="inlineCheckbox1" value="Before Feed">
<label class="form-check-label" for="inlineCheckbox1">Before Feed</label>
</div>
<div class="form-check form-check form-check-inline">
<input class="form-check-input" <?php echo ($pdata->flush_frequency == 'After Feed')?'checked':'' ; ?> name="flush_frequency" type="radio" id="inlineCheckbox2" value="After Feed">
<label class="form-check-label" for="inlineCheckbox2">After Feed</label>
</div>
<div class="form-check form-check form-check-inline">
<input class="form-check-input" <?php echo ($pdata->flush_frequency == 'Before Medication')?'checked':'' ; ?> name="flush_frequency" type="radio" id="inlineCheckbox2" value="Before Medication">
<label class="form-check-label" for="inlineCheckbox2">Before Medication</label>
</div>
<div class="form-check form-check form-check-inline">
<input class="form-check-input" <?php echo ($pdata->flush_frequency == 'After Madication')?'checked':'' ; ?> name="flush_frequency" type="radio" id="inlineCheckbox2" value="After Madication">
<label class="form-check-label" for="inlineCheckbox2">After Madication</label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Daily Intake Requirment'); ?></label>
<input type="text" class="form-control" name="daily_intake_requirment" value="<?php echo $pdata->daily_intake_requirment; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Fluide Restrictions'); ?></label>
<div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="fluid_restriction" id="fluid_restriction_yes" value="YES" <?php echo ($pdata->fluid_restriction == 'YES')?'checked':'' ; ?>>
<label class="form-check-label" for="fluid_restriction_yes">YES</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="fluid_restriction" id="fluid_restriction_no" value="NO" <?php echo ($pdata->fluid_restriction == 'NO')?'checked':'' ; ?>>
<label class="form-check-label" for="fluid_restriction_no">NO</label>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label><?php echo lang('Fluide Restriction Amount'); ?></label>
<input type="text" class="form-control" name="fluide_restric_amount"
value="<?php echo $pdata->fluide_restric_amount ; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label><?php echo lang('Fluide Restriction Frequency'); ?></label>
<div>
<div class="form-check form-check form-check-inline">
<input class="form-check-input" name="fluide_restric_frequency" type="radio" id="inlineCheckbox3" value="Per day" <?php echo ($pdata->fluide_restric_frequency == 'Per day')?'checked':'' ; ?>>
<label class="form-check-label" for="inlineCheckbox2">Per day</label>
</div>
<div class="form-check form-check form-check-inline">
<input class="form-check-input" name="fluide_restric_frequency" type="radio" id="inlineCheckbox4" value="Per Hour" <?php echo ($pdata->fluide_restric_frequency == 'Per Hour')?'checked':'' ; ?>>
<label class="form-check-label" for="inlineCheckbox2">Per Hour</label>
</div>
</div>
</div>
</div>
</div>
<!-- lab draw div -->
</div>
<!-- lab draw div -->
<div class="col-md-12 form-group row mt-1">
<button type="submit" name="submit" value="services" class="btn btn-info"><?php echo lang('submit'); ?></button>
</div>
</form>
</div>
<!-- services tab -->
<!-- payer tab -->
<div class="tab-pane fade <?php echo $tabPane4; ?>" id="payer_need" role="tabpanel" aria-labelledby="payer-tab" style="padding: 20px; border: 1px solid #ccc; margin-bottom: 15px; border-radius: 5px;">
<form role="form" action="<?php echo base_url(); ?>referral/editReferal?pid=<?php echo $pid; ?>" method="post" enctype="multipart/form-data" name="newInsuranceFrom" onsubmit="return validateForm4()" >
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
<input type="hidden" name="pid" value="<?=$pid?>">
<input type="hidden" name="form_status" value="4">
<input type="hidden" name="tabPgs" value="20">
<input type="hidden" name="fromType" value="addRef">
<input type="hidden" name="form_mode" value="<?php if($pdata->form_status>4) echo 'Edit'; else echo 'Add'; ?>">
<!-- <hr class="my-2"> -->
<h4 class="font-weight-bold">Payer Type</h4>
<hr class="my-2">
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('Payer Type'); ?></label>
<!-- <input type="text" class="form-control" name="payerType" value="<?php echo $pdata->payerType; ?>"> -->
<select class="form-control" name="payerType" id="payer_type_1" required="">
<option value="" selected disabled="">Choose</option>
<?php foreach ($payerType as $value) { ?>
<option <?php echo ($pdata->payerType == $value->id)?'selected':'' ; ?> value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<hr class="my-2">
<div class="form-group">
<div class="row" id="pmodeRow" style="display: none;">
<div class="col-md-3 pmodes" id="CreditDebit">
<input class="form-check form-check-inline paymodes" type="radio" name="paymentModes" id="CreditorDebitCard" value="Credit or Debit Card">
<label class="form-check-label" for="CreditorDebitCard">
Credit or Debit Card
</label>
</div>
<div class="col-md-3 pmodes" id="etf">
<input class="form-check form-check-inline paymodes" type="radio" name="paymentModes" id="EFT" value="EFT">
<label class="form-check-label" for="EFT">
EFT
</label>
</div>
<div class="col-md-3 pmodes" id="monthlyInvoice">
<input class="form-check form-check-inline paymodes" type="radio" name="paymentModes" id="MonthlyInvoice" value="Monthly Invoice">
<label class="form-check-label" for="MonthlyInvoice">
Monthly Invoice
</label>
</div>
<div class="col-md-3 pmodes" id="InsuranceInformation">
<input class="form-check form-check-inline paymodes" style="display:none;" type="radio" name="paymentModes" id="InsuranceInformationradio" value="Insurance Information">
<label class="form-check-label" for="InsuranceInformation">
<h4 class="font-weight-bold">Insurance Information</h4>
</label>
</div>
</div>
</div>
<span id="insInfoSection" class="paymodesSh" style="display: none;">
<span id="insCommonInfoSection">
<hr class="my-2">
<div class="form-group">
<div class="row" style="display: <?php echo ($pdata->reference_information == 'Reffered by Vendor')? 'block' : 'none'; ?>;">
<div class="col-lg-3">
<input class="form-check-input" type="checkbox" name="RefertoVendorDocument" id="RefertoVendorDocument" value="Refer to Vendor Document" notRequired="TRUE">
<label class="form-check-label" for="RefertoVendorDocument">
Refer to Vendor Document
</label>
</div>
<hr>
</div>
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('Insurance Type'); ?></label>
<select class="form-control" name="insurance_type" id="insurance_type">
<option value="" selected>Choose</option>
<option value="Madicaid" >Madicaid(MCOs)</option>
<option value="Private" >Private(PPOs)</option>
</select>
</div>
<div class="col-lg-4">
<label class="required"><?php echo lang('Insurance Plan'); ?></label>
<select class="form-control" name="insurance_plan" id="insurance_plan">
<option value="" selected>Choose</option>
<?php
foreach ($insuranceCompanyList as $value)
{
?>
<option <?php echo ($idata->insurance_plan == $value->id)?'selected':'' ; ?> value="<?php echo $value->id; ?>">
<?php echo $value->vedor_name; ?>
</option>
<?php
}
?>
</select>
</div>
</div>
</div>
</span>
<span id="medicaidInfoSection" style="display: none;">
<hr class="my-2">
<h4 class="font-weight-bold">Medicaid information</h4>
<hr class="my-2">
<!-- <p class="lead"> Please fill all the emergency contact</p> -->
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Medicaid ID'); ?></label>
<input type="text" class="form-control" name="MedicaidId" id="exampleInputEmail1" value="<?php echo $idata->medicaid_id; ?>">
</div>
<div class="col-lg-4">
<label><?php echo lang('Medicaid adult'); ?></label>
<input type="text" class="form-control" name="medicaidAdult" id="exampleInputEmail1" value="<?php echo $idata->medicaid_adult; ?>">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Medicaid Pediatric'); ?></label>
<input type="text" class="form-control" name="MedicaidPediriatic" id="exampleInputEmail1" value="<?php echo $idata->medicaid_pedriatic; ?>">
</div>
<div class="col-lg-4">
<label><?php echo lang('Primary or Secondary'); ?></label>
<select class="form-control" name="primarySeconday" id="primarySeconday" notRequired="TRUE">
<option value="" selected>Choose</option>
<option value="Primary">Primary</option>
<option value="Secondary">Secondary</option>
</select>
</div>
</div>
</div>
</span>
<span id="pvtInsInfoSection" style="display: none;">
<hr class="my-2">
<h4 class="font-weight-bold">Private Insurance</h4>
<hr class="my-2">
<!-- <p class="lead"> Please fill all the emergency contact</p> -->
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label><?php echo lang('Insurance Plan ID or Policy Number'); ?></label>
<input type="text" class="form-control" name="privatePolicyNumber" id="privatePolicyNumber" value="<?php echo $idata->Pvt_Ins_PlanId_Policy_no; ?>" oninput="this.value = this.value.replace(/[^0-9 :]/g,'');">
</div>
<div class="col-lg-4">
<label><?php echo lang('Claim Number'); ?></label>
<input type="text" class="form-control" name="Private_claim_number" id="Private_claim_number" value="<?php echo $idata->claim_no; ?>" oninput="this.value = this.value.replace(/[^0-9 :]/g,'');">
</div>
</div>
</div>
</span>
</span>
<span id="CreditDebitPayOpt" class="paymodesSh" style="display: none;">
<hr class="my-2">
<h4 class="font-weight-bold">Credit or Debit Card</h4>
<hr class="my-2">
<div class="form-group">
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('Credit Card Info'); ?></label>
<input type="text" class="form-control" name="CreditCardInfo" id="exampleInputEmail1" value="<?php echo $idata->CreditCardInfo; ?>" required>
</div>
<div class="col-lg-4">
<label class="required"><?php echo lang('CC Number'); ?></label>
<input type="text" class="form-control" name="ccNumber" id="exampleInputEmail1" oninput="this.value = this.value.replace(/[^0-9 :]/g,'');" value="<?php echo $idata->ccNumber; ?>" required>
</div>
</div>
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('Expiration'); ?></label>
<input type="month" class="form-control" name="ccExpiration" id="datepicker" value="<?php echo $idata->ccExpiration; ?>" required>
</div>
<div class="col-lg-4">
<label class="required"><?php echo lang('CVV'); ?></label>
<input type="text" class="form-control" name="ccCvv" id="exampleInputEmail1" value="<?php echo $idata->ccCvv; ?>" minlenght="3" maxlength="3" onkeypress="return isNumberKey(event)" required>
</div>
</div>
<div class="row">
<div class="col-lg-4">
<label class="required"><?php echo lang('Zipcode'); ?></label>
<input type="text" class="form-control" name="ccZipcode" id="exampleInputEmail1" value="<?php echo $idata->ccZipcode; ?>" minlenght="5" maxlength="5" onkeypress="return isNumberKey(event)" required>
</div>
</div>
</div>
</span>
<span id="ETFPayOpt" class="paymodesSh" style="display: none;">
<hr class="my-2">
<h4 class="font-weight-bold">EFT</h4>
<hr class="my-2">
<div class="form-group">
<div class="row">
<div class="col-lg-6">
<label class="required"><?php echo lang('Bank Account'); ?></label>
<input type="text" class="form-control" name="bankAccount" id="exampleInputEmail1" oninput="this.value = this.value.replace(/[^0-9 :]/g,'');" value="<?php echo $idata->bankAccount; ?>">
</div>
<div class="col-lg-6">
<label class="required"><?php echo lang('name'); ?></label>
<input type="text" class="form-control" name="bankName" id="bankName_id" value="<?php echo $idata->bankName; ?>">
<div class="txt-red" id="bankName_id_Error" style="color:red;font-size: 12.5px !important;"></div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<label class="required"><?php echo lang('Number'); ?></label>
<input type="text" class="form-control" name="bankNumber" id="exampleInputEmail1" oninput="this.value = this.value.replace(/[^0-9 :]/g,'');" value="<?php echo $idata->bankNumber; ?>">
</div>
<div class="col-lg-6">
<label class="required"><?php echo lang('Routing Number'); ?></label>
<input type="text" class="form-control" name="RoutingNumber" id="exampleInputEmail1" oninput="this.value = this.value.replace(/[^0-9 :]/g,'');" value="<?php echo $idata->RoutingNumber; ?>">
</div>
</div>
</div>
</span>
<span id="monthlyInvoicePayOpt" class="paymodesSh" style="display: none;">
<hr class="my-2">
<h4 class="font-weight-bold">Monthly Invoice</h4>
<hr class="my-2">
<div class="form-group">
<div class="row">
<div class="col-lg-6">
<label class="required"><?php echo lang('Monthly Invoice'); ?></label>
<input type="text" class="form-control" name="Monthly_Invoice" id="exampleInputEmail1" value="<?php echo $idata->Monthly_Invoice; ?>">
</div>
</div>
</div>
</span>
<div class="col-md-12 form-group row mt-1">
<button type="submit" name="submit" value="insInfo" class="btn btn-info"><?php echo lang('submit'); ?></button>
</div>
</form>
</div>
<!-- payer tab -->
<!-- mdorder tab -->
<div class="tab-pane fade <?php echo $tabPane5; ?>" id="mdorder" role="tabpanel" aria-labelledby="mdorder-tab" style="padding: 20px; border: 1px solid #ccc; margin-bottom: 15px; border-radius: 5px;">
<form role="form" action="<?php echo base_url(); ?>referral/editReferal?pid=<?php echo $_GET['pid']; ?>&phase2=complete" method="post" name="referalFrom" onsubmit="return validateForm5()" enctype="multipart/form-data">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
<input type="hidden" name="pid" value="<?=$pid?>">
<input type="hidden" name="form_status" value="5">
<input type="hidden" name="fromType" value="addRef">
<input type="hidden" name="tabPgs" value="10">
<div class="form-group">
<div class="row">
<div class="col-lg-6">
<label for="exampleInputEmail1"><?php echo lang('Primary Care Physician/MD Info (NPI)'); ?><span class="danger">*</span></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="">
NPI
<!-- <span id="npiNoValidating" style="display: none"><i class="la la-hourglass-start" style="color: blue;"></i></span>
<span id="npiValid" style="display: none"><i class="la la-check" style="color: green;"></i></span>
<span id="npiinValid" style="display: none"><i class="la la-close" style="color: red;"></i></span> -->
</span>
</div>
<input type="text" class="form-control" name="primaryCarePhyMdInfo" id="phymdNPI" value="<?php echo $pdata->primaryCarePhyMdNpi; ?>" minlength="10" maxlength="10" required>
<div class="input-group-append" id="npivalidateTab" style="display: none;">
<span class="input-group-text" >
<span id="npiNoValidating" style="display: none"><i class="la la-hourglass-start" style="color: blue;"></i></span>
<span id="npiValid" style="display: none"><i class="la la-check" style="color: green;">Valid</i></span>
<span id="npiinValid" style="display: none"><i class="la la-close" style="color: red;">Invalid</i></span>
</span>
</div>
</div>
<input type="hidden" name="npivalidate" id="npivalidate" value="<?php if($pdata->primaryCarePhyMdNpi!=""){echo "valid";} ?>">
</div>
<!-- <div class="col-lg-6">
<label><?php echo lang('Diagnosis'); ?></label>
<input type="text" class="form-control" name="diagnosis" value="<?php echo $pdata->diagnosis; ?>">
</div> -->
</div>
</div>
<div class="col-md-12 form-group row mt-1">
<button type="submit" name="submit" value="mdOrders_info" class="btn btn-info"><?php echo lang('submit'); ?></button>
</div>
</form>
</div>
<!-- mdorder tab -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<div use="agreementDocuploadContaner" style="display: none;">
<div class="eachagreementDocupload" action="<?php echo base_url(); ?>referral/documentsSave" enctype="multipart/form-data" use="agreementDocuploadForm">
<div class="row">
<?php
$required="";
if($pdata->patient_auth_stat == '1'){ $required="required-field"; }
?>
<div class="form-group col-md-6">
<label class="<?=$required?>"><?php echo lang('Document (gif/jpg/png/jpeg/pdf)'); ?></label>
<input type="file" class="form-control" id="docsm" name="pagreeDoc[]" <?php if($pdata->patient_auth_stat == '1'){ echo 'required'; }?> >
</div>
<div class="form-group col-md-4">
<label class="required-field"><?php echo lang('Remarks'); ?></label>
<input type="text" class="form-control" name="pagreeDoc_remarks[]">
</div>
<div class="form-group col-md-2">
<img src="<?php echo base_url(); ?>uploads/minus.png" use="minusbutt" onclick="lessPatientAgreementDocument(this);" class="img-thumbnail" style="height:30px; margin-top: 20px; cursor: pointer;">
<img src="<?php echo base_url(); ?>uploads/plus.png" use="plusbutt" onclick="patientAgreementDocument(null);" class="img-thumbnail" style="height:30px;margin-top: 20px; cursor: pointer;">
</div>
</div>
</div>
</div>
<!-- trach doc -->
<div use="otherUploadFormContainer" style="display: none;">
<div class="eachTrachDoc" action="<?php echo base_url(); ?>referral/documentsSave" enctype="multipart/form-data" use="otherUploadForm">
<div class="row">
<!-- <input type="hidden" name="id" id="patient_id" value="<?php echo $_GET['pid']; ?>">
<input type="hidden" name="doc_type" value="<?php echo "TRACH" ; ?>">
<input type="hidden" name="doc_id" value=""> -->
<div class="form-group col-md-6">
<label class="required-field"><?php echo lang('Other Documents (gif/jpg/png/jpeg/pdf)'); ?></label>
<input type="file" class="form-control" name="<?php echo "otherDoc" ; ?>[]">
</div>
<div class="form-group col-md-4">
<label class="required-field"><?php echo lang('Remarks'); ?></label>
<input type="text" class="form-control" name="<?php echo "otherDoc" ; ?>_remarks[]">
</div>
<div class="form-group col-md-2">
<img src="<?php echo base_url(); ?>uploads/minus.png" use="minusbutt" onclick="less_other_documents(this);" class="img-thumbnail" style="height:30px; margin-top: 20px; cursor: pointer;">
<img src="<?php echo base_url(); ?>uploads/plus.png" use="plusbutt" onclick="add_other_documents(null);" class="img-thumbnail" style="height:30px;margin-top: 20px; cursor: pointer;">
</div>
</div>
</div>
</div>
<script type="text/javascript">
$( document ).ready(function() {
setInterval(function(){
load_progress();
}, 1000);
});
function load_progress(){
$.ajax({
url:'<?= base_url()?>referral/load_progress?id=<?php echo $pid; ?>',
type :'GET',
success:function(data){
//console.log(data);
if(data>99){ data=100; }
if(data==''){ data=0; }
$('#progress_lbl').html(data);
$('#progress_bar').html(data+'%');
$('#progress_bar').attr('aria-valuenow',data);
$('#progress_bar').attr('style','width: '+data+'%;');
}
});
}
// --agreement Docs---------------------------------------------------
patientAgreementDocument(null);
function patientAgreementDocument(data){
var appenddata = $("div[use=agreementDocuploadContaner]").find("div[use=agreementDocuploadForm]").clone();
// need to review
if(data!=null)
{
$.each($(appenddata).find("input"),function(){
var val = data[$(this).attr("name")];
if($(this).attr("type") != 'file')
{
$(this).val(val);
}
else
{
$(this).removeAttr('required');
$(this).parent().closest('div').find('label').removeClass('required-field');
}
});
if(data.OTR!='')
{
var img_data='<a target="_blank" href="'+data.OTR+'">'
+'<img src="uploads/attachment.png" class="img-thumbnail" style="height: 50px;">'
//+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 50px;">'
+'</a>';
$(appenddata).find("span[use=uploadContainer]").append(img_data);
}
else
{
var img_data='<img src="uploads/attachment.png" class="img-thumbnail" style="height: 50px;">';
$(appenddata).find("span[use=uploadContainer]").append(img_data);
}
}
// need to review end
$('#agreementVerifiedDocument').append(appenddata);
$('#agreementVerifiedDocument').find("img[use=plusbutt]").hide();
$('#agreementVerifiedDocument').find("img[use=plusbutt]").last().show();
$('#agreementVerifiedDocument').find("img[use=minusbutt]").last().show();
if($('#agreementVerifiedDocument').find("img[use=minusbutt]").length<=1)
{
$('#agreementVerifiedDocument').find("img[use=minusbutt]").first().hide();
}
}
function lessPatientAgreementDocument(obj){
console.log(obj);
//alert()
var form = $(obj).parent().closest(".eachagreementDocupload");
// ajax
$(form).remove();
$('#agreementVerifiedDocument').find("img[use=plusbutt]").hide();
$('#agreementVerifiedDocument').find("img[use=plusbutt]").last().show();
$('#agreementVerifiedDocument').find("img[use=minusbutt]").last().show();
if($('#agreementVerifiedDocument').find("img[use=minusbutt]").length<=1)
{
$('#agreementVerifiedDocument').find("img[use=minusbutt]").first().hide();
}
}
add_other_documents(null);
function add_other_documents(data){
var appenddata = $("div[use=otherUploadFormContainer]").find("div[use=otherUploadForm]").clone();
if(data!=null)
{
$.each($(appenddata).find("input"),function(){
var val = data[$(this).attr("name")];
if($(this).attr("type") != 'file')
{
$(this).val(val);
}else{
$(this).removeAttr('required');
$(this).parent().closest('div').find('label').removeClass('required-field');
}
});
if(data.OTR!='')
{
var img_data='<a target="_blank" href="'+data.OTR+'">'
+'<img src="uploads/attachment.png" class="img-thumbnail" style="height: 50px;">'
//+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 50px;">'
+'</a>';
$(appenddata).find("span[use=uploadContainer]").append(img_data);
}else{
var img_data='<img src="uploads/attachment.png" class="img-thumbnail" style="height: 50px;">';
$(appenddata).find("span[use=uploadContainer]").append(img_data);
}
}
$(appenddata).on("submit",function(e){
e.preventDefault();
submit_upload_form(e,this);
});
$('#mdorder_Trach').append(appenddata);
$('#mdorder_Trach').find("img[use=plusbutt]").hide();
$('#mdorder_Trach').find("img[use=plusbutt]").last().show();
$('#mdorder_Trach').find("img[use=minusbutt]").last().show();
if($('#mdorder_Trach').find("img[use=minusbutt]").length<=1)
{
$('#mdorder_Trach').find("img[use=minusbutt]").first().hide();
}
}
function less_other_documents(obj){
console.log(obj);
//alert()
var form = $(obj).parent().closest(".eachTrachDoc");
// ajax
$(form).remove();
$('#mdorder_Trach').find("img[use=plusbutt]").hide();
$('#mdorder_Trach').find("img[use=plusbutt]").last().show();
$('#mdorder_Trach').find("img[use=minusbutt]").last().show();
if($('#mdorder_Trach').find("img[use=minusbutt]").length<=1)
{
$('#mdorder_Trach').find("img[use=minusbutt]").first().hide();
}
}
function submit_upload_form(e,formObject){
e.preventDefault();
//console.log('>>>>>>>>>>');
var formObj = $(formObject);
// alert($(formObject).attr("action"));
console.log(formObj);
var from_data=new FormData(formObject);
$.ajax({
url: $(formObject).attr("action"),
type : 'POST',
data : from_data,
dataType: "text",
contentType: false,
cache: false,
processData:false,
beforeSend : function(){
//$("#preview").fadeOut();
$("#err").fadeOut();
},
success : function(data){
console.log(data);
// if(data.upload=='success'){
// Swal.fire({
// position: 'center',
// icon: 'success',
// title: data.msg,
// showConfirmButton: false,
// timer: 3500
// });
// $(formObj).find("span[use=uploadContainer]").empty();
// var insert = '<a target="_blank" href="'+data.file_url+'">'
// +'<img src="uploads/attachment.png" class="img-thumbnail" style="height: 50px;">'
// //+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 75px;">'
// +'</a>';
// $(formObj).find("span[use=uploadContainer]").append(insert);
// }
},
error : function(err){
alert("error");
}
});
}
</script>
<!-- new added on 29-09-2021 -->
<script type="text/javascript">
$(document).ready(function(){
$("#refEmailId").blur(function(){
//alert('1');
var email=this.value;
var ck_email = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
$("#emailcheckTab").show();
$("#emailChecking").show();
$("#emailAvailable").hide();
$("#emailNA").hide();
$("#submitBtn").prop('disabled', true); // this submitBtn id is added to the submit button of basic info form
if ( email !='' && (!ck_email.test($.trim(email)))){
$("#emailChecking").hide();
$("#emailAvailable").hide();
$("#emailNA").show();
}else{
$.ajax({
url:'<?php echo base_url();?>patientDashboard/hms_check_patient_email_avl?pid=<?php echo $pid?>',
type:'GET',
data:{email:email},
beforeSend: function(){
$("#emailcheckTab").show();
$("#emailChecking").show();
$("#emailAvailable").hide();
$("#emailNA").hide();
},
success:function(data){
// alert(data);
if(data==true){
$("#emailAvailable").show();
$("#emailNA").hide();
$("#submitBtn").prop('disabled', false);
}else{
$("#emailAvailable").hide();
$("#emailNA").show();
}
$("#emailcheckTab").show();
$("#emailChecking").hide();
}
});
}
});
$("#weight").blur(function(){
var weight=$(this).val();
if(weight<1 || weight>300){
$(this).attr("style","border:2px solid red");
$(".weight-criteria").removeAttr("hidden");
$("#submitBtn").prop('disabled', true);
}else{
$(this).removeAttr("style");
$(".weight-criteria").attr("hidden","");
$("#submitBtn").prop('disabled', false);
}
});
// $("#fname").blur(function(){
// var fname=this.value;
// var regex = /^[a-zA-Z ]*$/;
// if(fname!='')
// {
// if(!regex.test($.trim(fname)))
// {
// $(this).attr("style","border:2px solid red");
// $(".weight-criteria-fname").removeAttr("hidden");
// $("#submitBtn").prop('disabled', true);
// }else{
// $(this).removeAttr("style");
// $(".weight-criteria-fname").attr("hidden","");
// $("#submitBtn").prop('disabled', false);
// }
// }
// });
});
</script>
<!-- new added ending here -->
<script type="text/javascript">
$(document).ready(function(){
var soc=$("#socsec").val();
var len=soc.length;
var xxx_soc_no="";
if(len==9){
for(i=0;i<len;i++){
var n=soc.charAt(i);
if(i<5){
xxx_soc_no+="X";
if(i==2 || i==4){
xxx_soc_no+="-";
}
}
if(i>=5){
xxx_soc_no+=n;
}
}
}
$("#socsec_outer").val(xxx_soc_no);
});
</script>
<script type="text/javascript">
$(document).on("click",".dwnload",function() {
var docType=$(this).data('doctype');
var userid=$(this).data('userid');
var link='<?=base_url()?>referral/file_downloader?doctype='+docType+'&userid='+userid;
window.open(link, 'download');
});
</script>
<!-- new added on 04-10-2021 -->
<!-- <script type="text/javascript">
$("#telId").blur(function(){
//alert('1');
var telephone=this.value;
$("#telcheckTab").show();
$("#telChecking").show();
$("#telAvailable").hide();
$("#telNA").hide();
$("#submitBtn").prop('disabled', true); // this submitBtn id is added to the submit button of basic info form
$.ajax({
url:'<?php echo base_url();?>patientDashboard/checkTel?pid=<?php echo $pid?>',
type:'GET',
data:{tel:telephone},
beforeSend: function(){
$("#telcheckTab").show();
$("#telChecking").show();
$("#telAvailable").hide();
$("#telNA").hide();
},
success:function(data){
// alert(data);
if(data){
$("#telAvailable").show();
$("#telNA").hide();
$("#submitBtn").prop('disabled', false);
}else{
$("#telAvailable").hide();
$("#telNA").show();
}
$("#telcheckTab").show();
$("#telChecking").hide();
}
});
});
</script> -->
<!-- new added ending here -->
<script type="text/javascript">
$(function(){
$("#phymdNPI").blur(function(){
var npiCode = $(this).val();
$.ajax({
url:'<?=base_url()?>referral/getNpiData?code='+npiCode,
type :'GET',
dataType: "json",
beforeSend: function() {
$("#npiValid").hide();
$("#npiinValid").hide();
$("#npiNoValidating").show();
$("#npivalidateTab").show();
},
success:function(data){
console.log(data);
$('#phymdfName').val(data.fname);
if(data.license)
{
$("#npivalidate").val('valid');
$("#npiValid").show();
$("#npiinValid").hide();
$("#npiNoValidating").hide();
}
else
{
$("#npivalidate").val('invalid');
$("#npiValid").hide();
$("#npiinValid").show();
$("#npiNoValidating").hide();
}
}
});
})
});
</script>
<script type="text/javascript">
$(function(){
$("#payer_type_1").change(function(){
$ptype = $(this).val();
$("#pmodeRow").show();
$(".paymodesSh").hide();
$(".pmodes").hide();
$(".paymodes").attr('checked', false);
if ($ptype == '1') {
$("#CreditDebit").show();
$("#etf").show();
$("#monthlyInvoice").show();
}
else if ($ptype == '2' || $ptype == '3' || $ptype == '4') {
$("#InsuranceInformation").show();
$("#insInfoSection").show();
$("#InsuranceInformationradio").attr('checked', true);
setRequiredFields($("#insCommonInfoSection"));
}
if ($ptype == '5') {
$("#etf").show();
$("#monthlyInvoice").show();
}
});
$("#donothave").click(function(){
if($('#donothave').prop('checked')){
$("#refEmailId"). prop('disabled', true);
}else{
$("#refEmailId"). prop('disabled', false);
}
});
})
$(function(){
$(".paymodes").click(function(){
var paymodes = $(this).val();
// alert(paymodes);
$(".paymodesSh").hide();
if(paymodes == 'Insurance Information')
{
$("#insInfoSection").show();
setRequiredFields($("#insInfoSection"));
}
if(paymodes == 'Credit or Debit Card')
{
$("#CreditDebitPayOpt").show();
setRequiredFields($("#CreditDebitPayOpt"));
}
if(paymodes == 'EFT')
{
$("#ETFPayOpt").show();
setRequiredFields($("#ETFPayOpt"));
}
if(paymodes == 'Monthly Invoice')
{
$("#monthlyInvoicePayOpt").show();
setRequiredFields($("#monthlyInvoicePayOpt"));
}
});
var payerType = "<?php echo $idata->payerType; ?>";
var paymode = "<?php echo $idata->paymentModes; ?>";
if(payerType!='' && paymode != '')
{
$('#payer_type_1').val(payerType).trigger('change');
// $("input[name=payerType][value='" + payerType + "']").attr('selected', 'selected').trigger('change');
$("input[name=paymentModes][value='" + paymode + "']").attr('checked', 'checked').trigger('click');
if (paymode == 'Insurance Information')
{
var insType = "<?php echo $idata->insurance_type; ?>";
$('#insurance_type').val(insType).trigger('change');
$('#pvtInsInfoSection').show();
}
}
});
function setRequiredFields(targetspan)
{
$("#insInfoSection").find("input, select, textarea").removeAttr("required");
$("#CreditDebitPayOpt").find("input, select, textarea").removeAttr("required");
$("#ETFPayOpt").find("input, select, textarea").removeAttr("required");
$("#monthlyInvoicePayOpt").find("input, select, textarea").removeAttr("required");
$.each($(targetspan).find("input, select, textarea"), function(){
if($(this).attr("notRequired")=="TRUE")
{
// do nothinh
}
else
{
$(this).attr("required","required");
}
});
}
</script>
<script type="text/javascript">
/* future date dob not accept */
$(document).ready(function() {
// alert("dateSec");
var todaysDate = new Date(); // Gets today's date
// Max date attribute is in "YYYY-MM-DD". Need to format today's date accordingly
var year = todaysDate.getFullYear(); // YYYY
var month = ("0" + (todaysDate.getMonth() + 1)).slice(-2); // MM
var day = ("0" + todaysDate.getDate()).slice(-2); // DD
var maxDate = (year + "-" + month + "-" + day); // Results in "YYYY-MM-DD" for today's date
// Now to set the max date value for the calendar to be today's date
$('#ptdob').attr('max', maxDate);
$("#referalRecDate").attr('max', maxDate);
});
</script>
<script type="text/javascript">
function validateForm() {
var fldval = $("#slotEditname").val();
if (fldval == "") {
$("#msg_rm").html("<div class='alert alert-danger' role='alert'> Please enter a value</div>");
return false;
}
var fldval = $("#slotEditname").val();
var currId = $('#nameId').val();
var msgs = '';
$.ajax('master_icd/duplicateCheck', {
type: 'GET', // http method
data: { val: fldval, currId: currId }, // data to submit
async: false,
success: function(data, status, xhr) {
// $('p').append('status: ' + status + ', data: ' + data);
// alert(data);
msgs = data;
},
error: function(jqXhr, textStatus, errorMessage) {
// $('p').append('Error' + errorMessage);
alert("error duc");
}
});
if (msgs == 'exist') {
$("#msg_rm").html("<div class='alert alert-danger' role='alert'> Value already exist in the list</div>");
return false;
} else {
return true;
}
}
</script>
<script type="text/javascript">
// function USformatPhoneNumber(phoneNumberString,_this) {
// var cleaned = ('' + phoneNumberString).replace(/\D/g, '')
// var match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
// if (match) {
// var intlCode = (match[1] ? '+1 ' : '')
// var fres = [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('')
// _this.value = fres;
// }
// return null
// }
function USformatPhoneNumber(phoneNumberString,_this) {
var cleaned = ('' + phoneNumberString).replace(/\D/g, '')
if(cleaned.length > 10){
cleaned = cleaned.substr(0, 10);
}
var match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
if (cleaned.length == 10 && match) {
var intlCode = (match[1] ? '+1 ' : '')
var fres = [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('')
_this.value = fres;
}else{
_this.value = cleaned
}
return null
}
</script>
<script type="text/javascript">
$(document).ready(function(){
// Initialize Select2
$('#ref_pt_id').select2();
// Set option selected onchange
$('#user_selected').change(function()
{
var value = $(this).val();
// Set selected
$('#ref_pt_id').val(value);
$('#ref_pt_id').select2().trigger('change');
});
});
</script>
<script type="text/javascript">
$( document ).ready(function() {
$("#diagICD").blur(function(){
var icdCode = $(this).val();
$.ajax({
url:'<?=base_url()?>referral/getIcdList?code='+icdCode,
type :'GET',
success:function(data){
$('#diagICDopt').find('option').remove().end()
$('#diagICDopt').append(data);
}
});
})
})
$( document ).ready(function() {
$("#SecdiagICD").blur(function(){
var icdCode = $(this).val();
$.ajax({
url:'<?=base_url()?>referral/getIcdList?code='+icdCode,
type :'GET',
success:function(data){
$('#SecdiagICDopt').find('option').remove().end()
$('#SecdiagICDopt').append(data);
}
});
})
})
</script>
<script>
$( document ).ready(function() {
$(".onlyNumber").keypress(function(evt){
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
})
$('.nav-item').click(function(event){
if ($(this).hasClass('disabled')) {
return false;
}else{
$(".nav-item").removeClass("active");
$(this).addClass("active");
}
});
// $('.nav-item').click(function(event){
// $(".nav-item").removeClass("active");
// $(this).addClass("active");
// });
});
</script>
<script type="text/javascript">
$(function(){
$("#patient_agreement_Document_Verified").click(function(){
if($('#patient_agreement_Document_Verified').prop('checked')){
$("#patientAgreementBtn").removeClass("disabled");
$("#patientAgreementBtn"). prop('disabled', false);
if($("#imageval").val()){
$("#docsm").prop('required',false);
}else{
$("#docsm").prop('required',true);
}
}
else{
$("#patientAgreementBtn").addClass("disabled");
$("#patientAgreementBtn"). prop('disabled', true);
}
});
$("#RefertoVendorDocument").click(function(){
if($('#RefertoVendorDocument').prop('checked')){
$("#insurance_type"). prop('disabled', true);
$("#insurance_plan"). prop('disabled', true);
}else{
$("#insurance_type"). prop('disabled', false);
$("#insurance_plan"). prop('disabled', false);
}
});
$('#insurance_type').change(function(){
var insType = $(this).val();
if(insType == 'Madicaid')
{
document.getElementById("medicaidInfoSection").style.display = "block";
document.getElementById("pvtInsInfoSection").style.display = "none";
}
if(insType == 'Private')
{
document.getElementById("medicaidInfoSection").style.display = "none";
document.getElementById("pvtInsInfoSection").style.display = "block";
}
})
$("#check_acElgb").click(function(){
var pid = $(this).val();
if($('#check_acElgb').prop('checked')){
$.ajax('referral/activatePatientCriterial', {
type: 'POST', // http method
data: { pid: pid ,<?php echo $this->security->get_csrf_token_name(); ?>:'<?php echo $this->security->get_csrf_hash(); ?>'}, // data to submit
async: false,
success: function (data, status, xhr) {
// msgs = data;
var resp = JSON.parse(data);
if (resp.status == '0') {
$("#msgActivation").html(resp.msg);
$("#activatePatient").addClass('disabled');
}
if (resp.status == '1') {
$("#msgActivation").html(resp.msg);
$("#activatePatient").removeClass('disabled');
}
},
error: function (jqXhr, textStatus, errorMessage) {
alert("error duc");
}
});
}
else {
$("#activatePatient").removeClass('disabled');
$("#activatePatient").addClass('disabled');
}
});
});
function secDigActive(_this){
var val = $(_this).val();
if (val=='Secondary') {
$("#secondaryDiagonosis").show();
}
else{
$("#secondaryDiagonosis").hide();
}
}
$("#advanceDirectiveIfyes").change(function(){
var val = $(this).val();
if(val == 'file-upload'){
$("#advUploadFIle").show();
}
else{
$("#advUploadFIle").hide();
}
});
$(function(){
$("#level_service").change(function(){
var valu = $("#level_service option:selected"). attr("attr_name")
// var valu = $(this).("option:selected").attr("attr_name");
// var valu = $(this).val();
if(valu != 'RN' && valu != 'LPN')
$("#rnlnp").hide();
else
$("#rnlnp").show();
});
$('#selectlp').select2();
$('.select3').select2();
});
</script>
<script type="text/javascript">
function secDigActive(_this){
var val = $(_this).val();
if (val=='Secondary') {
$("#secondaryDiagonosis").show();
}
else{
$("#secondaryDiagonosis").hide();
}
}
$("#advanceDirectiveIfyes").change(function(){
var val = $(this).val();
if(val == 'file-upload'){
$("#advUploadFIle").show();
}
else{
$("#advUploadFIle").hide();
}
});
</script>
<?php if(isset($_SESSION['ref_added'])){ ?>
<script>
Swal.fire({
position: 'center',
icon: 'success',
title: 'Referral data added',
showConfirmButton: false,
timer: 3500
})
</script>
<?php unset($_SESSION['ref_added']);} ?>
<!-- new added on 29-09-2021 -->
<?php if(isset($_SESSION['feedback_error'])){ ?>
<script>
Swal.fire({
position: 'center',
icon: 'error',
title: '<?php echo $_SESSION['feedback_error'];?>',
showConfirmButton: false,
timer: 3500
})
</script>
<?php unset($_SESSION['feedback_error']);} ?>
<!-- new added ending here -->
<?php if(isset($_SESSION['ref_updated'])){ ?>
<script>
Swal.fire({
position: 'center',
icon: 'success',
title: 'Referal data Updated',
showConfirmButton: false,
timer: 3500
})
</script>
<?php } ?>
<?php if(isset($_SESSION['doc_deleted'])){ ?>
<script>
$(function(){
Swal.fire({
position: 'center',
icon: 'success',
title: 'Document Successfuly deleted',
showConfirmButton: false,
timer: 3500
})
})
</script>
<?php } ?>
<?php if(isset($_SESSION['doc_deleted_fails'])){ ?>
<script>
Swal.fire({
position: 'center',
icon: 'error',
title: 'Unable to delete the document',
showConfirmButton: false,
timer: 3500
})
</script>
<?php } ?>
<script type="text/javascript">
function check_parmanent_address(_this)
{
var idPostfix = $(_this).val();
var address1=$('#address'+idPostfix).val();
var zipcode1=$('#zipcode'+idPostfix).val();
if(zipcode1 == "")
{
Swal.fire({
position: 'center',
icon: 'error',
title: 'Please enter zip code',
showConfirmButton: true,
});
return 0;
}
$.ajax({
url:"<?=base_url()?>referral/checkaddress",
type:"GET",
data:{address:address1,zipcode:zipcode1},
dataType: "json",
beforeSend: function() {
$("#check_parmanent_address_btn"+idPostfix).hide();
$("#check_parmanent_address_loader"+idPostfix).show();
},
success:function(data){
console.log(data);
if(data.state!=''){
$('#state'+idPostfix).val(data.state);
$('#county'+idPostfix).val(data.county);
$('#city'+idPostfix).val(data.city);
$('#lang'+idPostfix).val(data.lat);
$('#long'+idPostfix).val(data.long);
$('#contact_info_submit').prop('disabled',false);
}else{
Swal.fire({
position: 'center',
icon: 'error',
title: 'Address not found',
showConfirmButton: true,
});
$('#contact_info_submit').prop('disabled',true);
}
$("#check_parmanent_address_btn"+idPostfix).show();
$("#check_parmanent_address_loader"+idPostfix).hide();
}
});
}
</script>
<script type="text/javascript">
function validateForm1(){
var x = document.forms["newGenInfo"]["addrZipcode1"].value;
if (x != "") {
var y = document.forms["newGenInfo"]["state1"].value;
if (y == "") {
document.forms["newGenInfo"]["addrZipcode1"].focus();
Swal.fire({
position: 'center',
icon: 'error',
title: 'Please check the address',
showConfirmButton: true,
});
return false;
}
}
var x = document.forms["newGenInfo"]["altZipcode"].value;
if (x != "") {
var y = document.forms["newGenInfo"]["altState"].value;
if (y == "") {
document.forms["newGenInfo"]["altZipcode"].focus();
Swal.fire({
position: 'center',
icon: 'error',
title: 'Please check the alternate address',
showConfirmButton: true,
});
return false;
}
}
var has_error =0;
$("#fname_Error").html('');
$("#lname_Error").html('');
$("#weight_Error").html('');
var fname = $('#fname').val();
var lname = $('#lname').val();
var weight = $('#weight').val();
var regex = /^[a-zA-Z ]*$/;
if($.trim(fname) == ''){
$("#fname_Error").html('Please enter a valid name.');
$('#fname').focus();
has_error++;
return false;
}
if ($.trim(fname) !='' && (!regex.test($.trim(fname)))){
$('#fname_Error').html("Name field does not contain characters.");
$('#fname').focus();
has_error++;
return false;
}
if($.trim(lname) == ''){
$("#lname_Error").html('Please enter a valid name.');
$('#lname').focus();
has_error++;
return false;
}
if ($.trim(lname) !='' && (!regex.test($.trim(lname)))){
$('#lname_Error').html("Name field does not contain characters.");
$('#lname').focus();
has_error++;
return false;
}
if(weight<1 || weight>300){
$("#weight_Error").html('Weight should be between (1 - 300) lbs.');
$('#weight').focus();
has_error++;
return false;
}
if(has_error == 0){
$('#submitBtn').submit();
}
}
function validateForm4()
{
var x = document.forms["patientAgreementFrom"]["addrZipcode3"].value;
if (x != "") {
var y = document.forms["patientAgreementFrom"]["addrState3"].value;
if (y == "") {
document.forms["patientAgreementFrom"]["addrZipcode3"].focus();
Swal.fire({
position: 'center',
icon: 'error',
title: 'Please check the emergency contact address',
showConfirmButton: true,
});
return false;
}
}
var has_error =0;
$("#fname_Error").html('');
$("#lname_Error").html('');
$("#weight_Error").html('');
$("#emgEmailId_Error").html('');
$("#bankName_id_Error").html('');
$("#advDNR_Error").html('');
var fname = $('#fname').val();
var lname = $('#lname').val();
var weight = $('#weight').val();
var emgEmailId = $('#emgEmailId').val();
var bankName = $('#bankName_id').val();
var advDNR = $('#advDNR').val();
var regex = /^[a-zA-Z ]*$/;
var format = /^[a-zA-Z\s]*$/;
if($.trim(fname) == ''){
$("#fname_Error").html('Please enter a valid name.');
$('#fname').focus();
has_error++;
return false;
}
if ($.trim(fname) !='' && (!regex.test($.trim(fname)))){
$('#fname_Error').html("Name field does not contain characters.");
$('#fname').focus();
has_error++;
return false;
}
if($.trim(lname) == ''){
$("#lname_Error").html('Please enter a valid name.');
$('#lname').focus();
has_error++;
return false;
}
if ($.trim(lname) !='' && (!regex.test($.trim(lname)))){
$('#lname_Error').html("Name field does not contain characters.");
$('#lname').focus();
has_error++;
return false;
}
var ck_email = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if ($.trim(emgEmailId) !='' && (!ck_email.test($.trim(emgEmailId)))){
$('#emgEmailId_Error').html('Please enter correct email.');
$('#emgEmailId').focus();
has_error++;
return false;
}
if ($.trim(bankName) !='' && (!format.test($.trim(bankName)))){
$('#bankName_id_Error').html("Name field does not contain characters and numbers.");
$('#bankName_id').focus();
has_error++;
return false;
}
if ($.trim(advDNR) !='' && (!format.test($.trim(advDNR)))){
$('#advDNR_Error').html("Field does not contain characters.");
$('#advDNR').focus();
has_error++;
return false;
}
}
function validateForm5()
{
var y = $("#npivalidate").val();
if (y == 'invalid' || y == "") {
Swal.fire({
position: 'center',
icon: 'error',
title: 'Please enter a valid NPI number',
showConfirmButton: true,
});
return false;
}
}
$(function(){
$(".select2-container--default").css("width", "100%");
})
$(function(){
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){
dd='0'+dd
}
if(mm<10){
mm='0'+mm
}
today = yyyy+'-'+mm+'-'+dd;
$(".not_future").attr("max", today);
})
function socialSecurity(phoneNumberString,_this) {
//var cleaned = ('' + phoneNumberString).replace(/\D/g, '')
var cleaned =phoneNumberString;
if(cleaned.length > 11){
cleaned = cleaned.substr(0, 11);
}
if(phoneNumberString.length < 11){
var x = document.getElementById("socsec").value;
document.getElementById("socsec_outer").value = x;
}
var match = cleaned.match(/^(1|)?(\d{3})(\d{2})(\d{4})$/);
if (cleaned.length == 9 && match) {
document.getElementById("socsec").value = phoneNumberString;
//var fres = [match[2], '-', match[3], '-', match[4]].join('');
$("#actual_ssn").val([match[2], '-', match[3], '-', match[4]].join(''));
var fres = ['XXX', '-', 'XX', '-', match[4]].join('');
_this.value = fres;
}else{
_this.value = cleaned
}
return null
}
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script>