3306 lines
157 KiB
PHP
3306 lines
157 KiB
PHP
<?php $issue_config = getFieldFromTable('value','config','key_name','ISSUED_ITEMS'); ?>
|
|
<script type="text/javascript">
|
|
function delete_opd_document(delete_id) {
|
|
$("#medical_doc_id").on("click", ".glyphicon-trash", function(event) {
|
|
$('#medical_doc_' + delete_id).remove();
|
|
});
|
|
$.ajax({
|
|
url: "delete_opd_document.php",
|
|
data: {
|
|
delete_id: delete_id
|
|
},
|
|
method: "POST",
|
|
|
|
success: function(data) {
|
|
BootstrapDialog.alert('Document deleted successfully ');
|
|
|
|
|
|
//getMedicalDocData();
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error deleting document');
|
|
}
|
|
});
|
|
}
|
|
var docAttendedNotDoc = false;
|
|
var appointment_id = '<?php echo $row['appointment_id'] ?>'
|
|
|
|
<?php if ($rolecode != 'DOC' && $row['doctor_attended_flag'] == 'Y') { ?>
|
|
docAttendedNotDoc = true;
|
|
$('textarea').prop('readonly', true);
|
|
$('#followup_remarks').prop('readonly', false);
|
|
$("div .tag").children().prop('readonly', true);
|
|
$('#sbp').attr("readonly", "readonly");
|
|
$('#DBP').attr("readonly", "readonly");
|
|
$('#heart_rate').attr("readonly", "readonly");
|
|
$('#fbs').attr("readonly", "readonly");
|
|
$('#rbs').attr("readonly", "readonly");
|
|
$('#ppbs').attr("readonly", "readonly");
|
|
$('#temperature').attr("readonly", "readonly");
|
|
$('#spo2_percent').attr("readonly", "readonly");
|
|
$('#token_no').attr("readonly", "readonly");
|
|
$('#appointment_date').attr("readonly", "readonly");
|
|
$('#out_time').attr("readonly", "readonly");
|
|
$('#injury_type').prop('disabled', true);
|
|
$('#injury_part').prop('disabled', true);
|
|
$('#injury_class').prop('disabled', true);
|
|
$('#injury_sbu').prop('disabled', true);
|
|
$('#injury_firm').prop('disabled', true);
|
|
$('#injury_sub_section').prop('disabled', true);
|
|
$('#injury_section').prop('disabled', true);
|
|
$('#health_advice_name').prop('disabled', true);
|
|
$('#isEmergency').prop('disabled', true);
|
|
<?php } ?>
|
|
|
|
|
|
|
|
/**
|
|
* Get Medicine function to be used for populating the OPD/Injury Medicine Recommendation section.
|
|
*/
|
|
function getMedicine() {
|
|
if (!ace.vars['old_ie']) $('#appointment_date').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
|
defaultDate: new Date("<?php echo $row['appointment_date'] ?>"),
|
|
maxDate: new Date(),
|
|
icons: {
|
|
time: 'fa fa-clock-o',
|
|
date: 'fa fa-calendar',
|
|
up: 'fa fa-chevron-up',
|
|
down: 'fa fa-chevron-down',
|
|
previous: 'fa fa-chevron-left',
|
|
next: 'fa fa-chevron-right',
|
|
today: 'fa fa-arrows ',
|
|
clear: 'fa fa-trash',
|
|
close: 'fa fa-times'
|
|
}
|
|
}).next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
|
|
|
|
|
|
//$("#appointment_date").val(appointment_date_format);
|
|
|
|
appointment_id = '<?php echo $row['appointment_id'] ?>'
|
|
//alert(appointment_id);
|
|
$("#appointment_id").val(appointment_id);
|
|
var content = "";
|
|
content += "<thead>"
|
|
content += "<tr class=\"active info\" >"
|
|
content += "<th style=\"font-size:9px; text-align: center;\" >Medicine</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Frequency</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Timing</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Admin. Route</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Duration / Days</th>"
|
|
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Daily Dose Qty</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Total Qty</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Available Qty</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">BATCH</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Qty Issued</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">"
|
|
<?php
|
|
// if doctor consulted then only doctor should be allowed to add additional medicines
|
|
if ($row['doctor_attended_flag'] != 'Y' || $rolecode == 'DOC') {
|
|
?>
|
|
|
|
content +=
|
|
"<a onclick=\"addRow('<?php echo $row['appointment_id'] ?>')\" id=\"addrow<?php echo $row_history['appointment_id'] ?>\">"
|
|
content += "<i class=\"ace-icon fa fa-plus-square bigger-200\"></i></a>"
|
|
content +=
|
|
"<a onclick=\"addRowExternal('<?php echo $row['appointment_id'] ?>')\" id=\"addrowExternal<?php echo $row_history['appointment_id'] ?>\">"
|
|
content += "<i class=\"ace-icon fa fa-plus-square-o bigger-200\"></i></a>"
|
|
<?php } ?>
|
|
|
|
content += "</th></tr></thead>";
|
|
|
|
|
|
content += "<tbody>";
|
|
$("#treatmentTable").html(content);
|
|
<?php $row_treatment = null; ?>
|
|
|
|
|
|
var count = 0;
|
|
<?php
|
|
$issued_qty_by_pharma = array();
|
|
|
|
if ($num_rows_treatment > 0) {
|
|
while ($row_treatment = @mysqli_fetch_array($result_for_treatment)) {
|
|
|
|
$issued_qty_by_pharma[$row_treatment['item_id']] = $row_treatment['issued_qty'];
|
|
$unit_id = getFieldFromTable("unit_id", "tbl_items", "item_id", $row_treatment['item_id']);
|
|
if ($rolecode == 'DIS') {
|
|
$current_stock = getStockQtyAtDispensaryLevel($row_treatment['item_id'], $ohc_type_id);
|
|
} {
|
|
$current_stock = getStockQtyAtStoreLevel($row_treatment['item_id'], $ohc_type_id, '');
|
|
}
|
|
?>
|
|
content = "";
|
|
content += "<tr style=\"width:70%\">"
|
|
content += "<td class=\"col-sm-2\" id=\"treatment_item_td_" + count + "\">";
|
|
//case when already reviewed by the doctor
|
|
<?php if ($rolecode != 'DOC' && $row['doctor_attended_flag'] == 'Y') { ?>
|
|
|
|
content += "<input id=\"treatment_item_" + count + "\" name=\"treatment_item" + count +
|
|
"\" value='<?php echo $row_treatment['item_id'] ?>' type=\"hidden\">"
|
|
content += "<?php echo getItemWithFormName($row_treatment['item_id']); ?></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<input id=\"treatment_item_dosage" + '_' + count + "\" name=\"treatment_item_dosage" + count +
|
|
"\" value='<?php echo $row_treatment['frequency_id'] ?>'type=\"hidden\">"
|
|
content +=
|
|
"<?php echo getTableFieldValue("medicine_frequency", "medicine_frequency", "frequency_id", $row_treatment['frequency_id']); ?></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<input id=\"timings" + '_' + count + "\" name=\"timings" + count +
|
|
"\" value='<?php echo $row_treatment['timing_id'] ?>'type=\"hidden\">"
|
|
content +=
|
|
"<?php echo getTableFieldValue("medicine_timings", "medicine_timing", "timing_id", $row_treatment['timing_id']); ?></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<input id=\"treatment_item_dosage_category" + '_' + count + "\" name=\"treatment_item_dosage_category" +
|
|
count + "\" value='<?php echo $row_treatment['dosage_category_id'] ?>'type=\"hidden\">"
|
|
content +=
|
|
"<?php echo getTableFieldValue("dosage_category", "dosage_category", "dosage_category_id", $row_treatment['dosage_category_id']); ?></td>"
|
|
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['treatment_id'] ?>\"></td>"
|
|
content += "<td class=\"col-sm-1\" style='width:1%'>"
|
|
content += "<center><?php echo $row_treatment['for_days'] ?></center>"
|
|
content += "<input type=\"hidden\" name=\"treatment_item_days" + count + "\" id=\"treatment_item_days" + '_' +
|
|
count + "\" value='<?php echo $row_treatment['for_days'] ?>'/>"
|
|
|
|
//case when directly dispensary is handling
|
|
|
|
|
|
<?php } else if (($rolecode == 'DIS' || in_array('DIS', $Rolecodes)) && $row['doctor_discussed'] != 'Y') { ?>
|
|
|
|
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item" + '_' + count +
|
|
"\" name=\"treatment_item" + count + "\" onchange=\"getAvailableQty(this.value," + count +
|
|
",'');getItemDetails(this.value,'current_stock" + "_" + count +
|
|
"','current_stock_div" + count + "','" + appointment_id + "', '" + count +
|
|
"');\" data-placeholder=\"Treatment...\">"
|
|
content +=
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(item_code,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' and is_prescription!='1' order by item_name", $row_treatment['item_id'], 'item_id', 'item_name', '', ''); ?></select></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item_dosage" + '_' + count +
|
|
"\" name=\"treatment_item_dosage" + count +
|
|
"\" data-placeholder=\"Dosages...\" onchange=\"getFrequenceyQty(this.value,'frequency_qty" + "_" + count +
|
|
"','dosage" + "_" + count + "','" + appointment_id + "', '" + count + "');\">"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption('medicine_frequency', 'medicine_frequency', 'frequency_id', $row_treatment['frequency_id'], ''); ?>"
|
|
content += "</select></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\">"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings', 'medicine_timing', 'timing_id', $row_treatment['timing_id'], ''); ?>"
|
|
content += "</select></td>"
|
|
|
|
|
|
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" class=\"form-control select2\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment['dosage_category_id'] ?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category", "dosage_category_id", $row_treatment['dosage_category_id'], ''); ?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['treatment_id'] ?>\"></td>"
|
|
content += "<td class=\"col-sm-1\"style='width:7%'>"
|
|
content +=
|
|
"<input type=\"number\" style=\"height:25px;font-size:11px\" class=\"form-control\" name=\"treatment_item_days" +
|
|
count + "\" id=\"treatment_item_days" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['for_days'] ?>\" onchange=\"updateTotalMedicineQtyNew('frequency_qty" +
|
|
"_" + count + "','treatment_item_days" + '_' + count + "'," + count + ");\"/>"
|
|
|
|
|
|
<?php } else { ?>
|
|
//When its doctor
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item" + '_' + count +
|
|
"\" name=\"treatment_item" + count + "\" onchange=\"getAvailableQty(this.value," + count +
|
|
",'');getItemDetails(this.value,'current_stock" + "_" + count +
|
|
"','current_stock_div" + count + "','" + appointment_id + "', '" + count +
|
|
"');\" data-placeholder=\"Treatment...\">"
|
|
content +=
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' order by item_name", $row_treatment['item_id'], 'item_id', 'item_name', '', ''); ?></select></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item_dosage" + '_' + count +
|
|
"\" name=\"treatment_item_dosage" + count +
|
|
"\" data-placeholder=\"Dosages...\" onchange=\"getFrequenceyQty(this.value,'frequency_qty" + "_" + count +
|
|
"','dosage" + "_" + count + "','" + appointment_id + "', '" + count + "');\">"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_frequency', 'medicine_frequency', 'frequency_id', $row_treatment['frequency_id'], ''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\" >"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings', 'medicine_timing', 'timing_id', $row_treatment['timing_id'], ''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" style=\"width:100%\" class=\"select2 form-control\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment['dosage_category_id'] ?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category", "dosage_category_id", $row_treatment['dosage_category_id'], ''); ?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['treatment_id'] ?>\"></td>"
|
|
content += "<td class=\"col-sm-1\" style='width:7%'>"
|
|
content +=
|
|
"<input type=\"number\" style=\"height:25px;font-size:11px\" class=\"form-control\" name=\"treatment_item_days" +
|
|
count + "\" id=\"treatment_item_days" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['for_days'] ?>\" onchange=\"updateTotalMedicineQtyNew('frequency_qty" +
|
|
"_" + count + "','treatment_item_days" + '_' + count + "'," + count + ");\"/>"
|
|
<?php } ?>
|
|
|
|
|
|
|
|
//content+="</td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%;\">"
|
|
content +=
|
|
"<input type=\"hidden\" class=\"form-control\" style=\"height:25px;font-size:12px\" name=\"frequency_qty" +
|
|
count + "\" id=\"frequency_qty" + '_' + count +
|
|
"\" value=\"<?php echo getMedicineFrequencyQty($row_treatment['frequency_id']) ?>\"/>"
|
|
content +=
|
|
"<input type=\"number\" class=\"form-control\" style=\"height:25px;font-size:12px\" onblur=\"updateTotalMedicineQtyNew('frequency_qty" +
|
|
"_" + count + "','treatment_item_days" + '_' + count + "'," + count + ");\" name=\"dose_qty" + count +
|
|
"\" id=\"dose_qty" + '_' + count + "\" value=\"<?php echo $row_treatment['item_qty'] ?>\"/>"
|
|
content += "<input type=\"hidden\" name=\"dosage" + count + "\" id=\"dosage" + '_' + count + "\" />"
|
|
content += "</td><td class=\"col-sm-1\" style=\"width:5%\"><span id=\"treatment_item_total_div" + count +
|
|
"\"><?php echo $row_treatment['item_qty'] ?></span> <input type=\"hidden\" name=\"treatment_item_total" +
|
|
count + "\" value=\"<?php echo $row_treatment['item_qty'] ?>\" id=\"treatment_item_total" + '_' + count +
|
|
"\" readonly />"
|
|
content += "</td>"
|
|
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\">"
|
|
content += "<div style=\"text-align:right\" id=\"current_stock_div" + count + "\">"
|
|
content +=
|
|
"<center><?php echo $current_stock ?> <?php echo isset($unitMap[$unit_id]) ? $unitMap[$unit_id] : '' ?></center>"
|
|
content += "</div>"
|
|
content += "<input type=\"hidden\" name=\"current_stock" + count +
|
|
"\" value=\"<?php echo $current_stock ?>\"id=\"current_stock" + '_' + count + "\" />"
|
|
|
|
content += "</td>"
|
|
content += `<td style="width: 10%"><select onchange='alert_exp_batch(this.value,"`+count+`")' name="item_batch_no` + count + `" id="item_batch_no` + count +
|
|
`" class="form-control">
|
|
<option value="<?php echo $row_treatment['item_batch_no'] ?>" selected><?php echo $row_treatment['item_batch_no'] ?></option>
|
|
</select></td>` + "<td class=\"col-sm-1\" style=\"width:10%\" id=\"qty_td" + count +
|
|
"\">"
|
|
if (jQuery.inArray("<?php echo $row_treatment['item_id'] ?>", groupItems) != -1) {
|
|
content += "<label id='group_" + count + "' onclick='openGroup(" + count +
|
|
")'><span class=\"ace-icon fa fa-medkit\"><span></label>"
|
|
content +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn_hidden" + '_' + count + "\" value=\"1\" />"
|
|
content += "<input type='hidden' id='group_child_flag_" + count + "' name='group_child_flag_" + count +
|
|
"' value='0' ><div style='display:none' id=\"group_items" + '_' + count + "\"></div>"
|
|
|
|
} else {
|
|
content += "<div class='input-group' >"
|
|
<?php if ($rolecode == 'DIS' || in_array('DIS', $Rolecodes)) { ?>
|
|
content +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty'] ?>\" onchange=\"checkQty()\"/>"
|
|
|
|
<?php } else if ($treatment_followup_picked) { ?>
|
|
content +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn" + '_' + count + "\" readonly/>"
|
|
|
|
<?php } else { ?>
|
|
content +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty'] ?>\" readonly/>"
|
|
|
|
<?php } ?>
|
|
content +=
|
|
"<span class='input-group-addon' style='font-size:8px; margin:1px;padding:1px;'><?php echo isset($unitMap[$unit_id]) ? $unitMap[$unit_id] : '' ?></span>";
|
|
|
|
}
|
|
|
|
// getAvailableQty(<?php echo ($row_treatment['item_id']) ?>, count, '<?= $row_treatment['item_batch_no'] ?>');
|
|
// getItemDetails("<?php echo $row_treatment['item_id'] ?>", "current_stock" + '_' + count, "current_stock_div" +
|
|
// count, appointment_id + "_" + count, count, 'edit');
|
|
// getFrequenceyQty($("#treatment_item_dosage" + '_' + count).val(), "frequency_qty" + '_' + count, "dosage" + '_' +
|
|
// count, appointment_id, count);
|
|
// updateTotalMedicineQtyNew("frequency_qty" + '_' + count, "treatment_item_days" + '_' + count, count);
|
|
|
|
content += "</td>"
|
|
|
|
|
|
/// if(count>0)
|
|
content +=
|
|
'<td style=\"width:3%\"><?php if ($rolecode != 'DOC' && $row['doctor_attended_flag'] == 'Y') {
|
|
} else { ?><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label><?php } ?></td>';
|
|
// else
|
|
// content += '<td style=\"width:5%\"></td>';
|
|
content += "</tr>"
|
|
|
|
$("#treatmentTable").append(content);
|
|
$(".select2").select2();
|
|
|
|
|
|
getAvailableQty(<?php echo ($row_treatment['item_id']) ?>, count, '<?= $row_treatment['item_batch_no'] ?>');
|
|
getItemDetails("<?php echo $row_treatment['item_id'] ?>", "current_stock" + '_' + count, "current_stock_div" +
|
|
count, appointment_id + "_" + count, count, 'edit');
|
|
getFrequenceyQty($("#treatment_item_dosage" + '_' + count).val(), "frequency_qty" + '_' + count, "dosage" + '_' +
|
|
count, appointment_id, count);
|
|
updateTotalMedicineQtyNew("frequency_qty" + '_' + count, "treatment_item_days" + '_' + count, count);
|
|
|
|
|
|
|
|
count = count + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
}
|
|
}
|
|
if ($num_rows_treatment_external > 0) {
|
|
// echo "inside external treatments";
|
|
while ($row_treatment_external = @mysqli_fetch_array($result_for_treatment_external)) {
|
|
|
|
?>
|
|
content = "";
|
|
content += "<tr style=\"width:70%\">"
|
|
content += "<td class=\"col-sm-2\" style=\"width:15%\" id=\"treatment_item_td_" + count + "\">";
|
|
<?php if ($rolecode != 'DOC' && $row['doctor_attended_flag'] == 'Y') { ?>
|
|
|
|
content += "<input id=\"treatment_item_external" + count + "\" name=\"treatment_item_external" + count +
|
|
"\" value='<?php echo $row_treatment_external['item_name'] ?>' type=\"hidden\">"
|
|
content += "<?php echo $row_treatment_external['item_name']; ?></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<input id=\"treatment_item_dosage" + '_' + count + "\" name=\"treatment_item_dosage" + count +
|
|
"\" value='<?php echo $row_treatment_external['dosage'] ?>'type=\"hidden\">"
|
|
content += "<?php echo $row_treatment_external['dosage']; ?></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\" >"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings', 'medicine_timing', 'timing_id', $row_treatment_external['timing'], ''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" style=\"width:100%\" class=\"select2 form-control\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment_external['dosage_category_id'] ?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category", "dosage_category_id", $row_treatment_external['dosage_category_id'], ''); ?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment_external['treatment_id'] ?>\"></td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style='width:7%'>"
|
|
content += "<?php echo $row_treatment_external['for_days'] ?>"
|
|
content += "<input type=\"hidden\" name=\"treatment_item_days" + count + "\" id=\"treatment_item_days" + '_' +
|
|
count + "\" value='<?php echo $row_treatment_external['for_days'] ?>'/>"
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
content += "<input id=\"treatment_item_external" + count + "\" name=\"treatment_item_external" + count +
|
|
"\" value='<?php echo $row_treatment_external['item_name'] ?>' class=\"form-control\" type=\"text\">"
|
|
content += "</td><td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<input id=\"treatment_item_dosage" + '_' + count + "\" name=\"treatment_item_dosage" + count +
|
|
"\" value='<?php echo $row_treatment_external['dosage'] ?>'class=\"form-control\" type=\"text\">"
|
|
content += "</td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\" >"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings', 'medicine_timing', 'timing_id', $row_treatment_external['timing'], ''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:5%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" style=\"width:100%\" class=\"select2 form-control\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment['dosage_category_id'] ?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category", "dosage_category_id", $row_treatment_external['dosage_category_id'], ''); ?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment_external['treatment_id'] ?>\"></td>"
|
|
|
|
content += "<td class=\"col-sm-1\"style='width:7%' >"
|
|
content += "<input class=\"form-control\" type=\"text\" name=\"treatment_item_days" + count +
|
|
"\" id=\"treatment_item_days" + '_' + count + "\" value='<?php echo $row_treatment_external['for_days'] ?>'/>"
|
|
<?php } ?>
|
|
|
|
|
|
|
|
content += "</td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%;\">"
|
|
content += "<input type=\"hidden\" class=\"form-control\" name=\"frequency_qty" + count + "\" id=\"frequency_qty" +
|
|
'_' + count + "\" value=\"<?php echo getMedicineFrequencyQty($row_treatment_external['frequency_id']) ?>\"/>"
|
|
content += "<input type=\"text\" class=\"form-control\" name=\"dose_qty" + count + "\" id=\"dose_qty" + '_' +
|
|
count + "\" value=\"<?php echo $row_treatment_external['item_qty'] ?>\" />"
|
|
content += "<input type=\"hidden\" name=\"dosage" + count + "\" id=\"dosage" + '_' + count + "\" />"
|
|
content += "</td><td class=\"col-sm-1\" style=\"width:5%\"><span id=\"treatment_item_total_div" + count +
|
|
"\"><?php echo $row_treatment_external['item_qty'] ?></span><input type=\"hidden\" name=\"treatment_item_total" +
|
|
count + "\" value=\"<?php echo $row_treatment_external['item_qty'] ?>\" id=\"treatment_item_total" + '_' +
|
|
count + "\" readonly/>"
|
|
content += "</td>"
|
|
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\">"
|
|
content += "<div style=\"text-align:right\" id=\"current_stock_div" + count + "\">"
|
|
content += "</div>"
|
|
content += "<input type=\"hidden\" name=\"current_stock" + count + "\" id=\"current_stock" + '_' + count + "\" />"
|
|
|
|
content += "</td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\">"
|
|
content += "</td>"
|
|
|
|
|
|
// if(count>0)
|
|
content +=
|
|
'<td style=\"width:3%\"><?php if ($rolecode != 'DOC' && $row['doctor_attended_flag'] == 'Y') {
|
|
} else { ?><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label><?php } ?></td>';
|
|
// else
|
|
// content += '<td style=\"width:5%\"></td>';
|
|
content += "</tr>"
|
|
|
|
$("#treatmentTable").append(content);
|
|
/////
|
|
getAvailableQty("<?php echo $row_treatment['item_id'] ?>", count, '');
|
|
getItemDetails("<?php echo $row_treatment['item_id'] ?>", "current_stock" + '_' + count, "current_stock_div" +
|
|
count, appointment_id + "_" + count, count, 'edit');
|
|
getFrequenceyQty($("#treatment_item_dosage" + '_' + count).val(), "frequency_qty" + '_' + count, "dosage" + '_' +
|
|
count, appointment_id, count);
|
|
updateTotalMedicineQtyNew("frequency_qty" + '_' + count, "treatment_item_days" + '_' + count, count);
|
|
|
|
count = count + 1;
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
}
|
|
}
|
|
if ($num_rows_treatment_external > 0 || $num_rows_treatment > 0) {
|
|
|
|
?>
|
|
var content = "";
|
|
|
|
content += "</tbody>"
|
|
content += "<tfoot>"
|
|
content += "<tr>"
|
|
content += "<input type=\"hidden\" name=\"count_treatment_item\" id=\"count_treatment_item\" value=\"" + count +
|
|
"\" />"
|
|
|
|
content += "<input type=\"hidden\" name=\"count_treatment_item_old\" id=\"count_treatment_item_old\" value=\"" +
|
|
count + "\" />"
|
|
|
|
content += "</tfoot>"
|
|
$("#treatmentTable").append(content);
|
|
// $("#count_treatment_item").val(count);
|
|
<?php if ($rolecode != 'DIS' || in_array('DIS', $Rolecodes)) { ?>setFieldDisableOrEnable(
|
|
'<?php echo $row['medi_disbursement']; ?>') <?php } ?>
|
|
|
|
<?php
|
|
} else if ($num_rows_treatment_external == 0 && $num_rows_treatment == 0) {
|
|
|
|
?>
|
|
var content = "";
|
|
content += "</tbody>"
|
|
content += "<tfoot>"
|
|
content += "<tr>"
|
|
content += "<input type=\"hidden\" name=\"count_treatment_item\" id=\"count_treatment_item\" value=\"0\" />"
|
|
content +=
|
|
"<input type=\"hidden\" name=\"count_treatment_item_old\" id=\"count_treatment_item_old\" value=\"0\" />"
|
|
|
|
|
|
content += "</tr>"
|
|
content += "<tr>"
|
|
content += "</tr>"
|
|
content += "</tfoot>"
|
|
$("#treatmentTable").append(content);
|
|
$("#count_treatment_item").val(count);
|
|
$("#count_treatment_item_old").val(count);
|
|
addRow(appointment_id);
|
|
addRow(appointment_id);
|
|
addRow(appointment_id);
|
|
|
|
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
}
|
|
|
|
function loadExistingAppointmentTreatment(referenceAppointmentId) {
|
|
|
|
if (referenceAppointmentId == null || referenceAppointmentId == 0 || referenceAppointmentId == undefined ||
|
|
referenceAppointmentId == "") {
|
|
return;
|
|
}
|
|
$("#treatmentTable > tbody").empty();
|
|
$("#count_treatment_item").val("0");
|
|
//first check for internal treatments
|
|
$.ajax({
|
|
url: 'ajax_2.php',
|
|
type: "POST",
|
|
dataType: 'json',
|
|
data: {
|
|
"request_type": "selectAllTableElementsByIdJSON",
|
|
"tableName": "treatment",
|
|
"idCol": "appointment_id",
|
|
"idColVal": referenceAppointmentId
|
|
},
|
|
success: function(data) {
|
|
if (data.length > 0) {
|
|
|
|
rowCntr = 0;
|
|
for (var i = 0; i < data.length; i++) {
|
|
rowCntr = addRow('<?php echo $row['appointment_id'] ?>');
|
|
//Set Field values after adding row
|
|
|
|
$("#treatment_item_dosage_" + rowCntr).val(data[i].frequency_id);
|
|
$("#timings_" + rowCntr).val(data[i].timing_id);
|
|
$("#treatment_item_dosage_category_" + rowCntr).val(data[i].dosage_category_id);
|
|
$("#treatment_item_days_" + rowCntr).val(data[i].for_days);
|
|
$("#frequency_qty" + rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_total_" + rowCntr).val(data[i].item_qty);
|
|
//$("#treatment_item_qtygvn_hidden_"+rowCntr).val(1);
|
|
$("#treatment_id_" + rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_" + rowCntr).val(data[i].item_id);
|
|
$("#treatment_item_qtygvn_" + rowCntr).val(data[i].issued_qty);
|
|
//var availableQty = getDispensaryItemAvailableQty('<?php echo $ohc_type_id ?>',data[i].item_id);
|
|
//var qtydisplay= availableQty+" "+unitMap[data[i].unit_id];
|
|
//$("#current_stock_div"+rowCntr).html(qtydisplay);
|
|
getAvailableQty(data[i].item_id, i, '');
|
|
$("#item_batch_no" + rowCntr).val(data[i].item_batch_no);
|
|
|
|
}
|
|
$(".select2").select2();
|
|
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Treatment Details');
|
|
return;
|
|
}
|
|
});
|
|
//first check for internal treatments
|
|
$.ajax({
|
|
url: 'ajax_2.php',
|
|
type: "POST",
|
|
dataType: 'json',
|
|
data: {
|
|
"request_type": "selectAllTableElementsByIdJSON",
|
|
"tableName": "treatment_external",
|
|
"idCol": "appointment_id",
|
|
"idColVal": referenceAppointmentId
|
|
},
|
|
success: function(data) {
|
|
if (data.length > 0) {
|
|
rowCntr = 0;
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
rowCntr = addRowExternal('<?php echo $row['appointment_id'] ?>');
|
|
|
|
$("#treatment_item_dosage_external_" + rowCntr).val(data[i].frequency_id);
|
|
|
|
$("#frequency_qty_external_" + rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_total_external_" + rowCntr).val(data[i].item_qty);
|
|
//$("#treatment_item_qtygvn_hidden_"+rowCntr).val(1);
|
|
//$("#treatment_id_"+rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_external_" + rowCntr).val(data[i].item_name);
|
|
$("#treatment_item_dosage_category_external_" + rowCntr).val(data[i]
|
|
.dosage_category_id);
|
|
$("#treatment_item_days_external_" + rowCntr).val(data[i].for_days);
|
|
$("#timings_external_" + rowCntr).val(data[i].timing_id);
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Treatment Details');
|
|
return;
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function addRow(appointment_id) {
|
|
var rolecode = '<?= $rolecode ?>';
|
|
var itemOptions = "";
|
|
var counter = $("#count_treatment_item").val();
|
|
var doctorDiscussed = $('input[name=doctor_discussed]:checked').val();
|
|
if (rolecode != 'DOC' && doctorDiscussed != 'Y') {
|
|
itemOptions = itemOptionsDis;
|
|
} else {
|
|
itemOptions = itemOptionsDoc;
|
|
}
|
|
var itemDosages = "<?php echo generateOption('medicine_frequency', 'medicine_frequency', 'frequency_id', '', ''); ?>";
|
|
|
|
var timings = "<?php echo generateOption('medicine_timings', 'medicine_timing', 'timing_id', '', ''); ?>";
|
|
|
|
|
|
var newRow = $("<tr style=\"width:70%\">");
|
|
var cols = "";
|
|
var select_treatment = "";
|
|
select_treatment += "<select onchange=\"getAvailableQty(this.value," + counter +
|
|
",'');getItemDetails(this.value,'current_stock" + "_" + counter +
|
|
"','current_stock_div" + counter + "','" + appointment_id + "', '" + counter +
|
|
"');\" style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_treatment += "id=\"treatment_item" + "_" + counter + "\"name=\"treatment_item" + counter +
|
|
"\"data-placeholder=\"Treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
|
|
cols += '<td style=\"width:7%\" class=\"col-sm-2\" id=\"treatment_item_td_' + counter + '\">' + select_treatment +
|
|
'</td>';
|
|
var select_dosage = "";
|
|
select_dosage += "<select onchange=\"getFrequenceyQty(this.value,'frequency_qty" + "_" + counter + "','dosage" +
|
|
"_" + counter + "','" + appointment_id + "', '" + counter +
|
|
"');\" style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_dosage += "id=\"treatment_item_dosage" + "_" + counter + "\"name=\"treatment_item_dosage" + counter +
|
|
"\"data-placeholder=\"Frequency\"";
|
|
//select_dosage+="style=\"display: none;\"";
|
|
select_dosage += ">";
|
|
|
|
select_dosage += "<option value=\"\">N/A</option>";
|
|
select_dosage += itemDosages
|
|
select_dosage += "</select>";
|
|
|
|
cols += '<td style=\"width:5%\"class=\"col-sm-2\" >' + select_dosage + '</td>';
|
|
|
|
var select_timing = "";
|
|
select_timing += "<select style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_timing += "id=\"timings" + "_" + counter + "\"name=\"timings" + counter +
|
|
"\" data-placeholder=\"Timings...\"";
|
|
select_timing += ">";
|
|
|
|
select_timing += "<option value=\"\">N/A</option>";
|
|
select_timing += timings;
|
|
select_timing += "</select>";
|
|
|
|
cols += '<td style=\"width:7%\" class=\"col-sm-2\" >' + select_timing + '</td>';
|
|
|
|
var select_dosage_cateogory = "";
|
|
select_dosage_cateogory += "<select style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_dosage_cateogory += "id=\"treatment_item_dosage_category" + "_" + counter +
|
|
"\"name=\"treatment_item_dosage_category" + counter + "\"data-placeholder=\"Route of Admin.\"";
|
|
//select_dosage+="style=\"display: none;\"";
|
|
select_dosage_cateogory += ">";
|
|
|
|
select_dosage_cateogory += "<option value=\"\">N/A</option>";
|
|
select_dosage_cateogory += itemDosage_categories
|
|
select_dosage_cateogory += "</select>";
|
|
|
|
cols += '<td style=\"width:5%\" class=\"col-sm-2\" >' + select_dosage_cateogory + '</td>';
|
|
cols += '<td style=\"width:5%\" class=\"col-sm-1\" ><input type=\"hidden\" name=\"treatment_id' + counter +
|
|
'" id=\"treatment_id' + '_' + counter +
|
|
'" ><input type="number" style="height:25px;font-size:12px" class="form-control"id ="treatment_item_days' +
|
|
'_' + counter + '" value="1" onblur="updateTotalMedicineQtyNew(\'frequency_qty' + '_' + counter +
|
|
'\',\'treatment_item_days' + '_' + counter + '\', ' + counter + ')" name="treatment_item_days' + counter +
|
|
'"/></td>';
|
|
|
|
cols +=
|
|
'<td style=\"width:5%;\"class=\"col-sm-1\"><input type="hidden" class=\"form-control\" style=\"height:25px;font-size:12px\" name="frequency_qty' +
|
|
counter + '" id="frequency_qty' + '_' + counter +
|
|
'" /><input type="number" class=\"form-control\" style=\"height:25px;font-size:12px\" name="dose_qty' +
|
|
counter + '" id="dose_qty' + '_' + counter + '" onblur="updateTotalMedicineQtyNew(\'frequency_qty' + '_' +
|
|
counter + '\',\'treatment_item_days' + '_' + counter + '\', ' + counter +
|
|
')" /><input type="hidden" name="dosage' + counter + '" id="dosage' + appointment_id + '_' + counter +
|
|
'" /> </td>';
|
|
cols += '<td style=\"width:5%;\"class=\"col-sm-1\" ><span id=\"treatment_item_total_div' + counter +
|
|
'\"></span><input type="hidden" id="treatment_item_total_' + counter + '" name="treatment_item_total' +
|
|
counter + '" readonly/></td>'
|
|
cols += '<td style=\"width:5%\"><div style="text-align:right" id="current_stock_div' + counter +
|
|
'" ></div><input type="hidden" id="current_stock' + '_' + counter + '" name="current_stock' + counter +
|
|
'" /></td>';
|
|
cols += `<td style="width: 10%"><select name="item_batch_no` + counter + `" id="item_batch_no` + counter +
|
|
`" onchange='alert_exp_batch(this.value,"`+counter+`")' class="form-control"><option value="<?php echo $row_treatment['item_batch_no'] ?>" selected><?php echo $row_treatment['item_batch_no'] ?></option></select></td>` +
|
|
"<td class=\"col-sm-1\" style=\"width:7%\" id=\"qty_td" + counter +
|
|
"\">"
|
|
if (jQuery.inArray("<?php echo $row_treatment['item_id'] ?>", groupItems) != -1) {
|
|
cols += "<label id='group_" + count + "' onclick='openGroup(" + counter +
|
|
")'><span class=\"ace-icon fa fa-medkit\"><span></label>"
|
|
cols +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn_hidden" + '_' + counter + "\" value=\"1\" />"
|
|
cols += "<input type='hidden' id=' _" + counter + "' name='group_child_flag_" + counter +
|
|
"' value='0' ><div style='display:none' id=\"group_items" + '_' + counter + "\"></div>"
|
|
|
|
} else {
|
|
<?php if ($rolecode == 'DIS' || in_array('DIS', $Rolecodes)) { ?>
|
|
cols +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty'] ?>\" onchange=\"checkQty()\"/>"
|
|
<?php } else if($rolecode == 'DOC' && $issue_config == 'TRUE') {
|
|
|
|
?>
|
|
cols +=
|
|
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty'] ?>\" onchange=\"checkQty()\"/>"
|
|
|
|
<?php
|
|
}else{
|
|
|
|
?>
|
|
cols +=
|
|
|
|
"<input type=\"number\" min='0' readonly style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty'] ?>\" onchange=\"checkQty()\"/>"
|
|
<?php } ?>
|
|
}
|
|
|
|
//if(counter>0)
|
|
cols += '<td style=\"width:3%\"><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label></td>';
|
|
// else
|
|
// cols += '<td style=\"width:5%\"></td>';
|
|
|
|
newRow.append(cols);
|
|
$("#treatmentTable").append(newRow);
|
|
$(".select2").select2();
|
|
counter++;
|
|
$("#count_treatment_item").val(counter);
|
|
|
|
var valueChecked = $('input[name=medicine_disbursement]:checked').val();
|
|
|
|
setFieldDisableOrEnable(valueChecked)
|
|
$(".select2").each(function() {
|
|
$(this).attr('style', 'width: 100%');
|
|
});
|
|
return eval(counter - 1);
|
|
}
|
|
//end of addRow
|
|
|
|
|
|
|
|
$("#treatmentTable").on("click", ".fa-trash-o", function(event) {
|
|
$(this).closest("tr").remove();
|
|
var counter = $("#count_treatment_item").val();
|
|
counter -= 1
|
|
//$("#count_treatment_item").val(counter);
|
|
});
|
|
|
|
function addRowExternal(appointment_id) {
|
|
var counter = $("#count_treatment_item").val();
|
|
var doctorDiscussed = $('input[name=doctor_discussed]:checked').val();
|
|
|
|
|
|
var newRow = $("<tr style=\"width:70%\">");
|
|
var cols = "";
|
|
|
|
var timings = "<?php echo generateOption('medicine_timings', 'medicine_timing', 'timing_id', '', ''); ?>";
|
|
|
|
|
|
cols += '<td style=\"width:15%\" id=\"treatment_item_td_' + counter +
|
|
'\"><input type="text" class="form-control" id=\"treatment_item_external_' + counter +
|
|
'\"name=\"treatment_item_external' + counter + '\"></td>';
|
|
|
|
var select_dosage = "";
|
|
select_dosage += "<input type='text' class='form-control'";
|
|
select_dosage += "id=\"treatment_item_dosage" + "_" + counter + "\"name=\"treatment_item_dosage" + counter +
|
|
"\"data-placeholder=\"Frequency\"";
|
|
select_dosage += ">";
|
|
|
|
|
|
cols += '<td style=\"width:5%\" >' + select_dosage + '</td>';
|
|
|
|
|
|
var select_timing = "";
|
|
select_timing += "<select style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_timing += "id=\"timings" + "_" + counter + "\"name=\"timings" + counter +
|
|
"\" data-placeholder=\"Timings...\"";
|
|
select_timing += ">";
|
|
|
|
select_timing += "<option value=\"\">N/A</option>";
|
|
select_timing += timings;
|
|
select_timing += "</select>";
|
|
|
|
|
|
cols += '<td style=\"width:7%\" class=\"col-sm-2\" >' + select_timing + '</td>';
|
|
|
|
var select_dosage_cateogory = "";
|
|
select_dosage_cateogory += "<select style='width:100%' class='form-control select2'";
|
|
select_dosage_cateogory += "id=\"treatment_item_dosage_category" + "_" + counter +
|
|
"\"name=\"treatment_item_dosage_category" + counter + "\"data-placeholder=\"Route of Admin.\"";
|
|
//select_dosage+="style=\"display: none;\"";
|
|
select_dosage_cateogory += ">";
|
|
|
|
select_dosage_cateogory += "<option value=\"\"> </option>";
|
|
select_dosage_cateogory += itemDosage_categories
|
|
select_dosage_cateogory += "</select>";
|
|
|
|
cols += '<td style=\"width:5%\" >' + select_dosage_cateogory + '</td>';
|
|
cols += '<td><input type=\"hidden\" name=\"treatment_id' + counter + '" id=\"treatment_id' + '_' + counter +
|
|
'" ><input type="number" style="height:25px;font-size:12px" class="form-control"id ="treatment_item_days' +
|
|
'_' + counter + '" value="1" name="treatment_item_days' + counter + '"/></td>';
|
|
|
|
cols +=
|
|
'<td style=\"width:5%;\"class=\"col-sm-1\"><input type="hidden" class=\"form-control\" style=\"height:25px;font-size:12px\" name="frequency_qty' +
|
|
counter + '" id="frequency_qty' + '_' + counter +
|
|
'" /><input type="number" class=\"form-control\" onblur="updateTotalMedicineQtyNew(\'frequency_qty' + '_' +
|
|
counter + '\',\'treatment_item_days' + '_' + counter + '\', ' + counter +
|
|
')" style=\"height:25px;font-size:12px\" name="dose_qty' + counter + '" id="dose_qty' + '_' + counter +
|
|
'" /><input type="hidden" name="dosage' + counter + '" id="dosage' + appointment_id + '_' + counter +
|
|
'" /> </td>';
|
|
cols += '<td style=\"width:5%;\"class=\"col-sm-1\"><span id=\"treatment_item_total_div' + counter +
|
|
'\"><?php echo $row_treatment['item_qty'] ?></span><input type="hidden" id="treatment_item_total_' + counter +
|
|
'" name="treatment_item_total' + counter + '" readonly/></td>'
|
|
cols += '<td style=\"width:5%\"><div style="text-align:center display:none" id="current_stock_div' + counter +
|
|
'" ></div><input type="hidden" id="current_stock' + '_' + counter + '" name="current_stock' + counter +
|
|
'" /></td>';
|
|
cols += `<td style="width: 10%"><select onchange='alert_exp_batch(this.value,"`+counter+`")' name="item_batch_no` + counter + `" id="item_batch_no` + counter +
|
|
`" class="form-control"><option value="<?php echo $row_treatment['item_batch_no'] ?>" Selected><?php echo $row_treatment['item_batch_no'] ?></option></select></td>` +
|
|
"<td class=\"col-sm-1\" style=\"width:7%\" id=\"qty_td" + counter +
|
|
"\">"
|
|
cols +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty'] ?>\" onchange=\"checkQty()\"/>"
|
|
|
|
//if(counter>0)
|
|
cols += '<td style=\"width:3%\"><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label></td>';
|
|
//else
|
|
// cols += '<td style=\"width:5%\"></td>';
|
|
|
|
newRow.append(cols);
|
|
$("#treatmentTable").append(newRow);
|
|
$('.select2').select2();
|
|
//$('#ailment_system').trigger('chosen:updated');
|
|
//$('#treatment_item_dosage'+"_"+counter).chosen({allow_single_deselect:true});
|
|
// $('#treatment_item_dosage'+"_"+counter).next().css({'width': $('#treatment_item_dosage'+counter).parent().width()});
|
|
|
|
//$('#treatment_item'+"_"+counter).chosen({allow_single_deselect:true});
|
|
//$('#treatment_item'+"_"+counter).next().css({'width': $('#treatment_item'+counter).parent().width()});
|
|
|
|
counter++;
|
|
$("#count_treatment_item").val(counter);
|
|
|
|
var valueChecked = $('input[name=medicine_disbursement]:checked').val();
|
|
|
|
setFieldDisableOrEnable(valueChecked)
|
|
return eval(counter - 1);
|
|
|
|
}
|
|
//End of AddRowExternal
|
|
|
|
|
|
$("#treatmentTable").on("click", ".fa-trash-o", function(event) {
|
|
$(this).closest("tr").remove();
|
|
var counter = $("#count_treatment_item").val();
|
|
counter -= 1
|
|
//$("#count_treatment_item").val(counter);
|
|
});
|
|
|
|
|
|
// search by salt name start
|
|
let typingTimer;
|
|
const doneTypingInterval = 2000; // Adjust the interval as needed
|
|
|
|
//checking if user stopped the generic search feature or not
|
|
var myBox = document.getElementById('genericSearchCheckbox');
|
|
if(myBox!='' && myBox!=null && myBox!="undefined"){
|
|
myBox.addEventListener('change', () => {
|
|
if (!myBox.checked) {
|
|
resetTreatmentRows();
|
|
}
|
|
});
|
|
}
|
|
document.addEventListener('input', function(event) {
|
|
var ulOptionElement = document.querySelector('.select2-results__options');
|
|
if(ulOptionElement!='' && ulOptionElement!=null ){
|
|
selectedOptionId = ulOptionElement.id.split("-")[1];
|
|
var pattern = /^treatment_item_\d+$/;
|
|
|
|
console.log("id is ", selectedOptionId);
|
|
if (pattern.test(selectedOptionId)) {
|
|
|
|
if (event.target.classList.contains('select2-search__field')) {
|
|
var userEnteredSalt = event.target.value.trim();
|
|
console.log('User entered salt:', userEnteredSalt);
|
|
|
|
var genericSearchBox = document.getElementById("genericSearchCheckbox");
|
|
|
|
if (genericSearchBox.checked) {
|
|
console.log("inside if and searching by salt ");
|
|
|
|
// Clear the previous timer (if any)
|
|
clearTimeout(typingTimer);
|
|
if (document.getElementsByClassName('select2-results__message')[0]) {
|
|
var loadingMessage = document.getElementsByClassName('select2-results__message')[0];
|
|
loadingMessage.innerText = 'Keep Typing We Are Searching...';
|
|
|
|
// Adding some styling to the loading message
|
|
loadingMessage.style.color = '#007bff';
|
|
loadingMessage.style.fontWeight = 'bold';
|
|
loadingMessage.style.fontSize = '12px';
|
|
}
|
|
|
|
if (userEnteredSalt.length > 0) {
|
|
// Set a new timer
|
|
typingTimer = setTimeout(function() {
|
|
// Perform the desired action here
|
|
console.log('User finished typing:', userEnteredSalt);
|
|
|
|
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_medicine_by_generic_name.php',
|
|
data: {
|
|
generics: userEnteredSalt
|
|
},
|
|
success: function(data) {
|
|
if (document.getElementsByClassName('select2-results__message')[0]) {
|
|
var loadingMessage = document.getElementsByClassName('select2-results__message')[0];
|
|
loadingMessage.innerText = 'Keep Typing We Are Searching...';
|
|
|
|
// Adding some styling to the loading message
|
|
loadingMessage.style.color = '#007bff';
|
|
loadingMessage.style.fontWeight = 'bold';
|
|
loadingMessage.style.fontSize = '12px';
|
|
}
|
|
console.log(data);
|
|
data = JSON.parse(data);
|
|
if (data.length > 0) {
|
|
|
|
var dynamicSelect = "";
|
|
try {
|
|
var ulElement = document.querySelector('.select2-results__options');
|
|
dynamicSelect = $("#" + ulElement.id.split("-")[1]);
|
|
} catch (err) {
|
|
console.log(e);
|
|
}
|
|
|
|
console.log(dynamicSelect);
|
|
|
|
dynamicSelect.empty();
|
|
|
|
var dataArray = Array.isArray(data) ? data : Object.values(data);
|
|
|
|
dynamicSelect.append(new Option("Select an item", ""));
|
|
|
|
data.forEach(function(item) {
|
|
dynamicSelect.append(new Option(item.item_name, item.item_id));
|
|
});
|
|
$('.select2').select2();
|
|
} else {
|
|
if (document.getElementsByClassName('select2-results__message')[0]) {
|
|
document.getElementsByClassName('select2-results__message')[0].innerText = 'No Results Found';
|
|
}
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert("Something Went Wrong While Loading The Medicines According to Generic Names");
|
|
}
|
|
});
|
|
}, doneTypingInterval);
|
|
}
|
|
// else{
|
|
// var currentRowId = ulElement.id.split("-")[1];
|
|
// resetTreatmentRowsParticular(currentRowId);
|
|
// }
|
|
}
|
|
}
|
|
} else {
|
|
// its an another field no need to do anything
|
|
}
|
|
}
|
|
});
|
|
//end
|
|
|
|
|
|
|
|
function alert_exp_batch(selectTag , counter){
|
|
$.ajax({
|
|
url: 'get_item_batch_nos_exp.php',
|
|
type: 'POST',
|
|
data: {
|
|
batch_no: selectTag
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// console.log(data[0].expiry_date);
|
|
|
|
const expiryDate = new Date(data[0].expiry_date);
|
|
const currentDate = new Date();
|
|
const sixtyDaysLater = new Date(currentDate);
|
|
sixtyDaysLater.setDate(currentDate.getDate() + 60);
|
|
|
|
// Check if expiry is within the next 60 days
|
|
if (expiryDate > currentDate && expiryDate <= sixtyDaysLater) {
|
|
console.log("Alert condition reached.");
|
|
BootstrapDialog.alert("This " + data[0].item_batch_no + " batch no has expiry within the next 60 days");
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
////
|
|
function getFrequenceyQty(frequency_id, qty_value_field_id, dosage_desc_field_id, appointment_id, counter) {
|
|
|
|
$.ajax({
|
|
url: 'select_frequency.php?frequency_id=' + frequency_id,
|
|
type: "GET",
|
|
async: false,
|
|
success: function(data) {
|
|
var data = $.parseJSON(data);
|
|
if (data.qty != null) {
|
|
$("#dose_qty_" + counter).val(data.qty);
|
|
$("#" + qty_value_field_id).val(data.qty);
|
|
$("#" + dosage_desc_field_id).val(data.frequency_description);
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling frequency qty');
|
|
return;
|
|
}
|
|
|
|
});
|
|
updateTotalMedicineQtyNew('frequency_qty' + '_' + counter, 'treatment_item_days' + '_' + counter, counter)
|
|
|
|
}
|
|
|
|
function getAvailableQty(value, counter, batch) {
|
|
|
|
$.ajax({
|
|
url: '<?php if ($rolecode == 'DIS') {
|
|
echo 'get_medicine_available_qty.php';
|
|
} else {
|
|
echo 'get_medicine_available_qty_store.php';
|
|
} ?>',
|
|
form: 'POST',
|
|
data: {
|
|
value: value
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
$("#available" + counter).html(data.stock_qty);
|
|
$("#current_stock_div" + counter).html(data.stock_qty + " " + unitMap[data.unit_id]);
|
|
// $("#unit").html(unitMap[data.unit_id]);
|
|
$("#unit" + counter).html(unitMap[data.unit_id]);
|
|
setItemBatchNo(value, counter, batch);
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Retrieving Medicine Available Quantity.!!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
function setItemBatchNo(item_id, count, batch) {
|
|
$.ajax({
|
|
url: 'get_item_batch_nos.php',
|
|
type: 'POST',
|
|
data: {
|
|
item_id: item_id
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var content_item_batch =
|
|
"<option value=\"\" selected disabled >Please Select Batch No</option>";
|
|
if (data != null && data != "") {
|
|
item_batch = data;
|
|
for (var i = 0; i < data.length; i++) {
|
|
var select = '';
|
|
|
|
if ((batch == '' || batch == null) && i == 0) {
|
|
select = 'selected';
|
|
}
|
|
if (batch == data[i].item_batch_no) {
|
|
select = 'selected';
|
|
}
|
|
const expiryDate = new Date(data[i].expiry_date);
|
|
const currentDate = new Date();
|
|
const sixtyDaysLater = new Date(currentDate);
|
|
sixtyDaysLater.setDate(currentDate.getDate() + 60);
|
|
|
|
// Check if expiry is within the next 60 days
|
|
if (expiryDate > currentDate && expiryDate <= sixtyDaysLater) {
|
|
console.log("Alert condition reached.");
|
|
BootstrapDialog.alert("This " + data[i].item_batch_no + " batch no has expiry within the next 60 days");
|
|
}
|
|
|
|
content_item_batch += "<option value='" + data[i].item_batch_no + "' " + select + ">" +
|
|
data[i]
|
|
.item_batch_no + " (Expiry Date:" + myDateFormaterMonthYear(data[i].expiry_date) +
|
|
", Stock Qty:" + data[i].stock_qty + ")</option>"
|
|
}
|
|
}
|
|
$("#item_batch_no" + count).html(content_item_batch);
|
|
},
|
|
error: function(data) {}
|
|
});
|
|
}
|
|
|
|
function myDateFormaterMonthYear(myDate) {
|
|
var d = new Date(myDate);
|
|
var m = d.getMonth() + 1;
|
|
var y = d.getFullYear();
|
|
var date = d.getDate();
|
|
// alert(date+"/"+m+"/"+y);
|
|
return m + "/" + y;
|
|
|
|
|
|
}
|
|
|
|
|
|
function getItemDetails(item_id, current_stock_field, current_stock_field_div, appointment_id, counter, e) {
|
|
var issued_qty_by_pharma = <?php echo json_encode($issued_qty_by_pharma); ?>
|
|
|
|
console.log(issued_qty_by_pharma);
|
|
|
|
$.ajax({
|
|
async: false,
|
|
url: '<?php if ($rolecode == 'DIS') {
|
|
echo "select_item_dispensary.php";
|
|
} else {
|
|
echo "select_item_store.php";
|
|
} ?>?item_id=' +
|
|
item_id,
|
|
type: "GET",
|
|
success: function(data) {
|
|
var data = $.parseJSON(data);
|
|
var content = "";
|
|
|
|
if (data.current_stock_level == 0 || data.current_stock_level == '' || data
|
|
.current_stock_level == null) {
|
|
// BootstrapDialog.alert('This Item is not available in stock.');
|
|
$('.med-content').empty();
|
|
$.ajax({
|
|
async: false,
|
|
url: 'get_alternate_med_data.php',
|
|
type: 'post',
|
|
data: {
|
|
item_id: item_id
|
|
},
|
|
success: function(data) {
|
|
console.log(data);
|
|
var items = JSON.parse(data);
|
|
|
|
if (items.length > 0) {
|
|
|
|
var table = $('<table>').addClass(
|
|
'table table-bordered table-striped');
|
|
var tableHeader = $('<thead>').addClass('thead-dark');
|
|
var tableBody = $('<tbody>');
|
|
|
|
var headerRow = $('<tr>');
|
|
headerRow.append($('<th>').text('Medicine Name'));
|
|
headerRow.append($('<th>').text('Stock'));
|
|
headerRow.append($('<th>').text('Click To Select'));
|
|
|
|
tableHeader.append(headerRow);
|
|
|
|
table.append(tableHeader);
|
|
|
|
for (var i = 0; i < items.length; i++) {
|
|
var item = items[i];
|
|
|
|
var row = $('<tr>');
|
|
|
|
var medicineNameCell = $('<td>').text(item.item_name);
|
|
|
|
var stockCell = $('<td>').text(item.qty);
|
|
|
|
var plusCell = $('<td>');
|
|
var plusButton = $('<button>').text('+').addClass(
|
|
'btn btn-primary');
|
|
|
|
plusButton.attr('data-item-id', item.item_id);
|
|
plusButton.attr('data-is-prescription', item.is_prescribed);
|
|
|
|
// console.log("is_prescription " + item.is_prescribed);
|
|
|
|
// Attach the click event handler to the plus button
|
|
plusButton.click(function(event) {
|
|
event.preventDefault();
|
|
// Retrieve the item_id and additional parameter from data attributes
|
|
var item_id = $(this).data('item-id');
|
|
var is_prescription = $(this).data(
|
|
'is-prescription');
|
|
document.getElementById('treatment_item_' + counter)
|
|
.value = item_id;
|
|
|
|
var doc_dis = document.querySelector(
|
|
'input[name="doctor_discussed"]:checked');
|
|
var doc_dis_value;
|
|
|
|
if (doc_dis) {
|
|
doc_dis_value = doc_dis.value;
|
|
console.log("Selected Value: " + doc_dis_value);
|
|
} else {
|
|
console.log(
|
|
"Radio button not defined or not selected."
|
|
);
|
|
}
|
|
|
|
if (doc_dis_value == 'Y' && is_prescription ==
|
|
"1") {
|
|
console.log("is_prescription" +
|
|
is_prescription);
|
|
$('#treatment_item_' + counter).trigger(
|
|
'chosen:updated');
|
|
} else {
|
|
// console.log("is_prescription" + is_prescription);
|
|
$("#treatment_item_" + counter).select2();
|
|
}
|
|
getItemDetails(item_id, "current_stock_" + counter,
|
|
"current_stock_div" + counter,
|
|
'<?= $_REQUEST['appointmentId'] ?>', i);
|
|
setItemBatchNo(item_id, counter, '');
|
|
|
|
$('#alternative_med').modal('hide');
|
|
});
|
|
|
|
plusCell.append(plusButton);
|
|
|
|
row.append(medicineNameCell);
|
|
row.append(stockCell);
|
|
row.append(plusCell);
|
|
|
|
tableBody.append(row);
|
|
}
|
|
|
|
|
|
table.append(tableBody);
|
|
|
|
|
|
$('.med-content').append(table);
|
|
|
|
$('#alternative_med').modal();
|
|
}
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert(
|
|
"Something went wrong while fetching the alternate medicine data! Try Again..."
|
|
);
|
|
}
|
|
});
|
|
}
|
|
//current_val=$("treatment_item_qtygvn"+'_'+counter).val();
|
|
//alert(current_val);
|
|
|
|
$.ajax({
|
|
async: false,
|
|
url: 'get_med_salt_data.php',
|
|
type: 'post',
|
|
data: {
|
|
item_id: item_id
|
|
},
|
|
success: function(data) {
|
|
// console.log(typeof data);
|
|
try {
|
|
var salt_data = JSON.parse(data);
|
|
// console.log(typeof salt_data);
|
|
// console.log("allergies "+ selected_allergy);
|
|
|
|
var selected_allergy = $("#drug_allergy").val();
|
|
|
|
for (let salt of salt_data) {
|
|
if (selected_allergy.includes(salt)) {
|
|
BootstrapDialog.alert(
|
|
"Patient Is Allergic To This Medicine Please Change Medicine ."
|
|
);
|
|
break;
|
|
} else {
|
|
console.log("Allergy not found: " + salt);
|
|
}
|
|
};
|
|
} catch (error) {
|
|
console.log(
|
|
"Either allergy field is blank or salt is not mapped with medicine"
|
|
);
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert(
|
|
"Something went wrong while fetching the drug allergy data! Try Again..."
|
|
);
|
|
}
|
|
});
|
|
|
|
if (jQuery.inArray(item_id, groupItems) != -1) {
|
|
|
|
content += "<label id='group_" + counter + "' onclick='openGroup(" + counter +
|
|
")'><span class=\"ace-icon fa fa-medkit\"><span></label>"
|
|
content +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn_hidden" + '_' + counter +
|
|
"\" value=\"1\" />"
|
|
|
|
content += "<input type='hidden' id='group_child_flag_" + counter +
|
|
"' name='group_child_flag_" + counter +
|
|
"' value='0' ><div style='display:none' id=\"group_items" + '_' + counter + "\"></div>"
|
|
|
|
$("#qty_td" + counter).html(content);
|
|
//$("treatment_item_qtygvn"+'_'+counter).val($current_val);
|
|
document.getElementById(current_stock_field_div + "").innerText = 'N/A';
|
|
|
|
} else {
|
|
|
|
var issue_qty = 0
|
|
|
|
|
|
|
|
if (issued_qty_by_pharma[item_id] == 0 || issued_qty_by_pharma[item_id] == '' ||
|
|
issued_qty_by_pharma[item_id] == null) {
|
|
var issue_qty = 0
|
|
} else {
|
|
issue_qty = issued_qty_by_pharma[item_id];
|
|
}
|
|
|
|
content +=
|
|
"<div class='input-group' ><input type=\"number\" min='0' style=\"height:25px;font-size:12px;\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=" + issue_qty + "";
|
|
<?php if ($rolecode == 'DOC' && $issue_config == 'TRUE') { ?> content += " "; <?php }else if($rolecode == 'DOC' && $issue_config == 'TRUE'){ ?> content += " "; <?php } else{ ?> content += " readonly ";
|
|
<?php } ?>
|
|
|
|
content +=
|
|
" onchange=\"checkQty()\"/><span class='input-group-addon' style='font-size:8px; margin:1px;padding:1px;'>" +
|
|
unitMap[data.unit_id] + "</span></div>";
|
|
$("#qty_td" + counter).html(content);
|
|
//$("treatment_item_qtygvn"+'_'+counter).val(current_val);
|
|
//alert(current_val);
|
|
|
|
if (e == 'edit') {
|
|
$("#" + current_stock_field).val(data.current_stock_level)
|
|
document.getElementById(current_stock_field_div + "").innerText = data
|
|
.current_stock_level + " " + unitMap[data.unit_id];
|
|
|
|
} else if (data.current_stock_level > 1) {
|
|
|
|
$("#" + current_stock_field).val(data.current_stock_level)
|
|
document.getElementById(current_stock_field_div + "").innerText = data
|
|
.current_stock_level + " " + unitMap[data.unit_id];
|
|
|
|
|
|
} else {
|
|
if (data.current_stock_level == null || data.current_stock_level == 'undefined' || data
|
|
.current_stock_level == undefined) {
|
|
document.getElementById(current_stock_field_div + "").innerText = '0.0';
|
|
|
|
} else {
|
|
document.getElementById(current_stock_field_div + "").innerText = data
|
|
.current_stock_level + " " + unitMap[data.unit_id];
|
|
|
|
|
|
|
|
if (flagReload == 1) {
|
|
BootstrapDialog.alert('This Item is not available in stock.');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Item Details');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
function itemLevelTotol(treatment_item_qtygvn_field, current_rate_field, treatment_item_total_amount_field,
|
|
treatment_item_total_amount_field_div) {
|
|
var appointment_id = '<?php echo $row['appointment_id'] ?>'
|
|
var count = $("#count_treatment_item").val();
|
|
//alert(count);
|
|
var price = $("#" + current_rate_field).val();
|
|
var qty = $("#" + treatment_item_qtygvn_field).val();
|
|
var totalValue = price * qty;
|
|
///alert(totalValue);
|
|
$("#" + treatment_item_total_amount_field).val(totalValue);
|
|
document.getElementById(treatment_item_total_amount_field_div + "").innerText = totalValue;
|
|
|
|
orderLevelTotal(count);
|
|
}
|
|
|
|
function orderLevelTotal(count) {
|
|
var totalAmount = 0;
|
|
var appointment_id = '<?php echo $row['appointment_id'] ?>'
|
|
//totalAmount=totalAmount+parseInt(treatment_item_total_amount_field_value);
|
|
for (var i = 0; i < parseInt(count); i++) {
|
|
totalAmount = totalAmount + parseInt($("#treatment_item_total_amount" + '_' + i).val());
|
|
}
|
|
|
|
//alert(totalAmount);
|
|
$("#order_level_total").val(totalAmount);
|
|
|
|
document.getElementById("order_level_total_div").innerText = totalAmount;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function updateTotalMedicineQtyNew(frequency_qty_fieild, treatment_item_days_fieild, counter) {
|
|
|
|
let treatment_item_id = $("#treatment_item_" + counter).val();
|
|
// alert(treatment_item_id);
|
|
|
|
if(treatment_item_id){
|
|
$.ajax({
|
|
async:'false',
|
|
type: 'post',
|
|
url: 'get_form_name.php',
|
|
data: {
|
|
item_id: treatment_item_id,
|
|
appointment_id: appointment_id
|
|
},
|
|
success: function(data) {
|
|
|
|
let result_data = JSON.parse(data);
|
|
// console.log("to check is qty fixed "+ data);
|
|
let is_qty_fixed = result_data['is_qty_fixed'];
|
|
|
|
if (is_qty_fixed != null && is_qty_fixed != '' && is_qty_fixed != undefined && is_qty_fixed.toLowerCase().trim() ==
|
|
'yes') {
|
|
$("#treatment_item_total_" + counter).val(1);
|
|
$("#treatment_item_total_div" + counter).html(1);
|
|
|
|
if($("#treatment_item_qtygvn_"+counter).val() =='0' || $("#treatment_item_qtygvn_"+counter).val() == ''){
|
|
<?php if ($_SESSION["RoleCode"] != 'DOC') { ?>
|
|
$("#treatment_item_qtygvn_" + counter).val(1);
|
|
<?php } ?>
|
|
}
|
|
} else {
|
|
frequency_qty = parseFloat($("#" + frequency_qty_fieild).val());
|
|
treatment_item_days = parseInt($("#" + treatment_item_days_fieild).val());
|
|
if (treatment_item_days == null || treatment_item_days == '' || treatment_item_days == 0) {
|
|
treatment_item_days = 1;
|
|
}
|
|
var dose_qty = $("#dose_qty_" + counter).val();
|
|
// if someone changing dose manually than do this also to get right result
|
|
if(frequency_qty != dose_qty){
|
|
frequency_qty = dose_qty;
|
|
}
|
|
$("#treatment_item_total_" + counter).val(treatment_item_days * frequency_qty);
|
|
// console.log("total value " + treatment_item_days * frequency_qty);
|
|
$("#treatment_item_total_div" + counter).html(treatment_item_days * frequency_qty);
|
|
|
|
// if($("#treatment_item_qtygvn_"+counter).val() =='0' || $("#treatment_item_qtygvn_"+counter).val() == ''){
|
|
|
|
avl_qty = parseInt($("#current_stock_div" + counter).text().split(" ")[0]);
|
|
if (avl_qty == undefined || avl_qty == '' || avl_qty == null || isNaN(avl_qty)) {
|
|
// no need to populate issued qty automatic
|
|
}else{
|
|
|
|
if('<?=$row['medi_disbursement']?>' != 'Y'){
|
|
<?php if ($_SESSION["RoleCode"] != 'DOC') { ?>
|
|
$("#treatment_item_qtygvn_" + counter).val(treatment_item_days * frequency_qty);
|
|
<?php } ?>
|
|
}
|
|
}
|
|
// }
|
|
|
|
}
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
var flagReload = 1;
|
|
|
|
|
|
|
|
var itemOptionsDis = "";
|
|
var itemOptionsDoc = "";
|
|
var itemDosage_categories = "";
|
|
var groupItems = <?php echo json_encode(getGroupItemsList()); ?>;
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
itemOptionsDis =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(item_code,' '),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' and is_prescription!='1' order by item_name", '', 'item_id', 'item_name', '', '') ?>";
|
|
itemOptionsDoc =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(item_name)) AS item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' order by item_name", '', 'item_id', 'item_name', '', ''); ?>";
|
|
var appointment_id = "<?php echo $row['appointment_id'] ?>";
|
|
itemDosage_categories =
|
|
"<?php echo generateOption('dosage_category', 'dosage_category', 'dosage_category_id', '', ''); ?>";
|
|
|
|
getMedicine();
|
|
$('.chosen-select').chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
//resize the chosen on window resize
|
|
|
|
$(window)
|
|
.off('resize.chosen')
|
|
.on('resize.chosen', function() {
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
// $this.next().css({'width': '200px'});
|
|
})
|
|
}).trigger('resize.chosen');
|
|
//resize chosen on sidebar collapse/expand
|
|
$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
|
|
if (event_name != 'sidebar_collapsed') return;
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
//$this.next().css({'width': '200px'});
|
|
})
|
|
});
|
|
});
|
|
|
|
function setDoctorDiscussed(discussedVal) {
|
|
var counterT = $("#count_treatment_item").val();
|
|
var doctorDiscussed = $('input[name=doctor_discussed]:checked').val();
|
|
var itemOptions = "";
|
|
|
|
for (var i = 0; i < counterT; i++) {
|
|
$('#treatment_item_td_' + i).html('')
|
|
if (rolecode != 'DOC' && doctorDiscussed != 'Y') {
|
|
itemOptions = itemOptionsDis;
|
|
} else {
|
|
itemOptions = itemOptionsDoc;
|
|
}
|
|
var select_treatment = "";
|
|
select_treatment += "<select onchange=\"getAvailableQty(this.value," + i +
|
|
",'');getItemDetails(this.value,'current_stock" + "_" + i +
|
|
"','current_stock_div" + i + "','" + appointment_id + "', '" + i +
|
|
"');\" class='chosen-select form-control'";
|
|
select_treatment += "id=\"treatment_item" + "_" + i + "\"name=\"treatment_item" + i +
|
|
"\"data-placeholder=\"Treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
$('#treatment_item_td_' + i).html(select_treatment);
|
|
$('#treatment_item_' + i).chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
$('#treatment_item_' + i).next().css({
|
|
'width': '200px'
|
|
});
|
|
|
|
|
|
}
|
|
|
|
$("#doc_discuss_div").toggle();
|
|
}
|
|
|
|
function validate_update(formId, appointment_id) {
|
|
var appointment_date = $('#appointment_date' + appointment_id).val();
|
|
if (appointment_date == '') {
|
|
BootstrapDialog.alert('Please Enter Appointment Date.!!!');
|
|
return false;
|
|
}
|
|
var complaints = $('#complaints' + appointment_id).val();
|
|
if (complaints == '') {
|
|
BootstrapDialog.alert('Please Enter Complaints.!!!');
|
|
return false;
|
|
}
|
|
update_appointment(formId, appointment_id);
|
|
}
|
|
|
|
function update_appointment(formId, appointment_id) {
|
|
$("#save_button").hide();
|
|
$("#abnormalitys").val($('#abnormality').val());
|
|
$.ajax({
|
|
url: 'save_opd.php',
|
|
type: "POST",
|
|
data: $("#" + formId).serialize(),
|
|
success: function(data) {
|
|
|
|
//BootstrapDialog.alert('Details Updated Successfully.');
|
|
//window.location = 'employee_appointment_form.php?appointmentId='+appointmentId+' ';
|
|
//
|
|
BootstrapDialog.show({
|
|
message: 'Details Updated Successfully.',
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function(dialogItself) {
|
|
dialogItself.close();
|
|
//window.location.reload();
|
|
}
|
|
}, {
|
|
label: 'Cancel',
|
|
action: function() {
|
|
$(".modal-header .close").click();
|
|
}
|
|
}]
|
|
});
|
|
|
|
|
|
|
|
|
|
//window.location.reload();
|
|
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Updating Details');
|
|
return;
|
|
}
|
|
});
|
|
//window.location.reload();
|
|
}
|
|
|
|
function setFieldDisableOrEnable(value) {
|
|
// alert(value);
|
|
var count = $("#count_treatment_item").val();
|
|
if (value == 'N') {
|
|
// $("[name='field07']").prop("disabled", false);
|
|
for (var i = 0; i < count; i++) {
|
|
$("#treatment_item_qtygvn_" + i).prop("disabled", false);
|
|
}
|
|
} else if (value == 'Y') {
|
|
|
|
for (var i = 0; i < count; i++) {
|
|
$("#treatment_item_qtygvn_" + i).prop("disabled", true);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function checkQty() {
|
|
var total_item = $("#count_treatment_item").val();
|
|
// alert(total_item);
|
|
for (var i = 0; i < total_item; i++) {
|
|
var item_id = $("#treatment_item_" + i).val();
|
|
var issue_qty = $("#treatment_item_qtygvn_" + i).val();
|
|
if (issue_qty == null || issue_qty == '') {
|
|
issue_qty = 0;
|
|
}
|
|
if (item_id == undefined || issue_qty == undefined) continue;
|
|
|
|
if (issue_qty < 0) {
|
|
BootstrapDialog.alert("Negative values are not allowed!!!");
|
|
$("#treatment_item_qtygvn_" + i).val("");
|
|
return false;
|
|
}
|
|
var avl_qty = $("#current_stock_" + i).val();
|
|
// alert("avl qty "+avl_qty);
|
|
if (avl_qty == undefined || avl_qty == '' || avl_qty == null || isNaN(avl_qty)) {
|
|
avl_qty = parseInt($("#current_stock_div" + i).text().split(" ")[0]);
|
|
if (avl_qty == undefined || avl_qty == '' || avl_qty == null || isNaN(avl_qty)) {
|
|
avl_qty = 0;
|
|
}
|
|
}
|
|
// alert("avl qty "+avl_qty);
|
|
$.ajax({
|
|
type: 'post',
|
|
async: false,
|
|
url: 'get_prev_issue_qty.php',
|
|
data: {
|
|
item_id: item_id,
|
|
appointment_id: appointment_id
|
|
},
|
|
success: function(data) {
|
|
let pre_issue = JSON.parse(data);
|
|
if (pre_issue == null || pre_issue == '') pre_issue = 0;
|
|
if (eval(avl_qty) + eval(pre_issue) < issue_qty) {
|
|
// alert(eval(avl_qty)+eval(pre_issue));
|
|
BootstrapDialog.alert('Issue quantity can not be greater than available quantity.!!!');
|
|
$("#treatment_item_qtygvn_" + i).val("");
|
|
return false;
|
|
}
|
|
},
|
|
error: function(data) {
|
|
console.log("Something went wrong in fetching the previous itme qty for checking")
|
|
}
|
|
});
|
|
// }
|
|
}
|
|
}
|
|
|
|
function toCheckItemStock() {
|
|
|
|
var counter = $("#count_treatment_item").val();
|
|
for (var i = 0; i < counter; i++) {
|
|
var treatment_qty = $("#treatment_item_total_" + i).val();
|
|
var issued_qty = $("#treatment_item_qtygvn_" + i).val();
|
|
if (issued_qty == null || issued_qty == '') {
|
|
issued_qty = 0;
|
|
}
|
|
/* if(issued_qty>treatment_qty){
|
|
BootstrapDialog.alert(' Issue Qty should be less than or equal to Treatment Qty .!!!');
|
|
|
|
return false;
|
|
}*/
|
|
}
|
|
|
|
}
|
|
|
|
function validate_template(formId) {
|
|
$("#save_button").hide();
|
|
|
|
$.ajax({
|
|
url: 'save_opd_template.php',
|
|
type: "POST",
|
|
data: $("#opd_form").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.show({
|
|
message: 'Details Updated Successfully.',
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function(dialogItself) {
|
|
dialogItself.close();
|
|
|
|
}
|
|
}, {
|
|
label: 'Cancel',
|
|
action: function() {
|
|
$(".modal-header .close").click();
|
|
}
|
|
}]
|
|
});
|
|
|
|
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Templates Details');
|
|
return;
|
|
}
|
|
});
|
|
//window.location.reload();
|
|
}
|
|
|
|
// Save & Update
|
|
function validate() {
|
|
var appointment_date = $('#appointment_date').val();
|
|
if (appointment_date == '') {
|
|
BootstrapDialog.alert('Please Enter Appointment Name.!!!');
|
|
return false;
|
|
}
|
|
var complaints = $('#complaints').val();
|
|
if (complaints == '') {
|
|
BootstrapDialog.alert('Please Enter Complaints.!!!');
|
|
return false;
|
|
}
|
|
save_appointment();
|
|
}
|
|
|
|
function save_appointment() {
|
|
$.ajax({
|
|
url: 'save_opd.php',
|
|
type: "POST",
|
|
data: $("#opd_form").serialize(),
|
|
success: function(data) {
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
if (data.appointment_id != null) {
|
|
$("#appointment_id").val(data.appointment_id);
|
|
$("#appointment_id_pdf").val(data.appointment_id);
|
|
}
|
|
|
|
BootstrapDialog.alert('Details Saved Successfully.');
|
|
//loadAppointmentHistory('<?php echo $_REQUEST['flex_opd_id'] ?>');
|
|
//return;
|
|
window.location.reload();
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Details');
|
|
//return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Handle Free Entry Tag boxes for OPD and Injury forms
|
|
|
|
*/
|
|
//Entry is allowed only for Doctors and Dispensary if in case not already updated by Doctor
|
|
|
|
<?php if ($rolecode != 'DOC' && $row['doctor_attended_flag'] == 'Y') { ?>
|
|
$('#ailment_system_new').prop('readonly', true);
|
|
|
|
// $('#ailment_new').prop('readonly', true);
|
|
// $('#complaints').prop('readonly', true);
|
|
|
|
|
|
<?php
|
|
$diagnosis_config = getFieldFromTable('value','config','key_name','diagnosis_tag_switch');
|
|
error_log("diagnosis tag switch in opd injury common code ".$diagnosis_config);
|
|
if(!strcmp(strtolower($diagnosis_config) ,"true")){
|
|
$ailment_names = explode(',', $row['ailments_new']);?>
|
|
$('#ailment_new').val(
|
|
"<?php foreach ($ailment_names as $ailment_name) { echo strtoupper(getTableFieldValue('ailment','ailment_name','ailment_id',$ailment_name)); }?>"
|
|
).prop('readonly', true);
|
|
<?php } ?>
|
|
|
|
<?php
|
|
$complaint_config = getFieldFromTable('value', 'config', 'key_name', 'complaint_tag_switch');
|
|
error_log("complaint_tag_switch tag switch in opd injury common code ".$complaint_config);
|
|
if(!strcmp(strtolower($complaint_config) ,"true")){
|
|
$complaints = explode(',', $row['complaints']);?>
|
|
$('#complaints').val(
|
|
"<?php foreach ($complaints as $complaint) { echo strtoupper( getTableFieldValue('complaints','complaint','complaint_id',$complaint)); }?>"
|
|
).prop('readonly', true);
|
|
<?php } ?>
|
|
|
|
$('#drug_allergy').prop('readonly', true);
|
|
|
|
$('#examination_remarks').prop('readonly', true);
|
|
|
|
$('#recommended_test_new').val("<?php echo $row['recommended_tests_new'] ?>").prop('readonly', true);
|
|
$('#injury_class_new').prop('readonly', true);
|
|
$('#injury_type_new').prop('readonly', true);
|
|
|
|
$('#injury_part_new').prop(
|
|
'readonly', true);
|
|
$('#health_advice_name_new').val("<?php echo $row['health_advices_new'] ?>").prop('readonly', true);
|
|
<?php } else if ($rolecode == 'DOC' || $rolecode == 'DIS' || $rolecode == 'RCP' || in_array('DIS', $Rolecodes)) { ?>
|
|
|
|
<?php if (!strcmp(strtolower($diagnosis_config), "true")) { ?>
|
|
|
|
if ($('#ailment_new')) {
|
|
var ailments = new Array();
|
|
getAilments();
|
|
|
|
function getAilments() {
|
|
$.ajax({
|
|
url: 'select_ailments.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
ailments = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Ailments');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
<?php } ?>
|
|
/*if($("#ailment_system_new")){
|
|
var ailmentSystems= new Array();
|
|
getAilmentSystems();
|
|
function getAilmentSystems(){
|
|
$.ajax({
|
|
url : 'select_ailment_systems.php',
|
|
type : "GET",
|
|
success : function(data) {
|
|
ailmentSystems = $.parseJSON(data);
|
|
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error pulling Ailment Systems');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}*/
|
|
if ($('#health_advice_name_new')) {
|
|
|
|
var healthAdvices = new Array();
|
|
getHealthAdvices();
|
|
|
|
function getHealthAdvices() {
|
|
$.ajax({
|
|
url: 'select_health_advices.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
healthAdvices = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Health Advices');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
if ($('#injury_type_new')) {
|
|
|
|
var injuryTypes = new Array();
|
|
getInjuryTypes();
|
|
|
|
function getInjuryTypes() {
|
|
$.ajax({
|
|
url: 'select_injury_types.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
injuryTypes = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Injury Types');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
/*if($('#injury_class_new')){
|
|
|
|
var injuryClasses= new Array();
|
|
getInjuryClasses();
|
|
function getInjuryClasses(){
|
|
$.ajax({
|
|
url : 'select_injury_classes.php',
|
|
type : "GET",
|
|
success : function(data) {
|
|
injuryClasses = $.parseJSON(data);
|
|
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error pulling Injury Classes');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}*/
|
|
if ($('#injury_part_new')) {
|
|
|
|
var affectedBodyParts = new Array();
|
|
getAffectedBodyParts();
|
|
|
|
function getAffectedBodyParts() {
|
|
$.ajax({
|
|
url: 'select_injury_parts.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
affectedBodyParts = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Affected body parts');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
/*
|
|
if ($('#recommended_test_new')) {
|
|
|
|
var recommendedTests = new Array();
|
|
getRecommendedTests();
|
|
|
|
function getRecommendedTests() {
|
|
$.ajax({
|
|
url: 'select_recommended_tests.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
recommendedTests = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Health Advices');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
} */
|
|
|
|
<?php if (!strcmp(strtolower($complaint_config), "true")) { ?>
|
|
if ($('#complaints')) {
|
|
|
|
var complaints = new Array();
|
|
getComplaints();
|
|
|
|
function getComplaints() {
|
|
$.ajax({
|
|
url: 'select_complaints.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
complaints = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Complaints!!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
<?php } ?>
|
|
|
|
<?php if (!strcmp(strtolower($examination_remarks_config), "true")) { ?>
|
|
if ($('#examination_remarks')) {
|
|
|
|
var findings = new Array();
|
|
getFindings();
|
|
|
|
function getFindings() {
|
|
$.ajax({
|
|
url: 'select_findings.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
findings = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Examination findings!!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
<?php } ?>
|
|
if ($('#referral')) {
|
|
|
|
var referrals = new Array();
|
|
getReferrals();
|
|
|
|
function getReferrals() {
|
|
$.ajax({
|
|
url: 'select_referrals.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
referrals = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling referrals!!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
// getMedicine();
|
|
|
|
/*if($("#ailment_system_new")){
|
|
|
|
var tag_input_ailment_systems = $('#ailment_system_new');
|
|
try{
|
|
tag_input_ailment_systems.tag(
|
|
{
|
|
placeholder:tag_input_ailment_systems.attr('placeholder'),
|
|
|
|
source:ailmentSystems
|
|
|
|
}
|
|
)
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#ailment_system_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingAilmentSystems = "<?php echo $row['ailment_systems_new'] ?>"
|
|
if(existingAilmentSystems!=undefined && existingAilmentSystems!=null && existingAilmentSystems!=''){
|
|
var existingAilmentSystemsArr =existingAilmentSystems.split(",");
|
|
jQuery.each( existingAilmentSystemsArr, function( i, val ) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
}catch(e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_ailment_systems.after('<textarea id="'+tag_input_ailment_systems.attr('id')+'" name="'+tag_input_ailment_systems.attr('name')+'" rows="3">'+tag_input_ailment_systems.val()+'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}//end ailmentSystems */
|
|
|
|
<?php if (!strcmp(strtolower($diagnosis_config), "true")) { ?>
|
|
|
|
|
|
|
|
if ($('#ailment_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_ailments = $('#ailment_new');
|
|
try {
|
|
tag_input_ailments.tag({
|
|
placeholder: tag_input_ailments.attr('placeholder'),
|
|
|
|
source: ailments,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#ailment_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
//var existingAilments = "<?php echo $row['ailments_new'] ?>"
|
|
var existingAilments =
|
|
"<?php echo getCommaSeperatedValuesForInClause('select ailment_name from ailment', 'ailment_id', $row['ailments_new']) ?>"
|
|
if (existingAilments != undefined && existingAilments != null && existingAilments !=
|
|
'') {
|
|
var existingAilmentsArr = existingAilments.split(",");
|
|
jQuery.each(existingAilmentsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
} catch (e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_ailments.after('<textarea id="' + tag_input_ailments.attr('id') + '" name="' +
|
|
tag_input_ailments.attr('name') + '" rows="3">' + tag_input_ailments.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
var y = $('#ailment_new').parents(".col-sm-3").width();
|
|
$('#ailment_new').siblings().css('width', y - 5);
|
|
|
|
|
|
}, 500);
|
|
} //end Ailments*/
|
|
|
|
<?php } ?>
|
|
|
|
/*
|
|
if ($('#recommended_test_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_advices = $('#recommended_test_new');
|
|
try {
|
|
tag_input_advices.tag({
|
|
placeholder: tag_input_advices.attr('placeholder'),
|
|
|
|
source: recommendedTests,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false,
|
|
|
|
});
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#recommended_test_new').data('tag');
|
|
var existingHealthAdvices = "<?php echo $row['recommended_tests_new'] ?>"
|
|
if (existingHealthAdvices != undefined && existingHealthAdvices != null &&
|
|
existingHealthAdvices != '') {
|
|
var existingHealthAdvicesArr = existingHealthAdvices.split(",");
|
|
jQuery.each(existingHealthAdvicesArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
} catch (e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_advices.after('<textarea id="' + tag_input_advices.attr('id') + '" name="' +
|
|
tag_input_advices.attr('name') + '" rows="3">' + tag_input_advices.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end tests */
|
|
|
|
<?php if (!strcmp(strtolower($complaint_config), "true")) { ?>
|
|
|
|
if ($('#complaints')) {
|
|
setTimeout(function() {
|
|
|
|
var tag_input_complaints = $('#complaints');
|
|
try {
|
|
tag_input_complaints.tag({
|
|
placeholder: tag_input_complaints.attr('placeholder'),
|
|
|
|
source: complaints,
|
|
trimValue: true,
|
|
allowDuplicates: false
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#complaints').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingComplaints = "<?php echo getCommaSeperatedValuesForInClause('select complaint from complaints','complaint_id',$row['complaints'])?>"
|
|
if (existingComplaints != undefined && existingComplaints != null &&
|
|
existingComplaints != '') {
|
|
var existingComplaintsArr = existingComplaints.split(",");
|
|
jQuery.each(existingComplaintsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
} catch (e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_complaints.after('<textarea id="' + tag_input_complaints.attr('id') +
|
|
'" name="' + tag_input_complaints.attr('name') + '" rows="3">' +
|
|
tag_input_complaints.val() + '</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
var y = $('#complaints').parents(".col-sm-3").width();
|
|
$('#complaints').siblings().css('width', y - 5);
|
|
}, 500);
|
|
}
|
|
<?php } ?>
|
|
<?php if (!strcmp(strtolower($examination_remarks_config), "true")) { ?>
|
|
if ($('#examination_remarks')) {
|
|
setTimeout(function() {
|
|
|
|
var tag_input_findings = $('#examination_remarks');
|
|
try {
|
|
tag_input_findings.tag({
|
|
placeholder: tag_input_findings.attr('placeholder'),
|
|
|
|
source: findings,
|
|
// tagClass: 'bigTag',
|
|
// trimValue: true,
|
|
// allowDuplicates: false
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#examination_remarks').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingFindings =
|
|
"<?php echo getCommaSeperatedValuesForInClause('select examination_finding from examination_findings', 'id', $row['examination_remarks']) ?>"
|
|
if (existingFindings != undefined && existingFindings != null && existingFindings !=
|
|
'') {
|
|
var existingFindingsArr = existingFindings.split(",");
|
|
jQuery.each(existingFindingsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
} catch (e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_findings.after('<textarea id="' + tag_input_findings.attr('id') + '" name="' +
|
|
tag_input_findings.attr('name') + '" rows="3">' + tag_input_findings.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
|
|
var y = $('#examination_remarks').parents(".col-sm-3").width();
|
|
$('#examination_remarks').siblings().css('width', y - 5);
|
|
|
|
|
|
}, 500);
|
|
}
|
|
|
|
<?php } ?>
|
|
if ($('#referral')) {
|
|
setTimeout(function() {
|
|
|
|
var tag_input_referrals = $('#referral');
|
|
try {
|
|
tag_input_referrals.tag({
|
|
placeholder: tag_input_referrals.attr('placeholder'),
|
|
|
|
source: referrals
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#referral').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingReferrals =
|
|
"<?php echo getCommaSeperatedValuesForInClause('select referral_point_name from referral_point', 'referral_point_id', $row['referral']) ?>"
|
|
if (existingReferrals != undefined && existingReferrals != null && existingReferrals !=
|
|
'') {
|
|
var existingReferralsArr = existingReferrals.split(",");
|
|
jQuery.each(existingReferralsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
} catch (e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_referrals.after('<textarea id="' + tag_input_referrals.attr('id') +
|
|
'" name="' + tag_input_referrals.attr('name') + '" rows="3">' +
|
|
tag_input_referrals.val() + '</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
|
|
var y = $('#referral').parents(".col-sm-4").width();
|
|
$('#referral').siblings().css('width', y - 5);
|
|
}, 500);
|
|
}
|
|
|
|
|
|
/*if($('#injury_class_new')){
|
|
var tag_input_classes = $('#injury_class_new');
|
|
try{
|
|
tag_input_classes.tag(
|
|
{
|
|
placeholder:tag_input_classes.attr('placeholder'),
|
|
|
|
source:injuryClasses
|
|
|
|
}
|
|
)
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#injury_class_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingClasses = "<?php echo $row['injury_classes_new'] ?>"
|
|
if(existingClasses!=undefined && existingClasses!=null && existingClasses!=''){
|
|
var existingClassesArr =existingClasses.split(",");
|
|
jQuery.each( existingClassesArr, function( i, val ) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
}catch(e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_classes.after('<textarea id="'+tag_input_classes.attr('id')+'" name="'+tag_input_classes.attr('name')+'" rows="3">'+tag_input_classes.val()+'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}//end injury parts*/
|
|
|
|
|
|
/*if($('#injury_type_new')){
|
|
var tag_input_types = $('#injury_type_new');
|
|
try{
|
|
tag_input_types.tag(
|
|
{
|
|
placeholder:tag_input_types.attr('placeholder'),
|
|
|
|
source:injuryTypes
|
|
|
|
}
|
|
)
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#injury_type_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingTypes = "<?php echo $row['injury_types_new'] ?>"
|
|
if(existingTypes!=undefined && existingTypes!=null && existingTypes!=''){
|
|
var existingTypesArr =existingTypes.split(",");
|
|
jQuery.each( existingTypesArr, function( i, val ) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
}catch(e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_types.after('<textarea id="'+tag_input_types.attr('id')+'" name="'+tag_input_types.attr('name')+'" rows="3">'+tag_input_types.val()+'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}//end injury Types*/
|
|
|
|
|
|
if ($('#injury_part_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_parts = $('#injury_part_new');
|
|
try {
|
|
tag_input_parts.tag({
|
|
placeholder: tag_input_parts.attr('placeholder'),
|
|
|
|
source: affectedBodyParts
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#injury_part_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingParts = "<?php echo $row['injury_parts_new'] ?>"
|
|
if (existingParts != undefined && existingParts != null && existingParts != '') {
|
|
var existingPartsArr = existingParts.split(",");
|
|
jQuery.each(existingPartsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
} catch (e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_parts.after('<textarea id="' + tag_input_parts.attr('id') + '" name="' +
|
|
tag_input_parts.attr('name') + '" rows="3">' + tag_input_parts.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end injury parts
|
|
if ($('#health_advice_name_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_advices = $('#health_advice_name_new');
|
|
try {
|
|
tag_input_advices.tag({
|
|
placeholder: tag_input_advices.attr('placeholder'),
|
|
|
|
source: healthAdvices,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false,
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#health_advice_name_new').data('tag');
|
|
var existingHealthAdvices = "<?php echo $row['health_advices_new'] ?>"
|
|
if (existingHealthAdvices != undefined && existingHealthAdvices != null &&
|
|
existingHealthAdvices != '') {
|
|
var existingHealthAdvicesArr = existingHealthAdvices.split(",");
|
|
jQuery.each(existingHealthAdvicesArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//var index = $tag_obj.inValues('some tag');
|
|
// $tag_obj.remove(index);
|
|
} catch (e) {
|
|
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
|
|
tag_input_advices.after('<textarea id="' + tag_input_advices.attr('id') + '" name="' +
|
|
tag_input_advices.attr('name') + '" rows="3">' + tag_input_advices.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end health advices
|
|
|
|
});
|
|
<?php } ?>
|
|
|
|
function openGroup(item_id_counter) {
|
|
var content = "";
|
|
var footerContent = "";
|
|
item_id = $("#treatment_item_" + item_id_counter).val();
|
|
$.ajax({
|
|
url: 'select_group_item.php?item_id=' + item_id + ' ',
|
|
type: 'POST',
|
|
success: function(data) {
|
|
data = $.parseJSON(data);
|
|
for (var i = 0; i < data.length; i++) {
|
|
childItem = data[i];
|
|
$("#group_item_name").html(childItem.item_name);
|
|
content += "<div class='row'>";
|
|
content += "<div class='col-md-12'>";
|
|
|
|
content += "<div class='col-md-6'>";
|
|
content += childItem.child_item_name;
|
|
content += "</div>";
|
|
content += "<div class='col-md-6'>";
|
|
content += "<div class='input-group'>";
|
|
content += "<input type='hidden' class='form-control' id='child_item_" + item_id_counter +
|
|
"_" + i + "' name='child_item_" + item_id_counter + "_" + i + "' value='" + childItem
|
|
.item_id + "'>";
|
|
if ($("#child_item_qty_gvn" + item_id_counter + "_" + i) != undefined && $(
|
|
"#child_item_qty_gvn" + item_id_counter + "_" + i).val() != undefined) {
|
|
content += "<input type='number' class='form-control' id='child_item_qty_gvn" +
|
|
item_id_counter + "_" + i + "' name='child_item_qty_gvn" + item_id_counter + "_" +
|
|
i + "' value='" + $("#child_item_qty_gvn" + item_id_counter + "_" + i).val() + "'>";
|
|
} else {
|
|
content += "<input type='number' class='form-control' id='child_item_qty_gvn" +
|
|
item_id_counter + "_" + i + "' name='child_item_qty_gvn" + item_id_counter + "_" +
|
|
i + "' value='" + childItem.qty + "'>";
|
|
}
|
|
content +=
|
|
"<span class='input-group-addon' style='font-size:8px; margin:1px;padding:1px;'>" +
|
|
unitMap[childItem.unit_id] + "</span>";
|
|
content += "</div>";
|
|
content += "</div>";
|
|
content += "</div>";
|
|
content += "</div>";
|
|
}
|
|
if (data.length > 0) {
|
|
footerContent += " <div><button type=\"button\" onclick=\"saveGroupChanges(" +
|
|
item_id_counter + "," + data.length + ")\" "
|
|
footerContent += " class=\"btn btn-primary\">Save Changes</button>";
|
|
footerContent += " </div>";
|
|
|
|
|
|
}
|
|
$("#group_item_details").html(content);
|
|
$("#group_item_details").append(footerContent);
|
|
$('#modal_group_item_pop').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Sickness');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
// loading treatment dynamically acc to already present prescription
|
|
function loadMedData() {
|
|
let med_tab_count = $("#count_treatment_item").val();
|
|
let current_row_count = $('#treatmentTable tbody tr').length;
|
|
let med_arr = [];
|
|
for (var i = 0; i <= (med_tab_count + current_row_count); i++) {
|
|
if (document.getElementById("treatment_item_" + i)) {
|
|
med_arr.push($("#treatment_item_" + i).val());
|
|
}
|
|
}
|
|
|
|
$("#med-detail-table tbody").html("");
|
|
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_med_data.php',
|
|
data: {
|
|
med_arr: med_arr
|
|
},
|
|
success: function(data) {
|
|
try {
|
|
data = JSON.parse(data);
|
|
|
|
var rowData = "";
|
|
|
|
for (medId in data) {
|
|
if (data.hasOwnProperty(medId)) {
|
|
var med_detail = data[medId];
|
|
var item_name = med_detail['item_name'];
|
|
var precaution = med_detail['item_precaution'];
|
|
var alternate = med_detail['item_alternate'];
|
|
var prescription = med_detail['is_prescription'];
|
|
var composition = med_detail['composition'];
|
|
var indication = med_detail['indication'];
|
|
var contraIndication = med_detail['contraIndication'];
|
|
var effect = med_detail['effect'];
|
|
var interaction = med_detail['interaction'];
|
|
|
|
rowData +=
|
|
`<tr><td>${item_name}</td><td>${precaution}</td><td>${composition}</td><td>${indication}</td><td>${contraIndication}</td><td>${effect}</td><td>${alternate}</td><td>${prescription}</td><td>${interaction}</td></tr>`;
|
|
}
|
|
}
|
|
|
|
$("#med-detail-table").append(rowData);
|
|
if (activated == false) {
|
|
let table3 = new DataTable('#med-detail-table', {
|
|
responsive: true
|
|
});
|
|
activated = true;
|
|
}
|
|
|
|
console.log(rowData);
|
|
} catch (err) {
|
|
console.log("some error in load med function");
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
console.log("something went wrong");
|
|
}
|
|
});
|
|
}
|
|
|
|
function loadTreatment() {
|
|
document.getElementById("load-treatment-btn").style.display = 'none';
|
|
document.getElementsByClassName("loader")[0].style.display = 'block';
|
|
|
|
var diag_arr = $("#ailment_new").val();
|
|
console.log(diag_arr);
|
|
|
|
var chronic_arr = $("#abnormality").val();
|
|
console.log(chronic_arr);
|
|
|
|
$.ajax({
|
|
async: 'false',
|
|
type: 'post',
|
|
url: 'show_prescription.php',
|
|
data: {
|
|
diagnosis: diag_arr,
|
|
illness : chronic_arr
|
|
},
|
|
success: function(data) {
|
|
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (err) {
|
|
console.log("some error in loading med function " + err.name);
|
|
}
|
|
|
|
let tab_count = 0;
|
|
var health_advice_arr = [];
|
|
var med_info = [];
|
|
var drug_count = 0;
|
|
|
|
try {
|
|
for (medId in data) {
|
|
if (data.hasOwnProperty(medId)) {
|
|
var drugArr = data[medId];
|
|
med_info.push({
|
|
'drug': '',
|
|
'name': '',
|
|
'freq': '',
|
|
'freq_val': '',
|
|
'timing': '',
|
|
'admin_route': '',
|
|
'duration': '',
|
|
'dose': '',
|
|
'drug_count': '',
|
|
'is_prescription': ''
|
|
});
|
|
// console.log(drug + typeof drug);
|
|
med_info[tab_count]['drug'] = medId;
|
|
med_info[tab_count]['name'] = drugArr['name'];
|
|
med_info[tab_count]['freq'] = drugArr['frequency'];
|
|
med_info[tab_count]['freq_val'] = drugArr['freq_val'];
|
|
med_info[tab_count]['timing'] = drugArr['timing'];
|
|
med_info[tab_count]['admin_route'] = drugArr['admin_route'];
|
|
|
|
med_info[tab_count]['duration'] = drugArr['duration'];
|
|
med_info[tab_count]['dose'] = drugArr['dose'];
|
|
|
|
med_info[tab_count]['drug_count'] = drugArr['count'];
|
|
med_info[tab_count]['is_prescription'] = drugArr['is_prescription'];
|
|
|
|
drug_count = drugArr['count'];
|
|
// console.log(drugArr['health_advices']);
|
|
var health_advices = drugArr['health_advices'].split(",");
|
|
for (let y of health_advices) {
|
|
health_advice_arr.push(y);
|
|
}
|
|
}
|
|
tab_count++;
|
|
}
|
|
|
|
console.log(med_info);
|
|
|
|
var actual_rowCount = $('#treatmentTable tbody tr').length;
|
|
console.log("actual row present this moment " + actual_rowCount);
|
|
|
|
let added_row_count = $("#count_treatment_item").val();
|
|
|
|
console.log("actual row added by plus button " + added_row_count);
|
|
|
|
console.log("drug count " + drug_count);
|
|
|
|
let new_added_row_count = 0;
|
|
|
|
if (actual_rowCount < drug_count) {
|
|
while (drug_count > actual_rowCount) {
|
|
addRow(<?= $_REQUEST['appointmentId'] ?>);
|
|
actual_rowCount++;
|
|
new_added_row_count++;
|
|
}
|
|
}
|
|
// else if (actual_rowCount > drug_count) {
|
|
// while (actual_rowCount > drug_count) {
|
|
// $('#treatmentTable tbody tr:nth-last-child(1)').remove();
|
|
// actual_rowCount--;
|
|
// }
|
|
// }
|
|
|
|
var index = 0;
|
|
for (let i = 0; i <= (added_row_count + new_added_row_count); i++) {
|
|
|
|
if (document.getElementById('treatment_item_td_' + i)) {
|
|
console.log('treatment_item_td_' + i);
|
|
console.log("got here with index " + index);
|
|
var drug = med_info[index]['drug'];
|
|
var name = med_info[index]['name'];
|
|
var freq = med_info[index]['freq'];
|
|
var freq_qty = med_info[index]['freq_val'];
|
|
var timing = med_info[index]['timing'];
|
|
var admin_route = med_info[index]['admin_route'];
|
|
var duration = med_info[index]['duration'];
|
|
var dose = med_info[index]['dose'];
|
|
var is_prescription = med_info[index]['is_prescription'];
|
|
|
|
// check if this row already has a item
|
|
var isItemPresent = document.getElementById('treatment_item_' + i).value;
|
|
if((isItemPresent != null && isItemPresent !='' && isItemPresent != undefined && isItemPresent > 0 && isItemPresent != drug)){
|
|
console.log("got inside if cond because some medicines are already present in table ");
|
|
addRow(<?= $_REQUEST['appointmentId'] ?>);
|
|
actual_rowCount++;
|
|
new_added_row_count++;
|
|
continue;
|
|
}else if(isItemPresent == drug){
|
|
console.log("got inside if cond because some medicines are already present in table same as we are going to add ");
|
|
index++;
|
|
continue;
|
|
}
|
|
|
|
if (is_prescription == 1 && '<?=$_SESSION['RoleCode']?>' != 'DOC') {
|
|
isPrescribed = true;
|
|
document.getElementById('doctor_discussed_yes').checked = true;
|
|
$("#doc_discuss_div").show();
|
|
$('#treatment_item_td_' + i).html('');
|
|
var itemOptions =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(item_code,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' order by item_name", '', 'item_id', 'item_name', '', ''); ?>";
|
|
var select_treatment = "";
|
|
select_treatment +=
|
|
"<select onchange=\"getAvailableQty(this.value," + i +
|
|
",'');getItemDetails(this.value,'current_stock" + "_" + i +
|
|
"','current_stock_div" + i + "','" + appointment_id + "', '" + i +
|
|
"');\" class='chosen-select form-control'";
|
|
select_treatment += "id=\"treatment_item" + "_" + i +
|
|
"\"name=\"treatment_item" + i +
|
|
"\"data-placeholder=\"Treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
$('#treatment_item_td_' + i).html(select_treatment);
|
|
$('#treatment_item_' + i).chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
$('#treatment_item_' + i).next().css({
|
|
'width': '200px',
|
|
'border': '1px solid red',
|
|
'border-radius': '5px'
|
|
});
|
|
// $("#treatmentTable tbody tr:nth-child(" + (i) + ")").css('border', '1px solid red');
|
|
|
|
}
|
|
|
|
document.getElementById('treatment_item_' + i).value = drug;
|
|
$('#treatment_item_' + i).trigger('chosen:updated');
|
|
document.getElementById('treatment_item_dosage_' + i).value = freq;
|
|
document.getElementById('timings_' + i).value = timing;
|
|
document.getElementById('treatment_item_dosage_category_' + i).value = admin_route;
|
|
document.getElementById('treatment_item_days_' + i).value = duration;
|
|
document.getElementById('dose_qty_' + i).value = dose;
|
|
|
|
getItemDetails(drug, "current_stock_" + i, "current_stock_div" + i,
|
|
'<?= $_REQUEST['appointmentId'] ?>', i);
|
|
|
|
setItemBatchNo(drug, i, '');
|
|
|
|
|
|
if (duration == null || duration == '' || duration == 0) {
|
|
duration = 1;
|
|
}
|
|
$("#treatment_item_total_" + i).val(parseInt(duration) * (freq_qty));
|
|
$("#treatment_item_total_div" + i).html(parseInt(duration) * (freq_qty));
|
|
|
|
<?php if ($_SESSION["RoleCode"] != 'DOC') { ?>
|
|
var total_qty_gvn = parseInt(duration) * (freq_qty);
|
|
document.getElementById("treatment_item_qtygvn_" + i).value = total_qty_gvn;
|
|
console.log("total qty " + duration + " " + freq_qty + " " + dose +" id for total issue " + " treatment_item_qtygvn_" + i);
|
|
<?php } ?>
|
|
console.log("total qty " + duration + " " + freq_qty + " " + dose);
|
|
|
|
|
|
$('.select2').select2();
|
|
// $("#count_treatment_item").val(drug_count);
|
|
index++;
|
|
}
|
|
}
|
|
|
|
|
|
if ($('#health_advice_name_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_advices = $('#health_advice_name_new');
|
|
try {
|
|
tag_input_advices.tag({
|
|
placeholder: tag_input_advices.attr('placeholder'),
|
|
|
|
source: healthAdvices,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false,
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#health_advice_name_new').data('tag');
|
|
var existingHealthAdvicesArr = health_advice_arr;
|
|
// if (existingHealthAdvices != undefined && existingHealthAdvices != null &&
|
|
// existingHealthAdvices != '') {
|
|
// var existingHealthAdvicesArr = existingHealthAdvices.split(",");
|
|
jQuery.each(existingHealthAdvicesArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
// }
|
|
|
|
} catch (e) {
|
|
|
|
tag_input_advices.after('<textarea id="' + tag_input_advices.attr(
|
|
'id') + '" name="' +
|
|
tag_input_advices.attr('name') + '" rows="3">' +
|
|
tag_input_advices.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end health advices
|
|
} catch (err) {
|
|
console.log("Got some error in loading treatment function " + err.name);
|
|
} finally {
|
|
document.getElementById("load-treatment-btn").style.display = 'block';
|
|
document.getElementsByClassName("loader")[0].style.display = 'none';
|
|
removeEmptyRowsFromTable('treatmentTable');
|
|
}
|
|
},
|
|
error: function(data) {
|
|
document.getElementById("load-treatment-btn").style.display = 'block';
|
|
document.getElementsByClassName("loader")[0].style.display = 'none';
|
|
BootstrapDialog.alert("something went wrong while loading the treatment.");
|
|
}
|
|
});
|
|
|
|
removeEmptyRowsFromTable('treatmentTable');
|
|
|
|
}
|
|
|
|
|
|
function loadChronicTreatment() {
|
|
document.getElementById("load-chronic-treatment-btn").style.display = 'none';
|
|
document.getElementsByClassName("loader-chronic")[0].style.display = 'block';
|
|
|
|
var diag_arr = $("#abnormality").val();
|
|
console.log("chronic arr " + diag_arr);
|
|
|
|
var emp_id = $("#emp_id").val();
|
|
console.log("emp id " + emp_id);
|
|
|
|
var chronic_day = $("#chronic_day").val();
|
|
console.log("days ".chronic_day);
|
|
|
|
if (chronic_day != null && chronic_day != '' && chronic_day != '0') {
|
|
$.ajax({
|
|
async: 'false',
|
|
type: 'post',
|
|
url: 'show_prescription_chronic.php',
|
|
data: {
|
|
chronic: diag_arr,
|
|
emp_id: emp_id
|
|
},
|
|
success: function(data) {
|
|
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (err) {
|
|
console.log("some error in loading med function " + err.name);
|
|
}
|
|
|
|
let tab_count = 0;
|
|
var health_advice_arr = [];
|
|
const diagnosis_chronic_arr = new Set();
|
|
var med_info = [];
|
|
var drug_count = 0;
|
|
|
|
try {
|
|
for (medId in data) {
|
|
if (data.hasOwnProperty(medId)) {
|
|
var drugArr = data[medId];
|
|
med_info.push({
|
|
'drug': '',
|
|
'name': '',
|
|
'freq': '',
|
|
'freq_val': '',
|
|
'timing': '',
|
|
'admin_route': '',
|
|
'duration': '',
|
|
'dose': '',
|
|
'drug_count': '',
|
|
'is_prescription': ''
|
|
});
|
|
// console.log(drug + typeof drug);
|
|
med_info[tab_count]['drug'] = medId;
|
|
med_info[tab_count]['name'] = drugArr['name'];
|
|
med_info[tab_count]['freq'] = drugArr['frequency'];
|
|
med_info[tab_count]['freq_val'] = drugArr['freq_val'];
|
|
med_info[tab_count]['timing'] = drugArr['timing'];
|
|
med_info[tab_count]['admin_route'] = drugArr['admin_route'];
|
|
|
|
med_info[tab_count]['duration'] = drugArr['duration'];
|
|
med_info[tab_count]['dose'] = drugArr['dose'];
|
|
|
|
med_info[tab_count]['drug_count'] = drugArr['count'];
|
|
med_info[tab_count]['is_prescription'] = drugArr['is_prescription'];
|
|
|
|
drug_count = drugArr['count'];
|
|
// console.log(drugArr['health_advices']);
|
|
var health_advices = drugArr['health_advices'].split(",");
|
|
for (let y of health_advices) {
|
|
health_advice_arr.push(y);
|
|
}
|
|
var diagnosis_chronic_mapped = drugArr['diagnosis'].split(",");
|
|
for (let z of diagnosis_chronic_mapped) {
|
|
diagnosis_chronic_arr.add(z);
|
|
}
|
|
|
|
}
|
|
tab_count++;
|
|
}
|
|
|
|
console.log(diagnosis_chronic_arr);
|
|
const setToArrayDiagnosis = Array.from(diagnosis_chronic_arr);
|
|
$("#ailment_new").val(setToArrayDiagnosis);
|
|
$('#ailment_new').trigger('chosen:updated');
|
|
|
|
console.log(med_info);
|
|
|
|
var actual_rowCount = $('#treatmentTable tbody tr').length;
|
|
console.log("actual row present this moment " + actual_rowCount);
|
|
|
|
let added_row_count = $("#count_treatment_item").val();
|
|
|
|
console.log("actual row added by plus button " + added_row_count);
|
|
|
|
console.log("drug count " + drug_count);
|
|
|
|
let new_added_row_count = 0;
|
|
|
|
if (actual_rowCount < drug_count) {
|
|
while (drug_count > actual_rowCount) {
|
|
addRow(<?= $_REQUEST['appointmentId'] ?>);
|
|
actual_rowCount++;
|
|
new_added_row_count++;
|
|
}
|
|
}
|
|
// else if (actual_rowCount > drug_count) {
|
|
// while (actual_rowCount > drug_count) {
|
|
// $('#treatmentTable tbody tr:nth-last-child(1)').remove();
|
|
// actual_rowCount--;
|
|
// }
|
|
// }
|
|
|
|
var index = 0;
|
|
for (let i = 0; i <= (added_row_count + new_added_row_count); i++) {
|
|
|
|
if (document.getElementById('treatment_item_td_' + i)) {
|
|
|
|
console.log('treatment_item_td_' + i);
|
|
console.log("got here with index " + index);
|
|
var drug = med_info[index]['drug'];
|
|
var name = med_info[index]['name'];
|
|
var freq = med_info[index]['freq'];
|
|
var freq_qty = med_info[index]['freq_val'];
|
|
var timing = med_info[index]['timing'];
|
|
var admin_route = med_info[index]['admin_route'];
|
|
var duration = med_info[index]['duration'];
|
|
var dose = med_info[index]['dose'];
|
|
var is_prescription = med_info[index]['is_prescription'];
|
|
|
|
// check if this row already has a item
|
|
var isItemPresent = document.getElementById('treatment_item_' + i).value;
|
|
if((isItemPresent != null && isItemPresent !='' && isItemPresent != undefined && isItemPresent > 0 && isItemPresent != drug)){
|
|
console.log("got inside if cond because some medicines are already present in table ");
|
|
addRow(<?= $_REQUEST['appointmentId'] ?>);
|
|
actual_rowCount++;
|
|
new_added_row_count++;
|
|
continue;
|
|
}else if(isItemPresent == drug){
|
|
console.log("got inside if cond because some medicines are already present in table same as we are going to add ");
|
|
// update duration if user changed the duration only
|
|
if (duration == null || duration == '' || duration == undefined) {
|
|
document.getElementById('treatment_item_days_' + i).value = chronic_day;
|
|
} else {
|
|
document.getElementById('treatment_item_days_' + i).value = duration;
|
|
}
|
|
|
|
if (duration == null || duration == '' || duration == 0) {
|
|
if (chronic_day == null || chronic_day == '' || chronic_day == 0 ||
|
|
chronic_day == undefined) {
|
|
duration = 1;
|
|
} else {
|
|
duration = chronic_day;
|
|
}
|
|
}
|
|
|
|
document.getElementById("treatment_item_total_" + i).value = parseInt(duration) * (freq_qty);
|
|
$("#treatment_item_total_div" + i).html(parseInt(duration) * (freq_qty));
|
|
|
|
<?php if ($_SESSION["RoleCode"] != 'DOC') { ?>
|
|
var total_qty_gvn = parseInt(duration) * (freq_qty);
|
|
document.getElementById("treatment_item_qtygvn_" + i).value = total_qty_gvn;
|
|
console.log("total qty " + duration + " " + freq_qty + " " + dose +
|
|
" id for total issue " + " treatment_item_qtygvn_" + i);
|
|
<?php } ?>
|
|
|
|
index++;
|
|
continue;
|
|
}
|
|
|
|
if (is_prescription == 1 && '<?=$_SESSION['RoleCode']?>' != 'DOC') {
|
|
isPrescribed = true;
|
|
document.getElementById('doctor_discussed_yes').checked = true;
|
|
$("#doc_discuss_div").show();
|
|
$('#treatment_item_td_' + i).html('');
|
|
var itemOptions =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(item_code,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' order by item_name", '', 'item_id', 'item_name', '', ''); ?>";
|
|
var select_treatment = "";
|
|
select_treatment +=
|
|
"<select onchange=\"getAvailableQty(this.value," + i +
|
|
",'');getItemDetails(this.value,'current_stock" + "_" + i +
|
|
"','current_stock_div" + i + "','" + appointment_id + "', '" + i +
|
|
"');\" class='chosen-select form-control'";
|
|
select_treatment += "id=\"treatment_item" + "_" + i +
|
|
"\"name=\"treatment_item" + i +
|
|
"\"data-placeholder=\"Treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
$('#treatment_item_td_' + i).html(select_treatment);
|
|
$('#treatment_item_' + i).chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
$('#treatment_item_' + i).next().css({
|
|
'width': '200px',
|
|
'border': '1px solid red',
|
|
'border-radius': '5px'
|
|
});
|
|
// $("#treatmentTable tbody tr:nth-child(" + (i) + ")").css('border', '1px solid red');
|
|
|
|
}
|
|
|
|
document.getElementById('treatment_item_' + i).value = drug;
|
|
$('#treatment_item_' + i).trigger('chosen:updated');
|
|
document.getElementById('treatment_item_dosage_' + i).value = freq;
|
|
document.getElementById('timings_' + i).value = timing;
|
|
document.getElementById('treatment_item_dosage_category_' + i).value =
|
|
admin_route;
|
|
if (duration == null || duration == '' || duration == undefined) {
|
|
document.getElementById('treatment_item_days_' + i).value = chronic_day;
|
|
} else {
|
|
document.getElementById('treatment_item_days_' + i).value = duration;
|
|
}
|
|
document.getElementById('dose_qty_' + i).value = dose;
|
|
|
|
getItemDetails(drug, "current_stock_" + i, "current_stock_div" + i,
|
|
'<?= $_REQUEST['appointmentId'] ?>', i);
|
|
|
|
setItemBatchNo(drug, i, '');
|
|
|
|
|
|
if (duration == null || duration == '' || duration == 0) {
|
|
if (chronic_day == null || chronic_day == '' || chronic_day == 0 ||
|
|
chronic_day == undefined) {
|
|
duration = 1;
|
|
} else {
|
|
duration = chronic_day;
|
|
}
|
|
}
|
|
$("#treatment_item_total_" + i).val(parseInt(duration) * (freq_qty));
|
|
$("#treatment_item_total_div" + i).html(parseInt(duration) * (freq_qty));
|
|
|
|
<?php if ($_SESSION["RoleCode"] != 'DOC') { ?>
|
|
var total_qty_gvn = parseInt(duration) * (freq_qty);
|
|
document.getElementById("treatment_item_qtygvn_" + i).value = total_qty_gvn;
|
|
console.log("total qty " + duration + " " + freq_qty + " " + dose +
|
|
" id for total issue " + " treatment_item_qtygvn_" + i);
|
|
<?php } ?>
|
|
|
|
$('.select2').select2();
|
|
// $("#count_treatment_item").val(drug_count);
|
|
index++;
|
|
}
|
|
}
|
|
|
|
|
|
if ($('#health_advice_name_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_advices = $('#health_advice_name_new');
|
|
try {
|
|
tag_input_advices.tag({
|
|
placeholder: tag_input_advices.attr('placeholder'),
|
|
|
|
source: healthAdvices,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false,
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#health_advice_name_new').data('tag');
|
|
var existingHealthAdvicesArr = health_advice_arr;
|
|
// if (existingHealthAdvices != undefined && existingHealthAdvices != null &&
|
|
// existingHealthAdvices != '') {
|
|
// var existingHealthAdvicesArr = existingHealthAdvices.split(",");
|
|
jQuery.each(existingHealthAdvicesArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
// }
|
|
|
|
} catch (e) {
|
|
|
|
tag_input_advices.after('<textarea id="' + tag_input_advices.attr(
|
|
'id') + '" name="' +
|
|
tag_input_advices.attr('name') + '" rows="3">' +
|
|
tag_input_advices.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end health advices
|
|
|
|
|
|
|
|
} catch (err) {
|
|
console.log("Got some error in loading treatment function " + err.name);
|
|
} finally {
|
|
document.getElementById("load-chronic-treatment-btn").style.display = 'block';
|
|
document.getElementsByClassName("loader-chronic")[0].style.display = 'none';
|
|
removeEmptyRowsFromTable('treatmentTable');
|
|
}
|
|
},
|
|
error: function(data) {
|
|
document.getElementById("load-chronic-treatment-btn").style.display = 'block';
|
|
document.getElementsByClassName("loader-chronic")[0].style.display = 'none';
|
|
BootstrapDialog.alert("something went wrong while loading the treatment.");
|
|
}
|
|
});
|
|
|
|
removeEmptyRowsFromTable('treatmentTable');
|
|
} else {
|
|
BootstrapDialog.alert("Add Days First Than Click On Load Chronic Treatment Button..");
|
|
document.getElementById("load-chronic-treatment-btn").style.display = 'block';
|
|
document.getElementsByClassName("loader-chronic")[0].style.display = 'none';
|
|
}
|
|
}
|
|
// end
|
|
|
|
function redirectTo(redirectValue) {
|
|
if (redirectValue.trim() == 'O') {
|
|
createAndSubmitForm('edit_opd.php');
|
|
} else if (redirectValue.trim() == 'I') {
|
|
createAndSubmitForm('edit_injury.php');
|
|
}
|
|
}
|
|
|
|
function createAndSubmitForm(actionUrl) {
|
|
|
|
var dynamicForm = $('<form>', {
|
|
'id': 'task_form',
|
|
'method': 'post',
|
|
'action': actionUrl
|
|
});
|
|
|
|
var hiddenFields = [{
|
|
name: 'emp_id',
|
|
value: $("#emp_id").val()
|
|
},
|
|
{
|
|
name: 'flex_opd_id',
|
|
value: $("#emp_id").val()
|
|
},
|
|
{
|
|
name: 'returnPage',
|
|
value: 'appointment_list.php'
|
|
}
|
|
];
|
|
|
|
$.each(hiddenFields, function(index, field) {
|
|
dynamicForm.append($('<input>', {
|
|
'type': 'hidden',
|
|
'name': field.name,
|
|
'value': field.value
|
|
}));
|
|
});
|
|
|
|
|
|
$('body').append(dynamicForm);
|
|
|
|
dynamicForm.submit();
|
|
}
|
|
|
|
function removeEmptyRowsFromTable(tableId) {
|
|
console.log("cleaning function called");
|
|
var table = document.getElementById(tableId);
|
|
if (!table) {
|
|
console.error('Table with ID ' + tableId + ' not found.');
|
|
return;
|
|
}
|
|
|
|
var rows = table.rows;
|
|
for (var i = rows.length - 2; i >= 1; i--) {
|
|
var row = rows[i];
|
|
var treatmentIdInput = row.querySelector('[name^="treatment_item"]');
|
|
if(treatmentIdInput){
|
|
var treatmentId = treatmentIdInput.value;
|
|
|
|
if (treatmentId =='' && !treatmentId > 0) {
|
|
console.log("cleaning function worked");
|
|
row.remove();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function saveGroupChanges(item_id_counter, childItemCount) {
|
|
$('#group_child_flag_' + item_id_counter).val("1");
|
|
var map = new Map();
|
|
for (var i = 0; i < childItemCount; i++) {
|
|
newVal = $("#child_item_" + item_id_counter + "_" + i).val();
|
|
map.set("#child_item_" + item_id_counter + "_" + i, newVal);
|
|
|
|
newVal = $("#child_item_qty_gvn" + item_id_counter + "_" + i).val();
|
|
map.set("#child_item_qty_gvn" + item_id_counter + "_" + i, newVal);
|
|
}
|
|
$('#modal_group_item_pop').modal("hide");
|
|
var newContent = "";
|
|
|
|
for (var i = 0; i < childItemCount; i++) {
|
|
newContent += "<input type='hidden' name=\"child_item_" + item_id_counter + "_" + i + "\" id=\"child_item_" +
|
|
item_id_counter + "_" + i + "\" value=\"" + map.get("#child_item_" + item_id_counter + "_" + i) + "\">";
|
|
newContent += "<input type='hidden' name=\"child_item_qty_gvn" + item_id_counter + "_" + i +
|
|
"\" id=\"child_item_qty_gvn" + item_id_counter + "_" + i + "\" value=\"" + map.get("#child_item_qty_gvn" +
|
|
item_id_counter + "_" + i) + "\">";
|
|
}
|
|
$('#group_items_' + item_id_counter).html(newContent);
|
|
|
|
}
|
|
$(document).ready(function() {
|
|
$("input[type=text]").keyup(function() {
|
|
$(this).val($(this).val().toUpperCase());
|
|
});
|
|
$("textarea").keyup(function() {
|
|
$(this).val($(this).val().toUpperCase());
|
|
});
|
|
|
|
});
|
|
var flagReload = 0;
|
|
</script>
|
|
|
|
<?php include('group_item_pop.php'); ?>
|
|
<?php include 'support_opd_document.php' ?>
|
|
<?php include 'image_popup_opd.php' ?>
|
|
<style>
|
|
.tags .tag {
|
|
font-size: 10px;
|
|
}
|
|
</style>
|