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(); modeSaisieFeuille=$("#modeSaisieFeuille").val(); alert("saisirFactureDecompte="+saisirFactureDecompte+" ; modeSaisieFeuille="+modeSaisieFeuille); if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } // if (actVisible!="1" && modeSaisieFacture!="1") if (actVisible!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } if (modeSaisieFacture="1" && saisirFactureDecompte!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Prescription/"); } function livraison_pharmacie() { 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; } numeroBonOrdonnance=$("#numeroBonOrdonnance_C").val(); if (numeroBonOrdonnance==0) { v_msg="Aucune prescription!"; v_msgEng="No prescription!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Pharmacie/"); } function prescription_optique() { modeSaisieFacture=$("#modeSaisieFacture").val(); saisirFactureDecompte=$("#saisirFactureDecompte").val(); modeSaisieFeuille=$("#modeSaisieFeuille").val(); if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } if (modeSaisieFacture=="1" && saisirFactureDecompte!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Optique/"); } function attribution_chambre() { window.location.assign($("#racineWeb" ).val()+"Chambre/"); } function feuillemaladie() { window.location.assign($("#racineWeb" ).val()+"Feuillemaladie/"); } function feuillemaladie_ajax() { $("#div_feuillemaladie").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxfeuillemaladie/", type: 'POST', success: function(data) { $("#div_feuillemaladie").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite_cso(); } }); } function recherche() { window.location.assign($("#racineWeb" ).val()+"Recherche/"); } function requetes() { codeProfil = $("#codeProfil_C" ).val(); if(codeProfil=="PHA") { consultationpha(); return; } if(codeProfil=="OPT") { consultationopt(); return; } if(codeProfil=="CSO") { consultationcso(); return; } if(codeProfil=="LAB") { consultationlab(); return; } if(codeProfil=="SEA") { consultationsea(); return; } } // function lister_factures_pha_ben() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationbenpha/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_dossiers").html(data); }, complete: function() { } }); } function lister_factures_opt_ben() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationbenopt/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_dossiers").html(data); }, complete: function() { } }); } function afficher_facture_cons_pha_ben(idFacture, numeroBonOrdonnance, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonOrdonnance='+numeroBonOrdonnance+'&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfacturepha/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_pha_ben(); } }); } } function afficher_facture_cons_pha(idFacture, numeroBonOrdonnance, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonOrdonnance='+numeroBonOrdonnance+'&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfacturepha/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_pha(); } }); } } function consulter_facture_pha_ben() { window.location.assign($("#racineWeb" ).val()+"Pharmacienconsben/"); } function consulter_facture_pha() { window.location.assign($("#racineWeb" ).val()+"Pharmaciencons/"); } function afficher_facture_cons_opt_ben(idFacture, numeroBonOptique, numeroOptique, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonOptique='+numeroBonOptique+'&numeroOptique='+numeroOptique; donnees += '&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfactureopt/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_opt_ben(); } }); } } function consulter_facture_opt_ben() { window.location.assign($("#racineWeb" ).val()+"Opticienconsben/"); } function consultations() { window.location.assign($("#racineWeb" ).val()+"Consultations/"); } function listerdossiercons_pha() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; donnees_sav = donnees; $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationphaentete/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#reglement").html(data); }, complete: function() { } }); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationpha/", type : 'post', data: donnees_sav, error: function(errorData) { }, success: function(data) { $("#detail_reglement").html(data); $("#detail_reglement").css("padding-top", "0px"); }, complete: function() { } }); } function listerdossiercons_opt() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; donnees_sav = donnees; $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationoptentete/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#reglement").html(data); }, complete: function() { } }); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationopt/", 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_facture_cons_opt(idFacture, numeroBonOptique, numeroOptique, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonOptique='+numeroBonOptique+'&numeroOptique='+numeroOptique; donnees += '&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfactureopt/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_opt(); } }); } } function consulter_facture_opt() { window.location.assign($("#racineWeb" ).val()+"Opticiencons/"); } function liste_decompte() { window.location.assign($("#racineWeb" ).val()+"Listedecomptes/"); } function listerdecomptes() { codeExercice = $("#codeExercice").val(); // codeMois = $("#codeMois").val(); codeEtatDecompte = $("#codeEtatDecompte").val(); if (codeExercice<=" ") { v_msg="Veuillez sélectionner un exercice!"; v_msgEng="Please select an exercise!"; alert_ebene(v_msg, v_msgEng); $("#codeExercice").focus(); return; } donnees = 'codeExercice='+codeExercice+'&codeEtatDecompte='+codeEtatDecompte; $("#div_detail").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlistedecomptes/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_detail").html(data); }, complete: function() { } }); } function consulterdecompte(idReglement) { donnees = 'idReglement='+idReglement; $.ajax({ url: $("#racineWeb").val()+"Ajaxdecompte/initierdecompte/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { }, complete: function() { afficher_decompte(); } }); } function afficher_decompte() { // $("#detail_demande_decompte").html('
  ' + 'Veuillez patienter...' + '
