Personal Kidney Assistant
Enter your Anthropic API Key
to start using the app
🔒 Your key is saved in your browser only
and is never sent to any third party
Personal Kidney Assistant
Active Monitoring
🔔 Active Alerts
Good morning 🫘
💪
Stay consistent with your medications and hydration today.
eGFR
mL/min
Creatinine
mg/dL
HbA1c
%
ACR
mg/g
Potassium
mEq/L
Bicarbonate
mEq/L
Phosphorus
mg/dL
Hemoglobin
g/dL
Uric Acid
mg/dL
🗓 Next Lab Test
🔕 Lab reminder notifications are not enabled.
💊 Medications
No medications added.

🤖 AI Assistant

Ask me anything about your kidney health. Uses real AI when online, offline guide when not connected.
Hello! I'm your personal kidney health assistant. Ask me anything about diet, medications, lab results, or symptoms. 🫘

📖 CKD Stage 3 Knowledge Base

Tap any topic to expand. Based on KDIGO 2024 clinical guidelines.
🥗 Diet & Foods
✅ Safe Foods:
Cabbage · Cauliflower · Green beans · Garlic · Onion · Lettuce · Radish
Apple · Blueberry · Strawberry · Grapes · Pineapple · Cranberry
Egg whites · Skinless chicken · White fish · White rice · White bread · Pasta

❌ Limit or Avoid:
Bananas · Oranges · Potatoes · Tomatoes · Spinach · Avocado
Nuts · Seeds · Dairy (large amounts) · Dark colas · Processed meats · Salt substitutes

📊 Daily Targets:
🧂 Sodium: <2,300 mg/day
🥩 Protein: 0.6–0.8 g/kg body weight/day
🦴 Phosphorus: <800 mg/day
⚗️ Potassium: restrict if levels >5.0 mEq/L
💧 Fluid Intake
General target: 1.5–2 liters/day (unless told otherwise)

⚠️ Signs of fluid retention — call doctor:
• Swelling in legs, ankles, or face
• Sudden weight gain >1 kg/day
• Shortness of breath at rest
• Puffiness around eyes in morning

💡 Remember to count: Soups · Ice cream · Gelatin · Juice · Tea · Coffee
🔬 Understanding Lab Values
TestNormalCKD Target
Creatinine (men)0.7–1.3 mg/dLMonitor trend
Creatinine (women)0.5–1.1 mg/dLMonitor trend
eGFR>60Stage 3: 30–59
ACR (urine)<30 mg/g<30 mg/g
Potassium3.5–5.0 mEq/L3.5–5.0
Phosphorus2.5–4.5 mg/dL2.5–4.5
Bicarbonate22–29 mEq/L>22
Albumin3.5–5.0 g/dL>4.0
Hemoglobin (men)13.5–17.5>11 g/dL
Hemoglobin (women)12.0–15.5>11 g/dL
PTH15–65 pg/mL<2x upper limit
Vitamin D30–100 ng/mL>30 ng/mL
Blood Pressure<120/80<130/80
💊 Medications
❌ Always Avoid:
• NSAIDs: Ibuprofen · Naproxen · Diclofenac · Aspirin (high dose)
• High-dose Vitamin C (>500mg/day)
• Herbal supplements without nephrologist approval
• Contrast dye — always tell radiologist about CKD
• Certain antibiotics need dose adjustment

✅ Common CKD Medications:
• ACE inhibitors or ARBs — protect kidneys, reduce proteinuria
• Diuretics — reduce fluid retention
• Phosphate binders — control phosphorus
• Erythropoietin (ESA) — treat anemia
• Vitamin D supplements — bone protection
• Sodium bicarbonate — treat acidosis

💡 Always inform ALL doctors and pharmacists you have CKD Stage 3
⚠️ Warning Signs
🚨 Call Doctor Immediately:
🔴 Sudden decrease in urination
🔴 Severe swelling in legs, feet, or face
🔴 Shortness of breath at rest
🔴 Chest pain or pressure
🔴 Confusion or difficulty concentrating
🔴 Severe nausea or vomiting
🔴 Blood in urine (red or dark brown)
🔴 BP above 160/100 mmHg

⚠️ Monitor Closely:
🟡 Increasing fatigue or weakness
🟡 Loss of appetite
🟡 Muscle cramps (especially at night)
🟡 Itchy skin
🟡 Foamy or bubbly urine
🟡 Weight gain >1kg in a day
🏃 Lifestyle & Exercise
✅ Recommended:
• Walking 30 min, 5 days/week
• Swimming or cycling (low impact)
• Maintain healthy weight (BMI 18.5–24.9)
• Sleep 7–8 hours per night
• Stress management: meditation, breathing exercises

