function alert_ebene(p_msg, p_msg_eng) { codeLangue = $("#codeLangue").val(); if(codeLangue=="en_US") { alert(p_msg_eng); } else { alert(p_msg); } } function alert_ebene_ajax(p_msg, p_msg_eng) { codeLangue = $("#codeLangue").val(); if(codeLangue=="en_US") { alert(p_msg_eng); } else { alert(p_msg); } } function confirm_ebene(p_msg, p_msg_eng) { codeLangue = $("#codeLangue").val(); if(codeLangue=="en_US") { return confirm(p_msg_eng); } else { return confirm(p_msg); } } function prompt_ebene(p_msg, p_msg_eng, p_retour) { codeLangue = $("#codeLangue").val(); if(codeLangue=="en_US") { return prompt(p_msg_eng, p_retour); } else { return prompt(p_msg, p_retour); } } var p_destinataires=""; var p_message=""; function adherents_police() { if ($("#idPolice_C" ).val()>"") { window.location.assign($("#racineWeb" ).val()+"Listeadherent/"); } } $.prototype.enable = function () { $.each(this, function (index, el) { $(el).removeAttr('disabled'); }); } $.prototype.disable = function () { $.each(this, function (index, el) { $(el).attr('disabled', 'disabled'); }); } $.prototype.unreadable = function () { $.each(this, function (index, el) { $(el).attr('READONLY', 'READONLY'); }); } $.prototype.readable = function () { $.each(this, function (index, el) { $(el).removeAttr('READONLY'); }); } Date.estAnneeBissextile = function (annee) { return (((annee % 4 === 0) && (annee % 100 !== 0)) || (annee % 400 === 0)); }; Date.getDaysInMonth = function (annee, month) { return [31, (Date.estAnneeBissextile(annee) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; }; Date.prototype.estAnneeBissextile = function () { return Date.estAnneeBissextile(this.getFullYear()); }; Date.prototype.getDaysInMonth = function () { return Date.getDaysInMonth(this.getFullYear(), this.getMonth()); }; Date.prototype.addMonths = function (value) { var n = this.getDate(); this.setDate(1); this.setMonth(this.getMonth() + value); this.setDate(Math.min(n, this.getDaysInMonth())); this.setDate(this.getDate()-1); return this; }; $( ".datepicker" ).datepicker({ inline: true, changeMonth: true, changeYear: true, yearRange: "c-60:c+20" }); /*les fonctions courantes et globales */ function get_age(dater) { var td2 = $("#datejourfr_C").datepicker("getDate"); return age = td2.getFullYear()-dater.getFullYear(); } // function controle_age(dater, codeLienParente, controle) function controle_age(dater, codeLienParente) { age = get_age(dater); $("#agepersonne").val("Âge : "+age); if (age>65) { v_msg="Âge "+age+" supérieur à 65 ans!"; v_msgEng="Age "+age+" over 65!"; alert_ebene(v_msg, v_msgEng); return false; } if ( (codeLienParente=="E")&& (age>21) ) { v_msg="Âge "+age+" => Enfant âgé de plus de 21 ans!"; v_msgEng="Âge "+age+" => Child over 21 years old!"; alert_ebene(v_msg, v_msgEng); return false; } if ( (codeLienParente=="O")&& (age>21) ) { v_msg="Âge "+age+" => Enfant âgé de plus de 21 ans!"; v_msgEng="Âge "+age+" => Child over 21 years old!"; alert_ebene(v_msg, v_msgEng); return false; } return true; } /* Début JS client */ function selectionner_client(id,no) { $("#idClient_C").val(id); $("#numeroClient_C").val(no); $("#nomClient_C").val(""); } function selectionner_client_d(id,no) { $("#idClient_d_C").val(id); $("#numeroClient_d_C").val(no); $("#nomClient_d_C").val(""); } function afficher_client_id() { idClient=$("#idClient_C" ).val(); if (idClient>"") { ajax_context_client_afficher(idClient); } } function afficher_client_d_id() { idClient=$("#idClient_d_C" ).val(); if (idClient>"") { ajax_context_client_d_afficher(idClient); } } /* Fin JS client */ /* Début JS police */ function selectionner_police(id,no) { $("#idPolice_C" ).val(id); $("#numeroPolice_C" ).val(no); } function selectionner_police_d(id,no) { $("#idPolice_d_C" ).val(id); $("#numeroPolice_d_C" ).val(no); } function afficher_police_id() { idPolice=$("#idPolice_C" ).val(); if (idPolice>"") { ajax_context_police_afficher(idPolice); } } function afficher_police_d_id() { idPolice=$("#idPolice_d_C" ).val(); if (idPolice>"") { ajax_context_police_d_afficher(idPolice); } } /* Fin JS client */ /* Début JS adherent */ function selectionner_adherent(id,no) { $("#idAdherent_C" ).val(id); $("#numeroAdherent_C" ).val(no); } function afficher_adherent() { if ($("#numeroAdherent_C" ).val()>"") { window.location.assign($("#racineWeb" ).val()+"Ficheadherent/"+$("#numeroAdherent_C" ).val()+"/"); } } function afficher_adherent_id() { if ($("#idAdherent_C" ).val()>"") { window.location.assign($("#racineWeb" ).val()+"Ficheadherent/"+$("#idAdherent_C" ).val()+"/"); } } /* Fin JS adherent */ /* Début JS bénéficiare */ function selectionner_beneficiaire(id,no) { $("#idBeneficiaire_C").val(id); $("#numeroBeneficiaire_C" ).val(no); } function afficher_beneficiaire_id() { idBeneficiaire=$("#idBeneficiaire_C").val(); okId=$("#okId").val(); okId_face=$("#okId_face").val(); if (idBeneficiaire>"") { ajax_context_beneficiaire_afficher(idBeneficiaire, okId, okId_face); } } function afficher_adherent_assure() { if ($("#idAdherent_C" ).val()<=" ") { return; } window.location.assign($("#racineWeb" ).val()+"ficheadherentassure/"); } function afficher_assure() { if ($("#idAdherent_C" ).val()>"") { window.location.assign($("#racineWeb" ).val()+"ficheadherentassure/"+$("#idAdherent_C" ).val()+"/"); } } /* Fin JS beneficiaire */ function fermerFenetre() { v_msg="Etes-vous sur de vouloir quitter?"; v_msgEng="Are you sure you want to exit?"; if(confirm_ebene(v_msg, v_msgEng)) { ajax_deconnexion(); } } function ChangerPass() { if ($("#ancmdp" ).val()<=' ') { v_msg="Veuillez saisir l\'ancien mot de passe!"; v_msgEng="Please enter the old password!"; alert_ebene(v_msg, v_msgEng); $("#ancmdp").focus(); return false; } if ($("#nvmdp" ).val()<=' ') { v_msg="Veuillez saisir un mot de passe!"; v_msgEng="Please enter a password!"; alert_ebene(v_msg, v_msgEng); $("#nvmdp").focus(); return false; } if ($("#nvmdp").val()=='0000' || $("#nvmdp").val()=='radiant') { v_msg="Veuillez changer de mot de passe!"; v_msgEng="Please change password!"; alert_ebene(v_msg, v_msgEng); $("#nvmdp").focus(); return false; } longueur = $("#nvmdp").val().length; if(longueur>0 && longueur<6) { v_msg="6 caractères minimum exigé!"; v_msgEng="6 characters minimum required!"; alert_ebene(v_msg, v_msgEng); $("#nvmdp").focus(); return false; } if ($("#cfnvmdp" ).val()!=$("#nvmdp" ).val()) { v_msg="Veuillez confirmer votre mot de passe!"; v_msgEng="Please confirm your password!"; alert_ebene(v_msg, v_msgEng); $("#nvmdp").focus(); return false; } } function afficher_image(fichier) { window.open(fichier); } function selectionner_bon(id,no, codeEtatBon, motifAnnulation) { $("#idBon_C").val(id); $("#numeroBon_C").val(no); $("#motifAnnulation_C").val(motifAnnulation); $("#codeEtatBon_C").val(codeEtatBon); } function imprimerbon() { if ($("#codeActe").val()<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); return; } var codeEtatBon = $("input[name='codeEtatBon']").val(); if (codeEtatBon!="1") { return; } $("#frmconsultation").submit(); } function imprimerbonVierge() { if ($("#codeActe").val()<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } $("#codeTypeBon").val('2'); $("#frmconsultation").submit(); $("#codeTypeBon").val('1'); } function calculer_Tm() { $("#montantTm").val( ($("#montantacte").val() * (100-$("#tauxCouverture").val() )) / 100 ); if ($("#codeMedecin").val()>" ") $("#numeroBon").focus(); else $("#codeMedecin").focus(); return true; } function controlefocusconsultationMd() { if ($("#codeActe").val()>" ") $("#numeroBon").focus(); else $("#codeActe").focus(); return true; } function ajaxinfosacteexamen() { if ($("#codeActe").val()<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosacte/", type : 'post', data: "codePrestataire="+$("#codePrestataire").val()+"&codeActe="+$("#codeActe").val(), error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { $("#tauxCouverture").val( $("#tauxCouverture_info").val()); } }); } function ajaxbonexamendisponible() { if ($("#codeActe").val()<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } $("#codeTypeBon").val('1'); $.ajax({ url: $("#racineWeb").val()+"Ajaxbondisponible/", type : 'post', data: "codePrestataire="+$("#codePrestataire").val()+"&numeroBon="+$("#numeroBon").val(), error: function(errorData) { }, success: function(data) { $("#msgErreur").html(data); }, complete: function() { imprimerbon(); } }); } function ajaxbonhospitdisponible() { if ($("#codeActe").val()<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } $.ajax({ url: $("#racineWeb").val()+"Ajaxbondisponible/", type : 'post', data: "codePrestataire="+$("#codePrestataire").val()+"&numeroBon="+$("#numeroBon").val(), error: function(errorData) { }, success: function(data) { $("#msgErreur").html(data); }, complete: function() { imprimerbon(); } }); } function accueil() { if($("#codeProfil_C" ).val()=="MEC") { window.location.assign($("#racineWeb").val()+"Accueilmedecin/"); } else { window.location.assign($("#racineWeb").val()+"Accueil/"); } } function forceDownload(fileURL, fileName) { } function ged() { if ($("#numeroBeneficiaire_C" ).val()<=" ") { v_msg="Veuillez sélectionner un assuré!"; v_msgEng="Please select an insured person!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb").val()+"Ged/"); } function tachesadherent() { if ($("#numeroAdherent_C" ).val()<=" ") { v_msg="Veuillez sélectionner un assuré!"; v_msgEng="Please select an insured person!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb").val()+"Tacheadherent/"); } function afficherged(cheminFichier) { if (cheminFichier<=" ") { v_msg="Veuillez sélectionner un fichier!"; v_msgEng="Please select a file"; alert_ebene(v_msg, v_msgEng); return; } //window.open(cheminFichier); window.open(cheminFichier, '_blank'); } function archiverged() { if ($("#nomFichier").val()<=" ") { v_msg="Veuillez sélectionner un document!"; v_msgEng="Please select a document"; alert_ebene(v_msg, v_msgEng); return; } if( $("#accesAssure").val()=="0" && $("#accesPrestataire").val()=="0" && $("#accesMedecin").val()=="0" && $("#accesGestionnaire").val()=="0") { v_msg="Le document doit être visible par au moins un des acteurs!"; v_msgEng="The document must be seen by at least one of the persons in charge!"; alert_ebene(v_msg, v_msgEng); return; } $("#frmarchiherged").submit(); } function archiverfacture() { if ($("#nomFichier").val()<=" ") { v_msg="Veuillez sélectionner un fichier!"; v_msgEng="Please select a file"; alert_ebene(v_msg, v_msgEng); return; } $("#frmarchiherged").submit(); } function ajaxinfosdestinatairetache() { if ($("#codeDestinataire").val()<=" ") { v_msg="Veuillez sélectionner un destinataire!"; v_msgEng="Please select a recipient!"; alert_ebene(v_msg, v_msgEng); $("#codeDestinataire").focus(); return; } $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosdestinatairetache/", type : 'post', data: "codeDestinataire="+$("#codeDestinataire").val(), error: function(errorData) { }, success: function(data) { $("#infosdestinatairetache").html(data); }, complete: function() { $("#emailtache").val( $("#emailActeurtache_info").val()); } }); } function selectionner_tache(id) { $("#idTache").val(id); } function afficher_tache() { if ($("#idTache" ).val()<="") { v_msg="Veuillez sélectionner une ligne!"; v_msgEng="Please select a line!"; alert_ebene(v_msg, v_msgEng); } else window.location.assign($("#racineWeb" ).val()+"Affichertache/"+$("#idTache").val()+"/"); } function reinitialiserrecherche() { // window.location.assign($("#racineWeb").val()+"Tache/"); } function selectionner_Rq(lienrequete) { $("#lienrequete" ).val(lienrequete); } function parametre_Rq() { if ($("#lienrequete" ).val()<="") { v_msg="Veuillez sélectionner une requête!"; v_msgEng="Please select a query (request)!"; alert_ebene(v_msg, v_msgEng); } { window.location.assign($("#racineWeb" ).val()+$("#lienrequete" ).val()); } } function imprimer_pdf() { $("#sortie").val('1'); $("#frmrequete").submit(); } function export_xls() { $("#sortie").val('2'); $("#frmrequete").submit(); $("#sortie").val('1'); } function affichermanuel() { codeProfil = $("#codeProfil_C").val(); cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_CENTRES_DE_SOINS.pdf"; switch(codeProfil) { case "AAA": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_AGENT_AFRIK_ASSUR.pdf"; break; case "ADM": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_ADMINISTRATEUR_SYSTEME.pdf"; break; case "ASS": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_ASSURE.pdf"; break; case "CSO": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_CENTRES_DE_SOINS.pdf"; break; case "DIR": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_DIRECTION_AFRIK_ASSUR.pdf"; break; case "LAB": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_LABORATOIRES.pdf"; break; case "MEC": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_MEDECINS_CONSEIL.pdf"; break; case "PHA": cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_PHARMACIES.pdf"; break; } window.open('Docs/'+cheminFichier, '_blank'); } function ajaxListerequetesProfil() { $("#listerequete").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxrequetesprofil/", type : 'post', data: "codeProfil="+$("#codeProfil").val(), error: function(errorData) { }, success: function(data) { $("#listerequete").html(data); } }); } function compta() { numeroClient = $("#numeroClient_C" ).val(); idClient = $("#idClient_C").val(); window.location.assign($("#racineWeb").val()+"Compta/"+idClient+"/"); } function selectionner_client_pop(id,no,nom) { $("#nocli").val(no); $("#nomcli").val(nom); selectionner_client(id,no); } function controle_numerique(controle) { if(isNaN(controle.value)) { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; alert_ebene(v_msg, v_msgEng); controle.value=""; controle.focus(); return false; } return true; } function ajax_context_client(idClient) { donnees = 'idClient='+idClient; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextclient/", type : 'post', data: donnees, error: function(errorData) { } }); } function ajax_context_client_afficher(idClient) { donnees = 'idClient='+idClient; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextclient/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { window.location.assign($("#racineWeb" ).val()+"Ficheclient/"); } }); } function ajax_context_police(idPolice) { donnees = 'idPolice='+idPolice; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextpolice/", type : 'post', data: donnees, error: function(errorData) { } }); } function ajax_context_police_afficher(idPolice) { donnees = 'idPolice='+idPolice; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextpolice/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { window.location.assign($("#racineWeb" ).val()+"Fichepolice/"); } }); } /* 24/03/2019 function ajax_deconnexion() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdeconnexion/" }); } */ function ajax_deconnexion() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdeconnexion/", complete: function() { window.open('about:blank','_parent',''); close(); window.close(); } }); } function ajax_flexcode() { // donnees = 'idPolice='+idPolice; $.ajax({ url: $("#racineWeb").val()+"Ajaxflexcode/", type : 'post', // data: donnees, error: function(errorData) { }, success: function(data) { $("#content").html(data); }, complete: function() { // window.location.assign($("#racineWeb" ).val()+"Fichepolice/"); } }); } function controle_champ_obligatoire(controle) { if (controle.value<=" ") { v_msg="Valeur exigée!"; v_msgEng="Value required!"; alert_ebene(v_msg, v_msgEng); controle.focus(); return false; } return true; } function exporter_liste_assures() { $('#div_liste').html(''); var div_export = $('#div_export'); div_export.html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxexporterlisteassure/", type: 'POST', success: function(data) { div_export.html(data); }, error : function(resultat, statut, erreur) { }, complete: function(data) { } }); } function imprimer_liste_assures() { $('#div_liste').html(''); var div_export = $('#div_export'); div_export.html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaximprimerlisteassure/", type: 'POST', success: function(data) { div_export.html(data); }, error : function(resultat, statut, erreur) { }, complete: function(data) { } }); } function imprimer_limites() { $('#div_liste').html(''); var div_export = $('#div_export'); div_export.html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaximprimerlimite/", type: 'POST', success: function(data) { div_export.html(data); }, error : function(resultat, statut, erreur) { }, complete: function(data) { } }); } function pop_tableau_prestation() { $.ajax({ url: $("#racineWeb").val()+"Ajaxtableauprestation/", type : 'post', error: function(errorData) { }, success: function(data) { $("#div_tableau_prestation").html(data); }, complete: function() { $("#btn_pop").click(); } }); } function selectionner_tout_limite(p_idCollegeTemp, p_choix) { donnees = 'idCollegeTemp='+p_idCollegeTemp; donnees += '&choix='+p_choix; $.ajax({ url: $("#racineWeb").val()+"Ajaxselectionlimite/selectionnertout/", type: 'POST', data: donnees, success: function(data) { }, error: function(data) { }, complete: function() { recapituler_limite_college_simple(); pop_afficher_selection_limite(p_idCollegeTemp); } }); } function prestation_possible() { enVigueur=$("#enVigueur_C").val(); codeEtatBeneficiaire=$("#codeEtatBeneficiaire_C").val(); etatbeneficiaire=$("#etatbeneficiaire_C").val(); college_couvert=$("#college_couvert_C").val(); derogation_en_cours=$("#derogation_en_cours_C").val(); derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); datejour = $("#datejour_C").val(); dateEffetPolice = $("#dateEffetPolice_C").val(); dateEcheancePolice = $("#dateEcheancePolice_C").val(); dateEffetCouvert = $("#dateEffetCouvert").val(); radiation = $("#radiation").val(); /* if (dateEffetCouvert!="1") { v_msg="Attention! Non renouvelé"; v_msgEng="Warning! Not renewed"; alert_ebene(v_msg, v_msgEng); return false; } */ if (enVigueur!="1") { v_msg="Attention! cette personne n'est pas en vigueur"; v_msgEng="Warning! This person is not in force"; alert_ebene(v_msg, v_msgEng); return false; } if (codeEtatBeneficiaire!="V") { if(radiation=="0" && codeEtatBeneficiaire=="R"){ return true; }else{ v_msg="Attention! "+etatbeneficiaire; v_msgEng="Warning! "+etatbeneficiaire; alert_ebene(v_msg, v_msgEng); return false; } } if (college_couvert<1 && derogation_en_cours<1) { v_msg="Attention! Cette personne n\'a pas accès à ce centre"; v_msgEng="Warning! This person does not have access to this center"; alert_ebene(v_msg, v_msgEng); return false; } // var td0 = new Date(dateEffetPolice); dateEntreeBeneficiaire = $("#dateEntreeBeneficiaire_C").val(); var td0 = new Date(dateEntreeBeneficiaire); var td1 = new Date(datejour); var td2 = new Date(dateEcheancePolice); dt0=Math.round(Date.parse(td0)/(1000*3600*24)); dt1=Math.round(Date.parse(td1)/(1000*3600*24)); dt2=Math.round(Date.parse(td2)/(1000*3600*24)); // if (dt1>dt2) if (dt1>dt2 || dt1"2000-01-01") { var tdd = new Date(dateSortieBeneficiaire); dtd=Math.round(Date.parse(tdd)/(1000*3600*24)); if (dt1>dtd) { v_msg="Attention! cette personne n'est pas couverte à cette date!"; v_msgEng="Warning! This person is not valid on this date!"; alert_ebene(v_msg, v_msgEng); return false; } } dateDeces_C=$("#dateDeces_C").val(); if(dateDeces_C>"2000-01-01") { v_msg="Attention! personne décédée!"; v_msgEng="Warning! Deceased!"; alert_ebene(v_msg, v_msgEng); return false; } return true; } function consultation() { prestationPossible = $("#prestationPossible").val(); if (prestationPossible!="1") { v_msg="Assuré non encore couvert!"; v_msgEng="Insured not yet covered!"; alert_ebene(v_msg, v_msgEng); return; } dateEffetCouvert = $("#dateEffetCouvert").val(); if (dateEffetCouvert!="1") { v_msg="Attention! Non renouvelé"; v_msgEng="Warning! Not renewed"; alert_ebene(v_msg, v_msgEng); return; } modeSaisieFacture=$("#modeSaisieFacture").val(); if(modeSaisieFacture=="1") { $("#btn_popdate_reelle").click(); return; } if (prestation_possible()) { p_codeModeBiometrie = $("#p_codeModeBiometrie" ).val(); if(p_codeModeBiometrie=="0") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); window.location.assign($("#racineWeb" ).val()+"Consultation/"); return; } okId=$("#okId" ).val(); okId_face=$("#okId_face" ).val(); if(okId=="1" || okId_face=="1") { window.location.assign($("#racineWeb" ).val()+"Consultation/"); return; } modeSaisieFacture=$("#modeSaisieFacture").val(); if(modeSaisieFacture=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); window.location.assign($("#racineWeb" ).val()+"Consultation/"); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); } else { finger_id = $("#finger_id_C" ).val(); if (finger_id==0) { v_msg="Veuillez procéder à l\'enrôlement avant!"; v_msgEng="Please enroll before!"; alert_ebene(v_msg, v_msgEng); return; } okId=$("#okId" ).val(); okId_face=$("#okId_face" ).val(); if (okId!=1 && okId_face!=1) { v_msg="Veuillez procéder à l\'identification avant!"; v_msgEng="Please check identity before!"; alert_ebene(v_msg, v_msgEng); return; } } window.location.assign($("#racineWeb" ).val()+"Consultation/"); } } function gestionbon() { adminBon = $("#adminBon" ).val(); if (adminBon!="1") { v_msg="Accès refusé!"; v_msgEng="Access denied!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb").val()+"Receptionbons/"); } function afficherbon() { codeTypeBon=$("#codeTypeBon").val(); codeEtatBon=$("#codeEtatBon").val(); noDepart=$("#noDepart").val(); noFin=$("#noFin").val(); if (noDepart=="") { noDepart="0"; } if (noFin=="") { noFin="0"; } noDepart = parseInt(noDepart); noFin = parseInt(noFin); if (codeTypeBon<=" ") { v_msg="Veuillez sélectionner un type de bon!"; v_msgEng="Please select a form type!"; alert_ebene(v_msg, v_msgEng); $("#codeTypeBon").focus(); return; } if (noFin  ' + 'Veuillez patienter... / Please wait...' + ''); $.ajax({ url: $("#racineWeb").val()+"Ajaxafficherbons/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_bonpecs").html(data); }, complete: function() { codeLangue = $("#codeLangue").val(); if(codeLangue=="en_US") { $("#nbligne").val("Number of lines displayed : "+$("#nbligne_info").val()); } else { $("#nbligne").val("Nombre de bons affichés : "+$("#nbligne_info").val()); } // $("#nbligne").val("Nombre de bons affichés : "+$("#nbligne_info").val()); } }); } function demander_annulation_bon() { var codeEtatBon = $("#codeEtatBon_C").val(); var motifAnnulation = $("#motifAnnulation_C").val(); var numeroBon = $("#numeroBon_C").val(); var idBon = $("#idBon_C").val(); if (numeroBon<=" ") { v_msg="Veuillez sélectionner une ligne!"; v_msgEng="Please select a line!"; alert_ebene(v_msg, v_msgEng); return; } if (codeEtatBon=="3") { v_msg="Anullé pour motif : "+motifAnnulation; v_msgEng="Canceled for reason : "+motifAnnulation; alert_ebene(v_msg, v_msgEng); return; } if (codeEtatBon=="4") { v_msg="Remplacé pour motif : "+motifAnnulation; v_msgEng="Replaced for reason : "+motifAnnulation; alert_ebene(v_msg, v_msgEng); return; } if (codeEtatBon=="9") { v_msg="Demande anullation pour motif : "+motifAnnulation; v_msgEng="Cancellation request for reason : "+motifAnnulation; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous la demande d\'annulation du bon No "+numeroBon+"?"; v_msgEng="Do you confirm the request for cancellation of the prescription No "+numeroBon+"?"; if(confirm_ebene(v_msg, v_msgEng)) { v_msg="Raison de l\'annulation?"; v_msgEng="Reason for cancellation?"; motifAnnulation = prompt_ebene(v_msg, v_msgEng, motifAnnulation); if (motifAnnulation<=" ") { v_msg="Vous devez saisir un motif!"; v_msgEng="You have to enter a reason!"; alert_ebene(v_msg, v_msgEng); return; } $("#motifAnnulation_C").val(motifAnnulation); donnees = 'idBon='+idBon+'&motifAnnulation='+motifAnnulation; donnees_sav = 'idBon='+idBon+'&typeMail=maildemandeannulationbon'; $.ajax({ url: $("#racineWeb").val()+"Ajaxafficherbons/demanderAnnulationBon/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { }, complete: function() { mettremailattente(donnees_sav); v_msg="Demande envoyée avec succès!"; v_msgEng="Request sent successfully!"; alert_ebene(v_msg, v_msgEng); afficherbon(); } }); } } function enregistrer_commande_bon() { codeTypeBon=$("#codeTypeBon").val(); if ($("#codeTypeBon").val()<" ") { v_msg="Veuillez sélectionner un type de bon!"; v_msgEng="Please select a form type!"; alert_ebene(v_msg, v_msgEng); $("#codeTypeBon").focus(); return; } quantite =$("#quantite").val(); if (quantite<" ") { v_msg="Veuillez saisir la quantité!"; v_msgEng="Please enter the quantity!"; alert_ebene(v_msg, v_msgEng); $("#quantite").focus(); return; } quantite = parseInt(quantite); if(quantite<1) { v_msg="Veuillez saisir la quantité!"; v_msgEng="Please enter the quantity!"; alert_ebene(v_msg, v_msgEng); $("#quantite").focus(); return; } /* commentaire=$("#commentaire").val(); if ($("#commentaire").val()<" ") { v_msg="Veuillez saisir une note!"; v_msgEng="Please enter a note/comment!"; alert_ebene(v_msg, v_msgEng); $("#commentaire").focus(); return; } */ var codehtml = ""; v_msg="Confirmez-vous cette commande?"; v_msgEng="Do you confirm this order?"; if(confirm_ebene(v_msg, v_msgEng)) { prestataire = $("#prestataire_C").val(); donnees = 'codeTypeBon='+codeTypeBon+'&quantite='+quantite; donnees_sav = donnees+'&prestataire='+prestataire+'&typeMail=mailcommandebon'; lst_libelleBon = document.getElementById("codeTypeBon"); libelleBon = lst_libelleBon.options[lst_libelleBon.selectedIndex].text.trim(); typeSms = "commandebon"; $.ajax({ url: $("#racineWeb").val()+"Ajaxcommanderbons/commanderBon/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { codehtml = data; preparesms(typeSms); }, complete: function() { mettremailattente(donnees_sav); v_msg="commande envoyée avec succès!"; v_msgEng="Order sent successfully!"; alert_ebene(v_msg, v_msgEng); $("#div_page_entiere").html(codehtml); } }); } } function receptionner_bon() { nbligne_info=$("#nbligne_info").val(); nbligne_info = parseInt(nbligne_info); if (nbligne_info==0) { v_msg="Veuillez actualiser la liste avant!"; v_msgEng="Please refresh before!"; alert_ebene(v_msg, v_msgEng); return; } codeTypeBon=$("#codeTypeBon").val(); noDepart=$("#noDepart").val(); noFin=$("#noFin").val(); if (noDepart=="") { noDepart="0"; } if (noFin=="") { noFin="0"; } noDepart = parseInt(noDepart); noFin = parseInt(noFin); if (codeTypeBon<=" ") { v_msg="Veuillez sélectionner un type de bon!"; v_msgEng="Please select a form type!"; alert_ebene(v_msg, v_msgEng); $("#codeTypeBon").focus(); return; } if (noFin  ' + 'Veuillez patienter... / Please wait...' + ''); $.ajax({ url: $("#racineWeb").val()+"Ajaxalistegenererbons/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_bonpecs").html(data); }, complete: function() { $("#nbligne").val("Nombre de lignes affichées : "+$("#nbligne_info").val()); } }); } function listerdemandebon() { codeTypeBon=$("#codeTypeBon").val(); d1=$("#d1").val(); d2=$("#d2").val(); if (codeTypeBon<=" ") { v_msg="Veuillez sélectionner un type de bon!"; v_msgEng="Please select a form type!"; alert_ebene(v_msg, v_msgEng); $("#codeTypeBon").focus(); return; } donnees = 'codeTypeBon='+codeTypeBon+'&d1='+d1+'&d2='+d2; $("#div_bonpecs").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxalistedemandebon/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_bonpecs").html(data); }, complete: function() { } }); } function ajaxactespossibles() { codeGestionBon = $("#codeGestionBon").val(); codeFamilleActe=$("#codeFamilleActe").val(); codeTypePrestation=$("#codeTypePrestation").val(); donnees = 'codeFamilleActe='+codeFamilleActe+'&codeTypePrestation='+codeTypePrestation; $.ajax({ url: $("#racineWeb").val()+"Ajaxactespossibles/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#listeacte").html(data); $("#prixActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); $("#numeroBon").val(""); // $("#btn_enreg").disable(); // $("#codeEtatBon").val(""); $("#msgErreur").html(""); if (codeGestionBon=="0") { $("#btn_enreg").disable(); $("#codeEtatBon").val(""); } } }); } function ajaxactespossibles_med() { codeFamilleActe=$("#codeFamilleActe").val(); codeTypePrestation=$("#codeTypePrestation").val(); donnees = 'codeFamilleActe='+codeFamilleActe+'&codeTypePrestation='+codeTypePrestation; $.ajax({ url: $("#racineWeb").val()+"Ajaxactespossiblesmed/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#listeacte").html(data); $("#prixActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); }, complete: function() { } }); } function ajaxinfosacte() { if ($("#codeActe").val()<=" ") { $("#prixActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); $("#numeroBon").val(""); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosacte/", type : 'post', data: "codePrestataire="+$("#codePrestataire").val()+"&codeActe="+$("#codeActe").val(), error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { $("#montantacte").val( $("#montantacte_info").val()); $("#tauxCouverture").val( $("#tauxCouverture_info").val()); // calculer_Tm(); } }); } function ajaxprixacte() { codeGestionBon = $("#codeGestionBon").val(); codeActe = $("#codeActe").val(); if (codeActe<=" ") { $("#prixActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } donnees = 'codeActe='+codeActe; $.ajax({ url: $("#racineWeb").val()+"Ajaxprixacte/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); $("#numeroBon").val(""); $("#codeRaisonConsultation").focus(); $("#msgErreur").html(""); if (codeGestionBon=="0") { $("#btn_enreg").disable(); $("#codeEtatBon").val(""); } }, complete: function() { } }); } function ajaxbondisponible() { codeMedecin = $("#codeMedecin").val(); if (codeMedecin<=" ") { v_msg="Veuillez sélectionner un médecin!"; v_msgEng="Please select a doctor!"; alert_ebene(v_msg, v_msgEng); // $("#codeMedecin").focus(); $("#nomMedecin").focus(); $("#numeroBon").val(""); return; } codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); $("#numeroBon").val(""); return; } codeRaisonConsultation = $("#codeRaisonConsultation").val(); if (codeRaisonConsultation<=" ") { v_msg="Veuillez sélectionner une raison pour la consultation!"; v_msgEng="Please select a reason for the consultation!"; alert_ebene(v_msg, v_msgEng); $("#codeRaisonConsultation").focus(); $("#numeroBon").val(""); return; } numeroBon = $("#numeroBon").val(); if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxbondisponible/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function ajaxinfosbonconsultation() { badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } codeGestionBon = $("#codeGestionBon").val(); if (codeGestionBon!="0") { v_msg="Option non disponible!"; v_msgEng="Option not available!"; alert_ebene(v_msg, v_msgEng); return; } codeMedecin = $("#codeMedecin").val(); if (codeMedecin<=" ") { v_msg="Veuillez sélectionner un médecin!"; v_msgEng="Please select a doctor!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").val(""); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); // $("#codeMedecin").focus(); $("#nomMedecin").focus(); $("#btn_pop_medecin").click(); return; } codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").val(""); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#codeActe").focus(); return; } codeRaisonConsultation = $("#codeRaisonConsultation").val(); if (codeRaisonConsultation<=" ") { v_msg="Veuillez sélectionner une raison pour la consultation!"; v_msgEng="Please select a reason for the consultation!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").val(""); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#codeRaisonConsultation").focus(); return; } numeroBon = $("#numeroBon").val(); if(isNaN(numeroBon)) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonconsultation/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function enregistrerconsultation() { /* dateSurvenance = $("#dateSurvenance").val(); alert("dateSurvenance => "+dateSurvenance); return; */ badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } /* delaiCarenceBeneficiaire = $("#delaiCarenceBeneficiaire").val(); delaiCarenceBeneficiaire = parseInt(delaiCarenceBeneficiaire); if (delaiCarenceBeneficiaire>0) { if (anciennete"+delaiCarenceBeneficiaire); // alert("appliquerDelaiCarence =>"+appliquerDelaiCarence); // return; if (delaiCarenceBeneficiaire>0 && appliquerDelaiCarence=="1") { if (anciennete  ' + 'Veuillez patienter... / Please wait...' + ''); $.ajax({ url: $("#racineWeb").val()+"Ajaxdossiers/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_dossiers").html(data); }, complete: function() { } }); } function selectionner_feuille_maladie(no) { $("#numeroFeuilleMaladie_C" ).val(no); } function afficher_feuille_maladie() { numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C" ).val(); if (numeroFeuilleMaladie>"") { ajax_context_feuille_maladie_afficher(numeroFeuilleMaladie); } } function ajax_context_feuille_maladie_afficher(numeroFeuilleMaladie) { donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfeuillemaladie/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { feuillemaladie(); } }); } function enregistrerprescription() { badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } codeGestionBon = $("#codeGestionBon").val(); nbBonsOrd = $("#nbBonsOrd").val(); numeroBonSave = $("#numeroBonSave").val(); codeMedecin = $("#codeMedecin").val(); if (codeMedecin<=" ") { v_msg="Veuillez sélectionner un médecin!"; v_msgEng="Please select a doctor!"; alert_ebene(v_msg, v_msgEng); //$("#codeMedecin").focus(); $("#nomMedecin").focus(); return; } if (codeGestionBon=="0") { numeroBon = $("#numeroBon").val(); if(isNaN(numeroBon)) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } codeEtatBon = $("#codeEtatBon").val(); if (codeEtatBon!="1") { v_msg="Veuillez saisir un No de bon disponible!"; v_msgEng="Please enter a prescription number available!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } if(numeroBonSave!=numeroBon) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } v_msg="Confirmez-vous ce No de bon?"; v_msgEng="Do you confirm this number of prescription?"; } else { numeroBon = "-1"; v_msg="Confirmez-vous cette prescription?"; v_msgEng="Do you confirm this prescription?"; } /* v_msg="Confirmez-vous ce No de bon?"; v_msgEng="Do you confirm this number of prescription?"; */ if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin; // ajout du 27/06/2019 => prise en compte de la gestion paperless donnees += '&codeGestionBon='+codeGestionBon; $("#btn_enreg").disable(); $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistrerprescription/enregistrerprescription/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { // $('#div_test_gabarit').html(data); }, complete: function() { v_msg="Prescription enregistrée avec succès"; v_msgEng="Saved successfully!"; alert_ebene(v_msg, v_msgEng); prescription_medicament(); } }); } } function ajaxinfosbonprescription() { bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1) { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } codeGestionBon = $("#codeGestionBon").val(); if (codeGestionBon!="0") { v_msg="Option non disponible!"; v_msgEng="Option not available!"; alert_ebene(v_msg, v_msgEng); return; } numeroBonOrdonnance = $("#numeroBonOrdonnance").val(); numeroBonOrdonnance = parseInt(numeroBonOrdonnance); if (numeroBonOrdonnance>0) { v_msg="Déjà effectué!"; v_msgEng="Already done!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } codeMedecin = $("#codeMedecin").val(); if (codeMedecin<=" ") { v_msg="Veuillez sélectionner un médecin!"; v_msgEng="Please select a doctor!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").val(""); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); // $("#codeMedecin").focus(); $("#nomMedecin").focus(); return; } numeroBon = $("#numeroBon").val(); if(isNaN(numeroBon)) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonprescription/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function afficher_pop_recherche_medicament() { nomsearch = $("#nomsearch").val(); if (nomsearch > " ") { donnees = "valid=1&nomsearch="+nomsearch; $("#div_listemedicament").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlistemedicaments/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_listemedicament").html(data); } }); } } function ctrlkeypress(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_medicament(); } } function selectionner_medicament_pop(codeMedicament, libelleMedicament) { $("#codeMedicament_pop").val(codeMedicament); $("#libelleMedicament_pop").val(libelleMedicament); } function ajouter_medicament() { codeMedicament = $("#codeMedicament_pop").val(); libelleMedicament = $("#libelleMedicament_pop").val(); if (codeMedicament<=" ") { v_msg="Veuillez sélectionner un médicament!"; v_msgEng="Please select a medicine/drug!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Prescrire : "+libelleMedicament+"?"; v_msgEng="Prescribe : "+libelleMedicament+"?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'codeMedicament='+codeMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailprescription/ajoutermedicament/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { prescription_medicament(); }, complete: function() { } }); } } function ajax_maj_qte_medicament(idMedicament, quantite, controle) { quantite=quantite.replace(",","."); controle.value=quantite; if(controle_numerique(controle)) { if(quantite==0) { controle.focus(); v_msg="Veuillez saisir la quantité!"; v_msgEng="Please enter the quantity!"; alert_ebene(v_msg, v_msgEng); return; } donnees = 'idMedicament='+idMedicament+"&quantite="+quantite; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailprescription/majquantite/", type: 'POST', data: donnees, success: function(data) { $("#medicaments").html(data); }, error: function(data) { }, complete: function() { controle.focus(); } }); } } function supprimer_medicament(idMedicament) { v_msg="Confirmez-vous la suppression de ce médicament?"; v_msgEng="Do you confirm the removal of this medicine/drug?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idMedicament='+idMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailprescription/supprimer/", type: 'POST', data: donnees, success: function(data) { // $("#medicaments").html(data); prescription_medicament(); }, error: function(data) { }, complete: function() { } }); } } function ajoutermedicament(idMedicament) { donnees = 'idMedicament='+idMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacie/ajoutermedicament/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { } }); } function ajoutermedicament_pha(idMedicament) { donnees = 'idMedicament='+idMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/ajoutermedicament/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); // raffraichier_detail_prescription(); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function ajoutermedicament_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacie/ajoutermedicamenttous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite_cso(); } }); } function ajoutermedicament_pha_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/ajoutermedicamenttous/", type: 'POST', success: function(data) { $("#livraison").html(data); // raffraichier_detail_prescription(); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function retirermedicament(idMedicament) { donnees = 'idMedicament='+idMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacie/retirermedicament/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { } }); } function retirermedicament_pha(idMedicament) { donnees = 'idMedicament='+idMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/retirermedicament/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); raffraichier_detail_prescription(); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function retirermedicament_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacie/retirermedicamenttous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { } }); } function retirermedicament_pha_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/retirermedicamenttous/", type: 'POST', success: function(data) { $("#livraison").html(data); raffraichier_detail_prescription(); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); // actualiser_pharmacien(); } }); } function valider_pharmacie_cso() { facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } idPrestationactes=$("#idPrestationactes").val(); idPrestationactes = parseInt(idPrestationactes); nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); // if (idPrestationactes==0 && nbLivre<1) if (nbLivre<1) { v_msg="Rien à enregitrer! Confirmez-vous cette situation?"; v_msgEng="Nothing to save! Do you confirm this situation?"; } else { v_msg="Confirmez-vous cette livraison?"; v_msgEng="Do you confirm this delivery?"; } if(confirm_ebene(v_msg, v_msgEng)) { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacie/enregistrerpharmacie/", type: 'POST', success: function(data) { maj_fraisexclu_cso(); }, error: function(data) { }, complete: function() { feuillemaladie(); } }); } } function chercher_ordonnance(numeroBonOrdonnance) { donnees = 'numeroBonOrdonnance='+numeroBonOrdonnance; $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerordonnance/", type: 'POST', data: donnees, success: function(data) { }, error: function(data) { }, complete: function() { window.location.assign($("#racineWeb" ).val()+"Pharmacien/"); } }); } function chercher_ordonnance_opt(numeroBonOptique) { if(numeroBonOptique<="0") { // actualiser_opticien(); reinitialiser_opticien(); return; } donnees = 'numeroBonOptique='+numeroBonOptique; $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerordonnanceopt/", type: 'POST', data: donnees, success: function(data) { window.location.assign($("#racineWeb" ).val()+"Opticien/"); }, error: function(data) { }, complete: function() { } }); } function chercher_ordonnance_lab(numeroBonExamen) { donnees = 'numeroBonExamen='+numeroBonExamen; $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerordonnancelab/", type: 'POST', data: donnees, success: function(data) { window.location.assign($("#racineWeb" ).val()+"Laboratoire/"); }, error: function(data) { }, complete: function() { } }); } function ctrlkeypressord(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { numeroBonOrdonnance=$("#numeroBonOrdonnance").val(); $("#numeroBonOrdonnance").blur(); } } function rechercherbonordonnance() { numeroBonOrdonnance=$("#numeroBonOrdonnance").val(); if (numeroBonOrdonnance>" ") { chercher_ordonnance(numeroBonOrdonnance); } } function ctrlkeypressordopt(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { numeroBonOptique=$("#numeroBonOptique").val(); $("#numeroBonOptique").blur(); } } function ctrlkeypressordlab(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { numeroBonExamen=$("#numeroBonExamen").val(); $("#numeroBonExamen").blur(); } } function rechercherbonoptique() { numeroBonOptique=$("#numeroBonOptique").val(); if (numeroBonOptique>" ") { chercher_ordonnance_opt(numeroBonOptique); } } function valider_presciption() { bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1) { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } actVisible=$("#actVisible").val(); // if (actVisible!="1" && modeSaisieFacture!="1") if (actVisible!="1") { v_msg="Non autorisée!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } numeroBonOrdonnance = $("#numeroBonOrdonnance").val(); numeroBonOrdonnance = parseInt(numeroBonOrdonnance); if (numeroBonOrdonnance<=0) { v_msg="Pas de prescription!"; v_msgEng="No prescription!"; alert_ebene(v_msg, v_msgEng); // feuillemaladie(); return; } v_msg="Confirmez-vous cette ordonnance ?"; v_msgEng="Do you confirm this prescription?"; if(confirm_ebene(v_msg, v_msgEng)) { feuillemaladie(); } } function ajaxchanger_type_bon() { $("#msgErreur").html(""); } function ajaxprixactemed() { $("#prixActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } div_quantite = $("#quantite"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } div_quantite.val(quantite); quantite = parseInt(quantite); if(quantite==0) { div_quantite.focus(); v_msg="Veuillez saisir la quantité!"; v_msgEng="Please enter quantity!"; alert_ebene(v_msg, v_msgEng); $("#quantite").focus(); return; } donnees = 'codeActe='+codeActe+'&quantite='+quantite; $.ajax({ url: $("#racineWeb").val()+"Ajaxprixactemed/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { } }); } function enregistreractemedical() { acteExclu = $("#acteExclu").val(); autorisation = "0"; if(acteExclu==1) { autorisation = "2"; v_msg="Acte non couvert!"; v_msgEng="Not covered!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } donnees="" donnees_sav=""; codeMedecin = $("#codeMedecin").val(); if (codeMedecin<=" ") { v_msg="Veuillez sélectionner un médecin!"; v_msgEng="Please select a doctor!"; alert_ebene(v_msg, v_msgEng); $("#nomMedecin").focus(); return; } codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } div_prix = $("#prixActe"); prixActe = div_prix.val(); prixTarif = $("#prixTarif").val(); if(prixActe==0 || parseFloat(prixActe)>parseFloat(prixTarif)) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } div_quantite = $("#quantite"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } quantite = parseInt(quantite); div_quantite.val(quantite); if(quantite==0) { div_quantite.focus(); v_msg="Veuillez saisir la quantité!"; v_msgEng="Please neter the quantity!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous cet acte?"; v_msgEng="Do you confirm this act?"; if(confirm_ebene(v_msg, v_msgEng)) { prixActe = $("#prixActe").val(); valeurActe = $("#valeurActe").val(); montantTm = $("#montantTm").val(); aRembourser = $("#aRembourser").val(); ententePrealable = $("#ententePrealable").val(); if(ententePrealable==1) { ententePrealable = "2"; } donnees = 'codeActe='+codeActe+'&codeMedecin='+codeMedecin+'&quantite='+quantite+'&ententePrealable='+ententePrealable; donnees += '&prixActe='+prixActe+'&valeurActe='+valeurActe+'&montantTm='+montantTm+'&aRembourser='+aRembourser; donnees += '&autorisation='+autorisation+'&prixTarif='+prixTarif; numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; donnees_sav2 = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailautorisation'; typeSms="ententeprealable"; typeSms2="autorisation"; $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistreractemedical/enregistreractemedical/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { maj_fraisexclu_cso(); if(ententePrealable=="2") { preparesms(typeSms); v_msg="Demande accord prealable envoyée!"; v_msgEng="Request prior agreement sent!"; alert_ebene(v_msg, v_msgEng); } if(autorisation=="2") { preparesms(typeSms2); v_msg="Demande autorisation envoyée!"; v_msgEng="Request for authorization sent!"; alert_ebene(v_msg, v_msgEng); } }, complete: function() { if(ententePrealable=="2") { mettremailattente(donnees_sav); } if(autorisation=="2") { mettremailattente(donnees_sav2); } feuillemaladie(); } }); } } function ajax_changer_qte_acte() { codeActe = $("#codeActe").val(); prixActe = $("#prixActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } div_quantite = $("#quantite"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } div_quantite.val(quantite); quantite = parseInt(quantite); if(quantite==0) { div_quantite.focus(); div_quantite.val(""); v_msg="Veuillez saisir la quantité!"; v_msgEng="Please neter the quantity!"; alert_ebene(v_msg, v_msgEng); return; } donnees = 'codeActe='+codeActe+'&quantite='+quantite+'&prixActe='+prixActe; $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerqteacte/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { } }); } function supprimer_acte_medical(idPrestationactes, codeTypePrestation) { v_msg="Confirmez-vous la suppression de cet acte?"; v_msgEng="Do you confirm the removal of this act?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idPrestationactes='+idPrestationactes+'&codeTypePrestation='+codeTypePrestation; $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistreractemedical/supprimeracte/", type: 'POST', data: donnees, success: function(data) { feuillemaladie_ajax(); }, error: function(data) { }, complete: function() { } }); } } function supprimer_chambre(idChambre) { v_msg="Confirmez-vous la suppression de cette chambre?"; v_msgEng="Do you confirm the removal of this room?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idPrestationactes='+idChambre+'&codeTypePrestation=HOSP'; $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistreractemedical/supprimeracte/", type: 'POST', data: donnees, success: function(data) { attribution_chambre(); }, error: function(data) { }, complete: function() { } }); } } function ajaxinfosbonhospitalisation() { bonCaduc=$("#bonCaduc").val(); // alert("bonCaduc => "+bonCaduc); // return; if (bonCaduc==1) { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } codeGestionBon = $("#codeGestionBon").val(); if (codeGestionBon!="0") { v_msg="Option non disponible!"; v_msgEng="Option not available!"; alert_ebene(v_msg, v_msgEng); return; } numeroBonHospitalisation = $("#numeroBonHospitalisation").val(); numeroBonHospitalisation = parseInt(numeroBonHospitalisation); if (numeroBonHospitalisation>0) { v_msg="Déjà effectué!"; v_msgEng="Already done!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } numeroBon = $("#numeroBon").val(); if(isNaN(numeroBon)) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon Hospitalisation!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonhospitalisation/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function enregistrerhospitalisation() { badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } codeGestionBon = $("#codeGestionBon").val(); nbBonsOrd = $("#nbBonsOrd").val(); numeroBonSave = $("#numeroBonSave").val(); numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); if (codeGestionBon=="0") { numeroBon = $("#numeroBon").val(); if(isNaN(numeroBon)) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } codeEtatBon = $("#codeEtatBon").val(); if (codeEtatBon!="1") { v_msg="Veuillez saisir un No de bon disponible!"; v_msgEng="Please enter a prescription number available!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } if(numeroBonSave!=numeroBon) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } v_msg="Confirmez-vous ce No de bon?"; v_msgEng="Do you confirm this number of prescription?"; } else { numeroBon = "-1"; v_msg="Confirmez-vous cette prescription?"; v_msgEng="Do you confirm this prescription?"; } if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'numeroBon='+numeroBon+'&numeroFeuilleMaladie='+numeroFeuilleMaladie; donnees_sav = donnees+'&typeMail=mailhospitalisation'; // ajout du 27/06/2019 => prise en compte de la gestion paperless donnees += '&codeGestionBon='+codeGestionBon; $("#btn_enreg").disable(); typeSms="hospitalisation"; $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/enregistrerhospitalisation/", type : 'post', data: donnees, error: function(errorData) { // $("#msgErreur").html(errorData); }, success: function(data) { // $('#div_test_gabarit').html(data); /* mise en commentaire le 04/07/2019 => pour les attributions automatiques, on ne connait pas encore le No de bon preparesms(typeSms); */ }, complete: function() { /* mise en commentaire le 04/07/2019 => pour les attributions automatiques, on ne connait pas encore le No de bon mettremailattente(donnees_sav); */ v_msg="Avis hospitalisation envoyé, souhaitez-vous ajouter une chambre?"; v_msgEng="Hospitalization notice sent, would you like to add a room?"; if(confirm_ebene(v_msg, v_msgEng)) { attribution_chambre(); } else { feuillemaladie(); } } }); } } function ajaxprixchambre() { $("#btn_enreg").disable(); $("#prixActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un type de chambre!"; v_msgEng="Please select a category of room!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } div_quantite = $("#quantite"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } div_quantite.val(quantite); quantite = parseInt(quantite); if(quantite==0) { div_quantite.focus(); v_msg="Veuillez saisir la durée!"; v_msgEng="Please enter the duration!"; alert_ebene(v_msg, v_msgEng); return; } donnees = 'codeActe='+codeActe+'&quantite='+quantite; $("#infosacte").html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxprixchambre/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { } }); } function ajax_changer_duree_chambre() { $("#btn_enreg").disable(); codeActe = $("#codeActe").val(); prixActe = $("#prixActe").val(); numeroChambre = $("#numeroChambre").val(); /* alert("numeroChambre => "+numeroChambre); return; */ if (codeActe<=" ") { v_msg="Veuillez sélectionner un type de chambre!"; v_msgEng="Please select a category of room!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } div_quantite = $("#quantite"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } div_quantite.val(quantite); quantite = parseInt(quantite); if(quantite==0) { div_quantite.focus(); div_quantite.val(""); v_msg="Veuillez saisir la durée!"; v_msgEng="Please enter duration!"; alert_ebene(v_msg, v_msgEng); return; } claculerfinchambre(); donnees = 'codeActe='+codeActe+'&quantite='+quantite+'&prixActe='+prixActe+'&numeroChambre='+numeroChambre; $("#infosacte").html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerdureechambre/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { } }); } function claculerfinchambre() { div_quantite = $("#quantite"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } div_quantite.val(quantite); quantite = parseInt(quantite); if(quantite==0) { div_quantite.focus(); div_quantite.val(""); v_msg="Veuillez saisir la durée!"; v_msgEng="Please enter the duration!"; alert_ebene(v_msg, v_msgEng); return; } var typdate = $("#debut").datepicker("getDate"); typdate.setDate(typdate.getDate() + quantite -1); $( "#fin" ).datepicker( "setDate", typdate ); // contrôle du cheveauchement des dates /* var td1 = new Date($("#dateFinHospit").val()); var td2 = $("#debut").datepicker("getDate"); dt1=Math.round(Date.parse(td1)/(1000*3600*24)); dt2=Math.round(Date.parse(td2)/(1000*3600*24)); if (dt1>dt2) { $("#btn_enreg").disable(); $("#debut").focus(); v_msg="Veuillez revoir vos dates!"; v_msgEng="Please review your dates!"; alert_ebene(v_msg, v_msgEng); return; } $("#btn_enreg").enable(); */ } function enregistrerchambre() { acteExclu = $("#acteExclu").val(); ententePrealable = $("#ententePrealable").val(); /* alert('ententePrealable = '+ententePrealable); return; */ autorisation = "0"; if(acteExclu==1) { autorisation = "2"; v_msg="Non couvert!"; v_msgEng="Not covered!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un type de chambre!"; v_msgEng="Please select a category of room!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } div_prix = $("#prixActe"); prixActe = div_prix.val(); prixTarif = prixActe; if(prixActe==0) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } div_quantite = $("#quantite"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } quantite = parseInt(quantite); div_quantite.val(quantite); if(quantite==0) { div_quantite.focus(); v_msg="Veuillez saisir la durée!"; v_msgEng="Please enter the duration!"; alert_ebene(v_msg, v_msgEng); return; } // contrôle du cheveauchement des dates // mis en commentaire le 31/10/2018 BONA /* var td1 = new Date($("#dateFinHospit").val()); var td2 = $("#debut").datepicker("getDate"); dt1=Math.round(Date.parse(td1)/(1000*3600*24)); dt2=Math.round(Date.parse(td2)/(1000*3600*24)); if (dt1>dt2) { $("#btn_enreg").disable(); $("#debut").focus(); v_msg="Veuillez revoir vos dates!"; v_msgEng="Please review your dates!"; alert_ebene(v_msg, v_msgEng); return; } // $("#btn_enreg").enable(); */ numeroChambre = $("#numeroChambre").val(); if (numeroChambre<=" ") { v_msg="Veuillez saisir le No de chambre!"; v_msgEng="Please enter room number!"; alert_ebene(v_msg, v_msgEng); $("#numeroChambre").focus(); return; } v_msg="Confirmez-vous cette chambre?"; v_msgEng="Do you confirm this room?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees="" donnees_sav=""; if(ententePrealable==1) { ententePrealable = "2"; } prixActe = $("#prixActe").val(); valeurActe = $("#valeurActe").val(); montantTm = $("#montantTm").val(); aRembourser = $("#aRembourser").val(); debut = $("#debut").val(); // $("#fin").enable(); fin = $("#fin").val(); donnees = 'codeActe='+codeActe+'&quantite='+quantite+'&prixActe='+prixActe+'&valeurActe='+valeurActe; donnees += '&montantTm='+montantTm+'&aRembourser='+aRembourser+'&debut='+debut+'&fin='+fin +'&numeroChambre='+numeroChambre; donnees += '&autorisation='+autorisation+'&prixTarif='+prixTarif; donnees += '&ententePrealable='+ententePrealable; // alert("donnees => "+donnees); // return; numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; donnees_sav2 = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailautorisation'; typeSms="ententeprealable"; typeSms2="autorisation"; $("#btn_enreg_chambre").disable(); $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistrerchambre/enregistrerchambre/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { maj_fraisexclu_cso(); if(ententePrealable=="2") { preparesms(typeSms); v_msg="Demande accord prealable envoyée!"; v_msgEng="Request prior agreement sent!"; alert_ebene(v_msg, v_msgEng); } if(autorisation=="2") { preparesms(typeSms2); v_msg="Demande autorisation envoyée!"; v_msgEng="Request for authorization sent!"; alert_ebene(v_msg, v_msgEng); } }, complete: function() { if(ententePrealable=="2") { mettremailattente(donnees_sav); } if(autorisation=="2") { mettremailattente(donnees_sav2); } v_msg="Enregistrée avec succès"; v_msgEng="Saved successfully!"; alert_ebene(v_msg, v_msgEng); attribution_chambre(); } }); } } function actesmedicaux() { actVisible=$("#actVisible").val(); // if (actVisible!="1" && modeSaisieFacture!="1") if (actVisible!="1") { v_msg="Non autorisée!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } modeSaisieFacture=$("#modeSaisieFacture").val(); bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1 && modeSaisieFacture!="1") { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Actesmedicaux/"); } function optique() { facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } prescription_optique(); } function pharmacien() { if (prestation_possible()) { /* mis en commentaire le 28/11/2017 derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); } else { finger_id = $("#finger_id_C" ).val(); if (finger_id==0) { v_msg="Veuillez procéder à l\'enrôlement avant!"; v_msgEng="Please enroll before!"; alert_ebene(v_msg, v_msgEng); return; } okId=$("#okId" ).val(); if (okId!=1) { v_msg="Veuillez procéder à l\'identification avant!"; v_msgEng="Please check identity before!"; alert_ebene(v_msg, v_msgEng); return; } } */ window.location.assign($("#racineWeb" ).val()+"Pharmacien/"); } } function dossiers(okId) { codeProfil = $("#codeProfil_C" ).val(); if(codeProfil=="PHA") { pharmacien(); return; } if(codeProfil=="OPT") { monture = $("#monture").val(); if(monture=="1") { window.location.assign($("#racineWeb" ).val()+"Monture/"); return; } opticien(); return; } if(codeProfil=="LAB") { laboratoire(); return; } if(codeProfil=="SEA") { seancekine(); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); } /* else { // finger_id = $("#finger_id_C" ).val(); finger_id = $("#okId" ).val(); if (finger_id==0) { v_msg="Veuillez procéder à l\'enrôlement avant!"; v_msgEng="Please enroll before!"; alert_ebene(v_msg, v_msgEng); return; } } */ modeSaisieFacture=$("#modeSaisieFacture").val(); if(modeSaisieFacture=="1") { window.location.assign($("#racineWeb" ).val()+"Dossiers/"); return; } if (prestation_possible()) { if (okId==1) { window.location.assign($("#racineWeb" ).val()+"Consultation/"); return; } else { okId=$("#okId" ).val(); } if (okId==1) { $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextidentification/", type : 'post', error: function(errorData) { }, complete: function() { if (prestation_possible()) { window.location.assign($("#racineWeb" ).val()+"Dossiers/"); } } }); } else { window.location.assign($("#racineWeb" ).val()+"Dossiers/"); } } } function afficher_beneficiaire_id_okId() { idBeneficiaire=$("#idBeneficiaire_C").val(); okId=$("#okId").val(); okId_face=$("#okId_face").val(); if (idBeneficiaire>"") { ajax_context_beneficiaire_afficher(idBeneficiaire, okId, okId_face); } } function ajax_context_beneficiaire_afficher(idBeneficiaire, okId, okId_face) { donnees = 'idBeneficiaire='+idBeneficiaire+'&okId='+okId+'&okId_face='+okId_face; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextbeneficiaire/", type : 'post', data: donnees, success: function(data) { $('#div_ok_face_info').html(data); }, error: function(errorData) { }, complete: function() { window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"); } }); } function ajax_context_beneficiaire_afficher(idBeneficiaire, okId) { donnees = 'idBeneficiaire='+idBeneficiaire+'&okId='+okId; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextbeneficiaire/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"); } }); } function facturer_cso(user_id) { facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } // verifier depasement fraisExclu=$("#fraisExclu").val(); fraisExclu = parseInt(fraisExclu); if (fraisExclu>0) { v_msg="Attention ! Dépassement de limite, souhaitez-vous continuer?"; v_msgEng="Warning ! Overflow, Would you like to continue?"; if(!confirm_ebene(v_msg, v_msgEng)) { return; } } // Fin verification depassement derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face").val("1"); } else { okId=$("#okId" ).val(); okId_face=$("#okId_face" ).val(); if (okId!=1 && okId_face!=1) { v_msg="Veuillez procéder à l\'identification avant!"; v_msgEng="Please check identity before!"; alert_ebene(v_msg, v_msgEng); return; } } prixActe = $("#prixActe").val(); if (prixActe==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } montantTm = $("#montantTm").val(); cout = $("#cout").val(); montantTm_f = $("#montantTm_f").val(); cout_f = $("#cout_f").val(); donnees = 'prixActe='+prixActe; donnees += '&montantTm='+montantTm; donnees += '&cout='+cout; numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); donnees_sav = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailfacturationfeuillemaladie'; typeSms = "facturer_cso"; user_id_0 = $("#user_id_C").val(); user_id_substitut = "0"; if (user_id_0!=user_id) { user_id_substitut = user_id; } donnees_substitut = 'user_id_substitut='+user_id_substitut; $.ajax({ url: $("#racineWeb").val()+"Ajaxfacturerfeuillemaladie/facturer/", type: 'POST', data: donnees_substitut, success: function(data) { preparesms_adherent(typeSms); }, error: function(data) { }, complete: function() { preparemail_adherent(typeSms); v_msg="Facturation effectuée avec succès!"; v_msgEng="Billing done successfully!"; alert_ebene(v_msg, v_msgEng); feuillemaladie(); } }); } function facturer_feuillemaladie() { modeSaisieFacture=$("#modeSaisieFacture").val(); bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1 && modeSaisieFacture!="1") { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } numOrd = $("#numOrd").val(); noPrescription = $("#noPrescription").val(); if (numOrd==0 && noPrescription==0) { v_msg="Attention, pas de presciption de médicaments!?"; v_msgEng="Warning, no presciption of drugs!"; alert_ebene(v_msg, v_msgEng); prescription_medicament(); return; } prixActe = $("#prixActe").val(); if (prixActe==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } affectionObligatoire=$("#affectionObligatoire").val(); codeAffection=$("#codeAffection").val(); if (affectionObligatoire=="1" && codeAffection<="0000") { v_msg="Diagnostique exigé!"; v_msgEng="Diagnosis required!"; alert_ebene(v_msg, v_msgEng); $("#libelleAffection").focus(); $("#btn_pop_affection").click(); return; } v_msg="Confirmez-vous la facturation?"; v_msgEng="Do you confirm billing?"; if(confirm_ebene(v_msg, v_msgEng)) { user_id_0 = $("#user_id_C").val(); modeSaisieFacture=$("#modeSaisieFacture").val(); derogationFingerFacturation=$("#derogationFingerFacturation").val(); // alert("modeSaisieFacture="+modeSaisieFacture+" ; derogationFingerFacturation="+derogationFingerFacturation); // return; if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_cso(user_id_0); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); // alert("derogation_finger_en_cours="+derogation_finger_en_cours); // return; if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_cso(user_id_0); return; } else { beneficiaire = $("#beneficiaire_C").val(); user_id = $("#user_id_C").val(); finger_id = $("#finger_id_C").val(); $("#facturation").val("1"); data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; // load("flexcode/user.php?"+data); load("flexcode/user_facturation.php?"+data); } } } function facturer_pha() { idPrestationactes=$("#idPrestationactes").val(); idPrestationactes = parseInt(idPrestationactes); /* mis en commentaire le 31/07/2018 => permettre la multi-facturation if (idPrestationactes>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } */ nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); // if (idPrestationactes==0 && nbLivre<1) if (nbLivre<1) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } prixActe = $("#prixActe").val(); if (prixActe==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } montantTm = $("#montantTm").val(); cout = $("#cout").val(); montantTm_f = $("#montantTm_f").val(); cout_f = $("#cout_f").val(); donnees = 'prixActe='+prixActe; donnees += '&montantTm='+montantTm; donnees += '&cout='+cout; numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); codePrestataire = $("#codePrestataire_C").val(); donnees_sav = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&codePrestataire='+codePrestataire+'&typeMail=mailpharmacie'; typeSms = "facturer_pha"; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/enregistrerpharmacie/", type: 'POST', success: function(data) { preparesms_adherent(typeSms); }, error: function(data) { }, complete: function() { preparemail_adherent(typeSms); v_msg="Facturation effectuée avec succès!"; v_msgEng="Billing done successfully!"; alert_ebene(v_msg, v_msgEng); window.location.assign($("#racineWeb" ).val()+"Pharmacien/"); } }); } function valider_pharmacie_pha() { prixActe = $("#prixActe").val(); if (prixActe==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } modeSaisieFacture=$("#modeSaisieFacture").val(); bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1 && modeSaisieFacture!="1") { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } estRempalace=$("#estRempalace").val(); if (estRempalace=="1") { v_msg="Remplacée!"; v_msgEng="Replaced!"; alert_ebene(v_msg, v_msgEng); return; } numeroPrescription=$("#numeroPrescription_C").val(); if (numeroPrescription<="0") { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } idPrestationactes=$("#idPrestationactes").val(); idPrestationactes = parseInt(idPrestationactes); /* mis en commentaire le 31/07/2018 => permettre la multi-facturation if (idPrestationactes>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } */ nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); // if (idPrestationactes==0 && nbLivre<1) if (nbLivre<1) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous cette livraison?"; v_msgEng="Do you confirm this delivery?"; if(confirm_ebene(v_msg, v_msgEng)) { // 07/01/2018 => Mis en commentaire parce pas besoin de fingerprint en pharmacie /* derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_pha(); } else { beneficiaire = $("#beneficiaire_C").val(); user_id =$("#user_id_C").val(); finger_id =$("#finger_id_C").val(); $("#facturation").val("1"); data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; load("flexcode/user.php?"+data); } */ facturer_pha(); } } function valider_optique() { bonCaduc=$("#bonCaduc").val(); // alert("bonCaduc => "+bonCaduc); // return; if (bonCaduc==1) { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } /* nbVerres=$("#nbVerres").val(); nbVerres = parseInt(nbVerres); if (nbVerres<1) { v_msg="Rien à valider!"; v_msgEng="Nothing to save!"; alert_ebene(v_msg, v_msgEng); return; } */ numeroBonOptique=$("#numeroBonOptique").val(); if (numeroBonOptique<=0) { v_msg="Pas de prescription!"; v_msgEng="No prescription!"; alert_ebene(v_msg, v_msgEng); // feuillemaladie(); return; } v_msg="Confirmez-vous cette ordonnance ?"; v_msgEng="Do you confirm this prescription?"; if(confirm_ebene(v_msg, v_msgEng)) { $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistreroptique/videroptiquetemp/", type : 'post', error: function(errorData) { }, success: function(data) { feuillemaladie(); }, complete: function() { } }); } } function separateur_millier(montant) { montant = parseInt(montant); montant.toLocaleString(); return montant.toLocaleString(); } function ajaxinfosbonoptique() { bonCaduc=$("#bonCaduc").val(); // alert("bonCaduc => "+bonCaduc); // return; if (bonCaduc==1) { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } codeGestionBon = $("#codeGestionBon").val(); if (codeGestionBon!="0") { v_msg="Option non disponible!"; v_msgEng="Option not available!"; alert_ebene(v_msg, v_msgEng); return; } numeroBonOptique = $("#numeroBonOptique").val(); numeroBonOptique = parseInt(numeroBonOptique); if (numeroBonOptique>0) { v_msg="Déjà effectué!"; v_msgEng="Already done!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } codeMedecin = $("#codeMedecin").val(); if (codeMedecin<=" ") { v_msg="Veuillez sélectionner un médecin!"; v_msgEng="Please select a doctor!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").val(""); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); // $("#codeMedecin").focus(); $("#nomMedecin").focus(); return; } numeroBon = $("#numeroBon").val(); if(isNaN(numeroBon)) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonoptique/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function supprimer_optique(idOptique) { v_msg="Confirmez-vous la suppression de ce verre?"; v_msgEng="Do you confirm the removal of this glass?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idOptique='+idOptique; $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistrerverre/supprimerverre/", type: 'POST', data: donnees, success: function(data) { $("#medicaments").html(data); }, error: function(data) { }, complete: function() { prescription_optique(); } }); } } function enregistreroptique() { badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } codeGestionBon = $("#codeGestionBon").val(); nbBonsOrd = $("#nbBonsOrd").val(); numeroBonSave = $("#numeroBonSave").val(); codeMedecin = $("#codeMedecin").val(); if (codeMedecin<=" ") { v_msg="Veuillez sélectionner un médecin!"; v_msgEng="Please select a doctor!"; alert_ebene(v_msg, v_msgEng); $("#nomMedecin").focus(); return; } if (codeGestionBon=="0") { numeroBon = $("#numeroBon").val(); if(isNaN(numeroBon)) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } if ($("#numeroBon").val()<="0") { v_msg="Veuillez saisir un No de bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } codeEtatBon = $("#codeEtatBon").val(); if (codeEtatBon!="1") { v_msg="Veuillez saisir un No de bon disponible!"; v_msgEng="Please enter a prescription number available!"; alert_ebene(v_msg, v_msgEng); $("#numeroBon").focus(); return; } if(numeroBonSave!=numeroBon) { v_msg="Veuillez revoir le numéro de bon!"; v_msgEng="Please review the prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_enreg").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } v_msg="Confirmez-vous ce No de bon?"; v_msgEng="Do you confirm this number of prescription?"; } else { numeroBon = "-1"; v_msg="Confirmez-vous cette prescription?"; v_msgEng="Do you confirm this prescription?"; } /* v_msg="Confirmez-vous ce No de bon?"; v_msgEng="Do you confirm this number of prescription?"; */ if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin; // ajout du 27/06/2019 => prise en compte de la gestion paperless donnees += '&codeGestionBon='+codeGestionBon; $("#btn_enreg").disable(); $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistreroptique/enregistreroptique/", type : 'post', data: donnees, error: function(errorData) { // $("#msgErreur").html(errorData); }, success: function(data) { // $('#div_test_gabarit').html(data); }, complete: function() { v_msg="Prescription enregistrée avec succès"; v_msgEng="Saved successfully!"; alert_ebene(v_msg, v_msgEng); prescription_optique(); } }); } } function enregistrerverre() { codeOptique = $("#codeOptique").val(); if (codeOptique<=" ") { v_msg="Veuillez sélectionner un verre!"; v_msgEng="Please select a glass!"; alert_ebene(v_msg, v_msgEng); $("#codeOptique").focus(); return; } v_msg="Confirmez-vous ces verres?"; v_msgEng="Do you confirm these glasses?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'codeOptique='+codeOptique; $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistrerverre/enregistrerverre/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { prescription_optique(); }, complete: function() { } }); } } function valider_chambre() { badcodeGestionBon = $("#badcodeGestionBon").val(); if (badcodeGestionBon=="1") { v_msg="Veuillez revoir le type de gestion de bons!"; v_msgEng="Please review the type of forms management!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1) { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous cette hospitalisation ?"; v_msgEng="Do you confirm this hospitalization?"; if(confirm_ebene(v_msg, v_msgEng)) { feuillemaladie(); } } function valider_opticien() { prixActe = $("#prixActe").val(); if (prixActe==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } modeSaisieFacture=$("#modeSaisieFacture").val(); bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1 && modeSaisieFacture!="1") { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } numeroOptique=$("#numeroOptique_C").val(); if (numeroOptique<="0") { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } idPrestationactes=$("#idPrestationactes").val(); idPrestationactes = parseInt(idPrestationactes); if (idPrestationactes>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); if (idPrestationactes==0 && nbLivre<1) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous cette livraison?"; v_msgEng="Do you confirm this delivery?"; if(confirm_ebene(v_msg, v_msgEng)) { // 07/01/2018 => Mis en commentaire parce pas besoin de fingerprint en magasin optique /* derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_opt(); } else { beneficiaire = $("#beneficiaire_C").val(); user_id =$("#user_id_C").val(); finger_id =$("#finger_id_C").val(); $("#facturation").val("1"); data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; load("flexcode/user.php?"+data); } */ facturer_opt(); } } function opticien() { if (prestation_possible()) { /* mis en commentaire le 28/11/2017 derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); } else { finger_id = $("#finger_id_C" ).val(); if (finger_id==0) { v_msg="Veuillez procéder à l\'enrôlement avant!"; v_msgEng="Please enroll before!"; alert_ebene(v_msg, v_msgEng); return; } okId=$("#okId" ).val(); $("#okId_face" ).val("1"); if (okId!=1 && okId_face!=1) { v_msg="Veuillez procéder à l\'identification avant!"; v_msgEng="Please check identity before!"; alert_ebene(v_msg, v_msgEng); return; } } */ window.location.assign($("#racineWeb" ).val()+"Opticien/"); } } function envoyer_alert_tentative_fraude(user_id) { /* donnees = 'user_id='+user_id; idBeneficiaire = $("#idBeneficiaire_C").val(); prestataire = $("#prestataire_C").val(); donnees_sav = donnees+'&prestataire='+prestataire+'&idBeneficiaire='+idBeneficiaire+'&typeMail=mailfraudeidentite'; mettremailattente(donnees_sav); */ } function ajouterverre_opt_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailopticien/ajouterverretous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function ajouterverre_opt(idOptique) { donnees = 'idOptique='+idOptique; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailopticien/ajouterverre/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function retirerverre_opt_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailopticien/retirerverretous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { } }); } function retirerverre_opt(idOptique) { donnees = 'idOptique='+idOptique; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailopticien/retirerverre/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { } }); } function facturer_opt() { idPrestationactes=$("#idPrestationactes").val(); idPrestationactes = parseInt(idPrestationactes); if (idPrestationactes>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); if (idPrestationactes==0 && nbLivre<1) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } prixActe = $("#prixActe").val(); if (prixActe==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } montantTm = $("#montantTm").val(); cout = $("#cout").val(); montantTm_f = $("#montantTm_f").val(); cout_f = $("#cout_f").val(); donnees = 'prixActe='+prixActe; donnees += '&montantTm='+montantTm; donnees += '&cout='+cout; numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); codePrestataire = $("#codePrestataire_C").val(); donnees_sav = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&codePrestataire='+codePrestataire+'&typeMail=mailoptique'; typeSms = "facturer_opt"; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailopticien/enregistreroptique/", type: 'POST', success: function(data) { preparesms_adherent(typeSms); }, error: function(data) { }, complete: function() { preparemail_adherent(typeSms); v_msg="Facturation effectuée avec succès!"; v_msgEng="Billing done successfully!"; alert_ebene(v_msg, v_msgEng); window.location.assign($("#racineWeb" ).val()+"Opticien/"); } }); } function afficher_detail_generartionbon(idgenerationbon) { if (idgenerationbon>"") { window.location.assign($("#racineWeb" ).val()+"Detailgenerationbon/"+idgenerationbon+"/"); } } function maj_monture_temp(idOptique, monture) { donnees = 'idOptique='+idOptique+"&monture="+monture; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailopticien/majmonture/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function supprimer_espace_nombre(nombre) { nombre = nombre.replace(" ", ""); if(isNaN(nombre)) { v_msg = nombre+" n'est pas un nombre!"; v_msgEng = nombre+" is not a number!"; alert_ebene(v_msg, v_msgEng); return '0'; } nombre = parseInt(nombre); return nombre; } function demander_derogation() { window.location.assign($("#racineWeb" ).val()+"Demandederogation/"); } function enregistrerdemandederogation() { codeDerogation = $("#codeDerogation").val(); lst_libelleDerogation = document.getElementById("codeDerogation"); libelleDerogation = lst_libelleDerogation.options[lst_libelleDerogation.selectedIndex].text.trim(); college_couvert=$("#college_couvert_C").val(); if (college_couvert>0 && codeDerogation=="01") { v_msg="Attention! Cette personne a déjà accès à ce centre"; v_msgEng="Warning! This person all ready have access to this center"; alert_ebene(v_msg, v_msgEng); return; } if (codeDerogation<=" ") { v_msg="Veuillez sélectionner une dérogation!"; v_msgEng="Please select an exemption!"; alert_ebene(v_msg, v_msgEng); $("#codeDerogation").focus(); return; } observations = $("#observations").val(); if (observations<=" ") { v_msg="Veuillez saisir la motivation!"; v_msgEng="Please select the motivation!"; alert_ebene(v_msg, v_msgEng); $("#observations").focus(); return; } v_msg="Confirmez-vous cette demande de dérogation?"; v_msgEng="Do you confirm this request?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'codeDerogation='+codeDerogation+'&observations='+observations+'&libelleDerogation='+libelleDerogation; idBeneficiaire = $("#idBeneficiaire_C").val(); prestataire = $("#prestataire_C").val(); donnees_sav = donnees+'&prestataire='+prestataire+'&idBeneficiaire='+idBeneficiaire+'&typeMail=maildemandederogation'; typeSms = "demandederogation"; $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistrerdemandederogation/enregistrerdemandederogation/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { preparesms(typeSms); }, complete: function() { mettremailattente(donnees_sav); v_msg="Demande envoyée avec succès!"; v_msgEng="Request sent successfully!"; alert_ebene(v_msg, v_msgEng); liste_derogation(); } }); } } function liste_derogation() { window.location.assign($("#racineWeb" ).val()+"Listederogations/"); } function listerderogation() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; $("#div_derogations").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxderogation/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_derogations").html(data); }, complete: function() { } }); } function afficher_div_wait() { // $("#div_page_complet").disable(); // $("#div_wait").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); } function effacer_div_wait() { $("#div_wait").html(""); } function consultationpha() { window.location.assign($("#racineWeb" ).val()+"Consultationpha/"); } function consultationlab() { window.location.assign($("#racineWeb" ).val()+"Consultationlab/"); } function consultationopt() { window.location.assign($("#racineWeb" ).val()+"Consultationopt/"); } function consultationcso() { window.location.assign($("#racineWeb" ).val()+"Consultationcso/"); } function consultationbenpha() { window.location.assign($("#racineWeb" ).val()+"Consultationbenpha/"); } function consultationbenopt() { window.location.assign($("#racineWeb" ).val()+"Consultationbenopt/"); } function consultationbencso() { window.location.assign($("#racineWeb" ).val()+"Consultationbencso/"); } function listerdossiercons_ben() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationbencso/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_dossiers").html(data); }, complete: function() { } }); } function listerdossiercons() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; donnees_sav = donnees; $("#reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationcsoentete/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#reglement").html(data); }, complete: function() { } }); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationcso/", type : 'post', data: donnees_sav, error: function(errorData) { }, success: function(data) { $("#detail_reglement").html(data); $("#detail_reglement").css("padding-top", "0px"); }, complete: function() { } }); } function afficher_feuille_maladie_cons() { numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C" ).val(); if (numeroFeuilleMaladie>"") { ajax_context_feuille_maladie_afficher_cons(numeroFeuilleMaladie); } } function ajax_context_feuille_maladie_afficher_cons(numeroFeuilleMaladie) { donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfeuillemaladie/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_feuillemaladie(); } }); } function afficher_feuille_maladie_cons_ben() { numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C" ).val(); if (numeroFeuilleMaladie>"") { ajax_context_feuille_maladie_afficher_cons_ben(numeroFeuilleMaladie); } } function ajax_context_feuille_maladie_afficher_cons_ben(numeroFeuilleMaladie) { donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfeuillemaladie/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_feuillemaladie_ben(); } }); } function consulter_prescription_ben() { window.location.assign($("#racineWeb" ).val()+"Prescriptionconsben/"); } function consulter_chambre_ben() { window.location.assign($("#racineWeb" ).val()+"Chambreconsben/"); } function consulter_optique_ben() { window.location.assign($("#racineWeb" ).val()+"Optiqueconsben/"); } function consulter_feuillemaladie_ben() { window.location.assign($("#racineWeb" ).val()+"Feuillemaladieconsben/"); } function consulter_prescription() { window.location.assign($("#racineWeb" ).val()+"Prescriptioncons/"); } function consulter_chambre() { window.location.assign($("#racineWeb" ).val()+"Chambrecons/"); } function consulter_optique() { window.location.assign($("#racineWeb" ).val()+"Optiquecons/"); } function consulter_feuillemaladie() { window.location.assign($("#racineWeb" ).val()+"Feuillemaladiecons/"); } // function prescription_medicament() { actVisible=$("#actVisible").val(); modeSaisieFacture=$("#modeSaisieFacture").val(); saisirFactureDecompte=$("#saisirFactureDecompte").val();