From d2d77e77852e84e3b513f364c5086fe13f38663f Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Fri, 8 Apr 2022 11:01:46 +0100 Subject: [PATCH] Update health care sheets infos table --- .../controllers/NanoHealthController.php | 13 ++- application/language/english/message_lang.php | 2 +- application/language/french/message_lang.php | 5 +- application/models/Nano_health_model.php | 2 +- .../health_care_sheet_consultation_form.php | 80 +++++++++++++------ .../health_care_sheet_execution_form.php | 6 +- ...th_care_sheet_update_consultation_form.php | 6 +- ...ealth_care_sheet_update_execution_form.php | 6 +- .../nano_health/hyper/gestion_wallet.php | 33 +++++--- .../hyper/infos_health_care_sheet.php | 12 +-- 10 files changed, 112 insertions(+), 53 deletions(-) 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); lang->line('exam_class'); ?> lang->line('exam_description'); ?> - 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 = '' + '' + - '' + + getActsOptions(null,'CONSULTATION')+ '' + '' + '' + @@ -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(''); + $(this).html(''); if (index == 1) $(this).html(''); if (index == 2) @@ -596,11 +628,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); var row = '' + '' + '' + '' + '' + - '' + + // '' + ' ' + 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(''); + $(this).html(''); 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($('', { label: 'Ayants droits', @@ -237,7 +238,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); $('#sheet-form').find('select[name="insured_id"]').append($('', { label: 'Ayants droits', @@ -325,7 +326,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); $('#sheet-form').find('select[name="insured_id"]').append($('', { label: 'Ayants droits', @@ -215,7 +216,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); $('#sheet-form').find('select[name="insured_id"]').append($('