❌ Avoid:
• Heavy weightlifting without medical clearance
• Smoking — accelerates kidney decline
• Alcohol >1 drink/day
• Dehydration during exercise

📅 Follow-up Schedule:
• Nephrologist: every 3 months
• Labs (creatinine, eGFR, ACR): every 3 months
• Eye exam: annually
• Heart/cardiovascular check: annually
• Vaccinations: Flu (yearly) · Pneumococcal · Hepatitis B
🩸 Blood Pressure Guide
Target for CKD: Below 130/80 mmHg

CategorySystolicDiastolic
Normal<120<80
Elevated120–129<80
High Stage 1130–13980–89
High Stage 2≥140≥90
Crisis>180>120

Tips to lower BP:
• Reduce salt to <2,300 mg/day
• Exercise regularly
• Maintain healthy weight
• Limit alcohol · Stop smoking
• Take medications as prescribed
• Monitor at same time daily
🧮 CKD Stages Explained
StageeGFRDescription
G1≥90Normal function
G260–89Mildly decreased
G3a45–59Mildly-moderately decreased
G3b30–44Moderately-severely decreased
G415–29Severely decreased
G5<15Kidney failure

Albuminuria Categories (ACR):
CategoryACR mg/g
A1 Normal<30
A2 Moderately elevated30–300
A3 Severely elevated>300

💡 Use the 🧮 CKD Calc tab to calculate your current stage from your lab values.
🇹🇷 Türkçe → English Lab Guide
Böbrek Fonksiyonu / Kidney Function
TürkçeEnglishUnit
KreatininCreatininemg/dL
GFR / eGFReGFRmL/min
ÜreUrea / BUNmg/dL
Ürik AsitUric Acidmg/dL
İdrar Albumin/KreatininUrine ACRmg/g
MikroalbüminüriMicroalbuminuriamg/L
Sistatin CCystatin Cmg/L
Elektrolitler / Electrolytes
TürkçeEnglishUnit
SodyumSodiummEq/L
PotasyumPotassiummEq/L
KlorChloridemEq/L
Bikarbonat / HCO3BicarbonatemEq/L
KalsiyumCalciummg/dL
FosforPhosphorusmg/dL
MagnezyumMagnesiummg/dL
Kan Sayımı / Blood Count (CBC)
TürkçeEnglishUnit
Hemoglobin / HbHemoglobing/dL
Hematokrit / HctHematocrit%
Eritrosit / RBCRed Blood CellsM/µL
Lökosit / WBCWhite Blood CellsK/µL
Trombosit / PLTPlateletsK/µL
MCVMean Cell VolumefL
DemirIron / Feµg/dL
Demir Bağlama KapasitesiTIBCµg/dL
FerritinFerritinng/mL
Proteinler / Proteins
TürkçeEnglishUnit
AlbüminAlbuming/dL
Total ProteinTotal Proteing/dL
CRPC-Reactive Proteinmg/L
Sedimentasyon / ESRESRmm/hr
ProkalsitoninProcalcitoninng/mL
Kan Şekeri / Blood Sugar
TürkçeEnglishUnit
Açlık Kan ŞekeriFasting Blood Sugarmg/dL
Tokluk Kan ŞekeriPostprandial Glucosemg/dL
HbA1c / Glikozillenmiş HbHbA1c%
İnsülinInsulinµIU/mL
Lipidler / Lipids
TürkçeEnglishUnit
Total KolesterolTotal Cholesterolmg/dL
TrigliseritTriglyceridesmg/dL
HDL KolesterolHDL Cholesterolmg/dL
LDL KolesterolLDL Cholesterolmg/dL
VLDL KolesterolVLDL Cholesterolmg/dL
Karaciğer / Liver
TürkçeEnglishUnit
ALT / SGPTALT (Liver enzyme)U/L
AST / SGOTAST (Liver enzyme)U/L
ALPAlkaline PhosphataseU/L
GGTGamma-GTU/L
Total BilirubinTotal Bilirubinmg/dL
Direkt BilirubinDirect Bilirubinmg/dL
Tiroit / Thyroid
TürkçeEnglishUnit
TSHTSHmIU/L
Serbest T3 / fT3Free T3pg/mL
Serbest T4 / fT4Free T4ng/dL
Anti-TPOAnti-TPO AntibodyIU/mL
Kemik & Hormonlar / Bone & Hormones
TürkçeEnglishUnit
PTH / Paratiroit HormonuParathyroid Hormonepg/mL
D Vitamini / 25-OH Vit DVitamin Dng/mL
B12 VitaminiVitamin B12pg/mL
Folik AsitFolic Acidng/mL
İdrar Tahlili / Urinalysis
TürkçeEnglish
İdrar RengiUrine Color
Dansite / Özgül AğırlıkSpecific Gravity
pHpH
Protein (İdrarda)Urine Protein
Glikoz (İdrarda)Urine Glucose
Eritrosit (İdrarda)RBC in Urine
Lökosit (İdrarda)WBC in Urine
NitritNitrite
KetonKetones
👁 Diabetic Eye Exam
🧠 Why is the annual eye exam critical with T2DM + CKD?

