diff --git a/application/controllers/NanoHealthController.php b/application/controllers/NanoHealthController.php index b56224dc..ca71d4b8 100644 --- a/application/controllers/NanoHealthController.php +++ b/application/controllers/NanoHealthController.php @@ -270,6 +270,40 @@ class NanoHealthController extends CI_Controller } } + public function resubmitHealthCareSheet(){ + if($this->isLogged()) { + if (isset($_POST)) { + $url = NANO_SANTE_SERVICE_URL.'/health-care-sheets'; + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); + /* set the content type json */ + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type:application/json', + 'Authorization:'.NANO_SANTE_SERVICE_TOKEN, + 'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en' + )); + /* set return type json */ + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $body = new \stdClass(); + $body->health_care_sheet_id = $this->input->post('health_care_sheet_id'); + $body->user_id = $this->input->post('user_id'); + $body->action = 'RESUBMIT'; + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); + + /* execute request */ + $result = curl_exec($ch); + /* close cURL resource */ + curl_close($ch); + + if ($result) { + echo $result; + } else { + echo json_encode(['status' => 500]); + } + } + } + } + private function isLogged() { diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 7f8b0b23..2aa00df6 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -815,5 +815,9 @@ $lang['exam_class'] = "Exam class"; $lang['quantity'] = "Quantity"; $lang['medical_prescriptions'] = "Medical prescriptions"; $lang['dosage'] = "Dosage"; -$lang['drugs_or_device'] = "Drug / Device" +$lang['drugs_or_device'] = "Drug / Device"; +$lang['resubmit'] = "Resubmit"; +$lang['subscription_resubmitted'] = "The subscription has been resubmitted"; +$lang['insurance_part'] = "Insurance share"; +$lang['insurance_part'] = "Insurance share"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 8a757e30..bc451169 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -815,7 +815,7 @@ $lang['practitioner'] = "Praticien"; $lang['accident_date'] = "Date de l'accident"; $lang['pregnancy_start_at'] = "Date de debut de la grossesse"; $lang['pregnancy_end_at'] = "Date de fin de la grossesse"; -$lang['performances'] = "Prescriptions"; +$lang['performances'] = "Prestations"; $lang['moderator_ticket'] = "Ticket modérateur"; $lang['home_visit_fees'] = "Frais de déplacement à domicile"; $lang['act'] = "Acte"; @@ -826,5 +826,9 @@ $lang['exam_class'] = "Classe de l'examen"; $lang['quantity'] = "Quantité"; $lang['medical_prescriptions'] = "Prescriptions médicales"; $lang['dosage'] = "Posologie"; -$lang['drugs_or_device'] = "Médicament / Appareillage" +$lang['drugs_or_device'] = "Médicament / Appareillage"; +$lang['resubmit'] = "Resoumettre"; +$lang['subscription_resubmitted'] = "La souscription a été re-soumise"; +$lang['insurance_part'] = "Part de l'assurance"; +$lang['insurance_part'] = "Part de l'assurance"; ?> diff --git a/application/views/nano_health/hyper/infos_health_care_sheet.php b/application/views/nano_health/hyper/infos_health_care_sheet.php index 4898d929..0f5a1ce5 100755 --- a/application/views/nano_health/hyper/infos_health_care_sheet.php +++ b/application/views/nano_health/hyper/infos_health_care_sheet.php @@ -15,6 +15,14 @@