Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisioneRevisione precedente | |||
docuneo:programma_npt [2025/08/01 06:02] – neoadmin | docuneo:programma_npt [2025/08/02 21:46] (versione attuale) – neoadmin | ||
---|---|---|---|
Linea 3: | Linea 3: | ||
<meta charset=" | <meta charset=" | ||
<meta name=" | <meta name=" | ||
- | < | + | < |
+ | <script src=" | ||
< | < | ||
body { | body { | ||
Linea 26: | Linea 27: | ||
border-bottom: | border-bottom: | ||
padding-bottom: | padding-bottom: | ||
+ | } | ||
+ | |||
+ | .version-info { | ||
+ | text-align: center; | ||
+ | font-size: 12px; | ||
+ | color: #7f8c8d; | ||
+ | margin-bottom: | ||
} | } | ||
Linea 210: | Linea 218: | ||
.hidden { | .hidden { | ||
- | display: none !important; | + | display: none; |
} | } | ||
- | | + | /* CSS TAB ORIZZONTALI |
- | display: block !important; | + | |
- | } | + | |
- | + | ||
- | | + | |
.tabs { | .tabs { | ||
display: flex; | display: flex; | ||
Linea 226: | Linea 230: | ||
.tab { | .tab { | ||
- | padding: | + | padding: |
background-color: | background-color: | ||
border: 1px solid #ddd; | border: 1px solid #ddd; | ||
Linea 234: | Linea 238: | ||
transition: all 0.3s ease; | transition: all 0.3s ease; | ||
text-align: center; | text-align: center; | ||
- | min-width: | + | min-width: |
flex: 1; | flex: 1; | ||
- | max-width: | + | max-width: |
+ | font-size: 12px; | ||
} | } | ||
Linea 311: | Linea 316: | ||
} | } | ||
- | | + | .config-table { |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
font-size: 12px; | font-size: 12px; | ||
- | line-height: | ||
- | max-width: 800px; | ||
- | margin: 0 auto; | ||
- | border: 1px solid #ddd; | ||
} | } | ||
- | .report-header | + | .config-table th, .config-table td { |
- | display: flex; | + | border: |
- | justify-content: | + | padding: |
- | align-items: | + | |
- | border-bottom: 2px solid #333; | + | |
- | padding-bottom: 10px; | + | |
- | | + | |
} | } | ||
- | .report-header-left | + | .config-table th { |
- | | + | |
+ | color: white; | ||
} | } | ||
- | .report-header-right | + | .config-table input { |
- | width: 100px; | + | width: 60px; |
- | height: 60px; | + | |
- | | + | border: 1px solid #ddd; |
- | border: 1px solid #ccc; | + | |
- | | + | |
- | align-items: center; | + | |
- | justify-content: | + | |
- | font-size: 10px; | + | |
- | color: #666; | + | |
} | } | ||
- | .report-title { | + | .component-name { |
- | font-size: 14px; | + | |
font-weight: | font-weight: | ||
- | | + | |
+ | text-align: left !important; | ||
} | } | ||
- | .report-subtitle | + | |
- | | + | |
- | | + | |
- | | + | |
+ | | ||
+ | padding: 20px; | ||
+ | margin: 20px 0; | ||
} | } | ||
- | .report-section | + | .config-advanced h3 { |
- | margin-bottom: | + | color: #0c5460; |
+ | margin-top: 0; | ||
+ | border-bottom: | ||
+ | padding-bottom: | ||
} | } | ||
- | .report-section-title { | + | .monitoring-table { |
- | background-color: | + | |
- | color: white; | + | |
- | padding: 5px 10px; | + | |
- | font-weight: | + | |
- | font-size: 12px; | + | |
- | margin-bottom: | + | |
- | } | + | |
- | + | ||
- | .report-table { | + | |
width: 100%; | width: 100%; | ||
border-collapse: | border-collapse: | ||
- | font-size: | + | |
+ | | ||
} | } | ||
- | .report-table td { | + | .monitoring-table th, .monitoring-table td { |
- | padding: 3px 8px; | + | border: 1px solid #17a2b8; |
- | border-bottom: 1px solid #ddd; | + | padding: 8px; |
- | | + | |
} | } | ||
- | .report-table | + | .monitoring-table |
- | | + | |
- | | + | |
} | } | ||
- | .report-table .value-col | + | .alert-critical |
- | | + | |
+ | color: white; | ||
+ | padding: 15px; | ||
+ | border-radius: | ||
+ | margin: 15px 0; | ||
font-weight: | font-weight: | ||
} | } | ||
- | .composition-table { | + | |
- | | + | |
- | border-collapse: collapse; | + | |
- | | + | border-radius: 10px; |
- | margin-top: | + | |
+ | margin-top: | ||
+ | background-color: | ||
+ | font-family: | ||
+ | line-height: | ||
} | } | ||
- | .composition-table th { | + | .medical-header |
- | background-color: | + | |
- | padding: 5px 8px; | + | |
text-align: center; | text-align: center; | ||
- | | + | |
- | | + | |
+ | margin-bottom: | ||
} | } | ||
- | .composition-table td { | + | .medical-header h1 { |
- | | + | |
- | | + | |
- | | + | |
} | } | ||
- | .composition-table .component-name-col | + | .medical-header h2 { |
- | | + | |
- | | + | color: #34495e; |
+ | | ||
} | } | ||
- | .composition-total { | + | .medical-header p { |
- | | + | |
- | | + | |
+ | | ||
} | } | ||
- | .elements-table { | + | .no-print { |
- | | + | |
- | border-collapse: | + | |
- | font-size: 11px; | + | |
- | margin-top: 0; | + | |
- | } | + | |
- | + | ||
- | .elements-table td { | + | |
- | padding: 3px 8px; | + | |
- | border-bottom: | + | |
- | } | + | |
- | + | ||
- | .elements-table .element-name { | + | |
- | width: 200px; | + | |
- | } | + | |
- | + | ||
- | .elements-table .element-value { | + | |
- | text-align: right; | + | |
- | font-weight: | + | |
- | width: 80px; | + | |
- | } | + | |
- | + | ||
- | .elements-table .element-unit { | + | |
- | text-align: left; | + | |
- | width: 40px; | + | |
- | font-size: 10px; | + | |
- | } | + | |
- | + | ||
- | .report-footer { | + | |
- | margin-top: 30px; | + | |
- | padding-top: | + | |
- | border-top: 1px solid #ddd; | + | |
- | font-size: 10px; | + | |
- | color: #666; | + | |
- | text-align: center; | + | |
} | } | ||
@media print { | @media print { | ||
- | .npt-report | + | .no-print { |
- | | + | |
- | border: none; | + | |
- | margin: 0; | + | |
- | padding: 15px; | + | |
} | } | ||
- | | + | |
- | .button | + | |
- | | + | |
} | } | ||
- | | + | .container |
- | | + | |
- | | + | |
} | } | ||
} | } | ||
Linea 484: | Linea 446: | ||
<div class=" | <div class=" | ||
- | < | + | < |
+ | <div class=" | ||
+ | < | ||
+ | </div> | ||
| | ||
- | <!-- TAB ORIZZONTALI --> | + | <!-- TAB ORIZZONTALI |
<div class=" | <div class=" | ||
<div class=" | <div class=" | ||
- | <span style=" | + | <span style=" |
</ | </ | ||
+ | | ||
+ | <!-- SEZIONE CONFIGURAZIONE COMPONENTI (DA VERSIONE 17) --> | ||
<div class=" | <div class=" | ||
- | <span style=" | + | <span style=" |
</ | </ | ||
<div class=" | <div class=" | ||
- | <span style=" | + | <span style=" |
</ | </ | ||
<div class=" | <div class=" | ||
- | <span style=" | + | <span style=" |
+ | </ | ||
+ | <div class=" | ||
+ | <span style=" | ||
</ | </ | ||
<div class=" | <div class=" | ||
- | <span style=" | + | <span style=" |
</ | </ | ||
</ | </ | ||
- | <!-- TAB 1: DATI PAZIENTE --> | + | <!-- TAB 1: DATI PAZIENTE |
<div id=" | <div id=" | ||
<div class=" | <div class=" | ||
Linea 522: | Linea 492: | ||
<label for=" | <label for=" | ||
<select id=" | <select id=" | ||
- | <option value=""> | + | <!-- Popolato dinamicamente --> |
- | <option value=" | + | |
- | <option value=" | + | |
- | <option value=" | + | |
- | <option value=" | + | |
- | <option value=" | + | |
- | <option value=" | + | |
</ | </ | ||
</ | </ | ||
Linea 557: | Linea 521: | ||
<div class=" | <div class=" | ||
<label for=" | <label for=" | ||
- | <input type=" | + | <input type=" |
</ | </ | ||
<div class=" | <div class=" | ||
Linea 610: | Linea 574: | ||
</ | </ | ||
- | <!-- TAB 2: NUTRIZIONE ENTERALE --> | + | <!-- TAB 2: NUTRIZIONE ENTERALE |
<div id=" | <div id=" | ||
<div class=" | <div class=" | ||
Linea 709: | Linea 673: | ||
</ | </ | ||
- | <!-- TAB 3: CALCOLO FABBISOGNI --> | + | <!-- TAB 3: CALCOLO FABBISOGNI |
<div id=" | <div id=" | ||
<div class=" | <div class=" | ||
Linea 839: | Linea 803: | ||
</ | </ | ||
- | <!-- TAB 4: NUTRIZIONE PARENTERALE --> | + | <!-- TAB 4: NUTRIZIONE PARENTERALE |
<div id=" | <div id=" | ||
<div class=" | <div class=" | ||
Linea 881: | Linea 845: | ||
<div id=" | <div id=" | ||
| | ||
- | <div style=" | + | <div style=" |
- | | + | <button class=" |
- | <p style=" | + | <button class=" |
- | <div style=" | + | |
- | | + | |
- | <button id=" | + | |
- | < | + | |
- | <button id=" | + | |
- | <button id=" | + | |
- | </div> | + | |
</ | </ | ||
- | | ||
- | <div id=" | ||
- | <div id=" | ||
</ | </ | ||
</ | </ | ||
- | <!-- TAB 5: CONFIGURAZIONE | + | <!-- TAB 5: REPORT FINALE (SPOSTATO DA TAB 6) --> |
- | <div id="config" class=" | + | <div id="report" class=" |
<div class=" | <div class=" | ||
- | < | + | < |
- | < | + | < |
</ | </ | ||
| | ||
+ | <div class=" | ||
+ | < | ||
+ | <button class=" | ||
+ | <button class=" | ||
+ | <button class=" | ||
+ | </ | ||
+ | | ||
+ | <div id=" | ||
+ | </ | ||
+ | |||
+ | <!-- TAB 6: CONFIGURAZIONE (SPOSTATO DA TAB 5) --> | ||
+ | <div id=" | ||
+ | <div class=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
<div class=" | <div class=" | ||
< | < | ||
Linea 911: | Linea 881: | ||
<div class=" | <div class=" | ||
<label for=" | <label for=" | ||
- | <input type=" | + | <input type=" |
</ | </ | ||
<div class=" | <div class=" | ||
Linea 922: | Linea 892: | ||
<div class=" | <div class=" | ||
<button id=" | <button id=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | | ||
+ | <div class=" | ||
+ | < | ||
+ | <div style=" | ||
+ | <table class=" | ||
+ | < | ||
+ | <tr> | ||
+ | <th style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | </ | ||
+ | <tbody id=" | ||
+ | <!-- Popolato dinamicamente --> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <button id=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <button class=" | ||
</ | </ | ||
</ | </ | ||
Linea 927: | Linea 931: | ||
<div class=" | <div class=" | ||
- | <h2>Informazioni Sistema</ | + | <h2>Fortificanti in Polvere (Valori per 100g)</ |
- | < | + | < |
- | <strong>📊 NPT Calculator v2.0 - Stato Sistema</strong>< | + | <table class=" |
- | <strong>• Database Formule:</strong> 9 formule enterali configurate< | + | < |
- | <strong>• Database Componenti:</strong> 8 componenti parenterali configurati< | + | < |
- | <strong>• Medici Prescrittori: | + | <th style=" |
- | <strong>• Algoritmi:</strong> Calcoli BUN, fasi nutrizionali, | + | < |
- | | + | <th>Carboidrati< |
- | <strong>• Ultimo Aggiornamento:</strong> Agosto 2025 | + | < |
+ | <th>Sodio< | ||
+ | <th>Potassio<br> | ||
+ | <th>Calcio< | ||
+ | < | ||
+ | <th>Magnesio< | ||
+ | < | ||
+ | <th style=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | <tbody id=" | ||
+ | < | ||
+ | <td class=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <td style=" | ||
+ | <td><button class=" | ||
+ | </ | ||
+ | </ | ||
+ | | ||
</ | </ | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <button id=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <button class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=" | ||
+ | < | ||
+ | <div style=" | ||
+ | <table class=" | ||
+ | < | ||
+ | <tr> | ||
+ | <th style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <th style=" | ||
+ | < | ||
+ | </tr> | ||
+ | </ | ||
+ | <tbody id=" | ||
+ | <!-- Popolato dinamicamente --> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <button id=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <button class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=" | ||
+ | < | ||
+ | <div class=" | ||
+ | < | ||
+ | Gestisci la lista dei medici prescrittori. Le modifiche si applicano automaticamente alla dropdown del TAB 1. | ||
+ | </ | ||
+ | <div style=" | ||
+ | <table class=" | ||
+ | < | ||
+ | <tr> | ||
+ | <th style=" | ||
+ | <th style=" | ||
+ | <th style=" | ||
+ | <th style=" | ||
+ | < | ||
+ | </tr> | ||
+ | </ | ||
+ | <tbody id=" | ||
+ | <!-- Popolato dinamicamente --> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <button id=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <button class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <!-- SEZIONE CONFIGURAZIONE CLINICA AVANZATA (NOVITÀ) --> | ||
+ | <div class=" | ||
+ | < | ||
+ | | ||
+ | <div class=" | ||
+ | < | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | <span style=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | <span style=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | <span style=" | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | <span style=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | <span style=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | <span style=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <button class=" | ||
+ | </ | ||
+ | |||
+ | <div class=" | ||
+ | < | ||
+ | <table class=" | ||
+ | < | ||
+ | <tr> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | </ | ||
+ | < | ||
+ | <tr> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | <tr> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | <tr> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | <tr> | ||
+ | < | ||
+ | <td>2 volte/ | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | <tr> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </tr> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=" | ||
+ | < | ||
+ | <div class=" | ||
+ | < | ||
+ | • Glicemia > 250 mg/dL o < 40 mg/ | ||
+ | • Trigliceridi > 400 mg/ | ||
+ | • AST/ALT > 3x valore normale< | ||
+ | • Segni di sepsi cateter-correlata< | ||
+ | • Edema importante con bilancio positivo > 20 ml/kg/die | ||
+ | </ | ||
+ | | ||
+ | <div class=" | ||
+ | < | ||
+ | • GIR > 12 mg/kg/min → Ridurre glucosio< | ||
+ | • BUN > 20 mg/dL → Ridurre proteine< | ||
+ | • BUN < 5 mg/dL → Aumentare proteine< | ||
+ | • Trigliceridi 200-400 mg/dL → Ridurre/ | ||
+ | • Ipernatremia → Ridurre sodio, aumentare liquidi liberi | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=" | ||
+ | < | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <select id=" | ||
+ | <option value=" | ||
+ | <option value=" | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <label for=" | ||
+ | <select id=" | ||
+ | <option value=" | ||
+ | <option value=" | ||
+ | <option value=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <button class=" | ||
+ | <button class=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div id=" | ||
+ | < | ||
+ | <div id=" | ||
</ | </ | ||
</ | </ | ||
Linea 942: | Linea 1206: | ||
< | < | ||
- | // DATI NUTRIZIONALI COMPLETI | + | // DATI NUTRIZIONALI COMPLETI |
- | var formulaData = { | + | const formulaData = { |
maternal: { name: "Latte Materno", | maternal: { name: "Latte Materno", | ||
maternal_fortified: | maternal_fortified: | ||
Linea 955: | Linea 1219: | ||
}; | }; | ||
- | // CONFIGURAZIONI PARENTERALI COMPLETE | + | // CONFIGURAZIONI PARENTERALI COMPLETE |
- | var parenteralConfig = { | + | const parenteralConfig = { |
+ | trophamine: { | ||
+ | name: " | ||
+ | protein: 6.0, carbs: 0, lipids: 0, sodium: 0, potassium: 0, | ||
+ | calcium: 0, phosphorus: 0, magnesium: 0, energy: 24, water: 94, | ||
+ | description: | ||
+ | notes: " | ||
+ | }, | ||
+ | intralipid: { | ||
+ | name: " | ||
+ | protein: 0, carbs: 0, lipids: 20.0, sodium: 0, potassium: 0, | ||
+ | calcium: 0, phosphorus: 0, magnesium: 0, energy: 200, water: 80, | ||
+ | description: | ||
+ | notes: " | ||
+ | }, | ||
+ | glucose50: { | ||
+ | name: " | ||
+ | protein: 0, carbs: 50.0, lipids: 0, sodium: 0, potassium: 0, | ||
+ | calcium: 0, phosphorus: 0, magnesium: 0, energy: 200, water: 50, | ||
+ | description: | ||
+ | notes: " | ||
+ | }, | ||
ca_gluconato: | ca_gluconato: | ||
- | name: " | + | name: " |
- | | + | |
- | | + | |
+ | description: | ||
+ | notes: "8.4 mg Ca/ml. Non precipita con fosfati" | ||
}, | }, | ||
esafosfina: { | esafosfina: { | ||
- | name: " | + | name: " |
- | | + | |
- | | + | |
+ | description: | ||
+ | notes: "16 mg P/ml + 1.3 mEq Na/ml. Fosforo organico" | ||
}, | }, | ||
mg_sulfate: { | mg_sulfate: { | ||
- | name: " | + | name: " |
- | | + | |
- | | + | |
+ | description: | ||
+ | notes: "8 mEq Mg/ml. Cofattore enzimatico" | ||
}, | }, | ||
nacl: { | nacl: { | ||
- | name: "Sodio Cloruro", | + | name: "Sodio Cloruro |
- | | + | |
- | | + | |
+ | description: | ||
+ | notes: "10 mEq Na/ml. Prima scelta per supplementazione sodio" | ||
}, | }, | ||
sodium_acetate: | sodium_acetate: | ||
- | name: "Sodio Acetato", | + | name: "Sodio Acetato |
- | | + | |
- | | + | |
+ | description: | ||
+ | notes: "6.67 mEq Na/ml. Per acidosi: pH < 7.25 o BE < -4" | ||
}, | }, | ||
kcl: { | kcl: { | ||
- | name: " | + | name: " |
- | | + | |
- | protein: 0, carbs: 0, lipids: 0, energy: 0, water: 99 | + | calcium: 0, phosphorus: 0, magnesium: 0, energy: 0, water: 99, |
+ | description: | ||
+ | notes: "10 mEq K/ml. Max velocità infusione: 0.5 mEq/ | ||
+ | }, | ||
+ | carnitene: { | ||
+ | name: " | ||
+ | protein: 0, carbs: 0, lipids: 0, sodium: 0, potassium: 0, | ||
+ | calcium: 0, phosphorus: 0, magnesium: 0, energy: 0, water: 99, | ||
+ | carnitine: 10000, // 100 mg/ml = 10000 mg/100ml | ||
+ | description: | ||
+ | notes: "100 mg/ml. Indicata per NPT > 1 mese. Dose: 5 mg/ | ||
} | } | ||
}; | }; | ||
- | // Database medici | + | // Database fortificanti dinamico |
- | var doctorsData = { | + | let fortifierData = { |
+ | prenidina_fm85: | ||
+ | name: " | ||
+ | protein: 14, carbs: 4, lipids: 2.5, sodium: 2, potassium: 15, | ||
+ | calcium: 3500, phosphorus: 2000, magnesium: 150, energy: 400, | ||
+ | dose: " | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | // Database medici | ||
+ | let doctorsData = { | ||
dr_bellu: { name: " | dr_bellu: { name: " | ||
dr_condo: { name: " | dr_condo: { name: " | ||
Linea 996: | Linea 1311: | ||
dr_meroni: { name: " | dr_meroni: { name: " | ||
dr_calzatini: | dr_calzatini: | ||
- | dr_ferrari: { name: " | + | dr_ferrari: { name: " |
+ | dr_ferendeles: | ||
+ | dr_fumagalli_l: | ||
+ | dr_fumagalli_m: | ||
+ | dr_corno: { name: " | ||
+ | dr_evasi: { name: " | ||
+ | dr_cereda: { name: " | ||
+ | dr_ceccon: { name: " | ||
+ | dr_nava: { name: " | ||
+ | dr_terenzi: { name: " | ||
+ | dr_raffa: { name: " | ||
+ | dr_aquisti: { name: " | ||
}; | }; | ||
// VARIABILI GLOBALI | // VARIABILI GLOBALI | ||
- | var patientData = {}; | + | let patientData = {}; |
- | var enteralData = null; | + | let enteralData = null; |
- | window.currentActiveReport | + | let currentRequirements |
- | // INIZIALIZZAZIONE | + | // CONFIGURAZIONE CLINICA AVANZATA |
- | document.addEventListener(' | + | let clinicalConfig = { |
- | | + | |
- | | + | phosphorusReq: |
- | }); | + | magnesiumReq: |
+ | maxGIR: 12.0, | ||
+ | | ||
+ | maxProtein: 4.5, | ||
+ | hospitalName: | ||
+ | departmentName: | ||
+ | directorName: | ||
+ | }; | ||
- | // FUNZIONE | + | // FUNZIONE |
- | function | + | function |
- | | + | |
- | | + | |
- | | + | nutritionBtn.className |
+ | nutritionBtn.innerHTML = ' | ||
+ | |||
+ | // Nascondi | ||
+ | const nutritionResults = document.getElementById(' | ||
+ | | ||
+ | nutritionResults.classList.add('hidden'); | ||
+ | } | ||
+ | |||
+ | // Reset anche il pulsante NPT perché i fabbisogni sono cambiati | ||
+ | resetParenteralButton(); | ||
} | } | ||
- | | + | } |
- | | + | |
- | | + | // FUNZIONE RESET PULSANTE PARENTERALE |
- | | + | function resetParenteralButton() { |
+ | | ||
+ | | ||
+ | parenteralBtn.className | ||
+ | parenteralBtn.innerHTML = ' | ||
+ | |||
+ | // Reset anche i campi visualizzati | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | | ||
+ | | ||
+ | const parenteralResults = document.getElementById(' | ||
+ | if (parenteralResults) { | ||
+ | parenteralResults.classList.add('hidden'); | ||
+ | } | ||
} | } | ||
+ | } | ||
+ | |||
+ | // FUNZIONE CORRETTA PER CAMBIO TAB | ||
+ | function showTab(tabId) { | ||
+ | // Nascondi tutti i contenuti dei tab | ||
+ | document.querySelectorAll(' | ||
+ | content.classList.remove(' | ||
+ | }); | ||
+ | | ||
+ | // Rimuovi classe active da tutti i tab | ||
+ | document.querySelectorAll(' | ||
+ | tab.classList.remove(' | ||
+ | }); | ||
| | ||
- | | + | |
+ | const targetContent = document.getElementById(tabId); | ||
if (targetContent) { | if (targetContent) { | ||
targetContent.classList.add(' | targetContent.classList.add(' | ||
} | } | ||
| | ||
- | event.target.closest(' | + | |
+ | const clickedTab = event.target.closest(' | ||
+ | if (clickedTab) { | ||
+ | clickedTab.classList.add(' | ||
+ | } | ||
+ | |||
+ | // Popola le tabelle di configurazione quando si apre il TAB 6 (ora config) | ||
+ | if (tabId === ' | ||
+ | setTimeout(() => { | ||
+ | populateEnteralConfigTable(); | ||
+ | populateParenteralConfigTable(); | ||
+ | populateDoctorsConfigTable(); | ||
+ | }, 100); | ||
+ | } | ||
} | } | ||
- | // FUNZIONE CALCOLO FASE | + | // FUNZIONE GESTIONE CARTELLA CLINICA |
+ | function setupMedicalRecordField() { | ||
+ | const medicalRecordInput = document.getElementById(' | ||
+ | const currentYear = new Date().getFullYear().toString(); | ||
+ | |||
+ | // Imposta il valore iniziale con l'anno corrente | ||
+ | if (!medicalRecordInput.value) { | ||
+ | medicalRecordInput.value = currentYear; | ||
+ | } | ||
+ | |||
+ | // Gestisce l' | ||
+ | medicalRecordInput.addEventListener(' | ||
+ | let value = e.target.value.replace(/ | ||
+ | |||
+ | // Se l' | ||
+ | if (value.length < 4 || !value.startsWith(currentYear)) { | ||
+ | value = currentYear + value.slice(4); | ||
+ | } | ||
+ | |||
+ | // Limita a 10 cifre totali | ||
+ | if (value.length > 10) { | ||
+ | value = value.slice(0, | ||
+ | } | ||
+ | |||
+ | e.target.value = value; | ||
+ | }); | ||
+ | |||
+ | // Quando il campo ottiene il focus, posiziona il cursore dopo l' | ||
+ | medicalRecordInput.addEventListener(' | ||
+ | if (e.target.value === currentYear) { | ||
+ | // Posiziona il cursore alla fine | ||
+ | setTimeout(() => { | ||
+ | e.target.setSelectionRange(4, | ||
+ | }, 0); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | // Suggerimento visivo | ||
+ | medicalRecordInput.addEventListener(' | ||
+ | if (e.target.value === currentYear) { | ||
+ | e.target.placeholder = currentYear + ' | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | function updateDoctorsDropdown() { | ||
+ | const prescribingDoctorSelect = document.getElementById(' | ||
+ | if (!prescribingDoctorSelect) return; | ||
+ | |||
+ | const currentValue = prescribingDoctorSelect.value; | ||
+ | prescribingDoctorSelect.innerHTML = '< | ||
+ | |||
+ | Object.keys(doctorsData).forEach(function(key) { | ||
+ | const doctor = doctorsData[key]; | ||
+ | const option = document.createElement(' | ||
+ | option.value = key; | ||
+ | option.textContent = doctor.fullName; | ||
+ | prescribingDoctorSelect.appendChild(option); | ||
+ | }); | ||
+ | |||
+ | // Ripristina il valore precedente se esiste ancora | ||
+ | if (currentValue && doctorsData[currentValue]) { | ||
+ | prescribingDoctorSelect.value = currentValue; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // FUNZIONE CALCOLO FASE NUTRIZIONALE (DA VERSIONE 17) | ||
function calculatePhase() { | function calculatePhase() { | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
+ | |||
+ | // Trova il nome completo del medico | ||
+ | const doctorFullName = prescribingDoctorValue && doctorsData[prescribingDoctorValue] ? | ||
+ | doctorsData[prescribingDoctorValue].fullName : '' | ||
| | ||
patientData = { | patientData = { | ||
medicalRecord: | medicalRecord: | ||
- | birthWeight: | + | birthWeight: |
- | currentWeight: | + | currentWeight: |
daysOfLife: daysOfLife, | daysOfLife: daysOfLife, | ||
bun: bun, | bun: bun, | ||
Linea 1057: | Linea 1513: | ||
diuresis: diuresis, | diuresis: diuresis, | ||
prescriptionDate: | prescriptionDate: | ||
- | prescribingDoctor: | + | prescribingDoctor: |
+ | prescribingDoctorName: | ||
}; | }; | ||
| | ||
document.getElementById(' | document.getElementById(' | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
| | ||
+ | // Analisi BUN | ||
if (bun && bun !== '' | if (bun && bun !== '' | ||
- | | + | |
if (bunValue < 9) { | if (bunValue < 9) { | ||
bunStatus = 'Basso - Aumentare proteine'; | bunStatus = 'Basso - Aumentare proteine'; | ||
- | bunWarning = 'BUN basso: considerare aumento | + | bunWarning = 'BUN basso: considerare aumento |
} else if (bunValue > 14) { | } else if (bunValue > 14) { | ||
bunStatus = ' | bunStatus = ' | ||
- | bunWarning = 'BUN elevato: ridurre | + | bunWarning = 'BUN elevato: ridurre |
} else { | } else { | ||
bunStatus = ' | bunStatus = ' | ||
Linea 1081: | Linea 1539: | ||
} | } | ||
| | ||
- | | + | |
+ | let otherWarnings = []; | ||
+ | |||
+ | if (glucose && glucose !== '' | ||
+ | const glucoseValue = parseFloat(glucose); | ||
+ | if (glucoseValue < 70) { | ||
+ | otherWarnings.push(' | ||
+ | } else if (glucoseValue > 150) { | ||
+ | otherWarnings.push(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if (sodium && sodium !== '' | ||
+ | const sodiumValue = parseFloat(sodium); | ||
+ | if (sodiumValue < 135) { | ||
+ | otherWarnings.push(' | ||
+ | } else if (sodiumValue > 145) { | ||
+ | otherWarnings.push(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if (ph && ph !== '' | ||
+ | const phValue = parseFloat(ph); | ||
+ | if (phValue < 7.35) { | ||
+ | otherWarnings.push(' | ||
+ | } else if (phValue > 7.45) { | ||
+ | otherWarnings.push(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if (baseExcess && baseExcess !== '' | ||
+ | const beValue = parseFloat(baseExcess); | ||
+ | if (beValue < -4) { | ||
+ | otherWarnings.push(' | ||
+ | } else if (beValue > 2) { | ||
+ | otherWarnings.push(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // Raccomandazione combinata pH + BE per Sodio Acetato | ||
+ | if (ph && baseExcess) { | ||
+ | const phValue = parseFloat(ph); | ||
+ | const beValue = parseFloat(baseExcess); | ||
+ | if (phValue < 7.25 || beValue < -4) { | ||
+ | otherWarnings.push(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if (diuresis && diuresis !== '' | ||
+ | const diuresisValue = parseFloat(diuresis); | ||
+ | if (diuresisValue < 1) { | ||
+ | otherWarnings.push(' | ||
+ | } else if (diuresisValue > 3) { | ||
+ | otherWarnings.push(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | let phaseInfoHtml = '< | ||
phaseInfoHtml += '< | phaseInfoHtml += '< | ||
phaseInfoHtml += '< | phaseInfoHtml += '< | ||
Linea 1088: | Linea 1603: | ||
phaseInfoHtml += '< | phaseInfoHtml += '< | ||
} | } | ||
- | phaseInfoHtml += '< | + | phaseInfoHtml += '< |
phaseInfoHtml += '< | phaseInfoHtml += '< | ||
- | phaseInfoHtml += '< | + | phaseInfoHtml += '< |
phaseInfoHtml += '</ | phaseInfoHtml += '</ | ||
phaseInfoHtml += '< | phaseInfoHtml += '< | ||
Linea 1096: | Linea 1611: | ||
if (patientData.bun) { | if (patientData.bun) { | ||
phaseInfoHtml += '< | phaseInfoHtml += '< | ||
+ | } | ||
+ | if (patientData.glucose) { | ||
+ | const gluStatus = parseFloat(patientData.glucose) >= 70 && parseFloat(patientData.glucose) <= 110 ? ' | ||
+ | phaseInfoHtml += '< | ||
+ | } | ||
+ | if (patientData.sodium) { | ||
+ | const naStatus = parseFloat(patientData.sodium) >= 135 && parseFloat(patientData.sodium) <= 145 ? ' | ||
+ | phaseInfoHtml += '< | ||
+ | } | ||
+ | if (patientData.ph) { | ||
+ | const phStatus = parseFloat(patientData.ph) >= 7.35 && parseFloat(patientData.ph) <= 7.45 ? ' | ||
+ | phaseInfoHtml += '< | ||
+ | } | ||
+ | if (patientData.baseExcess) { | ||
+ | const beStatus = parseFloat(patientData.baseExcess) >= -4 && parseFloat(patientData.baseExcess) <= 2 ? ' | ||
+ | phaseInfoHtml += '< | ||
+ | } | ||
+ | if (patientData.diuresis) { | ||
+ | const diuStatus = parseFloat(patientData.diuresis) >= 1 && parseFloat(patientData.diuresis) <= 3 ? ' | ||
+ | phaseInfoHtml += '< | ||
} | } | ||
phaseInfoHtml += '</ | phaseInfoHtml += '</ | ||
Linea 1102: | Linea 1637: | ||
if (bunWarning) { | if (bunWarning) { | ||
phaseInfoHtml += '< | phaseInfoHtml += '< | ||
+ | } | ||
+ | | ||
+ | if (otherWarnings.length > 0) { | ||
+ | phaseInfoHtml += '< | ||
} | } | ||
| | ||
Linea 1111: | Linea 1650: | ||
document.getElementById(' | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
+ | | ||
+ | // Aggiorna il suggerimento sodio se il TAB 3 è già stato visitato | ||
+ | updateSodiumRecommendation(); | ||
+ | | ||
+ | // RESET anche il pulsante NPT | ||
+ | resetParenteralButton(); | ||
} | } | ||
+ | // FUNZIONE AGGIORNAMENTO OPZIONI FORTIFICANTE | ||
function updateFortifierOptions() { | function updateFortifierOptions() { | ||
- | | + | |
- | | + | |
+ | const fortifierSelect = document.getElementById(' | ||
| | ||
if (formulaType === ' | if (formulaType === ' | ||
fortifierSection.classList.remove(' | fortifierSection.classList.remove(' | ||
+ | | ||
+ | fortifierSelect.innerHTML = '< | ||
+ | Object.keys(fortifierData).forEach(function(key) { | ||
+ | const option = document.createElement(' | ||
+ | option.value = key; | ||
+ | option.textContent = fortifierData[key].name; | ||
+ | fortifierSelect.appendChild(option); | ||
+ | }); | ||
} else { | } else { | ||
fortifierSection.classList.add(' | fortifierSection.classList.add(' | ||
+ | fortifierSelect.value = ' | ||
} | } | ||
} | } | ||
+ | // FUNZIONE AGGIORNAMENTO DISPLAY CONCENTRAZIONE | ||
function updateConcentrationDisplay() { | function updateConcentrationDisplay() { | ||
- | | + | |
document.getElementById(' | document.getElementById(' | ||
} | } | ||
+ | // FUNZIONE CALCOLO NUTRIZIONE ENTERALE (DA VERSIONE 17) | ||
function calculateEnteral() { | function calculateEnteral() { | ||
- | | + | |
- | alert(' | + | const enteralCurrentWeight = parseInt(document.getElementById(' |
+ | const enteralBirthWeight = parseInt(document.getElementById(' | ||
+ | |||
+ | if (!enteralCurrentWeight || !enteralBirthWeight) { | ||
+ | alert(' | ||
return; | return; | ||
} | } | ||
| | ||
- | | + | |
- | | + | if (!patientData.currentWeight) { |
- | | + | patientData.currentWeight = enteralCurrentWeight; |
- | | + | patientData.birthWeight = enteralBirthWeight; |
- | | + | } |
- | | + | |
+ | const formulaType = document.getElementById(' | ||
+ | | ||
+ | | ||
+ | | ||
+ | const currentWeight = patientData.currentWeight; | ||
+ | | ||
+ | | ||
| | ||
if (formulaType === ' | if (formulaType === ' | ||
Linea 1151: | Linea 1720: | ||
}; | }; | ||
| | ||
- | | + | |
if (additionalFluids > 0) { | if (additionalFluids > 0) { | ||
tableHtml += '< | tableHtml += '< | ||
Linea 1162: | Linea 1731: | ||
document.getElementById(' | document.getElementById(' | ||
} else { | } else { | ||
- | | + | |
- | | + | |
| | ||
+ | // Calcoli finali per kg di peso | ||
enteralData = { | enteralData = { | ||
volume: dailyVolume, | volume: dailyVolume, | ||
Linea 1180: | Linea 1750: | ||
}; | }; | ||
| | ||
- | | + | |
tableHtml += '< | tableHtml += '< | ||
tableHtml += '< | tableHtml += '< | ||
if (additionalFluids > 0) { | if (additionalFluids > 0) { | ||
- | tableHtml += '< | + | tableHtml += '< |
tableHtml += '< | tableHtml += '< | ||
} else { | } else { | ||
Linea 1204: | Linea 1774: | ||
document.getElementById(' | document.getElementById(' | ||
| | ||
- | | + | |
+ | const enteralBtn = document.getElementById(' | ||
if (enteralBtn) { | if (enteralBtn) { | ||
enteralBtn.className = ' | enteralBtn.className = ' | ||
enteralBtn.innerHTML = ' | enteralBtn.innerHTML = ' | ||
} | } | ||
+ | | ||
+ | // RESET del pulsante Fabbisogni quando si modificano gli apporti enterali | ||
+ | resetNutritionButton(); | ||
} | } | ||
+ | // FUNZIONE CARICAMENTO VALORI STANDARD (DA VERSIONE 17) | ||
function loadNutritionDefaults() { | function loadNutritionDefaults() { | ||
- | | + | |
- | alert(' | + | const defaultsCurrentWeight = parseInt(document.getElementById(' |
+ | const defaultsBirthWeight = parseInt(document.getElementById(' | ||
+ | const defaultsDaysOfLife = parseInt(document.getElementById(' | ||
+ | |||
+ | if (!defaultsCurrentWeight || !defaultsBirthWeight || !defaultsDaysOfLife) { | ||
+ | alert(' | ||
return; | return; | ||
} | } | ||
| | ||
- | | + | |
- | | + | if (!patientData.currentWeight) { |
+ | patientData.currentWeight = defaultsCurrentWeight; | ||
+ | patientData.birthWeight = defaultsBirthWeight; | ||
+ | patientData.daysOfLife = defaultsDaysOfLife; | ||
+ | } | ||
+ | |||
+ | const targetDay = parseInt(document.getElementById(' | ||
+ | | ||
| | ||
- | | + | |
- | | + | |
weightCategorySelect.value = selectedCategory; | weightCategorySelect.value = selectedCategory; | ||
| | ||
- | | + | |
if (selectedCategory === ' | if (selectedCategory === ' | ||
plan = targetDay <= 3 ? {liquids: 100, protein: 3.5, carbs: 8.0, lipids: 1.0} : | plan = targetDay <= 3 ? {liquids: 100, protein: 3.5, carbs: 8.0, lipids: 1.0} : | ||
Linea 1233: | Linea 1820: | ||
} | } | ||
| | ||
+ | // Aggiustamento BUN | ||
if (patientData.bun && patientData.bun !== '' | if (patientData.bun && patientData.bun !== '' | ||
- | | + | |
if (bunValue < 9) { | if (bunValue < 9) { | ||
plan.protein = Math.min(6.0, | plan.protein = Math.min(6.0, | ||
Linea 1246: | Linea 1834: | ||
document.getElementById(' | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
- | document.getElementById(' | + | |
- | document.getElementById(' | + | // Usa configurazione clinica per elettroliti |
- | document.getElementById(' | + | |
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
| | ||
- | | + | |
- | | + | const sodiumSelect = document.getElementById(' |
+ | if (patientData.ph || patientData.baseExcess) { | ||
+ | const ph = patientData.ph ? parseFloat(patientData.ph) : null; | ||
+ | const be = patientData.baseExcess ? parseFloat(patientData.baseExcess) : null; | ||
+ | |||
+ | // Auto-seleziona Sodio Acetato se acidosi | ||
+ | if ((ph && ph < 7.30) || (be && be < -4)) { | ||
+ | sodiumSelect.value = ' | ||
+ | } else { | ||
+ | sodiumSelect.value = ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // Aggiorna il suggerimento sodio | ||
+ | updateSodiumRecommendation(); | ||
+ | |||
+ | // Gestione vitamine/ | ||
+ | const patientCurrentWeight | ||
+ | | ||
| | ||
if (targetDay >= 3 && enteralVolumePerKg < 100) { | if (targetDay >= 3 && enteralVolumePerKg < 100) { | ||
Linea 1260: | Linea 1868: | ||
document.getElementById(' | document.getElementById(' | ||
} else { | } else { | ||
+ | // Mantieni i valori a zero se prima del 3° giorno o se enterale ≥100 ml/kg/die | ||
document.getElementById(' | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
Linea 1265: | Linea 1874: | ||
} | } | ||
| | ||
- | document.getElementById(' | + | document.getElementById(' |
| | ||
- | | + | document.getElementById(' |
- | if (loadBtn) { | + | |
- | loadBtn.className = ' | + | |
- | | + | // RESET del pulsante Fabbisogni quando si modificano i valori standard |
- | | + | resetNutritionButton(); |
} | } | ||
+ | // FUNZIONE AGGIORNAMENTO UNITÀ CARBOIDRATI | ||
function updateCarbUnit() { | function updateCarbUnit() { | ||
- | | + | |
- | | + | |
- | | + | |
| | ||
if (unit === ' | if (unit === ' | ||
Linea 1288: | Linea 1898: | ||
carbInput.setAttribute(' | carbInput.setAttribute(' | ||
} | } | ||
+ | | ||
+ | // Reset fabbisogni quando si cambia unità | ||
+ | resetNutritionButton(); | ||
} | } | ||
+ | // FUNZIONE AGGIORNAMENTO CATEGORIA PESO | ||
function updateWeightCategory() { | function updateWeightCategory() { | ||
- | // Placeholder | + | // Reset fabbisogni quando si cambia categoria peso |
+ | resetNutritionButton(); | ||
} | } | ||
+ | // FUNZIONE AGGIORNAMENTO TIPO SODIO | ||
function updateSodiumChoice() { | function updateSodiumChoice() { | ||
- | // Placeholder | + | // Resetta i fabbisogni quando si cambia il tipo di sodio |
+ | resetNutritionButton(); | ||
} | } | ||
+ | // FUNZIONE AGGIORNAMENTO SUGGERIMENTO SODIO | ||
+ | function updateSodiumRecommendation() { | ||
+ | const sodiumSelect = document.getElementById(' | ||
+ | const recommendationDiv = document.getElementById(' | ||
+ | | ||
+ | if (!patientData.ph && !patientData.baseExcess) { | ||
+ | // Nessun dato clinico disponibile | ||
+ | recommendationDiv.classList.add(' | ||
+ | return; | ||
+ | } | ||
+ | | ||
+ | const ph = patientData.ph ? parseFloat(patientData.ph) : null; | ||
+ | const be = patientData.baseExcess ? parseFloat(patientData.baseExcess) : null; | ||
+ | | ||
+ | // Logica di raccomandazione | ||
+ | let needsAcetate = false; | ||
+ | let reason = ''; | ||
+ | | ||
+ | if (ph && ph < 7.30) { | ||
+ | needsAcetate = true; | ||
+ | reason = 'pH < 7.30 (acidosi)'; | ||
+ | } else if (be && be < -4) { | ||
+ | needsAcetate = true; | ||
+ | reason = 'BE < -4 mEq/L (acidosi metabolica)'; | ||
+ | } else if (ph && be && (ph < 7.30 || be < -4)) { | ||
+ | needsAcetate = true; | ||
+ | reason = 'pH < 7.30 o BE < -4 (acidosi)'; | ||
+ | } | ||
+ | | ||
+ | if (needsAcetate) { | ||
+ | // Suggerisci Sodio Acetato | ||
+ | if (sodiumSelect.value === ' | ||
+ | // L' | ||
+ | recommendationDiv.innerHTML = '< | ||
+ | '< | ||
+ | 'In base ai parametri clinici (' + reason + '), si raccomanda < | ||
+ | '</ | ||
+ | recommendationDiv.classList.remove(' | ||
+ | } else { | ||
+ | // L' | ||
+ | recommendationDiv.innerHTML = '< | ||
+ | '< | ||
+ | 'Sodio Acetato è indicato per i parametri clinici attuali (' + reason + ' | ||
+ | '</ | ||
+ | recommendationDiv.classList.remove(' | ||
+ | } | ||
+ | } else { | ||
+ | // Parametri normali | ||
+ | if (sodiumSelect.value === ' | ||
+ | // L' | ||
+ | recommendationDiv.innerHTML = '< | ||
+ | '< | ||
+ | 'I parametri clinici sono nella norma. Sodio Cloruro potrebbe essere sufficiente, | ||
+ | '</ | ||
+ | recommendationDiv.classList.remove(' | ||
+ | } else { | ||
+ | // Tutto normale | ||
+ | recommendationDiv.classList.add(' | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // FUNZIONE CALCOLO FABBISOGNI NUTRIZIONALI (DA VERSIONE 17) | ||
function calculateNutrition() { | function calculateNutrition() { | ||
- | | + | |
- | alert(' | + | const nutritionCurrentWeight = parseInt(document.getElementById(' |
+ | const nutritionBirthWeight = parseInt(document.getElementById(' | ||
+ | |||
+ | if (!nutritionCurrentWeight || !nutritionBirthWeight) { | ||
+ | alert(' | ||
return; | return; | ||
} | } | ||
| | ||
- | | + | |
+ | if (!patientData.currentWeight) { | ||
+ | patientData.currentWeight = nutritionCurrentWeight; | ||
+ | patientData.birthWeight = nutritionBirthWeight; | ||
+ | } | ||
+ | |||
+ | const requirements = { | ||
liquids: parseFloat(document.getElementById(' | liquids: parseFloat(document.getElementById(' | ||
protein: parseFloat(document.getElementById(' | protein: parseFloat(document.getElementById(' | ||
Linea 1321: | Linea 2011: | ||
}; | }; | ||
| | ||
- | | + | |
+ | const carbsGPerKgDay = requirements.carbUnit === ' | ||
(requirements.carbs * 1440 / 1000) : requirements.carbs; | (requirements.carbs * 1440 / 1000) : requirements.carbs; | ||
| | ||
- | | + | |
+ | const enteralVolumePerKg = enteralData ? (enteralData.totalFluids / patientCurrentWeight * 1000) : 0; | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | const enteralCalcium = enteralData ? enteralData.calcium : 0; |
- | | + | |
- | | + | |
- | | + | |
+ | | ||
| | ||
- | | + | |
- | | + | const residualCalcium = Math.max(0, requirements.calcium - enteralCalcium); |
- | | + | |
- | | + | |
- | | + | |
+ | | ||
| | ||
window.residualNeeds = { | window.residualNeeds = { | ||
Linea 1367: | Linea 2061: | ||
}; | }; | ||
| | ||
- | | + | |
- | | + | const carbsMgPerKgMin = (carbsGPerKgDay * 1000) / 1440; |
- | | + | |
+ | | ||
| | ||
- | | + | |
tableHtml += '< | tableHtml += '< | ||
tableHtml += '< | tableHtml += '< | ||
Linea 1378: | Linea 2073: | ||
tableHtml += '< | tableHtml += '< | ||
tableHtml += '< | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
+ | tableHtml += '< | ||
tableHtml += '< | tableHtml += '< | ||
tableHtml += '</ | tableHtml += '</ | ||
Linea 1385: | Linea 2089: | ||
document.getElementById(' | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
+ | | ||
+ | // RESET del pulsante NPT quando si modificano i fabbisogni | ||
+ | resetParenteralButton(); | ||
} | } | ||
+ | // FUNZIONE CALCOLO ELETTROLITI AGGIUNTIVI (DA VERSIONE 17) | ||
function calculateElectrolyteAdditions(calciumNeeded, | function calculateElectrolyteAdditions(calciumNeeded, | ||
- | | + | |
ca_gluconato: | ca_gluconato: | ||
esafosfina: 0, | esafosfina: 0, | ||
Linea 1396: | Linea 2104: | ||
kcl: 0, | kcl: 0, | ||
totalVolume: | totalVolume: | ||
- | providedCalcium: | ||
- | providedPhosphorus: | ||
- | providedMagnesium: | ||
- | providedSodium: | ||
- | providedPotassium: | ||
sodiumSource: | sodiumSource: | ||
}; | }; | ||
| | ||
- | | + | |
- | | + | const sodiumTypeSelect = document.getElementById(' |
+ | | ||
additions.sodiumSource = selectedSodiumType; | additions.sodiumSource = selectedSodiumType; | ||
| | ||
- | | + | |
- | | + | const totalCalciumNeeded = calciumNeeded * currentWeightKg; |
- | | + | |
- | | + | |
- | | + | |
+ | | ||
| | ||
+ | // Calcio Gluconato 10% (840 mg Ca/100ml) | ||
if (totalCalciumNeeded > 0) { | if (totalCalciumNeeded > 0) { | ||
additions.ca_gluconato = totalCalciumNeeded / (parenteralConfig.ca_gluconato.calcium / 100); | additions.ca_gluconato = totalCalciumNeeded / (parenteralConfig.ca_gluconato.calcium / 100); | ||
- | additions.providedCalcium = totalCalciumNeeded; | ||
} | } | ||
| | ||
+ | // Esafosfina (1600 mg P/100ml + 130 mEq Na/100ml) | ||
+ | let sodiumFromEsafosfina = 0; | ||
if (totalPhosphorusNeeded > 0) { | if (totalPhosphorusNeeded > 0) { | ||
additions.esafosfina = totalPhosphorusNeeded / (parenteralConfig.esafosfina.phosphorus / 100); | additions.esafosfina = totalPhosphorusNeeded / (parenteralConfig.esafosfina.phosphorus / 100); | ||
- | | + | |
- | additions.providedSodium += (additions.esafosfina * parenteralConfig.esafosfina.sodium / 100); | + | |
} | } | ||
| | ||
+ | // Magnesio Solfato (800 mEq Mg/100ml) | ||
if (totalMagnesiumNeeded > 0) { | if (totalMagnesiumNeeded > 0) { | ||
additions.mg_sulfate = totalMagnesiumNeeded / (parenteralConfig.mg_sulfate.magnesium / 100); | additions.mg_sulfate = totalMagnesiumNeeded / (parenteralConfig.mg_sulfate.magnesium / 100); | ||
- | additions.providedMagnesium = totalMagnesiumNeeded; | ||
} | } | ||
| | ||
- | | + | |
+ | const remainingSodium = Math.max(0, totalSodiumNeeded - sodiumFromEsafosfina); | ||
| | ||
if (remainingSodium > 0) { | if (remainingSodium > 0) { | ||
if (selectedSodiumType === ' | if (selectedSodiumType === ' | ||
- | | + | |
additions.sodium_acetate = remainingSodium / concentrationSodiumAcetate; | additions.sodium_acetate = remainingSodium / concentrationSodiumAcetate; | ||
} else { | } else { | ||
- | | + | |
additions.nacl = remainingSodium / concentrationNaCl; | additions.nacl = remainingSodium / concentrationNaCl; | ||
} | } | ||
- | additions.providedSodium += remainingSodium; | ||
} | } | ||
| | ||
+ | // Potassio Cloruro (1000 mEq K/100ml) | ||
if (totalPotassiumNeeded > 0) { | if (totalPotassiumNeeded > 0) { | ||
additions.kcl = totalPotassiumNeeded / (parenteralConfig.kcl.potassium / 100); | additions.kcl = totalPotassiumNeeded / (parenteralConfig.kcl.potassium / 100); | ||
- | additions.providedPotassium = totalPotassiumNeeded; | ||
} | } | ||
| | ||
+ | // Volume totale degli elettroliti | ||
additions.totalVolume = additions.ca_gluconato + additions.esafosfina + additions.mg_sulfate + additions.nacl + additions.sodium_acetate + additions.kcl; | additions.totalVolume = additions.ca_gluconato + additions.esafosfina + additions.mg_sulfate + additions.nacl + additions.sodium_acetate + additions.kcl; | ||
| | ||
Linea 1453: | Linea 2160: | ||
} | } | ||
+ | // FUNZIONE CALCOLO NPT PARENTERALE (DA VERSIONE 17 CON CONTROLLI CLINICI) | ||
function calculateParenteral() { | function calculateParenteral() { | ||
if (!window.residualNeeds) { | if (!window.residualNeeds) { | ||
Linea 1459: | Linea 2167: | ||
} | } | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
| | ||
- | | + | |
+ | const gir = (residualNeeds.carbs * 1000) / 1440; // mg/kg/min | ||
+ | let alerts = []; | ||
| | ||
- | | + | |
+ | alerts.push(' | ||
+ | } | ||
+ | if (residualNeeds.lipids > clinicalConfig.maxLipids) { | ||
+ | alerts.push(' | ||
+ | } | ||
+ | if (residualNeeds.protein > clinicalConfig.maxProtein) { | ||
+ | alerts.push(' | ||
+ | } | ||
+ | |||
+ | // Volume totale residuo richiesto | ||
+ | const totalVolume = Math.round(residualNeeds.liquids * currentWeightKg); | ||
+ | |||
+ | // CALCOLA ELETTROLITI AGGIUNTIVI | ||
+ | const electrolyteAdditions = calculateElectrolyteAdditions( | ||
residualNeeds.calcium, | residualNeeds.calcium, | ||
residualNeeds.phosphorus, | residualNeeds.phosphorus, | ||
Linea 1474: | Linea 2198: | ||
); | ); | ||
| | ||
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | const vitaminsVolume |
+ | | ||
| | ||
- | | + | |
- | | + | const neededGlucose |
+ | | ||
| | ||
- | | + | |
+ | const usedVolume | ||
| | ||
- | | + | // Volume rimanente = Acqua Bidistillata |
- | glucoseMessage = '< | + | |
- | ' | + | |
- | '• Volume utilizzato: ' + usedVolume.toFixed(1) + ' ml< | + | |
- | '• Acqua rimanente: ' + waterVolume.toFixed(1) + ' ml (NEGATIVO!)< | + | |
- | '< | + | |
- | + | ||
- | document.getElementById(' | + | |
- | document.getElementById(' | + | |
- | document.getElementById(' | + | |
- | document.getElementById(' | + | |
- | + | ||
- | document.getElementById(' | + | |
- | document.getElementById(' | + | |
- | return; | + | |
- | | + | |
- | + | ||
- | if (neededGlucose <= 0) { | + | |
- | glucoseMessage = '< | + | |
- | '• Tutto il glucosio necessario proviene dall\' | + | |
- | '• Non necessario glucosio in NPT</ | + | |
- | + | ||
- | document.getElementById(' | + | |
- | } else { | + | |
- | glucoseMessage = '< | + | |
- | '• Glucosio necessario: ' + neededGlucose.toFixed(1) + ' | + | |
- | '• Glucosio 50%: ' + glucose50Volume.toFixed(1) + ' | + | |
- | '• Acqua bidistillata: | + | |
- | '• < | + | |
- | + | ||
- | document.getElementById(' | + | |
- | } | + | |
| | ||
document.getElementById(' | document.getElementById(' | ||
+ | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
document.getElementById(' | document.getElementById(' | ||
| | ||
- | | + | |
+ | resultHtml += '< | ||
+ | resultHtml += '< | ||
+ | resultHtml += '< | ||
+ | resultHtml += '< | ||
+ | if (enteralData && enteralData.additionalFluids > 0) { | ||
+ | resultHtml += '< | ||
+ | } | ||
+ | resultHtml += '</ | ||
| | ||
- | resultHtml += '< | + | |
- | resultHtml += '< | + | if (alerts.length > 0) { |
- | resultHtml += '< | + | |
- | resultHtml += '< | + | } |
- | resultHtml | + | |
| | ||
resultHtml += '< | resultHtml += '< | ||
Linea 1541: | Linea 2246: | ||
| | ||
resultHtml += '< | resultHtml += '< | ||
- | resultHtml += '< | + | resultHtml += '< |
| | ||
+ | // ELETTROLITI AGGIUNTIVI | ||
if (electrolyteAdditions.ca_gluconato > 0) { | if (electrolyteAdditions.ca_gluconato > 0) { | ||
resultHtml += '< | resultHtml += '< | ||
Linea 1550: | Linea 2256: | ||
} | } | ||
if (electrolyteAdditions.mg_sulfate > 0) { | if (electrolyteAdditions.mg_sulfate > 0) { | ||
- | resultHtml += '< | + | resultHtml += '< |
} | } | ||
if (electrolyteAdditions.nacl > 0) { | if (electrolyteAdditions.nacl > 0) { | ||
Linea 1562: | Linea 2268: | ||
} | } | ||
| | ||
+ | // VITAMINE | ||
if (residualNeeds.vitalipid > 0) { | if (residualNeeds.vitalipid > 0) { | ||
- | | + | |
resultHtml += '< | resultHtml += '< | ||
} | } | ||
if (residualNeeds.soluvit > 0) { | if (residualNeeds.soluvit > 0) { | ||
- | | + | |
resultHtml += '< | resultHtml += '< | ||
} | } | ||
if (residualNeeds.peditrace > 0) { | if (residualNeeds.peditrace > 0) { | ||
- | | + | |
resultHtml += '< | resultHtml += '< | ||
} | } | ||
| | ||
+ | // CARNITINA | ||
if (residualNeeds.carnitine > 0) { | if (residualNeeds.carnitine > 0) { | ||
resultHtml += '< | resultHtml += '< | ||
} | } | ||
| | ||
+ | // ACQUA BIDISTILLATA | ||
if (waterVolume > 0) { | if (waterVolume > 0) { | ||
resultHtml += '< | resultHtml += '< | ||
Linea 1588: | Linea 2297: | ||
document.getElementById(' | document.getElementById(' | ||
| | ||
- | | + | |
- | | + | const deflectorVolume = parseInt(document.getElementById(' |
+ | | ||
+ | const ratio = totalVolumeWithDeflector / totalVolume; | ||
| | ||
- | | + | |
- | preparationHtml += '< | + | preparationHtml += '< |
preparationHtml += '• < | preparationHtml += '• < | ||
+ | preparationHtml += '• < | ||
preparationHtml += '• < | preparationHtml += '• < | ||
preparationHtml += '</ | preparationHtml += '</ | ||
| | ||
preparationHtml += '< | preparationHtml += '< | ||
- | preparationHtml += '< | + | preparationHtml += '< |
- | + | ||
- | var ratio = totalVolumeWithDeflector / totalVolume; | + | |
| | ||
if (neededGlucose > 0) { | if (neededGlucose > 0) { | ||
Linea 1607: | Linea 2317: | ||
| | ||
preparationHtml += '< | preparationHtml += '< | ||
- | preparationHtml += '< | + | preparationHtml += '< |
| | ||
if (electrolyteAdditions.ca_gluconato > 0) { | if (electrolyteAdditions.ca_gluconato > 0) { | ||
Linea 1616: | Linea 2326: | ||
} | } | ||
if (electrolyteAdditions.mg_sulfate > 0) { | if (electrolyteAdditions.mg_sulfate > 0) { | ||
- | preparationHtml += '< | + | preparationHtml += '< |
} | } | ||
if (electrolyteAdditions.nacl > 0) { | if (electrolyteAdditions.nacl > 0) { | ||
Linea 1628: | Linea 2338: | ||
} | } | ||
| | ||
+ | // VITAMINE con denominazioni complete | ||
if (residualNeeds.vitalipid > 0) { | if (residualNeeds.vitalipid > 0) { | ||
- | | + | |
preparationHtml += '< | preparationHtml += '< | ||
} | } | ||
if (residualNeeds.soluvit > 0) { | if (residualNeeds.soluvit > 0) { | ||
- | | + | |
preparationHtml += '< | preparationHtml += '< | ||
} | } | ||
if (residualNeeds.peditrace > 0) { | if (residualNeeds.peditrace > 0) { | ||
- | | + | |
preparationHtml += '< | preparationHtml += '< | ||
} | } | ||
| | ||
+ | // CARNITINA con denominazione completa | ||
if (residualNeeds.carnitine > 0) { | if (residualNeeds.carnitine > 0) { | ||
preparationHtml += '< | preparationHtml += '< | ||
Linea 1655: | Linea 2367: | ||
document.getElementById(' | document.getElementById(' | ||
| | ||
- | window.nptCalculationData | + | |
- | | + | document.getElementById(' |
- | | + | |
- | | + | // Salva i dati per il report |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | proteinVolume: | ||
+ | lipidVolume: | ||
+ | gir: gir, | ||
+ | neededGlucose: | ||
electrolyteAdditions: | electrolyteAdditions: | ||
- | | + | vitaminsVolume: |
- | lipidVolume: | + | |
- | | + | |
carnitineVolume: | carnitineVolume: | ||
- | | + | |
- | waterVolume: | + | |
- | neededGlucose: | + | |
- | residualNeeds: | + | |
}; | }; | ||
+ | } | ||
+ | |||
+ | // FUNZIONI CONFIGURAZIONE (DA VERSIONE 17) | ||
+ | function populateEnteralConfigTable() { | ||
+ | const tbody = document.getElementById(' | ||
+ | if (!tbody) return; | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | const row = tbody.insertRow(); |
- | } | + | row.innerHTML |
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | }); | ||
} | } | ||
- | function | + | function |
- | | + | |
- | alert('Prima calcolare la NPT!'); | + | if (!tbody) |
- | return; | + | |
- | } | + | |
| | ||
- | | + | |
- | | + | Object.keys(parenteralConfig).forEach(function(key) { |
- | | + | const component = parenteralConfig[key]; |
- | | + | const row = tbody.insertRow(); |
- | | + | row.innerHTML = '< |
- | | + | '< |
- | | + | '< |
- | | + | '< |
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | | ||
+ | } | ||
+ | |||
+ | function populateDoctorsConfigTable() { | ||
+ | const tbody = document.getElementById('doctorsConfigTable'); | ||
+ | if (!tbody) return; | ||
| | ||
- | | + | |
- | | + | |
- | | + | const doctor = doctorsData[key]; |
+ | const row = tbody.insertRow(); | ||
+ | row.innerHTML = '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '< | ||
+ | '</ | ||
+ | '< | ||
+ | | ||
+ | }); | ||
} | } | ||
- | function | + | function |
- | | + | |
- | | + | |
- | var totalVolumeWithDeflector = data.totalVolume + deflectorVolume; | + | |
- | var ratio = totalVolumeWithDeflector / data.totalVolume; | + | |
| | ||
- | | + | |
- | var dateStr | + | case ' |
+ | buttonId = ' | ||
+ | | ||
+ | break; | ||
+ | case ' | ||
+ | buttonId = ' | ||
+ | buttonText = 'SALVA MODIFICHE PARENTERALI'; | ||
+ | break; | ||
+ | case ' | ||
+ | buttonId = ' | ||
+ | buttonText = 'SALVA MODIFICHE FORTIFICANTI'; | ||
+ | break; | ||
+ | case ' | ||
+ | buttonId = ' | ||
+ | buttonText = 'SALVA MODIFICHE MEDICI'; | ||
+ | break; | ||
+ | case ' | ||
+ | buttonId = ' | ||
+ | buttonText = 'SALVA PARAMETRI SISTEMA'; | ||
+ | break; | ||
+ | } | ||
| | ||
- | | + | |
- | (doctorsData[patientData.prescribingDoctor] ? doctorsData[patientData.prescribingDoctor].fullName : 'N/A' | + | |
+ | button.className = 'button config-update-pending'; | ||
+ | button.innerHTML = buttonText; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function updateEnteralConfig() { | ||
+ | let changesCount = 0; | ||
| | ||
- | | + | |
- | var finalConcentration | + | const oldValues = Object.assign({}, formulaData[key]); |
- | var estimatedOsmolarity | + | |
+ | const proteinEl = document.getElementById(' | ||
+ | if (proteinEl) { | ||
+ | formulaData[key].protein = parseFloat(proteinEl.value); | ||
+ | | ||
+ | formulaData[key].lipids = parseFloat(document.getElementById(' | ||
+ | | ||
+ | formulaData[key].potassium = parseFloat(document.getElementById(' | ||
+ | formulaData[key].calcium = parseFloat(document.getElementById(' | ||
+ | formulaData[key].phosphorus = parseFloat(document.getElementById(' | ||
+ | formulaData[key].magnesium = parseFloat(document.getElementById(' | ||
+ | formulaData[key].energy = parseFloat(document.getElementById(' | ||
+ | |||
+ | if (JSON.stringify(oldValues) !== JSON.stringify(formulaData[key])) { | ||
+ | changesCount++; | ||
+ | } | ||
+ | } | ||
+ | }); | ||
| | ||
- | | + | |
+ | if (button) { | ||
+ | button.className | ||
+ | button.innerHTML = ' | ||
+ | setTimeout(() => { | ||
+ | button.className = 'button'; | ||
+ | button.innerHTML = ' | ||
+ | }, 3000); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function updateParenteralConfig() { | ||
+ | let changesCount = 0; | ||
| | ||
- | | + | |
- | html += '< | + | const oldValues |
- | html += '< | + | |
- | html += '<div style=" | + | const proteinEl |
- | html += '<div style=" | + | if (proteinEl) { |
- | html += '</ | + | parenteralConfig[key].protein |
- | | + | parenteralConfig[key].carbs |
- | | + | |
+ | | ||
+ | | ||
+ | | ||
+ | parenteralConfig[key].phosphorus | ||
+ | parenteralConfig[key].magnesium | ||
+ | | ||
+ | parenteralConfig[key].water | ||
+ | |||
+ | if (JSON.stringify(oldValues) !== JSON.stringify(parenteralConfig[key])) { | ||
+ | changesCount++; | ||
+ | } | ||
+ | } | ||
+ | }); | ||
| | ||
- | | + | |
- | html += '<div class=" | + | |
- | | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '</ | + | |
- | html += '</ | + | |
- | + | ||
- | // Composizione | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '<table class=" | + | |
- | html += '< | + | |
- | + | ||
- | if (data.waterVolume > 0) { | + | |
- | | + | |
} | } | ||
- | if (data.glucose50Volume > 0) { | + | } |
- | | + | |
+ | function updateFortifierConfig() { | ||
+ | // Aggiorna Prenidina FM85 predefinita | ||
+ | const proteinEl = document.getElementById(' | ||
+ | if (proteinEl) { | ||
+ | | ||
+ | fortifierData.prenidina_fm85.carbs = parseFloat(document.getElementById('fortifier_prenidina_fm85_carbs' | ||
+ | fortifierData.prenidina_fm85.lipids | ||
+ | fortifierData.prenidina_fm85.sodium = parseFloat(document.getElementById('fortifier_prenidina_fm85_sodium' | ||
+ | fortifierData.prenidina_fm85.potassium = parseFloat(document.getElementById(' | ||
+ | fortifierData.prenidina_fm85.calcium = parseFloat(document.getElementById('fortifier_prenidina_fm85_calcium').value); | ||
+ | fortifierData.prenidina_fm85.phosphorus = parseFloat(document.getElementById(' | ||
+ | fortifierData.prenidina_fm85.magnesium = parseFloat(document.getElementById(' | ||
+ | fortifierData.prenidina_fm85.energy = parseFloat(document.getElementById('fortifier_prenidina_fm85_energy').value); | ||
} | } | ||
- | | + | |
- | html += '< | + | const button |
- | } | + | if (button) { |
- | if (data.electrolyteAdditions.nacl > 0) { | + | |
- | | + | |
- | } | + | |
- | if (data.electrolyteAdditions.sodium_acetate > 0) { | + | button.className = 'button'; |
- | html += '< | + | |
- | } | + | }, 3000); |
- | if (data.electrolyteAdditions.kcl > 0) { | + | |
- | | + | |
- | } | + | |
- | if (data.electrolyteAdditions.mg_sulfate > 0) { | + | |
- | html += '< | + | |
- | } | + | |
- | if (data.carnitineVolume > 0) { | + | |
- | html += '< | + | |
} | } | ||
+ | } | ||
+ | |||
+ | function updateDoctorsConfig() { | ||
+ | let changesCount = 0; | ||
| | ||
- | | + | |
+ | const oldValues | ||
+ | |||
+ | const nameEl = document.getElementById(' | ||
+ | if (nameEl) { | ||
+ | const newName = nameEl.value.trim(); | ||
+ | const newSurname = document.getElementById('doctor_' + key + ' | ||
+ | const newTitle = document.getElementById(' | ||
+ | |||
+ | doctorsData[key].name = newName; | ||
+ | doctorsData[key].surname = newSurname; | ||
+ | doctorsData[key].title = newTitle; | ||
+ | doctorsData[key].fullName = newTitle | ||
+ | |||
+ | if (JSON.stringify(oldValues) !== JSON.stringify(doctorsData[key])) { | ||
+ | changesCount++; | ||
+ | } | ||
+ | } | ||
+ | }); | ||
| | ||
- | | + | |
- | | + | populateDoctorsConfigTable(); |
+ | |||
+ | const button = document.getElementById(' | ||
+ | if (button) { | ||
+ | | ||
+ | button.innerHTML = ' | ||
+ | setTimeout(() => { | ||
+ | button.className = 'button'; | ||
+ | button.innerHTML = ' | ||
+ | }, 3000); | ||
} | } | ||
- | if (data.residualNeeds.peditrace > 0) { | + | } |
- | var peditraceVolume | + | |
- | html += '< | + | function updateSystemConfig() { |
- | } | + | const button |
- | if (data.residualNeeds.soluvit > 0) { | + | if (button) { |
- | | + | |
- | html += '< | + | button.innerHTML = 'PARAMETRI SALVATI ✓'; |
- | } | + | setTimeout(() => { |
- | if (data.residualNeeds.vitalipid > 0) { | + | |
- | var vitalipidVolume = data.residualNeeds.vitalipid * data.currentWeightKg; | + | button.innerHTML = 'Aggiorna Parametri Sistema'; |
- | html += '< | + | }, 3000); |
} | } | ||
| | ||
- | | + | |
+ | } | ||
+ | |||
+ | // FUNZIONI CONFIGURAZIONE CLINICA AVANZATA (NUOVE) | ||
+ | function updateClinicalConfig() { | ||
+ | clinicalConfig.calciumReq | ||
+ | clinicalConfig.phosphorusReq = parseFloat(document.getElementById(' | ||
+ | clinicalConfig.magnesiumReq = parseFloat(document.getElementById('magnesiumReq').value); | ||
+ | clinicalConfig.maxGIR = parseFloat(document.getElementById(' | ||
+ | clinicalConfig.maxLipids = parseFloat(document.getElementById(' | ||
+ | clinicalConfig.maxProtein = parseFloat(document.getElementById('maxProtein').value); | ||
| | ||
- | | + | |
- | html += '<tr class=" | + | '• Calcio standard: |
- | html += '< | + | '• Fosforo standard: ' + clinicalConfig.phosphorusReq |
- | html += '< | + | '• GIR massimo: |
- | | + | |
- | | + | } |
- | | + | |
+ | function resetConfiguration() { | ||
+ | // Reset configurazione clinica | ||
+ | document.getElementById('calciumReq').value = 160; | ||
+ | document.getElementById('phosphorusReq' | ||
+ | | ||
+ | document.getElementById('maxGIR').value = 12.0; | ||
+ | | ||
+ | document.getElementById('maxProtein').value = 4.5; | ||
| | ||
- | | + | |
- | | + | document.getElementById(' |
- | | + | document.getElementById('hospitalName' |
+ | | ||
+ | | ||
| | ||
- | | + | // Reset configurazione clinica globale |
+ | clinicalConfig = { | ||
+ | calciumReq: 160, | ||
+ | phosphorusReq: | ||
+ | magnesiumReq: | ||
+ | maxGIR: 12.0, | ||
+ | maxLipids: 3.0, | ||
+ | maxProtein: 4.5, | ||
+ | hospitalName: | ||
+ | departmentName: | ||
+ | directorName: | ||
+ | }; | ||
| | ||
- | | + | |
} | } | ||
- | function | + | function |
- | | + | |
- | | + | deflectorVolume: |
- | | + | hospitalName: |
- | } | + | |
+ | | ||
+ | autoSave: document.getElementById(' | ||
+ | decimalPlaces: | ||
+ | clinicalConfig: | ||
+ | }; | ||
| | ||
- | | + | |
- | | + | |
- | document.getElementById(' | + | |
- | | + | |
- | | + | |
- | document.getElementById(' | + | |
- | document.getElementById(' | + | |
- | window.currentActiveReport = ' | + | |
| | ||
- | | + | |
- | | + | |
- | | + | |
} | } | ||
- | function | + | // FUNZIONI REPORT (COMPLETE CON TUTTI GLI ELEMENTI) |
- | | + | function |
- | var deflectorVolume = parseInt(document.getElementById('deflectorVolume').value) || 30; | + | |
- | var totalVolumeWithDeflector = data.totalVolume + deflectorVolume; | + | alert('Prima completare tutti i calcoli precedenti'); |
- | | + | |
+ | | ||
| | ||
- | | + | |
- | | + | |
+ | const prescriptionPatientWeightKg = patientData.currentWeight / 1000; | ||
+ | const calc = window.nptCalculation; | ||
| | ||
- | | + | |
- | var birthDate = patientData.prescriptionDate ? | + | |
- | | + | |
- | | + | |
- | | + | |
- | (doctorsData[patientData.prescribingDoctor] ? doctorsData[patientData.prescribingDoctor].fullName : ' | + | |
| | ||
- | | + | |
- | | + | |
- | var estimatedOsmolarity = (finalConcentration * 55 + data.electrolyteAdditions.totalVolume * 10).toFixed(0); | + | |
| | ||
- | | + | |
+ | (patientData.prescribingDoctor && doctorsData[patientData.prescribingDoctor] ? | ||
+ | | ||
| | ||
- | // INTESTAZIONE | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '<div style=" | + | html += '< |
- | html += '<div style=" | + | |
+ | // PARTE SINISTRA - INFO OSPEDALE | ||
+ | html += '< | ||
+ | html += '<h2 style=" | ||
+ | html += '<h3 style=" | ||
+ | html += '<p style=" | ||
html += '</ | html += '</ | ||
- | html += '< | + | |
+ | // PARTE DESTRA - LOGO ASST | ||
+ | | ||
+ | html += '< | ||
html += '</ | html += '</ | ||
| | ||
- | html += '< | + | html += '</ |
- | html += '< | + | |
| | ||
- | // INFO PAZIENTE | + | // TITOLO DOCUMENTO |
- | html += '< | + | html += '< |
- | html += '< | + | html += '<h2 style="font-size: 18px; font-weight: bold; color: #2c3e50; margin: 10px 0;">CALCOLO NUTRIZIONALE PARENTERALE</h2>'; |
- | html += '< | + | html += '<p style="font-size: 14px; color: #7f8c8d; margin: 5px 0;">Data: ' + currentDate |
- | html += '<tr>< | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '< | + | |
- | html += '<tr>< | + | |
- | html += '< | + | |
- | html += '</ | + | |
html += '</ | html += '</ | ||
| | ||
- | // LISTA APPORTI ENTERALI | + | // DATI PAZIENTE |
- | html += '< | + | html += '< |
- | html += '<div class="report-section-title">Lista Degli Apporti per la Giornata Corrente</div>'; | + | html += '<h3 style="margin-top: 0; color: #2c3e50;">DATI PAZIENTE</h3>'; |
- | | + | |
- | var formulaName | + | html += '<div>'; |
- | var formulaDisplayName | + | html += '<p><strong>Medico Prescrittore:</ |
- | html += '<table class=" | + | html += '<p>< |
- | html += '<tr><td class=" | + | html += '<p><strong>N° Cartella:</strong> ' + (patientData.medicalRecord || ' |
- | html += '<tr><td class=" | + | html += '</div>'; |
- | html += '</table>'; | + | html += '<div>'; |
- | | + | html += '<p><strong>Data Nascita:</ |
- | | + | html += '<p>< |
- | html += '<tr><td class=" | + | html += '<p><strong>Peso:</strong> ' + patientData.currentWeight + 'g (' + prescriptionPatientWeightKg.toFixed(3) + ' kg)</p>'; |
- | html += '<tr><td class=" | + | html += '</div>'; |
- | html += '</table>'; | + | html += '</div>'; |
- | } | + | |
html += '</ | html += '</ | ||
| | ||
- | // COMPOSIZIONE | + | // COMPOSIZIONE |
- | html += '<div class="report-section">'; | + | html += '<h3 style="color: #27ae60; margin-top: 30px;"> |
- | html += '<div class="report-section-title"> | + | html += '<table style="width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 13px;">'; |
- | html += '<table class="composition-table">'; | + | html += '<thead>< |
- | html += '<tr>< | + | html += '< |
+ | html += '< | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '</tr></ | ||
| | ||
- | // Componenti con ordine identico al foglio di lavoro | + | // ACQUA BIDISTILLATA |
- | if (data.waterVolume > 0) { | + | if (calc.waterVolume > 0) { |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.glucose50Volume | + | |
- | html += '< | + | // GLUCOSIO |
+ | | ||
+ | html += '< | ||
} | } | ||
- | if (data.electrolyteAdditions.ca_gluconato > 0) { | + | |
- | html += '< | + | // PROTEINE |
+ | html += '< | ||
+ | |||
+ | // LIPIDI | ||
+ | html += '< | ||
+ | |||
+ | // ELETTROLITI (SE PRESENTI) | ||
+ | | ||
+ | html += '< | ||
} | } | ||
- | if (data.electrolyteAdditions.nacl > 0) { | + | if (calc.electrolyteAdditions.esafosfina |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.electrolyteAdditions.kcl > 0) { | + | if (calc.electrolyteAdditions.mg_sulfate |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.electrolyteAdditions.mg_sulfate | + | if (calc.electrolyteAdditions.nacl > 0) { |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.carnitineVolume | + | if (calc.electrolyteAdditions.sodium_acetate |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.proteinVolume | + | if (calc.electrolyteAdditions.kcl |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.electrolyteAdditions.esafosfina | + | |
- | html += '< | + | // VITAMINE (SE PRESENTI) |
+ | | ||
+ | const vitalipidVolume = window.residualNeeds.vitalipid * prescriptionPatientWeightKg; | ||
+ | html += '< | ||
} | } | ||
- | if (data.residualNeeds.peditrace | + | if (window.residualNeeds.soluvit |
- | | + | |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.residualNeeds.soluvit | + | if (window.residualNeeds.peditrace |
- | | + | |
- | html += '< | + | html += '< |
} | } | ||
- | if (data.residualNeeds.vitalipid | + | |
- | | + | // CARNITINA (SE PRESENTE) |
- | html += '< | + | |
+ | | ||
+ | html += '< | ||
} | } | ||
- | // Gestione valore negativo per Intralipid | ||
- | var displayLipidVolume = data.lipidVolume < 0 ? 0 : data.lipidVolume; | ||
- | html += '< | ||
| | ||
- | // Totali | + | // TOTALE |
- | html += '< | + | html += '< |
- | html += '<tr><td class="component-name-col">< | + | html += '</tbody></ |
- | html += '<tr>< | + | |
- | html += '<tr>< | + | // PARAMETRI CLINICI |
- | html += '</ | + | html += '< |
+ | html += '<h4 style=" | ||
+ | html += '<p>< | ||
+ | html += '<p>< | ||
+ | html += '<p>< | ||
+ | html += '<p>< | ||
html += '</ | html += '</ | ||
| | ||
- | // TOTALE ELEMENTI PRO KILO | + | // FIRMA |
- | html += '< | + | html += '< |
- | html += '< | + | html += '< |
- | html += '<table class="elements-table">'; | + | html += '< |
+ | html += '< | ||
+ | html += '</ | ||
+ | html += '<div style="text-align: center; width: 200px;">'; | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '</ | ||
+ | html += '</ | ||
+ | html += '</ | ||
| | ||
- | | + | |
- | var totalLiquids | + | } |
- | | + | |
+ | function generateWorksheet() { | ||
+ | | ||
+ | alert('Prima completare tutti i calcoli precedenti' | ||
+ | return; | ||
+ | } | ||
| | ||
- | | + | |
- | | + | |
- | var totalCarbs = (enteralData ? enteralData.carbs * data.currentWeightKg / 1000 : 0) + (data.residualNeeds.carbs * data.currentWeightKg / 1000); | + | alert('Prima calcolare la NPT nel TAB 4'); |
- | var totalCalcium = (enteralData ? enteralData.calcium * data.currentWeightKg / 1000 : 0) + (data.residualNeeds.calcium * data.currentWeightKg / 1000); | + | |
- | | + | |
- | var totalSodium = (enteralData ? enteralData.sodium * data.currentWeightKg / 1000 : 0) + (data.residualNeeds.sodium * data.currentWeightKg / 1000); | + | |
- | var totalPotassium = (enteralData ? enteralData.potassium * data.currentWeightKg / 1000 : 0) + (data.residualNeeds.potassium * data.currentWeightKg / 1000); | + | |
- | var totalMagnesium = (enteralData ? enteralData.magnesium * data.currentWeightKg / 1000 : 0) + (data.residualNeeds.magnesium * data.currentWeightKg / 1000); | + | |
- | var totalCarnitine = data.residualNeeds.carnitine * data.currentWeightKg / 1000; | + | |
| | ||
- | | + | |
- | | + | |
- | | + | |
| | ||
- | | + | |
- | html += '< | + | |
- | | + | |
- | html += '< | + | |
- | html += '< | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | html += '<div class=" |
- | | + | html += '<h1>' + clinicalConfig.hospitalName |
- | html += '<tr>< | + | html += '<h2>' + clinicalConfig.departmentName |
- | html += '<tr>< | + | html += '<p>Direttore: |
- | html += '<tr>< | + | |
- | html += '<tr style=" | + | |
- | html += '<tr>< | + | |
- | html += '< | + | |
- | html += '</ | + | |
html += '</ | html += '</ | ||
| | ||
- | html += '< | + | html += '< |
- | html += 'NPT Calculator v2.0 - Report Parenterale generato il ' + new Date().toLocaleString('it-IT'); | + | |
+ | html += '<div style=" | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '< | ||
html += '</ | html += '</ | ||
| | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '< | ||
+ | html += '< | ||
html += '</ | html += '</ | ||
| | ||
- | | + | html += '< |
- | } | + | html += '< |
- | + | html += '< | |
- | function printCurrentReport() { | + | html += '< |
- | | + | |
- | | + | html += '<th style=" |
- | | + | html += '< |
- | | + | |
| | ||
- | | + | |
- | document.getElementById(' | + | |
- | document.getElementById('nptFinalReport').innerHTML; | + | |
| | ||
- | | + | |
- | | + | html += '< |
+ | } | ||
| | ||
- | // Crea una nuova finestra per la stampa | + | |
- | var printWindow | + | |
| | ||
- | | + | |
- | alert('Impossibile aprire la finestra di stampa. Controlla le impostazioni del browser per i popup.'); | + | |
- | return; | + | |
- | } | + | |
| | ||
- | | + | html += '<tr style=" |
- | var htmlContent = '< | + | |
- | htmlContent | + | |
- | htmlContent += '<title>' + reportTitle + '</title>'; | + | |
- | htmlContent += '<meta charset=" | + | |
- | htmlContent += '<style>'; | + | |
- | htmlContent += 'body { margin: 0; padding: | + | |
- | htmlContent | + | |
- | htmlContent | + | |
- | htmlContent | + | |
- | | + | |
- | htmlContent | + | |
| | ||
- | // Scrivi il contenuto nella nuova finestra | + | |
- | | + | html += '< |
- | | + | html += '< |
- | | + | html += '< |
+ | | ||
+ | | ||
+ | | ||
+ | html += '</ | ||
+ | html += '</ | ||
| | ||
- | // Avvia la stampa dopo un breve ritardo | + | |
- | | + | html += '< |
- | | + | html += '< |
- | | + | html += '< |
- | | + | |
+ | html += '< | ||
+ | html += '< | ||
+ | | ||
+ | html += '</ | ||
+ | html += '</ | ||
+ | html += '</ | ||
+ | |||
+ | document.getElementById(' | ||
} | } | ||
- | function | + | // FUNZIONE GENERAZIONE PDF (DA VERSIONE 17) |
- | if (!window.currentActiveReport | + | function |
- | alert(' | + | if (!window.residualNeeds |
+ | alert(' | ||
return; | return; | ||
} | } | ||
+ | |||
+ | const { jsPDF } = window.jspdf; | ||
+ | const doc = new jsPDF(); | ||
| | ||
- | | + | |
- | ' | + | doc.setFontSize(10); |
+ | | ||
+ | doc.text('Direttore: ' | ||
| | ||
- | // Genera nome file suggerito | + | // Logo ASST (posizionamento approssimativo) |
- | var today = new Date(); | + | |
- | | + | |
- | var medicalRecord = patientData.medicalRecord || ' | + | |
- | var suggestedFileName = ' | + | |
| | ||
- | | + | |
- | var savePdfBtn | + | |
- | | + | |
- | var originalColor = savePdfBtn.style.backgroundColor; | + | |
| | ||
- | | + | |
- | | + | generateFoglioLavoroPDF(doc); |
- | | + | |
+ | generateReportParenteralePDF(doc); | ||
+ | | ||
| | ||
- | // Mostra istruzioni dettagliate | + | // Salva il PDF |
- | var instructions = ' | + | |
- | | + | |
- | instructions += ' | + | } |
- | instructions += ' | + | |
- | instructions += ' | + | function generateFoglioLavoroPDF(doc) { |
- | instructions += '3️⃣ Nome file suggerito: ' | + | |
- | | + | let yPos = 50; |
- | | + | |
| | ||
- | | + | |
- | // Prova ad aprire la finestra di stampa | + | doc.text('FOGLIO DI LAVORO NPT', 20, yPos); |
- | try { | + | yPos += 20; |
- | var reportContent = window.currentActiveReport === ' | + | |
- | document.getElementById('nptWorkReport').innerHTML : | + | doc.setFontSize(10); |
- | | + | doc.text('Paziente: |
- | + | yPos += 10; | |
- | var printWindow = window.open('' | + | doc.text('Peso: ' + patientData.currentWeight + 'g', 20, yPos); |
- | + | yPos += 10; | |
- | if (!printWindow) { | + | doc.text(' |
- | // Popup bloccato | + | yPos += 20; |
- | savePdfBtn.innerHTML | + | |
- | | + | const calc = window.nptCalculation; |
- | + | | |
- | setTimeout(function() { | + | |
- | alert('⚠️ POPUP BLOCCATO!\n\nPer salvare come PDF:\n1. Abilita i popup per questo sito\n2. Riprova a cliccare "Salva PDF" | + | |
- | | + | |
- | | + | |
- | savePdfBtn.disabled = false; | + | } |
- | }, 1000); | + | |
- | | + | function generateReportParenteralePDF(doc) { |
- | } | + | |
- | + | let yPos = 50; | |
- | // Costruisci il contenuto HTML completo | + | |
- | var htmlContent | + | doc.setFontSize(12); |
- | | + | doc.text(' |
- | htmlContent | + | yPos += 20; |
- | | + | |
- | | + | doc.setFontSize(10); |
- | htmlContent += 'body { margin: 0; padding: 15px; font-family: | + | doc.text('Sistema: NPT Calculator v3.0 UNIFIED', 20, yPos); |
- | htmlContent | + | yPos += 10; |
- | | + | |
- | | + | } |
- | htmlContent | + | |
- | htmlContent | + | // FUNZIONI PLACEHOLDER |
- | | + | function |
- | | + | |
- | + | } | |
- | // Scrivi il contenuto nella nuova finestra | + | |
- | printWindow.document.open(); | + | function |
- | | + | |
- | | + | } |
- | + | ||
- | // Feedback di successo | + | function showAddParenteralForm() { |
- | savePdfBtn.innerHTML = '✅ Finestra Aperta!'; | + | |
- | | + | } |
- | + | ||
- | // Avvia la stampa dopo un breve ritardo | + | function |
- | setTimeout(function() { | + | alert(' |
- | printWindow.focus(); | + | } |
- | printWindow.print(); | + | |
- | + | function removeEnteralFormula(key) { | |
- | // Mostra istruzioni nella finestra di stampa | + | |
- | | + | |
- | | + | |
- | savePdfBtn.style.backgroundColor = '# | + | |
- | }, 1000); | + | |
- | }, 500); | + | |
- | + | ||
- | // Ripristina il pulsante dopo 5 secondi | + | |
- | setTimeout(function() { | + | |
- | | + | |
- | | + | |
- | savePdfBtn.disabled = false; | + | |
- | | + | |
- | + | ||
- | } catch (error) { | + | |
- | // Gestione errori | + | |
- | savePdfBtn.innerHTML = '❌ Errore!'; | + | |
- | | + | |
- | + | ||
- | | + | |
- | alert(' | + | |
- | | + | |
- | | + | |
- | | + | |
- | }, 1000); | + | |
- | } | + | |
- | | + | |
- | | + | |
- | savePdfBtn.innerHTML = originalText; | + | |
- | savePdfBtn.style.backgroundColor = originalColor; | + | |
- | savePdfBtn.disabled = false; | + | |
} | } | ||
} | } | ||
- | function | + | function |
- | if (!window.currentActiveReport || !window.nptCalculationData) { | + | if (confirm(' |
- | alert(' | + | alert(' |
- | return; | + | |
} | } | ||
+ | } | ||
+ | |||
+ | function removeFortifier(key) { | ||
+ | if (confirm(' | ||
+ | alert(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function removeDoctor(key) { | ||
+ | if (confirm(' | ||
+ | alert(' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // INIZIALIZZAZIONE | ||
+ | document.addEventListener(' | ||
+ | console.log(' | ||
| | ||
- | | + | |
- | document.getElementById('nptWorkReport').innerHTML : | + | const today = new Date().toISOString().split('T')[0]; |
- | document.getElementById(' | + | document.getElementById(' |
| | ||
- | | + | |
- | ' | + | |
| | ||
- | | + | |
- | var dateStr = today.toISOString().split('T')[0].replace(/-/g, '' | + | document.getElementById('currentWeight').value |
- | var medicalRecord | + | |
- | | + | |
| | ||
- | | + | |
- | | + | const requirementFields |
- | | + | ' |
- | | + | 'reqCalcium', ' |
- | '@media print { body { background: white; } .npt-report { box-shadow: none; } }' | + | 'reqSodium', 'reqPotassium', 'reqVitalipid', 'reqSoluvit', 'reqPeditrace', 'reqCarnitine' |
- | | + | ]; |
- | | + | |
- | reportContent + | + | |
- | | + | |
| | ||
- | | + | |
- | var url = URL.createObjectURL(blob); | + | const field = document.getElementById(fieldId); |
- | var a = document.createElement('a'); | + | if (field) { |
- | | + | field.addEventListener('input', function() { |
- | | + | |
- | | + | }); |
- | | + | field.addEventListener(' |
- | | + | |
- | | + | }); |
+ | } | ||
+ | | ||
| | ||
- | | + | |
- | | + | const sodiumTypeSelect |
- | | + | |
- | | + | |
+ | updateSodiumChoice(); | ||
+ | | ||
+ | }); | ||
+ | } | ||
| | ||
- | | + | |
- | | + | const deflectorVolumeInput |
- | saveHtmlBtn.style.backgroundColor = '#9b59b6'; | + | |
- | | + | |
- | } | + | resetParenteralButton(); |
- | + | }); | |
- | function updateSystemConfig() { | + | |
- | var updateBtn = document.getElementById('updateSystemBtn'); | + | |
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | document.getElementById(' |
- | | + | document.getElementById(' |
- | | + | |
- | } | + | document.getElementById('maxGIR').value = clinicalConfig.maxGIR; |
+ | | ||
+ | document.getElementById('maxProtein').value = clinicalConfig.maxProtein; | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | updateFortifierOptions(); | ||
+ | updateDoctorsDropdown(); | ||
+ | console.log(' | ||
+ | }); | ||
</ | </ | ||
+ | |||
</ | </ | ||
</ | </ |