Diabetes combined with kidney disease is a leading cause of microvascular damage, affecting:
• The eyes (retina)
• The kidneys (glomeruli)
• The nerves (peripheral neuropathy)

When the eyes begin to show damage → the kidneys are likely under stress too, and vice versa. Retinal damage can occur silently with no symptoms.
🔬 The exam includes:
Fundus photography — retinal imaging
OCT (Optical Coherence Tomography) — detailed cross-sectional imaging
Dilated fundus exam — direct ophthalmoscopy after pupil dilation

🧾 What happens based on results?

1 — Normal result
• Continue same level of control
• Repeat exam in 1 year
2 — Mild changes (Mild NPDR)
Mild dot hemorrhages or microaneurysms

Action:
• If post-meal blood sugar is frequently elevated → consider adding Semaglutide (Rybelsus)
• Tighten blood pressure control (target <130/80 mmHg)

If urine ACR is elevated: consider increasing Kerendia dose — only if:
  – Potassium is within normal range
  – No episodes of low blood pressure
3 — Macular edema (center of vision swelling)

Action:
• Intravitreal injections (anti-VEGF)
• Intensive follow-up with ophthalmologist
4 — Advanced stage (Proliferative DR)
New fragile vessels + vitreous hemorrhage

Treatment:
• Retinal laser photocoagulation
• Anti-VEGF injections
• Surgery (vitrectomy) may be required

📝 Save Today's Readings

🌅 MORNING — Before medications
Reading 1
Reading 2 (wait 1-2 min)
🌙 EVENING — Before sleep
Reading 1
Reading 2 (wait 1-2 min)

📅 Recent Readings

No readings yet.

➕ Add Medication

💊 My Medications

No medications added yet.

➕ Add Supplement

🧴 My Supplements

No supplements added yet.

⚠️ Medications to Avoid

❌ NSAIDs: Ibuprofen · Naproxen · Diclofenac
❌ High-dose Vitamin C supplements
❌ Herbal supplements without approval
❌ Contrast dye — notify radiologist of CKD
✅ Always inform all doctors you have CKD

📋 New Lab Report

Upload a lab report image, or enter values manually below.
No files selected
🔑 Report Order
🧪 Remaining Electrolytes
🔩 Iron Studies
🩸 Blood & Proteins
💛 Lipids
🦋 Other

🗂 Archived Reports

No reports archived yet.

🧫 Additional Tests

One-time specialty tests (MPGN workup, immunology, urine studies). Saved separately — do not affect regular lab tracking. Can be included in Doctor Reports.
🔬 Immunological Tests
🧪 Urine Studies
🦠 Viral Serology
📝 Additional Notes

🧮 CKD Stage & KFRE Calculator

Enter values manually or use "Save & Open in CKD Calc" from Labs tab to auto-fill.

📅 Calculation History

No calculations yet.

📄 Medical PDF Report

Generate a professional PDF report with lab results, charts, medications, and AI summary — ready to print or share with your doctor.

📅 Previous Reports

No reports generated yet.

👁 Annual Eye Exam

Record your annual diabetic eye exam. A reminder will appear when 1 year has passed since the last entry.

🗓 Recommended Lab Schedule

Based on KDIGO 2024 & NKF guidelines for CKD Stage 3. Alerts are calculated from your last uploaded report date.
📅 Last report: Not found

⏱ Every 3 Months

📆 Every 6 Months

📅 Every 12 Months — Lab Tests

🏥 Every 12 Months — Clinical Examinations

🔁 As Clinically Indicated

🎨 Appearance

⚙️ Settings

🔑 Enter your Anthropic API Key to get started — saved in your browser only, never shared.