'); window.location.assign($("#racineWeb" ).val()+"Decomptecons/"); } function sortirdexclusionstandards() { idBeneficiaire = $("#idBeneficiaire_C").val(); idAdherent_C = $("#idAdherent_C" ).val(); if (idBeneficiaire>"0") { afficher_beneficiaire_id(); } if (idAdherent_C>"0") { afficher_adherent_id(); } else { recherche(); } } function exclusionstandards() { window.location.assign($("#racineWeb" ).val()+"Exclusionstandards/"); } function envoimaildivers(datamail) { // var url_mail = "http://testprestation.medicare.rw/Cron/Ajaxenvoimaildivers.php?"+datamail; lienMail = $("#lienMail_C").val(); var url_mail = lienMail+"/Cron/Ajaxenvoimaildivers.php?"+datamail; $.ajax({ url : url_mail, type : "GET", error : function(errorData) { }, success :function(data) { } }); } function mettremailattente(datamail) { $.ajax({ url: $("#racineWeb").val()+"Ajaxmailattente/ajouter/", type: 'POST', data: datamail, success: function(data) { }, error: function(errorData) { }, complete: function() { } }); } function preparesms(typeSms) { envoismsactif = $("#envoismsactif").val(); if(envoismsactif=="0") { return; } codeLangueSociete = $("#codeLangueSociete").val(); p_destinataires = ""; p_message = ""; creation_message = "1"; if (typeSms=="demandederogation") { p_destinataires = $("#smsDerogation_C").val(); copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); if (copieSmsPrestataireAssure=="1") { p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); } patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Request for exemption : " : "Demande derogation pour : "; p_message += libelleDerogation; } if (typeSms=="ententeprealable") { p_destinataires = $("#smsAccordPrealable_C").val(); copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); if (copieSmsPrestataireAssure=="1") { p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); } patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement" : "Alerte : Accord prealable"; } if (typeSms=="hospitalisation") { p_destinataires = $("#smsMedecinConseil_C").val(); copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); if (copieSmsPrestataireAssure=="1") { p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); } patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Hospit. form No : " : "No Bon Hospit. : "; p_message += numeroBon; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Hospitalization notification" : "Avis Hospitalisation"; } if (typeSms=="autorisation") { p_destinataires = $("#smsAccordPrealable_C").val(); copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); if (copieSmsPrestataireAssure=="1") { p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); } patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Alert : Request authorization for excluded act" : "Alerte : Demande autorisation pour acte exclu"; } if (typeSms=="commandebon") { p_destinataires = $("#smsGestionBon_C").val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Order of claims form " : "Commande de bons de PEC"; p_message += "\n"; p_message += "Quantit. : "+quantite+" "; p_message += "\n"; p_message += "Type : "+libelleBon+"."; } if (typeSms=="ententeprealablepha") { p_destinataires = $("#smsAccordPrealable_C").val(); copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); if (copieSmsPrestataireAssure=="1") { p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); } patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement for pharmacy" : "Alerte : Accord prealable pharmacie"; } if (typeSms=="accident") { p_destinataires = $("#smsAccordPrealable_C").val(); patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Alert: Circulation accident" : "Alerte : Accident de la circulation"; } if (typeSms=="ententeprealableopt") { p_destinataires = $("#smsAccordPrealable_C").val(); patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement for glasses" : "Alerte : Accord prealable verres"; } if (typeSms=="ententeprealablemont") { p_destinataires = $("#smsAccordPrealable_C").val(); patient = $("#beneficiaire_C").val(); numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); prestataire = $("#prestataire_C").val(); p_message = prestataire+" "; p_message += "\n"; p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; p_message += "\n"; p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement for optical frames" : "Alerte : Accord prealable monture"; } envoyersms(p_destinataires, p_message, creation_message); } function liste_ententeprealable() { window.location.assign($("#racineWeb" ).val()+"Listeententeprealables/"); } function liste_exclusions() { window.location.assign($("#racineWeb" ).val()+"Listeexclusions/"); } function alerter_depassement_limite() { fraisExcluLivre=$("#fraisExcluLivre").val(); fraisExcluLivre = parseInt(fraisExcluLivre); if (fraisExcluLivre>0) { v_msg="Attention ! Dépassement de limite"; v_msgEng="Warning ! Overflow"; alert_ebene(v_msg, v_msgEng); return; } } function alerter_depassement_limite_cso() { fraisExclu=$("#fraisExclu").val(); fraisExclu = parseInt(fraisExclu); if (fraisExclu>0) { v_msg="Attention ! Dépassement de limite"; v_msgEng="Warning ! Overflow"; alert_ebene(v_msg, v_msgEng); return; } } function maj_fraisexclu_cso() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdepassementlimitefeuillemaladie/", error: function(errorData) { }, success: function(data) { $("#div_fraisExclu").html(data); }, complete: function() { alerter_depassement_limite_cso(); } }); } function consommables() { 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; } facturerConsommable=$("#facturerConsommable").val(); if (facturerConsommable!="1") { v_msg="Consommables non facturés!"; v_msgEng="Consumables not invoiced!"; alert_ebene(v_msg, v_msgEng); return; } ajoutConsommable = $("#ajoutConsommable").val(); if (ajoutConsommable!="1") { v_msg="Déjà inclu dans les actes ! Souhaitez-vous continuer?"; v_msgEng="Already included in the acts ! Would you like to continue?"; if(confirm_ebene(v_msg, v_msgEng)) { window.location.assign($("#racineWeb" ).val()+"Consommables/"); return; } else { return; } } window.location.assign($("#racineWeb" ).val()+"Consommables/"); } function afficher_recherche_consommable() { nomConsommable = $("#nomConsommable").val(); if (nomConsommable > " ") { donnees = "nomConsommable="+nomConsommable; $("#div_listeconsommable").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteconsommables/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_listeconsommable").html(data); } }); } } function ajouter_consommable(idConsommable, libelleConsommable) { if (libelleConsommable<=" ") { v_msg="Veuillez sélectionner un consommable!"; v_msgEng="Please select a consumable!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Ajouter : "+libelleConsommable+"?"; v_msgEng="Add : "+libelleConsommable+"?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idConsommable='+idConsommable; $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteconsommables/ajouterconsommable/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { maj_fraisexclu_cso(); }, complete: function() { // afficher_consommable(); feuillemaladie(); } }); } } function ajax_maj_qte_consommable(idConsommable, 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 = 'idConsommable='+idConsommable+"&quantite="+quantite; $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteconsommables/majquantite/", type: 'POST', data: donnees, success: function(data) { // $('#div_test_gabarit').html(data); }, error: function(data) { }, complete: function() { afficher_consommable(); } }); } } function ctrlkeypressconsommable(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_recherche_consommable(); } } function afficher_consommable() { $("#div_listeconsommable").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxafficherconsommables/", error: function(errorData) { }, success: function(data) { $("#div_listeconsommable").html(data); $("#libelleconsommable").focus(); } }); } function changer_type_bon() { $("#nbligne_info").val("0"); afficherbon_vide(); } function afficher_pop_recherche_medecin() { noOrdreMedecin = $("#noOrdreMedecin").val(); nomsearch = $("#nomsearch").val(); if(noOrdreMedecin+nomsearch<=" ") return; donnees = "valid=1&noOrdreMedecin="+noOrdreMedecin+"&nomsearch="+nomsearch; $("#div_listemedecins").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlistemedecins/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_listemedecins").html(data); }, complete: function() { } }); } function afficher_pop_recherche_actes_possibles() { libelleActeSearch = $("#libelleActeSearch").val(); if(libelleActeSearch<=" ") { return; } donnees = "valid=1&libelleActeSearch="+libelleActeSearch; $("#div_liste_actes_possibles").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteactespossibles/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_liste_actes_possibles").html(data); } }); } function ctrlkeypress_medecin(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_medecin(); } } function ctrlkeypress_actes_cons(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_actes_cons(); } } function ctrlkeypress_actes_possibles(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_actes_possibles(); } } function selectionner_medecin(codeMedecin, nomMedecin, noOrdreMedecin) { if(noOrdreMedecin+codeMedecin<=" ") return; v_msg="Confirmez-vous ce Médecin : "+nomMedecin+"?"; v_msgEng="Do you confirm this Doctor : "+nomMedecin+"?"; if(confirm_ebene(v_msg, v_msgEng)) { $("#codeMedecin").val(codeMedecin); $("#nomMedecin").html(nomMedecin+" ( "+noOrdreMedecin+" )"); if(codeMedecin=="ZZZZ") { $("#medecinManquant").readable(); $("#codeSpecialiteManuel").enable(); } else { $("#medecinManquant").unreadable(); $("#codeSpecialiteManuel").disable(); } $("#close_pop").click(); } } function maj_prix_actemedical() { prixTarif = $("#prixTarif").val(); prixNew = $("#prixNew").val(); if(prixNew==0 || parseFloat(prixNew)>parseFloat(prixTarif)) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); $("#prixNew").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; } ententePrealable = $("#ententePrealable").val(); acteExclu = $("#acteExclu").val(); acteChirurgie = $("#acteChirurgie").val(); donnees = 'prixNew='+prixNew+'&quantite='+quantite+'&prixTarif='+prixTarif; donnees += '&ententePrealable='+ententePrealable+'&acteExclu='+acteExclu+'&acteChirurgie='+acteChirurgie; $.ajax({ url: $("#racineWeb").val()+"Ajaxmajprixactemed/", type : 'post', data : donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { $("#btn_close_pop_tarif").click(); } }); } function afficher_pop_tarif() { prixActe = $("#prixActe").val(); $("#prixNew").val(prixActe); $("#btn_pop_tarif").click(); } function demanderaccordacteexclu() { v_msg="Acte non couvert!"; v_msgEng="Not covered!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } function demanderaccordchambreexclu() { v_msg="Attention! Chambre exclue. Demander un accord?"; v_msgEng="Warning! Non covered room. Request Agreement?"; alert_ebene(v_msg, v_msgEng); return; } function substituer_medicament(idMedicament) { v_msg="Substituer ce médicament?"; v_msgEng="Substitute this drug?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idMedicament='+idMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxsubstitutionmedicament/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_substitution").html(data); }, complete: function() { $("#btn_pop").click(); } }); } } function annuler_substitution_medicament(idMedicament) { v_msg="Annuler cette substitution?"; v_msgEng="Cancel this substitution?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idMedicament='+idMedicament; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/annulersubstitutionmedicament/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } } function enregistrersubstituion_medicament() { idMedicament = $("#idMedicament").val(); prixTarif = $("#prixTarif").val(); prixSubstitut = $("#prixSubstitut").val(); if(prixSubstitut==0 || parseFloat(prixSubstitut)>parseFloat(prixTarif)) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous cette substitution ?"; v_msgEng="Do you confirm this substitution?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idMedicament='+idMedicament+'&prixSubstitut='+prixSubstitut; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/enregistrersubstitutionmedicament/", type: 'POST', data: donnees, success: function(data) { $("#btn_close_pop").click(); $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } } function selectionner_acte_cons(codeFamilleActe, codeActe, familleActe, libelleActe) { if(libelleActe<=" ") return; $("#codeFamilleActe").val(codeFamilleActe); ajaxactespossibles(); v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; v_msgEng="Do you confirm this act : "+libelleActe+"?"; if(confirm_ebene(v_msg, v_msgEng)) { $("#codeActe").val(codeActe); ajaxprixacte(); $("#libelleActe").val(libelleActe); $("#close_pop_acte").click(); } } function afficher_pop_recherche_actes_cons() { libelleActeSearch = $("#libelleActeSearch").val(); if(libelleActeSearch<=" ") { return; } donnees = "valid=1&libelleActeSearch="+libelleActeSearch; $("#div_liste_actes_cons").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteactescons/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_liste_actes_cons").html(data); } }); } function selectionner_acte_possibles(codeFamilleActe, codeActe, familleActe, libelleActe) { if(libelleActe<=" ") return; $("#codeFamilleActe").val(codeFamilleActe); // ajaxactespossibles(); ajaxactespossibles_med(); v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; v_msgEng="Do you confirm this act : "+libelleActe+"?"; if(confirm_ebene(v_msg, v_msgEng)) { $("#codeActe").val(codeActe); ajaxprixactemed(); $("#libelleActe").val(libelleActe); $("#close_pop_acte").click(); } } function ctrlkeypress_pha(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_medicament_pha(); } } function afficher_pop_recherche_medicament_pha() { nomsearch = $("#nomsearch").val(); if (nomsearch > " ") { donnees = "valid=1&nomsearch="+nomsearch; $("#div_listemedicament").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlistemedicamentspha/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_listemedicament").html(data); } }); } } function prescrire_medicament_pha() { // Ajout à la prescription codePrestatairePrescription = $("#codePrestatairePrescription").val(); 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; } donnees = 'codeMedicament='+codeMedicament; donnees += '&codePrestatairePrescription=' + codePrestatairePrescription; // alert(donnees); // return; v_msg="Prescrire : "+libelleMedicament+"?"; v_msgEng="Prescribe : "+libelleMedicament+"?"; if(confirm_ebene(v_msg, v_msgEng)) { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailpharmacien/ajoutermedicamentprescription/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#btn_close_pop_medicament").click(); $("#livraison").html(data); raffraichier_detail_prescription(); }, complete: function() { alerter_depassement_limite(); } }); } // Fin Ajout à l aprescription } function raffraichier_detail_prescription() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailordonnance/", type : 'post', // data: donnees, error: function(errorData) { }, success: function(data) { $("#ordonnance").html(data); }, complete: function() { } }); } function actualiser_pharmacien() { /* modif du 15/11/2018 // window.location.assign($("#racineWeb" ).val()+"Pharmacien/"); actualiser_saisie_pharmacien(); */ 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; } window.location.assign($("#racineWeb" ).val()+"Pharmacien/"); } function ajax_maj_qte_medicament_pha(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()+"Ajaxdetailpharmacien/majquantitepha/", type: 'POST', data: donnees, success: function(data) { // $("#medicaments").html(data); $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); controle.focus(); } }); } } function prescription_examen() { actVisible=$("#actVisible").val(); modeSaisieFeuille=$("#modeSaisieFeuille").val(); if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } if (actVisible!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Prescriptionexamen/"); } function valider_presciption_examens() { 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; } nbExamens=$("#nbExamens").val(); nbExamens = parseInt(nbExamens); /* On peut saisir juste le No de bon sans saisir le détail de la prescription if (nbExamens<1) { v_msg="Rien à valider!"; v_msgEng="Nothing to save!"; alert_ebene(v_msg, v_msgEng); return; } */ numeroBonExamen=$("#numeroBonExamen").val(); if (numeroBonExamen<=0) { v_msg="Pas de prescription!"; v_msgEng="No prescription!"; alert_ebene(v_msg, v_msgEng); // feuillemaladie(); return; } v_msg="Confirmez-vous cette presciption ?"; v_msgEng="Do you confirm this prescription?"; if(confirm_ebene(v_msg, v_msgEng)) { feuillemaladie(); /* $.ajax({ // url: $("#racineWeb").val()+"Ajaxenregistreroptique/videroptiquetemp/", url: $("#racineWeb").val()+"Ajaxenregistrerexamen/viderexamentemp/", type : 'post', error: function(errorData) { }, success: function(data) { feuillemaladie(); }, complete: function() { } }); */ } } function ajaxinfosbonprescriptionexamen() { 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; } numeroBonExamen = $("#numeroBonExamen").val(); numeroBonExamen = parseInt(numeroBonExamen); if (numeroBonExamen>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()+"Ajaxinfosbonexamen/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function supprimer_examen(idExamen) { v_msg="Confirmez-vous la suppression de cet examen?"; v_msgEng="Do you confirm the removal of this exam?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'idExamen='+idExamen; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/supprimer/", type: 'POST', data: donnees, success: function(data) { $("#examens").html(data); }, error: function(data) { }, complete: function() { prescription_examen(); } }); } } function enregistrerprescriptionexamen() { 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()+"Ajaxenregistrerprescriptionexamen/enregistrerprescriptionexamen/", 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_examen(); } }); } } function ctrlkeypress_examens_possibles(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_examens_possibles(); } } function afficher_pop_recherche_examens_possibles() { libelleActeSearch = $("#libelleActeSearch").val(); if(libelleActeSearch<=" ") { return; } donnees = "valid=1&libelleActeSearch="+libelleActeSearch; $("#div_liste_actes_possibles").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteexamenspossibles/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_liste_actes_possibles").html(data); } }); } function ajouter_examen_possible(codeActe, libelleActe, acteExclu, ententePrealable) { typeSms="ententeprealable"; if(libelleActeSearch<=" ") { return; } if(acteExclu==1) { v_msg="Acte non couvert!"; v_msgEng="Not covered!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; v_msgEng="Do you confirm this act : "+libelleActe+"?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable; if (ententePrealable==1) { numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); donnees_sav = donnees+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; } $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/ajouterexamen/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { if(ententePrealable==1) { preparesms(typeSms); v_msg="Demande accord prealable envoyée!"; v_msgEng="Request prior agreement sent!"; alert_ebene(v_msg, v_msgEng); } // prescription_examen(); }, complete: function() { if(ententePrealable==1) { mettremailattente(donnees_sav); } prescription_examen(); } }); } } function ajax_maj_qte_examen(idExamen, 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 = 'idExamen='+idExamen+"&quantite="+quantite; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/majquantite/", type: 'POST', data: donnees, success: function(data) { $("#examens").html(data); }, error: function(data) { }, complete: function() { controle.focus(); } }); } } function examensmedicaux() { 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; } numeroExamen=$("#numeroExamen_C").val(); if (numeroExamen==0) { v_msg="Aucun examen prescrit!"; v_msgEng="No prescribed exam!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Examensmedicaux/"); } function valider_examen_cso() { facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); if (nbLivre<1) { v_msg="Rien à enregitrer!"; v_msgEng="Nothing to save!"; alert_ebene(v_msg, v_msgEng); feuillemaladie(); } else { v_msg="Confirmez-vous ces examens?"; v_msgEng="Do you confirm these exams?"; } if(confirm_ebene(v_msg, v_msgEng)) { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailexamen/enregistrerexamen/", type: 'POST', success: function(data) { maj_fraisexclu_cso(); }, error: function(data) { }, complete: function() { feuillemaladie(); } }); } } function ajouterexamen_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailexamen/ajouterexamentous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite_cso(); } }); } function ajouterexamen(idExamen, ententePrealable, codeActe) { donnees = 'idExamen='+idExamen+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable; typeSms="ententeprealable"; if (ententePrealable==9) { v_msg="Acte refusé!"; v_msgEng="Act refused!"; alert_ebene(v_msg, v_msgEng); return; } if (ententePrealable==2) { numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); donnees_sav = donnees+'&codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; } $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailexamen/ajouterexamen/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); if(ententePrealable=="2") { preparesms(typeSms); v_msg="Demande accord prealable envoyée!"; v_msgEng="Request prior agreement sent!"; alert_ebene(v_msg, v_msgEng); } }, error: function(data) { }, complete: function() { if(ententePrealable=="2") { mettremailattente(donnees_sav); } } }); } function retirerexamen_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailexamen/retirerexamentous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { } }); } function retirerexamen(idExamen) { donnees = 'idExamen='+idExamen; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailexamen/retirerexamen/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { } }); } function consulter_limite_avant_facturation_cons() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturecons/"); */ } function consulter_limite_avant_facturation() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacture/"); */ } function consulter_limite_avant_facturation_cons_ben() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureconsben/"); */ } function consulter_limite_avant_facturation_pha() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturepha/"); */ } function consulter_limite_avant_facturation_pha_cons() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturephacons/"); */ } function consulter_limite_avant_facturation_pha_cons_ben() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturephaconsben/"); */ } function actualiser_opticien() { window.location.assign($("#racineWeb" ).val()+"Opticien/"); } function reinitialiser_opticien() { window.location.assign($("#racineWeb" ).val()+"Opticien/0"); } function consulter_limite_avant_facturation_opt() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureopt/"); */ } function consulter_limite_avant_facturation_opt_cons() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureoptcons/"); */ } function consulter_limite_avant_facturation_opt_cons_ben() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureoptconsben/"); */ } function ajouterexamen_lab_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/ajouterexamentous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function ajouterexamen_lab(idExamen) { donnees = 'idExamen='+idExamen; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/ajouterexamen/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function retirerexamen_lab(idExamen) { donnees = 'idExamen='+idExamen; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/retirerexamen/", type: 'POST', data: donnees, success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function ctrlkeypress_examens_possibles_lab(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_examens_possibles_lab(); } } function afficher_pop_recherche_examens_possibles_lab() { libelleActeSearch = $("#libelleActeSearch").val(); if(libelleActeSearch<=" ") { return; } donnees = "valid=1&libelleActeSearch="+libelleActeSearch; $("#div_liste_actes_possibles").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteexamenspossibleslab/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_liste_actes_possibles").html(data); } }); } function consulter_limite_avant_facturation_lab() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturelab/"); */ } function actualiser_laboratoire() { window.location.assign($("#racineWeb" ).val()+"Laboratoire/"); } function valider_examen_lab() { 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; } numeroExamen=$("#numeroExamen_C").val(); if (numeroExamen<="0") { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); facture = parseInt(facture); if (facture>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); if (facture==0 && nbLivre<1) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous ces actes?"; v_msgEng="Do you confirm those acts?"; // alert_ebene(v_msg, v_msgEng); if(confirm_ebene(v_msg, v_msgEng)) { user_id_0 = $("#user_id_C").val(); modeSaisieFacture=$("#modeSaisieFacture").val(); derogationFingerFacturation=$("#derogationFingerFacturation").val(); if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_lab(user_id_0); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_lab(user_id_0); } 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); } } } function retirerexamen_lab_tous() { $.ajax({ url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/retirerexamentous/", type: 'POST', success: function(data) { $("#livraison").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); // actualiser_pharmacien(); } }); } function facturer_lab(user_id) { facture=$("#facture").val(); facture = parseInt(facture); if (facture>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); if (facture==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=maillabo'; typeSms = "facturer_lab"; donnees_retour =""; 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()+"Ajaxdetaillaboratoire/enregistrerlaboratoire/", 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); window.location.assign($("#racineWeb" ).val()+"Laboratoire/"); } }); } function prescrire_examen_lab(codeActe, libelleActe, acteExclu, ententePrealable) { typeSms="ententeprealable"; if(libelleActeSearch<=" ") { return; } if(acteExclu==1) { v_msg="Acte non couvert!"; v_msgEng="Not covered!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; v_msgEng="Do you confirm this act : "+libelleActe+"?"; if(confirm_ebene(v_msg, v_msgEng)) { donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable; if (ententePrealable==1) { numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); donnees_sav = donnees+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; } $.ajax({ url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/ajouterexamenprescription/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#btn_close_pop_acte").click(); $("#livraison").html(data); if(ententePrealable==1) { preparesms(typeSms); v_msg="Demande accord prealable envoyée!"; v_msgEng="Request prior agreement sent!"; alert_ebene(v_msg, v_msgEng); } }, complete: function() { if(ententePrealable==1) { mettremailattente(donnees_sav); } alerter_depassement_limite(); } }); } } function enregistrer_nv_consommables() { libelleconsommable = $("#libelleconsommable").val(); if (libelleconsommable<=" ") { v_msg="Veuillez saisir le nom!"; v_msgEng="Please enter tyhe name!"; alert_ebene(v_msg, v_msgEng); $("#libelleconsommable").focus(); return; } quantiteconsommable=$("#quantiteconsommable").val(); quantiteconsommable=quantiteconsommable.replace(",","."); $("#quantiteconsommable").val(quantiteconsommable); if(isNaN(quantiteconsommable)) { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; alert_ebene(v_msg, v_msgEng); $("#quantiteconsommable").val("0"); $("#quantiteconsommable").focus(); return; } if(quantiteconsommable==0) { $("#quantiteconsommable").focus(); v_msg="Veuillez saisir la quantité!"; v_msgEng="Please enter the quantity!"; alert_ebene(v_msg, v_msgEng); return; } prixconsommable=$("#prixconsommable").val(); prixconsommable=prixconsommable.replace(",","."); $("#prixconsommable").val(prixconsommable); if(isNaN(prixconsommable)) { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; alert_ebene(v_msg, v_msgEng); $("#prixconsommable").val("0"); $("#prixconsommable").focus(); return; } if(prixconsommable==0) { $("#prixconsommable").focus(); v_msg="Veuillez saisir le prix!"; v_msgEng="Please enter the price!"; alert_ebene(v_msg, v_msgEng); return; } donnees = 'libelleconsommable='+libelleconsommable+'&prixconsommable='+prixconsommable+'&quantiteconsommable='+quantiteconsommable; $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteconsommables/creerconsommable/", type: 'POST', data: donnees, success: function(data) { // $('#div_test_gabarit').html(data); }, error: function(data) { }, complete: function() { afficher_consommable(); } }); } function ajax_maj_prix_consommable(idConsommable, valeurActe, controle) { valeurActe=valeurActe.replace(",","."); controle.value=valeurActe; if(controle_numerique(controle)) { if(valeurActe==0) { controle.focus(); v_msg="Veuillez saisir le prix!"; v_msgEng="Please enter the price!"; alert_ebene(v_msg, v_msgEng); return; } donnees = 'idConsommable='+idConsommable+"&valeurActe="+valeurActe; $.ajax({ url: $("#racineWeb").val()+"Ajaxlisteconsommables/majprix/", type: 'POST', data: donnees, success: function(data) { // $('#div_test_gabarit').html(data); }, error: function(data) { }, complete: function() { afficher_consommable(); } }); } } function remplacer_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; } window.location.assign($("#racineWeb" ).val()+"Remplacerfeuille/"); } function ajaxinfosremplacerbonconsultation() { 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); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosremplacerbonconsultation/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function enregistrerremplacementconsultation() { numeroBonSave = $("#numeroBonSave").val(); motifremplacement = $("#motifremplacement").val(); if (motifremplacement<=" ") { v_msg="Veuillez saisir le otif du remplacement!"; v_msgEng="Please enter the reason!"; alert_ebene(v_msg, v_msgEng); $("#motifremplacement").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); $("#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 presciption?"; if(confirm_ebene(v_msg, v_msgEng)) { numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); OldnumeroBon = $("#OldnumeroBon").val(); donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&numeroBon='+numeroBon+'&OldnumeroBon='+OldnumeroBon+'&motifremplacement='+motifremplacement; // donnees += '&dateSurvenance='+dateSurvenance+'&observations='+observations+'&prixActe='+prixActe; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosremplacerbonconsultation/enregistrerremplacementconsultation/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { }, complete: function() { v_msg="Feuille remplacée avec succès!"; v_msgEng="Replaced successfully!"; alert_ebene(v_msg, v_msgEng); feuillemaladie(); } }); } } function remplacer_ordonnance() { bonCaduc=$("#bonCaduc").val(); if (bonCaduc==1) { v_msg="Bon caduc!"; v_msgEng="Obsolete!"; alert_ebene(v_msg, v_msgEng); return; } facture=$("#facture").val(); if (facture!=1) { v_msg="Pas encore facturé, vous pouvez modifier l\'ordonnance!"; v_msgEng="Not yet 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); return; } */ codeGestionBon = $("#codeGestionBon").val(); if (codeGestionBon!="0") { v_msg="Option non disponible!"; v_msgEng="Option not available!"; alert_ebene(v_msg, v_msgEng); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); fiche_remplacer_ordonnance(); } else { beneficiaire = $("#beneficiaire_C").val(); user_id =$("#user_id_C").val(); finger_id =$("#finger_id_C").val(); $("#remplacerordonnance").val("1"); data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&remplacerordonnance=1"; load("flexcode/user.php?"+data); } } function fiche_remplacer_ordonnance() { window.location.assign($("#racineWeb" ).val()+"Remplacerordonnance/"); } function ajaxinfosremplacerordonnance() { 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); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosremplacerordonnence/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function enregistrerremplacementordonnance() { numeroBonSave = $("#numeroBonSave").val(); motifremplacement = $("#motifremplacement").val(); if (motifremplacement<=" ") { v_msg="Veuillez saisir le otif du remplacement!"; v_msgEng="Please enter the reason!"; alert_ebene(v_msg, v_msgEng); $("#motifremplacement").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); $("#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 presciption?"; if(confirm_ebene(v_msg, v_msgEng)) { numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); OldnumeroBon = $("#OldnumeroBon").val(); donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&numeroBon='+numeroBon+'&OldnumeroBon='+OldnumeroBon+'&motifremplacement='+motifremplacement; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosremplacerordonnence/enregistrerremplacementordonnance/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { }, complete: function() { v_msg="Ordonnance remplacée avec succès!"; v_msgEng="Replaced successfully!"; alert_ebene(v_msg, v_msgEng); prescription_medicament(); } }); } } function afficher_laboratoire_cso() { window.location.assign($("#racineWeb" ).val()+"Laboratoirecso/"); } function afficher_seance_cso() { window.location.assign($("#racineWeb" ).val()+"Kinecso/"); } function consulter_limite_avant_facturation_lab_cso() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturelabcso/"); */ } function rechercherbonexamen_lab() { numeroBonExamen=$("#numeroBonExamen").val(); if (numeroBonExamen>" ") { chercher_ordonnance_lab(numeroBonExamen); } } function rechercherbonexamen_lab_cso() { numeroBonExamen=$("#numeroBonExamen").val(); if (numeroBonExamen>" ") { chercher_ordonnance_lab_cso(numeroBonExamen); } } function chercher_ordonnance_lab_cso(numeroBonExamen) { donnees = 'numeroBonExamen='+numeroBonExamen; $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerordonnancelab/", type: 'POST', data: donnees, success: function(data) { }, error: function(data) { }, complete: function() { afficher_laboratoire_cso(); } }); } function valider_examen_lab_cso() { actVisible=$("#actVisible").val(); 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; } numeroExamen=$("#numeroExamen_C").val(); if (numeroExamen<="0") { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } /* facture=$("#facture").val(); facture = parseInt(facture); if (facture>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } */ nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); // alert("nbLivre => "+nbLivre); // return; // if (facture==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 ces actes?"; v_msgEng="Do you confirm those acts?"; if(confirm_ebene(v_msg, v_msgEng)) { user_id_0 = $("#user_id_C").val(); modeSaisieFacture=$("#modeSaisieFacture").val(); derogationFingerFacturation=$("#derogationFingerFacturation").val(); if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_lab_cso(user_id_0); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_lab_cso(user_id_0); } 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); } } } function facturer_lab_cso(user_id) { facture=$("#facture").val(); facture = parseInt(facture); if (facture>0) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } nbLivre=$("#nbLivre").val(); nbLivre = parseInt(nbLivre); if (facture==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=maillabo'; typeSms = "facturer_lab"; 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()+"Ajaxdetaillaboratoire/enregistrerlaboratoire/", 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); afficher_laboratoire_cso(); } }); } function prescription_seance() { actVisible=$("#actVisible").val(); modeSaisieFeuille=$("#modeSaisieFeuille").val(); if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") { v_msg="Non autorisé!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } if (actVisible!="1") { v_msg="Non autorisée!"; v_msgEng="Not allowed!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Prescriptionseance/"); } function seances() { 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; } numeroPrescriptionKine=$("#numeroPrescriptionKine_C").val(); if (numeroPrescriptionKine==0) { v_msg="Aucune séance prescrite!"; v_msgEng="No prescribed session!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Seances/"); } function ajaxinfosbonprescriptionseance() { 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; } numeroBonKine = $("#numeroBonKine").val(); numeroBonKine = parseInt(numeroBonKine); if (numeroBonKine>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(""); $("#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()+"Ajaxinfosbonseance/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function enregistrerprescriptionseance() { 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()+"Ajaxenregistrerprescriptionseance/enregistrerprescriptionseance/", 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_seance(); } }); } } function modifierprescriptionseance() { acteExclu = $("#acteExclu").val(); ententePrealable = $("#ententePrealableSea").val(); autorisation = "0"; if(acteExclu==1) { v_msg="Acte non couvert!"; v_msgEng="Not covered!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); 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); // $("#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); $("#numeroBon").focus(); return; } codeActePrescription = $("#codeActe").val(); if (codeActePrescription<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); // $("#codeActePrescription").focus(); return; } quantite =$("#quantite").val(); 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; } div_prix = $("#prixActe"); prixActe = div_prix.val(); /* if(prixActe==0) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } */ v_msg="Confirmez-vous cette presciption ?"; v_msgEng="Do you confirm this prescription?"; if(confirm_ebene(v_msg, v_msgEng)) { if(ententePrealable==1) { ententePrealable = "2"; } montantTm =$("#montantTm").val(); montantArembourser =$("#aRembourser").val(); fraisReel =$("#totalActe").val(); donnees = 'codeActePrescription='+codeActePrescription +'&quantite='+quantite +'&prixActe='+prixActe; donnees += '&montantTm='+montantTm +'&montantArembourser='+montantArembourser +'&fraisReel='+fraisReel; donnees += '&ententePrealable='+ententePrealable; numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); donnees_sav = 'codeActe='+codeActePrescription+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; donnees_sav2 = 'codeActe='+codeActePrescription+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailautorisation'; typeSms="ententeprealable"; typeSms2="autorisation"; $("#btn_enreg_seance").disable(); $.ajax({ url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionseance/modifierprescriptionseance/", type : 'post', data: donnees, error: function(errorData) { $("#msgErreur").html(errorData); }, success: function(data) { 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="Prescription enregistrée avec succès"; v_msgEng="Saved successfully!"; alert_ebene(v_msg, v_msgEng); prescription_seance(); } }); } } function ajaxprixseance() { $("#prixActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); // $("#quantite_info").val("0"); codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un act!"; 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 le nombre de séances!"; v_msgEng="Please enter the number of sessions!"; alert_ebene(v_msg, v_msgEng); return; } // on va griser le bouton btn_enreg_seance $("#btn_enreg_seance").disable(); donnees = 'codeActe='+codeActe+'&quantite='+quantite; $.ajax({ url: $("#racineWeb").val()+"Ajaxprixseance/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { } }); } function valider_presciption_seances() { 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; } numeroBonKine=$("#numeroBonKine").val(); if (numeroBonKine<=0) { v_msg="Pas de prescription!"; v_msgEng="No prescription!"; alert_ebene(v_msg, v_msgEng); // feuillemaladie(); return; } codeActePrescription = $("#codeActePrescription").val(); if (codeActePrescription<=" ") { v_msg="Veuillez sélectionner un acte!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#btn_prescrire").click(); return; } nbSeance=$("#nbSeance").val(); nbSeance = parseInt(nbSeance); if (nbSeance<1) { v_msg="Veuillez saisir le nombre de séances!"; v_msgEng="Please enter the number of sessions!"; alert_ebene(v_msg, v_msgEng); $("#btn_prescrire").click(); return; } v_msg="Confirmez-vous cette presciption ?"; v_msgEng="Do you confirm this prescription?"; if(confirm_ebene(v_msg, v_msgEng)) { feuillemaladie(); } } function valider_seance_cso() { ententePrealableSea=$("#ententePrealableSea").val(); if (ententePrealableSea>1) { v_msg="Entente préalable!"; v_msgEng="Prior agreement!"; 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(); nbBonsCons = $("#nbBonsCons").val(); facture=$("#facture").val(); if (facture==1) { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } numeroBonSeance=$("#numeroBonSeance_C").val(); if (numeroBonSeance<="0") { v_msg="Veuillez sélectionner un bon!"; v_msgEng="Please enter a prescription number!"; alert_ebene(v_msg, v_msgEng); $("#btn_InitSession").click(); return; } div_quantite = $("#quantiteSeance"); 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 le nombre de séances!"; v_msgEng="Please enter the number of sessions!"; alert_ebene(v_msg, v_msgEng); return; } div_prix = $("#prixActe"); prixActe = div_prix.val(); if(prixActe==0) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous ces séances?"; v_msgEng="Do you confirm these sessions?"; if(confirm_ebene(v_msg, v_msgEng)) { // ajout du 27/06/2019 => prise en compte de la gestion paperless donnees = 'codeGestionBon='+codeGestionBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxdetailseance/enregistrerseance/", type: 'POST', data: donnees, success: function(data) { // $('#div_test_gabarit').html(data); maj_fraisexclu_cso(); }, error: function(data) { }, complete: function() { feuillemaladie(); } }); } } function actualiser_seance() { window.location.assign($("#racineWeb" ).val()+"Seances/"); } // SEANCES KINE function valider_seance_sea_cso() { ententePrealableSea=$("#ententePrealableSea").val(); if (ententePrealableSea>1) { v_msg="Entente préalable!"; v_msgEng="Prior agreement!"; 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(); nbBonsCons = $("#nbBonsCons").val(); 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; } numeroBonSeance=$("#numeroBonSeance_C").val(); if (numeroBonSeance<="0") { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un act!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } quantiteSeance=$("#quantiteSeance").val(); if (quantiteSeance<=0) { v_msg="Veuillez revoir la quantité!"; v_msgEng="Please review the quantity!"; alert_ebene(v_msg, v_msgEng); return; } fraisRetenuSeance=$("#fraisRetenuSeance").val(); if (fraisRetenuSeance<=0) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous ces séances?"; v_msgEng="Do you confirm those sessions?"; if(confirm_ebene(v_msg, v_msgEng)) { user_id_0 = $("#user_id_C").val(); modeSaisieFacture=$("#modeSaisieFacture").val(); derogationFingerFacturation=$("#derogationFingerFacturation").val(); if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_sea_cso(user_id_0); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_sea_cso(user_id_0); } 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_sea_cso(user_id) { 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(); nbBonsCons = $("#nbBonsCons").val(); cout = $("#cout").val(); if (cout==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } prixActe = $("#prixActe").val(); 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=mailkine'; typeSms = "facturer_sea"; 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; // ajout du 27/06/2019 => prise en compte de la gestion paperless // donnees += '&codeGestionBon='+codeGestionBon; donnees_substitut += '&codeGestionBon='+codeGestionBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxfacturatioseancesea/facturerseance/", type: 'POST', data: donnees_substitut, success: function(data) { // $('#div_test_gabarit').html(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); afficher_seance_cso(); } }); } function rechercherbonkine_sea() { numeroBonKine=$("#numeroBonKine").val(); if (numeroBonKine>" ") { chercher_ordonnance_sea(numeroBonKine); } } function chercher_ordonnance_sea(numeroBonKine) { $("#numeroBonSeance_C").val("-1"); donnees = 'numeroBonKine='+numeroBonKine; $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerordonnancesea/", type: 'POST', data: donnees, success: function(data) { window.location.assign($("#racineWeb" ).val()+"Kine/"); }, error: function(data) { }, complete: function() { } }); } function ctrlkeypressordsea(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { numeroBonKine=$("#numeroBonKine").val(); $("#numeroBonKine").blur(); } } function rechercherbonkine_sea_cso() { numeroBonKine=$("#numeroBonKine").val(); if (numeroBonKine>" ") { chercher_ordonnance_sea_cso(numeroBonKine); } } function chercher_ordonnance_sea_cso(numeroBonKine) { $("#numeroBonSeance_C").val("-1"); donnees = 'numeroBonKine='+numeroBonKine; $.ajax({ url: $("#racineWeb").val()+"Ajaxchangerordonnancesea/", type: 'POST', data: donnees, success: function(data) { window.location.assign($("#racineWeb" ).val()+"Kinecso/"); }, error: function(data) { }, complete: function() { } }); } function ajaxinfosbonseancekine() { 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; } 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_bon_kine").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonseancekine/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function enregistrerbonsseancekine() { 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(); nbBonsCons = $("#nbBonsCons").val(); if (codeGestionBon=="0") { numeroBonSave = $("#numeroBonSave").val(); 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 presciption?"; } else { // numeroBon = "-1"; numeroBon = "1"; v_msg="Confirmez-vous ce dossier?"; v_msgEng="Do you confirm this claim?"; } /* v_msg="Confirmez-vous ce No de bon?"; v_msgEng="Do you confirm this number of presciption?"; */ if(confirm_ebene(v_msg, v_msgEng)) { donnees = "numeroBon="+numeroBon; // ajout du 27/06/2019 => prise en compte de la gestion paperless donnees += '&codeGestionBon='+codeGestionBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonseancekine/attributionbontemporaire/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { // $('#div_test_gabarit').html(data); }, complete: function() { afficher_facturation_seance(); } }); } } function afficher_facturation_seance() { $.ajax({ url: $("#racineWeb").val()+"Ajaxfacturatioseancesea/", // type : 'post', // data: donnees, error: function(errorData) { }, success: function(data) { $("#btn_close_pop_session").click(); $("#div_facturation_seance").html(data); }, complete: function(data) { $("#numeroBonSeance_C").val($("#numeroBonSeance_info").val()); } }); } function ajaxprixseancesea() { codeActe = $("#codeActe").val(); if (codeActe<=" ") { $("#prixActe_info").val("0"); $("#totalActe_info").val("0"); $("#montantTm_info").val("0"); $("#aRembourser_info").val("0"); v_msg="Veuillez sélectionner un act!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } div_quantite = $("#quantiteSeance"); quantite = div_quantite.val(); if(quantite=="") { quantite = "0"; } div_quantite.val(quantite); quantite = parseInt(quantite); if(quantite==0) { div_quantite.val(1); quantite = 1; /* div_quantite.focus(); v_msg="Veuillez saisir le nombre de séances!"; v_msgEng="Please enter the number of sessions!"; alert_ebene(v_msg, v_msgEng); return; */ } div_nbRestant = $("#nbRestant"); nbRestant = div_nbRestant.val(); nbRestant = parseInt(nbRestant); if(quantite>nbRestant) { // div_quantite.focus(); v_msg="Vous ne pouvez pas dépasser "+nbRestant+" séances!"; v_msgEng="Only "+nbRestant+" sessions are possible!"; alert_ebene(v_msg, v_msgEng); // return; quantite = 0; } donnees = 'codeActe='+codeActe+'&quantite='+quantite; $.ajax({ url: $("#racineWeb").val()+"Ajaxprixseancesea/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosacte").html(data); }, complete: function() { } }); } // Facturation SEANCE KINE function valider_seance_sea() { ententePrealableSea=$("#ententePrealableSea").val(); if (ententePrealableSea>1) { v_msg="Entente préalable!"; v_msgEng="Prior agreement!"; 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(); nbBonsCons = $("#nbBonsCons").val(); 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; } numeroBonSeance=$("#numeroBonSeance_C").val(); if (numeroBonSeance<="0") { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } codeActe = $("#codeActe").val(); if (codeActe<=" ") { v_msg="Veuillez sélectionner un act!"; v_msgEng="Please select an act!"; alert_ebene(v_msg, v_msgEng); $("#codeActe").focus(); return; } fraisRetenuSeance=$("#fraisRetenuSeance").val(); if (fraisRetenuSeance<=0) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } v_msg="Confirmez-vous ces séances?"; v_msgEng="Do you confirm those sessions?"; if(confirm_ebene(v_msg, v_msgEng)) { user_id_0 = $("#user_id_C").val(); modeSaisieFacture=$("#modeSaisieFacture").val(); derogationFingerFacturation=$("#derogationFingerFacturation").val(); if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_sea(user_id_0); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_sea(user_id_0); } 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); } } } function facturer_sea(user_id) { 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(); nbBonsCons = $("#nbBonsCons").val(); cout = $("#cout").val(); if (cout==0) { v_msg="Rien à facturer!"; v_msgEng="Nothing to bill!"; alert_ebene(v_msg, v_msgEng); return; } prixActe = $("#prixActe").val(); 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=mailkine'; typeSms = "facturer_sea"; 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; // ajout du 27/06/2019 => prise en compte de la gestion paperless donnees_substitut += '&codeGestionBon='+codeGestionBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxfacturatioseancesea/facturerseance/", 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); // window.location.assign($("#racineWeb" ).val()+"Kine/"); afficher_seance_kine(); } }); } /* function rechercherbonexamen_lab_cso() { numeroBonExamen=$("#numeroBonExamen").val(); if (numeroBonExamen>" ") { chercher_ordonnance_lab_cso(numeroBonExamen); } } */ // 19/11/2017 function enregistrerbonsseancekinecso() { 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(); nbBonsCons = $("#nbBonsCons").val(); if (codeGestionBon=="0") { numeroBonSave = $("#numeroBonSave").val(); 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 presciption?"; } else { // numeroBon = "-1"; numeroBon = "1"; v_msg="Confirmez-vous ce dossier?"; v_msgEng="Do you confirm this claim?"; } /* v_msg="Confirmez-vous ce No de bon?"; v_msgEng="Do you confirm this number of presciption?"; */ if(confirm_ebene(v_msg, v_msgEng)) { donnees = "numeroBon="+numeroBon; // ajout du 27/06/2019 => prise en compte de la gestion paperless donnees += '&codeGestionBon='+codeGestionBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonseancekinecso/attributionbontemporaire/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { // $('#div_test_gabarit').html(data); }, complete: function() { afficher_facturation_seance_cso(); } }); } } function afficher_facturation_seance_cso() { $.ajax({ url: $("#racineWeb").val()+"Ajaxfacturatioseancecso/", error: function(errorData) { }, success: function(data) { $("#btn_close_pop_session").click(); $("#div_facturation_seance").html(data); }, complete: function(data) { $("#numeroBonSeance_C").val($("#numeroBonSeance_info").val()); } }); } function ajaxinfosbonseancekinecso() { 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; } 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_bon_kine").disable(); $("#msgErreur").html(""); $("#codeEtatBon").val(""); $("#numeroBon").focus(); return; } donnees = "numeroBon="+numeroBon; $.ajax({ url: $("#racineWeb").val()+"Ajaxinfosbonseancekinecso/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#infosbon").html(data); }, complete: function() { } }); } function ajaxmajquteseancecso() { div_prix = $("#prixActe"); prixActe = div_prix.val(); if(prixActe==0) { v_msg="Veuillez revoir le tarif!"; v_msgEng="Please review rate!"; alert_ebene(v_msg, v_msgEng); return; } div_quantite = $("#quantiteSeance"); 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 le nombre de séances!"; v_msgEng="Please enter the number of sessions!"; alert_ebene(v_msg, v_msgEng); return; } div_nbRestant = $("#nbRestant"); nbRestant = div_nbRestant.val(); nbRestant = parseInt(nbRestant); if(quantite>nbRestant) { div_quantite.focus(); v_msg="Vous ne pouvez pas dépasser "+nbRestant+" séances!"; v_msgEng="Only "+nbRestant+" sessions are possible!"; alert_ebene(v_msg, v_msgEng); return; } $("#btn_enreg_seance").disable(); donnees = 'prixActe='+prixActe+'&quantite='+quantite; $.ajax({ url: $("#racineWeb").val()+"Ajaxfacturatioseancecso/modifierseancecso/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { // $("#infoseance").html(data); }, complete: function() { afficher_facturation_seance_cso(); } }); } function consulter_limite_avant_facturation_kinecso(idFacture) { /* if (idFacture<=0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturekinecso/"+idFacture+"/"); */ } function consulter_limite_avant_facturation_kine(idFacture) { /* if (idFacture<=0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturekine/"+idFacture+"/"); */ } function afficher_seance_kine() { window.location.assign($("#racineWeb" ).val()+"Kine/"); } // consulatation_ben function consultationbenlab() { window.location.assign($("#racineWeb" ).val()+"Consultationbenlab/"); } function consultationbensea() { window.location.assign($("#racineWeb" ).val()+"Consultationbensea/"); } function laboratoire() { 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=$("#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()+"Laboratoire/"); } } function seancekine() { 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=$("#okId_face" ).val(); if (okId!=1 && 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()+"Kine/"); } } function afficher_facture_cons_lab(idFacture, numeroBonExamen, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonExamen='+numeroBonExamen+'&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfacturelab/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_lab(); } }); } } function consulter_facture_lab() { window.location.assign($("#racineWeb" ).val()+"Laboratoirecons/"); } function consulter_limite_avant_facturation_lab_cons() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturelabcons/"); */ } function afficher_facture_cons_lab_ben(idFacture, numeroBonExamen, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonExamen='+numeroBonExamen+'&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfacturelab/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_lab_ben(); } }); } } function consulter_facture_lab_ben() { window.location.assign($("#racineWeb" ).val()+"Laboratoireconsben/"); } function consulter_limite_avant_facturation_lab_cons_ben() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturelabconsben/"); */ } function listerdossiercons_lab() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; donnees_sav = donnees; $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationlabentete/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#reglement").html(data); }, complete: function() { } }); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationlab/", type : 'post', data: donnees_sav, error: function(errorData) { }, success: function(data) { $("#detail_reglement").html(data); $("#detail_reglement").css("padding-top", "0px"); }, complete: function() { } }); } function lister_factures_lab_ben() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationbenlab/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_dossiers").html(data); }, complete: function() { } }); } function consultationsea() { window.location.assign($("#racineWeb" ).val()+"Consultationsea/"); } function listerdossiercons_sea() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; donnees_sav = donnees; $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationseaentete/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#reglement").html(data); }, complete: function() { } }); $.ajax({ url: $("#racineWeb").val()+"Ajaxconsultationsea/", type : 'post', data: donnees_sav, error: function(errorData) { }, success: function(data) { $("#detail_reglement").html(data); $("#detail_reglement").css("padding-top", "0px"); }, complete: function() { } }); } function consulter_facture_sea() { window.location.assign($("#racineWeb" ).val()+"Kinecons/"); } function consulter_limite_avant_facturation_sea_cons() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureseacons/"); */ } function lister_factures_sea_ben() { d1=$("#d1").val(); d2=$("#d2").val(); donnees = 'd1='+d1+'&d2='+d2; $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ // url: $("#racineWeb").val()+"Ajaxconsultationbenlab/", url: $("#racineWeb").val()+"Ajaxconsultationbensea/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_dossiers").html(data); }, complete: function() { } }); } function afficher_facture_cons_sea(idFacture, numeroBonKine, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonKine='+numeroBonKine+'&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfacturesea/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_sea(); } }); } } function afficher_facture_cons_sea_ben(idFacture, numeroBonKine, codePrestataireLivraison) { if (idFacture>"") { donnees = 'idFacture='+idFacture+'&numeroBonKine='+numeroBonKine+'&codePrestataireLivraison='+codePrestataireLivraison; $.ajax({ url: $("#racineWeb").val()+"Ajaxcontextfacturesea/", type : 'post', data: donnees, error: function(errorData) { }, complete: function() { consulter_facture_sea_ben(); } }); } } function consulter_facture_sea_ben() { window.location.assign($("#racineWeb" ).val()+"Kineconsben/"); } function consulter_limite_avant_facturation_sea_cons_ben() { /* idFacture=$("#idFacture_C").val(); if (idFacture==0) { v_msg="Pas encore facturée!"; v_msgEng="Not yet charged!"; alert_ebene(v_msg, v_msgEng); return; } window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureseaconsben/"); */ } function ctrlkeypress_numeroBon(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { $("#numeroBon").blur(); } } function verifier_feuille_maladie_dec_cons(numeroFeuilleMaladie, idFacture) { $("#numeroFeuilleMaladie_C").val(numeroFeuilleMaladie); numeroDecompte = $("#numeroDecompte").val(); // if (numeroFeuilleMaladie>"") if (idFacture>"") { donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&numeroDecompte='+numeroDecompte+'&idFacture='+idFacture; codeTypePrestataire = $("#codeTypePrestataire_C").val(); if(codeTypePrestataire=="CSO" || codeTypePrestataire=="LAB" || codeTypePrestataire=="SEA") { verifier_feuille_maladie_dec_cso_cons(donnees); } else if(codeTypePrestataire=="PHA") { verifier_feuille_maladie_dec_pha_cons(donnees); } else if(codeTypePrestataire=="OPT") { verifier_feuille_maladie_dec_opt_cons(donnees); } } } function imprimerbordereaudecompte() { idReglement = $("#idReglement").val(); if (idReglement>"0") { var div_wait = $('#div_wait'); div_wait.html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaximprimerdemandereglement/imprimerbordereaudecompte", type: 'POST', success: function(data) { div_wait.html(data); }, error : function(resultat, statut, erreur) { }, complete: function(data) { } }); } } function verifier_feuille_maladie_dec_cso_cons(donnees) { $.ajax({ url: $("#racineWeb").val()+"Ajaxverifierfacturecons/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_verification_facture").html(data); }, complete: function() { $("#btn_pop").click(); } }); } function verifier_feuille_maladie_dec_pha_cons(donnees) { $.ajax({ url: $("#racineWeb").val()+"Ajaxverifierfacturephacons/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_verification_facture").html(data); }, complete: function() { $("#btn_pop").click(); } }); } function verifier_feuille_maladie_dec_opt_cons(donnees) { $.ajax({ url: $("#racineWeb").val()+"Ajaxverifierfactureoptcons/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_verification_facture").html(data); }, complete: function() { $("#btn_pop").click(); } }); } function limite_avant_facture_dec(idFacture) { donnees = 'idFacture='+idFacture; $.ajax({ url: $("#racineWeb").val()+"AjaxPlafondavantfacturecdec/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_limites").html(data); }, complete: function() { } }); } function demander_decompte() { window.location.assign($("#racineWeb" ).val()+"Initdemandedecompte/"); } function initierdemandedecompte() { codeExercice=$("#codeExercice").val(); codeMois=$("#codeMois").val(); if (codeExercice<=" ") { v_msg="Veuillez sélectionner un exercice!"; v_msgEng="Please select an exercise!"; alert_ebene(v_msg, v_msgEng); $("#codeExercice").focus(); return; } if (codeMois<=" ") { v_msg="Veuillez sélectionner une période!"; v_msgEng="Please select a period!"; alert_ebene(v_msg, v_msgEng); $("#codeMois").focus(); return; } donnees = 'codeExercice='+codeExercice+'&codeMois='+codeMois; // $("#div_dossiers").html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxdemandedecompte/initierdemandedecompte/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#inforegle").html(data); }, complete: function() { regle=$("#regle").val(); if(regle==-1) { v_msg="Problème lors de l\'initialisation!"; v_msgEng="Problem during initialization!"; alert_ebene(v_msg, v_msgEng); return; } else { afficher_demande_decompte(); } } }); } function afficher_demande_decompte() { $("#detail_demande_decompte").html('
  ' + 'Veuillez patienter...' + '
'); window.location.assign($("#racineWeb" ).val()+"Demandedecompte/"); } function imprimerbordereaudemandedecompte() { idDemandeDecompte = $("#idDemandeDecompte").val(); if (idDemandeDecompte>"0") { var div_wait = $('#div_wait'); div_wait.html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaximprimerdemandedecompte/imprimerdemandecompte", type: 'POST', success: function(data) { div_wait.html(data); }, error : function(resultat, statut, erreur) { }, complete: function(data) { } }); } } function rechargerdemandedecompte() { $("#detail_demande_decompte").html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxdemandedecompte/rechargerdemandedecompte/", type : 'post', error: function(errorData) { }, success: function(data) { afficher_demande_decompte(); }, complete: function() { } }); } function actualiser_decompte() { $("#div_detail").html('
  ' + 'Veuillez patienter...' + '
'); window.location.assign($("#racineWeb" ).val()+"Decomptecons/"); } function monture() { $("#monture").val("1"); if (prestation_possible()) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); window.location.assign($("#racineWeb" ).val()+"Monture/"); /* MAJ du 06/06/2019 => proposition de Pascal => les magasins d'optique n'ont pas de lecteurs d'empriente modeSaisieFacture=$("#modeSaisieFacture").val(); if(modeSaisieFacture=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); window.location.assign($("#racineWeb" ).val()+"Monture/"); 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()+"Monture/"); */ } } function actualiser_monture() { window.location.assign($("#racineWeb" ).val()+"Monture/"); } function valider_monture() { dejaFacture=$("#dejaFacture").val(); // alert("dejaFacture =>" +dejaFacture); // return; if (dejaFacture=="1") { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } ententePrealableMont=$("#ententePrealableMont").val(); nbActesMonture=$("#nbActesMonture").val(); if (nbActesMonture>0 && ententePrealableMont!=1) { /* v_msg="Montures déjà livrées une fois!"; v_msgEng="Frames already delivered once!"; */ v_msg="Veuillez demander une autorisation!"; v_msgEng="Please ask for an authorization!"; alert_ebene(v_msg, v_msgEng); return; } numeroFacture=$("#numeroFacture").val(); if (numeroFacture<=" ") { v_msg="Veuillez saisir le No de la facture!"; v_msgEng="Please enter the Invoice No!"; alert_ebene(v_msg, v_msgEng); $("#numeroFacture").focus(); return; } prixActe = $("#prixActe").val(); if (prixActe==0) { 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)) { user_id_0 = $("#user_id_C").val(); $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_monture(user_id_0); /* MAJ du 06/06/2019 => proposition de Pascal => les magasins d'optique n'ont pas de lecteurs d'empriente modeSaisieFacture=$("#modeSaisieFacture").val(); derogationFingerFacturation=$("#derogationFingerFacturation").val(); if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_monture(user_id_0); return; } derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); if(derogation_finger_en_cours>0) { $("#okId" ).val("1"); $("#okId_face" ).val("1"); facturer_monture(user_id_0); } 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); } */ } } function maj_monture_temp_monture(idOptique, monture) { numeroFacture=$("#numeroFacture").val(); donnees = 'idOptique='+idOptique+"&monture="+monture+"&numeroFacture="+numeroFacture; $.ajax({ url: $("#racineWeb").val()+"Ajaxmonture/majmonture/", type: 'POST', data: donnees, success: function(data) { $("#div_monture").html(data); }, error: function(data) { }, complete: function() { alerter_depassement_limite(); } }); } function facturer_monture(user_id) { dejaFacture=$("#dejaFacture").val(); if (dejaFacture=="1") { v_msg="Déjà facturé!"; v_msgEng="Already charged!"; alert_ebene(v_msg, v_msgEng); return; } numeroFacture=$("#numeroFacture").val(); if (numeroFacture<=" ") { v_msg="Veuillez saisir le No de la facture!"; v_msgEng="Please enter the Invoice No!"; alert_ebene(v_msg, v_msgEng); $("#numeroFacture").focus(); 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; donnees += '&numeroFacture='+numeroFacture; // numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); codePrestataire = $("#codePrestataire_C").val(); donnees_sav = 'codePrestataire='+codePrestataire+'&typeMail=mailoptique'; typeSms = "facturer_mont"; donnees_retour =""; user_id_0 = $("#user_id_C").val(); user_id_substitut = "0"; if (user_id_0!=user_id) { user_id_substitut = user_id; } donnees += '&user_id_substitut='+user_id_substitut; $.ajax({ url: $("#racineWeb").val()+"Ajaxmonture/enregistrermonture/", type: 'POST', data: donnees, success: function(data) { donnees_retour = 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); $("#div_monture").html(donnees_retour); // window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"); } }); } function requetes_prestaire() { window.location.assign($("#racineWeb" ).val()+"Requetes/"); } function ajaxenteterequete() { codeRequete=$("#codeRequete").val(); if (codeRequete<=" ") { v_msg="Veuillez sélectionner une requête!"; v_msgEng="Please select a query!"; alert_ebene(v_msg, v_msgEng); $("#codeRequete").focus(); return; } donnees = 'codeRequete='+codeRequete; v_url = $("#racineWeb").val()+"Ajaxrequeteentete"+codeRequete+"/"; $.ajax({ url: v_url, type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_ente_requete").html(data); $(".datepicker" ).datepicker(); } }); } function requetes_feuilles_maladie() { $('#div_export_a').html(""); donnees = ""; donnees_retour = ""; codeRequete=$("#codeRequete").val(); if (codeRequete<=" ") { v_msg="Veuillez sélectionner une requête!"; v_msgEng="Please select a query!"; alert_ebene(v_msg, v_msgEng); $("#codeRequete").focus(); return; } v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; // Ligne 1 codePrestataire = $("#codePrestataire").val(); dateConsultation1 = $("#dateConsultation1").val(); dateConsultation2 = $("#dateConsultation2").val(); numeroAdherent = $("#numeroAdherent").val(); numeroBeneficiaire = $("#numeroBeneficiaire").val(); // Ligne 2 codeMedecin = $("#codeMedecin").val(); numeroBonConsultation1 = $("#numeroBonConsultation1").val(); numeroBonConsultation2 = $("#numeroBonConsultation2").val(); numeroBonOrdonnance1 = $("#numeroBonOrdonnance1").val(); numeroBonOrdonnance2 = $("#numeroBonOrdonnance2").val(); numeroBonHospitalisation1 = $("#numeroBonHospitalisation1").val(); numeroBonHospitalisation2 = $("#numeroBonHospitalisation2").val(); numeroBonOptique1 = $("#numeroBonOptique1").val(); numeroBonOptique2 = $("#numeroBonOptique2").val(); // Ligne 3 codeTypePrestataire = $("#codeTypePrestataire").val(); numeroDecompte1 = $("#numeroDecompte1").val(); numeroDecompte2 = $("#numeroDecompte2").val(); codeRaisonConsultation = $("#codeRaisonConsultation").val(); hospitalisation = $("#hospitalisation").val(); numeroChambre = $("#numeroChambre").val(); chirurgie = $("#chirurgie").val(); facture = $("#facture").val(); // Ligne 4 adherent = $("#adherent").val(); beneficiaire = $("#beneficiaire").val(); // FIN champs // DEBUT convertir_en_entier numeroBonConsultation1 = convertir_en_entier(numeroBonConsultation1); numeroBonConsultation2 = convertir_en_entier(numeroBonConsultation2); numeroBonOrdonnance1 = convertir_en_entier(numeroBonOrdonnance1); numeroBonOrdonnance2 = convertir_en_entier(numeroBonOrdonnance2); numeroBonOptique1 = convertir_en_entier(numeroBonOptique1); numeroBonOptique2 = convertir_en_entier(numeroBonOptique2); numeroBonHospitalisation1 = convertir_en_entier(numeroBonHospitalisation1); numeroBonHospitalisation2 = convertir_en_entier(numeroBonHospitalisation2); // FIN convertir_en_entier // Ligne 1 donnees += 'codePrestataire=' + codePrestataire; donnees += '&dateConsultation1=' + dateConsultation1; donnees += '&dateConsultation2=' + dateConsultation2; donnees += '&numeroAdherent=' + numeroAdherent; donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; // Ligne 2 donnees += '&codeMedecin=' + codeMedecin; donnees += '&numeroBonConsultation1=' + numeroBonConsultation1; donnees += '&numeroBonConsultation2=' + numeroBonConsultation2; donnees += '&numeroBonOrdonnance1=' + numeroBonOrdonnance1; donnees += '&numeroBonOrdonnance2=' + numeroBonOrdonnance2; donnees += '&numeroBonHospitalisation1=' + numeroBonHospitalisation1; donnees += '&numeroBonHospitalisation2=' + numeroBonHospitalisation2; donnees += '&numeroBonOptique1=' + numeroBonOptique1; donnees += '&numeroBonOptique2=' + numeroBonOptique2; // Ligne 3 donnees += '&codeTypePrestataire=' + codeTypePrestataire; donnees += '&numeroDecompte1=' + numeroDecompte1; donnees += '&numeroDecompte2=' + numeroDecompte2; donnees += '&codeRaisonConsultation=' + codeRaisonConsultation; donnees += '&hospitalisation=' + hospitalisation; donnees += '&numeroChambre=' + numeroChambre; donnees += '&chirurgie=' + chirurgie; donnees += '&facture=' + facture; // Ligne 4 donnees += '&adherent=' + adherent; donnees += '&beneficiaire=' + beneficiaire; $("#div_detail_requete").html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: v_url, type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { donnees_retour = data; //$("#div_detail_requete").html(data); }, complete: function() { $("#div_detail_requete").html(donnees_retour); $("#nbligne").val("Result : "+$("#nbligne_info").val()); } }); } function requetes_feuilles_maladie_export() { $('#div_detail_requete').html(''); $('#div_export_a').html(""); donnees = ""; donnees_retour = ""; codeRequete=$("#codeRequete").val(); if (codeRequete<=" ") { v_msg="Veuillez sélectionner une requête!"; v_msgEng="Please select a query!"; alert_ebene(v_msg, v_msgEng); $("#codeRequete").focus(); return; } v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; // Ligne 1 codePrestataire = $("#codePrestataire").val(); dateConsultation1 = $("#dateConsultation1").val(); dateConsultation2 = $("#dateConsultation2").val(); numeroAdherent = $("#numeroAdherent").val(); numeroBeneficiaire = $("#numeroBeneficiaire").val(); // Ligne 2 codeMedecin = $("#codeMedecin").val(); numeroBonConsultation1 = $("#numeroBonConsultation1").val(); numeroBonConsultation2 = $("#numeroBonConsultation2").val(); numeroBonOrdonnance1 = $("#numeroBonOrdonnance1").val(); numeroBonOrdonnance2 = $("#numeroBonOrdonnance2").val(); numeroBonHospitalisation1 = $("#numeroBonHospitalisation1").val(); numeroBonHospitalisation2 = $("#numeroBonHospitalisation2").val(); numeroBonOptique1 = $("#numeroBonOptique1").val(); numeroBonOptique2 = $("#numeroBonOptique2").val(); // Ligne 3 codeTypePrestataire = $("#codeTypePrestataire").val(); numeroDecompte1 = $("#numeroDecompte1").val(); numeroDecompte2 = $("#numeroDecompte2").val(); codeRaisonConsultation = $("#codeRaisonConsultation").val(); hospitalisation = $("#hospitalisation").val(); numeroChambre = $("#numeroChambre").val(); chirurgie = $("#chirurgie").val(); facture = $("#facture").val(); // Ligne 4 adherent = $("#adherent").val(); beneficiaire = $("#beneficiaire").val(); // FIN champs // DEBUT convertir_en_entier numeroBonConsultation1 = convertir_en_entier(numeroBonConsultation1); numeroBonConsultation2 = convertir_en_entier(numeroBonConsultation2); numeroBonOrdonnance1 = convertir_en_entier(numeroBonOrdonnance1); numeroBonOrdonnance2 = convertir_en_entier(numeroBonOrdonnance2); numeroBonOptique1 = convertir_en_entier(numeroBonOptique1); numeroBonOptique2 = convertir_en_entier(numeroBonOptique2); numeroBonHospitalisation1 = convertir_en_entier(numeroBonHospitalisation1); numeroBonHospitalisation2 = convertir_en_entier(numeroBonHospitalisation2); // FIN convertir_en_entier // Ligne 1 donnees += 'codePrestataire=' + codePrestataire; donnees += '&dateConsultation1=' + dateConsultation1; donnees += '&dateConsultation2=' + dateConsultation2; donnees += '&numeroAdherent=' + numeroAdherent; donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; // Ligne 2 donnees += '&codeMedecin=' + codeMedecin; donnees += '&numeroBonConsultation1=' + numeroBonConsultation1; donnees += '&numeroBonConsultation2=' + numeroBonConsultation2; donnees += '&numeroBonOrdonnance1=' + numeroBonOrdonnance1; donnees += '&numeroBonOrdonnance2=' + numeroBonOrdonnance2; donnees += '&numeroBonHospitalisation1=' + numeroBonHospitalisation1; donnees += '&numeroBonHospitalisation2=' + numeroBonHospitalisation2; donnees += '&numeroBonOptique1=' + numeroBonOptique1; donnees += '&numeroBonOptique2=' + numeroBonOptique2; // Ligne 3 donnees += '&codeTypePrestataire=' + codeTypePrestataire; donnees += '&numeroDecompte1=' + numeroDecompte1; donnees += '&numeroDecompte2=' + numeroDecompte2; donnees += '&codeRaisonConsultation=' + codeRaisonConsultation; donnees += '&hospitalisation=' + hospitalisation; donnees += '&numeroChambre=' + numeroChambre; donnees += '&chirurgie=' + chirurgie; donnees += '&facture=' + facture; // Ligne 4 donnees += '&adherent=' + adherent; donnees += '&beneficiaire=' + beneficiaire; var div_export = $('#div_detail_requete'); div_export.html('
  ' + 'Veuillez patienter...' + '
'); $.ajax({ url: v_url, type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { donnees_retour = data; // $('#div_detail_requete').html(""); // $('#div_export_a').html(data); }, complete: function() { $('#div_detail_requete').html(""); $('#div_export_a').html(donnees_retour); } }); } function selectionner_medecin_requete(codeMedecin, nomMedecin, noOrdreMedecin) { $("#codeMedecin").val(codeMedecin); $("#nomMedecin").html(nomMedecin+" ( "+noOrdreMedecin+" )"); $("#close_pop").click(); } function afficher_pop_recherche_medecin_requete() { noOrdreMedecin = $("#noOrdreMedecin").val(); nomsearch = $("#nomsearch").val(); if(noOrdreMedecin+nomsearch<=" ") return; donnees = "valid=1&noOrdreMedecin="+noOrdreMedecin+"&nomsearch="+nomsearch; $("#div_listemedecins").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); $.ajax({ url: $("#racineWeb").val()+"Ajaxlistemedecinsrequete/", type : 'post', data: donnees, error: function(errorData) { }, success: function(data) { $("#div_listemedecins").html(data); } }); } function ctrlkeypress_medecin_requete(ev) { var keycode = (ev.keyCode ? ev.keyCode : ev.which); if(keycode == '13') { afficher_pop_recherche_medecin_requete(); } } function reinitialiser_medecin() { $("#codeMedecin").val(""); $("#nomMedecin").html("Rechercher Médecin..."); $("#close_pop").click(); } function requetes_factures() { $('#div_export_a').html(""); donnees = ""; donnees_retour = ""; codeRequete=$("#codeRequete").val(); if (codeRequete<=" ") { v_msg="Veuillez sélectionner une requête!"; v_msgEng="Please select a query!"; alert_ebene(v_msg, v_msgEng); $("#codeRequete").focus(); return;