Features: - Live encounter recording → HPI (outpatient/inpatient) - Voice dictation → HPI / SOAP note - Hospital course generator (prose/day-by-day/organ system/psych) - Chart review / precharting (outpatient/subspecialty/ED) - SOAP note generator (full/subjective only) - Developmental milestones (AAP/Nelson) with narrative + 3-sentence summary - AI refine & shorten for all outputs - Ask AI what's missing (clarification) - Authentication (email/password, email verification, 2FA) - Nextcloud integration with auto date folders - PWA support (installable on phone) - 18+ AI models via OpenRouter - HIPAA compliance guidance - Docker support
54 lines
2.2 KiB
JavaScript
54 lines
2.2 KiB
JavaScript
(function() {
|
|
function loadNextcloudStatus() {
|
|
fetch('/api/auth/me', { headers: getAuthHeaders() })
|
|
.then(function(r) { return r.json(); })
|
|
.then(function(data) {
|
|
if (data.user && data.user.nextcloud_url) {
|
|
document.getElementById('nc-status').innerHTML = '✅ Connected to <strong>' + data.user.nextcloud_url + '</strong> as ' + data.user.nextcloud_user;
|
|
document.getElementById('nc-url').value = data.user.nextcloud_url;
|
|
document.getElementById('nc-user').value = data.user.nextcloud_user;
|
|
document.getElementById('btn-nc-disconnect').classList.remove('hidden');
|
|
} else {
|
|
document.getElementById('nc-status').textContent = 'Not connected';
|
|
document.getElementById('btn-nc-disconnect').classList.add('hidden');
|
|
}
|
|
});
|
|
}
|
|
|
|
window.loadNextcloudStatus = loadNextcloudStatus;
|
|
|
|
document.getElementById('btn-nc-connect').addEventListener('click', function() {
|
|
var url = document.getElementById('nc-url').value.trim().replace(/\/+$/, '');
|
|
var user = document.getElementById('nc-user').value.trim();
|
|
var pass = document.getElementById('nc-pass').value.trim();
|
|
|
|
if (!url || !user || !pass) { showToast('Fill all Nextcloud fields', 'error'); return; }
|
|
|
|
showLoading('Connecting to Nextcloud...');
|
|
|
|
fetch('/api/nextcloud/connect', {
|
|
method: 'POST',
|
|
headers: getAuthHeaders(),
|
|
body: JSON.stringify({ nextcloudUrl: url, username: user, appPassword: pass })
|
|
})
|
|
.then(function(r) { return r.json(); })
|
|
.then(function(data) {
|
|
hideLoading();
|
|
if (data.success) {
|
|
showToast(data.message, 'success');
|
|
loadNextcloudStatus();
|
|
document.getElementById('nc-pass').value = '';
|
|
} else {
|
|
showToast(data.error || 'Connection failed', 'error');
|
|
}
|
|
})
|
|
.catch(function(err) { hideLoading(); showToast(err.message, 'error'); });
|
|
});
|
|
|
|
document.getElementById('btn-nc-disconnect').addEventListener('click', function() {
|
|
fetch('/api/nextcloud/disconnect', { method: 'POST', headers: getAuthHeaders() })
|
|
.then(function() { showToast('Disconnected', 'info'); loadNextcloudStatus(); });
|
|
});
|
|
|
|
console.log('✅ Nextcloud module loaded');
|
|
})();
|