☁️ Backup & Restore

Save your data as a JSON file — store it in iCloud Drive and restore it anytime.
🔄 Auto-backup on changes
Downloads backup file automatically after saving data
iPhone / Documents safe import: open the JSON backup file, copy all text, paste it here, then import.
Last export:

📱 QR Code Sync

Transfer data instantly between iPad and iPhone — no cables, no iCloud files needed.

🔑 API Key Status

Your Anthropic API key enables AI features: lab report extraction, doctor report generation, and health summaries.
Key Status
Tap Check Key to verify
ℹ️ Note: Direct API testing from Safari is blocked by iOS security policies. Your key works correctly for all in-app features (lab extraction, AI summaries, doctor reports). Use the Check Key button to verify the key is saved.

💵 Budget Tracker

Paid Balance ($)
Estimated Balance Remaining
$—
Spent
$—
—% remaining
of $—
📅 Daily Average
$—
⏳ Est. Days Remaining
Last check:

🗂 Usage Log

No usage recorded yet.

'; var w = window.open('','_blank'); if(!w){ alert('Please allow popups to export PDF'); return; } w.document.write(html); w.document.close(); setTimeout(function(){ w.print(); }, 600); } async function generateDoctorReport(){ return generatePDFReport(); } function copyReport(){ var content = document.getElementById('doctorReportContent').innerText; var name = document.getElementById('dr_name').value || 'Patient'; var timestamp = document.getElementById('reportTimestamp').textContent; var full = 'MEDICAL REPORT: ' + name + ' | ' + timestamp + '\n\n' + content; if(navigator.clipboard){ navigator.clipboard.writeText(full).then(function(){ toast('📋 Copied to clipboard!'); }); } else { var ta = document.createElement('textarea'); ta.value = full; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); document.body.removeChild(ta); toast('📋 Copied!'); } } function printReport(){ var content = document.getElementById('doctorReportContent').innerHTML; var name = document.getElementById('dr_name').value || 'Patient'; var timestamp = document.getElementById('reportTimestamp').textContent; var w = window.open('','_blank'); w.document.write( 'Medical Report' + '' + '

🫘 Medical Report — CKD Stage 3b

' + '
Patient: ' + name + '
' + 'Primary Diagnosis: CKD Stage 3b — MPGN Type I (Idiopathic, diagnosed 2005)
' + 'Renal biopsy: MPGN Type I. Workup (HCV, HBsAg, Anti-DNA, ANA) — all negative.
' + timestamp + '
' + content + '' ); w.document.close(); w.print(); } function renderDoctorHistory(){ var c = document.getElementById('doctorReportHistory'); doctorReports = ls('ck_dr_reports', []); if(!doctorReports.length){ c.innerHTML='

No reports generated yet.

