nomSociete = $("#nomSociete").val();
function alert_ebene_no_sweet_alert(p_msg, p_msg_eng)
{
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
alert(p_msg_eng);
}
else
{
alert(p_msg);
}
}
function alert_ebene_callback(p_msg, p_msg_eng, callback) {
let codeLangue = $("#codeLangue").val();
let message = codeLangue == "en_US" ? p_msg_eng : p_msg;
const hasCallback = typeof callback === "function";
if (hasCallback) {
// Version avec callback - nécessite un clic sur OK pour fermer et exécuter le callback
swal({
title: "Alert Information!",
text: message,
icon: "info",
buttons: {
confirm: {
text: "OK",
value: true,
visible: true,
className: "",
closeModal: false // Empêche la fermeture automatique
}
},
closeOnClickOutside: false,
closeOnEsc: false
}).then((willProceed) => {
if (willProceed) {
swal.close(); // Ferme manuellement l'alerte
callback(); // Exécute le callback
}
});
} else {
// Version sans callback - se ferme simplement quand on clique sur OK
swal({
title: "Alert Information!",
text: message,
icon: "info",
buttons: {
confirm: {
text: "OK",
value: true,
visible: true,
className: "",
closeModal: true // Permet la fermeture automatique
}
},
closeOnClickOutside: false,
closeOnEsc: false
});
}
}
function alert_ebene(p_msg, p_msg_eng) {
// Récupération de la langue sélectionnée
let codeLangue = $("#codeLangue").val();
// Choix du message en fonction de la langue
let message = (codeLangue === "en_US") ? p_msg_eng : p_msg;
// Utilisation de SweetAlert pour afficher le message
Swal.fire({
title: message,
icon: 'info', // Icône de type information
confirmButtonText: codeLangue === "en_US" ? 'OK' : 'D\'accord'
});
}
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 confirm_ebene_sweet(p_msg, p_msg_eng) {
// Récupération de la langue sélectionnée
let codeLangue = $("#codeLangue").val();
// Choix du message en fonction de la langue
let message = (codeLangue === "en_US") ? p_msg_eng : p_msg;
// Utilisation de SweetAlert avec une promesse
return Swal.fire({
title: message,
icon: 'warning',
showCancelButton: true,
confirmButtonText: codeLangue === "en_US" ? 'Yes' : 'Oui',
cancelButtonText: codeLangue === "en_US" ? 'No' : 'Non'
}).then((result) => {
return result.isConfirmed; // Retourne true si l'utilisateur confirme, false sinon
});
}
function confirm_ouvrir_dossier(p_msg, p_msg_eng)
{
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: "Do you want to open the patient's medical file?",
text: p_msg_eng,
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm) {
dossiers(0);
} else {
return false;
}
});
}
else
{
swal({
title: "Voulez-vous ouvrir le dossier médical du patient?",
text: p_msg,
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm) {
dossiers(0);
} else {
return;
}
});
}
}
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\u00e9rieur à 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\u00e9 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\u00e9 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\u00e9but 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\u00e9but 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\u00e9but 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\u00e9but JS b\u00e9n\u00e9ficiare */
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);
}else{
recherche();
}
}
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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
ajax_deconnexion();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
ajax_deconnexion();
}
else
{
return;
}
});
}
}
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\u00e9!";
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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner un assur\u00e9!";
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\u00e9lectionner un assur\u00e9!";
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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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 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\u00e9e!";
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()
{
//estGarantie = $("#estGarantie").val();
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();
ageMaxBeneficiaireAtteint = $("#ageMaxBeneficiaireAtteint_C").val();
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")
{
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;
}
if (ageMaxBeneficiaireAtteint == '1')
{
v_msg="Âge maximum atteint pour cette personne!";
v_msgEng="Maximum age reached for this person!";
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 est d\u00e9c\u00e9d\u00e9e!";
v_msgEng="Warning! Deceased!";
alert_ebene(v_msg, v_msgEng);
return false;
}
return true;
}
function consultation()
{
/* Laisser la possibilit\u00e9 de g\u00e9rer les cas d'accident */
/*
anciennete = $("#anciennete").val();
delaiCarenceBeneficiaire = $("#delaiCarenceBeneficiaire").val();
anciennete = parseInt(anciennete);
delaiCarenceBeneficiaire = parseInt(delaiCarenceBeneficiaire);
if (delaiCarenceBeneficiaire>0)
{
if (anciennete0)
{
$("#okId" ).val("1");
}
else
{
finger_id = $("#finger_id_C" ).val();
if (finger_id==0)
{
v_msg="Veuillez proc\u00e9der à 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\u00e9der à l\'identification avant!";
v_msgEng="Please check identity before!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
$('#div_consultation').show();
//window.location.assign($("#racineWeb" ).val()+"Consultation/");
}
else{
$('#div_consultation').hide();
}
}
function gestionbon()
{
adminBon = $("#adminBon" ).val();
if (adminBon!="1")
{
v_msg="Accès refus\u00e9!";
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\u00e9lectionner 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\u00e9s : "+$("#nbligne_info").val());
}
// $("#nbligne").val("Nombre de bons affich\u00e9s : "+$("#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\u00e9lectionner une ligne!";
v_msgEng="Please select a line!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (codeEtatBon=="3")
{
v_msg="Anull\u00e9 pour motif : "+motifAnnulation;
v_msgEng="Canceled for reason : "+motifAnnulation;
alert_ebene(v_msg, v_msgEng);
return;
}
if (codeEtatBon=="4")
{
v_msg="Remplac\u00e9 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+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Request sent successfully!";
alert_ebene(v_msg, v_msgEng);
afficherbon();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Request sent successfully!";
alert_ebene(v_msg, v_msgEng);
afficherbon();
}
});
}
else
{
return;
}
});
}
}
function enregistrer_commande_bon()
{
codeTypeBon=$("#codeTypeBon").val();
if ($("#codeTypeBon").val()<" ")
{
v_msg="Veuillez s\u00e9lectionner 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\u00e9!";
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\u00e9!";
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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Order sent successfully!";
alert_ebene(v_msg, v_msgEng);
$("#div_page_entiere").html(codehtml);
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Order sent successfully!";
alert_ebene(v_msg, v_msgEng);
$("#div_page_entiere").html(codehtml);
}
});
}
else
{
return;
}
});
}
}
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\u00e9lectionner 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\u00e9es : "+$("#nbligne_info").val());
}
});
}
function listerdemandebon()
{
codeTypeBon=$("#codeTypeBon").val();
d1=$("#d1").val();
d2=$("#d2").val();
if (codeTypeBon<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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\u00e9lectionner 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()
{
debugger;
codeGestionBon = $("#codeGestionBon").val();
codeActe = $("#codeActe").val();
codeMedecin = $('#codeMedecin').val();
codeSpecialite = $('#codeMedecin').val();
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
/*
if (codeSpecialite<=" ")
{
v_msg="Veuillez s\u00e9lectionner une sp\u00e9cialit\u00e9!";
v_msgEng="Please select a specialty!";
alert_ebene(v_msg, v_msgEng);
$("#codeSpecialite").focus();
return;
}
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#codeMedecin").focus();
return;
}
*/
datePrestation = $('#dateSurvenance').val();
sessionConsultationConservee = $("#sessionConsultationConservee").val();
codeActeConsultationGratuite = $("#codeActeConsultationGratuite").val();
if(sessionConsultationConservee=="0"){
faireDefileMessage("", "");
}
if (codeActe<=" ")
{
$("#prixActe_info").val("0");
$("#montantTm_info").val("0");
$("#aRembourser_info").val("0");
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
if(codeActe==codeActeConsultationGratuite){
$('#bonPrincipal').removeAttr('disabled');
$('#bonPrincipal').attr('required', 'required');
var bonPrincipal = $("#bonPrincipal").val();
if(bonPrincipal > "0"){
$("#bonPrincipal").val(bonPrincipal);
}else{
$("#bonPrincipal").val("0");
}
$('#labelBonPrincipal').addClass("required");
$('#labelBonPrincipal').css({"font-weight": "bold"});
}else{
$('#bonPrincipal').attr('disabled', 'disabled');
$("#bonPrincipal").val("");
$('#bonPrincipal').removeAttr('required');
$('#labelBonPrincipal').removeClass("required");
$('#labelBonPrincipal').css({"font-weight": "normal"});
}
$("#infosacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
donnees = 'codeActe='+codeActe+'&datePrestation='+datePrestation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxprixacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#infosacte").html(data);
//getstatutacte();
//afficheDivPlafond();
$("#numeroBon").val("");
$("#codeRaisonConsultation").focus();
$("#msgErreur").html("");
if (codeGestionBon=="0")
{
$("#btn_enreg").disable();
$("#codeEtatBon").val("");
}
},
complete: function() {
actualiseTauxCouverture();
}
});
}
function ajaxbondisponible()
{
codeMedecin = $("#codeMedecin").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
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\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner un m\u00e9decin!";
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\u00e9lectionner 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\u00e9lectionner 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\u00e9ro 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() {
}
});
}
////// pour le mode saisi facture
function enregistrerconsultationassureur()
{
/*
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"+appliquerDelaiCarence);
// return;
anciennete = $("#anciennete").val();
anciennete = parseInt(anciennete);
delaiCarenceRaisonconsultation = $("#delaiCarenceRaisonconsultation").val();
delaiCarenceRaisonconsultation = parseInt(delaiCarenceRaisonconsultation);
delaiCarenceBeneficiaire = $("#delaiCarenceBeneficiaire").val();
delaiCarenceBeneficiaire = parseInt(delaiCarenceBeneficiaire);
if (delaiCarenceBeneficiaire>0 && appliquerDelaiCarence=="1")
{
if (anciennete prise en compte de la gestion paperless
donnees += '&codeGestionBon='+codeGestionBon;
donnees_sav = donnees;
$("#btn_enreg").disable();
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerconsultation/enregistrerconsultation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
maj_fraisexclu_cso();
typeSms="accident";
if(codeRaisonConsultation=="ACIR")
{
preparesms(typeSms);
v_msg="alerte envoy\u00e9e pour accident!";
v_msgEng="alert sent for accident!";
alert_ebene(v_msg, v_msgEng);
}
},
complete: function()
{
v_msg="Consultation enregistr\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
dateSurvenance = $("#dateSurvenance").val();
observations = $("#observations").val();
prixActe = $("#prixActe").val();
montantTm = $("#montantTm").val();
aRembourser = $("#aRembourser").val();
numeroDerogation = $("#derogation_en_cours_C").val();
numeroDerogationFinger = $("#derogation_finger_en_cours_C").val();
okReferencement = $("#okReferencement").val();
dateReferencement = $("#dateReferencement").val();
codeReferencement = $("#codeReferencement").val();
if(dateReferencement == undefined){
dateReferencement="";
}
if(codeReferencement == undefined){
codeReferencement="";
}
if (numeroDerogation<1)
{
numeroDerogation = "0";
}
if (numeroDerogationFinger<1)
{
numeroDerogationFinger = "0";
}
donnees = 'codeActe='+codeActe+'&numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&codeRaisonConsultation='+codeRaisonConsultation;
donnees += '&dateSurvenance='+dateSurvenance+'&observations='+observations+'&prixActe='+prixActe;
donnees += '&montantTm='+montantTm+'&aRembourser='+aRembourser+'&numeroDerogation='+numeroDerogation;
donnees += '&numeroDerogationFinger='+numeroDerogationFinger;
donnees += '&medecinManquant='+medecinManquant;
donnees += '&dateReferencement='+dateReferencement;
donnees += '&codeReferencement='+codeReferencement;
// ajout du 27/06/2019 => prise en compte de la gestion paperless
donnees += '&codeGestionBon='+codeGestionBon;
donnees_sav = donnees;
$("#btn_enreg").disable();
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerconsultation/enregistrerconsultation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
maj_fraisexclu_cso();
typeSms="accident";
if(codeRaisonConsultation=="ACIR")
{
preparesms(typeSms);
v_msg="alerte envoy\u00e9e pour accident!";
v_msgEng="alert sent for accident!";
alert_ebene(v_msg, v_msgEng);
}
},
complete: function()
{
v_msg="Consultation enregistr\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
////////
function enregistrerconsultationold()
{
/*
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"+appliquerDelaiCarence);
// return;
anciennete = $("#anciennete").val();
anciennete = parseInt(anciennete);
delaiCarenceRaisonconsultation = $("#delaiCarenceRaisonconsultation").val();
delaiCarenceRaisonconsultation = parseInt(delaiCarenceRaisonconsultation);
delaiCarenceBeneficiaire = $("#delaiCarenceBeneficiaire").val();
delaiCarenceBeneficiaire = parseInt(delaiCarenceBeneficiaire);
if (delaiCarenceBeneficiaire>0 && appliquerDelaiCarence=="1")
{
if (anciennete prise en compte de la gestion paperless
donnees += '&codeGestionBon='+codeGestionBon;
donnees_sav = donnees;
$("#btn_enreg").disable();
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerconsultation/enregistrerconsultation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
maj_fraisexclu_cso();
typeSms="accident";
if(codeRaisonConsultation=="ACIR")
{
preparesms(typeSms);
v_msg="alerte envoy\u00e9e pour accident!";
v_msgEng="alert sent for accident!";
alert_ebene(v_msg, v_msgEng);
}
},
complete: function()
{
v_msg="Consultation enregistr\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
dateSurvenance = $("#dateSurvenance").val();
observations = $("#observations").val();
prixActe = $("#prixActe").val();
montantTm = $("#montantTm").val();
aRembourser = $("#aRembourser").val();
numeroDerogation = $("#derogation_en_cours_C").val();
numeroDerogationFinger = $("#derogation_finger_en_cours_C").val();
okReferencement = $("#okReferencement").val();
dateReferencement = $("#dateReferencement").val();
codeReferencement = $("#codeReferencement").val();
if(dateReferencement == undefined){
dateReferencement="";
}
if(codeReferencement == undefined){
codeReferencement="";
}
if (numeroDerogation<1)
{
numeroDerogation = "0";
}
if (numeroDerogationFinger<1)
{
numeroDerogationFinger = "0";
}
donnees = 'codeActe='+codeActe+'&numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&codeRaisonConsultation='+codeRaisonConsultation;
donnees += '&dateSurvenance='+dateSurvenance+'&observations='+observations+'&prixActe='+prixActe;
donnees += '&montantTm='+montantTm+'&aRembourser='+aRembourser+'&numeroDerogation='+numeroDerogation;
donnees += '&numeroDerogationFinger='+numeroDerogationFinger;
donnees += '&medecinManquant='+medecinManquant;
donnees += '&dateReferencement='+dateReferencement;
donnees += '&codeReferencement='+codeReferencement;
// ajout du 27/06/2019 => prise en compte de la gestion paperless
donnees += '&codeGestionBon='+codeGestionBon;
donnees_sav = donnees;
$("#btn_enreg").disable();
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerconsultation/enregistrerconsultation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
maj_fraisexclu_cso();
typeSms="accident";
if(codeRaisonConsultation=="ACIR")
{
preparesms(typeSms);
v_msg="alerte envoy\u00e9e pour accident!";
v_msgEng="alert sent for accident!";
alert_ebene(v_msg, v_msgEng);
}
},
complete: function()
{
v_msg="Consultation enregistr\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
function enregistrerconsultation()
{
debugger;
codeLangue = $("#codeLangue").val();
dateEffetCouvert = $("#dateEffetCouvert").val();
codeActeConsultationGratuite = $("#codeActeConsultationGratuite").val();
if (dateEffetCouvert!="1")
{
v_msg="Attention! Non renouvel\u00e9";
v_msgEng="Warning! Not renewed";
alert_ebene(v_msg, v_msgEng);
return;
}
fingerActif = $("#fingerActif" ).val();
faceActif = $("#faceActif").val();
if (prestation_possible())
{
//avecReferencement = $("#avecReferencement").val();
if (prestataireReference=="0")
{
if ($("#codeReferencement").val()==""){
okReferencement="0";
}else{
okReferencement="1";
}
}else{
okReferencement="1";
}
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();
faceRegistered = $("#faceRegistered" ).val();
if( (fingerActif=='1' && finger_id==0) || (faceActif=='1' && faceRegistered!="1") )
{
v_msg="Veuillez proc\u00e9der à 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( (fingerActif=='1' && okId!=1) || (faceActif=='1' && okId_face!=1) )
{
v_msg="Veuillez proc\u00e9der à l\'identification avant!";
v_msgEng="Please check identity before!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
modeSaisieFacture=$("#modeSaisieFacture").val();
//alert(modeSaisieFacture);
//return;
if(modeSaisieFacture=="1")
{
$("#btn_popdate_reelle").click();
return;
}else{
codeTypeRemboursement=$("#codeTypeRemboursement").val();
if(codeTypeRemboursement=="RDE"){
v_msg="Attention! La consultation est exclusivement en remboursement direct! Le patient est pri\u00e9 de se rendre chez le gestionnaire pour se faire rembourser. Merci pour votre compr\u00e9hension!";
v_msgEng="Warning! The consultation is exclusively in direct reimbursement! The patient is asked to go to the manager for reimbursement. "+nomSociete+" thanks you!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(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;
}
appliquerDelaiCarence = $("#appliquerDelaiCarence").val();
anciennete = $("#anciennete").val();
anciennete = parseInt(anciennete);
delaiCarenceRaisonconsultation = $("#delaiCarenceRaisonconsultation").val();
delaiCarenceRaisonconsultation = parseInt(delaiCarenceRaisonconsultation);
delaiCarenceBeneficiaire = $("#delaiCarenceBeneficiaire").val();
delaiCarenceBeneficiaire = parseInt(delaiCarenceBeneficiaire);
if (delaiCarenceBeneficiaire > 0 && appliquerDelaiCarence=="1")
{
if (anciennete < delaiCarenceBeneficiaire)
{
v_msg="Attention! P\u00e9riode de carence!";
v_msgEng="Warning! waiting period!";
alert_ebene(v_msg, v_msgEng);
return;
}
delaiCarenceActe = $("#delaiCarenceActe").val();
delaiCarenceActe = parseInt(delaiCarenceActe);
if (anciennete 0 et <= duree vie bon prestataire égal dernier prestataire
}else if((codeActe == dernierActe) && (dureeDerniereConsultation > "0") && (dureeDerniereConsultation <= dureeVieBon) && (codePrestataire == dernierCentre)){
if(codeTypeConsultation == "GE"){
v_msg="La derni\u00e8re consultation du patient pour cet acte date de moins de "+dureeVieBon+" jours. Veuiller changer l'acte ou passer en consultation gratuite. Merci pour votre compr\u00e9hension!";
v_msgEng="The patient's last consultation was less than "+dureeVieBon+" days ago. Please change the deed or go to free consultation. Thanks for understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if((codeTypeConsultation == "SP") && (dernierMedecinConsulte == codeMedecin)){
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 par ce sp\u00e9cialiste, il ya moins de "+dureeVieBon+" jours. Veuiller changer l'acte ou passer en consultation gratuite. Merci pour votre compr\u00e9hension!";
v_msgEng="Please note, this patient has already been consulted by this specialist, less than "+dureeVieBon+" days ago. Please change the deed or go to free consultation. Thanks for understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}
}else if ((codeActe == dernierActe) && (dureeDerniereConsultation == "0")){
if((codeTypeConsultation == "GE") && (codePrestataire == dernierCentre)){
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui par un g\u00e9n\u00e9raliste. Voulez-vous ouvrir son dossier m\u00e9dical?";
v_msgEng="Attention, this patient has already been consulted by a general practitioner today. Would you like to open his medical file?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
dossiers(0);
return;
}
else
{
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui par un g\u00e9n\u00e9raliste. Cliquer sur le menu Dossiers, dans la barre de gauche, pour ouvrir son dossier m\u00e9dical.";
v_msgEng="Attention, this patient has already been consulted by a general practitioner today. Click on the Files menu, in the left bar, to open his medical file.";
faireDefileMessage(v_msg, v_msgEng);
return;
}
});
return;
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
dossiers(0);
return;
}
else
{
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui par un g\u00e9n\u00e9raliste. Cliquer sur le menu Dossiers, dans la barre de gauche, pour ouvrir son dossier m\u00e9dical.";
v_msgEng="Attention, this patient has already been consulted by a general practitioner today. Click on the Files menu, in the left bar, to open his medical file.";
faireDefileMessage(v_msg, v_msgEng);
return;
}
});
return;
}
}else if((codeTypeConsultation == "GE") && (codePrestataire != dernierCentre)){
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui ailleurs par un g\u00e9n\u00e9raliste. Veuiller changer l'acte ou demander au patient de revenir un autre jour. Merci pour votre compr\u00e9hension!";
v_msgEng="Please note, for this day the patient has already been consulted elsewhere by a general practitioner. Please change the procedure or ask the patient to come back another day. Thank you for your understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if((codeTypeConsultation == "SP") && (nbreConsultaionSpecialisteJour >= paramConsultationSpecialisteJour)){
v_msg="Attention, ce patient a d\u00e9ja consult\u00e9 "+ paramConsultationSpecialisteJour +" sp\u00e9cialistes aujourd'hui. Veuiller changer l'acte. Merci pour votre compr\u00e9hension!";
v_msgEng="Attention, this patient has already consulted "+ paramConsultationSpecialisteJour +" specialists today. Please change the deed. Thanks for understanding.";
//alert("Alerte 3-3");
//return;
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if((codeTypeConsultation == "SP") && (codePrestataire == dernierCentre) && (dernierMedecinConsulte == codeMedecin)){
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui par ce sp\u00e9cialiste.";
v_msgEng="Attention, this patient has already been consulted by this specialist today.";
if(codeLangue=="en_US")
{
swal({
title: "Do you want to open the patient's medical file?",
text: v_msgEng,
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm) {
dossiers(0);
}
else
{
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui par ce sp\u00e9cialiste. Cliquer sur le menu Dossiers, dans la barre de gauche, pour ouvrir son dossier m\u00e9dical.";
v_msgEng="Attention, this patient has already been consulted by this specialist today. Click on the Files menu, in the left bar, to open his medical file.";
faireDefileMessage(v_msg, v_msgEng);
return;
}
});
return;
}
else
{
swal({
title: "Voulez-vous ouvrir le dossier médical du patient?",
text: v_msg,
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm) {
dossiers(0);
}
else
{
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui par ce sp\u00e9cialiste. Cliquer sur le menu Dossiers, dans la barre de gauche, pour ouvrir son dossier m\u00e9dical.";
v_msgEng="Attention, this patient has already been consulted by this specialist today. Click on the Files menu, in the left bar, to open his medical file.";
faireDefileMessage(v_msg, v_msgEng);
return;
}
});
}
return;
}else if((codeTypeConsultation == "SP") && (specialiteEstPossible == "0")){
if(codeSpecialite == "PED" && (age > agemaxipediatrie)) {
v_msg="Attention, ce patient n'a pas moins de "+agemaxipediatrie+" ans! Il ne peut pas faire cette consultation, veuiller changer l'acte.";
v_msgEng="Attention, this patient is not less than "+agemaxipediatrie+" years old! He cannot do this consultation, please change the act.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else{
v_msg="La derni\u00e8re consultation du patient pour cet acte date de moins de "+dureeVieBon+" jours. Veuiller changer l'acte ou passer en consultation gratuite. Merci pour votre compr\u00e9hension!";
v_msgEng="The patient's last consultation was less than "+dureeVieBon+" days ago. Please change the deed or go to free consultation. Thanks for understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}
}
}else if((codeTypeConsultation == "SP") && (nbreConsultaionSpecialisteJour >= paramConsultationSpecialisteJour) && (dureeDerniereConsultation == "0")){
v_msg="Attention, ce patient a d\u00e9ja consult\u00e9 "+ paramConsultationSpecialisteJour +" sp\u00e9cialistes aujourd'hui. Veuiller changer l'acte. Merci pour votre compr\u00e9hension!";
v_msgEng="Attention, this patient has already consulted "+ paramConsultationSpecialisteJour +" specialists today. Please change the deed. Thanks for understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if((codeTypeConsultation == "GE") && (dureeDerniereConsultation == "0") && (codePrestataire != dernierCentre)){
v_msg="Attention, ce patient a d\u00e9ja \u00e9t\u00e9 consult\u00e9 aujourd'hui dans un autre centre.";
v_msgEng="Attention, this patient has already been consulted today in another center";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if((codeTypeConsultation == "GE") && (dureeDerniereConsultation >= "0") && (dureeDerniereConsultation <= dureeVieBon) && (codePrestataire == dernierCentre)){
v_msg="La derni\u00e8re consultation g\u00e9n\u00e9raliste du patient date de moins de "+dureeVieBon+" jours. Veuiller changer l'acte ou passer en consultation gratuite. Merci pour votre compr\u00e9hension!";
v_msgEng="The patient's last general consultation was less than "+dureeVieBon+" days ago. Please change the deed or go to free consultation. Thanks for understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if((codeTypeConsultation == "SP") && (specialiteEstPossible == "0")){
if(codeSpecialite == "PED" && (age > agemaxipediatrie)) {
v_msg="Attention, ce patient n'a pas moins de "+agemaxipediatrie+" ans! Il ne peut pas faire cette consultation, veuiller changer l'acte.";
v_msgEng="Attention, this patient is not less than "+agemaxipediatrie+" years old! He cannot do this consultation, please change the act.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else{
v_msg="La derni\u00e8re consultation du patient pour cet acte date de moins de "+dureeVieBon+" jours. Veuiller changer l'acte ou passer en consultation gratuite. Merci pour votre compr\u00e9hension!";
v_msgEng="The patient's last consultation was less than "+dureeVieBon+" days ago. Please change the deed or go to free consultation. Thanks for understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}
}
}else if(codeActe == codeActeConsultationGratuite || codeTypeConsultation == "CO"){
if((dureeDerniereConsultation == "0") && (nombreFeuilleGratuite >= parametreNombreFeuilleGratuitJour)){
v_msg="Le quotas journalier de feuille de soin gratuite est atteint pour ce patient.";
v_msgEng="The daily free care sheet quota has been reached for this patient.";
confirm_ouvrir_dossier(v_msg, v_msgEng);
return;
}
}
codeRaisonConsultation = $("#codeRaisonConsultation").val();
if (codeRaisonConsultation<=" ")
{
v_msg="Veuillez s\u00e9lectionner une raison pour la consultation!";
v_msgEng="Please select a reason for the consultation!";
alert_ebene(v_msg, v_msgEng);
$("#codeRaisonConsultation").focus();
return;
}
if (codeGestionBon=="0")
{
numeroBon = $("#numeroBon").val();
if(isNaN(numeroBon))
{
v_msg="Veuillez revoir le num\u00e9ro 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\u00e9ro 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";
v_msg="Confirmez-vous l'ouverture d'un dossier médical pour ce patient?";
v_msgEng="Do you confirm the opening of a medical file for this patient?";
}
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if (ententePrealable==1){
ententePrealable = "2";
}
dateSurvenance = $("#dateSurvenance").val();
observations = $("#observations").val();
depassement = $("#depassement").val();
numeroDerogation = $("#derogation_en_cours_C").val();
numeroDerogationFinger = $("#derogation_finger_en_cours_C").val();
okReferencement = $("#okReferencement").val();
dateReferencement = $("#dateReferencement").val();
codeReferencement = $("#codeReferencement").val();
if(dateReferencement == undefined){
dateReferencement="";
}
if(codeReferencement == undefined){
codeReferencement="";
}
if (numeroDerogation<1)
{
numeroDerogation = "0";
}
if (numeroDerogationFinger<1)
{
numeroDerogationFinger = "0";
}
donnees = 'codeActe='+codeActe+'&numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&codeRaisonConsultation='+codeRaisonConsultation;
donnees += '&dateSurvenance='+dateSurvenance+'&observations='+observations+'&prixActe='+prixActe+'&prixBase='+prixBase;
donnees += '&montantTm='+montantTm+'&aRembourser='+aRembourser+'&numeroDerogation='+numeroDerogation+'&depassement='+depassement;
donnees += '&numeroDerogationFinger='+numeroDerogationFinger;
donnees += '&medecinManquant='+medecinManquant;
donnees += '&ententePrealable='+ententePrealable; // entente pr\u00e9alable consultation
donnees += '&dateReferencement='+dateReferencement;
donnees += '&codeReferencement='+codeReferencement;
donnees += '&bonPrincipal='+bonPrincipal;
// ajout du 27/06/2019 => prise en compte de la gestion paperless
donnees += '&codeGestionBon='+codeGestionBon;
// ajout du 17/04/2025 => enregistrement de la spécialité
donnees += '&codeSpecialite='+codeSpecialite;
donnees_sav = donnees;
// entente prealable consultation
//donnees_sav_rp = 'codeActe='+codeActe+'&codeMedecin='+codeMedecin+'&observations='+observations+'&typeMail=mailententeprealable';
//typeSms ="ententeprealable";
//typeSms2 ="autorisation";
//
$("#btn_enreg").disable();
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerconsultation/enregistrerconsultation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
// entente prealable consultation
/*
if(ententePrealable=="2")
{
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
*/
//////
maj_fraisexclu_cso();
/*
typeSms="accident";
if(codeRaisonConsultation=="ACIR")
{
preparesms(typeSms);
v_msg="alerte envoy\u00e9e pour accident!";
v_msgEng="alert sent for accident!";
alert_ebene(v_msg, v_msgEng);
}
*/
},
complete: function()
{
// entente prealable consultation
/*
if(ententePrealable=="2")
{
mettremailattente(donnees_sav);
}
*/
//////
v_msg="Consultation enregistr\u00e9e avec succ\u00e8s";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
} else {
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if (ententePrealable==1){
ententePrealable = "2";
}
dateSurvenance = $("#dateSurvenance").val();
observations = $("#observations").val();
depassement = $("#depassement").val();
numeroDerogation = $("#derogation_en_cours_C").val();
numeroDerogationFinger = $("#derogation_finger_en_cours_C").val();
okReferencement = $("#okReferencement").val();
dateReferencement = $("#dateReferencement").val();
codeReferencement = $("#codeReferencement").val();
if(dateReferencement == undefined){
dateReferencement="";
}
if(codeReferencement == undefined){
codeReferencement="";
}
if (numeroDerogation<1)
{
numeroDerogation = "0";
}
if (numeroDerogationFinger<1)
{
numeroDerogationFinger = "0";
}
donnees = 'codeActe='+codeActe+'&numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&codeRaisonConsultation='+codeRaisonConsultation;
donnees += '&dateSurvenance='+dateSurvenance+'&observations='+observations+'&prixActe='+prixActe+'&prixBase='+prixBase;
donnees += '&montantTm='+montantTm+'&aRembourser='+aRembourser+'&numeroDerogation='+numeroDerogation+'&depassement='+depassement;
donnees += '&numeroDerogationFinger='+numeroDerogationFinger;
donnees += '&medecinManquant='+medecinManquant;
donnees += '&ententePrealable='+ententePrealable; // entente pr\u00e9alable consultation
donnees += '&dateReferencement='+dateReferencement;
donnees += '&codeReferencement='+codeReferencement;
donnees += '&bonPrincipal='+bonPrincipal;
// ajout du 27/06/2019 => prise en compte de la gestion paperless
donnees += '&codeGestionBon='+codeGestionBon;
// ajout du 17/04/2025 => enregistrement de la spécialité
donnees += '&codeSpecialite='+codeSpecialite;
//donnees_sav = donnees;
// entente prealable consultation
//donnees_sav_rp = 'codeActe='+codeActe+'&codeMedecin='+codeMedecin+'&observations='+observations+'&typeMail=mailententeprealable';
//typeSms ="ententeprealable";
//typeSms2 ="autorisation";
//
$("#btn_enreg").disable();
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerconsultation/enregistrerconsultation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
// entente prealable consultation
/*
if(ententePrealable=="2")
{
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
*/
//////
maj_fraisexclu_cso();
/*
typeSms="accident";
if(codeRaisonConsultation=="ACIR")
{
preparesms(typeSms);
v_msg="alerte envoy\u00e9e pour accident!";
v_msgEng="alert sent for accident!";
alert_ebene(v_msg, v_msgEng);
}
*/
},
complete: function()
{
// entente prealable consultation
/*
if(ententePrealable=="2")
{
mettremailattente(donnees_sav);
}
*/
//////
v_msg="Consultation enregistr\u00e9e avec succ\u00e8s";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
} else {
return;
}
});
}
}
else{
$('#div_consultation').hide();
}
}
function listerdossier()
{
d1=$("#d1").val();
d2=$("#d2").val();
donnees = 'd1='+d1+'&d2='+d2;
$("#div_dossiers").html('
' + '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();
codeLangue = $("#codeLangue").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\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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\u00e9ro 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(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_medicament();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_medicament();
}
});
}
else
{
return;
}
});
}
}
function envoieprescription()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescription/envoieprescription/",
type : 'post',
data: donnees,
error: function(errorData)
{
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
},
complete: function() {
}
});
}
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\u00e9jà effectu\u00e9!";
v_msgEng="Already done!";
alert_ebene(v_msg, v_msgEng);
return;
}
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
codeMedecin = $("#codeMedecin").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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\u00e9lectionner un m\u00e9dicament!";
v_msgEng="Please select a medicine/drug!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Prescrire : "+libelleMedicament+"?";
v_msgEng="Prescribe : "+libelleMedicament+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeMedicament='+codeMedicament;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/ajoutermedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
prescription_medicament();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeMedicament='+codeMedicament;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/ajoutermedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
prescription_medicament();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
}
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\u00e9!";
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 ajax_maj_posologie_medicament(idMedicament, posologie, controle)
{
donnees = 'idMedicament='+idMedicament+"&posologie="+posologie;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/majposologie/",
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\u00e9dicament?";
v_msgEng="Do you confirm the removal of this medicine/drug?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament;
$("#medicaments").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/supprimer/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
prescription_medicament();
},
error: function(data) {
},
complete: function() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament;
$("#medicaments").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/supprimer/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
prescription_medicament();
},
error: function(data) {
},
complete: function() {
}
});
}
else
{
return;
}
});
}
}
function ajoutermedicament(idMedicament)
{
donnees = 'idMedicament='+idMedicament;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/ajoutermedicament/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
//afficheDivPlafond();
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
nbreLigne = parseInt($("#nbreLigne").val());
if(nbreLigne>0){
for(let i = 1; i <= nbreLigne; i++){
$("#div_selection"+i).hide();
}
}
}
});
}
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();
//$(this).get(0).focus();
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
//alerter_depassement_limite();
}
});
}
function actualiseordonnancepha(){
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxactualiseordonnancepha/",
type: 'POST',
data: donnees,
success: function(data) {
$("#ordonnance").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function ajoutermedicament_tous()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/ajoutermedicamenttous/",
type: 'POST',
success: function(data) {
$("#livraison").html(data);
//afficheDivPlafond();
getstatutacte("PH");
},
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();
$("#valeurActeManuel1").focus();
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
//alerter_depassement_limite();
}
});
}
function formatMonetaire(controle){
controle.value = formatCurrency(controle.value);
return;
}
function controle_numerique(controle)
{
controle.value=controle.value.replace(/ /g,"");
controle.value=parseInt(controle.value.replace(",","."),10);
if(isNaN(controle.value))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
controle.value="0";
controle.focus();
return false;
}
return true;
}
function ajax_maj_prix_medicament_pha(idMedicament, tarifPublic, prix, controle)
{
//debugger;
var appliquerMargePrixMedicament = $('#appliquerMargePrixMedicament').val();
var margePrixMedicament = $('#margePrixMedicament').val();
var typeMargePrixMedicament = $('#typeMargePrixMedicament').val();
var devise = $("#devise").val();
prix=prix.replace(",",".");
prix=prix.replace(/ /g,"");
controle.value=prix;
/*if(prix==0)
{
controle.focus();
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}*/
if(typeMargePrixMedicament=="Taux")
{
pourcentage = parseInt(tarifPublic) * parseInt(margePrixMedicament);
prixMarge = parseInt(pourcentage) / 100;
prixMarjore =parseInt(tarifPublic) + parseInt(prixMarge);
}else{
prixMarjore =parseInt(tarifPublic) + parseInt(margePrixMedicament);
}
margePrixMedicament = parseInt(margePrixMedicament);
if(controle_numerique(controle))
{
if(appliquerMargePrixMedicament == "1")
{
if(prix > prixMarjore){
controle.value = tarifPublic;
controle.focus();
v_msg="D\u00e9sol\u00e9! Le prix saisi est sup\u00e9rieur \u00e0 la valeur de la marge de "+formatCurrency(prixMarge)+" "+devise+" appliquable au le prix syst\u00e8me de ce m\u00e9dicament.";
v_msgEng="Sorry! but the price entered is higher than the value of the margin "+formatCurrency(prixMarge)+" "+devise+" applicable to the system price of this medicine.";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/majprixpha/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
alerter_depassement_limite();
controle.focus();
}
});
}else{
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/majprixpha/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
//alerter_depassement_limite();
controle.focus();
}
});
}
}
}
function ajax_maj_prix_medicament_cso(idMedicament, tarifPublic, prix, controle)
{
var appliquerMargePrixMedicament = $('#appliquerMargePrixMedicament').val();
var margePrixMedicament = $('#margePrixMedicament').val();
var devise = $("#devise").val();
codeLangue = $("#codeLangue").val();
prix=prix.replace(",",".");
prix=prix.replace(/ /g,"");
controle.value=prix;
prixMarge = parseInt(tarifPublic) + parseInt(margePrixMedicament);
margePrixMedicament = parseInt(margePrixMedicament);
if(controle_numerique(controle))
{
if(prix==0)
{
controle.focus();
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(appliquerMargePrixMedicament == "1"){
if(prix > prixMarge){
v_msg="Confirmez vous le d\u00e9passement de la marge de "+formatCurrency(margePrixMedicament)+" "+devise+" que vous avez appliqu\u00e9e au tarif public du m\u00e9dicament?";
v_msgEng="Do you confirm that the margin of "+formatCurrency(margePrixMedicament)+" "+devise+" that you have applied to the public drug price has been exceeded?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/majprixcso/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
getstatutacte("PH");
controle.focus();
}
});
}
else
{
controle.value = 0;
controle.focus();
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/majprixcso/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
//alerter_depassement_limite();
getstatutacte("PH");
controle.focus();
}
});
}
else
{
controle.value = 0;
controle.focus();
return;
}
});
}
} else{
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/majprixcso/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
getstatutacte("PH");
controle.focus();
}
});
}
}else{
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/majprixcso/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
getstatutacte("PH");
controle.focus();
}
});
}
}
}
function maj_prixmanuel_pha(idLivre, nbreLivre, valeurActeManuel, controle)
{
valeurActeManuel=valeurActeManuel.replace(/ /g,"");
valeurActeManuel=parseInt(valeurActeManuel.replace(",","."),10);
controle.value=valeurActeManuel;
tm = parseInt($('#tm').val());
if(controle_numerique(controle))
{
if(valeurActeManuel==0)
{
controle.focus();
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}
$('#prixManuel'+nbreLivre).val(valeurActeManuel*parseInt($('#quantite'+nbreLivre).val()));
prixManuel = parseInt($('#prixManuel'+nbreLivre).val());
$('#montantTm'+nbreLivre).val(parseInt(prixManuel*tm/100));
montantTm = parseInt($('#montantTm'+nbreLivre).val());
$('#montantArembourser'+nbreLivre).val(prixManuel-montantTm);
montantArembourser = parseInt($('#montantArembourser'+nbreLivre).val());
donnees = 'idLivre='+idLivre+"&valeurActeManuel="+valeurActeManuel+"&prixManuel="+prixManuel;
donnees += '&montantTm='+montantTm+"&montantArembourser="+montantArembourser;
//alert(donnees);
//return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/majprixmanuelpha/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
// raffraichier_detail_prescription();
},
error: function(data) {
},
complete: function() {
alerter_depassement_limite();
controle.focus();
}
});
}
}
function tableaulivre_pha()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/tableaulivre/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_tableau_pha").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
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\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
idPrestationactes=$("#idPrestationactes").val();
idPrestationactes = parseInt(idPrestationactes);
nbLivre=$("#nbLivre").val();
nbLivre = parseInt(nbLivre);
quantiteTotalLivree = $("#quantiteTotalLivree").val();
//alert(quantiteTotalLivree);
if (quantiteTotalLivree<="0")
{
v_msg="Aucune quantité à livrer!";
v_msgEng="No quantity to deliver!";
alert_ebene(v_msg, v_msgEng);
return;
}
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?";
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/enregistrerpharmacie/",
type: 'POST',
success: function(data) {
maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/enregistrerpharmacie/",
type: 'POST',
success: function(data) {
maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
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)
{
debugger;
$("#msgErreur").empty();
if(numeroBonOptique<="0")
{
// actualiser_opticien();
reinitialiser_opticien();
return;
}
donnees = 'numeroBonOptique='+numeroBonOptique;
$.ajax({
url: $("#racineWeb").val()+"Ajaxchangerordonnanceopt/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
$("#ordonnance").html(data);
numeroBon = $("#numeroBon").val();
if(numeroBon=="-1"){
return;
}else{
opticien();
}
//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()
{
debugger;
bonCaduc = $("#bonCaduc").val();
modeSaisieFacture = $("#modeSaisieFacture").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\u00e9e!";
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\u00e9jà factur\u00e9!";
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;
}
// verifie s'il existe un entente d'entente préalable sur la prescription de médicament
existeEntentePrealable = $("#existeEntentePrealable").val();
v_msg="Confirmez-vous cette prescription?";
v_msgEng="Do you confirm this prescription?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
if(modeSaisieFacture == "0"){
envoieprescription();
}
if(existeEntentePrealable > "0")
{
debugger
//preparesms(typeSms);
v_msg="Demande accord pr\u00e9alable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
feuillemaladie();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
debugger;
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
debugger;
if(modeSaisieFacture=="0"){
envoieprescription();
}
if(existeEntentePrealable > "0")
{
debugger;
//preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
feuillemaladie();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
}
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\u00e9lectionner 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\u00e9!";
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\u00e9lectionner un m\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#nomMedecin").focus();
return;
}
codeActe = $("#codeActe").val();
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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\u00e9!";
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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
if(autorisation=="2")
{
preparesms(typeSms2);
v_msg="Demande autorisation envoy\u00e9e!";
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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
if(autorisation=="2")
{
preparesms(typeSms2);
v_msg="Demande autorisation envoy\u00e9e!";
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();
}
});
}
else
{
return;
}
});
}
}
function ajax_changer_qte_acte()
{
codeActe = $("#codeActe").val();
prixActe = $("#prixActe").val();
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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\u00e9!";
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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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() {
}
});
}
else
{
return;
}
});
}
}
function supprimer_chambre(idChambre)
{
v_msg="Confirmez-vous la suppression de cette chambre?";
v_msgEng="Do you confirm the removal of this room?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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() {
}
});
}
else
{
return;
}
});
}
}
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\u00e9jà effectu\u00e9!";
v_msgEng="Already done!";
alert_ebene(v_msg, v_msgEng);
return;
}
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
numeroBon = $("#numeroBon").val();
if(isNaN(numeroBon))
{
v_msg="Veuillez revoir le num\u00e9ro 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();
codeLangue = $("#codeLangue").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();
motifHospitalisation = $("#motifHospitalisation").val();
if (codeGestionBon=="0")
{
numeroBon = $("#numeroBon").val();
if(isNaN(numeroBon))
{
v_msg="Veuillez revoir le num\u00e9ro 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\u00e9ro 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 (motifHospitalisation <=" ")
{
v_msg="Saisissez le motif d'hospitalisation!";
v_msgEng="Saisissez le motif d'hospitalisation!";
alert_ebene(v_msg, v_msgEng);
$("#motifHospitalisation").focus();
return;
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&motifHospitalisation='+motifHospitalisation;
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 d'hospitalisation envoy\u00e9, souhaitez-vous continu\u00e9?";
v_msgEng="Hospitalization notice sent, would you like to add a room?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
attribution_chambre();
}
else
{
feuillemaladie();
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
attribution_chambre();
}
else
{
feuillemaladie();
}
});
}
}
});
}
else
{
feuillemaladie();
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&motifHospitalisation='+motifHospitalisation;
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 d'hospitalisation envoy\u00e9, souhaitez-vous continu\u00e9?";
v_msgEng="Hospitalization notice sent, would you like to add a room?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
attribution_chambre();
}
else
{
feuillemaladie();
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
attribution_chambre();
}
else
{
feuillemaladie();
}
});
}
}
});
}
else
{
feuillemaladie();
}
});
}
}
function libellesubstitut(controle)
{
var libelle = controle.options[controle.selectedIndex].text;
$("#libelleSubstitut").val(libelle);
}
function verifierPrixSubstitut(controle){
var prixSubstitut = $('#prixSubstitut').val();
var prixPublicSubstitut = $('#prixPublicSubstitut').val();
var prixTarif = $('#prixTarif').val();
var idMedicament = $('#idMedicament').val();
var nomPrescrit = $('#nomPrescrit').val();
var posologie = $('#posologie').val();
var nvellePosologie = $('#nvellePosologie').val();
var appliquerMargePrixSubstitutMedicament = $('#appliquerMargePrixSubstitutMedicament').val();
var margePrixSubstitutMedicament = $('#margePrixSubstitutMedicament').val();
var idSubstitut = $('#idSubstitut').val();
var libelleSubstitut = $("#libelleSubstitut").val();
var devise = $("#devise").val();
if (idSubstitut=="")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9dicament de substitution!";
v_msgEng="Please select a replacement drug!";
alert_ebene(v_msg, v_msgEng);
$("#prixSubstitut").val(0);
$("#prixSubstitut").focus();
return false;
}
prixPublicSubstitut = prixPublicSubstitut.replace(/ /g,"");
prixPublicSubstitut = parseInt(prixPublicSubstitut.replace(",","."),10);
prixSubstitut = prixSubstitut.replace(/ /g,"");
prixSubstitut = parseInt(prixSubstitut.replace(",","."),10);
prixTarif = prixTarif.replace(/ /g,"");
prixTarif = parseInt(prixTarif.replace(",","."),10);
margePrixSubstitutMedicament = margePrixSubstitutMedicament.replace(/ /g,"");
margePrixSubstitutMedicament = parseInt(margePrixSubstitutMedicament.replace(",","."),10);
if(appliquerMargePrixSubstitutMedicament == "1"){
prixTarif = prixTarif + margePrixSubstitutMedicament;
}else{
$("#btn_actu").prop("disabled",true);
$("#btn_enreg").prop("disabled",false);
$("#div_patienter").empty();
return false;
}
donnees_sav = 'idMedicament='+idMedicament+'&nomPrescrit='+nomPrescrit+'&prixTarif='+prixTarif;
donnees_sav += '&idSubstitut='+idSubstitut+'&libelleSubstitut='+libelleSubstitut;
donnees_sav += '&prixPublicSubstitut='+prixPublicSubstitut+'&prixSubstitut='+prixSubstitut;
donnees_sav += '&posologie='+posologie+'&nvellePosologie='+nvellePosologie;
donnees_sav += '&typeMail=maildemandesubstitution';
//donnees_sav = 'idMedicament='+idMedicament+'&prixTarif='+prixTarif;
//donnees_sav += '&idSubstitut='+idSubstitut+'&prixSubstitut='+prixSubstitut;
//donnees_sav += '&typeMail=maildemandesubstitution';
if(prixSubstitut > 0){
if(prixSubstitut > prixTarif){
//typeSms = "demandesubstitution";
//v_msg="Le prix du m\u00e9dicament de substitution est sup\u00e9rieur au prix du m\u00e9dicament prescrit augment\u00e9 de la marge maximum de "+formatCurrency(margePrixSubstitutMedicament)+" "+devise+" d\u00e9finie, veuillez attendre l'accord de l'assureur avant de continuer.";
//v_msgEng="The price of the replacement drug is higher than the price of the prescribed drug plus the maximum margin of "+formatCurrency(margePrixSubstitutMedicament)+" "+devise+" defined, please wait for the insurer's agreement before continuing.";
v_msg="Vous devez imp\u00e9rativement prendre un m\u00e9dicament de prix inf\u00e9rieur ou \u00e9gal \u00e0 celui prescrit!";
v_msgEng="You must imperatively take a medicine of lower price or equal to that prescribed!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val("");
$("#prixSubstitut").val(0);
//preparesms(typeSms);
//mettremailattente(donnees_sav);
//$("#btn_actu").prop("disabled",false);
//etatreponsesubstitution();
//$("#btn_actu").focus();
//$("#btn_actu").click();
//sleep(1/10);
//$("#btn_actu").click();
return false;
}else{
$("#btn_actu").prop("disabled",true);
$("#btn_enreg").prop("disabled",false);
$("#div_patienter").empty();
}
}
}
function etatreponsesubstitution()
{
var idMedicament = $('#idMedicament').val();
var idSubstitut = $('#idSubstitut').val();
var prixSubstitut = $('#prixSubstitut').val();
var posologie = $('#posologie').val();
var nvellePosologie = $.trim($('#nvellePosologie').val());
donnees = 'idMedicament='+idMedicament;
donnees += '&idSubstitut='+idSubstitut;
donnees += '&prixSubstitut='+prixSubstitut;
donnees += '&posologie='+posologie;
donnees += '&nvellePosologie='+nvellePosologie;
//alert(donnees);
//return;
$("#div_patienter").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxetatreponsesubstitution/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_patienter").html(data);
var codeReponseEntentePrealable = $('#codeReponseEntentePrealable').val();
if(codeReponseEntentePrealable=="1"){
$("#btn_actu").prop("disabled",true);
$("#btn_enreg").prop("disabled",false);
$('#').val();
}
},
complete: function() {
}
});
}
function sleep(seconds){
var waitUntil = new Date().getTime() + seconds*1000;
while(new Date().getTime() < waitUntil){
true;
}
}
function viderDuree(){
//debugger;
$("#quantite").val("1");
div_quantite.focus();
}
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\u00e9lectionner 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\u00e9e!";
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\u00e9lectionner 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\u00e9e!";
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\u00e9e!";
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\u00e9lectionner 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\u00e9e!";
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;
}
motifHospit = $("#motifHospit").val();
v_msg="Confirmez-vous cette chambre?";
v_msgEng="Do you confirm this room?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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+'&quantite='+quantite+'&motifHospit='+motifHospit+'&typeMail=mailententeprealable';
donnees_sav2 = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&quantite='+quantite+'&motifHospit='+motifHospit+'&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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
if(autorisation=="2")
{
preparesms(typeSms2);
v_msg="Demande autorisation envoy\u00e9e!";
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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
attribution_chambre();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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+'&quantite='+quantite+'&motifHospit='+motifHospit+'&typeMail=mailententeprealable';
donnees_sav2 = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&quantite='+quantite+'&motifHospit='+motifHospit+'&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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
if(autorisation=="2")
{
preparesms(typeSms2);
v_msg="Demande autorisation envoy\u00e9e!";
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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
attribution_chambre();
}
});
}
else
{
return;
}
});
}
}
function actesmedicaux()
{
actVisible=$("#actVisible").val();
// if (actVisible!="1" && modeSaisieFacture!="1")
if (actVisible!="1")
{
v_msg="Non autoris\u00e9e!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
modeSaisieFacture=$("#modeSaisieFacture").val();
facture=$("#facture").val();
if (modeSaisieFacture=="0" && facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
bonCaduc=$("#bonCaduc").val();
if (bonCaduc==1 && modeSaisieFacture!="1")
{
v_msg="Bon caduc!";
v_msgEng="Obsolete!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Actesmedicaux/");
}
function optique()
{
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
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\u00e9der à 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\u00e9der à 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\u00e9der à 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,
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\u00e9jà factur\u00e9!";
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\u00e9passement 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");
}
else
{
okId=$("#okId" ).val();
if (okId!=1)
{
v_msg="Veuillez proc\u00e9der à 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) {
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data) {
},
complete: function()
{
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation d\u00e9finitive effectu\u00e9e avec succès!";
v_msgEng="Final invoicing successfully completed!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
}
function facturer_feuillemaladie()
{
// actes A ENTENTE PREALBLE demande en attente
debugger;
codeLangue = $("#codeLangue").val();
prixActe = $("#prixActe").val();
if (prixActe =="0")
{
v_msg="Rien à facturer!";
v_msgEng="Nothing to charge!";
alert_ebene(v_msg, v_msgEng);
return;
}
ententePrealableenattente=$("#ententePrealableenattente").val();
if (ententePrealableenattente =="1")
{
v_msg="Veuillez attendre la reponse du gestionnaire avant la facturation d\u00e9finitive ! ";
v_msgEng="Please wait for the manager's response before final billing!";
alert_ebene(v_msg, v_msgEng);
return;
}
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
modeSaisieFacture=$("#modeSaisieFacture").val();
facture=$("#facture").val();
contestation = $("#contestation").val();
if(facture == "0" && contestation == "1"){
v_msg="Dossier médical contesté !";
v_msgEng="Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (modeSaisieFacture=="0" && facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
bonCaduc=$("#bonCaduc").val();
if (bonCaduc==1 && modeSaisieFacture!="1")
{
v_msg="Bon caduc!";
v_msgEng="Obsolete!";
alert_ebene(v_msg, v_msgEng);
return;
}
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
codeEtatDecompte=$("#codeEtatDecompte").val();
if (codeEtatDecompte=="1" || codeEtatDecompte=="9")
{
v_msg="Période clôturée!";
v_msgEng="Period closed!";
alert_ebene(v_msg, v_msgEng);
return;
}
numOrd = $("#numOrd").val();
noPrescription = $("#noPrescription").val();
hospitalisation = $("#hospitalisation").val();
if (numOrd=="0" && noPrescription=="0" && hospitalisation=="0" && modeSaisieFacture=="0")
{
v_msg="Souhaitez-vous cr\u00e9er une ordonnance m\u00e9dicale avant de facturer?";
v_msgEng="Would you like to create a medical prescription before invoicing?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
prescription_medicament();
}
else
{
v_msgEng="Do you confirm the final billing?";
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_cso(user_id_0);
}
else
{
return;
}
});
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
prescription_medicament();
}
else
{
v_msg="Confirmez-vous la facturation d\u00e9finitive?";
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_cso(user_id_0);
}
else
{
return;
}
});
}
});
}
}
else
{
v_msg="Confirmez-vous la facturation d\u00e9finitive?";
v_msgEng="Do you confirm the final billing?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_cso(user_id_0);
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_cso(user_id_0);
}
else
{
return;
}
});
}
}
}
function facturer_pha()
{
//debugger;
var div_messages = $('#div_messages');
div_messages.html('');
nbLivre=$("#nbLivre").val();
nbLivre = parseInt(nbLivre);
if (nbLivre<1)
{
v_msg="Rien à facturer!";
v_msgEng="Nothing to bill!";
alert_ebene(v_msg, v_msgEng);
return;
}
coutprescription = $("#coutprescription").val();
//alert(coutprescription);
//return;
montantTm = $("#montantTm").val();
cout = $("#cout").val();
montantTm_f = $("#montantTm_f").val();
cout_f = $("#cout_f").val();
donnees = 'prixActe='+coutprescription;
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) {
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data) {
},
complete: function() {
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation effectu\u00e9e avec succès!";
v_msgEng="Billing done successfully!";
alert_ebene(v_msg, v_msgEng);
window.location.assign($("#racineWeb" ).val()+"Pharmacien/");
}
});
}
function valider_pharmacie_pha()
{
//debugger;
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\u00e9e!";
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);
coutprescription =$("#coutprescription").val();
if (coutprescription<=0 || coutprescription==undefined)
{
v_msg="Rien à facturer!";
v_msgEng="Nothing to bill!";
alert_ebene(v_msg, v_msgEng);
return;
}
montantsaisi=$("#montantsaisi").val();
if (montantsaisi==1)
{
v_msg="Veuillez verifier les montants et facturer à nouveau s'il vous plaît!";
v_msgEng="Please check the amounts and invoice again!";
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;
}else{
for (let pas = 1; pas <= nbLivre; pas++) {
if($("#valeurActeManuel"+pas).val()=="0"){
v_msg="Veuiller entrer le prix du m\u00e9dicament!";
v_msgEng="Please enter the drug price!";
alert_ebene(v_msg, v_msgEng);
$("#valeurActeManuel"+pas).focus();
return;
}
}
}
//messagePatienter();
//debugger;
v_msg="Confirmez-vous cette facturation?";
v_msgEng="Do you confirm this billing?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
facturer_pha();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
facturer_pha();
}
else
{
return;
}
});
}
}
function imprimer_facture_definitive_pha()
{
//debugger;
idFacture = $("#idFacture").val();
if (idFacture>="0")
{
donnees = "idFacture="+idFacture;
var div_export = $('#div_facture_definitive');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturedefinitivepha/",
type: 'POST',
data: donnees,
success: function(data)
{
div_export.html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
else
{
v_msg="Rien \u00e0 imprimer!";
v_msgEng="Nothing to print!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
function imprimer_facture_definitive_opt()
{
debugger;
idFacture = $("#idFacture").val();
if (idFacture>="0")
{
donnees = "idFacture="+idFacture;
var div_export = $('#div_facture_definitive');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
//$("#btn_facture_partielle").click();
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturedefinitiveopt/",
type: 'POST',
data: donnees,
success: function(data)
{
div_export.html(data);
//facturepartielle();
//$('#div_export_a').html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
else
{
v_msg="Rien \u00e0 imprimer!";
v_msgEng="Nothing to print!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
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\u00e9jà factur\u00e9!";
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;
}
axeVisionLoinDroit= $("#axeVisionLoinDroit").val();
verreCylindriqueDroit= $("#verreCylindriqueDroit").val();
verreSpheriqueDroit= $("#verreSpheriqueDroit").val();
axeVisionLoinGauche= $("#axeVisionLoinGauche").val();
verreCylindriqueGauche= $("#verreCylindriqueGauche").val();
verreSpheriqueGauche= $("#verreSpheriqueGauche").val();
distanceInterpupillaireVisionLoin= $("#distanceInterpupillaireVisionLoin").val();
axeVisionPresDroit= $("#axeVisionPresDroit").val();
axeVisionPresGauche= $("#axeVisionPresGauche").val();
distanceInterpupillaireVisionPres= $("#distanceInterpupillaireVisionPres").val();
doubleFoyer= $("#doubleFoyer").val();
progressif= $("#progressif").val();
teinteA= $("#teinteA").val();
teinteAB= $("#teinteAB").val();
teinteB= $("#teinteB").val();
teinteC= $("#teinteC").val();
photogray= $("#photogray").val();
antireflet= $("#antireflet").val();
photochromique= $("#photochromique").val();
antiUV= $("#antiUV").val();
transition= $("#transition").val();
antiBuee= $("#antiBuee").val();
filtreBleu= $("#filtreBleu").val();
v_msg="Confirmez-vous cette ordonnance ?";
v_msgEng="Do you confirm this prescription?";
donnees = 'numeroBonOptique='+numeroBonOptique;
donnees += '&axeVisionLoinDroit='+axeVisionLoinDroit+'&verreCylindriqueDroit='+verreCylindriqueDroit+'&verreSpheriqueDroit='+verreSpheriqueDroit;
donnees += '&axeVisionLoinGauche='+axeVisionLoinGauche+'&verreCylindriqueGauche='+verreCylindriqueGauche;
donnees += '&verreSpheriqueGauche='+verreSpheriqueGauche+'&distanceInterpupillaireVisionLoin='+distanceInterpupillaireVisionLoin+'&axeVisionPresDroit='+axeVisionPresDroit;
donnees += '&axeVisionPresGauche='+axeVisionPresGauche+'&distanceInterpupillaireVisionPres='+distanceInterpupillaireVisionPres+'&doubleFoyer='+doubleFoyer;
donnees += '&progressif='+progressif+'&teinteA='+teinteA+'&teinteAB='+teinteAB+'&teinteB='+teinteB+'&teinteC='+teinteC+'&photogray='+photogray;
donnees += '&antireflet='+antireflet+'&photochromique='+photochromique+'&antiUV='+antiUV+'&transition='+transition+'&antiBuee='+antiBuee+'&filtreBleu='+filtreBleu;
//alert(donnees);
//return;
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
}
else
{
return;
}
});
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistreroptique/enregistrerprescriptionoptique/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
feuillemaladie();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistreroptique/enregistrerprescriptionoptique/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
feuillemaladie();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
}
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\u00e9jà effectu\u00e9!";
v_msgEng="Already done!";
alert_ebene(v_msg, v_msgEng);
return;
}
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
codeMedecin = $("#codeMedecin").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
}
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\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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\u00e9ro 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?";
*/
motifOptique = $("#motifOptique").val();
if (motifOptique<=" ")
{
v_msg="Saisissez le motif de la prescription!";
v_msgEng="Enter the reason for the prescription!";
alert_ebene(v_msg, v_msgEng);
$("#motifOptique").focus();
return;
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifOptique='+motifOptique;
// 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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_optique();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifOptique='+motifOptique;
// 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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_optique();
}
});
}
else
{
return;
}
});
}
}
function enregistrerverre()
{
codeOptique = $("#codeOptique").val();
if (codeOptique<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeOptique='+codeOptique;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerverre/enregistrerverre/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
prescription_optique();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeOptique='+codeOptique;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerverre/enregistrerverre/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
prescription_optique();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
}
function valider_chambre()
{
var dureeHospit = $("#dureeHospit").val();
var dateDebutHospit = $("#dateDebutHospit").val();
var optionHospitalisation = $("#optionHospitalisation").val();
var avisHospitalisation = $("#avisHospitalisation").val();
var libelleAvis = $("#libelleAvis").val();
var nbreActesSansPrix = $("#nbreActesSansPrix").val();
var nbreActesSansPrixPro = $("#nbreActesSansPrixPro").val();
var reclame = $("#reclame").val();
var modeSaisieFacture = $("#modeSaisieFacture").val();
var prixChambreProlongation = $("#prixChambreProlongation").val();
var noChambrePro = $("#noChambrePro").val();
var idProlongationFeuille = $("#idProlongationFeuille").val();
//alert(nbreActesSansPrix);
if(dateDebutHospit==""){
v_msg="Veuillez saisir la date de début de l'hospitalisation!";
v_msgEng="Please enter the start date of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebutHospit").focus();
return;
}
if(dureeHospit=="0"){
v_msg="Veuillez saisir la dur\u00e9e de l'hospitalisation!";
v_msgEng="Please enter the duration of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#dureeHospit").focus();
return;
}
if (avisHospitalisation != "1" && avisHospitalisation != "9")
{
alert_ebene(libelleAvis, libelleAvis);
//feuillemaladie();
return;
}
badcodeGestionBon = $("#badcodeGestionBon").val();
chambreOK = $("#chambreOK").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;
}
if (reclame == "0")
{
v_msg="Rien à valider!";
v_msgEng="Nothing to confirm!";
alert_ebene(v_msg, v_msgEng);
return;
}
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9j\u00e0 factur\u00e9!";
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;
}
noChambre = $("#noChambre").val();
if(noChambre<=" ")
{
v_msg="Veuillez entrer le numero de chambre!";
v_msgEng="Please enter the room number!";
alert_ebene(v_msg, v_msgEng);
$("#noChambre").focus();
return;
}
if(idProlongationFeuille>"0")
{
if(noChambrePro!=undefined && noChambrePro<=" ")
{
v_msg="Veuillez entrer le numero de chambre de prorogation!";
v_msgEng="Please enter the extension room number!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (prixChambreProlongation==undefined || prixChambreProlongation == "0")
{
v_msg="Vous n'avez pas saisi le prix de la chambre de prorogation.";
v_msgEng="You have not entered the price of the extension room.";
alert_ebene(v_msg, v_msgEng);
$("#btn_close_pop").click();
return;
}
}
donnees = 'noChambre='+noChambre;
v_msg="Confirmez-vous cette hospitalisation ?";
v_msgEng="Do you confirm this hospitalization?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(nbreActesSansPrix>'0' || nbreActesSansPrixPro>'0'){
v_msg="Les actes sans prix unitaire seront supprimés à la validation!";
v_msgEng="Acts without a unit price will be deleted upon validation!";
faireDefileMessage(v_msg, v_msgEng);
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/supprimeacte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
}
});
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/validerhospitalisation/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(nbreActesSansPrix>'0' || nbreActesSansPrixPro>'0'){
v_msg="Les actes sans prix unitaire seront supprimés!";
v_msgEng="Acts without a unit price will be deleted";
faireDefileMessage(v_msg, v_msgEng);
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/supprimeacte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
}
});
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/validerhospitalisation/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
function valider_opticien()
{
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;
}
idPrestationactes=$("#idPrestationactes").val();
idPrestationactes = parseInt(idPrestationactes);
if (idPrestationactes>0)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val();
if(codeReponseEntentePrealable!="1")
{
v_msg="Vous ne pouvez pas facturer! Veuillez attendre l'accord de l'assureur.";
v_msgEng="You cannot charge! Please wait for the agreement of the insurer.";
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\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Confirmez-vous cette facturation?";
v_msgEng="Do you confirm this billing?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
facturer_opt();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
facturer_opt();
}
else
{
return;
}
});
}
}
function opticien()
{
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\u00e9jà factur\u00e9!";
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) {
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data) {
},
complete: function()
{
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation effectu\u00e9e 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();
$("#libelleDerogation").val(libelleDerogation);
college_couvert=$("#college_couvert_C").val();
if (college_couvert>0 && codeDerogation=="01")
{
v_msg="Attention! Cette personne a d\u00e9jà 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\u00e9lectionner une d\u00e9rogation!";
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\u00e9rogation?";
v_msgEng="Do you confirm this request?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Request sent successfully!";
alert_ebene(v_msg, v_msgEng);
liste_derogation();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Request sent successfully!";
alert_ebene(v_msg, v_msgEng);
liste_derogation();
}
});
}
else
{
return;
}
});
}
}
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;
$("#div_entete_dossier").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxconsultationcsoentete/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_entete_dossier").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()
{
debugger;
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
hospitalisation = $("#hospitalisation").val();
numOrd = $("#numOrd").val();
facture=$("#facture").val();
if (numOrd == "0" && facture==1)
{
v_msg="D\u00e9j\u00e0 factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(numOrd == "0" && contestation == "1"){
const v_msg = "Dossier médical contesté !";
const v_msgEng = "Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (hospitalisation=="1" && numOrd=="0")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
numeroBon = $("#numeroBon").val();
codeMedecin = $("#codeMedecin").val();
codeGestionBon = "2";
/* CODE A RAJOUTER POUR LES CODE D'AFFECTION*/
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
// if (actVisible!="1" && modeSaisieFacture!="1")
if (actVisible!="1")
{
v_msg="Non autoris\u00e9!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (numOrd=="0" && contestation == "0"){
enregistrerprescriptionmedicatement(numeroBon,codeMedecin,codeGestionBon);
} else{
window.location.assign($("#racineWeb" ).val()+"Prescription/");
}
}
function livraison_pharmacie()
{
actVisible=$("#actVisible").val();
nomForm = $("#nomForm").val();
if (nomForm=="feuillemaladie"){
estGarantiePha = $("#estGarantiePha").val();
/*
if (estGarantiePha!="1"){
v_msg="Cet acte n'est pas garantie pour le b\u00e9n\u00e9ficiaire!";
v_msgEng="This act is not guaranteed for the beneficiary!";
alert_ebene(v_msg, v_msgEng);
return;
}*/
}
// if (actVisible!="1" && modeSaisieFacture!="1")
if (actVisible!="1")
{
v_msg="Non autoris\u00e9e!";
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()
{
//debugger;
codePrestataire=$("#codePrestataire").val();
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
numeroBonOptique=$("#numeroBonOptique").val();
facture=$("#facture").val();
if (numeroBonOptique == "0" && facture==1)
{
v_msg="D\u00e9j\u00e0 factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(numeroBonOptique == "0" && contestation == "1"){
v_msg="Dossier médical contesté !";
v_msgEng="Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
hospitalisation = $("#hospitalisation").val();
if (hospitalisation=="1")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
window.location.assign($("#racineWeb" ).val()+"Optique/");
}
function attribution_chambre()
{
debugger;
affectionObligatoire = $("#affectionObligatoire").val();
codeAffection = $("#codeAffection").val();
modeSaisieFacture = $("#modeSaisieFacture").val();
numeroBonHospitalisation = $("#numeroBonHospitalisation").val();
dateDebutHospit = $("#dateDebutHospit").val();
facture=$("#facture").val();
if (numeroBonHospitalisation == "0" && facture==1)
{
v_msg="D\u00e9j\u00e0 factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(numeroBonHospitalisation == "0" && contestation == "1"){
v_msg="Dossier médical contesté !";
v_msgEng="Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
codeLangue = $("#codeLangue").val();
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
facture = $("#facture").val();
modeSaisieFacture = $("#facture").val();
avisHospitalisation = $("#avisHospitalisation").val();
idProformaHospitalisation = $("#idProformaHospitalisation").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
garantieHospitalisation = $("#garantieHospitalisation").val();
finCarenceHospitalisation = $("#finCarenceHospitalisation").val();
if (garantieHospitalisation!=undefined && garantieHospitalisation!="1970-01-01")
{
v_msg="Le d\u00e9lai de carence est toujours en vigueur pour cet assur\u00e9 sur cette prescription, la fin est pr\u00e9vue pour le "+finCarenceHospitalisation;
v_msgEng="Waiting period is still in force for this insured on this prescription, the end is scheduled for "+finCarenceHospitalisation;
alert_ebene(v_msg, v_msgEng);
return;
}
//window.location.assign($("#racineWeb" ).val()+"Chambre/");
if(avisHospitalisation == "0" && numeroBonHospitalisation=="0" && idProformaHospitalisation > "0" && facture=="0")
{
afficher_proforma_hospitalisation(idProformaHospitalisation);
return;
}
autoriserBonHospitAvantDate = $("#autoriserBonHospitAvantDate").val();
if(avisHospitalisation == "1" && estDateFuture(dateDebutHospit) && autoriserBonHospitAvantDate =="0" && idProformaHospitalisation > "0" && facture=="0")
{
v_msg="Hospitalisation chirurgicale non encore autorisée! Attendez, s'il vous plaît, la date de sa programmation. Merci pour votre compréhension!";
v_msgEng="Surgical hospitalization not yet authorized! Please wait for the scheduling date. Thank you for understanding!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(avisHospitalisation == "2"){
v_msg="Un avis d'hospitalisation a d\u00e9ja \u00e9t\u00e9 envoy\u00e9 pour validation! Souhaitez-vous le modifier?";
v_msgEng="A notice of hospitalization has already been sent for validation! Would you like to modify it?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
hospitalisation();
return;
}
else
{
feuillemaladie();
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
hospitalisation();
return;
}
else
{
feuillemaladie();
return;
}
});
}
}else if(avisHospitalisation == "3" && facture == "0"){
v_msg="Avis rejet\u00e9!";
v_msgEng="Review rejected!";
alert_ebene(v_msg, v_msgEng);
//feuillemaladie();
return;
}else if(avisHospitalisation == "4"){
v_msg="Avis de prorogation d'hospitalisation envoy\u00e9 pour validation! Souhaitez-vous le modifier?";
v_msgEng="Notice of extension of hospitalization sent for validation! Would you like to modify it?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
hospitalisation();
}
else
{
feuillemaladie();
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
hospitalisation();
}
else
{
feuillemaladie();
return;
}
});
}
}else{
hospitalisation();
}
}
// K@M0us2023
function hospitalisation()
{
feuillemaladie_ajax();
window.location.assign($("#racineWeb" ).val()+"Chambre/");
}
function feuillemaladie()
{
nomForm = $("#nomForm").val();
if(nomForm=="frmactesmedicaux"){
motifActe = $("#motifActe").val();
nbEntentePrealable = parseInt($("#nbEntentePrealable").val());
if(nbEntentePrealable>0 && motifActe <=" ")
{
v_msg="Le renseignement clinique est obligatoire pour que votre demande soit envoy\u00e9e \u00e0 l'assureur.";
v_msgEng="Clinical information is mandatory for your claim to be sent to the insurer.";
alert_ebene(v_msg, v_msgEng);
$("#motifActe").focus();
return;
}
}
window.location.assign($("#racineWeb" ).val()+"Feuillemaladie/");
}
function feuillemaladie_ajax()
{
feuillemaladie();
}
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\u00e9lectionner 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)
{
debugger;
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();
libelleDerogation = $("#libelleDerogation").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=="ententeprealableexamen")
{
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();
fraisTotal = parseInt($("#fraisTotal").val());
montantTotalExamen = parseInt($("#montantTotalExamen").val());
p_message = prestataire+" ";
p_message += "\n";
p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_message += "\n";
if(isNaN(fraisTotal) || fraisTotal==undefined || fraisTotal =="" || fraisTotal < montantTotalExamen){
p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement medical examinations" : "Alerte : Accord prealable examens";
}else{
p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement medical examinations"+"\nAmount greater than:"+montantTotalExamen+" Fcfa." : "Alerte : Accord prealable examens medicaux"+"\nMontant sup\u00e9rieur \u00e0: "+montantTotalExamen+" Fcfa.";
}
}
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();
dateDebutHospit = $("#dateDebutHospit").val();
optionHospitalisation = $("#optionHospitalisation").val();
nomForm = $("#nomForm").val();
duree = $("#quantite").val();
dureeHospit = $("#dureeHospit").val();
numeroChambre = $("#numeroChambre").val();
motifHospitalisation= $("#motifHospitalisation").val();
numeroBon = $("#numeroBonHospitalisation").val();
motifProlongation = $("#motifProlongation").val();
codeTypeHospitalisationPro = $("#codeTypeHospitalisationPro").val();
p_message = prestataire+" ";
p_message += "\n";
p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_message += "\n";
p_message += (codeLangueSociete=="en_US") ? "Alert : Hospitalization notification" : "Alerte: Avis Hospitalisation";
//p_message += numeroBon;
if(nomForm=="chambre"){
if(optionHospitalisation=="option-1"){
type = (codeLangueSociete=="en_US") ? "MEDICAL HOSPITALIZATION" : "HOSPITALISATION MEDICALE";
}
if(optionHospitalisation=="option-3"){
type = (codeLangueSociete=="en_US") ? "SURGICAL HOSPITALIZATION" : "HOSPITALISATION CHIRURGICALE";
}
p_message += "\n";
if(motifProlongation == undefined || motifProlongation ==""){
p_message += (codeLangueSociete=="en_US") ? "Clinical Information: " : "Raison clinique: ";
p_message += motifHospitalisation;
p_message += "\n";
p_message += (codeLangueSociete=="en_US") ? "Type: " : "Type: ";
p_message += type;
p_message += "\n";
p_message += (codeLangueSociete=="en_US") ? "Number of days: " : "Nombre de jours: ";
p_message += dureeHospit;
}else{
if (codeTypeHospitalisationPro=="option-1"){
type = (codeLangueSociete=="en_US") ? "MEDICAL HOSPITALIZATION" : "HOSPITALISATION MEDICALE";
}
if (codeTypeHospitalisationPro=="option-3"){
type = (codeLangueSociete=="en_US") ? "SURGICAL HOSPITALIZATION" : "HOSPITALISATION CHIRURGICALE";
}
p_message += (codeLangueSociete=="en_US") ? "Clinical reason extension: " : "Raison clinique prolongation: ";
p_message += motifProlongation;
p_message += "\n";
p_message += (codeLangueSociete=="en_US") ? "Type: " : "Type: ";
p_message += type;
p_message += "\n";
p_message += (codeLangueSociete=="en_US") ? "Number of days: " : "Nombre de jour: ";
p_message += duree;
}
}
}
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";
}
if (typeSms=="demandesubstitution")
{
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: Higher substitution drug price" : "Alerte: Prix m\u00e9dicament substitution sup\u00e9rieur";
}
if (typeSms=="proformahospitalisation")
{
p_destinataires = $("#smsAccordPrealable_C").val();
nomForm = $("#nomForm").val();
copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val();
if (copieSmsPrestataireAssure=="1")
{
p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires);
}
if(nomForm=="proformahospitalisation"){
patient = $("#nomAssure").val();
numeroBeneficiaire = $("#searchInputB" ).val();
}else{
patient = $("#beneficiaire").val();
numeroBeneficiaire = $("#numeroBeneficiaire" ).val();
}
prestataire = $("#prestataire_C").val();
idProforma = $("#idProforma").val();
p_message = prestataire+" ";
p_message += "\n";
p_message += "Assuré : "+patient+" ("+numeroBeneficiaire+") ";
p_message += "\n";
p_message += (codeLangueSociete=="en_US") ? "Alert: Proforma Hospitalization No: "+idProforma : "Alerte : Proforma Hospitalisation No: "+idProforma;
}
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\u00e9passement 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\u00e9passement 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()
{
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
modeSaisieFacture=$("#modeSaisieFacture").val();
facture=$("#facture").val();
if (modeSaisieFacture=="0" && facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(facture == "0" && contestation == "1"){
v_msg="Dossier médical contesté !";
v_msgEng="Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
bonCaduc=$("#bonCaduc").val();
if (bonCaduc==1 && modeSaisieFacture!="1")
{
v_msg="Bon caduc!";
v_msgEng="Obsolete!";
alert_ebene(v_msg, v_msgEng);
return;
}
hospitalisation = $("#hospitalisation").val();
if (hospitalisation=="1")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
facture=$("#facture").val();
if (modeSaisieFacture=="0" && facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
facturerConsommable=$("#facturerConsommable").val();
if (facturerConsommable!="1")
{
v_msg="Consommables non factur\u00e9s!";
v_msgEng="Consumables not invoiced!";
alert_ebene(v_msg, v_msgEng);
return;
}
ajoutConsommable = $("#ajoutConsommable").val();
if (ajoutConsommable!="1")
{
v_msg="D\u00e9jà inclu dans les actes ! Souhaitez-vous continuer?";
v_msgEng="Already included in the acts ! Would you like to continue?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
window.location.assign($("#racineWeb" ).val()+"Consommables/");
return;
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9lectionner un consommable!";
v_msgEng="Please select a consumable!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Ajouter : "+libelleConsommable+"?";
v_msgEng="Add : "+libelleConsommable+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
}
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\u00e9!";
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()
{
codeMedecin = $("#codeMedecin").val();
nomsearch = $("#nomsearch").val();
if(codeMedecin+nomsearch<=" ")
return;
donnees = "valid=1&codeMedecin="+codeMedecin+"&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\u00e9decin : "+nomMedecin+"?";
v_msgEng="Do you confirm this Doctor : "+nomMedecin+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#codeMedecin").val(codeMedecin);
$("#nomMedecin").html(nomMedecin+" ( "+codeMedecin+" )");
$("#close_pop").click();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#codeMedecin").val(codeMedecin);
$("#nomMedecin").html(nomMedecin+" ( "+codeMedecin+" )");
$("#close_pop").click();
}
else
{
return;
}
});
}
}
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\u00e9!";
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, posologie, idDemandeSubstitution, quantite)
{
var bonCaduc = $('#bonCaduc').val();
v_msg="Substituer ce m\u00e9dicament?";
v_msgEng="Substitute this drug?";
if(bonCaduc=="1"){
v_msg="Substitution impossible le bon est caduc!";
v_msgEng="Impossible substitution the voucher is void!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(idDemandeSubstitution > "0"){
donnees = 'idMedicament='+idMedicament+'&posologie='+posologie+'&idDemandeSubstitution='+idDemandeSubstitution+'&quantite='+quantite;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsubstitutionmedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_substitution").html(data);
$("#div_substitution #frmmedicament #libelleMedicamentSearch").focus();
},
complete: function() {
$("#btn_pop").click();
etatreponsesubstitution();
}
});
}else{
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament+'&posologie='+posologie+'&idDemandeSubstitution=0'+'&quantite='+quantite;
//alert(donnees);
//return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsubstitutionmedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_substitution").html(data);
$("#libelleMedicamentSearch").focus();
},
complete: function() {
$("#btn_pop").click();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament+'&posologie='+posologie+'&idDemandeSubstitution=0'+'&quantite='+quantite;
//alert(donnees);
//return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsubstitutionmedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_substitution").html(data);
$("#libelleMedicamentSearch").focus();
},
complete: function() {
$("#btn_pop").click();
}
});
}
else
{
return;
}
});
}
}
}
function annuler_substitution_medicament(idMedicament)
{
v_msg="Annuler cette substitution?";
v_msgEng="Cancel this substitution?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
}
function enregistrersubstituion_medicament()
{
idMedicament = $("#idMedicament").val();
prixTarif = $("#prixTarif").val();
prixTarif = prixTarif.replace(/ /g,"");
prixTarif = parseInt(prixTarif.replace(",","."),10);
idSubstitut = $("#idSubstitut").val();
prixSubstitut = $("#prixSubstitut").val();
prixSubstitut = prixSubstitut.replace(/ /g,"");
prixSubstitut = parseInt(prixSubstitut.replace(",","."),10);
qteMedicamentSubstitut = $("#qteMedicamentSubstitut").val();
//idDemandeSubstitution = $("#idDemandeSubstitution").val();
nvellePosologie = $("#nvellePosologie").val();
if(prixSubstitut==0)
{
v_msg="Veuillez revoir le tarif!";
v_msgEng="Please review rate!";
alert_ebene(v_msg, v_msgEng);
$("#prixSubstitut").focus();
return false;
}
v_msg="Confirmez-vous cette substitution?";
v_msgEng="Do you confirm this substitution?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament+'&prixTarif='+prixTarif+'&idSubstitut='+idSubstitut+'&prixSubstitut='+prixSubstitut;
donnees += '&nvellePosologie='+nvellePosologie+'&qteMedicamentSubstitut='+qteMedicamentSubstitut;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/enregistrersubstitutionmedicament/",
type: 'POST',
data: donnees,
success: function(data) {
$("#btn_close_pop").click();
//affiche_livraison_substituer();
},
error: function(data) {
},
complete: function() {
$("#btn_ordonnance").click();
$("#btn_livarison").click();
alerter_depassement_limite();
window.location.assign($("#racineWeb" ).val()+"Pharmacien/");
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idMedicament='+idMedicament+'&prixTarif='+prixTarif+'&idSubstitut='+idSubstitut+'&prixSubstitut='+prixSubstitut;
donnees += '&nvellePosologie='+nvellePosologie+'&qteMedicamentSubstitut='+qteMedicamentSubstitut;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/enregistrersubstitutionmedicament/",
type: 'POST',
data: donnees,
success: function(data) {
$("#btn_close_pop").click();
//affiche_livraison_substituer();
},
error: function(data) {
},
complete: function() {
$("#btn_ordonnance").click();
$("#btn_livarison").click();
alerter_depassement_limite();
window.location.assign($("#racineWeb" ).val()+"Pharmacien/");
}
});
}
else
{
return;
}
});
}
}
function actualise_livraisonpha_substituer()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxlivraisonphasubstitues/",
type: 'POST',
data: donnees,
success: function(data) {
$("#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+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#codeActe").val(codeActe);
ajaxprixacte();
$("#libelleActe").val(libelleActe);
$("#close_pop_acte").click();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#codeActe").val(codeActe);
ajaxprixacte();
$("#libelleActe").val(libelleActe);
$("#close_pop_acte").click();
}
else
{
return;
}
});
}
}
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+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#codeActe").val(codeActe);
ajaxprixactemed();
$("#libelleActe").val(libelleActe);
$("#close_pop_acte").click();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#codeActe").val(codeActe);
ajaxprixactemed();
$("#libelleActe").val(libelleActe);
$("#close_pop_acte").click();
}
else
{
return;
}
});
}
}
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();
codeLangue = $("#codeLangue").val();
if (codeMedicament<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9dicament!";
v_msgEng="Please select a medicine/drug!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'codeMedicament='+codeMedicament;
donnees += '&codePrestatairePrescription=' + codePrestatairePrescription;
v_msg="Prescrire : "+libelleMedicament+"?";
v_msgEng="Prescribe : "+libelleMedicament+"?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.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();
}
});
}
else
{
return;
}
});
}
// 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\u00e9e!";
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\u00e9!";
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()
{
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
numeroBonExamen=$("#numeroBonExamen").val();
facture=$("#facture").val();
if (numeroBonExamen == "0" && facture==1)
{
v_msg="D\u00e9j\u00e0 factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(numeroBonExamen == "0" && contestation == "1"){
const v_msg = "Dossier médical contesté !";
const v_msgEng = "Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
actVisible=$("#actVisible").val();
hospitalisation = $("#hospitalisation").val();
if (hospitalisation=="1")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
// if (actVisible!="1" && modeSaisieFacture!="1")
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Prescriptionexamen/");
}
function valider_presciption_examens()
{
debugger;
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;
}
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
nbExamens=$("#nbExamens").val();
nbExamens = parseInt(nbExamens);
//
numeroEnteteEntentePrealable=$("#numeroEnteteEntentePrealable").val();
envoyeSms=$("#envoyeSms").val();
envoyeSms = parseInt(envoyeSms);
numeroBonExamen=$("#numeroBonExamen").val();
if (numeroBonExamen<=0)
{
v_msg="Pas de prescription!";
v_msgEng="No prescription!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
return;
}
motifExamen = $("#motifExamen").val();
if (motifExamen<=" ")
{
v_msg="Veuillez entrer le motif de la prescription d'examen!";
v_msgEng="Please enter the reason for the examination prescription!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").val("");
$("#motifExamen").focus();
return;
}
v_msg="Confirmez-vous cette presciption ?";
v_msgEng="Do you confirm this prescription?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
// KANE => ajout du 12/04/2025
envoieprescription_examen();
if(numeroEnteteEntentePrealable == "0")
{
debugger
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
feuillemaladie();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
// KANE => ajout du 12/04/2025
envoieprescription_examen();
if(numeroEnteteEntentePrealable == "0")
{
debugger
//preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
feuillemaladie();
}
else
{
return;
}
});
}
}
function majMotifExamen(){
motifExamen = $("#motifExamen").val();
donnees = 'motifExamen='+motifExamen;
//$("#examens").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionexamen/majmotifexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
},
complete: function()
{
}
});
}
function majMotifSeance(){
codeGestionBon = "2";
numeroBon = $("#numeroBon").val();
codeMedecin = $("#codeMedecin").val();
motifSeance = $("#motifSeance").val();
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifSeance='+motifSeance+'&codeGestionBon='+codeGestionBon;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionseance/majmotifseance/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
window.location.assign($("#racineWeb" ).val()+"Prescriptionsence/");
},
complete: function()
{
}
});
}
function majMotifMiseEnObservation(){
motif = $("#motif").val();
donnees = 'motif='+motif;
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/majmotif/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
},
complete: function()
{
}
});
}
function majMotifHospitalisation(){
motifHospitalisation = $("#motifHospitalisation").val();
donnees = 'motifHospitalisation='+motifHospitalisation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/majmotif/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
},
complete: function()
{
}
});
}
function majMotifOptique(){
codeGestionBon = "2";
numeroBon = $("#numeroBon").val();
codeMedecin = $("#codeMedecin").val();
motifOptique = $("#motifOptique").val();
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifOptique='+motifOptique+'&codeGestionBon='+codeGestionBon;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistreroptique/majmotifoptique/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
window.location.assign($("#racineWeb" ).val()+"Optique/");
},
complete: function()
{
}
});
}
function chargeactesexamen(libelle)
{
if(libelle=="acte"){
libelle = $("#searchExam").val();
}
if(libelle==""){
return;
}
donnees = 'libelle='+libelle;
//$("#div_select_examen").html('
' + 'Veuillez patienter pour le chargement des examens...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxchargeractesexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#div_select_examen").html(data);
//$("#codeActe").selectpicker();
$("#codeActe").focus();
//$("#codeActe").click();
},
complete: function()
{
//chargeactesexamen();
}
});
}
function ajaxPrescriptionexamen()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxprescriptionexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#div_prescription").html(data);
},
complete: function()
{
//chargeactesexamen();
}
});
}
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\u00e9jà effectu\u00e9!";
v_msgEng="Already done!";
alert_ebene(v_msg, v_msgEng);
return;
}
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
codeMedecin = $("#codeMedecin").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
}
function enregistrerprescriptionexamen()
{
badcodeGestionBon = $("#badcodeGestionBon").val();
codeLangue = $("#codeLangue").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\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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\u00e9ro 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?";
}
motifExamen = $("#motifExamen").val();
if (motifExamen<=" ")
{
v_msg="Saisissez le motif de la prescription de l'examen!";
v_msgEng="Enter the reason for ordering the examination!";
alert_ebene(v_msg, v_msgEng);
$("#motifExamen").focus();
return;
}
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifExamen='+motifExamen;
// 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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_examen();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifExamen='+motifExamen;
// 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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_examen();
}
});
}
else
{
return;
}
});
}
}
function genereBonAutomatiqueExamen(codeGestionBon,codeMedecin,numeroBon)
{
motifExamen = $("#motifExamen").val();
if (motifExamen==undefined)
{
motifExamen ="";
}
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifExamen='+motifExamen;
// ajout du 27/06/2019 => prise en compte de la gestion paperless
donnees += '&codeGestionBon='+codeGestionBon;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionexamen/enregistrerprescriptionexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
},
complete: function() {
window.location.assign($("#racineWeb" ).val()+"Prescriptionexamen/");
}
});
}
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);
dataTableSpeciale();
}
});
}
function afficher_pop_recherche_autres_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);
dataTableSpeciale();
}
});
}
function afficher_pop_recherche_bio_possibles()
{
libelleActeSearch = $("#libelleActeSearch").val();
if(libelleActeSearch<=" ")
{
return;
}
donnees = "bio=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);
dataTableSpeciale();
}
});
}
function afficher_pop_recherche_ima_possibles()
{
libelleActeSearch = $("#libelleActeSearch").val();
if(libelleActeSearch<=" ")
{
return;
}
donnees = "ima=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);
dataTableSpeciale();
}
});
}
function ajouter_examen_possible(codeActe, libelleActe, acteExclu, ententePrealable)
{
//alert('OK');
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+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
prescription_examen();
},
complete: function() {
if(ententePrealable==1)
{
mettremailattente(donnees_sav);
}
prescription_examen();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
prescription_examen();
},
complete: function() {
if(ententePrealable==1)
{
mettremailattente(donnees_sav);
}
prescription_examen();
}
});
}
else
{
return;
}
});
}
}
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\u00e9!";
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()
{
hospitalisation = $("#hospitalisation").val();
numeroBonExamen = $("#numeroBonExamen").val();
if (hospitalisation=="1" && numeroBonExamen=="0")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene(v_msg, v_msgEng);
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
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\u00e9jà factur\u00e9!";
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\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
nbLivre=$("#nbLivre").val();
nbLivre = parseInt(nbLivre);
if (nbLivre<1)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailexamen/enregistrerexamen/",
type: 'POST',
success: function(data) {
//maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
v_msg="Confirmez-vous ces examens?";
v_msgEng="Do you confirm these exams?";
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailexamen/enregistrerexamen/",
type: 'POST',
success: function(data) {
//maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailexamen/enregistrerexamen/",
type: 'POST',
success: function(data) {
maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
function ajouterexamen_tous()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailexamen/ajouterexamentous/",
type: 'POST',
success: function(data) {
$("#livraison").html(data);
//afficheDivPlafond();
//getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
//alerter_depassement_limite_cso();
}
});
}
function ajouterexamen(idExamen, ententePrealable, codeActe, codeGarantie)
{
donnees = 'idExamen='+idExamen+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
typeSms="ententeprealable";
datePrescription = $("#datePrescription").val();
if (ententePrealable==9)
{
v_msg="Acte refus\u00e9!";
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);
//afficheDivPlafond();
getstatutacte(codeActe);
if(ententePrealable=="2")
{
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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);
afficheDivPlafond();
},
error: function(data) {
},
complete: function() {
alerter_depassement_limite();
}
});
}
function ajouterexamen_lab(idExamen, ententePrealable, codeActe, codeGarantie)
{
donnees = 'idExamen='+idExamen+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
typeSms="ententeprealable";
datePrescription = $("#datePrescription").val();
if (ententePrealable==9)
{
v_msg="Acte refus\u00e9!";
v_msgEng="Act refused!";
alert_ebene(v_msg, v_msgEng);
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/ajouterexamen/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
//afficheDivPlafond();
getstatutacte(codeActe);
},
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\u00e9e!";
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")
{
v_msg="Non autoris\u00e9e!";
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\u00e9jà factur\u00e9!";
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);
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val();
// faceActif=
// codeModeBiometrie=
// if(modeSaisieFacture=="1")
// if(derogation_finger_en_cours>0)
facturer_lab(user_id_0);
/*
if(modeSaisieFacture=="1" || derogationFingerFacturation=="1")
{
$("#okId" ).val("1");
$("#okId_face" ).val("1");
facturer_lab(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);
}
*/
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val();
facturer_lab(user_id_0);
/*
if(modeSaisieFacture=="1" || derogationFingerFacturation=="1")
{
$("#okId" ).val("1");
$("#okId_face" ).val("1");
facturer_lab(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);
}
*/
}
else
{
return;
}
});
}
}
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\u00e9jà factur\u00e9!";
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) {
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data) {
},
complete: function() {
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation effectu\u00e9e 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+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
},
complete: function() {
if(ententePrealable==1)
{
mettremailattente(donnees_sav);
}
alerter_depassement_limite();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
},
complete: function() {
if(ententePrealable==1)
{
mettremailattente(donnees_sav);
}
alerter_depassement_limite();
}
});
}
else
{
return;
}
});
}
}
function enregistrer_nv_consommables()
{
debugger;
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\u00e9rique exig\u00e9e!";
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\u00e9!";
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\u00e9rique exig\u00e9e!";
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\u00e9jà factur\u00e9!";
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\u00e9ro 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\u00e9ro 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\u00e9ro 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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Replaced successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Replaced successfully!";
alert_ebene(v_msg, v_msgEng);
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
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\u00e9, 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");
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\u00e9ro 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\u00e9ro 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\u00e9ro 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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Replaced successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_medicament();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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\u00e9e avec succès!";
v_msgEng="Replaced successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_medicament();
}
});
}
else
{
return;
}
});
}
}
function afficher_laboratoire_cso()
{
window.location.assign($("#racineWeb" ).val()+"Laboratoirecso/");
}
function afficher_laboratoire()
{
window.location.assign($("#racineWeb" ).val()+"Laboratoire/");
}
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\u00e9e!";
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\u00e9e!";
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\u00e9jà factur\u00e9!";
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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_lab_cso(user_id_0);
/*
if(modeSaisieFacture=="1")
{
$("#okId" ).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");
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);
}
*/
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_lab_cso(user_id_0);
/*
if(modeSaisieFacture=="1")
{
$("#okId" ).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");
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);
}
*/
}
else
{
return;
}
});
}
}
function facturer_lab_cso(user_id)
{
facture=$("#facture").val();
facture = parseInt(facture);
if (facture>0)
{
v_msg="D\u00e9jà factur\u00e9!";
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) {
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data) {
},
complete: function() {
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation effectu\u00e9e avec succès!";
v_msgEng="Billing done successfully!";
alert_ebene(v_msg, v_msgEng);
afficher_laboratoire_cso();
}
});
}
function prescription_seance()
{
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
numeroBonKine = $("#numeroBonKine").val();
facture=$("#facture").val();
if (numeroBonKine == "0" && facture==1)
{
v_msg="D\u00e9j\u00e0 factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(numeroBonKine == "0" && contestation == "1"){
const v_msg = "Dossier médical contesté !";
const v_msgEng = "Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
//nomForm = $("#nomForm").val();
hospitalisation = $("#hospitalisation").val();
if (hospitalisation=="1" && numeroBonKine=="0")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Prescriptionseance/");
}
function seances()
{
hospitalisation = $("#hospitalisation").val();
if (hospitalisation=="1")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
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\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
*/
numeroPrescriptionKine=$("#numeroPrescriptionKine_C").val();
if (numeroPrescriptionKine==0)
{
v_msg="Aucune s\u00e9ance prescrite!";
v_msgEng="No prescribed session!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Seances/");
}
function miseenobservation()
{
affectionObligatoire = $("#affectionObligatoire").val();
codeAffection = $("#codeAffection").val();
modeSaisieFacture = $("#modeSaisieFacture").val();
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(facture == "0" && contestation == "1"){
v_msg="Dossier médical contesté !";
v_msgEng="Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
hospitalisation = $("#hospitalisation").val();
miseEnObservation = $("#miseEnObservation").val();
if (hospitalisation=="1" && miseEnObservation=="0")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
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();
window.location.assign($("#racineWeb" ).val()+"Miseenobservation/");
}
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\u00e9jà effectu\u00e9!";
v_msgEng="Already done!";
alert_ebene(v_msg, v_msgEng);
return;
}
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
codeMedecin = $("#codeMedecin").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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()
{
debugger;
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\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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\u00e9ro 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?";
*/
motifSeance = $("#motifSeance").val();
if (motifSeance<=" ")
{
v_msg="Saisissez le motif de la prescription de la s\u00e9ance de kin\u00e9sith\u00e9rapie!";
v_msgEng="Enter the reason for the prescription of the physiotherapy session!";
alert_ebene(v_msg, v_msgEng);
$("#motifSeance").focus();
return;
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifSeance='+motifSeance;
// 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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_seance();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin+'&motifSeance='+motifSeance;
// 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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
prescription_seance();
}
});
}
else
{
return;
}
});
}
}
function modifierprescriptionseance()
{
debugger;
acteExclu = "0";
ententePrealable = "0";
autorisation = "0";
dureeTraitement = 0;
codeMedecin = $("#codeMedecin").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
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\u00e9ro 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\u00e9lectionner 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\u00e9!";
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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
montantTm =$("#montantTm").val();
montantArembourser =$("#aRembourser").val();
fraisReel =$("#totalActe").val();
fraisReelBase = $("#fraisReelBase").val();
prixBase = $("#prixBase").val();
depassement = $("#depassement").val();
donnees = 'codeActePrescription='+codeActePrescription +'&quantite='+quantite +'&prixActe='+prixActe;
donnees += '&montantTm='+montantTm +'&montantArembourser='+montantArembourser +'&fraisReel='+fraisReel;
donnees += '&ententePrealable='+ententePrealable+'&fraisReelBase='+fraisReelBase+'&prixBase='+prixBase;
donnees += '&depassement='+depassement+'&dureeTraitement='+dureeTraitement;
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
if(autorisation=="2")
{
preparesms(typeSms2);
v_msg="Demande autorisation envoy\u00e9e!";
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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
*/
prescription_seance();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
/*
if(ententePrealable==1)
{
ententePrealable = "2";
}
*/
montantTm =$("#montantTm").val();
montantArembourser =$("#aRembourser").val();
fraisReel =$("#totalActe").val();
fraisReelBase = $("#fraisReelBase").val();
prixBase = $("#prixBase").val();
depassement = $("#depassement").val();
donnees = 'codeActePrescription='+codeActePrescription +'&quantite='+quantite +'&prixActe='+prixActe;
donnees += '&montantTm='+montantTm +'&montantArembourser='+montantArembourser +'&fraisReel='+fraisReel;
donnees += '&ententePrealable='+ententePrealable+'&fraisReelBase='+fraisReelBase+'&prixBase='+prixBase;
donnees += '&depassement='+depassement+'&dureeTraitement='+dureeTraitement;;
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\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
if(autorisation=="2")
{
preparesms(typeSms2);
v_msg="Demande autorisation envoy\u00e9e!";
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\u00e9e avec succès";
v_msgEng="Saved successfully!";
alert_ebene(v_msg, v_msgEng);
*/
prescription_seance();
}
});
}
else
{
return;
}
});
}
}
function ajaxprixseance()
{
$("#prixActe_info").val("0");
$("#montantTm_info").val("0");
$("#aRembourser_info").val("0");
// $("#quantite_info").val("0");
datePrescription = $("#datePrescription").val();
prescriptionSiCritereBareme = $('#prescriptionSiCritereBareme').val();
codeActe = $("#codeActe").val();
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un act!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
var statut = isStatut(codeActe);
//alert(prescriptionSiCritereBareme);
//return;
if(statut!='1' && prescriptionSiCritereBareme=="0")
{
v_msg="Cet acte n'est pas autorisé!";
v_msgEng="This act is not allowed!";
alert_ebene(v_msg, v_msgEng);
getstatutacte(codeActe);
$('#codeActe').val('');
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\u00e9ances!";
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();
getsourcebareme(codeActe, datePrescription);
dureeTraitement = 0;
donnees = 'codeActe='+codeActe+'&quantite='+quantite+'&dureeTraitement='+dureeTraitement;
$("#infosacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.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();
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\u00e9jà factur\u00e9!";
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\u00e9lectionner 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\u00e9ances!";
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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
// KANE => ajout du 12/04/2025
envoieprescription_seance();
feuillemaladie();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
// KANE => ajout du 12/04/2025
envoieprescription_seance();
feuillemaladie();
}
else
{
return;
}
});
}
}
function valider_seance_cso()
{
debugger;
dureeTraitement = $('#dureeTraitement').val();
nbRestant = $('#nbRestant').val();
if(dureeTraitement=="0"){
v_msg="Veuillez indiquer la durée du traitement!";
v_msgEng="Please indicate the duration of treatment!";
alert_ebene(v_msg, v_msgEng);
$('#dureeTraitement').focus();
return;
}
rapportTraitement = $("#rapportTraitement").val();
if (nbRestant == "0" && rapportTraitement <= " ")
{
v_msg="Veuillez enregistrer le rapport du traitement des séances!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#rapportTraitement").focus();
return;
}
ententePrealableSea=$("#ententePrealableSea").val();
$("#btn_InitSession").show();
$("#div_liste_seance").show();
if (ententePrealableSea>1)
{
v_msg="Entente pr\u00e9alable!";
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\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
numeroBonSeance=$("#numeroBonSeance_C").val();
if (numeroBonSeance<="0")
{
v_msg="Veuillez s\u00e9lectionner 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();
//$("#quantiteSeance").val("1");
v_msg="Veuillez saisir le nombre de s\u00e9ances!";
v_msgEng="Please enter the number of sessions!";
alert_ebene(v_msg, v_msgEng);
return;
}
div_prix = $("#prixActe");
prixActe = parseInt(div_prix.val());
depassementSeance=parseInt($("#depassementSeance").val());
fraisRetenuSeance=parseInt($("#fraisRetenuSeance").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\u00e9ances?";
v_msgEng="Do you confirm these sessions?";
// ajout du 27/06/2019 => prise en compte de la gestion paperless
donnees = 'codeGestionBon='+codeGestionBon;
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.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();
}
});
}
else
{
return;
}
});
}
}
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\u00e9alable!";
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\u00e9lectionner 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\u00e9!";
v_msgEng="Please review the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
fraisRetenuSeance=parseInt($("#fraisRetenuSeance").val());
depassementSeance=parseInt($("#depassementSeance").val());
if (fraisRetenuSeance<=0 && depassementSeance<=0)
{
v_msg="Veuillez revoir le tarif!";
v_msgEng="Please review rate!";
alert_ebene(v_msg, v_msgEng);
return;
}
statut =$("#statut").val();
//$statut == "1" || $statut == "4" || $statut == "5"
if(statut!="1" && statut!="4" && statut!="5")
{
v_msg="Facturation impossible!";
v_msgEng="Billing not possible!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Confirmez-vous la facturation de ces s\u00e9ances?";
v_msgEng="Do you confirm the billing for these sessions?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_sea_cso(user_id_0);
/*
if(modeSaisieFacture=="1")
{
$("#okId" ).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");
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);
}
*/
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_sea_cso(user_id_0);
/*
if(modeSaisieFacture=="1")
{
$("#okId" ).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");
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);
}
*/
}
else
{
return;
}
});
}
}
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);
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data) {
},
complete: function()
{
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation effectu\u00e9e 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\u00e9ro 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\u00e9ro 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\u00e9ro 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 cette opération?";
v_msgEng="Do you confirm this operation?";
}
/*
v_msg="Confirmez-vous ce No de bon?";
v_msgEng="Do you confirm this number of presciption?";
*/
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
}
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);
$("#quantiteSeance").focus();
//ajaxprixseancesea();
},
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\u00e9lectionner un act!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
quantite = $("#quantiteSeance").val();
quantite = parseInt(quantite);
if(quantite==0)
{
$("#quantiteSeance").val(1);
quantite = 1;
/*
div_quantite.focus();
v_msg="Veuillez saisir le nombre de s\u00e9ances!";
v_msgEng="Please enter the number of sessions!";
alert_ebene(v_msg, v_msgEng);
return;
*/
}
nbRestant = $("#nbRestant").val();
nbRestant = parseInt(nbRestant);
if(quantite>nbRestant)
{
// div_quantite.focus();
v_msg="Vous ne pouvez pas d\u00e9passer "+nbRestant+" s\u00e9ances!";
v_msgEng="Only "+nbRestant+" sessions are possible!";
alert_ebene(v_msg, v_msgEng);
// return;
quantite = 0;
}
donnees = 'codeActe='+codeActe+'&quantite='+quantite;
$("#infosacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.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\u00e9alable!";
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\u00e9lectionner un act!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
fraisRetenuSeance=parseInt($("#fraisRetenuSeance").val());
depassementSeance=parseInt($("#depassementSeance").val());
if (fraisRetenuSeance<=0 && depassementSeance<=0)
{
v_msg="Veuillez revoir le tarif!";
v_msgEng="Please review rate!";
alert_ebene(v_msg, v_msgEng);
return;
}
statut =$("#statut").val();
//$statut == "1" || $statut == "4" || $statut == "5"
if(statut!="1" && statut!="4" && statut!="5")
{
v_msg="Facturation impossible!";
v_msgEng="Billing not possible!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Confirmez-vous ces s\u00e9ances?";
v_msgEng="Do you confirm those sessions?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_sea(user_id_0);
/*
if(modeSaisieFacture=="1")
{
$("#okId" ).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");
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);
}
*/
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facturer_sea(user_id_0);
/*
if(modeSaisieFacture=="1")
{
$("#okId" ).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");
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);
}
*/
}
else
{
return;
}
});
}
}
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)
{
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data) {
},
complete: function()
{
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation effectu\u00e9e 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\u00e9ro 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\u00e9ro 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 = $("#numeroBon").val();
v_msg="Confirmez-vous ce dossier?";
v_msgEng="Do you confirm this claim?";
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
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();
}
});
}
else
{
return;
}
});
}
}
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);
$("#btn_InitSession").hide();
$("#div_liste_seance").hide();
$("#quantiteSeance").focus();
},
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\u00e9ro 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();
prixBase = $("#prixBase").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();
//$("#quantiteSeance").val("1");
v_msg="Veuillez saisir le nombre de s\u00e9ances!";
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\u00e9passer "+nbRestant+" s\u00e9ances!";
v_msgEng="Only "+nbRestant+" sessions are possible!";
alert_ebene(v_msg, v_msgEng);
div_quantite.val(0);
return;
}
$("#btn_enreg_seance").disable();
$("#div_facturation_seance").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
donnees = 'prixActe='+prixActe+'&quantite='+quantite+'&prixBase='+prixBase;
$.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\u00e9e!";
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\u00e9e!";
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");
}
else
{
finger_id = $("#finger_id_C" ).val();
if (finger_id==0)
{
v_msg="Veuillez proc\u00e9der à 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\u00e9der à 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");
}
else
{
finger_id = $("#finger_id_C" ).val();
if (finger_id==0)
{
v_msg="Veuillez proc\u00e9der à 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\u00e9der à 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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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\u00e9e!";
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)
{
debugger;
$("#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" || codeTypePrestataire=="DEN" || codeTypePrestataire=="POC" || codeTypePrestataire=="HPC" || codeTypePrestataire=="HPP" || codeTypePrestataire=="CME")
{
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)
{
debugger;
$.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\u00e9lectionner un exercice!";
v_msgEng="Please select an exercise!";
alert_ebene(v_msg, v_msgEng);
$("#codeExercice").focus();
return;
}
if (codeMois<=" ")
{
v_msg="Veuillez s\u00e9lectionner une p\u00e9riode!";
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");
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");
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");
}
else
{
finger_id = $("#finger_id_C" ).val();
if (finger_id==0)
{
v_msg="Veuillez proc\u00e9der à 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\u00e9der à 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\u00e9jà factur\u00e9!";
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\u00e9jà livr\u00e9es 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?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
$("#okId" ).val("1");
facturer_monture(user_id_0);
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
user_id_0 = $("#user_id_C").val();
$("#okId" ).val("1");
facturer_monture(user_id_0);
}
else
{
return;
}
});
}
}
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\u00e9jà factur\u00e9!";
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;
// KANE 17/03/2025 => ne pas envoyer de SMS d'alerte de facturation
// preparesms_adherent(typeSms);
},
error: function(data)
{
},
complete: function() {
// KANE 17/03/2025 => ne pas envoyer de mail d'alerte de facturation
// preparemail_adherent(typeSms);
v_msg="Facturation effectu\u00e9e avec succès!";
v_msgEng="Billing done successfully!";
alert_ebene(v_msg, v_msgEng);
$("#div_monture").html(donnees_retour);
}
});
}
function requetes_prestaire()
{
window.location.assign($("#racineWeb" ).val()+"Requetes/");
}
function ajaxenteterequete()
{
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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\u00e9lectionner 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\u00e9lectionner 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\u00e9decin...");
$("#close_pop").click();
}
function requetes_factures()
{
debugger;
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner une requête!";
v_msgEng="Please select a query!";
alert_ebene(v_msg, v_msgEng);
$("#codeRequete").focus();
return;
}
v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/";
codePrestataire = $("#codePrestataire").val();
codeGarantie = $("#codeGarantie").val();
dateFacture1 = $("#dateFacture1").val();
dateFacture2 = $("#dateFacture2").val();
donnees += '&codePrestataire=' + codePrestataire;
donnees += '&codeGarantie='+codeGarantie;
donnees += '&dateFacture1=' + dateFacture1;
donnees += '&dateFacture2=' + dateFacture2;
$("#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_factures_export()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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/";
codePrestataire = $("#codePrestataire").val();
codeGarantie = $("#codeGarantie").val();
dateFacture1 = $("#dateFacture1").val();
dateFacture2 = $("#dateFacture2").val();
donnees += '&codePrestataire=' + codePrestataire;
donnees += '&codeGarantie='+codeGarantie;
donnees += '&dateFacture1=' + dateFacture1;
donnees += '&dateFacture2=' + dateFacture2;
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 requetes_factures_pdf()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner une requête!";
v_msgEng="Please select a query!";
alert_ebene(v_msg, v_msgEng);
$("#codeRequete").focus();
return;
}
v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"pdf/";
codePrestataire = $("#codePrestataire").val();
codeGarantie = $("#codeGarantie").val();
dateFacture1 = $("#dateFacture1").val();
dateFacture2 = $("#dateFacture2").val();
donnees += '&codePrestataire=' + codePrestataire;
donnees += '&codeGarantie='+codeGarantie;
donnees += '&dateFacture1=' + dateFacture1;
donnees += '&dateFacture2=' + dateFacture2;
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 requetes_factures()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner une requête!";
v_msgEng="Please select a query!";
alert_ebene(v_msg, v_msgEng);
$("#codeRequete").focus();
return;
}
v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/";
codePrestataire = $("#codePrestataire").val();
dateFacture1 = $("#dateFacture1").val();
dateFacture2 = $("#dateFacture2").val();
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&dateFacture1=' + dateFacture1;
donnees += '&dateFacture2=' + dateFacture2;
$("#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_factures_export()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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/";
codePrestataire = $("#codePrestataire").val();
dateFacture1 = $("#dateFacture1").val();
dateFacture2 = $("#dateFacture2").val();
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&dateFacture1=' + dateFacture1;
donnees += '&dateFacture2=' + dateFacture2;
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 requetes_factures_pdf()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner une requête!";
v_msgEng="Please select a query!";
alert_ebene(v_msg, v_msgEng);
$("#codeRequete").focus();
return;
}
v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"pdf/";
codePrestataire = $("#codePrestataire").val();
dateFacture1 = $("#dateFacture1").val();
dateFacture2 = $("#dateFacture2").val();
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&dateFacture1=' + dateFacture1;
donnees += '&dateFacture2=' + dateFacture2;
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 requetes_bonpoec()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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();
codeTypeBon = $("#codeTypeBon").val();
codeEtatBon = $("#codeEtatBon").val();
// Ligne 2
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
numeroBon1 = $("#numeroBon1").val();
numeroBon2 = $("#numeroBon2").val();
// Ligne 4
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// FIN champs
// DEBUT convertir_en_entier
numeroBon1 = convertir_en_entier(numeroBon1);
numeroBon2 = convertir_en_entier(numeroBon2);
// FIN convertir_en_entier
// Ligne 1
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&codeTypeBon=' + codeTypeBon;
donnees += '&codeEtatBon=' + codeEtatBon;
// Ligne 2
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
donnees += '&numeroBon1=' + numeroBon1;
donnees += '&numeroBon2=' + numeroBon2;
// 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_bonpoec_export()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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();
codeTypeBon = $("#codeTypeBon").val();
codeEtatBon = $("#codeEtatBon").val();
// Ligne 2
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
numeroBon1 = $("#numeroBon1").val();
numeroBon2 = $("#numeroBon2").val();
// Ligne 3
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// FIN champs
// DEBUT convertir_en_entier
numeroBon1 = convertir_en_entier(numeroBon1);
numeroBon2 = convertir_en_entier(numeroBon2);
// FIN convertir_en_entier
// Ligne 1
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&codeTypeBon=' + codeTypeBon;
donnees += '&codeEtatBon=' + codeEtatBon;
// Ligne 2
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
donnees += '&numeroBon1=' + numeroBon1;
donnees += '&numeroBon2=' + numeroBon2;
// Ligne 3
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 requetes_prestationactes()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner une requête!";
v_msgEng="Please select a query!";
alert_ebene(v_msg, v_msgEng);
$("#codeRequete").focus();
return;
}
v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/";
codePrestataire = $("#codePrestataire").val();
datePrestation1 = $("#datePrestation1").val();
datePrestation2 = $("#datePrestation2").val();
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&datePrestation1=' + datePrestation1;
donnees += '&datePrestation2=' + datePrestation2;
$("#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_prestationactes_export()
{
$('#div_detail_requete').html('');
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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/";
codePrestataire = $("#codePrestataire").val();
datePrestation1 = $("#datePrestation1").val();
datePrestation2 = $("#datePrestation2").val();
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&datePrestation1=' + datePrestation1;
donnees += '&datePrestation2=' + datePrestation2;
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 requetes_pharmacie()
{
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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();
dateLivraison1 = $("#dateLivraison1").val();
dateLivraison2 = $("#dateLivraison2").val();
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
// Ligne 2
codeMedecin = $("#codeMedecin").val();
numeroBonConsultation1 = $("#numeroBonConsultation1").val();
numeroBonConsultation2 = $("#numeroBonConsultation2").val();
numeroBonOrdonnance1 = $("#numeroBonOrdonnance1").val();
numeroBonOrdonnance2 = $("#numeroBonOrdonnance2").val();
numeroFeuilleMaladie1 = $("#numeroFeuilleMaladie1").val();
numeroFeuilleMaladie2 = $("#numeroFeuilleMaladie2").val();
codePrestatairePrescription = $("#codePrestatairePrescription").val();
// Ligne 3
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// Ligne 4
libelleMedicament = $("#libelleMedicament").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);
numeroFeuilleMaladie1 = convertir_en_entier(numeroFeuilleMaladie1);
numeroFeuilleMaladie2 = convertir_en_entier(numeroFeuilleMaladie2);
// FIN convertir_en_entier
// Ligne 1
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&dateLivraison1=' + dateLivraison1;
donnees += '&dateLivraison2=' + dateLivraison2;
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
// Ligne 2
donnees += '&codeMedecin=' + codeMedecin;
donnees += '&numeroBonConsultation1=' + numeroBonConsultation1;
donnees += '&numeroBonConsultation2=' + numeroBonConsultation2;
donnees += '&numeroBonOrdonnance1=' + numeroBonOrdonnance1;
donnees += '&numeroBonOrdonnance2=' + numeroBonOrdonnance2;
donnees += '&numeroFeuilleMaladie1=' + numeroFeuilleMaladie1;
donnees += '&numeroFeuilleMaladie2=' + numeroFeuilleMaladie2;
donnees += '&codePrestatairePrescription=' + codePrestatairePrescription;
// Ligne 3
donnees += '&adherent=' + adherent;
donnees += '&beneficiaire=' + beneficiaire;
// Ligne 4
donnees += '&libelleMedicament=' + libelleMedicament;
$("#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_pharmacie_export()
{
$('#div_detail_requete').html('');
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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();
dateLivraison1 = $("#dateLivraison1").val();
dateLivraison2 = $("#dateLivraison2").val();
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
// Ligne 2
codeMedecin = $("#codeMedecin").val();
numeroBonConsultation1 = $("#numeroBonConsultation1").val();
numeroBonConsultation2 = $("#numeroBonConsultation2").val();
numeroBonOrdonnance1 = $("#numeroBonOrdonnance1").val();
numeroBonOrdonnance2 = $("#numeroBonOrdonnance2").val();
numeroFeuilleMaladie1 = $("#numeroFeuilleMaladie1").val();
numeroFeuilleMaladie2 = $("#numeroFeuilleMaladie2").val();
codePrestatairePrescription = $("#codePrestatairePrescription").val();
// Ligne 3
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// Ligne 4
libelleMedicament = $("#libelleMedicament").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);
numeroFeuilleMaladie1 = convertir_en_entier(numeroFeuilleMaladie1);
numeroFeuilleMaladie2 = convertir_en_entier(numeroFeuilleMaladie2);
// FIN convertir_en_entier
// Ligne 1
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&dateLivraison1=' + dateLivraison1;
donnees += '&dateLivraison2=' + dateLivraison2;
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
// Ligne 2
donnees += '&codeMedecin=' + codeMedecin;
donnees += '&numeroBonConsultation1=' + numeroBonConsultation1;
donnees += '&numeroBonConsultation2=' + numeroBonConsultation2;
donnees += '&numeroBonOrdonnance1=' + numeroBonOrdonnance1;
donnees += '&numeroBonOrdonnance2=' + numeroBonOrdonnance2;
donnees += '&numeroFeuilleMaladie1=' + numeroFeuilleMaladie1;
donnees += '&numeroFeuilleMaladie2=' + numeroFeuilleMaladie2;
donnees += '&codePrestatairePrescription=' + codePrestatairePrescription;
// Ligne 3
donnees += '&adherent=' + adherent;
donnees += '&beneficiaire=' + beneficiaire;
// Ligne 4
donnees += '&libelleMedicament=' + libelleMedicament;
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 requetes_optique()
{
$('#div_export').html("");
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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();
dateLivraison1 = $("#dateLivraison1").val();
dateLivraison2 = $("#dateLivraison2").val();
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
// Ligne 2
codeMedecin = $("#codeMedecin").val();
numeroBonConsultation1 = $("#numeroBonConsultation1").val();
numeroBonConsultation2 = $("#numeroBonConsultation2").val();
numeroBonOptique1 = $("#numeroBonOptique1").val();
numeroBonOptique2 = $("#numeroBonOptique2").val();
numeroFeuilleMaladie1 = $("#numeroFeuilleMaladie1").val();
numeroFeuilleMaladie2 = $("#numeroFeuilleMaladie2").val();
codePrestatairePrescription = $("#codePrestatairePrescription").val();
// Ligne 3
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// Ligne 4
libelleOptique = $("#libelleOptique").val();
// FIN champs
// DEBUT convertir_en_entier
numeroBonConsultation1 = convertir_en_entier(numeroBonConsultation1);
numeroBonConsultation2 = convertir_en_entier(numeroBonConsultation2);
numeroBonOptique1 = convertir_en_entier(numeroBonOptique1);
numeroBonOptique2 = convertir_en_entier(numeroBonOptique2);
numeroFeuilleMaladie1 = convertir_en_entier(numeroFeuilleMaladie1);
numeroFeuilleMaladie2 = convertir_en_entier(numeroFeuilleMaladie2);
// FIN convertir_en_entier
// Ligne 1
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&dateLivraison1=' + dateLivraison1;
donnees += '&dateLivraison2=' + dateLivraison2;
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
// Ligne 2
donnees += '&codeMedecin=' + codeMedecin;
donnees += '&numeroBonConsultation1=' + numeroBonConsultation1;
donnees += '&numeroBonConsultation2=' + numeroBonConsultation2;
donnees += '&numeroBonOptique1=' + numeroBonOptique1;
donnees += '&numeroBonOptique2=' + numeroBonOptique2;
donnees += '&numeroFeuilleMaladie1=' + numeroFeuilleMaladie1;
donnees += '&numeroFeuilleMaladie2=' + numeroFeuilleMaladie2;
donnees += '&codePrestatairePrescription=' + codePrestatairePrescription;
// Ligne 3
donnees += '&adherent=' + adherent;
donnees += '&beneficiaire=' + beneficiaire;
// Ligne 4
donnees += '&libelleOptique=' + libelleOptique;
$("#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_optique_export()
{
$('#div_detail_requete').html('');
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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();
dateLivraison1 = $("#dateLivraison1").val();
dateLivraison2 = $("#dateLivraison2").val();
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
// Ligne 2
codeMedecin = $("#codeMedecin").val();
numeroBonConsultation1 = $("#numeroBonConsultation1").val();
numeroBonConsultation2 = $("#numeroBonConsultation2").val();
numeroBonOptique1 = $("#numeroBonOptique1").val();
numeroBonOptique2 = $("#numeroBonOptique2").val();
numeroFeuilleMaladie1 = $("#numeroFeuilleMaladie1").val();
numeroFeuilleMaladie2 = $("#numeroFeuilleMaladie2").val();
codePrestatairePrescription = $("#codePrestatairePrescription").val();
// Ligne 3
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// Ligne 4
libelleOptique = $("#libelleOptique").val();
// FIN champs
// DEBUT convertir_en_entier
numeroBonConsultation1 = convertir_en_entier(numeroBonConsultation1);
numeroBonConsultation2 = convertir_en_entier(numeroBonConsultation2);
numeroBonOptique1 = convertir_en_entier(numeroBonOptique1);
numeroBonOptique2 = convertir_en_entier(numeroBonOptique2);
numeroFeuilleMaladie1 = convertir_en_entier(numeroFeuilleMaladie1);
numeroFeuilleMaladie2 = convertir_en_entier(numeroFeuilleMaladie2);
// FIN convertir_en_entier
// Ligne 1
donnees += 'codePrestataire=' + codePrestataire;
donnees += '&dateLivraison1=' + dateLivraison1;
donnees += '&dateLivraison2=' + dateLivraison2;
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
// Ligne 2
donnees += '&codeMedecin=' + codeMedecin;
donnees += '&numeroBonConsultation1=' + numeroBonConsultation1;
donnees += '&numeroBonConsultation2=' + numeroBonConsultation2;
donnees += '&numeroBonOptique1=' + numeroBonOptique1;
donnees += '&numeroBonOptique2=' + numeroBonOptique2;
donnees += '&numeroFeuilleMaladie1=' + numeroFeuilleMaladie1;
donnees += '&numeroFeuilleMaladie2=' + numeroFeuilleMaladie2;
donnees += '&codePrestatairePrescription=' + codePrestatairePrescription;
// Ligne 3
donnees += '&adherent=' + adherent;
donnees += '&beneficiaire=' + beneficiaire;
// Ligne 4
donnees += '&libelleOptique=' + libelleOptique;
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 requetes_assure()
{
$('#div_export').html("");
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// Ligne 2
numeroPolice = $("#numeroPolice").val();
codeProduit = $("#codeProduit").val();
codeEtatPolice = $("#codeEtatPolice").val();
codeLienParente = $("#codeLienParente").val();
codeEtatBeneficiaire = $("#codeEtatBeneficiaire").val();
sexe = $("#sexe").val();
// Ligne 3
numeroClient1 = $("#numeroClient1").val();
numeroClient2 = $("#numeroClient2").val();
telephonePortableAdherent = $("#telephonePortableAdherent").val();
emailAdherent = $("#emailAdherent").val();
decede = $("#decede").val();
nomClient = $("#nomClient").val();
// FIN champs
// DEBUT convertir_en_entier
numeroClient1 = convertir_en_entier(numeroClient1);
numeroClient2 = convertir_en_entier(numeroClient2);
// FIN convertir_en_entier
// Ligne 1
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
donnees += '&adherent=' + adherent;
donnees += '&beneficiaire=' + beneficiaire;
// Ligne 2
donnees += '&numeroPolice=' + numeroPolice;
donnees += '&codeProduit=' + codeProduit;
donnees += '&codeEtatPolice=' + codeEtatPolice;
donnees += '&codeLienParente=' + codeLienParente;
donnees += '&codeEtatBeneficiaire=' + codeEtatBeneficiaire;
donnees += '&sexe=' + sexe;
// Ligne 3
donnees += '&numeroClient1=' + numeroClient1;
donnees += '&numeroClient2=' + numeroClient2;
donnees += '&telephonePortableAdherent=' + telephonePortableAdherent;
donnees += '&emailAdherent=' + emailAdherent;
donnees += '&decede=' + decede;
donnees += '&nomClient=' + nomClient;
$("#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_assure_export()
{
$('#div_detail_requete').html('');
$('#div_export_a').html("");
donnees = "";
donnees_retour = "";
codeRequete=$("#codeRequete").val();
if (codeRequete<=" ")
{
v_msg="Veuillez s\u00e9lectionner 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
numeroAdherent = $("#numeroAdherent").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
adherent = $("#adherent").val();
beneficiaire = $("#beneficiaire").val();
// Ligne 2
numeroPolice = $("#numeroPolice").val();
codeProduit = $("#codeProduit").val();
codeEtatPolice = $("#codeEtatPolice").val();
codeLienParente = $("#codeLienParente").val();
codeEtatBeneficiaire = $("#codeEtatBeneficiaire").val();
sexe = $("#sexe").val();
// Ligne 3
numeroClient1 = $("#numeroClient1").val();
numeroClient2 = $("#numeroClient2").val();
telephonePortableAdherent = $("#telephonePortableAdherent").val();
emailAdherent = $("#emailAdherent").val();
decede = $("#decede").val();
nomClient = $("#nomClient").val();
// FIN champs
// DEBUT convertir_en_entier
numeroClient1 = convertir_en_entier(numeroClient1);
numeroClient2 = convertir_en_entier(numeroClient2);
// FIN convertir_en_entier
// Ligne 1
donnees += '&numeroAdherent=' + numeroAdherent;
donnees += '&numeroBeneficiaire=' + numeroBeneficiaire;
donnees += '&adherent=' + adherent;
donnees += '&beneficiaire=' + beneficiaire;
// Ligne 2
donnees += '&numeroPolice=' + numeroPolice;
donnees += '&codeProduit=' + codeProduit;
donnees += '&codeEtatPolice=' + codeEtatPolice;
donnees += '&codeLienParente=' + codeLienParente;
donnees += '&codeEtatBeneficiaire=' + codeEtatBeneficiaire;
donnees += '&sexe=' + sexe;
// Ligne 3
donnees += '&numeroClient1=' + numeroClient1;
donnees += '&numeroClient2=' + numeroClient2;
donnees += '&telephonePortableAdherent=' + telephonePortableAdherent;
donnees += '&emailAdherent=' + emailAdherent;
donnees += '&decede=' + decede;
donnees += '&nomClient=' + nomClient;
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 convertir_en_entier(valeur)
{
if(isNaN(valeur))
{
valeur = "0";
}
if (valeur=="")
{
valeur="0";
}
valeur = parseInt(valeur);
return valeur;
}
function selectionactesmedicaux()
{
hospitalisation = $("#hospitalisation").val();
gestionActe = $("#gestionActe").val();
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
facture=$("#facture").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
contestation = $("#contestation").val();
if(facture == "0" && contestation == "1"){
v_msg="Dossier médical contesté !";
v_msgEng="Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
if (hospitalisation=="1" && gestionActe=="0")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
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\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Selectactesmedicaux/");
}
function ajaxactespossibles_selection()
{
codeFamilleActe=$("#codeFamilleActe").val();
donnees = 'codeFamilleActe='+codeFamilleActe;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicaux/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#totam_donnees").html(data);
//$("#listeacte").html(data);
appliquerDataTable();
},
complete: function(){
majgestionacte();
}
});
}
/*
function ajaxactespossibles_selection()
{
codeFamilleActe=$("#codeFamilleActe").val();
donnees = 'codeFamilleActe='+codeFamilleActe;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxactespossiblesselection/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#listeacte").html(data);
appliquerDataTable();
},
complete: function() {
}
});
}
*/
function ajaxactespossibles_miseenobservation()
{
codeFamilleActe=$("#codeFamilleActe").val();
donnees = 'codeFamilleActe='+codeFamilleActe;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#totam_donnees").html(data);
//$("#listeacte").html(data);
appliquerDataTable();
},
complete: function() {
}
});
}
function ajouter_un_acte_miseenobservation(codeActe, prixBase, prixActe, ententePrealable)
{
donnee_a_affciher = "";
codeFamilleActe=$("#codeFamilleActe").val();
donnees=""
donnees_sav="";
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
return;
}
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 cet acte?";
v_msgEng="Do you confirm this act?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeFamilleActe='+codeFamilleActe+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixActe='+prixActe+'&prixBase='+prixBase;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/enregistreractemedicalobservation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
//maj_fraisexclu_cso();
donnee_a_affciher = data;
},
complete: function() {
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeFamilleActe='+codeFamilleActe+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixActe='+prixActe+'&prixBase='+prixBase;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/enregistreractemedicalobservation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
//maj_fraisexclu_cso();
donnee_a_affciher = data;
},
complete: function() {
if(ententePrealable=="2")
{
mettremailattente(donnees_sav);
}
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
}
});
}
else
{
return;
}
});
}
}
function ajouter_un_acte_selection_hospitalisation(codeActe, prixBase, prixActe, montantTm, aRembourser, depassement, ententePrealable, plafond)
{
donnee_a_affciher = "";
codeFamilleActe="FA100";
plafondHospitalisation=$("#plafondHospitalisation").val();
plafondHospitalisation = plafondHospitalisation.replace(/ /g,"");
totalHospitalisation = $("#totalHospitalisation").val();
totalHospitalisation = totalHospitalisation.replace(/ /g,"");
modeSaisieFacture = $("#modeSaisieFacture").val();
nbreChambre = $('#nbreChambre').val();
nbreActeEntentePrealable = $('#nbreActeEntentePrealable').val();
if(nbreActeEntentePrealable > "0"){
v_msg="Une demande d'accord pr\u00e9alable a d\u00e9ja \u00e9t\u00e9 envoy\u00e9 \u00e0 l'assureur. Merci de patienter qu'il vous donne sa r\u00e9ponse avant de poursuivre!";
v_msgEng="A request for prior agreement has already been sent to the insurer. Please wait for him to give you his answer before continuing!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
window.setTimeout(attribution_chambre, 25000);
return;
}
donnees=""
donnees_sav="";
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(plafond=="1")
{
v_msg="Le prix de cet acte est le plafond qui sera pris en charge par l'assureur, par cons\u00e9quent, en le s\u00e9lectionnant vous ne pourrez pas modifier sa quantit\u00e9.";
v_msgEng="The price of this act is the ceiling that will be borne by the insurer, therefore, by selecting it you will not be able to change its quantity.";
alert_ebene(v_msg, v_msgEng);
}
v_msg="Confirmez-vous cet acte?";
v_msgEng="Do you confirm this act?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(ententePrealable==1)
{
ententePrealable = "2";
}
donnees = 'codeFamilleActe='+codeFamilleActe+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixActe='+prixActe+'&montantTm='+montantTm+'&aRembourser='+aRembourser+'&prixBase='+prixBase+'&depassement='+depassement;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
typeSms="ententeprealable";
info_fin_delaicarence(codeActe);
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/enregistreractemedical/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
maj_fraisexclu_cso();
if(ententePrealable=="2")
{
if(modeSaisieFacture=="0"){
preparesms(typeSms);
}
v_msg="Demande accord pr\u00e9alable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
donnee_a_affciher = data;
},
complete: function() {
if(ententePrealable=="2")
{
mettremailattente(donnees_sav);
}
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
cach();
var nbreProlongation = parseInt($("#nbreProlongation").val());
if(nbreProlongation > "0"){
for (let pas = 1; pas <= nbreProlongation; pas++) {
cachLigneTab(pas);
}
}
afficherPlafondHospitalisation();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(ententePrealable==1)
{
ententePrealable = "2";
}
donnees = 'codeFamilleActe='+codeFamilleActe+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixActe='+prixActe+'&montantTm='+montantTm+'&aRembourser='+aRembourser+'&prixBase='+prixBase+'&depassement='+depassement;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
typeSms="ententeprealable";
info_fin_delaicarence(codeActe);
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/enregistreractemedical/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
maj_fraisexclu_cso();
if(ententePrealable=="2")
{
if(modeSaisieFacture=="0"){
preparesms(typeSms);
}
v_msg="Demande accord pr\u00e9alable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
donnee_a_affciher = data;
},
complete: function() {
if(ententePrealable=="2")
{
mettremailattente(donnees_sav);
}
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
cach();
var nbreProlongation = parseInt($("#nbreProlongation").val());
if(nbreProlongation > "0"){
for (let pas = 1; pas <= nbreProlongation; pas++) {
cachLigneTab(pas);
}
}
afficherPlafondHospitalisation();
}
});
}
else
{
return;
}
});
}
}
function supprimer_acte_medical_miseenobservation(idDetail)
{
donnee_a_affciher = "";
v_msg="Confirmez-vous la suppression de cet acte?";
v_msgEng="Do you confirm the removal of this act?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idDetail='+idDetail;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
ajaxactespossibles_miseenobservation();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idDetail='+idDetail;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
ajaxactespossibles_miseenobservation();
}
});
}
else
{
return;
}
});
}
}
function ajax_maj_qte_acte_miseenobservation(idDetail, quantite, controle)
{
quantite=quantite.replace(",",".");
controle.value=quantite;
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idDetail='+idDetail+"&quantite="+quantite;
donnee_a_affciher = "";
//donnees = 'idDetail='+idDetail+"&quantite="+quantite;;
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesmedicauxmiseenobservation/majquantite/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
},
error: function(data) {
},
complete: function() {
$("#div_prestations").html(donnee_a_affciher);
controle.focus();
}
});
}
}
function ajax_maj_prix_acte_hospitalisation(idPrestationactes, valeurActe, controle)
{
valeurActe=valeurActe.replace(",",".");
controle.value=valeurActe;
valeurActe=valeurActe.replace(/ /g,"");
valeurActe=parseInt(valeurActe.replace(",","."),10);
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 = 'idPrestationactes='+idPrestationactes+"&valeurActe="+valeurActe;
//donnee_a_affciher = "";
//$("#div_prestations").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/majvaleuracte/",
type: 'POST',
data: donnees,
success: function(data) {
//prestations_hospitalisation();
},
error: function(data) {
},
complete: function() {
ajaxactespossibles_selection_hospitalisation();
//afficherPlafondHospitalisation();
}
});
}
}
function supprimer_acte_medical_selection(idPrestationactes, codeTypePrestation)
{
donnee_a_affciher = "";
v_msg="Confirmez-vous la suppression de cet acte?";
v_msgEng="Do you confirm the removal of this act?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
codeFamilleActe=$("#codeFamilleActe").val();
donnees = 'codeFamilleActe='+codeFamilleActe+'&idPrestationactes='+idPrestationactes+'&codeTypePrestation='+codeTypePrestation;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicaux/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
majgestionacte();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
codeFamilleActe=$("#codeFamilleActe").val();
donnees = 'codeFamilleActe='+codeFamilleActe+'&idPrestationactes='+idPrestationactes+'&codeTypePrestation='+codeTypePrestation;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicaux/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
majgestionacte();
}
});
}
else
{
return;
}
});
}
}
function valider_selection_acte()
{
motifActe = $("#motifActe").val();
nbEntentePrealable = parseInt($("#nbEntentePrealable").val());
if(nbEntentePrealable>0 && motifActe <=" ")
{
v_msg="Le renseignement clinique est obligatoire pour que votre demande soit envoy\u00e9e \u00e0 l'assureur.";
v_msgEng="Clinical information is mandatory for your claim to be sent to the insurer.";
alert_ebene(v_msg, v_msgEng);
$("#motifActe").focus();
return;
}
v_msg="Confirmez-vous cette saisie?";
v_msgEng="Do you confirm this situation?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(nbEntentePrealable>0)
{
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
//return;
}
feuillemaladie();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(nbEntentePrealable>0)
{
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
//return;
}
feuillemaladie();
}
else
{
return;
}
});
}
}
function valider_miseenobservation()
{
motif=$("#motif").val();
modeSaisieFacture =$("#modeSaisieFacture").val();
if (motif<=" ")
{
v_msg="Veuillez saisir le motif!";
v_msgEng="Please enter the motif!";
alert_ebene(v_msg, v_msgEng);
$("#motif").focus();
return;
}
numeroEntentePrealable = $("#numeroEntentePrealable").val();
/*alert(numeroEntentePrealable);
return;*/
if(numeroEntentePrealable == "0"){
ententePrealable = "2";
}else{
ententePrealable = "1";
}
typeSms="ententeprealable";
v_msg="Confirmez-vous cette saisie?";
v_msgEng="Do you confirm this situation?";
donnees = 'motif='+motif;
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/validermiseenobservation/",
type: 'POST',
data: donnees,
success: function(data) {
if(ententePrealable=="2")
{
if(modeSaisieFacture=="0"){
preparesms(typeSms);
}
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/validermiseenobservation/",
type: 'POST',
data: donnees,
success: function(data) {
if(ententePrealable=="2")
{
if(modeSaisieFacture=="0"){
preparesms(typeSms);
}
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
},
error: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
function ajax_maj_qte_acte(idPrestationactes, quantite, controle)
{
quantite=quantite.replace(",",".");
controle.value=quantite;
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite;
donnee_a_affciher = "";
donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite;;
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesmedicauxselect/majquantite/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
},
error: function(data) {
},
complete: function() {
$("#div_prestations").html(donnee_a_affciher);
controle.focus();
}
});
}
}
function supprimer_acte_medical_hospitalisation(idPrestationactes, codeTypePrestation)
{
donnees = 'idPrestationactes='+idPrestationactes+'&codeTypePrestation='+codeTypePrestation;
codeLangue = $("#codeLangue").val();
v_msg="Confirmez-vous cette suppression?";
v_msgEng="Do you confirm this deletion?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#div_prestations").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
ajaxactespossibles_selection_hospitalisation();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#div_prestations").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
ajaxactespossibles_selection_hospitalisation();
}
});
}
else
{
return;
}
});
}
}
function ajax_maj_qte_acte_hospitalisation(idPrestationactes, quantite, controle)
{
quantite=quantite.replace(",",".");
controle.value=quantite;
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite;
//donnee_a_affciher = "";
donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite;
//$("#div_prestations").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/majquantite/",
type: 'POST',
data: donnees,
success: function(data) {
//prestations_hospitalisation();
},
error: function(data) {
},
complete: function() {
ajaxactespossibles_selection_hospitalisation();
//afficherPlafondHospitalisation();
}
});
}
}
function prestations_hospitalisation(){
$.ajax({
url: $("#racineWeb").val()+"Ajaxprestationshospitalisation/",
type: 'POST',
success: function(data) {
$("#totam_donnees").html(data);
appliquerDataTable();
cach();
var nbreProlongation = parseInt($("#nbreProlongation").val());
if(nbreProlongation > "0"){
for (let pas = 1; pas <= nbreProlongation; pas++) {
cachLigneTab(pas);
}
}
},
error: function(data) {
},
complete: function() {
afficherPlafondHospitalisation();
}
});
}
function selectionner_acte_possibles_select(codeFamilleActe, codeActe, familleActe, libelleActe)
{
if(libelleActe<=" ")
return;
$("#codeFamilleActe").val(codeFamilleActe);
$("#libelleActe").val(libelleActe);
ajaxactespossibles_selection();
$("#close_pop_acte").click();
}
function afficher_pop_recherche_actes_possibles_select()
{
libelleActeSearch = $("#libelleActeSearch").val();
if(libelleActeSearch<=" ")
{
return;
}
donnees = "valid=1&libelleActeSearch="+libelleActeSearch;
$("#div_liste_actes_possibles").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteactespossiblesselect/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_liste_actes_possibles").html(data);
}
});
}
function ctrlkeypress_actes_possibles_select(ev)
{
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
if(keycode == '13')
{
afficher_pop_recherche_actes_possibles_select();
}
}
function selectionexamens()
{
actVisible=$("#actVisible").val();
// if (actVisible!="1" && modeSaisieFacture!="1")
if (actVisible!="1")
{
v_msg="Non autoris\u00e9e!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Selectexaemens/");
}
function ajaxexamenpossibles_selection()
{
codeFamilleActe=$("#codeFamilleActe").val();
donnees = 'codeFamilleActe='+codeFamilleActe;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxexamenspossiblesselection/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#listeacte").html(data);
appliquerDataTable();
},
complete: function() {
}
});
}
function ajouter_un_examen_selection(codeActe, prixActe, montantTm, aRembourser, ententePrealable)
{
donnee_a_affciher = "";
codeFamilleActe=$("#codeFamilleActe").val();
donnees=""
donnees_sav="";
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(prixActe==0)
{
v_msg="Veuillez revoir le tarif!";
v_msgEng="Please review rate!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(ententePrealable==1)
{
ententePrealable = "2";
}
donnees = 'codeFamilleActe='+codeFamilleActe+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixActe='+prixActe+'&montantTm='+montantTm+'&aRembourser='+aRembourser;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
typeSms="ententeprealable";
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectexamens/ajouterexamenprescription/",
type : 'post',
data: donnees,
error: function(errorData)
{
},
success: function(data) {
// $('#div_test_gabarit').html(data);
if(ententePrealable=="2")
{
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
donnee_a_affciher = data;
},
complete: function()
{
if(ententePrealable=="2")
{
mettremailattente(donnees_sav);
}
$("#totam_donnees").html(donnee_a_affciher);
}
});
}
function retirerexamen_lab_selection(idExamen)
{
donnee_a_affciher = "";
codeFamilleActe=$("#codeFamilleActe").val();
donnees = 'codeFamilleActe='+codeFamilleActe+'&idExamen='+idExamen;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectexamens/retirerexamen/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
alerter_depassement_limite();
},
error: function(data) {
},
complete: function() {
$("#totam_donnees").html(donnee_a_affciher);
}
});
}
function valider_selection_examen()
{
v_msg="Confirmez-vous cette saisie?";
v_msgEng="Do you confirm this situation?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
afficher_laboratoire_cso();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
afficher_laboratoire_cso();
}
else
{
return;
}
});
}
}
function selectionexamens_lab()
{
window.location.assign($("#racineWeb" ).val()+"Selectexaemenslab/");
}
function valider_selection_examen_lab()
{
v_msg="Confirmez-vous cette saisie?";
v_msgEng="Do you confirm this situation?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
actualiser_laboratoire();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
actualiser_laboratoire();
}
else
{
return;
}
});
}
}
function afficher_examensmedicaux()
{
window.location.assign($("#racineWeb" ).val()+"Examensmedicaux/");
}
function selectionexamens_cso()
{
window.location.assign($("#racineWeb" ).val()+"Selectexaemenscso/");
}
function valider_selection_examen_cso()
{
v_msg="Confirmez-vous cette saisie?";
v_msgEng="Do you confirm this situation?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
afficher_examensmedicaux();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
afficher_examensmedicaux();
}
else
{
return;
}
});
}
}
function no_presciption()
{
facture=$("#facture").val();
contestation = $("#contestation").val();
if (facture==1)
{
v_msg="D\u00e9jà factur\u00e9!";
v_msgEng="Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(contestation == "1"){
const v_msg = "Dossier médical contesté !";
const v_msgEng = "Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
numOrd = $("#numOrd").val();
noPrescription = $("#noPrescription").val();
if (numOrd==0 && noPrescription==0)
{
v_msg="Confirmez-vous qu\'il n\'y a pas de prescription de m\u00e9dicaments?";
v_msgEng="Do you confirm that there is no drugs prescription?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescription/noprescription/",
type : 'post',
// data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescription/noprescription/",
type : 'post',
// data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
// feuillemaladie();
}
function prescrire_verre_opt()
{
// Ajout à la prescription
/*
nbActesVerres = $("#nbActesVerres").val();
if (nbActesVerres>0)
{
v_msg="Veuillez s\u00e9lectionner un verre!";
v_msgEng="Please select a glass!";
alert_ebene(v_msg, v_msgEng);
$("#codeOptique").focus();
return;
}
*/
codePrestatairePrescription = $("#codePrestatairePrescription").val();
codeActeOptique = $("#codeActeOptique").val();
if (codeActeOptique<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActeOptique").focus();
return;
}
donnees = 'codeActeOptique='+codeActeOptique;
donnees += '&codePrestatairePrescription=' + codePrestatairePrescription;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/ajouterverreprescription/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#btn_close_pop_verre").click();
// $("#livraison").html(data);
},
complete: function() {
// alerter_depassement_limite();
actualiser_opticien();
}
});
//}
// Fin Ajout à la prescription
}
function validerdecompte_prestataire()
{
/*
0 D\u00e9compte en cours
2 Attente Valid. prestat. / Waiting for provider s valid.
3 Valid\u00e9 par le prestataire
8 Pas besoin de valid prestat / Provid valid not needed
9 En attente de règelment
1 R\u00e9gl\u00e9 / Pay\u00e9
*/
regle=$("#regle").val();
regle = parseInt(regle);
if (regle==1)
{
v_msg="D\u00e9jà pay\u00e9!";
v_msgEng="Already paid!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (regle==0)
{
v_msg="Veuillez attendre la 1ère validation de l\'assureur!";
v_msgEng="Please wait for the first validation of the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (regle==3)
{
v_msg="D\u00e9jà valid\u00e9!";
v_msgEng="Already validated!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (regle==8)
{
v_msg="Pas besoin de validation prestataire!";
v_msgEng="Provider validation not needed!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (regle==9)
{
v_msg="En attente de paiement!";
v_msgEng="Waiting for payment!";
alert_ebene(v_msg, v_msgEng);
return;
}
if ($("#montantApayer").val()<="0")
{
v_msg="Rien à valider!";
v_msgEng="Nothing to validate!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (regle==2)
{
v_msg="Confirmez-vous la validation?";
v_msgEng="Do you confirm the validation?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdecompte/validerdecompteprestataire",
type : 'post',
error: function(errorData) {
},
success: function(data) {
// $("#div_detail").html("");
v_msg="D\u00e9compte valid\u00e9 avec succès!";
v_msgEng="validated successfully!";
alert_ebene(v_msg, v_msgEng);
},
complete: function() {
// actualiser_decompte();
afficher_decompte();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdecompte/validerdecompteprestataire",
type : 'post',
error: function(errorData) {
},
success: function(data) {
// $("#div_detail").html("");
v_msg="D\u00e9compte valid\u00e9 avec succès!";
v_msgEng="validated successfully!";
alert_ebene(v_msg, v_msgEng);
},
complete: function() {
// actualiser_decompte();
afficher_decompte();
}
});
}
else
{
return;
}
});
}
}
}
function retourdecompte()
{
idSaisieDecompte = $("#idSaisieDecompte").val();
lienPrestation_C = $("#lienPrestation_C").val();
lienProduction_C = $("#lienProduction_C").val();
v_url = lienProduction_C+"/Connexiondecompte/"+idSaisieDecompte;
if (idSaisieDecompte>"")
{
window.location.assign(v_url);
}
}
function enregistrer_nv_medicament()
{
libelleMedicament = $("#libelleMedicament").val();
if (libelleMedicament<=" ")
{
v_msg="Veuillez saisir le nom!";
v_msgEng="Please enter the name!";
alert_ebene(v_msg, v_msgEng);
$("#libelleMedicament").focus();
return;
}
prixMedicament=$("#prixMedicament").val();
prixMedicament=prixMedicament.replace(",",".");
$("#prixMedicament").val(prixMedicament);
if(isNaN(prixMedicament))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#prixMedicament").val("0");
$("#prixMedicament").focus();
return;
}
if(prixMedicament==0)
{
$("#prixMedicament").focus();
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}
qteMedicament=$("#qteMedicament").val();
qteMedicament=qteMedicament.replace(",",".");
$("#qteMedicament").val(qteMedicament);
if(isNaN(qteMedicament))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#qteMedicament").val("0");
$("#qteMedicament").focus();
return;
}
if(qteMedicament==0)
{
$("#qteMedicament").focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'libelleMedicament='+libelleMedicament+'&prixMedicament='+prixMedicament+'&qteMedicament='+qteMedicament;
typeSms="ententeprealablepha";
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistemedicamentspha/creermedicament/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
// alert("error => "+data);
// $("#div_new_medicament_test").html(data);
$("#btn_close_pop_new_med").click();
$("#btn_close_pop_medicament").click();
},
error: function(data) {
alert("error => "+data);
$("#div_new_medicament_test").html(data);
},
complete: function() {
actualiser_saisie_pharmacien();
}
});
}
function demander_accord_pha(idMedicament)
{
donnees = 'idMedicament='+idMedicament;
typeSms="ententeprealablepha";
donnees_sav = 'idMedicament='+idMedicament+'&typeMail=mailententeprealablepha';
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/demanderaccordpha/",
type: 'POST',
data: donnees,
success: function(data) {
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
// raffraichir affichage
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
mettremailattente(donnees_sav);
}
});
}
function controle_longeur_passe(controle)
{
longueur = controle.value.length;
if(longueur==0)
{
return false;
}
if(longueur<6)
{
v_msg="6 caractères minimum exig\u00e9!";
v_msgEng="6 characters minmum required!";
alert_ebene(v_msg, v_msgEng);
controle.value="";
controle.focus();
return false;
}
}
function facture_sans_bon()
{
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
if (numeroBeneficiaire<="0")
{
v_msg="Veuillez s\u00e9lectionner un b\u00e9n\u00e9ficiaire!";
v_msgEng="Please select an insured person!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb").val()+"Facturesansboncso/");
}
function nouvelle_sans_bon()
{
window.location.assign($("#racineWeb").val()+"Facturesansboncso/");
}
// js_facture_san_sbon
function enregistrerfacture_sans_bon_temp(v_initialiser)
{
dateFacture=$("#dateFacture").val();
debutMoisDecompte = $("#debutMoisDecompte").val();
codeMedecin = $("#codeMedecin").val();
medecinManquant = $("#medecinManquant").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#nomMedecin").focus();
return;
}
if (codeMedecin=="ZZZZ" && medecinManquant<=" ")
{
v_msg="Veuillez saisir le nom du m\u00e9decin non enregistr\u00e9!";
v_msgEng="Please enter the name of the non-registered doctor!";
alert_ebene(v_msg, v_msgEng);
$("#medecinManquant").focus();
return;
}
numeroBon = $("#numeroBon").val();
if (numeroBon<=" ")
{
v_msg="Veuillez saisir le No de Bons!";
v_msgEng="Please enter the first number of form!";
alert_ebene(v_msg, v_msgEng);
$("#numeroBon").focus();
return;
}
if (dateFacture<=" ")
{
v_msg="Veuillez saisir la date de la facture!";
v_msgEng="Please enter the date of the invoice!";
alert_ebene(v_msg, v_msgEng);
$("#dateFacture").focus();
return;
}
/*
medecinManquant = $("#medecinManquant").val();
if (medecinManquant<=" ")
{
v_msg="Veuillez saisir le M\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#medecinManquant").focus();
return;
}
*/
// v\u00e9rifier que le gars est couvert
// modifi\u00e9 le 09/07/2019
$("#dateFactureReelle").val(dateFacture);
if (prestation_possible_assureur())
{
observations = $("#observations").val();
hospitalisation = $("#hospitalisation").val();
tm = $("#tmFacture").val();
donnees = 'observations='+observations+'&dateFacture='+dateFacture+'&hospitalisation='+hospitalisation+'&tm='+tm+'&numeroBon='+numeroBon+'&medecinManquant='+medecinManquant+'&codeMedecin='+codeMedecin;
donnees += '&initialiserprestation='+v_initialiser;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailfacturesansboncso/enregistrerfacturetemp/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_facture").html(data);
$(".datepicker" ).datepicker();
},
complete: function() {
alerter_depassement_limite_sans_bon();
}
});
}
}
function enregistrerfacture_sans_bon()
{
enregistrerfacture_sans_bon_temp("0");
medecinManquant = $("#medecinManquant").val();
if (medecinManquant<=" ")
{
v_msg="Veuillez saisir le M\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#medecinManquant").focus();
return;
}
dateFacture=$("#dateFacture").val();
if (dateFacture<=" ")
{
v_msg="Veuillez saisir la date de la facture!";
v_msgEng="Please enter the date of the invoice";
alert_ebene(v_msg, v_msgEng);
$("#dateFacture").focus();
return;
}
prixActe = $("#prixActe").val();
if (prixActe==0)
{
v_msg="Rien à enregistrer!";
v_msgEng="Nothing to save!";
alert_ebene(v_msg, v_msgEng);
return;
}
// v\u00e9rifier que le gars est couvert
// modifi\u00e9 le 09/07/2019
$("#dateFactureReelle").val(dateFacture);
if (prestation_possible_assureur())
{
v_msg="Confirmez-vous cette facture?";
v_msgEng="Do you confirm this invoice?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailfacturesansboncso/validerfacturesansbon/",
error: function(errorData) {
},
success: function(data) {
// maj_fraisexclu_cso();
$(".datepicker" ).datepicker();
},
complete: function() {
v_msg="Validation effectu\u00e9e avec succès!";
v_msgEng="Validation done successfully!";
alert_ebene(v_msg, v_msgEng);
afficher_beneficiaire_id();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailfacturesansboncso/validerfacturesansbon/",
error: function(errorData) {
},
success: function(data) {
// maj_fraisexclu_cso();
$(".datepicker" ).datepicker();
},
complete: function() {
v_msg="Validation effectu\u00e9e avec succès!";
v_msgEng="Validation done successfully!";
alert_ebene(v_msg, v_msgEng);
afficher_beneficiaire_id();
}
});
}
else
{
return;
}
});
}
}
}
function ajax_maj_tm_facture(tm, controle)
{
donnees = 'tm='+tm;
tm=tm.replace(",",".");
controle.value=tm;
if(controle_numerique(controle))
{
// enregistrerfacture_sans_bon_temp();
enregistrerfacture_sans_bon_temp("0");
}
}
function ajax_maj_prix_acte(idPrestation, valeurActe, controle)
{
donnees = 'idPrestation='+idPrestation+"&valeurActe="+valeurActe;
valeurActe=valeurActe.replace(",",".");
controle.value=valeurActe;
if(controle_numerique(controle))
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailfacturesansboncso/majprix/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture").html(data);
$(".datepicker" ).datepicker();
},
error: function(data) {
},
complete: function(data) {
alerter_depassement_limite_sans_bon();
}
});
}
}
function valider_facture_sans_bon_temp()
{
enregistrerfacture_sans_bon_temp("1");
}
function alerter_depassement_limite_sans_bon()
{
fraisExclu=$("#fraisExclu").val();
fraisExclu = parseInt(fraisExclu);
if (fraisExclu>0)
{
v_msg="Attention ! D\u00e9passement de limite";
v_msgEng="Warning ! Overflow";
alert_ebene(v_msg, v_msgEng);
return;
}
}
function consulter_limite_avant_facturation_classique()
{
/*
idFacture=$("#idFacture_C").val();
if (idFacture==0)
{
v_msg="Pas encore factur\u00e9e!";
v_msgEng="Not yet charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureclassique/");
*/
}
function pop_messagerie()
{
// alert('Hello');
nbMessagesNonLus = $("#timer").val();
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerieliste/",
error: function(errorData) {
},
success: function(data) {
$("#div_messagerie").html(data);
},
complete: function() {
$("#btn_pop_messagerie").click();
}
});
}
function marquer_message_comme_lu(idMessagerie, controle)
{
donnees = 'idMessagerie='+idMessagerie;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerieliste/marquercommelu/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
controle.parentElement.removeChild(controle);
}
});
}
function envoyer_messagerie(textMessage, idParent)
{
donnees = 'textMessage='+textMessage+"&idParent="+idParent;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerie/creermessage/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
}
});
}
function repondre_message(idMessagerie, idParent, controle)
{
donnees = 'idMessagerie='+idMessagerie+'&idParent='+idParent;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessageriereponse/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_messagerie_reponse").html(data);
},
complete: function() {
repondu = $("#repondu").val();
if(repondu=="1")
{
v_msg="D\u00e9jà r\u00e9pondu!";
v_msgEng="Already answered!";
alert_ebene(v_msg, v_msgEng);
controle.parentElement.removeChild(controle);
return;
}
else
{$("#btn_pop_messagerie_reponse").click();
}
}
});
}
function gerer_messagerie()
{
window.location.assign($("#racineWeb").val()+"Messagerie/");
}
function afficher_lite_messagerie()
{
donnees = "";
donnees_retour = "";
date1 = $("#date1").val();
date2 = $("#date2").val();
messageLu = $("#messageLu").val();
textMessage = $("#textMessage").val();
donnees += 'date1=' + date1;
donnees += '&date2=' + date2;
donnees += '&messageLu=' + messageLu;
donnees += '&textMessage=' + textMessage;
$("#div_messagerie_gestion").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistemessagerie/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_messagerie_gestion").html(donnees_retour);
$("#nbligne").val("Lignes : "+$("#nbligne_info").val());
}
});
}
function enregistrer_repondre_message()
{
idMessagerie = $("#idMessagerie").val();
idParent = $("#idParentReponse").val();
textMessage = $("#textMessageReponse").val();
textMessage = textMessage.trim();
if (textMessage<=" ")
{
v_msg="Veuillez saisir la r\u00e9ponse!";
v_msgEng="Please enter the answer!";
alert_ebene(v_msg, v_msgEng);
$("#textMessageReponse").focus();
return;
}
donnees = 'idMessagerie='+idMessagerie+"&idParent="+idParent+"&textMessage="+textMessage;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerie/repondremessage/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
$("#btn_pop_messagerie_reponse_quit").click();
}
});
}
function historique_message(idParent)
{
donnees = 'idParent='+idParent;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessageriehistorique/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_messagerie_historique").html(data);
},
complete: function() {
$("#btn_pop_messagerie_historique").click();
}
});
}
function initiermessage()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerienew/",
error: function(errorData) {
},
success: function(data) {
$("#div_messagerie_new").html(data);
},
complete: function() {
$("#btn_pop_messagerie_new").click();
}
});
}
function enregistrer_new_message()
{
textMessage = $("#textMessageNew").val();
textMessage = textMessage.trim();
if (textMessage<=" ")
{
v_msg="Veuillez saisir le message!";
v_msgEng="Please enter the message!";
alert_ebene(v_msg, v_msgEng);
$("#textMessageNew").focus();
return;
}
donnees = 'textMessage='+textMessage+"&idParent=0";
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerie/creermessage/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
$("#btn_pop_messagerie_new_quit").click();
}
});
}
function consultation_assureur()
{
dateFactureReelle = $("#dateFactureReelle").val();
if (dateFactureReelle<=" ")
{
v_msg="Veuillez saisir la date de la consultation!";
v_msgEng="Please enter the date of the consultation!";
alert_ebene(v_msg, v_msgEng);
$("#dateFactureReelle").focus();
return;
}
if (prestation_possible_assureur())
{
$("#okId" ).val("1");
ajax_context_datefacture_reelle(dateFactureReelle);
}
}
function prestation_possible_assureur()
{
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();
dateSortieBeneficiaire = $("#dateSortieBeneficiaire_C").val();
var tdd = new Date(dateSortieBeneficiaire);
dtd = Math.round(Date.parse(tdd)/(1000*3600*24));
dateFactureReelle = $("#dateFactureReelle").val();
dateEffetPolice = $("#dateEffetPolice_C").val();
dateEcheancePolice = $("#dateEcheancePolice_C").val();
dateEntreeBeneficiaire = $("#dateEntreeBeneficiaire_C").val();
libelledebutMoisDecompte = $("#debutMoisDecompte").val();
debutMoisDecompte = $("#debutMoisDecompte").datepicker("getDate");
var tddebut = new Date(debutMoisDecompte);
dddebut = Math.round(Date.parse(tddebut)/(1000*3600*24));
CalculerFinMoisDecompte();
libellefinMoisDecompte = $("#finMoisDecompte").val();
finMoisDecompte = $("#finMoisDecompte").datepicker("getDate");
var tfin = new Date(finMoisDecompte);
ddfin = Math.round(Date.parse(tfin)/(1000*3600*24));
var td0 = new Date(dateEntreeBeneficiaire);
var td1 = $("#dateFactureReelle").datepicker("getDate");
var td2 = new Date(dateEcheancePolice);
var tdj = new Date(datejour);
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));
dtj=Math.round(Date.parse(tdj)/(1000*3600*24));
if ( (dt1ddfin) )
{
v_msg="Attention! date hors du mois! => "+libelledebutMoisDecompte+" - "+libellefinMoisDecompte;
v_msgEng="Warning! date out of the month!";
alert_ebene(v_msg, v_msgEng);
return false;
//dt1 = dddebut;
}
if(dateSortieBeneficiaire>"2000-01-01")
{
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;
}
}
else
{
// A d\u00e9sactiv\u00e9 peut-être pour RADIANT
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")
{
v_msg="Attention! "+etatbeneficiaire;
v_msgEng="Warning! "+etatbeneficiaire;
alert_ebene(v_msg, v_msgEng);
return false;
}
// Fin d\u00e9sactivation peut-être pour RADIANT
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;
}
if (dt1>dtj)
{
v_msg="Attention! Revoir la date!";
v_msgEng="Warning! Review the date!";
alert_ebene(v_msg, v_msgEng);
return false;
}
if (dt1>dt2 || dt1"2000-01-01")
{
v_msg="Attention! personne d\u00e9c\u00e9d\u00e9e!";
v_msgEng="Warning! Deceased!";
alert_ebene(v_msg, v_msgEng);
return false;
}
}
return true;
}
function ajax_context_datefacture_reelle(dateFactureReelle)
{
donnees = 'dateFactureReelle='+dateFactureReelle;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdatefacturerelle/",
type : 'post',
data: donnees,
error: function(errorData) {
},
complete: function() {
aller_a_la_consultatio();
}
});
}
function aller_a_la_consultatio()
{
window.location.assign($("#racineWeb" ).val()+"Consultation/");
}
function ajax_maj_qte_examen_lab(idExamen, quantite, controle)
{
quantite=quantite.replace(",",".");
controle.value=quantite;
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idExamen='+idExamen+"&quantite="+quantite;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/majquantiteexam/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
//alerter_depassement_limite();
controle.focus();
}
});
}
}
function ajax_maj_qte_examen_lab_select(idExamen, quantite, controle)
{
donnee_a_affciher = "";
quantite=quantite.replace(",",".");
controle.value=quantite;
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idExamen='+idExamen+"&quantite="+quantite;
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectexamens/majquantiteexam/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#livraison").html(data);
donnee_a_affciher = data;
alerter_depassement_limite();
},
error: function(data) {
},
complete: function() {
$("#totam_donnees").html(donnee_a_affciher);
controle.focus();
}
});
}
}
function ajax_maj_qte_examen_cso(idExamen, quantite, controle)
{
donnee_a_affciher = "";
quantite=quantite.replace(",",".");
controle.value=quantite;
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idExamen='+idExamen+"&quantite="+quantite;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailexamen/majquantiteexam/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
controle.focus();
},
error: function(data) {
},
complete: function() {
}
});
}
}
function actualiser_saisie_pharmacien()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/",
// type : 'post',
// data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#livraison").html(data);
raffraichier_detail_prescription();
},
complete: function() {
alerter_depassement_limite();
}
});
}
function lister_ged()
{
d1 = $("#d1").val();
d2 = $("#d2").val();
nomOrigine = $("#nomOrigine").val();
donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine;
$("#div_ged").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteged/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_ged").html(data);
},
complete: function() {
}
});
}
function ctrlkeypress_lister_ged(ev)
{
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
if(keycode == '13')
{
lister_ged();;
}
}
function check_ged(idGed, cheminFichier, controle)
{
donnees = "idGed="+idGed+"&cheminFichier="+cheminFichier;
// var cible_ged = $('#cible_ged');
var ctrl_btn_ged = $("#btn_ged"+idGed);
var ctrl_mess_not_found= $("#mess_not_found"+idGed);
var ctrl_check = $("#ctrl_check"+idGed);
// document.getElementById('bouton_'+id).innerHTML='Afficher le texte';
$.ajax({
url: $("#racineWeb").val()+"Ajaxged/verifierexistancefichier/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
if(donnees_retour=="1")
{
ctrl_btn_ged.show();
}
else
{
ctrl_mess_not_found.html("Not found");
}
},
complete: function()
{
controle.style.display = 'none';
ctrl_check.show();
}
});
}
function lister_ged_adherent()
{
d1 = $("#d1").val();
d2 = $("#d2").val();
nomOrigine = $("#nomOrigine").val();
donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine;
$("#div_ged").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistegedadherent/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_ged").html(data);
},
complete: function() {
}
});
}
function lister_ged_beneficiaire_prest()
{
d1 = $("#d1").val();
d2 = $("#d2").val();
nomOrigine = $("#nomOrigine").val();
donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine;
$("#div_ged").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistegedbeneficiaireprest/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_ged").html(data);
},
complete: function() {
}
});
}
function lister_ged_feuille_maladie()
{
d1 = $("#d1").val();
d2 = $("#d2").val();
nomOrigine = $("#nomOrigine").val();
donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine;
$("#div_ged").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistegedfeuillemaladie/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_ged").html(data);
},
complete: function() {
}
});
}
function pop_ged_pharmacie()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistegedpharmacie/",
error: function(errorData) {
},
success: function(data)
{
$("#div_ged").html(data);
},
complete: function() {
$("#btn_pop_ged_pharmacie").click();
}
});
}
function save_enroleur(user_id)
{
if (user_id>"")
{
donnees = 'user_id='+user_id;
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontextbeneficiaire/saveenroleur/",
type : 'post',
data: donnees,
error: function(errorData) {
},
complete: function() {
}
});
}
}
/* ACTIVATION POPUP
function imprimer_liste_assures()
{
$('#div_export_assures').html('');
$("#btn_liste_assures").click();
popalertmessagerie
}
*/
function pop_dernier_messagerie()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerieliste/derniermessage/",
error: function(errorData) {
},
success: function(data) {
$("#div_dernier_messagerie").html(data);
},
complete: function() {
$("#btn_pop_dernier_messagerie").click();
}
});
}
function marquer_dernier_message_comme_lu(idMessagerie, controle)
{
donnees = 'idMessagerie='+idMessagerie;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerieliste/marquercommelu/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
// controle.parentElement.removeChild(controle);
$("#btn_close_pop_dernier_messagerie").click();
}
});
}
function isNumeric(num){
return !isNaN(num)
}
function retirer_consommable(idConsommable)
{
donnees = 'idConsommable='+idConsommable;
v_msg="Confirmez-vous cette suppression?";
v_msgEng="Do you Confirm this deletion?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteconsommables/retirerconsommable/",
type: 'POST',
data: donnees,
success: function(data) {
// $('#div_test_gabarit').html(data);
},
error: function(data) {
},
complete: function() {
afficher_consommable();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteconsommables/retirerconsommable/",
type: 'POST',
data: donnees,
success: function(data) {
// $('#div_test_gabarit').html(data);
},
error: function(data) {
},
complete: function() {
afficher_consommable();
}
});
}
else
{
return;
}
});
}
}
function retirer_consommable_tous()
{
v_msg="Confirmez-vous cette suppression?";
v_msgEng="Do you Confirm this deletion?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteconsommables/retirerconsommabletous/",
type: 'POST',
success: function(data) {
// $('#div_test_gabarit').html(data);
},
error: function(data) {
},
complete: function() {
afficher_consommable();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteconsommables/retirerconsommabletous/",
type: 'POST',
success: function(data) {
// $('#div_test_gabarit').html(data);
},
error: function(data) {
},
complete: function() {
afficher_consommable();
}
});
}
else
{
return;
}
});
}
}
function valider_consommables()
{
facturerConsommable=$("#facturerConsommable").val();
if (facturerConsommable!="1")
{
v_msg="Consommables non factur\u00e9s!";
v_msgEng="Consumables not invoiced!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Confirmez-vous cette saisie?";
v_msgEng="Do you confirm this situation?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
feuillemaladie();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
feuillemaladie();
}
else
{
return;
}
});
}
}
function imprimerdecompteprestataireaccord()
{
regle=$("#regle").val();
if( (regle!=1) && (regle!=9) )
{
v_msg="Pas encore valid\u00e9 par l\'asssureur";
v_msgEng="Not yet validates by insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
idReglement = $("#idReglement").val();
if (idReglement>"0")
{
var div_wait = $('#div_wait');
div_wait.html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerdemandereglement/imprimerdecompteprestataireaccord",
type: 'POST',
success: function(data)
{
div_wait.html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
}
});
}
}
function consulter_une_factures()
{
window.location.assign($("#racineWeb" ).val()+"Factureconsprestataire/");
}
function ctrlkeypressfacture(ev)
{
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
if(keycode == '13')
{
$("#idFacture").blur();
}
}
function chercher_facture(idFacture)
{
$("#div_facture_detail").html('');
$("#div_consulter_facture").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconsprestataire/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_consulter_facture").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulterfacturefeuillemaladie()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconsprestataire/feuillemaladie/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulterfactureprestationactes()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconsprestataire/prestationactes/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulterfacturemedicaments()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconsprestataire/medicaments/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulter_facture_pop(idFacture)
{
$("#div_facture_detail").html('');
$("#div_consulter_facture_pop").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconspop/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_consulter_facture_pop").html(data);
},
error: function(data) {
},
complete: function() {
$('#btn_pop_consulter_facture').click();
}
});
}
function consulterfacturefeuillemaladie_pop()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconspop/feuillemaladie/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulterfactureprestationactes_pop()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconspop/prestationactes/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulterfacturemedicaments_pop()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconspop/medicaments/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulterfactureverres_pop()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconspop/verres/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function consulterfactureged_pop()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconspop/geds/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function reafficher_ged_facture(idFacture)
{
if (idFacture>"0")
{
donnees = 'idFacture='+idFacture;
$.ajax({
url: $("#racineWeb").val()+"Ajaxgedfacture/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_ged").html(data);
},
complete: function() {
}
});
}
}
function valider_ged_facture()
{
idFacture = $("#idFactureGed").val();
v_url = $("#racineWeb").val()+"Ajaxgedfacture/chargerged";
donnees = "";
donnees = new FormData($("#ajax_form_upload")[0]);
$.ajax({
type: "POST",
url: v_url,
data: donnees,
contentType: false,
cache: false,
processData :false,
success: function(message){
alert_ebene(message);
},
error: function(errorData){
},
complete: function() {
// reafficher_ged_facture(idFacture);
}
});
}
function consulterfactureged()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconsprestataire/geds/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function enregistrer_nv_verres()
{
libelleOptique = $("#libelleOptique").val();
if (libelleOptique<=" ")
{
v_msg="Veuillez saisir le nom!";
v_msgEng="Please enter the name!";
alert_ebene(v_msg, v_msgEng);
$("#libelleOptique").focus();
return;
}
prixVerre=$("#prixVerre").val();
prixVerre=prixVerre.replace(",",".");
$("#prixVerre").val(prixVerre);
if(isNaN(prixVerre))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#prixVerre").val("0");
$("#prixVerre").focus();
return;
}
if(prixVerre==0)
{
$("#prixVerre").focus();
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'libelleOptique='+libelleOptique+'&prixVerre='+prixVerre;
// typeSms="ententeprealableopt";
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/creerverre/",
type: 'POST',
data: donnees,
success: function(data) {
$("#btn_close_pop_new_verre").click();
$("#btn_close_pop_verre").click();
// $("#div_test_gabarit").html(data);
},
error: function(data) {
},
complete: function() {
actualiser_opticien();
}
});
}
function actualiser_reponse_opt(){
const nomForm = $("#nomForm").val();
if (nomForm == "frmopticien") {
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/reponseopt/",
type : 'post',
error: function(errorData)
{
},
success: function(data)
{
// Mise à jour du contenu de la div reponse
$("#div_reponse").html(data);
},
complete: function() {
}
});
}
}
function modifier_prix_opt(idDetailOptique)
{
opticien();
codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val();
demander_accord_opt(idDetailOptique, codeReponseEntentePrealable);
}
function demander_accord_opt(idDetailOptique, codeReponseEntentePrealable)
{
//debugger;
idDemandeAccord = $("#idDemandeAccord").val();
cout = $("#cout").val();
donnees = 'idDetailOptique='+idDetailOptique;
if (cout =="0")
{
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
$("#valeurActe").focus();
return;
}
if(codeReponseEntentePrealable=="2"){
v_msg="Souhaitez-vous vraiment modifier votre prix?";
v_msgEng="Are you sure you want to change your price?";
}else{
v_msg="Confirmez-vous le prix?";
v_msgEng="Do you confirm the price?";
}
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idDetailOptique='+idDetailOptique;
$("#livraison").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/supprimedemande/",
type: 'POST',
data: donnees,
success: function(data){
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
opticien();
}
});
}
else
{
if(idDemandeAccord=="0"){
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/demanderaccordopt/",
type: 'POST',
data: donnees,
success: function(data) {
//preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
// raffraichir affichage
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
//mettremailattente(donnees_sav);
}
});
}else{
donnees = '';
$("#livraison").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/",
type: 'POST',
data: donnees,
success: function(data){
$("#livraison").html(data);
if($('#btn-demande-accord').val() =='Change your price'){
return;
};
},
error: function(data) {
},
complete: function() {
}
});
}
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(idDemandeAccord=="0" && codeReponseEntentePrealable==""){
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/demanderaccordopt/",
type: 'POST',
data: donnees,
success: function(data) {
//preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
// raffraichir affichage
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
//mettremailattente(donnees_sav);
}
});
}else if (codeReponseEntentePrealable=="2"){
donnees = 'idDetailOptique='+idDetailOptique;
$("#livraison").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/supprimedemande/",
type: 'POST',
data: donnees,
success: function(data){
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
opticien();
}
});
}else{
donnees = '';
$("#livraison").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/",
type: 'POST',
data: donnees,
success: function(data){
$("#livraison").html(data);
if($('#btn-demande-accord').val() =='Modifier votre prix'){
$('#btn-demande-accord').val('')
};
},
error: function(data) {
},
complete: function() {
}
});
}
}
else
{
donnees = '';
$("#livraison").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/",
type: 'POST',
data: donnees,
success: function(data){
$("#livraison").html(data);
if($('#btn-demande-accord').val() =='Modifier votre prix'){
$('#btn-demande-accord').val('')
};
},
error: function(data) {
},
complete: function() {
}
});
}
});
}
}
function demander_accord_mont(idOptique)
{
prixPrestataire = $("#prixPrestataire").val();
prixPrestataire=prixPrestataire.replace(",",".");
$("#prixPrestataire").val(prixPrestataire);
if(isNaN(prixPrestataire))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#prixPrestataire").val("0");
$("#prixPrestataire").focus();
return;
}
if(prixPrestataire==0)
{
$("#prixPrestataire").focus();
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idOptique='+idOptique+'&prixPrestataire='+prixPrestataire;
typeSms="ententeprealablemont";
donnees_sav = donnees+'&typeMail=mailententeprealablemont';
$.ajax({
url: $("#racineWeb").val()+"Ajaxmonture/demanderaccordmont/",
type: 'POST',
data: donnees,
success: function(data) {
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
$("#div_monture").html(data);
},
error: function(data) {
},
complete: function() {
mettremailattente(donnees_sav);
}
});
}
// 06/04/2019
function changer_langue()
{
codeLangue = $("#codeLangue").val();
v_msg="Confirmez-vous le changement de langue?";
v_msgEng="Do you confirm the language change?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxchangerlangue/changerlangue/",
type : 'post',
// data: donnees,
error: function(errorData)
{
},
success: function(data)
{
},
complete: function()
{
window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/");
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxchangerlangue/changerlangue/",
type : 'post',
// data: donnees,
error: function(errorData)
{
},
success: function(data)
{
},
complete: function()
{
window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/");
}
});
}
else
{
return;
}
});
}
}
function envoyersms(p_destinataires, p_message, creation_message)
{
debugger;
if(creation_message=="1")
{
envoyer_messagerie(p_message, "0");
}
envoismsactif = $("#envoismsactif").val();
if(envoismsactif=="0")
{
return;
}
if(p_destinataires.length<5)
{
/*
v_msg="SMS => Pas de destintaire!";
v_msgEng="SMS => No recipient!";
alert_ebene(v_msg, v_msgEng);
*/
return;
}
fournisseurSms = $("#fournisseurSms").val();
if (fournisseurSms<=" ")
{
v_msg="Fournisseur de SMS non d\u00e9fini!";
v_msgEng="SMS provider not defined!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(fournisseurSms=="esicia")
{
ajouter_sms_attente(p_destinataires, p_message);
return;
}
else
if(fournisseurSms=="blive")
{
ajouter_sms_attente(p_destinataires, p_message);
return;
}
else
if(fournisseurSms=="hooza")
{
ajouter_sms_attente(p_destinataires, p_message);
return;
}
else
if(fournisseurSms=="noah")
{
ajouter_sms_attente(p_destinataires, p_message);
return;
}
else
if(fournisseurSms=="emisms")
{
ajouter_sms_attente(p_destinataires, p_message);
return;
}
else
if(fournisseurSms=="nerhysms")
{
ajouter_sms_attente(p_destinataires, p_message);
return;
}
else
if(fournisseurSms=="ovh")
{
ajouter_sms_attente(p_destinataires, p_message);
return;
}
else
{
v_msg=fournisseurSms+" => Fournisseur de SMS inconnu!";
v_msgEng=fournisseurSms+" => Unknown SMS Provider!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
function preparesms_adherent(typeSms)
{
envoismsactif = $("#envoismsactif").val();
if(envoismsactif=="0")
{
return;
}
smsAssure = $("#smsAssure").val();
if(smsAssure=="0")
{
return;
}
smsmParFacture = $("#smsmParFacture").val();
if(smsmParFacture=="0")
{
return;
}
codeLangueAdherent = $("#codeLangueAdherent").val();
p_destinataires = "";
p_message = "";
creation_message = "0";
devise = $("#devise_C").val();
if (typeSms=="facturer_cso")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonConsultation = $("#numeroBonConsultation_C").val();
p_destinataires = $("#telephonePortableAdherent_C").val();
p_message = $("#prestataire_C").val()+" ";
p_message +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
/*
p_message +="Bon consultation No : "+numeroBonConsultation+" ";
p_message +="Consommations : "+cout_f+" "+devise;
*/
p_message += (codeLangueAdherent=="en_US") ? "Consultation form No :" : "Bon consultation No : ";
p_message += numeroBonConsultation+" ";
p_message += (codeLangueAdherent=="en_US") ? "Consumptions : " : "Consommations : ";
p_message += cout_f+" "+devise;
p_message +=" TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_pha")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonOrdonnance = $("#numeroBonOrdonnance_C").val();
p_destinataires = $("#telephonePortableAdherent_C").val();
p_message = $("#prestataire_C").val()+" ";
p_message +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_message += (codeLangueAdherent=="en_US") ? "Prescription No : " : "Ordonnance No : ";
p_message += numeroBonOrdonnance+" ";
p_message += (codeLangueAdherent=="en_US") ? "Pharmacy Consumptions : " : "Consommations Pharmacie : ";
p_message += cout_f+" "+devise;
p_message +=" TM : "+montantTm+" "+devise;
}
if (typeSms=="facturer_lab")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonExamen = $("#numeroBonExamen_C").val();
p_destinataires = $("#telephonePortableAdherent_C").val();
p_message = $("#prestataire_C").val()+" ";
p_message +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_message += (codeLangueAdherent=="en_US") ? "Exam form No : " : "Bon Examens No : ";
p_message += numeroBonExamen+" ";
p_message += (codeLangueAdherent=="en_US") ? "Laboratory consumptions : " : "Consommations Labo : ";
p_message += cout_f+" "+devise;
p_message +=" TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_opt")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonOptique = $("#numeroBonOptique_C").val();
p_destinataires = $("#telephonePortableAdherent_C").val();
p_message = $("#prestataire_C").val()+" ";
p_message +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_message += (codeLangueAdherent=="en_US") ? "Optical foem No : " : "Bon Optique No : ";
p_message += numeroBonOptique+" ";
p_message += (codeLangueAdherent=="en_US") ? "Optical consumptions : " : "Consommations Optiques : ";
p_message += cout_f+" "+devise;
p_message +=" TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_mont")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
p_destinataires = $("#telephonePortableAdherent_C").val();
p_message = $("#prestataire_C").val()+" ";
p_message +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_message += (codeLangueAdherent=="en_US") ? "Optical frames Consumptions : " : "Consommations Montures : ";
p_message += cout_f+" "+devise;
p_message +=" TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_sea")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonKine = $("#numeroBonKine_C").val();
p_destinataires = $("#telephonePortableAdherent_C").val();
p_message = $("#prestataire_C").val()+" ";
p_message +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_message += (codeLangueAdherent=="en_US") ? "KINE form No : " : "Bon KINE No : ";
p_message += numeroBonKine+" ";
p_message += (codeLangueAdherent=="en_US") ? "KINE Consumptions : " : "Consommations KINE : ";
p_message += cout_f+" "+devise;
p_message +=" TM : "+montantTm_f+" "+devise;
}
envoyersms(p_destinataires, p_message, creation_message);
}
function ajouter_sms_attente(p_destinataires, p_message)
{
donnees = "destinataires="+p_destinataires+"&message="+p_message;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsmsattente/ajouter/",
type: 'POST',
data: donnees,
success: function(data)
{
},
error: function(errdata)
{
},
complete: function()
{
}
});
}
function ajouter_sms_attente_singleton(p_destinataires, p_message)
{
donnees = "destinataires="+p_destinataires+"&message="+p_message;
var addr = p_destinataires.split(",");
addr.forEach(function(element)
{
p_dest = element;
if(p_dest.length>4)
{
donnees = "destinataires="+p_dest+"&message="+p_message;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsmsattente/ajouter/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
}
});
}
else
{
v_msg=p_dest+" => Mauvais format!";
v_msgEng=p_dest+" => wrong phone format!";
alert_ebene(v_msg, v_msgEng);
}
});
}
function tester_disponibiliter_sms()
{
p_message = "";
fournisseurSms = $("#fournisseurSms").val();
if (fournisseurSms<=" ")
{
v_msg="Fournisseur de SMS non d\u00e9fini!";
v_msgEng="SMS provider not defined!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(fournisseurSms=="esicia")
{
p_message = "Fournisseur : esicia ";
}
else
if(fournisseurSms=="blive")
{
p_message = "Fournisseur : blive ";
}
else
if(fournisseurSms=="hooza")
{
p_message = "Fournisseur : hooza ";
}
else
if(fournisseurSms=="ovh")
{
p_message = "Fournisseur : hooza ";
}
else
{
v_msg=fournisseurSms+" => Fournisseur de SMS inconnu!";
v_msgEng=fournisseurSms+" => Unknown SMS Provider!";
alert_ebene(v_msg, v_msgEng);
return;
}
p_destinataires = "25761198584";
// p_destinataires = "25761198584,25761198584";
donnees = "destinataires="+p_destinataires+"&message="+p_message+"&fournisseurSms="+fournisseurSms;
$.ajax({
url: $("#racineWeb").val()+"Ajaxtesterdisponiblitesms/envoyerlesms/",
type: 'POST',
data: donnees,
success: function(data)
{
$('#div_test_gabarit').html(data);
},
error: function(errdata)
{
},
complete: function()
{
}
});
}
function ajouter_destinataire_sms_adherent(p_destinataires)
{
envoismsactif = $("#envoismsactif").val();
if(envoismsactif=="0")
{
return p_destinataires;
}
smsAssure = $("#smsAssure").val();
if(smsAssure=="0")
{
return p_destinataires;
}
tel_adh = $("#telephonePortableAdherent_C").val();
if(tel_adh.length>4)
{
return p_destinataires+","+tel_adh;
}
return p_destinataires;
}
function tester_ajouter_destinataire_sms_adherent()
{
p_destinataires = "22506802339";
}
function preparemail_adherent(typeSms)
{
emailParFacture = $("#emailParFacture").val();
if(emailParFacture=="0")
{
return;
}
emailAdherent = $("#emailAdherent_C").val();
if(emailAdherent.length<5)
{
return;
}
codeLangueAdherent = $("#codeLangueAdherent").val();
p_objet_email_adh = (codeLangueAdherent=="en_US") ? "ALERT CONSUMPTION" : "ALERT CONSOMMATIONS";
p_messageemail_adh = "";
devise = $("#devise_C").val();
cout = parseInt(cout);
cout = cout.toLocaleString();
if (typeSms=="facturer_cso")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonConsultation = $("#numeroBonConsultation_C").val();
p_messageemail_adh = $("#prestataire_C").val()+" ";
p_messageemail_adh +="\n\n";
p_messageemail_adh +="Patient : "+patient+" ("+numeroBeneficiaire+")";
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Consultation form No : " : "Bon consultation No : ";
p_messageemail_adh += numeroBonConsultation;
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Consumptions : " : "Consommations : ";
p_messageemail_adh += cout_f+" "+devise;
p_messageemail_adh +="\n\n";
p_messageemail_adh +="TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_pha")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonOrdonnance = $("#numeroBonOrdonnance_C").val();
p_messageemail_adh = $("#prestataire_C").val()+" ";
p_messageemail_adh +="\n\n";
p_messageemail_adh +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Prescription No : " : "Ordonnance No : ";
p_messageemail_adh += numeroBonOrdonnance;
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Pharmacy Consumptions : " : "Consommations Pharmacie : ";
p_messageemail_adh += cout_f+" "+devise;
p_messageemail_adh +="\n\n";
p_messageemail_adh +="TM : "+montantTm+" "+devise;
}
if (typeSms=="facturer_lab")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonExamen = $("#numeroBonExamen_C").val();
p_messageemail_adh = $("#prestataire_C").val()+" ";
p_messageemail_adh +="\n\n";
p_messageemail_adh +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Exam form No : " : "Bon Examens No : ";
p_messageemail_adh += numeroBonExamen;
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Laboratory consumptions : " : "Consommations Labo : ";
p_messageemail_adh += cout_f+" "+devise;
p_messageemail_adh +="\n\n";
p_messageemail_adh +="TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_opt")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonOptique = $("#numeroBonOptique_C").val();
p_messageemail_adh = $("#prestataire_C").val()+" ";
p_messageemail_adh +="\n\n";
p_messageemail_adh +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Optical form No : " : "Bon Optique No : ";
p_messageemail_adh += numeroBonOptique;
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Optical consumptions : " : "Consommations Optiques : ";
p_messageemail_adh += cout_f+" "+devise;
p_messageemail_adh +="\n\n";
p_messageemail_adh +="TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_mont")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
p_messageemail_adh = $("#prestataire_C").val()+" ";
p_messageemail_adh +="\n\n";
p_messageemail_adh +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "Optical frames Consumptions : " : "Consommations Montures : ";
p_messageemail_adh += cout_f+" "+devise;
p_messageemail_adh +="\n\n";
p_messageemail_adh +="TM : "+montantTm_f+" "+devise;
}
if (typeSms=="facturer_sea")
{
patient = $("#beneficiaire_C").val();
numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val();
numeroBonKine = $("#numeroBonKine_C").val();
p_messageemail_adh = $("#prestataire_C").val()+" ";
p_messageemail_adh +="\n\n";
p_messageemail_adh +="Patient : "+patient+" ("+numeroBeneficiaire+") ";
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "KINE form No : " : "Bon KINE No : ";
p_messageemail_adh += numeroBonKine;
p_messageemail_adh +="\n\n";
p_messageemail_adh += (codeLangueAdherent=="en_US") ? "KINE Consumptions : " : "Consommations KINE : ";
p_messageemail_adh += cout_f+" "+devise;
p_messageemail_adh +="\n\n";
p_messageemail_adh +="TM : "+montantTm_f+" "+devise;
}
ajouter_mail_attente(emailAdherent, p_objet_email_adh, p_messageemail_adh);
}
function ajouter_mail_attente(emailAdherent, p_objet_email_adh, p_messageemail_adh)
{
donnees = "email="+emailAdherent+"&objet="+p_objet_email_adh+"&message="+p_messageemail_adh;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsmailadhattente/ajouter/",
type: 'POST',
data: donnees,
success: function(data)
{
},
error: function(errdata)
{
},
complete: function()
{
}
});
}
function verifiertentativeidentitification(user_id)
{
/*
donnees = 'user_id='+user_id;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenvoimaildivers/verifiertentativeidentitification/",
type : 'post',
data: donnees,
error: function(errorData)
{
},
success: function(data)
{
},
complete: function() {
}
});
*/
}
function afficherbon_vide()
{
$("#div_bonpecs").html("");
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
$("#nbligne").val("Number of lines displayed : 0");
}
else
{
$("#nbligne").val("Nombre de bons affich\u00e9s : 0");
}
codeTypeBon=$("#codeTypeBon").val();
if (codeTypeBon<=" ")
{
v_msg="Veuillez s\u00e9lectionner un type de bon!";
v_msgEng="Please select a form type!";
alert_ebene(v_msg, v_msgEng);
$("#codeTypeBon").focus();
return;
}
$("#div_bonpecs").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxafficherbons/vide/",
error: function(errorData)
{
},
success: function(data)
{
$("#div_bonpecs").html(data);
},
complete: function()
{
}
});
}
function demander_accord_pha_cso(idMedicament)
{
donnees = 'idMedicament='+idMedicament;
typeSms="ententeprealablepha";
donnees_sav = 'idMedicament='+idMedicament+'&typeMail=mailententeprealablepha';
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/demanderaccordpha/",
type: 'POST',
data: donnees,
success: function(data) {
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
// raffraichir affichage
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
mettremailattente(donnees_sav);
}
});
}
function desactiver_click_droit()
{
if (document.addEventListener) {
document.addEventListener('contextmenu', function (e) {
e.preventDefault();
}, false);
} else {
document.attachEvent('oncontextmenu', function () {
window.event.returnValue = false;
});
}
}
function enregistrer_new_notes()
{
notesNew = $("#notesNew").val();
notesNew = notesNew.trim();
if (notesNew<=" ")
{
v_msg="Veuillez saisir la note!";
v_msgEng="Please enter the note!";
alert_ebene(v_msg, v_msgEng);
$("#notesNew").focus();
return;
}
donnees = 'notesNew='+notesNew;
v_msg="Confirmez-vous cette note?";
v_msgEng="Do you confirm this note?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxnotesfeuillemaladie/creernote/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#btn_pop_note_new_quit").click();
},
complete: function() {
afficher_notes_feuille();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxnotesfeuillemaladie/creernote/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#btn_pop_note_new_quit").click();
},
complete: function() {
afficher_notes_feuille();
}
});
}
else
{
return;
}
});
}
}
function afficher_notes_feuille()
{
$("#div_notes").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxnotesfeuillemaladie/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_notes").html(donnees_retour);
}
});
}
function initiernotesfeuille()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxnotesfeuillemaladie/nouvellenote/",
error: function(errorData) {
},
success: function(data)
{
$("#div_note_new").html(data);
},
complete: function() {
$("#btn_pop_note_new").click();
}
});
}
function click_btn_add_drug()
{
hospitalisation = $("#hospitalisation_C").val();
miseEnObservation = $("#miseEnObservation_C").val();
nbMedicamentMax = parseInt($("#nbMedicamentMax").val());
nbMedicamentSaisie = parseInt($("#nbMedicamentSaisie").val());
if (nbMedicamentSaisie>=nbMedicamentMax && (hospitalisation!="1"||hospitalisation!="1"))
{
v_msg="Attention! Maximum de m\u00e9dicaments atteint!";
v_msgEng="Warning! Maximum drugs reached!";
alert_ebene(v_msg, v_msgEng);
return;
}
$("#btn_add_drug").click();
}
/*
function imprimer_feuille_maladie()
{
facture=$("#facture").val();
if (facture!=1)
{
v_msg="Pas encore factur\u00e9e!";
v_msgEng="Not yet charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
// $("#div_notes").html('
' + 'Veuillez patienter...' + ' ');
donnees_retour = "";
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfeuillemaladie/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_export_a").html(donnees_retour);
$("#btn_imprimer_feuille_maladie").click();
}
});
}
*/
function imprimer_feuille_maladie()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerbonprescrition/",
success: function(data)
{
$("#div_export_a").html(data);
$("#btn_imprimer_bon").click();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
}
});
}
function controle_numerique_new(idControle, oldValue)
{
controle = document.getElementById(idControle);
valeur = controle.value;
if(isNaN(valeur))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
controle.value=oldValue;
controle.focus();
return false;
}
return true;
}
function reinitrechercherbonordonnance()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxchangerordonnance/reinit/",
type: 'POST',
// data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
window.location.assign($("#racineWeb" ).val()+"Pharmacien/");
}
});
}
function reinit_chercher_ordonnance_opt()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxchangerordonnanceopt/reinit/",
type: 'POST',
// data: donnees,
success: function(data) {
// window.location.assign($("#racineWeb" ).val()+"Opticien/");
},
error: function(data) {
},
complete: function()
{
window.location.assign($("#racineWeb" ).val()+"Opticien/");
}
});
}
//
function reinitrechercherbonkine()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxchangerordonnancesea/reinit/",
type: 'POST',
// data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
window.location.assign($("#racineWeb" ).val()+"Kine/");
}
});
}
function supprimer_espace_string(p_mot)
{
p_mot = p_mot.trim();
p_mot = p_mot.replace(" ", "");
return p_mot;
}
function notesfeuillemaladie()
{
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9e!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Notesfeuillemaladie/");
}
function raffraichier_gabarit()
{
// Intercepteur AJAX global
$(document).ajaxError(function(event, xhr, settings, error) {
if (xhr.status === 500) {
const errorMatch = xhr.responseText.match(/Warning: (.+?) in (.+?) on line (\d+)/);
if (errorMatch) {
// alert(`Erreur PHP: ${errorMatch[1]}\nFichier: ${errorMatch[2]}\nLigne: ${errorMatch[3
window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/");
}
}
});
$.ajax({
url: $("#racineWeb").val()+"Ajaxgabarit/",
success: function(data)
{
$("#div_ajaxgabarit").html(data);
fusionConsOrd = $("#fusionConsOrd").val();
vue = $("#vue").val();
if(fusionConsOrd != "1" && vue !="Connexion"){
window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/");
}
},
error: function(errorData)
{
},
complete: function()
{
$(".datepicker" ).datepicker();
raffraichier_messagerie();
actualiser_contestation();
actualiser_avis_hospitalisation();
actualiser_reponse_opt();
}
});
}
function connexion_cookie()
{
msgErreur=$("#msgErreur").val();
donnees = 'msgErreur='+msgErreur;
$.ajax({
url: $("#racineWeb").val()+"Ajaxconnexioncookie/",
type: 'POST',
data: donnees,
success: function(data)
{
$("#div_ajaxconnexion").html(data);
$(".selectpicker").selectpicker();
},
error: function(errorData)
{
},
complete: function()
{
var login = document.getElementById("login").value;
if (login>" ")
{
$("#mdp").focus();
}
else
{
$("#codeSociete").focus();
}
}
});
}
function ajaxaffectionspossibles()
{
codeTypeAffection=$("#codeTypeAffection").val();
donnees = 'codeTypeAffection='+codeTypeAffection;
$.ajax({
url: $("#racineWeb").val()+"Ajaxaffectionspossibles/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#listeaffections").html(data);
}
});
}
function enregistreraffection()
{
//actVisible=$("#actVisible").val();
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffectionPop").val();
codeAffectionOld=$("#codeAffection").val();
hospitalisation = $("#hospitalisation").val();
//if (affectionObligatoire=="1" && codeAffection<="0000")
/*if (affectionObligatoire=="1" && codeAffection=="990")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#codeAffectionPop").focus();
return;
}
if (actVisible!="1")
{
v_msg="Non autoris\u00e9!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}*/
if (codeAffection==codeAffectionOld)
{
v_msg="D\u00e9jà saisi!";
v_msgEng="Already done!";
alert_ebene(v_msg, v_msgEng);
$("#codeAffectionPop").focus();
return;
}
numOrd = $("#numOrd").val();
numeroBon = $("#numeroBon").val();
codeMedecin = $("#codeMedecin").val();
codeGestionBon = "2";
noPrescription = $("#noPrescription").val();
facture=$("#facture").val();
v_msg="Confirmez-vous cette affection?";
v_msgEng="Do you confirm this affection?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeAffection='+codeAffection;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistreraffection/enregistreraffection/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function()
{
/*
if(facture!=1 && numOrd==0 && noPrescription==0)
{
if (numOrd=="0")
{
enregistrerprescriptionmedicatement(numeroBon,codeMedecin,codeGestionBon);
}
else if (hospitalisation=="1")
{
return false;
}
}
*/
$("#close_pop_affection").click();
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeAffection='+codeAffection;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistreraffection/enregistreraffection/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function()
{
/*
if(facture!=1 && numOrd==0 && noPrescription==0)
{
if (numOrd=="0")
{
//prescription_medicament();
enregistrerprescriptionmedicatement(numeroBon,codeMedecin,codeGestionBon);
}
else if (hospitalisation=="1")
{
return false;
}
else
{
window.location.assign($("#racineWeb" ).val()+"Prescription/");
}
}
*/
$("#close_pop_affection").click();
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
function diagnosticsfeuillemaladie()
{
/*
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
*/
window.location.assign($("#racineWeb" ).val()+"Diagnosticscons/");
}
function afficher_diagnostics_feuille()
{
$("#div_dianostics").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdiagnosticscons/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_dianostics").html(donnees_retour);
}
});
}
function imprimer_ecarts_decompte()
{
var div_export = $('#div_export_ecart_decompte');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$("#btn_imprimer_ecart_decompte").click();
// alert("Ajaximprimerecartdecompte");
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerecartdecompte/",
type: 'POST',
success: function(data)
{
div_export.html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
// $("#btn_imprimer_ecart_decompte").click();
}
});
}
function afficher_ecarts_facture_cons()
{
$("#div_ecart_decompte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxecartdecomptecons/ecartfacture/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_ecart_decompte").html(donnees_retour);
}
});
}
function ecarts_facture_non_saisies_cons()
{
$("#div_ecart_decompte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxecartdecomptecons/ecartnonsaisi/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_ecart_decompte").html(donnees_retour);
}
});
}
function initvidermessagerie()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxvidermessagerie/",
error: function(errorData) {
},
success: function(data) {
$("#div_vider_messagerie").html(data);
},
complete: function() {
$("#btn_pop_vider_messagerie").click();
$(".datepicker" ).datepicker();
}
});
}
function vidermessagerie()
{
dateLimite = $("#dateLimite").val();
v_msg="Confirmez-vous le vidage de tous les messages g\u00e9n\u00e9r\u00e9s avant le "+dateLimite+" ?";
v_msgEng="Do you confirm the emptying of all messages generated before the "+dateLimite+" ?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'dateLimite=' + dateLimite;
$("#btn_pop_vider_messagerie").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxvidermessagerie/vidermessagerie/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
},
complete: function()
{
v_msg="Vidage effectu\u00e9 avec succès!";
v_msgEng="Emptying done successfully!";
alert_ebene(v_msg, v_msgEng);
$("#btn_pop_vider_messagerie_quit").click();
gerer_messagerie();
// Messagerie/
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'dateLimite=' + dateLimite;
$("#btn_pop_vider_messagerie").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxvidermessagerie/vidermessagerie/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
},
complete: function()
{
v_msg="Vidage effectu\u00e9 avec succès!";
v_msgEng="Emptying done successfully!";
alert_ebene(v_msg, v_msgEng);
$("#btn_pop_vider_messagerie_quit").click();
gerer_messagerie();
// Messagerie/
}
});
}
else
{
return;
}
});
}
}
function afficher_contacts_assureur()
{
window.location.assign($("#racineWeb" ).val()+"Infossassureur/");
}
function ajaxdelaicarencecaisonconsultation()
{
codeRaisonConsultation=$("#codeRaisonConsultation").val();
donnees = 'codeRaisonConsultation='+codeRaisonConsultation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdelaicarencecaisonconsultation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#infodelaicarence").html(data);
},
complete: function() {
$("#delaiCarenceRaisonconsultation").val( $("#delaiCarenceRaisonconsultation_info").val());
$("#appliquerDelaiCarence").val( $("#appliquerDelaiCarence_info").val());
}
});
}
function CalculerFinMoisDecompte()
{
var typdate = $("#debutMoisDecompte").datepicker("getDate");
typdate.addMonths(1);
$("#finMoisDecompte").datepicker( "setDate", typdate );
}
function reposmedical()
{
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9e!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Reposmedical/");
}
function afficher_repos_medical()
{
$("#div_notes").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxreposmedical/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_notes").html(donnees_retour);
}
});
}
function initier_repos_medical()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxreposmedical/nouveaureposmedical/",
error: function(errorData) {
},
success: function(data)
{
$("#div_note_new").html(data);
},
complete: function() {
$("#btn_pop_note_new").click();
}
});
}
function enregistrer_new_repos_medical()
{
notesNew = $("#notesNew").val();
notesNew = notesNew.trim();
if (notesNew<=" ")
{
v_msg="Veuillez saisir la note!";
v_msgEng="Please enter the note!";
alert_ebene(v_msg, v_msgEng);
$("#notesNew").focus();
return;
}
nbJour = $("#nbJour").val();
if(isNaN(nbJour))
{
v_msg="Veuillez revoir la dur\u00e9ee!";
v_msgEng="Please review the duration!";
alert_ebene(v_msg, v_msgEng);
$("#nbJour").focus();
return;
}
if (nbJour<="0")
{
v_msg="Veuillez revoir la dur\u00e9ee!";
v_msgEng="Please review the duration!";
alert_ebene(v_msg, v_msgEng);
$("#nbJour").focus();
return;
}
donnees = 'notesNew='+notesNew+"&nbJour="+nbJour;
v_msg="Confirmez-vous ce repos m\u00e9dical?";
v_msgEng="Do you confirm this medical rest?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxreposmedical/creerreposmedical/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#btn_pop_note_new_quit").click();
},
complete: function() {
afficher_repos_medical();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxreposmedical/creerreposmedical/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#btn_pop_note_new_quit").click();
},
complete: function() {
afficher_repos_medical();
}
});
}
else
{
return;
}
});
}
}
function supprimer_affections(idAffection)
{
v_msg="Confirmez-vous cette suppression?";
v_msgEng="Do you confirm this deletion?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistreraffection/supprimeraffection/",
type : 'post',
data: "idAffection="+idAffection,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
$("#close_pop_affection").click();
feuillemaladie();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistreraffection/supprimeraffection/",
type : 'post',
data: "idAffection="+idAffection,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
$("#close_pop_affection").click();
feuillemaladie();
}
});
}
else
{
return;
}
});
}
}
function anteceentsmedicaux()
{
estMedecin=$("#estMedecin").val();
if (estMedecin!="1")
{
v_msg="Non autoris\u00e9!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Anteceentsmedicaux/");
}
function diagnosticsbeneficiaire()
{
estMedecin=$("#estMedecin").val();
if (estMedecin!="1")
{
v_msg="Non autoris\u00e9!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Diagnosticsconsbeneficiaire/");
}
function notesbeneficiaire()
{
estMedecin=$("#estMedecin").val();
if (estMedecin!="1")
{
v_msg="Non autoris\u00e9!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
window.location.assign($("#racineWeb" ).val()+"Notesbeneficiaire/");
}
function afficher_diagnostics_beneficiaire()
{
$("#div_dianostics").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdiagnosticsbeneficiaire/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_dianostics").html(donnees_retour);
}
});
}
function afficher_notes_beneficiaire()
{
$("#div_notes").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxnotesbeneficiaire/",
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_notes").html(donnees_retour);
}
});
}
function test_online()
{
if(navigator.onLine)
{
$("#test_connexion").css('background-color', 'green');
v_msg="Connexion OK!";
v_msgEng="Connection OK";
alert_ebene(v_msg, v_msgEng);
}
else
{
$("#test_connexion").css('background-color', 'red');
v_msg="Problème de Connexion!";
v_msgEng="Connection Problem!";
alert_ebene(v_msg, v_msgEng);
}
return;
}
function raffraichier_messagerie()
{
deconnexion='0';
if($('#nomForm').val()=="feuillemaladie"){
numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val();
if (numeroFeuilleMaladie > "0") {
afficheReponseAvis();
}
}
if(navigator.onLine)
{
$("#test_connexion").css('background-color', 'green');
c_html = "";
$.ajax({
url: $("#racineWeb").val()+"Ajaxmessagerie/",
success: function(data) {
c_html = data;
},
error: function(errorData) {
},
complete: function() {
$("#nbMessagesNonLus").html(c_html);
msgNonLus=$("#msgNonLus").val();
$("#span_notification").text(msgNonLus);
if(msgNonLus>0)
{
pop_dernier_messagerie();
}
// Ajout du 27/10/2024 => déconnecter si session expirée
deconnexion=$("#deconnexion").val();
// alert("deconnexion => "+deconnexion);
if(deconnexion=='1')
{
window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/");
}
}
});
}
else
{
$("#test_connexion").css('background-color', 'red');
return;
}
}
function consulterfactureverres()
{
idFacture = $("#idFacture").val();
$("#div_facture_detail").html('
' + 'Veuillez patienter...' + ' ');
donnees = 'idFacture='+idFacture;
if(isNaN(idFacture))
{
v_msg="Valeur num\u00e9rique exig\u00e9e!";
v_msgEng="Numeric value required!";
alert_ebene(v_msg, v_msgEng);
$("#idFacture").val("0");
$("#idFacture").focus();
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaxfactureconsprestataire/verres/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_facture_detail").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function init_remplacer_medicament(idMedicament)
{
donnees = 'idMedicament='+idMedicament;
// alert(donnees);
// return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/initremplacement/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function()
{
$("#btn_remplacer_medicament").click();
}
});
}
function consulter_remplacer_medicament()
{
$("#div_liste_medicaments_remplaces").html('
' + 'Veuillez patienter...' + ' ');
$('#btn_medicaments_remplaces').click();
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/consulterremplacement/",
type: 'POST',
success: function(data) {
$("#div_liste_medicaments_remplaces").html(data);
},
error: function(data) {
},
complete: function()
{
// $('#btn_medicaments_remplaces').click();
}
});
}
function ctrlkeypress_medicament_remplacement(ev)
{
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
if(keycode == '13')
{
afficher_pop_recherche_medicament_remplacement();
}
}
function afficher_pop_recherche_medicament_remplacement()
{
nomsearch = $("#nomsearchrempl").val();
if (nomsearch > " ")
{
donnees = "valid=1&nomsearch="+nomsearch;
// alert(donnees);
// return;
$("#div_listemedicament_rempl").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistemedicaments/remplacement/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_listemedicament_rempl").html(data);
}
});
}
}
function selectionner_medicament_pop_rempl(codeMedicament, libelleMedicament)
{
$("#codeMedicament_pop_rempl").val(codeMedicament);
$("#libelleMedicament_pop_rempl").val(libelleMedicament);
}
function remplacer_medicament()
{
codeMedicamentNouv = $("#codeMedicament_pop_rempl").val();
libelleMedicamentNouv = $("#libelleMedicament_pop_rempl").val();
if (codeMedicamentNouv<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9dicament!";
v_msgEng="Please select a medicine/drug!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Prescrire : "+libelleMedicamentNouv+"?";
v_msgEng="Prescribe : "+libelleMedicamentNouv+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeMedicamentNouv='+codeMedicamentNouv;
// alert(donnees);
// return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/remplacermedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
// $("#btn_close_pop_rempl").click();
prescription_medicament();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeMedicamentNouv='+codeMedicamentNouv;
// alert(donnees);
// return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/remplacermedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
// $('#div_test_gabarit').html(data);
// $("#btn_close_pop_rempl").click();
prescription_medicament();
},
complete: function() {
}
});
}
else
{
return;
}
});
}
}
var formatCurrency = function(num){
var str = num.toString().replace("", ""), parts = false, output = [], i = 1, formatted = null;
if(str.indexOf(".") > 0) {
parts = str.split(".");
str = parts[0];
}
str = str.split("").reverse();
for(var j = 0, len = str.length; j < len; j++) {
if(str[j] != " ") {
output.push(str[j]);
if(i%3 == 0 && j < (len - 1)) {
output.push(" ");
}
i++;
}
}
formatted = output.reverse().join("");
return(formatted + ((parts) ? "." + parts[1].substr(0, 2) : ""));
};
$(function(){
appliquerDataTable();
dataTableSpeciale();
afficheGaranties();
afficherficheconsultation();
afficheDivPlafond();
// Rafraîchir les notifications toutes les 10 secondes
setInterval(raffraichier_messagerie, 10000);
if($('#nomForm').val()=="chambre"){
var avisHospitalisation = $('#avisHospitalisation').val();
var numeroBonHospitalisation = $('#numeroBonHospitalisation').val();
var typeHospitalisation = $('#typeHospitalisation').val();
var facture = $('#facture').val();
var modeSaisieFacture = $('#modeSaisieFacture').val();
//alert('avisHospitalisation='+avisHospitalisation+'&numeroBonHospitalisation='+numeroBonHospitalisation);
if(avisHospitalisation == "1" && numeroBonHospitalisation <="0")
{
creerbonhospitalisation();
}else if(avisHospitalisation == "2"){
return false;
}else if((typeHospitalisation=="" || typeHospitalisation==undefined) && numeroBonHospitalisation=="0"){
return false;
}else{
cach();
//ajaxactespossibles_selection_hospitalisation();
var noChambre = $("#noChambre").val();
$("#div_selection").hide();
if (noChambre<=" ")
{
v_msg="Veuillez entrer le numero de chambre!";
v_msgEng="Please enter the room number!";
alert_ebene(v_msg, v_msgEng);
$("#noChambre").focus();
return;
}
$("#searchExam").keyup(function(){
var libelle = $(this).val();
if(libelle.length >="3")
{
examenhospitalisation(libelle);
}else{
$("#div_selection").hide();
return false;
}
});
}
}else
if($('#nomForm').val()=="miseEnObservation"){
//debugger;
codeFamilleActeObs = $('#codeFamilleActeObs').val();
if(codeFamilleActeObs=="" || codeFamilleActeObs==undefined){
$('#codeFamilleActeObs').val("FA008");
$('#codeFamilleActe').val("FA008");
}
ajaxactespossibles_miseenobservation();
//verification_contestation();
}else
if($('#nomForm').val()=="frmactesmedicaux"){
codeFamilleActeMed = $('#codeFamilleActeMed').val();
if(codeFamilleActeMed=="" || codeFamilleActeMed==undefined){
return false;
}else{
ajaxactespossibles_selection();
}
}else
if($('#nomForm').val()=="prescriptionexamens"){
ajax_demande_accord_examen();
}else
if($('#nomForm').val()=="prescriptionmedicament"){
//ajax_demande_accord_pharmacie();
var prescriptionSiCritereBareme = $('#prescriptionSiCritereBareme').val();
var statut = $('#statut').val();
if(prescriptionSiCritereBareme=="0" || statut!="1"){
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
faireDefileMessage(libelleMotif, libelleMotifEng);
}
}else
if($('#nomForm').val()=="pharmacie"){
codeActe = "PH"; // codeActePharmacie
getstatutacte(codeActe);
nbreLigne = parseInt($("#nbreLigne").val());
if(nbreLigne>0){
for(let i = 1; i <= nbreLigne; i++){
$("#div_selection"+i).hide();
}
}
}else
if($('#nomForm').val()=="pharmacien"){
codeActe = "PH"; // codeActePharmacie
getstatutacte(codeActe);
}else
if($('#nomForm').val()=="Optique"){
var prescriptionSiCritereBareme = $('#prescriptionSiCritereBareme').val();
var statut = $('#statut').val();
if(prescriptionSiCritereBareme=="0" || statut!="1"){
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
faireDefileMessage(libelleMotif, libelleMotifEng);
}
}else
if($('#nomForm').val()=="ficheBeneficiaire"){
var codeMedecin = $('#codeMedecin').val();
var codeActe = $('#codeActe').val();
if(codeActe>" " && codeMedecin > " "){
ajaxprixacte();
getstatutacte(codeActe);
}
}else
if($('#nomForm').val() == "proformahospitalisation"){
$("#div_selectionB").hide();
$("#searchInputB").keyup(function(){
var numero = $(this).val();
if(numero.length >="2")
{
chargernumero(numero);
}else{
$("#div_selectionB").hide();
return false;
}
});
idBeneficiaire = $("#idBeneficiaire").val();
ajax_beneficiaire_contexte(idBeneficiaire);
if(idBeneficiaire > "0"){
ajaxbeneficiairecouvert(idBeneficiaire);
}
affichedetailproformahopitalisation();
}else
if($('#nomForm').val()=="hospitalisationproforma")
{
afficherMasquerEnteteProforma();
affichedetailproformahopitalisation();
}else
if($('#nomForm').val()=="feuillemaladie")
{
bonCaduc = $("#bonCaduc").val();
facture = $("#facture").val();
codeAffection = $("#codeAffection").val();
contestation = $("#contestation").val();
if(codeAffection == "990" && contestation == "0" && facture == "0" && bonCaduc == "0"){
// Détection de la langue
const codeLangue = $("#codeLangue").val();
const p_msg_eng = "Click this button to add at least one condition to your medical record!";
const p_msg = "Cliquer sur ce bouton pour ajouter, au moins, une affection au dossier médical!";
const message = codeLangue == "en_US" ? p_msg_eng : p_msg;
// Création du tooltip
const tooltip = $(`
`);
// Ajout au DOM juste après le bouton
$('#btn_pop_affection').after(tooltip);
// Positionnement précis
function positionTooltip() {
const btn = $('#btn_pop_affection');
const btnRect = btn[0].getBoundingClientRect();
const tooltipDiv = $('.custom-tooltip');
// Calcul de la position horizontale centrée
const leftPosition = btnRect.left + (btnRect.width / 2) - (tooltipDiv.outerWidth() / 2);
// Correction pour éviter le débordement à gauche
const adjustedLeft = Math.max(10, leftPosition);
// Correction pour éviter le débordement à droite
const maxRight = window.innerWidth - tooltipDiv.outerWidth() - 10;
const finalLeft = Math.min(adjustedLeft, maxRight);
// Application du positionnement
tooltip.css({
'top': btnRect.bottom + window.scrollY + 'px',
'left': finalLeft + 'px'
});
}
// Positionnement initial
positionTooltip();
// Recalcul lors du redimensionnement
$(window).on('resize', positionTooltip);
// Fermeture au clic ailleurs
$(document).on('click', function(e) {
if (!$(e.target).closest('#btn_pop_affection').length &&
!$(e.target).closest('.custom-tooltip').length) {
tooltip.remove();
}
});
}
}
$("#div_selection").hide();
$("#searchInput").keyup(function(){
var libelle = $(this).val();
var donnees = 'libelle='+ libelle;
var vLink = "";
if($('#nomForm').val()=="prescriptionexamens"){
vLink = "Ajaxchargeractesexamen/";
}else if ($('#nomForm').val()=="prescriptionmedicament"){
vLink = "Ajaxchargerlistemedicaments/";
}else if ($('#nomForm').val()=="chambre"){
vLink = "Ajaxchargeractesexamenhospitalisation/";
}else if ($('#nomForm').val()=="dentaire"){
vLink = "Ajaxchargeractesdentisterie/";
}else if ($('#nomForm').val()=="proformahospitalisation" || $('#nomForm').val()=="hospitalisationproforma"){
idBeneficiaire = $("#idBeneficiaire").val();
motif = $("#motif").val();
dateDebut = $("#dateDebut").val();
duree = $("#duree").val();
if(idBeneficiaire=='0' || idBeneficiaire <=" ")
{
v_msg="Veuillez sélectionner un No Bénéficiaire!";
v_msgEng="Please select a Beneficiary Number!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#searchInputB").focus();
return;
}
if (motif <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#motif").focus();
return;
}
if (dateDebut<=" ")
{
v_msg="Veuillez saisir la date de d\u00e9but!";
v_msgEng="Please enter the start date!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#dateDebut").focus();
return;
}
if (duree == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#duree").focus();
return;
}
donnees += '&idBeneficiaire='+idBeneficiaire;
vLink = "Ajaxchargeractesproformahospitalisation/";
}
if(libelle!='' && libelle.length >="3")
{
$.ajax({
type: "POST",
url: $("#racineWeb").val()+vLink,
data:donnees,
beforeSend: function(){
$("#searchInput").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px");
},
success: function(data){
$("#div_selection").show();
$("#div_selection").html(data);
$("#searchInput").css("background","#FFF");
}
});
}else{
$("#div_selection").hide();
return false;
}
});
});
function actualiserFeuillemaladie()
{
feuillemaladie();
}
function affichelistemedicament()
{
var libelle = $('#searchInput').val();
if(libelle!='' && libelle.length >="3")
{
var donnees = 'libelle='+ libelle;
vLink = "Ajaxchargermedicamentsubstitution/";
$.ajax({
type: "POST",
url: $("#racineWeb").val()+vLink,
data:donnees,
beforeSend: function(){
$("#searchInput").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px");
},
success: function(data){
$("#div_selection").show();
$("#div_selection").html(data);
$("#searchInput").css("background","#FFF");
}
});
}else{
$("#div_selection").hide();
return false;
}
}
function selectElement(val){
$("#searchInput").val(val);
$("#div_selection").hide();
}
function enregistrerprescriptionmedicatement(numeroBon,codeMedecin,codeGestionBon)
{
debugger;
donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin;
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() {
window.location.assign($("#racineWeb" ).val()+"Prescription/");
}
});
}
// Applique la librairie DataBase sur les tableaux
function appliquerDataTable(){
var sc = $(window).scrollTop(),
dh = $(document).height(),
ch = $(window).height();
scrollPercent = (sc / (dh-ch)) * 100;
try{
var oTable = $('.tabliste').DataTable({
"lengthMenu": [ 50, 100, 150],
"scrollX": true,
"scrollY": "75vh",
"pagingType": "full_numbers",
"autoWidth": false,
"language": {
"lengthMenu":"_MENU_",
"zeroRecords": "D\u00e9sol\u00e9 - Aucune donn\u00e9e trouv\u00e9e",
"info": "_PAGE_ sur _PAGES_ pages",
"infoEmpty": "Pas d'enregistrement",
"search": "Recherche:",
"paginate": {
"next": "►",
"previous": "◄",
"first": "|◄",
"last": "►|"
},
"infoFiltered": "(filtr\u00e9 de _MAX_ total enregistrements)"
}
});
/*
$(window).bind('resize', function () {
oTable.fnAdjustColumnSizing(false);
});
*/
}
catch(err){
return false;
}
}
function facturepartielle()
{
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
// POUR LES CONSULTATIONS A ENTENTE PREALBLE
ententePrealableCons=$("#ententePrealableCons").val();
if (ententePrealableCons=="2" || ententePrealableCons=="9" )
{
v_msg="Veuillez attendre l'accord de l'assureur!";
v_msgEng="Please wait for insurer approval!";
alert_ebene(v_msg, v_msgEng);
return;
}
if (ententePrealableCons=="9" )
{
v_msg="Non autoris\u00e9 car l'acte consultation a \u00e9t\u00e9 r\u00e9fus\u00e9 par l'assureur!";
v_msgEng="Not authorized because the consultation act was refused by the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
///////////////
//alert("La Facturation partielle est actuellement en cours de construction! Veuillez cliquer sur le sous-menu \"Fermer Doss\" en dessous, pour clôturer le dossier du patient ainsi que sa prise en compte par l'assureur. Merci pour votre compr\u00e9hension!");
//return;
actVisible=$("#actVisible").val();
if (actVisible!="1")
{
v_msg="Non autoris\u00e9 car l'utilisateur n'a pas les droits requis. Veuillez contacter l'assureur!";
v_msgEng="Not authorized because the user does not have the required rights. Please contact the insurer!";
alert_ebene(v_msg, v_msgEng);
return;
}
var nomForm = $('#nomForm').val();
if(nomForm == "Listefacturepartielle"){
window.location.assign($("#racineWeb" ).val()+"Listefacturepartielle/");
}else{
window.location.assign($("#racineWeb" ).val()+"Facturepartielle/");
}
}
function imprimerfacturepartielle(idPrestationactes, codeTypePrestation)
{
if (idPrestationactes>"0")
{
if (codeTypePrestation == 'HOSP'){
print_hospitalisation();
}else{
donnees = "idPrestationactes="+idPrestationactes+"&codeTypePrestation="+codeTypePrestation;
var div_export = $('#div_facture_partielle');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$("#btn_facture_partielle").click();
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturepartielle/",
type: 'POST',
data: donnees,
success: function(data)
{
div_export.html(data);
//facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
}
else
{
v_msg="Rien \u00e0 imprimer!";
v_msgEng="Nothing to print!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
function actualisefacpartielle()
{
facturepartielle();
}
function dataTableSpeciale(){
try{
$('.tabspeciale').DataTable({
"lengthMenu": [ 20, 50, 100],
"scrollX": true,
"scrollY": "75vh",
"pagingType": "full_numbers",
"autoWidth": false,
"bFilter": false,
"bLengthChange": false,
"orderMulti": true,
"language": {
"lengthMenu":"Affiche _MENU_ par page",
"zeroRecords": "D\u00e9sol\u00e9 - Aucune donn\u00e9e trouv\u00e9e",
"info": "_PAGE_ sur _PAGES_ pages",
"infoEmpty": "Pas d'enregistrement",
"search": "Recherche:",
"paginate": {
"next": "?",
"previous": "?",
"first": "|?",
"last": "?|"
},
"infoFiltered": "(filtr\u00e9 de _MAX_ total enregistrements)"
}
});
}
catch(err){
return false;
}
}
// 19/05/2021
function supprimer_miseenobservation()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxobservation/supprimermiseenobservation/",
type: 'POST',
data: donnees,
success: function(data) {
feuillemaladie();
},
error: function(data) {
},
complete: function() {
}
});
}
// 24/05/2021
function select_prestatation_a_facturer(p_choix, idPrestationactes)
{
donnees = 'idPrestationactes='+idPrestationactes;
donnees += '&choix='+p_choix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxfacturepartielle/selectionnerunacte/",
type: 'POST',
data: donnees,
success: function(data) {
//$("#div_liste_actes").html(data);
facturepartielle();
},
error: function(data) {
},
complete: function() {
}
});
}
function selectionner_tous_actes_a_facturer()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxfacturepartielle/selectionnertous/",
type: 'POST',
data: donnees,
success: function(data) {
//$("#div_liste_actes").html(data);
facturepartielle();
},
error: function(data) {
},
complete: function() {
}
});
}
function annuler_selection_actes_a_facturer()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxfacturepartielle/annulerselection/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_liste_actes").html(data);
//facturepartielle();
},
error: function(data) {
},
complete: function() {
}
});
}
function imprimerfactureselection(idEnteteFacture)
{
var nbreSelec = $('#nbreSelec').val();
if(nbreSelec==undefined && idEnteteFacture > 0){
nbreSelec = idEnteteFacture;
}
if(nbreSelec > 0 ){
donnees = 'idEnteteFacture='+idEnteteFacture;
var div_export = $('#div_facture_selection');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$("#btn_facture_selection").click();
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturepartielleselection/",
type: 'POST',
data: donnees,
success: function(data)
{
div_export.html(data);
//facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}else{
v_msg="Rien \u00e0 imprimer!";
v_msgEng="Nothing to print!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
function supprimefactureselection(idEnteteFacture, numeroFacture)
{
donnees = 'idEnteteFacture='+idEnteteFacture;
v_msg="Confirmez-vous la suppression de la facture "+numeroFacture+"?";
v_msgEng="Do you confirm suppression of invoice "+numeroFacture+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistefacturepartielle/supprimefactureselection/",
type: 'POST',
data: donnees,
success: function(data)
{
facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistefacturepartielle/supprimefactureselection/",
type: 'POST',
data: donnees,
success: function(data)
{
facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
else
{
return;
}
});
}
}
function supprimefacturepartielle(idPrestationactes, numeroFacture)
{
donnees = 'idPrestationactes='+idPrestationactes;
v_msg="Confirmez-vous la suppression de la facture "+numeroFacture+"?";
v_msgEng="Do you confirm suppression of invoice "+numeroFacture+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistefacturepartielle/supprimefacturepartielle/",
type: 'POST',
data: donnees,
success: function(data)
{
facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistefacturepartielle/supprimefacturepartielle/",
type: 'POST',
data: donnees,
success: function(data)
{
facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
else
{
return;
}
});
}
}
// 28/05/2021
function afficher_liste_recherche_medicament()
{
libelleMedicamentSearch = $("#libelleMedicamentSearch").val();
if(libelleMedicamentSearch<=" ")
{
v_msg="Entrez le nom du m\u00e9dicament à rechercher";
v_msgEng="Enter the name of drug for search";
alert_ebene(v_msg,v_msgEng);
$("#libelleMedicamentSearch").focus();
return false;
}
donnees = "valid=1&libelleMedicamentSearch="+libelleMedicamentSearch;
$("#div_liste_medicament").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistemedicamentsubstitution/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_liste_medicament").html(data);
//dataTableSpeciale();
}
});
}
function ctrlkeypress_sub(ev)
{
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
if(keycode == '13')
{
afficher_liste_recherche_medicament();
}
}
function selectionner_medicament_sub(idMedicament, codeMedicament, libelleMedicament, prix)
{
$("#idSubstitut").val(idMedicament);
$("#codeSubstitut").val(codeMedicament);
$("#libelleSubstitut").val(libelleMedicament);
$("#libelleMedicamentSearch").val(libelleMedicament);
$("#prixPublicSubstitut").val(prix);
$("#prixPublicSubstitut").focus();
$("#prixSubstitut").focus();
$("#div_liste_medicament").empty();
}
function ajax_maj_valeurActe_detailoptique(idDetail, valeurActe, controle){
valeurActe=valeurActe.replace(",",".");
valeurActe=valeurActe.replace(/ /g,"");
controle.value=valeurActe;
if(controle_numerique(controle))
{
if(valeurActe==0)
{
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
controle.focus();
return;
}
donnees = 'idDetail='+idDetail;
donnees += "&valeurActe="+valeurActe;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/majprix/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
alerter_depassement_limite();
controle.focus();
}
});
}
}
function ajax_maj_quantite_detailoptique(idDetail, quantite, controle)
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idDetail='+idDetail
donnees += "&quantite="+quantite;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/majquantite/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
alerter_depassement_limite();
controle.focus();
}
});
}
// 13/07/2021
function ajaxplafondacteoptique()
{
codeActe = $("#codeActe").val();
datePrescription = $("#datePrescription").val();
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
donnees = 'codeActe='+codeActe+'&datePrescription='+datePrescription;
//$("#div_plafond").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/plafondacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_plafond").html(data);
},
complete: function() {
}
});
}
function prescrire_acte_opt()
{
var statutActe = $("#statutActe").val();
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
if(statutActe != "1")
{
alert_ebene(libelleMotif, libelleMotifEng);
faireDefileMessage(libelleMotif, libelleMotifEng);
return;
}else{
faireDefileMessage("", "");
codePrestatairePrescription = $("#codePrestatairePrescription").val();
codeActe = $("#codeActe").val();
soldeConsommation = $("#soldeConsommation").val();
if(soldeConsommation==undefined){
soldeConsommation = "9999999999";
}else{
soldeConsommation = soldeConsommation.replace(/ /g,"");
}
soldeNbreTransaction = $("#soldeNbreTransaction").val();
if(soldeNbreTransaction == undefined){
soldeNbreTransaction = "999";
}
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
donnees = 'codeActe='+codeActe;
donnees += '&soldeConsommation='+soldeConsommation;
donnees += '&soldeNbreTransaction='+soldeNbreTransaction;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/ajouteracteprescription/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#btn_close_pop_verre").click();
$("#livraison").html(data);
},
complete: function() {
//actualiser_opticien();
}
});
}
// Fin Ajout à la prescription
}
function clignotte(obj){
setInterval(function(){obj.style.visibility= (obj.style.visibility=='visible')?'hidden':'visible';},5000);
}
function supprimer_acte_opticien(idDetail, codeReponseEntentePrealable)
{
if(codeReponseEntentePrealable =='2'){
v_msg="Suppression impossible!";
v_msgEng="Deletion not possible!";
alert_ebene(v_msg, v_msgEng);
return;
};
v_msg="Confirmez-vous la suppression de cet acte?";
v_msgEng="Do you confirm the removal of this act?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idDetail='+idDetail;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
opticien();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'idDetail='+idDetail;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailopticien/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
},
error: function(data) {
},
complete: function() {
opticien();
}
});
}
else
{
return;
}
});
}
}
function reinitialiser_plafond()
{
$("#codeActe").val("");
$("#div_plafond").html('');
$("#close_pop").click();
}
function referencer(codeReference)
{
if($('#referencer').val()=="1")
{
$("#codeReferencement").val(codeReference);
}
else
{
$("#codeReferencement").val("0");
}
}
function affiche_prix_mediacment_substitution(controle)
{
if(controle!='' && controle.length >="10"){
var str = controle.split(' <==> ');
var codeMedicament = str[0];
var libelleMedicament = str[1];
//alert(str[4]); return;
//$('#ententePrealableSubstitut').val(dstr[2]);
donnees = 'codeMedicament='+codeMedicament+'&libelle='+libelleMedicament;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsubstitutionmedicament/prixsubstitut/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
var dstr = data.split('/');
$("#prixPublicSubstitut").val(parseInt(dstr[0]));
$('#idSubstitut').val(parseInt(dstr[1]));
$('#ententePrealableSubstitut').val(dstr[2]);
$("#libelleSubstitut").val(libelleMedicament);
},
complete: function() {
}
});
}else{
return false;
}
}
function affiche_info_mediacment_substitution(controle)
{
if(controle!='' && controle.length >="10"){
var str = controle.split(' <==> ');
var libelle = str[0];
donnees = 'libelle='+libelle;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsubstitutionmedicament/infosubstitut/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
var dstr = data.split('/');
$("#prixPublicSubstitut").val(parseInt(dstr[0]));
$('#idSubstitut').val(parseInt(dstr[1]));
$("#libelleSubstitut").val(libelle);
},
complete: function() {
}
});
}else{
return false;
}
}
function add_selected_drug(controle)
{
debugger;
nomForm = $("#nomForm").val();
if (nomForm == "pharmacien"){
affiche_prix_mediacment_substitution(controle);
return;
}
hospitalisation = $("#hospitalisation_C").val();
miseEnObservation = $("#miseEnObservation_C").val();
nbMedicamentMax = parseInt($("#nbMedicamentMax").val());
nbMedicamentSaisie = parseInt($("#nbMedicamentSaisie").val());
if (nbMedicamentSaisie >= nbMedicamentMax && (hospitalisation !="1" || hospitalisation !="1"))
{
v_msg="Attention! Maximum de m\u00e9dicaments atteint!";
v_msgEng="Warning! Maximum drugs reached!";
alert_ebene(v_msg, v_msgEng);
return;
}
var str = controle.split(' <==> ');
var codeMedicament = str[0];
var libelleMedicament = str[1];
var exclu = str[3];
var prixTarif = str[4];
var ententePrealable = str[5];
if(exclu=="Non garanti"){
v_msg="Ce m\u00e9dicament n'est pas rembours\u00e9 par l'assureur!";
v_msgEng="This drug is not reimbursed by the insurer!";
alert_ebene(v_msg, v_msgEng);
}
if(ententePrealable=="Demander Accord"){
ententePrealable=1;
}else{
ententePrealable=0;
}
v_msg="Confirmez-vous cet m\u00e9dicament : "+libelleMedicament+"?";
v_msgEng="Do you confirm these medications : "+libelleMedicament+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeMedicament='+codeMedicament+'&ententePrealable='+ententePrealable;
$("#medicaments").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/ajoutermedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
//$("#div_ajaxgabarit").html(data);
},
complete: function(data) {
prescription_medicament();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeMedicament='+codeMedicament+'&ententePrealable='+ententePrealable;
$("#medicaments").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/ajoutermedicament/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
//$("#div_ajaxgabarit").html(data);
},
complete: function(data) {
debugger;
prescription_medicament();
}
});
}
else
{
return;
}
});
}
}
function add_selected_exam(controle)
{
debugger;
motifExamen = $("#motifExamen").val();
prescriptionSiCritereBareme = $("#prescriptionSiCritereBareme").val();
if (motifExamen<=" ")
{
v_msg="Veuillez entrer le motif de la prescription d'examen!";
v_msgEng="Please enter the reason for the examination prescription!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").val("");
$("#motifExamen").focus();
return;
}else{
var str = controle.split(' <==> ');
var codeActe = str[0];
var libelleActe = str[1];
//var prixTarif = extraitNombre(str[2]);
var codeGarantie = str[2];
var acteExclu = str[3];
var ententePrealable = str[4];
var datePrescription = $("#datePrescription").val();
//alert(prixTarif);
//getstatutacte(codeActe);
var prixTarif = "0";
var statut = isStatut(codeActe);
//alert(prescriptionSiCritereBareme);
//return;
if(statut!='1' && prescriptionSiCritereBareme=="0")
{
v_msg="Cet acte n'est pas autorisé!";
v_msgEng="This act is not allowed!";
alert_ebene(v_msg, v_msgEng);
getstatutacte(codeActe);
$('#searchInput').val('');
$("#div_selection").hide();
return;
}
if(acteExclu=="Garanti"){
acteExclu=0;
}else{
acteExclu=1;
}
if(ententePrealable=="Demander Accord"){
ententePrealable=1;
}else{
ententePrealable=0;
}
if(libelleActe<=" ")
{
$("#codeActe").focus();
return;
}
if(acteExclu==1)
{
v_msg="Acte non couvert!";
v_msgEng="Not covered!";
alert_ebene(v_msg, v_msgEng);
return;
}
//alert(codeGarantie);
//return;
v_msg="Confirmez-vous cet acte : "+libelleActe+"?";
v_msgEng="Do you confirm this act : "+libelleActe+"?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixTarif='+prixTarif;
if (ententePrealable==1)
{
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = donnees+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
}
$("#examens").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/ajouterexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
debugger;
prescription_examen();
},
complete: function(data) {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixTarif='+prixTarif;
$("#examens").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/ajouterexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function(data) {
prescription_examen();
}
});
}
else
{
return;
}
});
}
}
}
function afficheDetailPrescriptionExamen(){
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#examens").html(data);
},
complete: function() {
}
});
}
function generercodereference()
{
var d = new Date();
var date = d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate();
var minNumber = 1; // le minimum
var maxNumber = 100; // le maximum
var randomnumber = Math.floor(Math.random() * (maxNumber + 1) + minNumber); // la fonction magique
$("#codeReference").val(date+'-'+randomnumber);
$("#codeReferencement").val(date+'-'+randomnumber);
$("#dureeCode").val(1);
$("#dureeCode").readable();
maj_beneficiaire();
}
function maj_beneficiaire(){
var codeReference = $("#codeReference").val();
var dureeCode = $("#dureeCode").val();
donnees = 'codeReference='+codeReference+'&dureeCode='+dureeCode;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmajbeneficiaire/majbeneficiaire/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
}
});
}
function imprimer_facture_definitive()
{
debugger;
idFacture = $("#idFacture").val();
if (idFacture>"0")
{
donnees = "idFacture="+idFacture;
var div_export = $('#div_facture_definitive');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturedefinitive/",
type: 'POST',
data: donnees,
success: function(data)
{
div_export.html(data);
//facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
else
{
v_msg="Rien à imprimer!";
v_msgEng="Nothing to print!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
/*
function imprimerbonprescription(numeroBonOrdonnance)
{
var div_wait = $('#div_bonprescription');
var nbMedicamentSaisie = $('#nbMedicamentSaisie').val();
if(nbMedicamentSaisie > 3){
v_msg="Le nombre de m\u00e9dicament \u00e9tant sup\u00e9rieur à 3, n'oubliez pas d'utiliser 2 feuilles de bons!";
v_msgEng="Since the number of medication is greater than 3, don't forget to use 2 voucher sheets!";
alert_ebene(v_msg, v_msgEng);
}
div_wait.html('
' + 'Veuillez patienter...' + ' ');
donnees = "numeroBonOrdonnance="+numeroBonOrdonnance;
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerbonprescrition/",
type: 'POST',
data: donnees,
success: function(data)
{
div_wait.html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
}
});
}
*/
/*
function imprimerbonprescription()
{
var div_wait = $('#div_bonprescription');
codeMedecin = $("#codeMedecin").val();
medecinManquant = $("#medecinManquant").val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#codeMedecin").focus();
return;
}
if (codeMedecin=="ZZZZ" && medecinManquant<=" ")
{
v_msg="Veuillez saisir le nom du m\u00e9decin non enregistr\u00e9!";
v_msgEng="Please enter the name of the non-registered doctor!";
alert_ebene(v_msg, v_msgEng);
$("#medecinManquant").focus();
return;
}
codeFamilleActe=$("#codeFamilleActe").val();
if (codeFamilleActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeFamilleActe").focus();
return;
}
codeActe = $("#codeActe").val();
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
codeRaisonConsultation = $("#codeRaisonConsultation").val();
if (codeRaisonConsultation<=" ")
{
v_msg="Veuillez s\u00e9lectionner une raison pour la consultation!";
v_msgEng="Please select a reason for the consultation!";
alert_ebene(v_msg, v_msgEng);
$("#codeRaisonConsultation").focus();
return;
}
div_wait.html('
' + 'Veuillez patienter...' + ' ');
donnees = "codeMedecin="+codeMedecin+"&medecinManquant="+medecinManquant;
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerbonprescrition/",
type: 'POST',
data: donnees,
success: function(data)
{
div_wait.html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
}
});
}
*/
function imprimerbonprescription()
{
var div_wait = $('#div_export_a');
div_wait.html('
' + "Veuillez patienter..." + ' ');
donnees = "";
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerbonprescrition/",
type: 'POST',
data: donnees,
success: function(data)
{
div_wait.html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
}
});
}
//08-11-2021
function afficheGaranties()
{
masquer = $("#masquer").val();
if(masquer=="1"){
$('#div_garantie').hide();
$("#masquer").val("0");
$("#span_libelle").text("Afficher");
}else{
$('#div_garantie').show();
$("#masquer").val("1");
$("#span_libelle").text("Masquer");
}
}
function afficherficheconsultation()
{
masquerconsulation = $("#masquerconsulation").val();
if(masquerconsulation=="Renseigner la fiche de consultation"){
$('#div_consultation').hide();
$("#masquerconsulation").val("Consultation");
}if(masquerconsulation=="Consultation"){
dateEffetCouvert = $("#dateEffetCouvert").val();
if (dateEffetCouvert!="1")
{
v_msg="Attention! Non renouvel\u00e9";
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())
{
//avecReferencement = $("#avecReferencement").val();
if (prestataireReference=="0")
{
if ($("#codeReferencement").val()==""){
okReferencement="0";
}else{
okReferencement="1";
}
}else{
okReferencement="1";
//window.location.assign($("#racineWeb" ).val()+"Consultation/"+okReferencement);
$('#div_consultation').show();
return;
}
modeSaisieFacture=$("#modeSaisieFacture").val();
if(modeSaisieFacture=="1")
{
$("#okId" ).val("1");
//window.location.assign($("#racineWeb" ).val()+"Consultation/");
$('#div_consultation').show();
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();
if (finger_id==0)
{
v_msg="Veuillez proc\u00e9der à 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\u00e9der à l\'identification avant!";
v_msgEng="Please check identity before!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
//window.location.assign($("#racineWeb" ).val()+"Consultation/");
$('#div_consultation').show();
}
else{
$('#div_consultation').hide();
}
}
}
function imprimer_hospitalisation()
{
numeroBonHospitalisation = $("#numeroBonHospitalisation").val();
if (numeroBonHospitalisation=="0"){
v_msg="Rien à imprimer!";
v_msgEng="Nothing to print!";
alert_ebene(v_msg, v_msgEng);
return;
}
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerbonhospitalisation/",
success: function(data)
{
$("#div_export_a").html(data);
$("#btn_imprimer_hospit").click();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
}
});
}
function ajax_maj_qte_prescrit_examen(idExamen, quantite, controle)
{
donnee_a_affciher = "";
quantite=quantite.replace(",",".");
controle.value=quantite;
fraisTotal = parseInt($("#fraisTotal").val());
montantTotalMedicament = parseInt($("#montantTotalMedicament").val());
codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val();
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
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);
controle.focus();
},
error: function(data) {
},
complete: function() {
prescription_examen();
}
});
}
}
function ajax_affiche_fin_delaicarence(){
codeLangue = $("#codeLangue").val();
plafondAtteint = $("#plafondAtteint").val();
nomForm = $("#nomForm").val();
codeMedecin = $("#codeMedecin").val();
var codeActe = $('#codeActe').val();
var datePrestation = $('#dateSurvenance').val();
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#codeMedecin").focus();
return;
}
if(codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
donnees = 'codeActe='+codeActe;
donnees += '&datePrestation='+datePrestation;
if(plafondAtteint=="1")
{
v_msg="L'assur\u00e9 assumera enti\u00e8rement les frais de consultaion car son plafond est atteint! Souhaitez-vous continuer?";
v_msgEng="The insured will fully assume the consultation costs because his ceiling has been reached! Would you like to continue?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
enregistrerconsultation();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
enregistrerconsultation();
}
else
{
return;
}
});
}
}
else{
$.ajax({
url: $("#racineWeb").val()+"Ajaxaffichedatefindelaicarenceacte/",
type: 'POST',
data: donnees,
success: function(data){
$("#div_findelaicarence").html(data);
var dateFinDelaiCarenceActe = $("#dateFinDelaiCarenceActe").val();
var plafondActe = $("#plafondActe").val().replace(/ /g,"");
var consommation = $("#consommation").val().replace(/ /g,"");
var soldeConsommation = $("#soldeConsommation").val().replace(/ /g,"");
var nbreTransaction = $("#nbreTransaction").val();
var nbreSinistre = $("#nbreSinistre").val();
var soldeNbreTransaction = $("#soldeNbreTransaction").val();
if(dateFinDelaiCarenceActe!="01/01/1970"){
v_msg="Impossible de faire cet acte \u00e0 cause du delai de carence qui est toujours en vigueur pour cet assur\u00e9! Il prendra fin le "+dateFinDelaiCarenceActe+". Merci pour votre compr\u00e9hension!";
v_msgEng="Impossible to do this act because of the deficiency period that is still in force for this insured! It will end on "+dateFinDelaiCarenceActe+". Thank you for your understanding.";
alert_ebene(v_msg, v_msgEng);
//faireDefileMessage(v_msg, v_msgEng);
return;
}else{
if(nomForm=="consultation" || nomForm=="ficheBeneficiaire"){
if(soldeConsommation > "0"){
if(nbreTransaction == "0"){
enregistrerconsultation();
}else{
if(nbreTransaction > "0" && soldeNbreTransaction>"0"){
enregistrerconsultation();
}else{
v_msg="L'assur\u00e9 assumera enti\u00e8rement les frais de consultaion car le seuil de garantie est atteint! Souhaitez-vous continuer?";
v_msgEng="The insured will fully assume the consultaion costs because the guarantee threshold has been reached! Would you like to continue?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
enregistrerconsultation();
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
enregistrerconsultation();
}
else
{
return;
}
});
}
}
}
}else{
v_msg="L'assur\u00e9 a atteint son plafond de garantie pour cet acte. Prise en charge impossible.";
v_msgEng="the insured has reached his limit of cover for this act. Support not possible.";
alert_ebene(v_msg, v_msgEng);
return;
}
}
}
},
error: function(data) {
},
complete: function() {
}
});
}
}
function info_fin_delaicarence(codeActe){
donnees_s = 'codeActe='+codeActe;
$.ajax({
url: $("#racineWeb").val()+"Ajaxaffichedatefindelaicarenceacte/",
type: 'POST',
data: donnees_s,
success: function(data){
$("#div_findelaicarence").html(data);
var dateFinDelaiCarenceActe = $("#dateFinDelaiCarenceActe").val();
if(dateFinDelaiCarenceActe!="01/01/1970"){
v_msg="Le d\u00e9lai de carence est toujours en vigueur sur cet acte. Les frais qui seront g\u00e9n\u00e9r\u00e9s seront enti\u00e8rement \u00e0 la charge du patient. La fin du d\u00e9lai de carence est pr\u00e9vu pour le: "+dateFinDelaiCarenceActe+". Merci pour votre compr\u00e9hension!";
v_msgEng="The waiting period is still in force on this act. The costs that will be generated will be entirely at the expense of the patient. The end of the deficiency period is present for: "+dateFinDelaiCarenceActe+". Thank you for your understanding.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
}
},
error: function(data) {
},
complete: function() {
}
});
}
function faireDefileMessage(p_msg, p_msg_eng){
if(p_msg!=""){
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
$("#div_messages").html('');
}
else
{
$("#div_messages").html('');
}
}else{
$("#div_messages").html('');
}
}
function ajax_demande_accord_pharmacie(){
typeSms="ententeprealable";
donnees = "";
fraisTotal = parseInt($("#fraisTotal").val());
ententePrealable = $("#ententePrealable").val();
montantTotalMedicament = parseInt($("#montantTotalMedicament").val());
if(fraisTotal > montantTotalMedicament){
v_msg="Une demande d'accord pr\u00e9alable a \u00e9t\u00e9 envoy\u00e9e \u00e0 l'assureur car les frais de m\u00e9dicaments prescrits sont sup\u00e9rieurs \u00e0 "+montantTotalMedicament+" Fcfa";
v_msgEng="A request for prior agreement will be sent to the insurer because prescription drug costs are higher than "+montantTotalMedicament;
alert_ebene(v_msg, v_msgEng);
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/accordpharmacie/",
type: 'POST',
data: donnees,
success: function(data){
$("#medicaments").html(data);
if(fraisTotal > montantTotalMedicament){
preparesms(typeSms);
}
},
error: function(data) {
},
complete: function() {
}
});
}
}
function ajax_demande_accord_examen(){
typeSms="ententeprealableexamen";
donnees = "";
fraisTotal = parseInt($("#fraisTotal").val());
ententePrealable = $("#ententePrealable").val();
montantTotalExamen = parseInt($("#montantTotalExamen").val());
codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val();
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
if((fraisTotal > montantTotalExamen) && (codeReponseEntentePrealable=="2")){
v_msg="Une demande d'accord pr\u00e9alable a \u00e9t\u00e9 envoy\u00e9e \u00e0 l'assureur car les frais d'examen sont sup\u00e9rieurs \u00e0 "+montantTotalExamen+" Fcfa";
v_msgEng="A request for prior agreement will be sent to the insurer because the examination fees are higher than "+montantTotalExamen;
alert_ebene(v_msg, v_msgEng);
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/accordexamen/",
type: 'POST',
data: donnees,
success: function(data){
$("#examens").html(data);
if((fraisTotal > montantTotalExamen) && (codeReponseEntentePrealable=="2")){
preparesms(typeSms);
}
},
error: function(data) {
},
complete: function() {
}
});
}
}
// 26-05-2022
function afficheDivPlafond()
{
masquer = $("#masquer").val();
if(masquer=="1"){
$('#div_plafond_beneficiaire').hide();
$("#masquer").val("0");
$("#span_libelle").text("Voir");
}else{
$('#div_plafond_beneficiaire').show();
$("#masquer").val("1");
$("#span_libelle").text("Masquer");
}
}
// 10-06-2022
function addDays(date, days) {
var result = new Date(date);
result.setDate(result.getDate() + days);
return result.toLocaleDateString("fr");
}
function formatDateInput(date){
return date.split('/').reverse().join('-');
}
// 25-10-2022
function ajax_maj_prix_actesmedicaux(idPrestationactes, prix, controle, codeActe, ententePrealable, autorisation)
{
prix=prix.replace(/ /g,"");
controle.value=prix;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
donnees_sav2 = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailautorisation';
//alert(ententePrealable);
//return;
typeSms="ententeprealable";
typeSms2="autorisation";
if(controle_numerique(controle))
{
if(prix==0)
{
controle.focus();
v_msg="Veuillez saisir le tarif!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idPrestationactes='+idPrestationactes+"&prix="+prix;
donnee_a_affciher = "";
donnees = 'idPrestationactes='+idPrestationactes+"&prix="+prix;;
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesmedicauxselect/majprixacte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
maj_fraisexclu_cso();
if(ententePrealable=="2")
{
preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
if(autorisation=="2")
{
preparesms(typeSms2);
v_msg="Demande autorisation envoy\u00e9e!";
v_msgEng="Request for authorization sent!";
alert_ebene(v_msg, v_msgEng);
}
},
error: function(data) {
},
complete: function() {
$("#div_prestations").html(donnee_a_affciher);
controle.focus();
}
});
}
}
//26-10-2022
function formatNumerique(controle){
controle.value = controle.value.replace(/ /g,"");
return;
}
//28-10-2022
function messageSituationHospitalisation(){
var optionHospitalisation = $("#optionHospitalisation").val();
if(optionHospitalisation == "option-1"){
codeActe = "HHM";
}else if (optionHospitalisation == "option-3"){
codeActe = "HHC";
}else{
codeActe = "";
}
getstatutacte(codeActe);
var donnees = 'codeActe='+codeActe;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsituationhospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#div_reponse").html(data);
},
complete: function(data)
{
}
});
}
function avishospitalisation()
{
//
motifHospitalisation = $("#motifHospitalisation").val();
dureeHospit = $("#dureeHospit").val();
dateDebutHospit = $("#dateDebutHospit").val();
optionHospitalisation = $("#optionHospitalisation").val();
modeSaisieFacture = $("#modeSaisieFacture").val();
codeActeChambreHospit = $("#codeActeChambreHospit").val();
//typeSms = "hospitalisation";
if (motifHospitalisation <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#motifHospitalisation").focus();
return;
}
if (optionHospitalisation <= " ")
{
v_msg="Veuillez renseigner le type d'hospitalisation!";
v_msgEng="Please fill in the type of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#optionHospitalisation").focus();
return;
}
if (codeActeChambreHospit <= " ")
{
v_msg="Veuillez renseigner le type de chambre!";
v_msgEng="Please enter the room type!";
alert_ebene(v_msg, v_msgEng);
$("#codeActeChambreHospit").focus();
return;
}
if (dateDebutHospit<=" ")
{
v_msg="Veuillez saisir la date de d\u00e9but!";
v_msgEng="Please enter the start date!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebutHospit").focus();
return;
}
if (dureeHospit == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#dureeHospit").focus();
return;
}
//alert(typeSms);
donnees = 'motifHospitalisation='+motifHospitalisation;
donnees += '&dureeHospit='+dureeHospit+'&dateDebutHospit='+dateDebutHospit;
donnees += '&optionHospitalisation='+optionHospitalisation+'&codeActeChambreHospit='+codeActeChambreHospit;
if (optionHospitalisation=="option-1"){
codeActe = "HHM";
}
if (optionHospitalisation=="option-3"){
codeActe = "HHC";
}
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
//donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&quantite='+dureeHospit+'&motifHospit='+motifHospitalisation+'&typeMail=mailententeprealable';
//alert(donnees);return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerchambre/majavishospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
/*if(modeSaisieFacture=="0"){
preparesms(typeSms);
}*/
v_msg="Avis d'hospitalisation envoy\u00e9 avec succ\u00e8s, merci de patienter un instant pour la suite...";
v_msgEng="Hospitalization notice sent successfully, please wait a moment for the rest...";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
},
complete: function() {
/*if(modeSaisieFacture=="0"){
mettremailattente(donnees_sav);
}*/
}
});
}
function modidieravishospitalisation()
{
//
motifHospitalisation = $("#motifHospitalisation").val();
dureeHospit = $("#dureeHospit").val();
dateDebutHospit = $("#dateDebutHospit").val();
optionHospitalisation = $("#optionHospitalisation").val();
modeSaisieFacture = $("#modeSaisieFacture").val();
codeActeChambre = $("#codeActeChambreHospit").val();
if (motifHospitalisation <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#motifHospitalisation").focus();
return;
}
if (optionHospitalisation <= " ")
{
v_msg="Veuillez renseigner le type d'hospitalisation!";
v_msgEng="Please fill in the type of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#optionHospitalisation").focus();
return;
}
if (codeActeChambre <= " ")
{
v_msg="Veuillez renseigner le type de chambre!";
v_msgEng="Please enter the room type!";
alert_ebene(v_msg, v_msgEng);
$("#codeActeChambreHospit").focus();
return;
}
if (dateDebutHospit<=" ")
{
v_msg="Veuillez saisir la date de d\u00e9but!";
v_msgEng="Please enter the start date!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebutHospit").focus();
return;
}
if (dureeHospit == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#dureeHospit").focus();
return;
}
//alert(typeSms);
donnees = 'motifHospitalisation='+motifHospitalisation;
donnees += '&dureeHospit='+dureeHospit+'&dateDebutHospit='+dateDebutHospit;
donnees += '&optionHospitalisation='+optionHospitalisation+'&codeActeChambre='+codeActeChambre;
//alert(donnees);
if (optionHospitalisation=="option-1"){
codeActe = "HHM";
}
if (optionHospitalisation=="option-3"){
codeActe = "HHC";
}
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
//donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&quantite='+dureeHospit+'&motifHospit='+motifHospitalisation+'&typeMail=mailententeprealable';
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerchambre/majavishospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
v_msg="Avis d'hospitalisation modifi\u00e9 avec succ\u00e8s, merci de patienter un instant pour la suite...";
v_msgEng="Notice of hospitalization successfully modified, please wait a moment for the rest...";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
},
complete: function() {
}
});
}
function afficheReponseAvis(){
var avisHospitalisation = $('#avisHospitalisation').val();
console.log(avisHospitalisation);
$.ajax({
url: $("#racineWeb").val()+"Ajaxreponseavis/",
success: function(data)
{
//$("#div_reponse").html('');
$("#div_reponse").html(data);
},
error: function(errorData) {
},
complete: function(data)
{
}
});
}
function creerbonhospitalisation()
{
codeGestionBon = "2";
numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val();
motifHospitalisation = $("#motifHospitalisation").val();
numeroBon = "-1";
donnees = 'numeroBon='+numeroBon+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&motifHospitalisation='+motifHospitalisation;
donnees += '&codeGestionBon='+codeGestionBon;
var div_patientez = $('#div_patientez');
div_patientez.html('
' + "Veuillez patienter...Bon d'hospitalisation en création" + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/enregistrerhospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
// $("#msgErreur").html(errorData);
},
success: function(data)
{
//attribution_chambre();
},
complete: function()
{
attribution_chambre();
}
});
}
function enregistrerTypeHospitalisation(type){
donnees = "type="+type;
var div_wait = $('#div_famille_acte');
div_wait.html('
' + "Veuillez patienter..." + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectfamilleactehospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
// alert("Erreur : "+errorData);
},
success: function(data) {
$("#div_famille_acte").html(data);
$("#codeFamilleActe").selectpicker();
var codeFamilleActe = $('#codeFamilleActe').val();
if(codeFamilleActe=="" || codeFamilleActe==undefined){
var nbreProlongation = parseInt($("#nbreProlongation").val());
if(nbreProlongation==undefined){
nbreProlongation = 0;
}
cach();
if(nbreProlongation > "0"){
for (let pas = 1; pas <= nbreProlongation; pas++) {
cachLigneTab(pas);
}
}
return false;
}else{
//ajaxactespossibles_selection_hospitalisation();
}
},
complete: function() {
}
});
}
function ajaxactespossibles_selection_hospitalisation()
{
var codeFamilleActe = "FA100";
donnees = 'codeFamilleActe='+codeFamilleActe;
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicauxhospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#totam_donnees").html(data);
appliquerDataTable();
$(".datepicker" ).datepicker();
cach();
var noChambre = $("#noChambre").val();
if (noChambre<=" ")
{
v_msg="Veuillez entrer le numero de chambre!";
v_msgEng="Please enter the room number!";
alert_ebene(v_msg, v_msgEng);
$("#noChambre").focus();
return;
}
var nbreProlongation = parseInt($("#nbreProlongation").val());
if(nbreProlongation > "0"){
for (let pas = 1; pas <= nbreProlongation; pas++) {
cachLigneTab(pas);
//alert($("#noChambrePro"+pas).val());
if ($("#noChambrePro"+pas).val()<=" ")
{
v_msg="Veuillez entrer le numero de chambre!";
v_msgEng="Please enter the room number!";
alert_ebene(v_msg, v_msgEng);
$("#noChambrePro"+pas).focus();
return;
}
}
}
},
complete: function() {
//prestations_hospitalisation();
afficherPlafondHospitalisation();
ajax_btn_avishospitalisation();
}
});
}
function afficherPlafondHospitalisation()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxmajplafondhospitalisation/",
success: function(data)
{
$("#div_plafond_beneficiaire").html(data);
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
}
});
}
function examenhospitalisation(libelle)
{
var donnees = 'libelle='+ libelle;
//alert(donnees); return;
vLink = "Ajaxchargeractesexamenhospitalisation/";
$.ajax({
type: "POST",
url: $("#racineWeb").val()+vLink,
data:donnees,
beforeSend: function(){
$("#searchInput").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px");
},
success: function(data){
$("#div_selection").show();
$("#div_selection").html(data);
$("#searchInput").css("background","#FFF");
}
});
}
function add_selected_exam_hosp(controle)
{
codeLangue = $("#codeLangue").val();
/*typeSms="ententeprealableexamen";*/
var str = controle.split(' <==> ');
/*
alert(str);
return;
*/
var codeActe = str[0];
var libelleActe = str[1];
var prixTarif = 0;
var acteExclu = str[3];
var ententePrealable = 0;
if(acteExclu=="Garanti"){
acteExclu=0;
}else{
acteExclu=1;
}
if(libelleActe<=" ")
{
$("#codeActe").focus();
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+"?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixTarif='+prixTarif+'&acteExclu='+acteExclu;
//info_fin_delaicarence(codeActe);
if (ententePrealable==2)
{
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = donnees+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
}
$("#div_prestations").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxchargeractesexamenhospitalisation/ajouterexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
ajaxactespossibles_selection_hospitalisation();
},
complete: function(data) {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixTarif='+prixTarif+'&acteExclu='+acteExclu;
//info_fin_delaicarence(codeActe);
if (ententePrealable==2)
{
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = donnees+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
}
$("#div_prestations").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxchargeractesexamenhospitalisation/ajouterexamen/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
ajaxactespossibles_selection_hospitalisation();
},
complete: function(data) {
$("#searchInput").val('');
}
});
}
else
{
return;
}
});
}
}
function majMotifProlongation(){
motifProlongation = $("#motifProlongation").val();
donnees = 'motifProlongation='+motifProlongation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/majmotifprolongation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
},
complete: function()
{
}
});
}
function affiche_prestations_prolongation(idProlongation, ligne)
{
donnees = 'idProlongation='+idProlongation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxprestationsprolongation/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_prestations_prolongation"+ligne).html(data);
var nbreProlongation = parseInt($("#nbreProlongation").val());
var noChambrePro = $("#noChambrePro").val();
if(noChambrePro!=undefined && noChambrePro<=" ")
{
v_msg="Veuillez entrer le numero de chambre de prorogation!";
v_msgEng="Please enter the extension room number!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(nbreProlongation > "0"){
for (let pas = 1; pas <= nbreProlongation; pas++) {
cachLigneTab(pas);
}
}
},
error: function(data) {
},
complete: function() {
}
});
}
function aff()
{
$('#cach').show();
$('#aff').hide();
tr_type = document.getElementById('tr_type');
tr_motif = document.getElementById('tr_motif');
tr_instruction = document.getElementById('tr_instruction');
tr_type.style.display = "";
tr_motif.style.display = "";
tr_instruction.style.display = "";
}
function cach()
{
//debugger;
$('#cach').hide();
$('#aff').show();
numeroBon = $("#numeroBon").val();
if(numeroBon > "0") {
tr_type = document.getElementById('tr_type');
tr_motif = document.getElementById('tr_motif');
tr_instruction = document.getElementById('tr_instruction');
tr_type.style.display = "none";
tr_motif.style.display = "none";
tr_instruction.style.display = "none";
}
}
function affLigneTab(ligne)
{
$('#cach'+ligne).show();
$('#aff'+ligne).hide();
tr_type = document.getElementById('tr_type'+ligne);
tr_motif = document.getElementById('tr_motif'+ligne);
tr_instruction = document.getElementById('tr_instruction'+ligne);
tr_type.style.display = "";
tr_motif.style.display = "";
tr_instruction.style.display = "";
}
function cachLigneTab(ligne)
{
$('#cach'+ligne).hide();
$('#aff'+ligne).show();
tr_type = document.getElementById('tr_type'+ligne);
tr_motif = document.getElementById('tr_motif'+ligne);
tr_instruction = document.getElementById('tr_instruction'+ligne);
tr_type.style.display = "none";
tr_motif.style.display = "none";
tr_instruction.style.display = "none";
}
function majChambreHospitalisation()
{
var noChambre = $("#noChambre").val();
donnees = 'noChambre='+noChambre;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/majnochambre/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
attribution_chambre();
},
complete: function()
{
}
});
}
function majChambreProrogation(idProlongation, noChambrePro)
{
donnees = 'idProlongation='+idProlongation+'&noChambrePro='+noChambrePro;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/majChambreProrogation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
//ajaxactespossibles_selection_hospitalisation();
},
complete: function()
{
}
});
}
function extraitNombre(str){
return Number(str.replace(/[^\d]/g, ""))
}
function enregistrer_nv_consommables_hospit()
{
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\u00e9rique exig\u00e9e!";
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\u00e9!";
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\u00e9rique exig\u00e9e!";
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;
$("#div_patienter_consommable").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteconsommables/creerconsommablehospit/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
attribution_chambre();
}
});
}
function print_hospitalisation()
{
$('#div_export_a').html('');
$("#btn_imprimer_chambre").click();
}
function imprimer_bon_pec_hospitalisation()
{
nomForm = $("#nomForm").val();
donnees_retour = "";
donnees = "nomForm="+nomForm;
$('#div_export_a').html('');
var div_export = $('#div_export_a');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturehospitalisation/bonpec/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
div_export.html(donnees_retour);
}
});
}
function imprimer_facture_hospitalisation()
{
donnees_retour = "";
$('#div_export_a').html('');
var div_export = $('#div_export_a');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturehospitalisation/",
success: function(data)
{
donnees_retour = data;
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
div_export.html(donnees_retour);
}
});
}
//01-11-2022
function selectionner_tous_hospitalisation()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxfacturepartielle/selectionnertoushospit/",
type: 'POST',
data: donnees,
success: function(data) {
//$("#div_liste_actes").html(data);
//facturepartielle();
},
error: function(data) {
},
complete: function() {
}
});
}
function test()
{
v_msg="Confirmez-vous le test?";
v_msgEng="Do you confirm this test?";
if (confirm_ebene(v_msg, v_msgEng)){
console.log('ok');
}else{
console.log('false');
}
}
function specialite_medecin()
{
debugger;
donnees_retour = "";
codeSpecialite = $("#codeSpecialite").val();
dureeVieBon = parseInt($("#dureeVieBon").val());
agemaxipediatrie = parseInt($("#agemaxipediatrie").val());
donnees = 'codeSpecialite='+codeSpecialite;
//alert(donnees);
//return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxspecialitemedecin/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
donnees_retour = data;
},
error: function(data) {
},
complete: function() {
debugger;
$("#div_medecin").html(donnees_retour);
$(".selectpicker").selectpicker();
specialiteEstPossible = $("#specialiteEstPossible").val();
if(specialiteEstPossible == "1"){
ajaxprixacte();
}else if(specialiteEstPossible == "2"){
v_msg="Attention, ce patient n'a pas moins de "+agemaxipediatrie+" ans! Il ne peut pas faire cette consultation, veuiller changer l'acte ou la sp\u00e9cialit\u00e9.";
v_msgEng="Attention, this patient is not less than "+agemaxipediatrie+" years old! He cannot do this consultation, please change the act or specialty.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
$("#codeActe").focus();
vider_medecin();
$("#infosacte").html('');
return;
}else if(specialiteEstPossible == "0"){
v_msg="La derni\u00e8re consultation du patient pour cette sp\u00e9cialit\u00e9 date de moins de "+dureeVieBon+" jours. Veuiller la changer ou passer en consultation gratuite.";
v_msgEng="The patient's last consultation for this specialty was less than "+dureeVieBon+" days ago. Please change it or have a free consultation.";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
vider_medecin();
$("#infosacte").html('');
return;
}
}
});
}
function majDebutHospitalisation()
{
var dateDebutHospit = $("#dateDebutHospit").val();
var dureeHospit = $("#dureeHospit").val();
var dureeCorrigeeHospit = $("#dureeCorrigeeHospit").val();
donnees = 'dateDebutHospit='+dateDebutHospit;
donnees += '&dureeHospit='+dureeHospit;
donnees += '&dureeCorrigeeHospit='+dureeCorrigeeHospit;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/majdebut/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
//ajaxactespossibles_selection_hospitalisation();
},
complete: function()
{
}
});
}
function majDureeHospitalisation()
{
var dureeHospit = $("#dureeHospit").val();
var dateDebutHospit = $("#dateDebutHospit").val();
if(dateDebutHospit==""){
v_msg="Veuillez saisir la date de début de l'hospitalisation!";
v_msgEng="Please enter the start date of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebutHospit").focus();
return;
}
donnees = 'dureeHospit='+dureeHospit;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/majduree/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
//$("#div_datefin").html(data);
//majTypeHospitalisation();
//prestations_hospitalisation();
},
complete: function()
{
}
});
}
function majTypeHospitalisation()
{
var optionHospitalisation = $("#optionHospitalisation").val();
donnees = 'optionHospitalisation='+optionHospitalisation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerhospitalisation/majoptionhospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
//ajaxactespossibles_selection_hospitalisation();
},
complete: function()
{
}
});
}
//03-03-2023
function getsourcebaremegarantie(codeGarantie, datePrestation)
{
donnees = 'codeGarantie='+codeGarantie;
donnees += '&datePrestation='+datePrestation;
//alert(donnees);
//return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsourcebareme/sourcebaremegarantie/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
actualiserInfosBareme();
},
complete: function()
{
}
});
}
function getsourcebareme(codeActe, datePrestation)
{
donnees = 'codeActe='+codeActe;
donnees += '&datePrestation='+datePrestation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxsourcebareme/sourcebareme/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
actualiserInfosBareme();
},
complete: function()
{
}
});
}
function actualiserInfosBareme()
{
donnees = '';
$("#div_infos_baremegarantie").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxsourcebareme/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#div_infos_baremegarantie").html(data);
var statut = $("#statut").val();
alert_bareme_statut(statut);
},
complete: function()
{
}
});
}
//10-03-2023
function ajax_afficher_beneficiaire()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxfichebeneficiaire/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#div_beneficiaire").html(data);
$("#codeMedecin").selectpicker();
$("#codeActe").selectpicker();
},
complete: function()
{
}
});
}
//22-03-2023
function alert_bareme()
{
baremeExiste = $("#baremeExiste").val();
bareme_actif = $("#bareme_actif").val();
ageBeneficiaire = parseInt($("#ageBeneficiaire").val());
ageMinimum = parseInt($("#ageMinimum").val());
ageMaximum = parseInt($("#ageMaximum").val());
bareme_codeTypeRemboursement = $("#bareme_codeTypeRemboursement").val();
soldeConsommationFamilleAct = $("#soldeConsommationFamilleAct").val();
soldeConsommationAct = $("#soldeConsommationAct").val();
soldeConsommationFamilleGar = $("#soldeConsommationFamilleGar").val();
soldeConsommationGar = $("#soldeConsommationGar").val();
soldeNbreTransactionFamilleAct = $("#soldeNbreTransactionFamilleAct").val();
soldeNbreTransactionAct = $("#soldeNbreTransactionAct").val();
soldeNbreTransactionFamilleGar = $("#soldeNbreTransactionFamilleGar").val();
soldeNbreTransactionGar = $("#soldeNbreTransactionGar").val();
if(soldeConsommationFamilleAct<="0" || soldeConsommationAct<="0" || soldeConsommationFamilleGar<="0"
|| soldeConsommationGar<="0" || soldeNbreTransactionFamilleAct<="0" || soldeNbreTransactionAct<="0"
|| soldeNbreTransactionFamilleGar<="0" || soldeNbreTransactionGar<="0")
{
v_msg="Impossible de s\u00e9lectionner cet acte! Le solde du plafond ou du nombre de transaction est nul!";
v_msgEng="Unable to select this act! The balance of the ceiling or number of transactions is zero!";
alert_ebene(v_msg, v_msgEng);
//faireDefileMessage(v_msg, v_msgEng);
return;
}
if(baremeExiste == "0")
{
v_msg="Aucun bar\u00e8me n'existe, veuillez en informer "+nomSociete+" afin que cel\u00e0 soit corrig\u00e9.";
v_msgEng="No scale exists, please inform "+nomSociete+" so that this can be corrected.";
alert_ebene(v_msg, v_msgEng);
//faireDefileMessage(v_msg, v_msgEng);
return;
}
if(bareme_actif == "0")
{
v_msg="Il n'y a pas de bar\u00e8me de garantie actif \u00e0 cette date, veuillez en informer "+nomSociete+" afin que cel\u00e0 soit corrig\u00e9.";
v_msgEng="There is no active guarantee schedule on this date, please inform "+nomSociete+" so that this can be corrected.";
alert_ebene(v_msg, v_msgEng);
//faireDefileMessage(v_msg, v_msgEng);
return;
}
if((ageMinimum > "0" && ageMaximum > "0") && (ageBeneficiaire < ageMinimum || ageBeneficiaire > ageMaximum))
{
v_msg="L'\u00e2ge du patient n'est pas pris en compte dans le bar\u00e8me de garantie!";
v_msgEng="The age of the insured is not taken into account in the warranty schedule!";
alert_ebene(v_msg, v_msgEng);
//faireDefileMessage(v_msg, v_msgEng);
return;
}
if(bareme_codeTypeRemboursement == "RDE")
{
v_msg="L'assur\u00e9 est en remboursement direct pour cette garantie. Il devra enti\u00e8rement payer la prestation et se faire rembourser par "+nomSociete+"!";
v_msgEng="The insured is in direct reimbursement for this guarantee. He will have to fully pay for the service and be reimbursed by "+nomSociete+"!";
alert_ebene(v_msg, v_msgEng);
//faireDefileMessage(v_msg, v_msgEng);
return;
}
}
function alert_bareme_statut(statut)
{
if(statut == "0")
{
v_msg="Le bar\u00e8me n'existe pas ou il est inactif!";
v_msgEng="The scale does not exist or it is inactive!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if(statut == "2")
{
v_msg="Le patient est en remboursement direct exclusif (RDE) pour cette garantie!";
v_msgEng="The patient is in exclusive direct reimbursement (DDR) for this benefit!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if(statut=="3")
{
v_msg="L'\u00e2ge du patient n'est pas pris en compte dans le bar\u00e8me!";
v_msgEng="The age of the patient is not taken into account in the scale!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if(statut=="4")
{
v_msg="Le d\u00e9lai de carence est toujours en vigueur sur cette garantie!";
v_msgEng="The waiting period is still in effect on this guarantee!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if(statut=="5")
{
v_msg="Le solde du plafond ou du nombre de prestations de la famille ou du patient est nul!";
v_msgEng="The balance of the ceiling or the number of benefits of the family or the patient is zero!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else if(statut=="7")
{
v_msg="Le plafond annuelle du patient est atteint!";
v_msgEng="The annual patient ceiling has been reached!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}else{
faireDefileMessage("", "");
}
}
function isNumeric(num){
return !isNaN(parseInt(num)) && isFinite(num);
}
function getstatutacte(codeActe="")
{
debugger;
if(codeActe==""){
codeActe = $("#codeActe").val();
}
datePrestation = $('#dateSurvenance').val();
donnee_a_affciher = "";
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
donnees = 'codeActe='+codeActe+'&datePrestation='+datePrestation;
//alert(donnees);
$.ajax({
url: $("#racineWeb").val()+"Ajaxstatutacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnee_a_affciher = data;
},
complete: function() {
debugger;
$("#div_statutacte").html(donnee_a_affciher);
var statut = $("#statut").val();
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
faireDefileMessage(libelleMotif, libelleMotifEng);
}
});
}
function isStatut(codeActe)
{
debugger;
var myVar = '';
if(codeActe==""){
codeActe = $("#codeActe").val();
}
datePrestation = $('#dateSurvenance').val();
donnee_a_affciher = "";
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
donnees = 'codeActe='+codeActe+'&datePrestation='+datePrestation;
//alert(donnees);
$.ajax({
url: $("#racineWeb").val()+"Ajaxstatutacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
async: false,
success: function(data) {
donnee_a_affciher = data;
},
complete: function() {
debugger;
$("#div_statutacte").html(donnee_a_affciher);
var statut = $("#statut").val();
myVar = statut;
}
});
return myVar;
}
function enregistrer_consultation()
{
debugger;
codeActe = $("#codeActe").val();
nomForm = $('#nomForm').val();
datePrestation = $('#dateSurvenance').val();
codeMedecin = $("#codeMedecin").val();
medecinManquant = $("#medecinManquant").val();
dateEffetCouvert= $("#dateEffetCouvert").val();
codeActeConsultationGratuite = $("#codeActeConsultationGratuite").val();
if (dateEffetCouvert!="1")
{
v_msg="Attention! Non renouvel\u00e9";
v_msgEng="Warning! Not renewed";
alert_ebene(v_msg, v_msgEng);
return;
}
fingerActif = $("#fingerActif" ).val();
faceActif = $("#faceActif").val();
if (prestation_possible())
{
if (prestataireReference=="0")
{
if ($("#codeReferencement").val()==""){
okReferencement="0";
}else{
okReferencement="1";
}
}else{
okReferencement="1";
}
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();
faceRegistered = $("#faceRegistered").val();
if( (fingerActif=='1' && finger_id==0) || (faceActif=='1' && faceRegistered!="1") )
{
v_msg="Veuillez proc\u00e9der à 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( (fingerActif=='1' && okId!=1) || (faceActif=='1' && okId_face!=1) )
{
v_msg="Veuillez proc\u00e9der à l\'identification avant!";
v_msgEng="Please check identity before!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
}
if (codeActe<=" ")
{
v_msg="Veuillez s\u00e9lectionner un acte!";
v_msgEng="Please select an act!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
if (codeSpecialite<=" ")
{
v_msg="Veuillez s\u00e9lectionner une sp\u00e9cialit\u00e9!";
v_msgEng="Please select a specialty!";
alert_ebene(v_msg, v_msgEng);
$("#codeSpecialite").focus();
return;
}
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un praticien!";
v_msgEng="Please select a practitioner!";
alert_ebene(v_msg, v_msgEng);
$("#codeMedecin").focus();
return;
}
if (codeMedecin=="ZZZZ" && medecinManquant<=" ")
{
v_msg="Veuillez saisir le nom du praticien non enregistr\u00e9!";
v_msgEng="Please enter the name of the non-registered practitioner!";
alert_ebene(v_msg, v_msgEng);
$("#medecinManquant").focus();
return;
}
bonPrincipal = $("#bonPrincipal").val();
autoriserUnBonPrincipal = $("#autoriserUnBonPrincipal").val();
if(codeActe == codeActeConsultationGratuite && $("#prixActe").val() == "0" && autoriserUnBonPrincipal == "1"){
if(bonPrincipal=="0")
{
v_msg="Veuillez entrer le numéro du bon principal!";
v_msgEng="Please enter the main voucher number!";
alert_ebene(v_msg, v_msgEng);
$("#bonPrincipal").focus();
return;
}
}
donnee_a_affciher = "";
donnees = 'codeActe='+codeActe+'&datePrestation='+datePrestation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxstatutacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnee_a_affciher = data;
},
complete: function() {
debugger;
$("#div_statutacte").html(donnee_a_affciher);
var statut = $("#statut").val();
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
if(statut != "1")
{
alert_ebene(libelleMotif, libelleMotifEng);
faireDefileMessage(libelleMotif, libelleMotifEng);
//conserver_infos_consultation();
return;
}else{
faireDefileMessage("", "");
if(nomForm == "ficheBeneficiaire")
{
enregistrerconsultation();
}else{
enregistrerconsultationassureur();
}
}
}
});
}
//28-05-2023
function actualiseTauxCouverture()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxactualisetauxcouverture/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_taux").html(data);
},
complete: function() {
}
});
}
//Modifier par sorel le 29-05-2023
function ajouter_un_acte_selection(codeActe, prixBase, prixActe, ententePrealable)
{
donnee_a_affciher = "";
codeFamilleActeMed = $("#codeFamilleActeMed").val();
datePrestation = $("#datePrestation").val();
codeFamilleActe=$("#codeFamilleActe").val();
donnees=""
donnees_sav="";
modeSaisieFacture=$("#modeSaisieFacture").val();
codeMedecin = $("#codeMedecin").val();
if(prixActe==0)
{
v_msg="Veuillez faire enregistrer votre tarif!";
v_msgEng="Please register your rate!";
alert_ebene(v_msg, v_msgEng);
return;
}
motifActe=$("#motifActe").val();
v_msg="Confirmez-vous cet acte?";
v_msgEng="Do you confirm this act?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(ententePrealable==1)
{
ententePrealable = "2";
/*
if (motifActe <=" "){
v_msg="L'acte est soumis \u00e0 une entente pr\u00e9alable! Veuillez entrer un motif afin que votre demande soit envoy\u00e9e \u00e0 l'assureur.";
v_msgEng="The act is subject to prior agreement! Please enter a reason for your request to be sent to the insurer.";
alert_ebene(v_msg, v_msgEng);
$("#motifActe").focus();
return;
}
*/
}
donnees = 'codeFamilleActe='+codeFamilleActe+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixActe='+prixActe+'&prixBase='+prixBase+'&motifActe='+motifActe;;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
//typeSms="ententeprealable";
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicaux/enregistreractemedical/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
/*
if(ententePrealable=="2" && (codeFamilleActe!="FA009"))
{
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
*/
donnee_a_affciher = data;
},
complete: function() {
/*
if(ententePrealable=="2" && (codeFamilleActe!="FA009"))
{
mettremailattente(donnees_sav);
}
*/
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
majgestionacte();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
if(ententePrealable==1)
{
ententePrealable = "2";
/*
if (motifActe <=" "){
v_msg="L' acte est soumis \u00e0 une entente pr\u00e9alable! Veuillez entrer un motif afin que votre demande soit envoy\u00e9e \u00e0 l'assureur.";
v_msgEng="The act is subject to prior agreement! Please enter a reason for your request to be sent to the insurer.";
alert_ebene(v_msg, v_msgEng);
$("#motifActe").focus();
return;
}
*/
}
donnees = 'codeFamilleActe='+codeFamilleActe+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixActe='+prixActe+'&prixBase='+prixBase+'&motifActe='+motifActe;;
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable';
//typeSms="ententeprealable";
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicaux/enregistreractemedical/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
/*
if(ententePrealable=="2" && (codeFamilleActe!="FA009"))
{
if(modeSaisieFacture=="0"){
preparesms(typeSms);
}
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
}
*/
donnee_a_affciher = data;
},
complete: function() {
/*
if(ententePrealable=="2" && (codeFamilleActe!="FA009"))
{
if(modeSaisieFacture=="0"){
mettremailattente(donnees_sav);
}
}
*/
$("#totam_donnees").html(donnee_a_affciher);
appliquerDataTable();
majgestionacte();
}
});
}
else
{
return;
}
});
}
}
//Ajouter par sorel le 30-05-2023
function verifie_statut_acte_selection(codeActe, prixBase, prixActe, ententePrealable)
{
datePrestation = $("#datePrestation").val();
nomForm = $("#nomForm").val();
donnees = "codeActe="+codeActe+"&datePrestation="+datePrestation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxstatutacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_statutacte").html(data);
var statut = $("#statut").val();
if(statut=="1"){
if(nomForm=="frmactesmedicaux"){
ajouter_un_acte_selection(codeActe, prixBase, prixActe, ententePrealable);
}else if(nomForm=="miseEnObservation"){
ajouter_un_acte_miseenobservation(codeActe, prixBase, prixActe, ententePrealable);
}
}else{
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
alert_ebene(libelleMotif, libelleMotifEng);
faireDefileMessage(libelleMotif, libelleMotifEng);
return;
}
},
complete: function() {
}
});
}
//06-06-2023
function ajax_btn_avishospitalisation()
{
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxbtnavishospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_btn_avis").html(data);
},
complete: function() {
}
});
}
//07-06-2023
function majgestionacte(){
nbreActesPrescrits = $("#nbreActesPrescrits").val();
donnees = "nbreActesPrescrits="+nbreActesPrescrits;
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicaux/majgestionacte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
}
});
}
// 1 - modifieravisprorogationhospitalisation()
// 0 - avisprorogationhospitalisation()
function verifiestatutprorogationhospitalisation(id, codeTypeHospitalisationPro)
{
motifProlongation = $("#motifProlongation").val();
quantite = $("#quantite").val();
datePrestation = $("#debut").val();
codeActeChambre = $("#codeActeChambre").val();
if (motifProlongation <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#motifProlongation").focus();
return;
}
/*
if (codeTypeHospitalisationPro <= " ")
{
v_msg="Veuillez renseigner le type d'hospitalisation!";
v_msgEng="Please fill in the type of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#codeTypeHospitalisationPro").focus();
return;
}
*/
if (codeActeChambre <= " ")
{
v_msg="Veuillez renseigner le type de chambre!";
v_msgEng="Please enter the room type!";
alert_ebene(v_msg, v_msgEng);
$("#codeActeChambre").focus();
return;
}
if (quantite == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#quantite").focus();
return;
}
if(codeTypeHospitalisationPro == "option-1"){
codeActe = "HHM";
}else if (codeTypeHospitalisationPro == "option-3"){
codeActe = "HHC";
}else{
codeActe = "";
}
donnees = "codeActe="+codeActe+"&datePrestation="+datePrestation;
$.ajax({
url: $("#racineWeb").val()+"Ajaxstatutacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_statutacte").html(data);
var statut = $("#statut").val();
if(statut=="1"){
if(id=="0"){
avisprorogationhospitalisation();
}else if(id=="1"){
modifieravisprorogationhospitalisation();
}
}else{
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
alert_ebene(libelleMotif, libelleMotifEng);
return;
}
},
complete: function() {
}
});
}
function avisprorogationhospitalisation()
{
//
motifProlongation = $("#motifProlongation").val();
quantite = $("#quantite").val();
debut = $("#debut").val();
codeTypeHospitalisationPro = $("#codeTypeHospitalisationPro").val();
dateDebutPro = $("#dateDebutPro").val();
dateJour = $("#dateJour").val();
optionHospitalisationPro= $("#optionHospitalisationPro").val();
idProlongation = $("#idProlongation").val();
prixChambre = $("#prixChambre").val();
prixChambreProlongation = $("#prixChambreProlongation").val();
codeActeChambre = $("#codeActeChambre").val();
if (idProlongation==undefined || idProlongation == "0") {
if (prixChambre==undefined || prixChambre == "0")
{
v_msg="Prorogation impossible! Vous n'avez pas saisi de prix de la derni\u00e8re chambre d'hospitalisation.";
v_msgEng="Impossible extension! You did not enter a price for the last hospital room.";
alert_ebene(v_msg, v_msgEng);
$("#btn_close_pop").click();
return;
}
}else{
if (prixChambreProlongation==undefined || prixChambreProlongation == "0")
{
v_msg="Prorogation impossible! Vous n'avez pas saisi de prix pour la derni\u00e8re chambre d'hospitalisation.";
v_msgEng="Impossible extension! You did not enter a price for the last hospital room.";
alert_ebene(v_msg, v_msgEng);
$("#btn_close_pop").click();
return;
}
}
var td0 = new Date(dateDebutPro);
var tdj = new Date(dateJour);
dt0=Math.round(Date.parse(td0)/(1000*3600*24));
dtj=Math.round(Date.parse(tdj)/(1000*3600*24));
//alert('dateDebutPro ='+dt0+' dateJour='+dtj);
//return;
if(codeTypeHospitalisationPro == optionHospitalisationPro){
if (dtj < dt0)
{
v_msg="Prorogation impossible! Veuillez attendre la fin de l'hospitalisation en cours avant de la proroger.";
v_msgEng="Extension not possible! Please wait until the end of the current hospitalization before extending it.";
alert_ebene(v_msg, v_msgEng);
return false;
}
}
//alert("dateDebutPro="+dateDebutPro+", dateJour="+dateJour); return;
donnees = 'motifProlongation='+motifProlongation;
donnees += '&quantite='+quantite+'&debut='+debut;
donnees += '&codeTypeHospitalisationPro='+codeTypeHospitalisationPro;
donnees += '&codeActeChambre='+codeActeChambre;
if (codeTypeHospitalisationPro=="option-1"){
codeActe = "HHM";
}
if (codeTypeHospitalisationPro=="option-3"){
codeActe = "HHC";
}
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
//donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&quantite='+quantite+'&motifHospit='+motifProlongation+'&typeMail=mailententeprealable';
//typeSms = "hospitalisation";
//alert(donnees); return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerchambre/avisprorogationhospit/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
//preparesms(typeSms);
//alertsmsavis(typeSms);
v_msg="Avis de prorogation d'hospitalisation envoy\u00e9 avec succ\u00e8s, merci de patienter un instant pour la suite...";
v_msgEng="Notice of extension of hospitalization sent successfully, please wait a moment for the rest...";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
},
complete: function() {
mettremailattente(donnees_sav);
}
});
}
function modifieravisprorogationhospitalisation()
{
//
motifProlongation = $("#motifProlongation").val();
quantite = $("#quantite").val();
debut = $("#debut").val();
codeTypeHospitalisationPro = $("#codeTypeHospitalisationPro").val();
optionHospitalisationPro= $("#optionHospitalisationPro").val();
idProlongation = $("#idProlongation").val();
prixChambre = $("#prixChambre").val();
prixChambreProlongation = $("#prixChambreProlongation").val();
dateDebutPro = $("#dateDebutPro").val();
dateJour = $("#dateJour").val();
codeActeChambre = $("#codeActeChambre").val();
if (idProlongation==undefined || idProlongation == "0") {
if (prixChambre==undefined || prixChambre == "0")
{
v_msg="Prorogation impossible! Vous n'avez pas saisi de prix de la derni\u00e8re chambre d'hospitalisation.";
v_msgEng="Impossible extension! You did not enter a price for the last hospital room.";
alert_ebene(v_msg, v_msgEng);
$("#btn_close_pop").click();
return;
}
}else{
if (prixChambreProlongation==undefined || prixChambreProlongation == "0")
{
v_msg="Prorogation impossible! Vous n'avez pas saisi de prix pour la derni\u00e8re chambre d'hospitalisation.";
v_msgEng="Impossible extension! You did not enter a price for the last hospital room.";
alert_ebene(v_msg, v_msgEng);
$("#btn_close_pop").click();
return;
}
}
var td0 = new Date(dateDebutPro);
var tdj = new Date(dateJour);
dt0=Math.round(Date.parse(td0)/(1000*3600*24));
dtj=Math.round(Date.parse(tdj)/(1000*3600*24));
//alert('dateDebutPro ='+dt0+' dateJour='+dtj);
//return;
if(codeTypeHospitalisationPro == optionHospitalisationPro){
if (dtj < dt0)
{
v_msg="Prorogation impossible! Veuillez attendre la fin de l'hospitalisation en cours avant de la proroger.";
v_msgEng="Extension not possible! Please wait until the end of the current hospitalization before extending it.";
alert_ebene(v_msg, v_msgEng);
return false;
}
}
donnees = 'motifProlongation='+motifProlongation;
donnees += '&quantite='+quantite+'&debut='+debut;
donnees += '&codeTypeHospitalisationPro='+codeTypeHospitalisationPro;
donnees += '&codeActeChambre='+codeActeChambre;
if (codeTypeHospitalisationPro=="option-1"){
codeActe = "HHM";
}
if (codeTypeHospitalisationPro=="option-3"){
codeActe = "HHC";
}
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
//donnees_sav = 'codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&quantite='+quantite+'&motifHospit='+motifProlongation+'&typeMail=mailententeprealable';
//typeSms = "hospitalisation";
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerchambre/avisprorogationhospit/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
//preparesms(typeSms);
//alertsmsavis(typeSms);
v_msg="Avis de prorogation d'hospitalisation modifi\u00e9 avec succ\u00e8s, merci de patienter un instant pour la suite...";
v_msgEng="Notice of extension of hospitalization modified successfully, please wait a moment for the rest...";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
},
complete: function() {
//mettremailattente(donnees_sav);
}
});
}
//Face Sorel 25-07-2023
function re_init_photo_face()
{
var photo = document.getElementById('photo_face');
photo.setAttribute('src', "");
$('#message_face').html("");
$('#image_face').val("");
$("#div_wait_face_ebene").html('');
}
function ebene_init_photo_face() // OK
{
faceRegistered = $("#faceRegistered").val();
if(faceRegistered=="1")
{
v_msg="Cettte personne a déjà une face dans le système!";
v_msgEng="This person already has a face in the system!";
alert_ebene(v_msg, v_msgEng);
$('#message_face').html("");
return;
}
re_init_photo_face();
$("#btn_pop_save_face").click();
}
function ebene_init_confirm_photo_face() // OK
{
faceRegistered = $("#faceRegistered").val();
if(faceRegistered!="1")
{
v_msg="Cettte personne n'a pas encore de face dans le système!";
v_msgEng="This person doesn't have a face in the system yet!";
alert_ebene(v_msg, v_msgEng);
$('#message_face').html("");
return;
}
re_init_photo_face();
$("#btn_pop_save_face").click();
}
function ebene_enregistrer_photo_face() // OK
{
$("#ebene_confirmer_photo_face").disable();
$("#ebene_supprimer_photo_face").disable();
$("#ebene_take_photo_face").disable();
$("#motif").disable();
$("ebene_confirmer_photo_face").prop('disabled', true);
$("ebene_supprimer_photo_face").prop('disabled', true);
$("ebene_take_photo_face").prop('disabled', true);
$("motif").prop('disabled', true);
$('#message_face').html("");
$("#div_wait_face_ebene").html('');
$("#okId").val("-1");
$("#okId_face").val("-1");
$("#del_face").val("0");
image_face = $("#image_face").val();
if(image_face<=" ")
{
v_msg="Veuillez prendre une photo!";
v_msgEng="Please take a photo!";
alert_ebene(v_msg, v_msgEng);
return;
}
$("#div_wait_face_ebene").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
compare_face = $("#compare_face").val();
var dataURL = canvas.toDataURL("image/jpeg");
$.ajax({
url: $("#racineWeb").val()+"Fichebeneficiaire/ebeneenregistrerface/",
type: 'POST',
data: {'image_face' : dataURL, 'compare_face' : compare_face , 'del_face' : "0"},
success: function(data) {
$("#ebene_take_photo_face").enable();
$("#div_wait_face_ebene").html('');
$("#message_face").html(data);
photo_succes = $("#photo_succes").val();
if(photo_succes=="1")
{
v_msg="Enrôlement effectué avec succès!";
v_msgEng="Enrollment completed successfully!!";
// alert_ebene(v_msg, v_msgEng);
setTimeout(() => {
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/");
}, 1000)
}
},
error: function(data) {
},
complete: function(data) {
$("#div_wait_face_ebene").html('');
}
});
}
function ebene_confirmer_photo_face() // OK
{
$("#ebene_confirmer_photo_face").disable();
$("#ebene_supprimer_photo_face").disable();
$("#ebene_take_photo_face").disable();
$("#motif").disable();
$("ebene_confirmer_photo_face").prop('disabled', true);
$("ebene_supprimer_photo_face").prop('disabled', true);
$("ebene_take_photo_face").prop('disabled', true);
$("motif").prop('disabled', true);
$('#message_face').html("");
$("#div_wait_face_ebene").html('');
$("#del_face").val("0");
faceRegistered = $("#faceRegistered").val();
if(faceRegistered!="1")
{
v_msg="Cette personne n'a pas encore de photo dans le système!";
v_msgEng="This person does not have a photo in the system yet!";
alert_ebene(v_msg, v_msgEng);
$('#message_face').html("");
return;
}
image_face = $("#image_face").val();
if(image_face<=" ")
{
v_msg="Veuillez prendre une photo!";
v_msgEng="Please take a photo!";
alert_ebene(v_msg, v_msgEng);
$('#message_face').html("");
return;
}
$("#div_wait_face_ebene").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
compare_face = $("#compare_face").val();
var dataURL = canvas.toDataURL("image/jpeg");
$.ajax({
url: $("#racineWeb").val()+"Fichebeneficiaire/ebeneenregistrerface/",
type: 'POST',
data: {'image_face' : dataURL, 'compare_face' : compare_face , 'del_face' : "0"},
success: function(data) {
$("#ebene_take_photo_face").enable();
$("#div_wait_face_ebene").html('');
$("#message_face").html(data);
photo_succes = $("#photo_succes").val();
if(photo_succes=="1")
{
$("#okId_face").val("1");
v_msg="Face confirmée!";
v_msgEng="Face confirmed!";
// alert_ebene(v_msg, v_msgEng);
setTimeout(() => {
// consultation();
fiche_beneficiaire();
}, 1000)
}
else
{
$("#okId").val("-1");
$("#okId_face").val("-1");
}
},
error: function(data) {
},
complete: function(data) {
$("#div_wait_face_ebene").html('');
}
});
}
function ebene_supprimer_photo_face() // OK
{
$('#message_face').html("");
$("#div_wait_face_ebene").html('');
motif=$("#motif").val();
motif= motif.trim();
$("#motif").val(motif);
if (motif<=" ")
{
v_msg="Veuillez saisir un motif!";
v_msgEng="Please enter a reaon!";
alert_ebene(v_msg, v_msgEng);
$("#motif").focus();
return;
}
$("#del_face").val("1");
faceRegistered = $("#faceRegistered").val();
if(faceRegistered!="1")
{
v_msg="Cette personne n'a pas encore de photo dans le système!";
v_msgEng="This person does not have a photo in the system yet!";
alert_ebene(v_msg, v_msgEng);
return;
}
image_face = $("#image_face").val();
if(image_face<=" ")
{
v_msg="Veuillez prendre une photo!";
v_msgEng="Please take a photo!";
alert_ebene(v_msg, v_msgEng);
return;
}
v_msg="Confirmez-vous cette suppression?";
v_msgEng="Do you confirm this deletion?";
if(confirm_ebene(v_msg, v_msgEng))
{
$("#ebene_confirmer_photo_face").disable();
$("#ebene_supprimer_photo_face").disable();
$("#ebene_take_photo_face").disable();
$("#motif").disable();
$("ebene_confirmer_photo_face").prop('disabled', true);
$("ebene_supprimer_photo_face").prop('disabled', true);
$("ebene_take_photo_face").prop('disabled', true);
$("motif").prop('disabled', true);
$("#div_wait_face_ebene").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
compare_face = $("#compare_face").val();
var dataURL = canvas.toDataURL("image/jpeg");
$.ajax({
url: $("#racineWeb").val()+"Fichebeneficiaire/ebeneenregistrerface/",
type: 'POST',
data: {'image_face' : dataURL, 'compare_face' : compare_face, 'del_face' : "1", 'motif' : motif},
success: function(data) {
$("#ebene_take_photo_face").enable();
$("#div_wait_face_ebene").html('');
$("#message_face").html(data);
photo_succes = $("#photo_succes").val();
if(photo_succes=="1")
{
$("#okId").val("-1");
$("#okId_face").val("-1");
document.getElementById('photo_face').setAttribute('src', "");
$("#faceRegistered").val("0");
$("#ebene_confirmer_photo_face").disable();
$("#ebene_supprimer_photo_face").disable();
$("#motif").disable();
$("ebene_confirmer_photo_face").prop('disabled', true);
$("ebene_supprimer_photo_face").prop('disabled', true);
$("motif").prop('disabled', true);
v_msg="Face supprimée avec succès!";
v_msgEng="Face removed successfully!";
// alert_ebene(v_msg, v_msgEng);
setTimeout(() => {
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/");
}, 1000)
}
},
error: function(data) {
},
complete: function(data) {
$("#div_wait_face_ebene").html('');
}
});
}
}
function fiche_beneficiaire()
{
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/");
}
function controler_bon_principal()
{
debugger;
bonPrincipal = $("#bonPrincipal").val();
donnees = "bonPrincipal="+bonPrincipal;
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontrolerbonprincipal/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
if(data=="0"){
v_msg="Ce numéro de bon est incorrect!";
v_msgEng="This voucher number is wrong!";
alert_ebene(v_msg, v_msgEng);
$("#bonPrincipal").val("0");
return;
}else{
return;
}
},
error: function(data) {
},
complete: function() {
}
});
}
function conserver_infos_consultation()
{
codeMedecin = $("#codeMedecin").val();
codeActe = $("#codeActe").val();
codeRaisonConsultation = $("#codeRaisonConsultation").val();
observations = $("#observations").val();
bonPrincipal = $("#bonPrincipal").val();
donnees = 'codeMedecin='+codeMedecin;
donnees += '&codeActe='+codeActe;
donnees += '&codeRaisonConsultation='+codeRaisonConsultation;
donnees += '&observations='+observations;
donnees += '&bonPrincipal='+bonPrincipal;
$.ajax({
url: $("#racineWeb").val()+"Ajaxconserverconsultation/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
}
});
}
function enregistrerdemandederogationbareme(codeDerogation, libelleDerogation, codeActe, codeGarantie, derogationAccorde)
{
debugger;
//
if(derogationAccorde!="0"){
if(derogationAccorde=="2"){
v_msg="La demande de dérogation est en cours de traitement! Veuillez patienter!";
v_msgEng="Your Request is being processed! Please wait for the answer...";
alert_ebene(v_msg, v_msgEng);
}else if(derogationAccorde=="9"){
v_msg="La demande de dérogation a été refusée!";
v_msgEng="The exemption request has been refused!";
faireDefileMessage(v_msg, v_msgEng);
}else{
faireDefileMessage("", "");
}
getstatutacte(codeActe);
return;
}
numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val();
donnees = 'codeDerogation='+codeDerogation+'&observations='+libelleDerogation+'&libelleDerogation='+libelleDerogation;
donnees += '&codeActe='+codeActe+'&codeGarantie='+codeGarantie+'&numeroFeuilleMaladie'+numeroFeuilleMaladie;
idBeneficiaire = $("#idBeneficiaire_C").val();
prestataire = $("#prestataire_C").val();
donnees_sav = donnees+'&prestataire='+prestataire+'&idBeneficiaire='+idBeneficiaire+'&typeMail=maildemandederogation';
typeSms = "demandederogation";
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerdemandederogation/enregistrerdemandederogationbareme/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
preparesms(typeSms);
},
complete: function()
{
mettremailattente(donnees_sav);
v_msg="Demande envoy\u00e9e avec succès!";
v_msgEng="Request sent successfully!";
alert_ebene(v_msg, v_msgEng);
//getstatutactederogation(codeActe, derogationAccorde);
getstatutacte(codeActe);
}
});
}
function ajax_maj_duree_medicament(idMedicament, duree, controle)
{
duree=duree.replace(",",".");
controle.value=duree;
if(controle_numerique(controle))
{
if(duree==0)
{
controle.focus();
v_msg="Veuillez saisir la dur\u00e9e du traitement!";
v_msgEng="Please enter the treatment duration!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idMedicament='+idMedicament+"&duree="+duree;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/majduree/",
type: 'POST',
data: donnees,
success: function(data) {
$("#medicaments").html(data);
},
error: function(data) {
},
complete: function() {
//controle.focus();
}
});
}
}
function ajaxmajmotifacte()
{
donnees = 'motifActe='+$('#motifActe').val();
$.ajax({
url: $("#racineWeb").val()+"Ajaxselectactesmedicaux/majmotifacte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
}
});
}
/////////////////
function proforma_hopitalisation()
{
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
function chargernumero(numero)
{
//var nomForm = $('#nomForm').val();
var donnees = 'numero='+ numero;
vLink = "Ajaxchargernumerobeneficiaire/";
$.ajax({
type: "POST",
url: $("#racineWeb").val()+vLink,
data:donnees,
beforeSend: function(){
$("#searchInputB").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px");
},
success: function(data){
$("#div_selectionB").show();
$("#div_selectionB").html(data);
$("#searchInputB").css("background","#FFF");
}
});
}
function selectBeneficiaire(id, numero, nom, nomPolice, nomCollege, codeLienParente, numeroAdherent, adherent){
var nomForm = $('#nomForm').val();
ajax_beneficiaire_contexte(id);
if(nomForm == "proformahospitalisation"){
ajaxbeneficiairecouvert(id);
}
$("#searchInputB").val(numero);
$("#div_selectionB").hide();
$("#nomAssure").val(nom);
$("#idBeneficiaire").val(id);
$("#nomPolice").val(nomPolice);
$("#nomCollege").val(nomCollege);
$("#codeLienParente").val(codeLienParente);
$("#noAdherent").val(numeroAdherent);
$("#nomAdherent").val(adherent);
donnees = "idBeneficiaire="+id;
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function(data) {
}
});
}
function add_selected_acte_proforma_hosp(controle)
{
debugger;
var nomForm = $("#nomForm").val();
var str = controle.split(' <==> ');
var codeActe = str[0];
var libelleActe = str[1];
var prixTarif = 0;
var acteExclu = str[3];
var ententePrealable = 0;
if(acteExclu=="Garanti"){
acteExclu=0;
}else{
acteExclu=1;
}
if(libelleActe<=" ")
{
$("#codeActe").focus();
return;
}
if(acteExclu==1)
{
v_msg="Acte non couvert!";
v_msgEng="Not covered!";
alert_ebene(v_msg, v_msgEng);
return;
}
idBeneficiaire = $("#idBeneficiaire").val();
optionHospitalisation = "option-3";//$("#optionHospitalisation").val();
dateDebut = $("#dateDebut").val();
duree = $("#duree").val();
motif = $("#motif").val();
codeMedecin = $("#codeMedecin").val();
idProforma = $("#idProformaHospitalisation").val();
donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable;
donnees += '&prixTarif='+prixTarif+'&acteExclu='+acteExclu;
donnees += '&idBeneficiaire='+idBeneficiaire+'&motif='+motif;
donnees += '&optionHospitalisation='+optionHospitalisation;
donnees += '&dateDebut='+dateDebut+'&duree='+duree+'&codeMedecin='+codeMedecin;
$("#div_attente").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxchargeractesproformahospitalisation/ajouteracte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#searchInput").val('');
$("#div_prestations").html('
' + 'Veuillez patienter...' + ' ');
if(idProforma > 0){
if(nomForm=="hospitalisationproforma"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}else{
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
}else{
if(nomForm=="hospitalisationproforma"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/");
}else{
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
}
},
complete: function(data) {
}
});
}
function affichedetailproformahopitalisation()
{
debugger;
idBeneficiaire = $("#idBeneficiaire").val();
dateDebut = $("#dateDebut").val();
if(idBeneficiaire>"0" && dateDebut>" ")
{
ajaxactes_proforma_hospitalisation();
}
}
function ajaxactes_proforma_hospitalisation()
{
nomForm = $("#nomForm").val();
idBeneficiaire = $("#idBeneficiaire").val();
optionHospitalisation = "option-3";//$("#optionHospitalisation").val();
dateDebut = $("#dateDebut").val();
donnees = 'idBeneficiaire='+idBeneficiaire;
donnees += '&optionHospitalisation='+optionHospitalisation;
donnees += '&dateDebut='+dateDebut;
$("#div_prestations").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesproformahospitalisation/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
debugger;
$("#div_prestations").html(data);
if(nomForm=="proformahospitalisation"){
motifProforma = $("#motif").val();
dureeProforma = $("#duree").val();
codeMedecinProforma = $("#codeMedecin").val();
codeMedecinProforma = $("#codeMedecin").val();
codeAffectionProforma = $("#codeAffection").val();
motif = $("#motif").val(motifProforma);
duree = $("#duree").val(dureeProforma);
codeMedecin = $("#codeMedecin").val(codeMedecinProforma);
codeAffection = $("#codeMedecin").val(codeAffectionProforma);
}
},
complete: function() {
}
});
}
function ajax_maj_prix_acte_proformahospitalisation(idPrestationactes, valeurActe, controle)
{
debugger;
valeurActe=valeurActe.replace(",",".");
controle.value=valeurActe;
valeurActe=valeurActe.replace(/ /g,"");
valeurActe=parseInt(valeurActe.replace(",","."),10);
controle.value=valeurActe;
if(controle_numerique(controle))
{
donnees = 'idPrestationactes='+idPrestationactes+"&valeurActe="+valeurActe;
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesproformahospitalisation/majvaleuracte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
ajaxactes_proforma_hospitalisation();
}
});
}
}
function ajax_maj_qte_acte_proformahospitalisation(idPrestationactes, quantite, controle)
{
quantite=quantite.replace(",",".");
controle.value=quantite;
if(controle_numerique(controle))
{
if(quantite==0)
{
controle.focus();
v_msg="Veuillez saisir la quantit\u00e9!";
v_msgEng="Please enter the quantity!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite;
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesproformahospitalisation/majquantite/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
ajaxactes_proforma_hospitalisation();
}
});
}
}
function supprimer_acte_proforma_hospitalisation(idPrestationactes, codeTypePrestation)
{
donnees = 'idPrestationactes='+idPrestationactes+'&codeTypePrestation='+codeTypePrestation;
codeLangue = $("#codeLangue").val();
v_msg="Confirmez-vous cette suppression?";
v_msgEng="Do you confirm this deletion?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#div_prestations").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesproformahospitalisation/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
ajaxactes_proforma_hospitalisation();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#div_prestations").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesproformahospitalisation/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
ajaxactes_proforma_hospitalisation();
}
});
}
else
{
return;
}
});
}
}
function init_proforma_hopitalisation()
{
codeLangue = $("#codeLangue").val();
v_msg="Confirmez-vous cette la réinitialisation?";
v_msgEng="Do you confirm this reset?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#searchInputB").val("");
$("#div_selectionB").hide();
$("#nomAssure").val("");
$("#idBeneficiaire").val("0");
$("#nomPolice").val("");
$("#nomCollege").val("");
$("#codeLienParente").val("");
$("#noAdherent").val("");
$("#nomAdherent").val("");
$("#dateDebut").val("");
$("#duree").val("0");
$("#motif").val("");
$("#codeMedecin").val("");
$("#codeAffection").val("");
$("#searchInput").val('');
$("#div_prestations").html("");
$("#div_couverture").html("");
$("#div_messages").html("");
$("#dateDebut").enable();
$("#duree").enable();
$("#motif").enable();
$("#codeMedecin").enable();
$("#codeAffection").enable();
$('.selectpicker').selectpicker('refresh');
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisation/unsetsession/",
type: 'POST',
data: donnees,
success: function(data) {
//prestations_hospitalisation();
},
error: function(data) {
},
complete: function() {
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$("#searchInputB").val("");
$("#div_selectionB").hide();
$("#nomAssure").val("");
$("#idBeneficiaire").val("0");
$("#nomPolice").val("");
$("#nomCollege").val("");
$("#codeLienParente").val("");
$("#noAdherent").val("");
$("#nomAdherent").val("");
$("#dateDebut").val("");
$("#duree").val("0");
$("#motif").val("");
$("#codeMedecin").val("");
$("#codeAffection").val("");
$("#searchInput").val('');
$("#div_prestations").html("");
$("#div_couverture").html("");
$("#div_messages").html("");
$("#dateDebut").enable();
$("#duree").enable();
$("#motif").enable();
$("#codeMedecin").enable();
$("#codeAffection").enable();
$('.selectpicker').selectpicker('refresh');
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisation/unsetsession/",
type: 'POST',
data: donnees,
success: function(data) {
//prestations_hospitalisation();
},
error: function(data) {
},
complete: function() {
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
});
}
else
{
return;
}
});
}
}
function valider_proforma_hopitalisation()
{
debugger;
idBeneficiaire = $("#idBeneficiaire").val();
motif = $("#motif").val();
dateDebut = $("#dateDebut").val();
duree = $("#duree").val();
codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val();
nbreActe = $("#nbreActe").val();
demandeTraite = $("#demandeTraite").val();
ligneZero = $("#ligneZero").val();
if(codeReponseEntentePrealable>" ")
{
v_msg="Proforma déjà validée!";
v_msgEng="Proforma already validated!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(demandeTraite>"0"){
v_msg="Proforma déjà traitée!";
v_msgEng="Proforma already processed!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(nbreActe=="0")
{
v_msg="Veuillez s\u00e9lectionner et ajouter des actes \u00e0 la proforma!";
v_msgEng="Please select and add acts to the proforma!";
alert_ebene(v_msg, v_msgEng);
return;
}
if(idBeneficiaire=='0' || idBeneficiaire <=" ")
{
v_msg="Veuillez sélectionner un No Bénéficiaire!";
v_msgEng="Please select a Beneficiary Number!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#searchInputB").focus();
return;
}
if (motif <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#motif").focus();
return;
}
if (dateDebut<=" ")
{
v_msg="Veuillez saisir la date de d\u00e9but!";
v_msgEng="Please enter the start date!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebut").focus();
return;
}
if (duree == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#duree").focus();
return;
}
idProforma = $("#idProforma").val();
numeroEntentePrealable = $("#numeroEntentePrealable").val();
if(idProforma=="0"){
v_msg="Veuillez d'abord, ajouter, au moins un acte!";
v_msgEng="Please first add at least one act";
alert_ebene(v_msg, v_msgEng);
return;
}
if(ligneZero=="1"){
v_msg="Il y a des lignes nulles! Supprimer les ou entrer leurs montants.";
v_msgEng="There are zero lines! Delete them or enter their amounts.";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idProforma='+idProforma;
codeLangue = $("#codeLangue").val();
v_msg="Validez-vous cette Proforma?";
v_msgEng="Do you validate this Proforma?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisation/valider/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
debugger;
if(numeroEntentePrealable=="0"){
//preparesms(typeSms);
v_msg="La facture proforma d'hospitalisation No: " + idProforma + " envoyé avec succès!";
v_msgEng="The proforma hospitalization invoice No: "+ idProforma +" sent successfully";
alert_ebene(v_msg, v_msgEng);
//return;
}
fermer_proforma_hospitalisation();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisation/valider/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
},
complete: function() {
debugger;
if(numeroEntentePrealable=="0"){
//preparesms(typeSms);
v_msg="La facture proforma d'hospitalisation No: " + idProforma + " envoyé avec succès!";
v_msgEng="The proforma hospitalization invoice No: "+ idProforma +" sent successfully";
alert_ebene(v_msg, v_msgEng);
//return;
}
fermer_proforma_hospitalisation();
}
});
}
else
{
return;
}
});
}
}
function fermer_proforma_hospitalisation()
{
window.location.assign($("#racineWeb" ).val()+"Historiqueproformahospitalisation/");
}
function save_nv_consommable_proformahospit()
{
idProforma = $("#idProformaHospitalisation").val();
nomForm = $("#nomForm").val();
if(idProforma=="0"){
v_msg="Veuillez d'abord, ajouter, au moins un acte!";
v_msgEng="Please first add at least one act";
alert_ebene(v_msg, v_msgEng);
if(nomForm=="hospitalisationproforma"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/");
}else{
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
//return;
}
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\u00e9rique exig\u00e9e!";
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\u00e9!";
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\u00e9rique exig\u00e9e!";
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;
donnees += '&idProforma='+idProforma;
$("#div_patienter_consommable").html('
' + 'Veuillez patienter...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteconsommables/creerconsommableproformahospit/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
//attribution_chambre();
$("#div_prestations").html('
' + 'Veuillez patienter...' + ' ');
if(idProforma > 0){
if(nomForm=="hospitalisationproforma"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}else{
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
}else{
if(nomForm=="hospitalisationproforma"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/");
}else{
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}
}
}
});
}
function enregistrer_entete_proforma_hospitalisation()
{
debugger;
optionHospitalisation = "option-3";//$("#optionHospitalisation").val();
dateDebut = $("#dateDebut").val();
codeMedecin = $("#codeMedecin").val();
duree = $("#duree").val();
motif = $("#motif").val();
idProformaHospitalisation = $("#idProformaHospitalisation").val();
nomForm = $("#nomForm").val();
codeAffection = $("#codeAffection").val();
if (motif <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#motif").focus();
return;
}
if (dateDebut<=" ")
{
v_msg="Veuillez saisir la date de d\u00e9but!";
v_msgEng="Please enter the start date!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#dateDebut").focus();
return;
}
if (duree == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val('');
$("#duree").focus();
return;
}
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
// $("#codeMedecin").focus();
$("#codeMedecin").focus();
return;
}
numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val();
idBeneficiaire = $("#idBeneficiaire_C").val();
codePrestataire = $("#codePrestataire_C").val();
donnees = 'optionHospitalisation='+optionHospitalisation+'&motif='+motif;
donnees += '&dateDebut='+dateDebut+'&duree='+duree+'&codeMedecin='+codeMedecin;
donnees += '&idProformaHospitalisation='+idProformaHospitalisation;
donnees +="&numeroFeuilleMaladie="+numeroFeuilleMaladie;
donnees +="&idBeneficiaire="+idBeneficiaire;
donnees +="&codePrestataire="+codePrestataire;
donnees +="&codeAffection="+codeAffection;
codeLangue = $("#codeLangue").val();
v_msg="Confirmez-vous cette entête de proforma?";
v_msgEng="Do you confirm this proforma header?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisation/enregistrerentete/",
type: 'POST',
data: donnees,
success: function(data) {
var idProforma = parseInt(data);
if(idProforma > 0){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}else{
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/");
}
},
error: function(data) {
},
complete: function() {
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisation/enregistrerentete/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
var idProforma = parseInt(data);
if(idProforma > 0){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}else{
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/");
}
},
error: function(data) {
},
complete: function() {
}
});
}
else
{
return;
}
});
}
}
function listerproformahospitalisation()
{
d1 = $("#d1").val();
d2 = $("#d2").val();
$("#div_proformas").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$("#div_messages").html('');
donnees = 'd1='+d1+'&d2='+d2;
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisterproformahospitalisation/",
type: 'POST',
data: donnees,
success: function(data) {
$("#div_proformas").html(data);
},
error: function(data) {
},
complete: function() {
}
});
}
function fermer_historique_proforma_hospitalisation()
{
window.location.assign($("#racineWeb" ).val()+$("#vueParent").val()+"/");
}
function afficher_proforma_hospitalisation(idProforma)
{
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}
function maj_duree_traitement_seance_cso()
{
debugger;
dureeTraitement = $("#dureeTraitement").val();
donnees = 'dureeTraitement='+dureeTraitement;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionseance/majdureeseance/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
//window.location.assign($("#racineWeb" ).val()+"Prescriptionsence/");
},
complete: function()
{
}
});
}
function proforma_seance_cso(codeActe)
{
debugger;
//typeSms="ententeprealable";
dureeTraitement = $('#dureeTraitement').val();
if(dureeTraitement=="0"){
v_msg="Veuillez indiquer la durée du traitement!";
v_msgEng="Please indicate the duration of treatment!";
alert_ebene(v_msg, v_msgEng);
$('#dureeTraitement').focus();
return;
}
donnees = 'codeActe='+codeActe;
$.ajax({
url: $("#racineWeb").val()+"Ajaxfacturatioseancecso/proformacso/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
if(data!="2"){
//preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
return;
}
},
error: function(data) {
},
complete: function() {
afficher_seance_cso();
}
});
}
function proforma_seance_sea(codeActe)
{
debugger;
//typeSms="ententeprealable";
dureeTraitement = $('#dureeTraitement').val();
if(dureeTraitement=="0"){
v_msg="Veuillez indiquer la durée du traitement!";
v_msgEng="Please indicate the duration of treatment!";
alert_ebene(v_msg, v_msgEng);
$('#dureeTraitement').focus();
return;
}
donnees = 'codeActe='+codeActe;
$.ajax({
url: $("#racineWeb").val()+"Ajaxfacturatioseancesea/proformasea/",
type: 'POST',
data: donnees,
success: function(data) {
if(data!="2"){
//preparesms(typeSms);
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
},
error: function(data) {
},
complete: function() {
actualiser_seance_sea();
//reinitrechercherbonkine();
}
});
}
function actualiser_seance_sea()
{
window.location.assign($("#racineWeb" ).val()+"Kine/");
}
function actualiser_seance_cso()
{
window.location.assign($("#racineWeb" ).val()+"Kinecso/");
}
function enregistrer_entete_hospitalisation_proforma()
{
debugger;
optionHospitalisation = "option-3";//$("#optionHospitalisation").val();
dateDebut = $("#dateDebut").val();
codeMedecin = $("#codeMedecin").val();
duree = $("#duree").val();
motif = $("#motif").val();
numeroBeneficiaire = $("#numeroBeneficiaire").val();
codeActeChambre = $("#codeActeChambre").val();
if (codeActeChambre <= " ")
{
v_msg="Veuillez renseigner le type de chambre!";
v_msgEng="Please enter the room type!";
alert_ebene(v_msg, v_msgEng);
$("#codeActeChambre").focus();
return;
}
if (dateDebut<=" ")
{
v_msg="Veuillez saisir la date de d\u00e9but!";
v_msgEng="Please enter the start date!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebut").focus();
return;
}
if (duree == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#duree").focus();
return;
}
if (motif <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#motif").focus();
return;
}
if (codeMedecin<=" ")
{
v_msg="Veuillez s\u00e9lectionner un m\u00e9decin!";
v_msgEng="Please select a doctor!";
alert_ebene(v_msg, v_msgEng);
$("#codeMedecin").focus();
return;
}
codeAffection = $("#codeAffection").val();
donnees = 'optionHospitalisation='+optionHospitalisation+'&motif='+motif;
donnees += '&dateDebut='+dateDebut+'&duree='+duree+'&codeMedecin='+codeMedecin;
donnees += '&numeroBeneficiaire='+numeroBeneficiaire+'&codeAffection='+codeAffection;
donnees += '&codeActeChambre='+codeActeChambre;
codeLangue = $("#codeLangue").val();
v_msg="Confirmez-vous l'enregistrement de cette entête de proforma?";
v_msgEng="Do you confirm the recording of this proforma header?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesproformahospitalisation/enregistrerentete/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
$("#div_proforma").html(data);
var idProforma = parseInt($("#idProforma").val());
if(idProforma > "0"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}
},
error: function(data) {
},
complete: function() {
//attribution_chambre();
}
});
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxactesproformahospitalisation/enregistrerentete/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
$("#div_proforma").html(data);
var idProforma = parseInt($("#idProforma").val());
if(idProforma > "0"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}
},
error: function(data) {
},
complete: function() {
//attribution_chambre();
}
});
}
else
{
return;
}
});
}
}
//04-01-2024
function dentisterie()
{
facture=$("#facture").val();
contestation = $("#contestation").val();
if(facture == "0" && contestation == "1"){
v_msg="Dossier médical contesté !";
v_msgEng="Medical records contested!";
alert_ebene(v_msg, v_msgEng);
return;
}
affectionObligatoire=$("#affectionObligatoire").val();
codeAffection=$("#codeAffection").val();
modeSaisieFacture=$("#modeSaisieFacture").val();
hospitalisation = $("#hospitalisation").val();
if (hospitalisation=="1")
{
v_msg="Non autoris\u00e9 car la p\u00e9riode d'hospitalisation est en cours.";
v_msgEng="Not authorized because the period of hospitalization is in progress.";
alert_ebene_callback(v_msg, v_msgEng, function() {
window.location.assign($("#racineWeb").val()+"Feuillemaladie/");
});
return;
}
if (affectionObligatoire=="1" && codeAffection=="990" && modeSaisieFacture!="1")
{
v_msg="Diagnostique exig\u00e9!";
v_msgEng="Diagnosis required!";
alert_ebene(v_msg, v_msgEng);
$("#libelleAffection").focus();
$("#btn_pop_affection").click();
return;
}
window.location.assign($("#racineWeb" ).val()+"Dentisterie/");
}
function ajoute_dentaire()
{
debugger;
var codeActe = $('#codeActe').val();
var ententePrealable = $('#ententePrealable').val();
var numeroDent = $("#numeroDent").val();
var motifDentaire = $('#motifDentaire').val();
var idCollege = $('#idCollege').val();
var nbreProthese = $('#nbreProthese').val();
/*
if(codeTypeActe=="PRO" && idCollege=="1"){
v_msg="La prothèse dentaire n'est pas prise en charge pour ce patient! Veuillez contacter l'assureur.";
v_msgEng="The dental prosthesis is not covered for this patient! Please contact the insurer.";
alert_ebene(v_msg, v_msgEng);
return;
}else if(codeTypeActe=="PRO" && nbreProthese > "0"){
v_msg="Le patient a déjà bénéficié d'une prothèse dentaire en cette année! Veuillez contacter l'assureur.";
v_msgEng="The patient has already benefited from a dental prosthesis this year! Please contact the insurer.";
alert_ebene(v_msg, v_msgEng);
return;
}
*/
donnees = 'codeActe='+codeActe+'&numeroDent='+numeroDent+'&motifDentaire='+motifDentaire;
//alert(donnees);
//return;
var div_prestations = $('#div_prestations');
div_prestations.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/ajouter/",
type: 'POST',
data: donnees,
success: function(data)
{
div_prestations.html(data);
var bool = $('#bool').val();
if(bool=="1"){
v_msg="Ajout impossible risque de doublons!";
v_msgEng="Addition impossible risk of duplicates!";
alert_ebene(v_msg, v_msgEng);
return;
}/*else{
//if(ententePrealable == "1"){
//preparesms(typeSms);
//v_msg="Demande accord prealable envoyée!";
//v_msgEng="Request prior agreement sent!";
//alert_ebene(v_msg, v_msgEng);
//return;
//}
}*/
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
dentisterie();
}
});
}
// 07-11-2022
function ajax_maj_prixacte_dentaire(idPrestationactes, prix, controle)
{
prix=prix.replace(",",".");
prix=prix.replace(/ /g,"");
controle.value=prix;
if(controle_numerique(controle))
{
if(prix==0)
{
controle.focus();
v_msg="Veuillez saisir le prix!";
v_msgEng="Please enter the price!";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idPrestationactes='+idPrestationactes+"&prix="+prix;
donnee_a_affciher = "";
donnees = 'idPrestationactes='+idPrestationactes+"&prix="+prix;;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/majprixacte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
},
error: function(data) {
},
complete: function() {
$("#div_prestations").html(donnee_a_affciher);
controle.focus();
}
});
}
}
function ajax_maj_qte_acte_dentaire(idPrestationactes, 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 = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite;
donnee_a_affciher = "";
donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite;;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/majquantite/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
},
error: function(data) {
},
complete: function() {
$("#div_prestations").html(donnee_a_affciher);
controle.focus();
}
});
}
}
function supprimer_acte_dentaire_selection(idPrestationactes)
{
donnee_a_affciher = "";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: "Do you confirm the removal of this act?",
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm) {
donnees = 'idPrestationactes='+idPrestationactes;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
$("#div_prestations").html(donnee_a_affciher);
//appliquerDataTable();
}
});
} else {
return false;
}
});
}
else
{
swal({
title: "Confirmez-vous la suppression de cet acte?",
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm) {
donnees = 'idPrestationactes='+idPrestationactes;
$("#listeacte").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/supprimeracte/",
type: 'POST',
data: donnees,
success: function(data) {
donnee_a_affciher = data;
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
$("#div_prestations").html(donnee_a_affciher);
//appliquerDataTable();
}
});
} else {
return;
}
});
}
}
function valider_dentaire()
{
donnees = "";
existeEntentePrealable=$("#existeEntentePrealable").val();
existeEntentePrealable = parseInt(existeEntentePrealable);
envoyeSms=$("#envoyeSms").val();
envoyeSms = parseInt(envoyeSms);
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: "Do you confirm validation?",
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm) {
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/valider/",
type: 'POST',
data: donnees,
success: function(data) {
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
debugger
if(existeEntentePrealable == 2 && envoyeSms == 0 )
{
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
feuillemaladie();
}
});
} else {
return false;
}
});
}
else
{
swal({
title: "Confirmez-vous la validation?",
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm) {
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/valider/",
type: 'POST',
data: donnees,
success: function(data) {
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
debugger
if(existeEntentePrealable == 2 && envoyeSms == 0 )
{
v_msg="Demande accord prealable envoy\u00e9e!";
v_msgEng="Request prior agreement sent!";
alert_ebene(v_msg, v_msgEng);
}
feuillemaladie();
}
});
} else {
return;
}
});
}
}
function add_selected_dentisterie(controle)
{
debugger;
motifDentaire = $("#motifDentaire").val();
if (motifDentaire<=" ")
{
v_msg="Veuillez entrer le motif de la prescription dentaire!";
v_msgEng="Please enter the reason for the dental prescription!";
alert_ebene(v_msg, v_msgEng);
$("#searchInput").val("");
$("#motifDentaire").focus();
return;
}else{
var str = controle.split(' <==> ');
var codeActe = str[0];
var libelleActe = str[1];
var acteExclu = str[2];
var ententePrealable = str[3];
var datePrescription = $("#datePrescription").val();
var statut = isStatut(codeActe);
//alert(statut);
//return;
if(statut!='1')
{
v_msg="Cet acte n'est pas autorisé!";
v_msgEng="This act is not allowed!";
alert_ebene(v_msg, v_msgEng);
getstatutacte(codeActe);
$('#searchInput').val('');
$("#div_selection").hide();
return;
}
if(acteExclu=="Garanti"){
acteExclu=0;
}else{
acteExclu=1;
}
if(ententePrealable=="Demander Accord"){
ententePrealable=1;
}else{
ententePrealable=0;
}
if(libelleActe<=" ")
{
$("#codeActe").focus();
return;
}
if(acteExclu==1)
{
v_msg="Acte non couvert!";
v_msgEng="Not covered!";
alert_ebene(v_msg, v_msgEng);
return;
}
$("#codeActe").val(codeActe);
$("#libelleActe").val(libelleActe);
//$("#prixTarif").val("0");
//$("#codeGarantie").val("DEN");
$("#acteExclu").val(acteExclu);
$("#ententePrealable").val(ententePrealable);
}
}
function maj_motif_dentaire()
{
motifDentaire = $("#motifDentaire").val();
if (motifDentaire>" ")
{
donnees = "motifDentaire="+motifDentaire;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/majmotifdentaire/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function() {
}
});
}
}
function maj_medecin_dentaire()
{
codeMedecin = $("#codeMedecin").val();
motifDentaire = $("#motifDentaire").val();
donnees = "codeMedecin="+codeMedecin+"&motifDentaire="+motifDentaire;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetaildentisterie/majmedecin/",
type: 'POST',
data: donnees,
success: function(data) {
// maj_fraisexclu_cso();
},
error: function(data) {
},
complete: function() {
}
});
}
function ajax_maj_renouvelable_medicament(idMedicament, renouvelable, controle)
{
donnees = 'idMedicament='+idMedicament+"&renouvelable="+renouvelable;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/majrenouvelable/",
type: 'POST',
data: donnees,
success: function(data) {
$("#medicaments").html(data);
},
error: function(data) {
},
complete: function() {
//controle.focus();
}
});
}
function ajax_maj_frequence_medicament(idMedicament, frequence, controle)
{
debugger;
frequence=frequence.replace(",",".");
controle.value=frequence;
if(controle_numerique(controle))
{
donnees = 'idMedicament='+idMedicament+"&frequence="+frequence;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailprescription/majfrequence/",
type: 'POST',
data: donnees,
success: function(data) {
$("#medicaments").html(data);
},
error: function(data) {
},
complete: function() {
//controle.focus();
}
});
}
}
function ajax_maj_qte_medicament_cso(idLivre, quantite, controle, quantiteRestante, ligne, quantiteRestanteInitiale)
{
quantite=parseInt(quantite.replace(",","."));
controle.value=quantite;
quantiteRestanteInitiale = parseInt(quantiteRestanteInitiale);
if(quantiteRestanteInitiale > 0){
quantiteRestante = quantiteRestanteInitiale;
}
if(isNaN(quantite) || quantite < 0 ){
controle.value = 0;
controle.focus();
return;
}
interdirVentePartielleMedicament = $("#interdirVentePartielleMedicament").val();
if(interdirVentePartielleMedicament=="1"){
if((quantite > 0) && (quantite < quantiteRestante)){
controle.focus();
v_msg="La vente partielle de médicament est interdite!";
v_msgEng="Partial sale of medicine is prohibited!";
alert_ebene(v_msg, v_msgEng);
controle.value = 0;
return;
}
}
if(controle_numerique(controle))
{
if(quantite > parseInt(quantiteRestante)){
controle.focus();
v_msg="La quantité servie est supérieure à la quantité restante! ";
v_msgEng="Review the quantity served, it is greater than the remaining quantity!";
alert_ebene(v_msg, v_msgEng);
controle.value = 0;
return;
}
donnees = 'idLivre='+idLivre+"&quantite="+quantite+'&quantiteRestanteInitiale='+quantiteRestanteInitiale;
//alert(donnees);return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/majquantitecso/",
type: 'POST',
data: donnees,
success: function(data) {
$("#livraison").html(data);
var nbLigne = parseInt($("#nbLigne").val());
$("#qte"+parseInt(ligne+1)).focus();
},
error: function(data) {
},
complete: function() {
controle.focus();
}
});
}
}
function enregistrer_rapport_seance()
{
debugger;
rapportTraitement = $("#rapportTraitement").val();
if (rapportTraitement <= " ")
{
v_msg="Veuillez enregistrer le rapport du traitement des séances!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#rapportTraitement").focus();
return;
}
donnees = 'rapportTraitement='+rapportTraitement;
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionseance/majrapportTraitement/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
//window.location.assign($("#racineWeb" ).val()+"Prescriptionsence/");
},
complete: function()
{
//valider_seance_cso();
}
});
}
function listemedicamentsubstitue(ligne, quantite, tM, codeMedicament)
{
var libelle = $('#searchInput'+ligne).val();
var donnees = 'libelle='+ libelle+'&ligne='+ligne+'&quantite='+quantite+'&tM='+tM+'&codeMedicament='+codeMedicament;
if(libelle.length >="3")
{
vLink = "Ajaxlistemedicamentsubstitue/";
$.ajax({
type: "POST",
url: $("#racineWeb").val()+vLink,
data:donnees,
beforeSend: function(){
$("#searchInput"+ligne).css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px");
},
success: function(data){
$("#div_selection"+ligne).show();
$("#div_selection"+ligne).html(data);
$("#searchInput"+ligne).css("background","#FFF");
}
});
}else{
$("#div_selection"+ligne).hide();
return false;
}
}
function selectElementSubtitue(val, ligne, quantite, tM, codeSubstitut, codeMedicament){
debugger;
var str = val.split(' <==> ');
var libelle = str[0];
var forme = str[1];
var srtGarantie = str[2];
var prix = str[3];
var valeurActe = parseInt(extraitNombre(prix));
if(srtGarantie=="Non garanti"){
v_msg="Attention, ce produit n'est pas remboursé! Voulez-vous continuer?";
v_msgEng="Be careful, this product is not refunded! Do you want to continue?";
tM = 0;
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm) {
tM = 0;
} else {
return false;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm) {
tM = 0;
} else {
return;
}
});
}
}
var fraisReel = valeurActe * parseInt(quantite);
var montantTm = parseInt(fraisReel*parseInt(tM)/100);
var montantArembourser = parseInt(fraisReel) - parseInt(montantTm);
$("#searchInput"+ligne).val(libelle);
$("#div_selection"+ligne).hide();
$("#valeurActe"+ligne).val(formatCurrency(valeurActe));
$("#fraisReel"+ligne).val(formatCurrency(fraisReel));
$("#montantTm"+ligne).val(formatCurrency(montantTm));
$("#montantArembourser"+ligne).val(formatCurrency(montantArembourser));
$("#forme"+ligne).val(forme);
var donnees = "codeMedicament="+codeMedicament+"&codeSubstitut="+codeSubstitut;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacie/majmedicamentsubstitution/",
type: 'POST',
data: donnees,
success: function(data) {
},
error: function(data) {
},
complete: function()
{
}
});
}
function fermer_seance()
{
window.location.assign($("#racineWeb" ).val()+$("#vueParent").val()+"/");
}
function changer_entite_portail()
{
codeSociete=$("#codeSociete").val();
if (codeSociete<=" ")
{
v_msg="Veuillez sélectionner une entité!";
v_msgEng="Please select an entity!";
alert_ebene(v_msg, v_msgEng);
$("#codeSociete").focus();
return;
}
donnees = 'codeSociete='+codeSociete;
v_url = $("#racineWeb").val()+"Ajaxchangerentiteportail/";
$("#div_login_portail").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: v_url,
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
// alert(data);
$("#div_login_portail").html(data);
$("#login").focus();
}
});
}
function changer_langue_connexion()
{
codeLangue = $("#langue").val();
donnees = 'codeLangue='+codeLangue;
$.ajax({
url: $("#racineWeb").val()+"Ajaxconnexioncookie/changerlangue/",
type : 'post',
data: donnees,
error: function(errorData)
{
},
success: function(data)
{
$("#div_detail_connexion").html(data);
},
complete: function()
{
$(".selectpicker").selectpicker();
}
});
}
function affichespecialite()
{
debugger;
donnees = "";
donnees_retour = "";
codeActe = $("#codeActe").val();
nbSpecialite = "0";
donnees = 'codeActe='+codeActe;
faireDefileMessage("", "");
var div_specialite = $('#div_specialite');
div_specialite.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
// div_specialite
$.ajax({
url: $("#racineWeb").val()+"Ajaxspecialiteacte/",
type : 'post',
data: donnees,
error: function(errorData)
{
},
success: function(data)
{
debugger;
donnees_retour = data;
},
complete: function()
{
debugger;
$("#div_specialite").html(donnees_retour);
$(".selectpicker").selectpicker();
acteNuit = $("#acteNuit").val();
nuit = $("#nuit").val();
nbSpecialite = $("#nbSpecialite").val();
//vider_medecin();
if (acteNuit=="1" && nuit=="0")
{
v_msg="Vous ne pouvez pas effectuer cet acte à cette heure!";
v_msgEng="You cannot perform this act at this time!";
alert_ebene(v_msg, v_msgEng);
$("#codeActe").focus();
return;
}
if(nbSpecialite=="1"){
specialite_medecin();
//ajaxprixacte();
}
}
});
}
function consulter_envois_sms()
{
donnees = "";
donnees_retour = "";
date1 = $("#date1").val();
date2 = $("#date2").val();
donnees += 'date1=' + date1;
donnees += '&date2=' + date2;
$("#div_sms").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdestinatairesms/consulter/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_sms").html(donnees_retour);
$("#nbligne").val("Lignes : "+$("#nbligne_info").val());
}
});
}
function vider_medecin(){
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxspecialitemedecin/vider/",
type : 'post',
data: donnees,
error: function(errorData)
{
},
success: function(data)
{
$("#div_medecin").html(data);
},
complete: function()
{
$(".selectpicker").selectpicker();
initialiser_prix_acte();
}
});
}
function initialiser_prix_acte(){
donnees = '';
$.ajax({
url: $("#racineWeb").val()+"Ajaxprixacte/initialiser/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#infosacte").html(data);
},
complete: function() {
}
});
}
function nouvelle_proforma_hopitalisation()
{
debugger;
codeLangue = $("#codeLangue").val();
motifHospitalisation = $('#motifHospitalisation').val();
optionHospitalisation = $('#optionHospitalisation').val();
codeActeChambreHospit = $('#codeActeChambreHospit').val();
dateDebutHospit = $('#dateDebutHospit').val();
dureeHospit = $('#dureeHospit').val();
numeroFeuilleMaladie = $("#numeroFeuilleMaladie").val();
idBeneficiaire = $("#idBeneficiaire").val();
codePrestataire = $("#codePrestataire").val();
if (motifHospitalisation <= " ")
{
v_msg="Veuillez renseigner le motif d'hospitalisation!";
v_msgEng="Please fill in the reason for hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#motifHospitalisation").focus();
return;
}
if (optionHospitalisation <= " ")
{
v_msg="Veuillez renseigner le type d'hospitalisation!";
v_msgEng="Please fill in the type of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#optionHospitalisation").focus();
return;
}
if (codeActeChambreHospit <= " ")
{
v_msg="Veuillez renseigner le type de chambre!";
v_msgEng="Please enter the room type!";
alert_ebene(v_msg, v_msgEng);
$("#codeActeChambreHospit").focus();
return;
}
if (dateDebutHospit<=" ")
{
v_msg="Veuillez saisir la date de d\u00e9but!";
v_msgEng="Please enter the start date!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebutHospit").focus();
return;
}
if (dureeHospit == "0")
{
v_msg="Veuillez renseigner le nombre de jours pr\u00e9visionnels d'hospitalisation!";
v_msgEng="Please fill in the estimated number of days of hospitalization!";
alert_ebene(v_msg, v_msgEng);
$("#dureeHospit").focus();
return;
}
donnees = 'motifHospitalisation='+motifHospitalisation;
donnees += "&optionHospitalisation="+optionHospitalisation;
donnees += "&codeActeChambreHospit="+codeActeChambreHospit;
donnees += "&dateDebutHospit="+dateDebutHospit;
donnees += "&dureeHospit="+dureeHospit;
donnees += "&numeroFeuilleMaladie="+numeroFeuilleMaladie;
donnees += "&idBeneficiaire="+idBeneficiaire;
donnees += "&codePrestataire="+codePrestataire;
v_msg="Confirmez-vous la cr\u00e9ation d'une facture proforma d'hospitalisation chirurgicale?";
v_msgEng="Do you confirm the creation of a surgical hospitalization proforma invoice?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm) {
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisationfeuille/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
$("#div_proforma").html(data);
var idProforma = parseInt($("#idProforma").val());
if(idProforma > "0"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}
},
error: function(data) {
},
complete: function()
{
}
});
} else {
return false;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm) {
$.ajax({
url: $("#racineWeb").val()+"Ajaxproformahospitalisationfeuille/",
type: 'POST',
data: donnees,
success: function(data) {
debugger;
$("#div_proforma").html(data);
var idProforma = parseInt($("#idProforma").val());
if(idProforma > "0"){
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}
},
error: function(data) {
},
complete: function()
{
}
});
} else {
return;
}
});
}
}
function messageSituationProformaHospit(){
debugger;
var optionHospitalisation = $("#optionHospitalisation").val();
var datePrestation = $('#dateDebut').val();
var idBeneficiaire = $('#idBeneficiaire').val();
var estcouvert = $('#estcouvert').val();
var estsorti = $('#estsorti').val();
if(optionHospitalisation == "option-1"){
codeActe = "HHM";
}else if (optionHospitalisation == "option-3"){
codeActe = "HHC";
}else{
codeActe = "";
}
if(estcouvert == "0" || estsorti == "1")
{
v_msg="Proforma impossible \u00e0 \u00e9tablir car ce b\u00e9n\u00e9ficiaire n'est plus couvert par l'assurance!";
v_msgEng="Proforma impossible to establish because this beneficiary is no longer covered by insurance!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
$("#dateDebut").disable();
$("#duree").disable();
$("#motif").disable();
$("#codeMedecin").disable();
$("#codeAffection").disable();
return;
}
ajax_beneficiaire_contexte(idBeneficiaire);
getstatutactedate(codeActe, datePrestation);
var donnees = 'codeActe='+codeActe+'&datePrestation='+datePrestation+'&idBeneficiaire='+idBeneficiaire;
$("#div_reponse").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxsituationproformahospit/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
$("#div_reponse").html(data);
},
complete: function(data)
{
}
});
}
function ajaxbeneficiairecouvert(id)
{
donnees = "idBeneficiaire="+id;
$.ajax({
url: $("#racineWeb").val()+"Ajaxbeneficiairecouvert/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_couverture").html(data);
},
complete: function(data) {
}
});
}
function ajax_beneficiaire_contexte(idBeneficiaire)
{
donnees = 'idBeneficiaire='+idBeneficiaire;
$.ajax({
url: $("#racineWeb").val()+"Ajaxbeneficiairecontexte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
complete: function() {
}
});
}
function getstatutactedate(codeActe, datePrestation)
{
debugger;
donnee_a_affciher = "";
donnees = 'codeActe='+codeActe+'&datePrestation='+datePrestation;
//alert(donnees);
$.ajax({
url: $("#racineWeb").val()+"Ajaxstatutacte/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnee_a_affciher = data;
},
complete: function() {
debugger;
$("#div_statutacte").html(donnee_a_affciher);
var statut = $("#statut").val();
var libelleMotif = $("#libelleMotif").val();
var libelleMotifEng = $("#libelleMotifEng").val();
faireDefileMessage(libelleMotif, libelleMotifEng);
}
});
}
function supprimer_proforma_hospitalisation(idProforma)
{
codeLangue = $("#codeLangue").val();
donnees = 'idProforma='+idProforma;
v_msg="Attention! Confirmez-vous la suppression de cette proforma?";
v_msgEng="Attention! Do you confirm the deletion of this proforma?";
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm) {
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisterproformahospitalisation/supprimer/",
type: 'POST',
data: donnees,
success: function(data) {
listerproformahospitalisation();
},
error: function(data) {
},
complete: function() {
}
});
} else {
return false;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm) {
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisterproformahospitalisation/supprimer/",
type: 'POST',
data: donnees,
success: function(data) {
listerproformahospitalisation();
},
error: function(data) {
},
complete: function() {
}
});
} else {
return;
}
});
}
}
// Fonction pour vérifier si une date est antérieure à aujourd'hui
function verifierDate() {
dateString = $("#dateDebut").val();
// Décomposer la date au format "jj/mm/aaaa"
const [jour, mois, annee] = dateString.split('/').map(Number);
// Créer un objet Date à partir de la date saisie
const dateSaisie = new Date(annee, mois - 1, jour);
// Obtenir la date actuelle sans l'heure
const aujourdHui = new Date();
aujourdHui.setHours(0, 0, 0, 0);
// Vérifier si la date saisie est strictement antérieure à aujourd'hui
if (dateSaisie < aujourdHui) {
v_msg="La date de d\u00e9but ne peut-\u00eatre ant\u00e9rieure \u00e0 la date du jour!";
v_msgEng="The start date cannot be earlier than today!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebut").val("");
$("#dateDebut").focus();
return;
} else{
messageSituationProformaHospit();
}
}
function estDateFuture(date) {
// Obtenir la date d'aujourd'hui sans l'heure
const aujourdHui = new Date();
aujourdHui.setHours(0, 0, 0, 0); // Réinitialiser les heures pour une comparaison pure de dates
// S'assurer que l'argument 'date' est un objet Date
const dateComparee = new Date(date);
dateComparee.setHours(0, 0, 0, 0); // De même, ignorer l'heure
// Comparer les dates
return dateComparee > aujourdHui;
}
function ouvrir_feuillemaladie(numeroBon, dateDebut)
{
debugger;
autoriserBonHospitAvantDate = $("#autoriserBonHospitAvantDate").val();
if(estDateFuture(dateDebut) && autoriserBonHospitAvantDate=="0")
{
v_msg="Hospitalisation chirurgicale non encore autorisée! Attendez, s'il vous plaît, la date de sa programmation. Merci pour votre compréhension!";
v_msgEng="Surgical hospitalization not yet authorized! Please wait for the scheduling date. Thank you for understanding!";
alert_ebene(v_msg, v_msgEng);
faireDefileMessage(v_msg, v_msgEng);
return;
}
donnees = 'numeroBon='+numeroBon;
$.ajax({
url: $("#racineWeb").val()+"Ajaxouvrirfeuillemaladie/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
feuillemaladie();
},
complete: function(data)
{
}
});
}
function verifierDateChambre() {
dateString = $("#dateDebutHospit").val();
// Décomposer la date au format "jj/mm/aaaa"
const [jour, mois, annee] = dateString.split('/').map(Number);
// Créer un objet Date à partir de la date saisie
const dateSaisie = new Date(annee, mois - 1, jour);
// Obtenir la date actuelle sans l'heure
const aujourdHui = new Date();
aujourdHui.setHours(0, 0, 0, 0);
// Vérifier si la date saisie est strictement antérieure à aujourd'hui
if (dateSaisie < aujourdHui) {
v_msg="La date de d\u00e9but ne peut-\u00eatre ant\u00e9rieure \u00e0 la date du jour!";
v_msgEng="The start date cannot be earlier than today!";
alert_ebene(v_msg, v_msgEng);
$("#dateDebutHospit").val("");
$("#dateDebutHospit").focus();
return;
}
}
function change_password()
{
v_msg="Attention, vous serez déconnecté par la suite! Voulez-vous changer votre mot de passe?";
v_msgEng="Attention, you will be logged out afterwards! Do you want to change your password?";
codeLangue = $("#codeLangue").val();
if(codeLangue=="en_US")
{
swal({
title: v_msgEng,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "No",
confirm: "Yes",
}
}).then(function(isConfirm) {
if (isConfirm)
{
window.location.assign($("#racineWeb" ).val()+"Changermotpass/");
}
else
{
return;
}
});
}
else
{
swal({
title: v_msg,
text: "",
icon: 'warning',
buttons: true,
dangerMode: true,
buttons: {
cancel: "Non",
confirm: "Oui",
}
}).then(function(isConfirm) {
if (isConfirm)
{
window.location.assign($("#racineWeb" ).val()+"Changermotpass/");
}
else
{
return;
}
});
}
}
function tarif_applique(tarif)
{
v_msg="Tarif appliqué : "+tarif;
v_msgEng="Price applied : "+tarif;
alert_ebene(v_msg, v_msgEng);
}
function imprimer_facture_seance(idFacture)
{
debugger;
donnees = "idFacture="+idFacture;
var div_export = $('#div_facture_definitive');
div_export.html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaximprimerfacturedefinitive/",
type: 'POST',
data: donnees,
success: function(data)
{
div_export.html(data);
//facturepartielle();
},
error : function(resultat, statut, erreur)
{
},
complete: function(data)
{
//
}
});
}
function creer_proforma_hospitalistation()
{
debugger;
prestationPossible = $("#prestationPossible").val();
face_confirmee = $("#face_confirmee").val();
faceActif = $("#faceActif").val();
codeProfil = $("#codeProfil_C" ).val();
if(prestationPossible == "0" || codeProfil == "PHA" || codeProfil == "OPT" || codeProfil == "LAB" || codeProfil == "SEA"){
v_msg="Non autoris\u00e9e!";
v_msgEng="Not allowed!";
alert_ebene(v_msg, v_msgEng);
return;
}
if ((face_confirmee == "1") || (faceActif != '1')){
window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/");
}else{
v_msg="Veuillez authentifier la photo du patient!";
v_msgEng="Please authenticate the patient's photo!";
alert_ebene(v_msg, v_msgEng);
return;
}
}
function pop_ged_optique()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistegedoptique/",
error: function(errorData) {
},
success: function(data)
{
$("#div_ged").html(data);
},
complete: function() {
$("#btn_pop_ged_optique").click();
}
});
}
function consulter_envois_sms()
{
donnees = "";
donnees_retour = "";
date1 = $("#date1").val();
date2 = $("#date2").val();
donnees += 'date1=' + date1;
donnees += '&date2=' + date2;
$("#div_sms").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdestinatairesms/consulter/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_sms").html(donnees_retour);
$("#nbligne").val("Lignes : "+$("#nbligne_info").val());
}
});
}
function consulter_envois_whatsapp()
{
donnees = "";
donnees_retour = "";
date1 = $("#date1").val();
date2 = $("#date2").val();
donnees += 'date1=' + date1;
donnees += '&date2=' + date2;
$("#div_sms").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdestinatairesms/consulterwhatsapp/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_sms").html(donnees_retour);
$("#nbligne").val("Lignes : "+$("#nbligne_info").val());
}
});
}
function consulter_envois_whatsapp_en_cours()
{
donnees = "";
donnees_retour = "";
date1 = $("#date1").val();
date2 = $("#date2").val();
donnees += 'date1=' + date1;
donnees += '&date2=' + date2;
$("#div_sms").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdestinatairesms/consulterwhatsappencours/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data) {
donnees_retour = data;
},
complete: function() {
$("#div_sms").html(donnees_retour);
$("#nbligne").val("Lignes : "+$("#nbligne_info").val());
}
});
}
function mettre_sms_commun_attente_assureur()
{
textMessage = $("#textMessageCommun").val();
textMessage = textMessage.trim();
if (textMessage<=" ")
{
v_msg="Veuillez saisir le message!";
v_msgEng="Please enter the message!";
alert_ebene(v_msg, v_msgEng);
$("#textMessageCommun").focus();
return;
}
donnees = "textMessage="+textMessage;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdestinatairesms/mettrewhatsappattenteassureur/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
// $('#div_test_gabarit').html(data);
// alert(data);
},
complete: function() {
v_msg="Messages mis dans la queue des envois!";
v_msgEng="Messages in the queue!";
alert_ebene(v_msg, v_msgEng);
re_init_envoi_sms();
}
});
}
function mettre_sms_commun_attente_assure()
{
idAdherent_C = $("#idAdherent_C").val();
if (idAdherent_C<="0")
{
v_msg="Veuillez sélectionner un assuré!";
v_msgEng="Please select an insured!";
alert_ebene(v_msg, v_msgEng);
return;
}
textMessage = $("#textMessageCommun").val();
textMessage = textMessage.trim();
if (textMessage<=" ")
{
v_msg="Veuillez saisir le message!";
v_msgEng="Please enter the message!";
alert_ebene(v_msg, v_msgEng);
$("#textMessageCommun").focus();
return;
}
donnees = "textMessage="+textMessage;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdestinatairesms/mettrewhatsappattenteassure/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
// $('#div_test_gabarit').html(data);
// alert(data);
},
complete: function() {
v_msg="Messages mis dans la queue des envois!";
v_msgEng="Messages in the queue!";
alert_ebene(v_msg, v_msgEng);
re_init_envoi_sms();
}
});
}
function mettre_sms_commun_attente_tous()
{
idAdherent_C = $("#idAdherent_C").val();
if (idAdherent_C<="0")
{
v_msg="Veuillez sélectionner un assuré!";
v_msgEng="Please select an insured!";
alert_ebene(v_msg, v_msgEng);
return;
}
textMessage = $("#textMessageCommun").val();
textMessage = textMessage.trim();
if (textMessage<=" ")
{
v_msg="Veuillez saisir le message!";
v_msgEng="Please enter the message!";
alert_ebene(v_msg, v_msgEng);
$("#textMessageCommun").focus();
return;
}
donnees = "textMessage="+textMessage;
// alert("mettre_sms_commun_attente_tous => idAdherent_C = "+idAdherent_C+" ; "+donnees);
// return;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdestinatairesms/mettrewhatsappattenteassureurassure/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
// $('#div_test_gabarit').html(data);
// alert(data);
},
complete: function() {
v_msg="Messages mis dans la queue des envois!";
v_msgEng="Messages in the queue!";
alert_ebene(v_msg, v_msgEng);
re_init_envoi_sms();
}
});
}
function re_init_envoi_sms()
{
window.location.assign($("#racineWeb" ).val()+"Envoisms/");
}
// KANE 12/04/2025
function envoieprescription_examen()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionexamen/envoieprescriptionexamen/",
type : 'post',
error: function(errorData)
{
},
success: function(data)
{
// alert(data);
// $('#div_test_gabarit').html(data);
},
complete: function() {
feuillemaladie();
}
});
}
function envoieprescription_seance()
{
$.ajax({
url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionseance/envoieprescriptionseance/",
type : 'post',
error: function(errorData)
{
},
success: function(data)
{
// alert(data);
// $('#div_test_gabarit').html(data);
},
complete: function() {
// feuillemaladie();
}
});
}
function actualiser_proforma_hospitalisation()
{
idProforma = $("#idProformaHospitalisation").val();
window.location.assign($("#racineWeb" ).val()+"Hospitalisationproforma/"+idProforma+"/");
}
function verifierContestationAvantOuverture() {
var contestation = $("#contestation").val();
if (contestation == "1") {
// Ne pas ouvrir le modal si contestation == 1
feuillemaladie();
} else {
// Ouvrir le modal si pas de contestation
$('#popRechercheAffection').modal('show');
}
}
function actualiser_contestation(){
const numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val();
if (numeroFeuilleMaladie > "0") {
$.ajax({
url: $("#racineWeb").val()+"Ajaxfeuillemaladie/",
type : 'post',
error: function(errorData)
{
},
success: function(data)
{
// Mise à jour du contenu de la div contestation
$("#div_contestation").html(data);
},
complete: function() {
}
});
}
}
function actualiser_avis_hospitalisation(){
const numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val();
if (numeroFeuilleMaladie > "0") {
$.ajax({
url: $("#racineWeb").val()+"Ajaxfeuillemaladie/avishopitalisation/",
type : 'post',
error: function(errorData)
{
},
success: function(data)
{
// Mise à jour du contenu de la div contestation
$("#div_avis_hos").html(data);
},
complete: function() {
}
});
}
}
function verification_contestation() {
debugger;
// Récupération des valeurs des champs
const bonCaduc = $("#bonCaduc").val();
const facture = $("#facture").val();
const numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val();
const nomForm = $("#nomForm").val();
// Vérification si le numéro de feuille de maladie est valide
if (numeroFeuilleMaladie > "0") {
$.ajax({
url: $("#racineWeb").val() + "Ajaxfeuillemaladie/",
type: 'POST',
success: function(data) {
debugger;
// Mise à jour du contenu de la div contestation
$("#div_contestation").html(data);
// Vérification des conditions de contestation
const contestation = $("#contestation").val();
if (bonCaduc === "0" && facture === "0" && contestation === "1") {
// Affichage de l'alerte en cas de contestation
const v_msg = "Dossier médical contesté !";
const v_msgEng = "Medical records contested!";
alert_ebene_callback(v_msg, v_msgEng, function(){
feuillemaladie();
});
} else {
// Exécution des fonctions spécifiques selon le formulaire
switch(nomForm)
{
case "prescriptionexamens":
enregistrerprescriptionexamen();
break;
case "prescriptionseances":
enregistrerprescriptionseance();
break;
case "Optique":
enregistreroptique();
break;
case "dentaire":
maj_motif_dentaire();
break;
// Possibilité d'ajouter d'autres cas si nécessaire
}
}
},
error: function(xhr, status, error) {
console.error("Erreur AJAX:", status, error);
// Vous pourriez ajouter ici un traitement d'erreur
}
});
}
}
function alertsiprixprestationzero()
{
v_msg="Veuillez saisir au moins un prix de prestation!";
v_msgEng="Please enter at least one service price!";
alert_ebene(v_msg, v_msgEng);
return;
}
function afficherMasquerEnteteProforma()
{
masquerEnteteProforma = $("#masquerEnteteProforma").val();
const element = document.getElementById("chevron-entete-proforma");
if(masquerEnteteProforma=="1"){
$('#div_entete_proforma').hide();
$("#masquerEnteteProforma").val("0");
//$("#span_entete_proforma").text("Afficher");
element.classList.remove("bi-chevron-up");
element.classList.add("bi-chevron-down");
}else{
$('#div_entete_proforma').show();
$("#masquerEnteteProforma").val("1");
//$("#span_entete_proforma").text("Masquer");
element.classList.remove("bi-chevron-down");
element.classList.add("bi-chevron-up");
}
}
function listerrdv()
{
debugger;
d1 = $("#d1").val();
d2 = $("#d2").val();
codeEtatRdv = $("#codeEtatRdv").val();
donnees = 'd1='+ d1+'&d2='+d2+'&codeEtatRdv='+codeEtatRdv;
$("#div_dossiers").html('
' + 'Veuillez patienter... / Please wait...' + ' ');
$.ajax({
url: $("#racineWeb").val()+"Ajaxdemanderdv/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
// alert(data);
debugger;
$('#div_dossiers').html(data);
},
complete: function() {
}
});
}
function selectionner_rdv(idDemande)
{
donnees = 'idDemande='+idDemande;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdemanderdv/selectionner/",
type: 'POST',
data: donnees,
error: function(errorData) {
},
success: function(data) {
// alert(data);
debugger;
},
complete: function() {
ouvrir_rdv();
}
});
}
function ouvrir_rdv()
{
window.location.assign($("#racineWeb" ).val()+"Rendezvous/");
}
function historique_rdv()
{
window.location.assign($("#racineWeb" ).val()+"Historiquerdv/");
}
function valider_rdv()
{
debugger;
numeroDemandeRdv = $("#numeroDemandeRdv").val();
codeEtatRdv = $("#codeEtatRdv").val();
motifReponseRdv = $("#motifReponseRdv").val();
motifReponseRdv = motifReponseRdv.trim();
if(codeEtatRdv=="0"){
v_msg="Un autre état de réponse est obligatoire!";
v_msgEng="Another response status is required!";
alert_ebene(v_msg, v_msgEng);
$("#codeEtatRdv").focus();
return;
}
if (codeEtatRdv=="1"){
dateRdvAccordee = $("#dateRdvAccordee").val();
heureRdvAccordee = $("#heureRdvAccordee").val();
if(dateRdvAccordee<=" "){
v_msg="Une date de rendez-vous est obligatoire!";
v_msgEng="An appointment date is required!";
alert_ebene(v_msg, v_msgEng);
$("#dateRdvAccordee").focus();
return;
}
if(heureRdvAccordee<=" "){
v_msg="Une heure de rendez-vous est obligatoire!";
v_msgEng="An appointment time is required!";
alert_ebene(v_msg, v_msgEng);
$("#heureRdvAccordee").focus();
return;
}
}else{
dateRdvAccordee = "";
heureRdvAccordee = "";
}
if(codeEtatRdv=="9" && motifReponseRdv<=" "){
v_msg="Le motif est obligatoire!";
v_msgEng="The pattern is mandatory!";
alert_ebene(v_msg, v_msgEng);
$("#motifReponseRdv").focus();
return;
}
donnees = 'numeroDemandeRdv='+ numeroDemandeRdv+'&codeEtatRdv='+codeEtatRdv;
donnees += '&dateRdvAccordee='+dateRdvAccordee+'&heureRdvAccordee='+heureRdvAccordee;
donnees += '&motifReponseRdv='+motifReponseRdv;
v_msg="Confirmez-vous la modification de votre demande?";
v_msgEng="Do you confirm the modification of your request?";
confirm_ebene_sweet(v_msg, v_msgEng)
.then((isConfirmed) => {
if (isConfirmed) {
// L'utilisateur a confirmé
vLink = "Ajaxdemanderdv/valider/";
$.ajax({
type: "POST",
url: $("#racineWeb").val()+vLink,
data:donnees,
error: function(errorData) {
},
success: function(data) {
//alert(data);
// $('#div_test_gabarit').html(data);
},
complete: function() {
historique_rdv();
}
});
} else {
// L'utilisateur a annulé
console.log("Confirmation refusée");
}
});
}
function visibilite_date_rdv()
{
codeEtatRdv = $('#codeEtatRdv').val();
if(codeEtatRdv=="0" || codeEtatRdv=="1"){
$('#tr_date').show();
}else{
$('#tr_date').hide();
}
}