diff --git a/application/controllers/NanoHealthController.php b/application/controllers/NanoHealthController.php
index cbdd4669..a88cb6b1 100644
--- a/application/controllers/NanoHealthController.php
+++ b/application/controllers/NanoHealthController.php
@@ -366,6 +366,12 @@ class NanoHealthController extends CI_Controller
echo $this->makeRequest('GET','/health-care-sheets/'.$id);
}
+ public function getActs()
+ {
+ echo $this->makeRequest('GET','/acts');
+ }
+
+
public function generateInvoice()
{
if($this->isLogged()) {
@@ -413,7 +419,12 @@ class NanoHealthController extends CI_Controller
return json_encode(['status' => 401]);
}
$url = NANO_SANTE_SERVICE_URL.$path;
- $ch = curl_init($url);
+ if($method == 'GET'){
+ $data = http_build_query($_POST);
+ $ch = curl_init($url."?".$data);
+ }else{
+ $ch = curl_init($url);
+ }
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
/* set the content type json */
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php
index 9ca64d2d..4e1d62c5 100755
--- a/application/language/english/message_lang.php
+++ b/application/language/english/message_lang.php
@@ -910,6 +910,6 @@ $lang['unit_value'] = "Unit value";
$lang['unit_value_required'] = "Unit value is required";
$lang['issuer_agent'] = "Issuing agent";
$lang['CONSULTATION'] = "CONSULTATION";
-$lang['EXAM'] = "EXAM";
+$lang['EXAM_OR_OTHER'] = "EXAM OR OTHER";
$lang['consultation_cannot_have_unit_price'] = "A consultation cannot have a unit price";
?>
diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php
index aae44e45..9a6d32bb 100755
--- a/application/language/french/message_lang.php
+++ b/application/language/french/message_lang.php
@@ -920,6 +920,7 @@ $lang['unit_value'] = "Valeur de l'unité";
$lang['unit_value_required'] = "La valeur de l'unité est requise";
$lang['issuer_agent'] = "Agent emetteur";
$lang['CONSULTATION'] = "CONSULTATION";
-$lang['EXAM'] = "EXAMEN";
-$lang['consultation_cannot_have_unit_price'] = "Une consultation ne peut pas avoir de prix unitaire"
+$lang['EXAM_OR_OTHER'] = "EXAMEN OU AUTRE";
+$lang['consultation_cannot_have_unit_price'] = "Une consultation ne peut pas avoir de prix unitaire";
+$lang['SUSPENDED'] = "SUSPENDU"
?>
diff --git a/application/models/Nano_health_model.php b/application/models/Nano_health_model.php
index abcb3ff7..f66dc00d 100644
--- a/application/models/Nano_health_model.php
+++ b/application/models/Nano_health_model.php
@@ -103,7 +103,7 @@ class Nano_health_model extends CI_Model
}
public function getHealthCareSheetExams($healthCareSheetId){
- return $this->db->select('e.* , a.code as act_code , a.name as act_name')
+ return $this->db->select('e.* , a.code as act_code , a.name as act_name , a.unit_value as act_unit_value')
->from('nh_exams e')->join('nh_health_care_sheets_exams se', 'e.id = se.exam_id')
->join('nh_acts a', 'a.id = e.act_id')
->where('se.sheet_id',$healthCareSheetId)->order_by('se.created_at','asc')->get();
diff --git a/application/views/nano_health/agent/health_care_sheet_consultation_form.php b/application/views/nano_health/agent/health_care_sheet_consultation_form.php
index b932a219..f7de18fe 100755
--- a/application/views/nano_health/agent/health_care_sheet_consultation_form.php
+++ b/application/views/nano_health/agent/health_care_sheet_consultation_form.php
@@ -180,7 +180,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
= $this->lang->line('exam_class'); ?> |
= $this->lang->line('exam_description'); ?> |
- = $this->lang->line('quantity'); ?> |
Actions |
@@ -268,6 +267,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
+ var acts = []
+
$(document).ready(function (){
$('#patient').hide();
$('#patient-details').hide();
@@ -299,7 +300,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$.each(insured, function (i, item) {
$('#sheet-form').find('select[name="insured_id"]').append($('`);
-
+ acts.forEach(function (a) {
+ if(type === a.type) {
+ var selected = a.id === parseInt(selectedValue) ? 'selected' : '';
+ actsOptions += (``);
+ }
+ })
return actsOptions;
}
@@ -495,6 +519,14 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
});
}
}
+
+ function autoFetchPrestationAmount(){
+ $('#act').on('change',function () {
+ let amount = $(this).find(":selected").attr('amount')
+ $("#amount").val(amount);
+ })
+ }
+
$('[data-toggle="tooltip"]').tooltip();
@@ -510,8 +542,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
var index = $("#prestations tbody tr:last-child").index();
var row = '' +
'' +
- ' | ' +
' | ' +
@@ -526,7 +558,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$('[data-toggle="tooltip"]').tooltip();
calculatePrestationsAmount();
-
+ autoFetchPrestationAmount();
});
// Add row on add button click
$(document).on("click", ".add1", function () {
@@ -560,7 +592,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(document).on("click", ".edit1", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
- $(this).html(''+ getActsOptions($(this).attr("value"))+ '');
+ $(this).html(''+ getActsOptions($(this).attr("value"),'CONSULTATION')+ '');
if (index == 1)
$(this).html('');
if (index == 2)
@@ -596,11 +628,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
var row = '
' +
'' +
'' +
- getActsOptions(null)+
+ getActsOptions(null,'EXAM_OR_OTHER')+
'' +
' | ' +
' | ' +
- ' | ' +
+ // ' | ' +
' ' + actions2 + ' | ' +
'
';
$("#exams").append(row);
@@ -639,11 +671,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(document).on("click", ".edit2", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
- $(this).html(''+ getActsOptions($(this).attr("value"))+ '');
+ $(this).html(''+ getActsOptions($(this).attr("value"),'EXAM_OR_OTHER')+ '');
if (index == 1)
$(this).html('');
- if (index == 2)
- $(this).html('');
+ // if (index == 2)
+ // $(this).html('');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new2").attr("disabled", "disabled");
diff --git a/application/views/nano_health/agent/health_care_sheet_execution_form.php b/application/views/nano_health/agent/health_care_sheet_execution_form.php
index 1c465cd7..6701bc1e 100755
--- a/application/views/nano_health/agent/health_care_sheet_execution_form.php
+++ b/application/views/nano_health/agent/health_care_sheet_execution_form.php
@@ -228,7 +228,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$('#sheet-form').find('select[name="insured_id"]').append($('