'; return; } c.innerHTML = doctorReports.map(function(r){ return '
' + '
' + '📄 ' + r.name + '' + '
' + '' + r.date + '' + '' + '' + '
' + '
' + r.lang + '
' + '
'; }).join(''); } function viewReport(id){ doctorReports = ls('ck_dr_reports', []); var r = doctorReports.find(function(x){ return x.id === id; }); if(!r) return; document.getElementById('doctorReportContent').innerHTML = r.content; document.getElementById('reportTimestamp').textContent = '📅 ' + r.date; document.getElementById('doctorReportResult').style.display = 'block'; document.getElementById('dr_name').value = r.name; window.scrollTo(0, 0); } function delDoctorReport(id){ if(!confirm('Delete this report?')) return; doctorReports = ls('ck_dr_reports', []).filter(function(r){ return r.id !== id; }); lw('ck_dr_reports', doctorReports); renderDoctorHistory(); } var LAB_SCHEDULE = { m3: [ { name: 'Serum Creatinine & eGFR', tr: 'Kreatinin / GFR', reason: 'Core kidney function marker', field: 'cr' }, { name: 'BUN / Urea', tr: 'Üre', reason: 'Waste product filtered by kidneys', field: 'bun' }, { name: 'Potassium (K)', tr: 'Potasyum', reason: 'Critical — risk of hyperkalemia in CKD', field: 'k' }, { name: 'Sodium (Na)', tr: 'Sodyum', reason: 'Electrolyte balance', field: 'na' }, { name: 'Bicarbonate (HCO3)', tr: 'Bikarbonat', reason: 'Metabolic acidosis monitoring', field: 'bicarb' }, { name: 'Phosphorus', tr: 'Fosfor', reason: 'Bone-mineral disease risk', field: 'phos' }, { name: 'Hemoglobin / CBC', tr: 'Hemoglobin / Tam Kan', reason: 'CKD-related anemia monitoring', field: 'hgb' }, { name: 'Urine ACR (Albumin/Creatinine)', tr: 'İdrar Albumin/Kreatinin', reason: 'Proteinuria tracking', field: 'acr' }, ], m6: [ { name: 'HbA1c', tr: 'HbA1c', reason: '3-month average blood sugar', field: 'a1c' }, { name: 'Calcium (Ca)', tr: 'Kalsiyum', reason: 'Bone-mineral disease', field: 'ca' }, { name: 'Albumin', tr: 'Albümin', reason: 'Nutritional & inflammation marker', field: 'alb' }, { name: 'PTH (Parathyroid Hormone)', tr: 'Parathormon / PTH', reason: 'Bone disease in CKD', field: 'pth' }, { name: 'Lipid Panel (Cholesterol/TG/HDL/LDL)', tr: 'Lipid Paneli', reason: 'Cardiovascular risk — high in CKD', field: 'chol' }, { name: 'Uric Acid', tr: 'Ürik Asit', reason: 'Gout risk, CKD progression', field: 'ua' }, { name: 'Ferritin & Iron Studies', tr: 'Ferritin / Demir', reason: 'Anemia workup', field: null }, { name: 'Liver Function (ALT/AST)', tr: 'Karaciğer Enzimleri', reason: 'Medication monitoring', field: null }, ], m12: [ { name: 'Vitamin D (25-OH)', tr: 'D Vitamini', reason: 'Deficiency common in CKD', field: 'vitd' }, { name: 'TSH (Thyroid)', tr: 'TSH', reason: 'Thyroid dysfunction common in CKD', field: 'tsh' }, { name: 'Vitamin B12 & Folate', tr: 'B12 / Folik Asit', reason: 'Anemia workup annually', field: null }, { name: 'Hepatitis B & C Screening', tr: 'Hepatit B & C', reason: 'Dialysis preparation screening', field: null }, ], m12_clinical: [ { name: 'Echocardiogram', tr: 'Ekokardiyogram', reason: 'Cardiac evaluation — high CV risk in CKD', field: null }, { name: 'Kidney Ultrasound', tr: 'Böbrek Ultrasonu', reason: 'Structural evaluation', field: null }, { name: 'Eye Exam (if diabetic)', tr: 'Göz Muayenesi', reason: 'Diabetic nephropathy monitoring', field: null }, { name: 'Bone Density (DEXA)', tr: 'Kemik Yoğunluğu', reason: 'CKD-MBD bone disease', field: null }, { name: 'Vaccinations review', tr: 'Aşı Takvimi', reason: 'Flu, Pneumococcal, Hep B boosters', field: null }, ], prn: [ { name: 'Urine Culture', tr: 'İdrar Kültürü', reason: 'If UTI symptoms present', field: null }, { name: 'Magnesium', tr: 'Magnezyum', reason: 'If on diuretics or malnutrition', field: null }, { name: 'Chloride', tr: 'Klor', reason: 'Acid-base disturbance workup', field: 'cl' }, { name: 'CRP / ESR', tr: 'CRP / Sedimentasyon', reason: 'Infection or inflammation suspected', field: null }, { name: 'Renal Biopsy', tr: 'Böbrek Biyopsisi', reason: 'If cause of CKD unknown or rapid decline', field: null }, { name: 'ANCA / ANA Panel', tr: 'ANCA / ANA', reason: 'If autoimmune cause suspected', field: null }, ] }; function getDaysUntil(lastDate, intervalMonths){ if(!lastDate) return null; var next = new Date(lastDate); next.setMonth(next.getMonth() + intervalMonths); var today = new Date(); var diff = Math.round((next - today) / (1000 * 60 * 60 * 24)); return { next: next, days: diff }; } function statusBadge(days){ var dLabel = LANG==='tr' ? 'g' : 'd'; var inLabel = LANG==='tr' ? 'İçinde' : 'In'; var overdueLabel = LANG==='tr' ? 'Gecikmiş' : 'Overdue'; var dueInLabel = LANG==='tr' ? 'Yakında' : 'Due in'; var noDataLabel = LANG==='tr' ? 'Veri yok' : 'No data'; if(days === null) return ''+noDataLabel+''; if(days < 0) return '⚠️ '+overdueLabel+' '+Math.abs(days)+dLabel+''; if(days <= 14) return '🔔 '+dueInLabel+' '+days+dLabel+''; if(days <= 30) return '📅 '+inLabel+' '+days+dLabel+''; return '✅ '+inLabel+' '+days+dLabel+''; } function renderScheduleSection(sectionId, tests, intervalMonths, lastDate){ var c = document.getElementById(sectionId); if(!c) return; var overdueCount = 0; var html = tests.map(function(t, i){ var info = getDaysUntil(lastDate, intervalMonths); var days = info ? info.days : null; var nextDate = info ? info.next.toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'}) : '—'; if(days !== null && days < 0) overdueCount++; var safeId = sectionId + '_' + i; return '
' + '
' + '
' + '
🔬 ' + t.name + '
' + '
🇹🇷 ' + t.tr + '
' + '
' + t.reason + '
' + (lastDate ? '
Next: ' + nextDate + '
' : '') + '
' + '
' + statusBadge(days) + '
' + '
'; }).join(''); c.innerHTML = html; // Store test data for modal lookup if(!window._scheduleTests) window._scheduleTests = {}; tests.forEach(function(t, i){ window._scheduleTests[sectionId + '_' + i] = t; }); return overdueCount; } function parseReportDate(r){ // Prefer the editable report date saved by the user if(r.reportDate && /^\d{4}-\d{2}-\d{2}$/.test(r.reportDate)){ return new Date(r.reportDate+'T12:00:00').getTime(); } // Try name field first (Turkish format DD.MM.YYYY) var name = r.name || ''; var m = name.match(/(\d{2})\.(\d{2})\.(\d{4})/); if(m) return new Date(parseInt(m[3]), parseInt(m[2])-1, parseInt(m[1])).getTime(); // Try sortDate field if(r.sortDate) return r.sortDate; // Fallback to id (insertion time) return r.id || 0; } function sortReports(reps){ return reps.slice().sort(function(a, b){ return parseReportDate(b) - parseReportDate(a); // newest first }); } function getLastReportDate(){ var reports = ls('ck_reports', []); if(!reports.length) return null; // Sort by actual report date (not entry date) and pick the most recent var sorted = sortReports(reports); var latest = sorted[0]; // Use parseReportDate to get the real test date from report name (DD.MM.YYYY) var ts = parseReportDate(latest); if(ts) { var d = new Date(ts); if(!isNaN(d.getTime())) return d; } // Fallback: try latest.date field var d2 = new Date(latest.date); if(!isNaN(d2.getTime())) return d2; return null; } function refreshSchedule(){ var lastDate = getLastReportDate(); var lastDateStr = lastDate ? lastDate.toLocaleDateString('en-US',{month:'long',day:'numeric',year:'numeric'}) : 'No reports found'; document.getElementById('lastReportDate').textContent = lastDateStr; var overdue3 = renderScheduleSection('schedule_3m', LAB_SCHEDULE.m3, 3, lastDate) || 0; var overdue6 = renderScheduleSection('schedule_6m', LAB_SCHEDULE.m6, 6, lastDate) || 0; var overdue12 = renderScheduleSection('schedule_12m', LAB_SCHEDULE.m12, 12, lastDate) || 0; renderScheduleSection('schedule_12m_clinical', LAB_SCHEDULE.m12_clinical, 12, lastDate); renderScheduleSection('schedule_prn', LAB_SCHEDULE.prn, 999, null); // Alert banner var totalOverdue = overdue3 + overdue6 + overdue12; var banner = document.getElementById('alertBanner'); if(totalOverdue > 0 && lastDate){ banner.style.display = 'block'; var overdueMsg = LANG==='tr' ? '⚠️ ' + totalOverdue + ' gecikmiş lab testi
Bu testleri yakında nefrologunuzla planlayın.
' : '⚠️ ' + totalOverdue + ' overdue lab test' + (totalOverdue>1?'s':'') + '
Please schedule these tests with your nephrologist soon.
'; banner.innerHTML = '
' + overdueMsg + '
'; } else if(lastDate) { banner.style.display = 'block'; var okMsg = LANG==='tr' ? '✅ Tüm testler zamanında
Düzenli izlemeye devam edin!
' : '✅ All tests are on schedule
Keep up with regular monitoring!
'; banner.innerHTML = '
' + okMsg + '
'; } else { banner.style.display = 'none'; } } /* ── iPhone / PWA lab reminder notifications ─────────────── */ function updateLabNotificationUI(){ var status = document.getElementById('labNotifStatus'); var btn = document.getElementById('labNotifBtn'); if(!status || !btn) return; if(!('Notification' in window)){ status.textContent = LANG==='tr' ? '⚠️ Bu görüntüleyici bildirimleri desteklemiyor. Uygulamayı iPhone Ana Ekranından açın.' : '⚠️ This viewer does not support notifications. Open the app from the iPhone Home Screen.'; btn.style.display = 'none'; return; } if(Notification.permission === 'granted'){ status.textContent = LANG==='tr' ? '🔔 Sonraki test tarihine 3 gün veya daha az kaldığında bildirim etkin.' : '🔔 Alert enabled when 3 days or less remain before the next lab test.'; btn.textContent = LANG==='tr' ? 'Etkin' : 'Enabled'; btn.disabled = true; btn.style.opacity = '0.65'; } else if(Notification.permission === 'denied'){ status.textContent = LANG==='tr' ? '🚫 Bildirim izni kapalı. iPhone Ayarlar → Bildirimler bölümünden izin verin.' : '🚫 Notification permission is blocked. Enable it in iPhone Settings → Notifications.'; btn.textContent = LANG==='tr' ? 'Engellendi' : 'Blocked'; btn.disabled = true; btn.style.opacity = '0.65'; } else { status.textContent = LANG==='tr' ? '🔕 Yaklaşan laboratuvar testi için iPhone bildirimini etkinleştirin.' : '🔕 Enable an iPhone alert for the upcoming periodic lab test.'; btn.textContent = LANG==='tr' ? 'Bildirimi Aç' : 'Enable Alert'; btn.disabled = false; btn.style.opacity = '1'; btn.style.display = ''; } } async function enableLabNotifications(ev){ if(ev){ ev.preventDefault(); ev.stopPropagation(); } if(!('Notification' in window)){ alert(LANG==='tr' ? 'Bu görüntüleyici bildirimleri desteklemiyor. Uygulamayı Safari üzerinden Ana Ekrana ekleyip oradan açın.' : 'This viewer does not support notifications. Add the app to the Home Screen from Safari and open it there.'); return; } try{ var permission = await Notification.requestPermission(); updateLabNotificationUI(); if(permission === 'granted'){ localStorage.setItem('ck_lab_notif_enabled','1'); var title = LANG==='tr' ? 'Böbrek Uygulaması Bildirimleri' : 'Kidney App Notifications'; var body = LANG==='tr' ? 'Yaklaşan periyodik laboratuvar testleri için bildirimler etkinleştirildi.' : 'Notifications are enabled for upcoming periodic lab tests.'; new Notification(title,{body:body,tag:'kidney-lab-enabled'}); if(window._nextLabReminder) checkLabReminderNotification(window._nextLabReminder, true); } }catch(err){ alert((LANG==='tr'?'Bildirim etkinleştirilemedi: ':'Could not enable notifications: ') + err.message); } } function localDateKey(d){ var y=d.getFullYear(), m=String(d.getMonth()+1).padStart(2,'0'), day=String(d.getDate()).padStart(2,'0'); return y+'-'+m+'-'+day; } function checkLabReminderNotification(reminder, forceCheck){ if(!reminder || !('Notification' in window) || Notification.permission !== 'granted') return; if(reminder.days > 3) return; var dueKey = localDateKey(reminder.next); var todayKey = localDateKey(new Date()); var sentKey = 'ck_lab_notif_sent_' + dueKey + '_' + todayKey; if(!forceCheck && localStorage.getItem(sentKey)==='1') return; var title, body; if(reminder.days < 0){ title = LANG==='tr' ? '⚠️ Laboratuvar testi gecikti' : '⚠️ Lab test overdue'; body = LANG==='tr' ? Math.abs(reminder.days)+' gün gecikmiş: '+reminder.name+'. Lütfen test tarihini planlayın.' : reminder.name+' is '+Math.abs(reminder.days)+' day(s) overdue. Please schedule the test.'; } else if(reminder.days === 0){ title = LANG==='tr' ? '🧪 Laboratuvar testi bugün' : '🧪 Lab test due today'; body = LANG==='tr' ? reminder.name+' için planlanan tarih bugün.' : reminder.name+' is scheduled for today.'; } else { title = LANG==='tr' ? '🔔 Laboratuvar testi yaklaşıyor' : '🔔 Upcoming lab test'; body = LANG==='tr' ? reminder.name+' için '+reminder.days+' gün kaldı. Tarih: '+reminder.next.toLocaleDateString('tr-TR') : reminder.days+' day(s) remain before '+reminder.name+'. Due: '+reminder.next.toLocaleDateString('en-US'); } try{ new Notification(title,{ body:body, tag:'kidney-lab-'+dueKey }); localStorage.setItem(sentKey,'1'); }catch(e){} } document.addEventListener('visibilitychange',function(){ if(document.visibilityState==='visible'){ updateLabNotificationUI(); if(window._nextLabReminder) checkLabReminderNotification(window._nextLabReminder); } }); window.addEventListener('focus',function(){ updateLabNotificationUI(); if(window._nextLabReminder) checkLabReminderNotification(window._nextLabReminder); }); setInterval(function(){ if(window._nextLabReminder) checkLabReminderNotification(window._nextLabReminder); }, 6 * 60 * 60 * 1000); function goTab(id, btn){ // Update pages document.querySelectorAll('.page').forEach(function(p){ p.classList.remove('show'); }); var pg = document.getElementById('pg-'+id); if(pg) pg.classList.add('show'); // Haptic if(window.navigator && window.navigator.vibrate) window.navigator.vibrate(6); // Update bottom nav active state document.querySelectorAll('.tab-btn').forEach(function(b){ b.classList.remove('on'); }); if(btn) { btn.classList.add('on'); } else { // Find matching tab btn by data-id var found = document.querySelector('#bottomNav .tab-btn[data-id="'+id+'"]'); if(found) found.classList.add('on'); else document.getElementById('moreTabBtn').classList.add('on'); } // Run page-specific renders if(id==='dash') renderDashboard(); if(id==='log') renderLogs(); if(id==='meds'){renderMeds();renderSupps();} if(id==='labs'){ renderArchive(); renderAdditionalTests(); var today=new Date().toISOString().slice(0,10); var atd=document.getElementById('at_date'); if(atd&&!atd.value) atd.value=today; } // Reset archive view when leaving labs if(id !== 'labs' && _archiveExpanded){ _archiveExpanded = false; } if(id==='doctor'){ renderDoctorHistory(); renderEyeExams(); var today = new Date().toISOString().slice(0,10); var d = document.getElementById('eyeExamDate'); if(d && !d.value) d.value = today; } if(id==='docnotes'){ renderDocNotes(); var today2=new Date().toISOString().slice(0,10); var dn=document.getElementById('dnDate'); if(dn&&!dn.value) dn.value=today2; } if(id==='medreports'){ renderMedReports(); var today3=new Date().toISOString().slice(0,10); var mr=document.getElementById('mr_date'); if(mr&&!mr.value) mr.value=today3; } if(id==='schedule') refreshSchedule(); if(id==='nutrition') renderNutritionPage(); if(id==='trends'){ renderTrends(); renderRefRangesList(); ucInit(); initChartSelect(); } if(id==='ckd') renderCKDHistory(); if(id==='apimon') initApiMonitor(); if(id==='settings'){ var le = ls('last_export',''); var elx = document.getElementById('lastExportDate'); if(elx) elx.textContent = le ? fmtDateTime(le) : '—'; var ks = document.getElementById('keyStatus'); if(ks && KEY){ ks.textContent='✅ Key saved — you can now use the app'; ks.style.color='#2dbd7e'; } initAutoBackupToggle(); applyLang(); } window.scrollTo(0,0); } function toggleMoreSheet(){ var sheet = document.getElementById('moreSheet'); var overlay = document.getElementById('moreOverlay'); var isOpen = sheet.classList.contains('open'); if(isOpen){ closeMoreSheet(); } else { overlay.style.display = 'block'; setTimeout(function(){ sheet.classList.add('open'); }, 10); if(window.navigator && window.navigator.vibrate) window.navigator.vibrate(6); } } function closeMoreSheet(){ var sheet = document.getElementById('moreSheet'); var overlay = document.getElementById('moreOverlay'); sheet.classList.remove('open'); setTimeout(function(){ overlay.style.display = 'none'; }, 350); } boot();
More

📝 Add Doctor Recommendation

Record your doctor's recommendations after each visit.

📋 Visit History

No recommendations recorded yet.

📋 Add Medical Report

Record summaries of 24-hour blood pressure monitoring, 24-hour glucose monitoring, or any other specialist medical report.
🌅 Daytime Averages (07:00–22:00)
🌙 Nighttime Averages (22:00–07:00)
📊 24h Overall

🗂 Report History

No medical reports recorded yet.

🥗 CKD Nutrition Guide
Daily limits for CKD Stage 3b. Protein limit is based on your weight — enter it below.
kg