👨‍⚕️ Connectez-vous à votre espace praticien

Pas encore de compte ?

?
🟢 ACTIF
0
🩺 CONSULTATIONS
0
📅 AUJOURD'HUI
📋 CONSULTATIONS RÉCENTES
Consultation VIVIA
ÉTAPE 01 / 03

👤 Identification Patient

Renseignez le profil du patient à consulter

ÉTAPE 02 / 03

🩺 Symptômes

Sélectionnez tous les symptômes observés

Symptômes observés
🌡️ Fièvre
🫁 Toux
🦠 Diarrhée
🧠 Maux de tête
🥶 Frissons
💧 Sueurs nocturnes
⚡ Fatigue
🤢 Nausées
🫃 Ventre douloureux
💨 Essoufflement
👁️ Yeux rouges
🩸 Pâleur
🥤 Soif intense
🔥 Brûlure urinaire
🔴 Éruption cutanée
😮 Gorge douloureuse
👂 Douleur oreille
🟡 Jaunisse
⚠️ Raideur nuque
🦴 Articulations
🫀 Toux avec crachats
💔 Douleur thoracique
Description complémentaire
📷 Photo clinique (optionnel)
📷
Ajouter une photo clinique
Plaie · Éruption · Œil · Gorge · Peau
⚕ VIVIA MEDICAL AI
?
🏥 Établissement
🌍 Pays
📧 Email
📱 Téléphone
✅ StatutActif
VIVIA-ID: —
'); w.document.close(); } function shareOrdonnance(){ var doc=document.getElementById('rxDoc'); if(!doc){toast('Ordonnance non disponible');return;} if(navigator.share){ var html='Ordonnance VIVIA' +'' +''+doc.outerHTML+''; var blob=new Blob([html],{type:'text/html'}); var file=new File([blob],'ordonnance-'+PT.cid+'.html',{type:'text/html'}); navigator.share({title:'Ordonnance VIVIA — '+PT.prenom+' '+(PT.nom||''),files:[file]}) .catch(function(e){if(e.name!=='AbortError') printOrdonnance();}); } else { printOrdonnance(); toast('Utilisez Imprimer → Enregistrer comme PDF pour partager'); } } function saveConsultServer(diag, dateStr, retry){ retry=retry||0; var tok=getToken(); if(!tok) return; fetch(API+'/saveConsult',{ method:'POST', headers:hdrs(), body:JSON.stringify({ cid:PT.cid, prenom:PT.prenom, nom:PT.nom, age:PT.age, sexe:PT.sexe, poids:PT.poids, pays:PT.pays, chips:PT.chips, diagnostic:diag, date:dateStr }) }).then(function(r){ if(r.ok){ toast('✅ Consultation enregistrée', 2000); } else if(r.status===401&&retry<1){ JWT=localStorage.getItem('vivia_jwt'); if(JWT) saveConsultServer(diag,dateStr,1); } else { r.json().then(function(e){ console.error('[saveConsult]',r.status,e); }); } }).catch(function(e){ console.error('[saveConsult réseau]',e.message); }); } /* UI CHAT */ function addMsg(type,txt){ var el=document.getElementById('chatMsgs'); if(!el) return; // Séparer le texte principal des choix rapides var mainTxt=txt, choices=[]; var choixMatch=txt.match(/CHOIX:\s*\[([^\]]+)\]/); if(choixMatch){ mainTxt=txt.replace(/CHOIX:\s*\[[^\]]+\]/,'').trim(); choices=choixMatch[1].split('|').map(function(c){return c.trim();}).filter(Boolean); } // Bulle message var d=document.createElement('div'); d.className='msg '+(type==='ai'?'msg-ai':'msg-usr'); var safe=esc(mainTxt).replace(/\*\*(.*?)\*\*/g,'$1').replace(/\n/g,'
'); d.innerHTML=safe; el.appendChild(d); // Boutons choix rapides (seulement pour messages IA) if(type==='ai'&&choices.length>0){ // Supprimer anciens boutons var old=document.getElementById('quickChoices'); if(old) old.remove(); var qc=document.createElement('div'); qc.id='quickChoices'; qc.className='quick-choices'; var lbl=document.createElement('div'); lbl.className='qc-label'; lbl.textContent='Réponses rapides :'; qc.appendChild(lbl); choices.forEach(function(c){ var btn=document.createElement('button'); btn.className='qc-btn'; btn.textContent=c; btn.onclick=function(){ // Supprimer les boutons qc.remove(); // Envoyer le choix comme message var ta=document.getElementById('chatTa'); if(ta){ ta.value=c; sendMsg(); } }; qc.appendChild(btn); }); el.appendChild(qc); } el.scrollTop=el.scrollHeight; } function addTyping(){ var el=document.getElementById('chatMsgs'); if(!el) return; var d=document.createElement('div'); d.id='typ'; d.className='msg msg-ai typ'; d.innerHTML=''; el.appendChild(d); el.scrollTop=el.scrollHeight; } function removeTyping(){ var t=document.getElementById('typ'); if(t) t.remove(); } function setInput(v){ BUSY=!v; var ta=document.getElementById('chatTa'); if(ta) ta.disabled=!v; var sb=document.getElementById('sendBtn'); if(sb) sb.disabled=!v; } /* MODAL IDENTIFICATION PRATICIEN */ function openIdModal(){ if(!USER) return; document.getElementById('idAva').textContent=(USER.prenom||'?')[0].toUpperCase(); document.getElementById('idName').textContent=(USER.prenom||'')+' '+(USER.nom||''); document.getElementById('idRole').textContent=(USER.role||'Praticien').toUpperCase(); document.getElementById('idEtab').textContent=USER.etablissement||'—'; document.getElementById('idPays').textContent=USER.pays||'—'; document.getElementById('idEmail').textContent=USER.email||'—'; document.getElementById('idTel').textContent=USER.telephone||'—'; document.getElementById('idNum').textContent='VIVIA-ID: '+(USER.id||'').toString().slice(0,8).toUpperCase(); document.getElementById('idBg').classList.add('open'); } function closeId(){ document.getElementById('idBg').classList.remove('open'); } function printId(){ var u=USER||{}; var w=window.open('','_blank','width=420,height=600'); w.document.write('Carte VIVIA
⚕ VIVIA MEDICAL AI
'+(((u.prenom||'?')[0]).toUpperCase())+'
'+(u.prenom||'')+' '+(u.nom||'')+'
'+((u.role||'').toUpperCase())+'
🏥 Établissement'+(u.etablissement||'—')+'
🌍 Pays'+(u.pays||'—')+'
📧 Email'+(u.email||'—')+'
✅ StatutActif
VIVIA-ID: '+(u.id||'').toString().slice(0,8).toUpperCase()+' · viviahealth.ca
window.print();'); w.document.close(); } /* ═══════════════════════════════════════════════════ BOOTSTRAP v10.1 ⚠️ TOUJOURS afficher la page de connexion ⚠️ JAMAIS d'auto-login ⚠️ Garder localStorage (callAI en a besoin) ═══════════════════════════════════════════════════ */ (function(){ JWT = null; USER = null; goScreen('authScreen'); })(); /* ═══════════════════════════════════════════════════ BOOTSTRAP v10.1 ⚠️ TOUJOURS afficher la page de connexion ⚠️ JAMAIS d'auto-login ⚠️ Garder localStorage (callAI en a besoin) ═══════════════════════════════════════════════════ */ (function(){ JWT = null; USER = null; goScreen('authScreen'); })();