Please translate this Belarussian protocol in English as it is in the same fashion given in attached file . Create a colorful pdf to direct download.
cd /tmp/workspace/attachments/edbdb0c8-df1b-4142-aa84-d6d55ac95d50/ && python -c " import pdfplumber with pdfplumber.open('DOC-20261031-WA0008.pdf') as pdf: print(len(pdf.pages)) for i,p in enumerate(pdf.pages): t=p.extract_text() print('---PAGE',i+1,len(t or ''),len(p.images)) print(t) "
mkdir -p /tmp/workspace/belarus-pe-protocol/src /tmp/workspace/belarus-pe-protocol/output && cd /tmp/workspace/belarus-pe-protocol/src && python - <<'EOF' import pdfplumber, re src='/tmp/workspace/attachments/edbdb0c8-df1b-4142-aa84-d6d55ac95d50/DOC-20261031-WA0008.pdf' out=[] bad=0 with pdfplumber.open(src) as pdf: for i,p in enumerate(pdf.pages): t=p.extract_text() or '' lines=[] for ln in t.split('\n'): if re.search('[ÐÑÂâ]',ln): try: f=ln.encode('latin-1').decode('utf-8') lines.append(f) continue except Exception as e: bad+=1 lines.append('@@BAD@@'+ln) continue lines.append(ln) out.append(f'=====PAGE {i+1}=====\n'+'\n'.join(lines)) open('raw.txt','w').write('\n'.join(out)) print(bad) print(repr(out[0][600:900])) EOF fc-list | grep -i -E "dejavu|noto|liberation" | head
cd /tmp/workspace/belarus-pe-protocol/src && wc -l raw.txt && sed -n '1,330p' raw.txt
cd /tmp/workspace/belarus-pe-protocol/src && python - <<'EOF' t=open('raw.txt',encoding='utf-8').read() print(t.count('Ð'), t.count('Ñ'), sum(1 for c in t if '\u0400'<=c<='\u04ff')) lines=t.split('\n') bad=[i for i,l in enumerate(lines) if 'Ð' in l or 'Ñ' in l] print(len(bad), bad[:10]) print(repr(lines[10][:80]) if len(lines)>10 else '') EOF
cd /tmp/workspace/belarus-pe-protocol/src && python - <<'EOF' import io,sys lines=open('raw.txt',encoding='utf-8').read().split('\n') for l in lines[10:16]: print(l) print('---') sys.stdout.buffer.write('\n'.join(lines[1236-5:1236]).encode('utf-8')) EOF
cd /tmp/workspace/belarus-pe-protocol/src && python - <<'EOF' lines=open('raw.txt',encoding='utf-8').read().split('\n') for i,l in enumerate(lines[326:760],start=327): print(l) EOF
cd /tmp/workspace/belarus-pe-protocol/src && python - <<'EOF' import re lines=open('raw.txt',encoding='utf-8').read().split('\n') def sus(l): return sum(1 for c in l if 0xC0<=ord(c)<=0xFF or 0x80<=ord(c)<=0x9F) print(sum(1 for l in lines if sus(l)>3)) l=lines[326] print([hex(ord(c)) for c in l[:12]]) EOF
cd /tmp/workspace/belarus-pe-protocol/src && python - <<'EOF' import pdfplumber src='/tmp/workspace/attachments/edbdb0c8-df1b-4142-aa84-d6d55ac95d50/DOC-20261031-WA0008.pdf' with pdfplumber.open(src) as pdf: for n in (1,17,19): pdf.pages[n-1].to_image(resolution=110).save(f'p{n}.png') print('ok') EOF ls -la /tmp/workspace/belarus-pe-protocol/src
python - <<'EOF' import matplotlib, os, glob d=os.path.join(os.path.dirname(matplotlib.__file__),'mpl-data/fonts/ttf') print(sorted(glob.glob(d+'/DejaVuSans*.ttf'))) EOF
~/belarus-pe-protocol/src/content.py
# -*- coding: utf-8 -*-
# Markup: "# " chapter band | "## " sub heading | "N.N. text" numbered paragraph | "- " bullet | "-- " sub bullet | "> " note box
T = {
'DAL': '(solution for injection 2,500 IU anti-Xa/0.2 mL; 5,000 IU anti-Xa/0.2 mL; 10,000 IU anti-Xa/1 mL)',
'NAD': '(solution for subcutaneous injection 2,850 IU anti-Xa/0.3 mL; 3,800 IU anti-Xa/0.4 mL; 5,700 IU anti-Xa/0.6 mL; 7,600 IU anti-Xa/0.8 mL; 11,400 IU anti-Xa/0.6 mL)',
'ENO': '(solution for injection 2,000 anti-Xa IU/0.2 mL; 4,000 anti-Xa IU/0.4 mL; 6,000 anti-Xa IU/0.6 mL; 8,000 anti-Xa IU/0.8 mL)',
'UFH': '(heparin, solution for intravenous and subcutaneous administration 5,000 U/mL, 5 mL)',
'APX': '(coated tablets 2.5 mg; coated tablets 5 mg)',
'DAB': '(capsules 75 mg; capsules 110 mg; capsules 150 mg)',
'RIV': '(coated tablets 10 mg; coated tablets 15 mg; coated tablets 20 mg)',
'FON': '(solution for intravenous and subcutaneous administration 2.5 mg/0.5 mL in syringes)',
'DABD': '150 mg twice daily orally (110 mg twice daily for patients older than 80 years or for those taking verapamil)',
}
BODY = r"""
@RESOLUTION
# CLINICAL PROTOCOL|"Diagnosis, treatment and medical prophylaxis of pulmonary embolism (adult population)"|CHAPTER 1 - GENERAL PROVISIONS
1. This clinical protocol establishes general requirements for the scope of medical care provided to patients (adult population) with pulmonary embolism (hereinafter - PE) (codes of the International Statistical Classification of Diseases and Related Health Problems, tenth revision: I26 Pulmonary embolism; I26.0 Pulmonary embolism with mention of acute cor pulmonale; I26.9 Pulmonary embolism without mention of acute cor pulmonale).
2. For the purposes of this clinical protocol, the main terms and their definitions are used in the meanings established by the Law of the Republic of Belarus "On Healthcare", as well as the following terms and their definitions:
- **venous thromboembolic complications (hereinafter - VTE)** - a collective concept combining superficial vein thrombosis, deep vein thrombosis and PE;
- **PE** - occlusion of the trunk or branches of the pulmonary artery (hereinafter - PA) by fragments of a thrombus formed in the veins of the systemic circulation or in the right chambers of the heart.
3. Patients with PE are referred for inpatient medical care in accordance with the Instruction on the procedure for referring patients to receive medical care in a healthcare organization, approved by Resolution of the Ministry of Health of the Republic of Belarus of 7 October 2025 No. 137.
4. This clinical protocol presents the basic pharmacotherapy regimens for PE, including the main pharmacotherapeutic groups of medicinal products (hereinafter - MPs).
> MPs are presented by international nonproprietary names or, in their absence, by chemical names according to systematic or substitutive nomenclature, indicating the route of administration, dosage forms and strengths, dosing regimen and single (if necessary daily, maximum single) dose. MPs are used for medical indications and in the dosing regimen in accordance with the summary of product characteristics and the instructions for medical use (package leaflet). Inclusion of MPs in the treatment regimen for medical indications not provided for in the instructions for medical use (package leaflet) and the summary of product characteristics (off-label) is permitted. Special conditions of prescription, method of use, dose, duration and frequency of administration are additionally specified.
5. In each specific situation, in the interests of the patient and where medical indications exist (for vital indications, taking into account individual intolerance and/or sensitivity), the scope of diagnosis and treatment may be expanded by decision of a medical consultation, using other methods of medical care approved by the Ministry of Health that are not included in this clinical protocol.
# CHAPTER 2 - CLASSIFICATION OF PE
6. Clinical classification of PE:
- substrate of occlusion of the PA and/or its branches is not verified (PE is determined by clinical probability);
- substrate of occlusion of the PA and/or its branches is verified (PE is determined by computed tomography (hereinafter - CT) data with contrast enhancement of the PA).
7. Classification of PE by stratification of the risk of early death (within the next 30 days):
- high risk;
- intermediate-high risk;
- intermediate-low risk;
- low risk.
8. The diagnosis states the clinical probability in accordance with the clinical assessment of the probability of PE (pretest probability) using the revised Geneva score according to Appendix 1 (if CT of the PA was not performed), the anatomical level of involvement of the PA bed (if CT of the PA was performed), the risk of early death (within the next 30 days), and complications.
## Examples of diagnosis wording
- "Thromboembolism of the lobar branches of the right PA (date). Intermediate-low risk. Tricuspid valve insufficiency with grade 2 regurgitation. Complete right bundle branch block.";
- "PE (total involvement of the pulmonary arterial bed 38 %), associated with COVID pneumonia (date). Intermediate-low risk.";
- "PE (date). Intermediate clinical probability (by the Geneva score). Low risk (PESI class II).";
- "PE (date) during pregnancy at 25 weeks. High clinical probability (by the Geneva score). Moderate risk (PESI class III). Tricuspid valve insufficiency with grade 3 regurgitation. Complete right bundle branch block.".
> Patients with acute PE and acute new-onset heart failure are not classified as having chronic heart failure (during the first three months from the onset of the disease).
# CHAPTER 3 - DIAGNOSIS OF PE
9. Mandatory diagnostic examinations performed by healthcare organizations when providing medical care to patients with PE at the first to fourth technological levels of medical care in outpatient settings are:
9.1. clinical examination methods:
- collection of complaints and history;
- general thermometry;
- anthropometry (height, weight);
- auscultation of the heart and lungs;
- counting of heart rate (hereinafter - HR) and pulse;
- counting of respiratory rate;
- measurement of arterial blood pressure (hereinafter - BP);
9.2. instrumental examination methods:
- pulse oximetry (determination of SpO2);
- electrocardiography (hereinafter - ECG);
- chest X-ray;
9.3. clinical assessment of the probability of PE (pretest probability) using the revised Geneva score according to Appendix 1;
9.4. assessment using the PE severity index (PESI) (risk of death within 30 days) according to Appendix 2.
10. Mandatory diagnostic examinations performed by healthcare organizations when providing medical care to patients with PE at the first technological level of medical care in inpatient settings are:
10.1. clinical examination methods:
- collection of complaints and history;
- general thermometry;
- anthropometry (height, weight);
- auscultation of the heart and lungs;
- counting of HR and pulse;
- counting of respiratory rate;
- measurement of BP;
10.2. laboratory examination methods:
- complete blood count;
- urinalysis;
- blood biochemistry: potassium, sodium, chloride, urea, creatinine, aspartate aminotransferase, alanine aminotransferase, bilirubin, glucose, C-reactive protein;
- calculation of glomerular filtration rate (hereinafter - GFR);
- coagulogram with D-dimer (in patients older than 50 years the permissible level is determined by the formula: age x 10 mcg/L) and international normalized ratio (hereinafter - INR);
- troponin level;
- acid-base status;
10.3. instrumental examination methods:
- pulse oximetry (determination of SpO2);
- ECG;
- chest X-ray;
- transthoracic echocardiography (hereinafter - TTE) with assessment of right ventricular (hereinafter - RV) function (RV size in the parasternal long-axis view, RV dilation with an RV/left ventricular (hereinafter - LV) diameter ratio > 1.0 (at the level of the basal segments), fractional area change (hereinafter - FAC), TAPSE, regional contractility, velocity and gradient of tricuspid regurgitation) and of the LV, PA pressure (systolic and mean), diameter of the inferior vena cava (hereinafter - IVC) and its inspiratory collapse (subcostal view);
- ultrasound examination of the veins of the lower limbs with mandatory control of four points (popliteal fossa and inguinal region on both sides);
10.4. clinical assessment of the probability of PE (pretest probability) using the revised Geneva score according to Appendix 1;
10.5. assessment of the risk of early death (within the next 30 days) using the algorithm according to Appendix 3.
11. Additional diagnostic examinations (where medical indications exist) are:
- transesophageal echocardiography (in hemodynamically unstable patients);
- consultations of medical specialists: hematologist, vascular surgeon;
- tumor marker testing;
- ultrasound examination of the abdominal organs and retroperitoneal space, including the IVC;
- digital rectal examination;
- esophagogastroduodenoscopy.
12. Mandatory diagnostic examinations performed by healthcare organizations when providing medical care to patients with PE at the second to third technological levels of medical care in inpatient settings are:
12.1. clinical examination methods:
- collection of complaints and history;
- general thermometry;
- anthropometry (height, weight);
- auscultation of the heart and lungs;
- counting of HR and pulse;
- counting of respiratory rate;
- measurement of BP;
12.2. laboratory examination methods:
- complete blood count;
- urinalysis;
- blood biochemistry: potassium, sodium, chloride, urea, creatinine, aspartate aminotransferase, alanine aminotransferase, bilirubin, glucose, C-reactive protein; brain natriuretic peptide (hereinafter - BNP) or its N-terminal precursor (hereinafter - NT-proBNP);
- calculation of GFR;
- coagulogram with antithrombin III (if possible), D-dimer (in patients older than 50 years the permissible level is determined by the formula: age x 10 mcg/L) and INR;
- troponin level;
- acid-base status;
12.3. instrumental examination methods:
- pulse oximetry (determination of SpO2);
- ECG;
- TTE with assessment of RV function (RV size in the parasternal long-axis view, RV dilation with an RV/LV diameter ratio > 1.0 (at the level of the basal segments), FAC, TAPSE, regional contractility, velocity and gradient of tricuspid regurgitation, determination of the "60/60" sign - a combination of RV outflow tract acceleration time < 60 msec and a moderately elevated peak systolic gradient across the tricuspid valve (< 60 mm Hg), and McConnell's sign - a combination of RV outflow tract acceleration time < 60 msec with reduced contractility of the RV free wall compared with the apex) and of the LV, PA pressure (systolic and mean), IVC diameter and inspiratory collapse (subcostal view);
- ultrasound examination of the veins of the lower limbs with mandatory control of four points (popliteal fossa and inguinal region on both sides);
- CT of the PA (not recommended up to 12 weeks of pregnancy);
12.4. clinical assessment of the probability of PE (before CT of the PA) (pretest probability) using the revised Geneva score according to Appendix 1;
12.5. assessment of the risk of early death (within the next 30 days) using the algorithm according to Appendix 3.
13. Additional diagnostic examinations performed where medical indications exist are:
- transesophageal echocardiography (in hemodynamically unstable patients);
- consultations of medical specialists: hematologist, vascular surgeon;
- molecular genetic diagnosis of thrombophilias;
- tumor marker testing;
- ultrasound examination of the abdominal organs and retroperitoneal space, including the IVC;
- digital rectal examination;
- esophagogastroduodenoscopy;
- fibrocolonoscopy;
- irrigoscopy;
- bronchoscopy.
14. Mandatory diagnostic examinations performed by healthcare organizations when providing medical care to patients with PE at the fourth technological level of medical care in inpatient settings are:
14.1. clinical examination methods:
- collection of complaints and history;
- general thermometry;
- anthropometry (height, weight);
- auscultation of the heart and lungs;
- counting of HR and pulse;
- counting of respiratory rate;
- measurement of BP;
14.2. laboratory examination methods:
- complete blood count;
- urinalysis;
- blood biochemistry: potassium, sodium, chloride, urea, creatinine, aspartate aminotransferase, alanine aminotransferase, bilirubin, glucose, C-reactive protein; BNP or NT-proBNP;
- calculation of GFR;
- coagulogram with antithrombin III (if possible), D-dimer (in patients older than 50 years the permissible level is determined by the formula: age x 10 mcg/L) and INR;
- troponin level;
- acid-base status;
14.3. instrumental examination methods:
- pulse oximetry (determination of SpO2);
- ECG;
- TTE with assessment of RV function (RV size in the parasternal long-axis view, RV dilation with an RV/LV diameter ratio > 1.0 (at the level of the basal segments), FAC, TAPSE, regional contractility, velocity and gradient of tricuspid regurgitation, determination of the "60/60" sign - a combination of RV outflow tract acceleration time < 60 msec and a moderately elevated peak systolic gradient across the tricuspid valve (< 60 mm Hg), and McConnell's sign - a combination of RV outflow tract acceleration time < 60 msec with reduced contractility of the RV free wall compared with the apex) and of the LV, PA pressure (systolic and mean), IVC diameter and inspiratory collapse (subcostal view);
- ultrasound examination of the veins of the lower limbs with mandatory control of four points (popliteal fossa and inguinal region on both sides);
- CT of the PA (not recommended up to 12 weeks of pregnancy);
14.4. clinical assessment of the probability of PE (before CT of the PA) (pretest probability) using the revised Geneva score according to Appendix 1;
14.5. assessment of the risk of early death (within the next 30 days) using the algorithm according to Appendix 3.
15. Additional diagnostic examinations performed where medical indications exist are:
- transesophageal echocardiography (in hemodynamically unstable patients);
- consultations of medical specialists: hematologist, vascular surgeon;
- ventilation-perfusion lung scintigraphy;
- molecular genetic diagnosis of thrombophilias;
- tumor marker testing;
- ultrasound examination of the abdominal organs and retroperitoneal space, including the IVC;
- digital rectal examination;
- esophagogastroduodenoscopy;
- fibrocolonoscopy;
- irrigoscopy;
- bronchoscopy.
# CHAPTER 4 - TREATMENT OF PATIENTS WITH PE
16. Treatment provided in healthcare organizations when delivering medical care to patients with PE accompanied by shock and hypotension, at the first to fourth technological levels of medical care in outpatient settings:
16.1. begin anticoagulant treatment without delay - bolus intravenous administration of unfractionated heparin (hereinafter - UFH) §UFH§, dosed by patient weight (80 U/kg), but not more than 5,000 U;
16.2. if pain syndrome is present, one of the following MPs is administered:
- Morphine | (solution for injection 10 mg/mL, 1 mL) 0.5-1 mL intravenously;
- Fentanyl | (solution for intravenous and intramuscular administration 0.05 mg/mL, 2 mL) 1-2 mL intravenously;
16.3. at BP < 90 mm Hg, one of the following MPs is prescribed:
- Dobutamine | (lyophilized powder for preparation of solution for infusion, 250 mg) at a dose of 2-20 mcg/kg/min;
- Norepinephrine | (solution for intravenous injection 1 mg/mL) at a dose of 0.2-1.0 mcg/kg/min;
16.4. in acute respiratory failure oxygen therapy is used (inhalation of an oxygen-air mixture through a nasal catheter or mask);
16.5. urgent hospitalization in a hospital organization is carried out.
17. Treatment provided in healthcare organizations when delivering medical care to patients with PE accompanied by shock and hypotension, at the first to fourth technological levels of medical care in inpatient settings:
17.1. catheterization of the subclavian vein;
17.2. respiratory support:
- at SpO2 < 90 % oxygen therapy is indicated (non-invasive, high-flow) through nasal cannulas or a face mask;
- if non-invasive ventilation is ineffective or adequate non-invasive ventilation cannot be performed, intubation and mechanical ventilation are carried out;
17.3. in acute right ventricular failure the following is prescribed:
17.3.1. at low or normal central venous pressure - intravenous infusion therapy (not more than 500 mL) over 15-30 minutes using one of the following electrolyte solutions: sodium chloride, potassium chloride or calcium chloride (Ringer's solution), solution for infusion 200-1000 mL, or sodium chloride (solution for infusion (for injection) 9 mg/mL, solution for infusion 100 mg/mL). When signs of increased central venous pressure appear, intravenous administration of the above solutions is stopped;
17.3.2. at BP < 90 mm Hg - one of the following MPs is administered:
- Dobutamine | (lyophilized powder for preparation of solution for infusion, 250 mg) at a dose of 2-20 mcg/kg/min intravenously;
- Norepinephrine | (solution for injection 1 mg/mL) at a dose of 0.2-1.0 mcg/kg/min intravenously.
> Combined use of dobutamine and norepinephrine is possible.
17.4. begin anticoagulant treatment without delay - bolus intravenous administration of UFH §UFH§, dosed by patient weight (80 U/kg), but not more than 5,000 U, followed by an infusion at a rate of 18 U/kg/h under control of the activated partial thromboplastin time (hereinafter - aPTT), which is maintained at 1.5-2 times above normal.
> Correction of UFH doses depending on the aPTT value is carried out according to Appendix 4. UFH is used as an anticoagulant in patients with unstable hemodynamics or at high risk of its development because of the possible need for reperfusion treatment (administration of a thrombolytic MP). UFH is part of the standard regimen of tissue plasminogen activator (alteplase) administration in PE;
17.5. patients with high-risk PE (cardiogenic shock, persistent arterial hypotension, cardiac arrest) should receive thrombolytic therapy with one of the following MPs:
- Alteplase | (lyophilisate for preparation of solution for infusion, 50 mg) by the standard regimen 100 mg over 2 hours intravenously or by the accelerated regimen: 0.6 mg/kg over 15 minutes (maximum dose 50 mg);
- Streptokinase | (lyophilized powder for preparation of solution for injection, 750,000 IU, 1,500,000 IU) by the standard regimen: 250,000 IU over 30 minutes as a loading dose, then 100,000 IU per hour for 12-24 hours, or by the accelerated regimen: 1,500,000 IU over 2 hours.
> After thrombolytic therapy the UFH infusion is resumed (3 hours after alteplase, 6 hours after streptokinase) at a rate of 18 U/kg/h under aPTT control, which is maintained at 1.5-2 times above normal and continued until hemodynamic stabilization of the patient. Correction of UFH doses depending on the aPTT value is carried out according to Appendix 4. Thrombolytic therapy is prescribed within 48 hours from the onset of PE symptoms, and up to 14 days when medical indications appear (shock or persistent hypotension, or cardiac arrest).
17.6. further, one of the following oral anticoagulants (hereinafter - OACs) is prescribed:
- Apixaban | §APX§ 10 mg twice daily orally for 7 days, then 5 mg twice daily orally;
- Dabigatran etexilate | §DAB§ §DABD§, prescribed 5 days after parenteral anticoagulant therapy;
- Rivaroxaban | §RIV§ 15 mg twice daily orally for 3 weeks, then 20 mg once daily orally;
-- or one of the following low-molecular-weight heparins (hereinafter - LMWH):
- Dalteparin | §DAL§ at a dose of 100 IU/kg twice daily subcutaneously (every 12 hours);
- Nadroparin | §NAD§ at a dose of 86 IU/kg twice daily subcutaneously;
- Enoxaparin | §ENO§ at a dose of 1 mg/kg twice daily subcutaneously (every 12 hours).
> In severe obesity (body mass index > 40 kg/m2) and severe renal impairment (GFR < 30 mL/min), UFH §UFH§ is prescribed, dosed by patient weight (80 U/kg), but not more than 5,000 U, followed by an infusion at a rate of 18 U/kg/h under aPTT control, maintained at 1.5-2 times above normal. Correction of UFH doses depending on the aPTT value is carried out according to Appendix 4;
17.7. if OACs cannot be prescribed, an indirect anticoagulant (vitamin K antagonist - warfarin) is used.
> Warfarin is started against the background of UFH or LMWH administration for at least 5 days. The initial dose of warfarin is 5 mg once daily under INR control, performed no later than 36 hours after the first dose of the MP and daily or every other day until the target level of hypocoagulation (INR 2.0-3.0) is reached. When target INR values are reached in two consecutive tests, UFH is discontinued and fully replaced by warfarin at individual doses depending on sensitivity to the MP. Selection of the warfarin dose by INR level is carried out according to Appendix 5.
18. In critical situations, with absolute medical contraindications to thrombolysis or its ineffectiveness, percutaneous catheter thrombectomy or surgical thrombectomy from the PA is performed (with extracorporeal membrane oxygenation if necessary) (at the third to fourth technological levels of medical care in inpatient settings).
19. Treatment provided in healthcare organizations when delivering medical care to patients with PE without shock and hypotension, at the first to fourth technological levels of medical care in outpatient settings:
19.1. begin anticoagulant treatment without delay - bolus intravenous administration of UFH §UFH§, dosed by patient weight (80 U/kg), but not more than 5,000 U;
19.2. if pain syndrome is present, one of the following MPs is administered:
- Morphine | (solution for injection 10 mg/mL, 1 mL) 0.5-1 mL intravenously;
- Fentanyl | (solution for intravenous and intramuscular administration 0.05 mg/mL, 2 mL) 1-2 mL intravenously;
19.3. in respiratory failure oxygen therapy is used (inhalation of an oxygen-air mixture through a nasal catheter or mask);
19.4. urgent hospitalization in a hospital organization is carried out.
20. Treatment provided in healthcare organizations when delivering medical care to patients with PE without shock and hypotension, at the first to fourth technological levels of medical care in inpatient settings:
20.1. if PE has an intermediate-high risk of early death, anticoagulant treatment is started with one of the following LMWHs:
- Dalteparin | §DAL§ at a dose of 100 IU/kg twice daily subcutaneously (every 12 hours);
- Nadroparin | §NAD§ at a dose of 86 IU/kg twice daily subcutaneously;
- Enoxaparin | §ENO§ at a dose of 1 mg/kg twice daily subcutaneously (every 12 hours).
> In severe obesity (body mass index > 40 kg/m2) and severe renal impairment (GFR < 30 mL/min), UFH is prescribed in accordance with subparagraph 17.4 of paragraph 17 of this clinical protocol. LMWH or UFH is administered for 5-7 days, followed by transition to one of the following OACs:
- Apixaban | §APX§ 10 mg twice daily orally for 7 days, then 5 mg twice daily orally;
- Dabigatran etexilate | §DAB§ §DABD§, prescribed 5 days after parenteral anticoagulant therapy;
- Rivaroxaban | §RIV§ 15 mg twice daily orally for 3 weeks, then 20 mg once daily orally;
20.2. if PE has an intermediate-low or low risk of early death, anticoagulant treatment is started with one of the OACs:
- Apixaban | §APX§ 10 mg twice daily orally for 7 days, then 5 mg twice daily orally;
- Dabigatran etexilate | §DAB§ §DABD§, prescribed 5 days after parenteral anticoagulant therapy;
- Rivaroxaban | §RIV§ 15 mg twice daily orally for 3 weeks, then 20 mg once daily orally;
20.3. if OACs cannot be prescribed, warfarin is prescribed in accordance with subparagraph 17.7 of paragraph 17 of this clinical protocol;
20.4. in patients with intermediate-high, intermediate-low and low risk of PE/VTE, if hemodynamics worsen during anticoagulant treatment, thrombolytic therapy is indicated, carried out in accordance with subparagraph 17.5 of paragraph 17 of this clinical protocol;
20.5. in patients with intermediate-high, intermediate-low and low risk of PE/VTE, if hemodynamics worsen during anticoagulant treatment, percutaneous catheter thrombectomy or surgical thrombectomy from the PA, with extracorporeal membrane oxygenation if necessary, is used as an alternative to thrombolysis (at the third to fourth technological levels of medical care in inpatient settings).
21. Continuation of drug treatment (use of anticoagulant MPs):
21.1. the minimum duration of anticoagulant MP use after a first episode of PE caused by a major transient risk factor (hereinafter - RF) is 3 months;
21.2. the same anticoagulant MP as in the acute period of PE is used - one of the OACs (in the absence of medical contraindications):
- Apixaban | §APX§ 5 mg twice daily orally;
- Dabigatran etexilate | §DAB§ §DABD§;
- Rivaroxaban | §RIV§ 20 mg once daily orally;
21.3. in case of extensive involvement of the pulmonary bed or proximal localization of deep vein thrombosis reaching the level of the iliac veins, the duration of anticoagulant MP use is extended to 6 months;
21.4. extension of anticoagulant treatment beyond 6 months is indicated in the following cases:
- unidentified source of PE;
- recurrent PE/VTE (at least one episode) not associated with a major transient RF.
> When treatment continues beyond 6 months, reduced doses of one of the OACs are prescribed:
- Apixaban | §APX§ 2.5 mg twice daily orally;
- Rivaroxaban | §RIV§ 10 mg once daily orally.
> If OACs are not tolerated or patients refuse them, antithrombotic treatment with acetylsalicylic acid (coated tablets 75 mg, 150 mg; enteric-coated tablets 50 mg, 100 mg; enteric-coated tablets (enteric-soluble coated tablets) 75 mg, 150 mg) 75-100 mg once daily orally is prescribed.
22. Stratification of the risk of PE/VTE recurrence is established according to Appendix 6.
23. Features of PE treatment in oncological diseases:
23.1. in hemodynamically stable PE, regardless of the risk of early death, treatment is started with LMWH during the first 10-14 days, administered in accordance with subparagraph 17.6 of paragraph 17 of this clinical protocol;
23.2. treatment is then continued for 6 months in accordance with subparagraph 20.1 of paragraph 20 of this clinical protocol, or with LMWH or OACs (rivaroxaban is not used in tumors of the gastrointestinal tract);
23.3. the duration of anticoagulant therapy is indefinitely long (6 months and more) or until cure of the oncological disease, and one of the following MPs is prescribed:
- Apixaban | §APX§ 2.5 mg twice daily orally;
- Rivaroxaban | §RIV§ 10 mg once daily orally, except for tumors of the gastrointestinal tract (to avoid bleeding);
23.4. treatment of acute PE with shock and hypotension is carried out in accordance with paragraphs 17-18 of this clinical protocol.
# CHAPTER 5 - MEDICAL PROPHYLAXIS OF PE AND VTE
24. Medical prophylaxis of PE/VTE includes non-specific (physical) and specific (drug) methods.
> Non-specific (physical) methods include mechanical methods of medical prophylaxis, namely:
- elastic compression of the lower limbs using compression hosiery;
- intermittent pneumatic compression of the lower limbs;
- electrical stimulation of the calf muscles;
- shortening the duration of bed rest;
- the earliest possible mobilization of patients;
- therapeutic exercise, use of simple training devices imitating walking.
> Specific (drug) methods of medical prophylaxis include the use of anticoagulants: UFH, LMWH, OACs.
25. Medical prophylaxis of PE/VTE in patients with surgical diseases (general surgery) is determined by the degree of risk of PE/VTE (Caprini score) according to Appendix 7 and consists in prescribing, 12 hours after surgical intervention, the following MPs:
25.1. for patients with low risk of PE/VTE, dalteparin §DAL§ 2,500 IU subcutaneously once daily is prescribed;
25.2. for patients with moderate risk of PE/VTE, one of the following MPs is prescribed:
- Dalteparin | §DAL§ 5,000 IU subcutaneously once daily or 2,500 IU subcutaneously twice daily (in case of bleeding risk);
- Nadroparin | §NAD§ 2,850 IU (0.3 mL) subcutaneously once daily;
- Enoxaparin | §ENO§ 2,000 IU (0.2 mL) subcutaneously once daily;
- UFH | §UFH§ 5,000 U every 8 hours subcutaneously;
25.3. for patients with high risk of PE/VTE, one of the following MPs is prescribed:
- Nadroparin | §NAD§ 2,850 IU (0.3 mL) subcutaneously (at body weight 51-70 kg) or 3,800 IU (0.4 mL) (at body weight above 70 kg) 12 hours after surgical intervention, for up to 3 days after surgery, then subcutaneously at body weight 51-70 kg - 3,800 IU (0.4 mL) once daily, and 5,700 IU (0.6 mL) at body weight over 70 kg;
- Enoxaparin | §ENO§ 4,000 IU (0.4 mL) subcutaneously once daily;
- UFH | §UFH§ 5,000 U every 8 hours subcutaneously.
> In case of progressive decrease in platelet count during anticoagulant therapy and suspected type II heparin-induced thrombocytopenia, heparin or LMWH is discontinued and a selective factor Xa inhibitor - fondaparinux §FON§ - is prescribed, 2.5 mg subcutaneously once daily, regardless of the RF.
25.4. if the patient is immobilized in the postoperative period, anticoagulant therapy is prescribed until the patient is mobilized.
26. Medical prophylaxis of PE/VTE in patients with trauma and orthopedic diseases:
26.1. patients with a low degree of risk of PE/VTE are patients under 40 years of age without comorbidity and with an uncomplicated early postoperative period after soft-tissue surgical interventions lasting up to 45 minutes.
> Patients with a low degree of risk of PE/VTE do not need preventive measures with anticoagulant MPs. Non-specific medical prophylaxis by early increase of motor activity is carried out;
26.2. patients with moderate risk of PE/VTE are patients:
- aged 40 to 60 years without comorbidity and RFs capable of aggravating the postoperative period, provided the duration of surgical intervention is not more than 45 minutes;
- under 40 years of age with comorbidity, provided the duration of surgical intervention is more than 45 minutes.
> Patients with moderate risk of PE/VTE are prescribed one of the following MPs:
- Low-dose UFH | §UFH§ 5,000 U every 8 hours subcutaneously;
- Dalteparin | §DAL§ 2,500 IU subcutaneously 2 hours before surgical intervention, then on the following days 2,500 IU once daily subcutaneously;
- Nadroparin | §NAD§ 2,850 IU (0.3 mL) subcutaneously 2-4 hours before surgical intervention, then on the following days 2,850 IU once daily subcutaneously;
- Enoxaparin | §ENO§ 2,000 IU (0.2 mL) subcutaneously 2-4 hours before surgical intervention, then on the following days 2,000 IU (0.2 mL) once daily subcutaneously;
26.3. patients with high risk of PE/VTE are patients:
- older than 60 years;
- aged 40 to 60 years with comorbidity, who are to undergo surgical intervention lasting more than 45 minutes;
- requiring osteosynthesis of the bones of the lower leg or foot, fractures of the upper limb, or surgical interventions on the bones of the upper limb (except the fingers of the hand and foot), regardless of age and comorbidity.
> Patients with high risk of PE/VTE are prescribed one of the following MPs:
- Low-dose UFH | §UFH§ 5,000 U every 8 hours subcutaneously;
- Dalteparin | §DAL§ 5,000 IU 12 hours before surgical intervention, then on the following days 5,000 IU once daily subcutaneously. A first administration of 2,500 IU 1-2 hours before surgical intervention and 2,500 IU subcutaneously 8-12 hours later, but not earlier than 4 hours after completion of the surgical intervention, is permissible; on the following days 5,000 IU is given subcutaneously once daily;
- Nadroparin | §NAD§ 2,850 IU (0.3 mL) subcutaneously 2-4 hours before surgical intervention, then on the following days 2,850 IU subcutaneously once daily;
- Enoxaparin | §ENO§ 4,000 IU (0.4 mL) subcutaneously 12 hours before surgical intervention, then on the following days 4,000 IU (0.4 mL) subcutaneously once daily;
26.4. patients with very high risk of PE/VTE are patients:
- requiring osteosynthesis and osteotomy of the femur, osteosynthesis of the pelvic bones, total arthroplasty of large joints (hip, knee, ankle, shoulder, elbow);
- older than 75 years;
- who have been on forced bed rest for more than 3 days while awaiting surgical intervention.
> Patients with very high risk of PE/VTE are indicated for medical prophylaxis with one of the following MPs:
- Dalteparin | §DAL§ 5,000 IU subcutaneously 12 hours before surgical intervention, then on the following days 5,000 IU once daily. A first administration of 2,500 IU 1-2 hours before surgical intervention and 2,500 IU subcutaneously 8-12 hours later, but not earlier than 4 hours after completion of the surgical intervention, is permissible; on the following days 5,000 IU is given subcutaneously once daily;
- Nadroparin | §NAD§ subcutaneously 12 hours before surgical intervention, 12 hours after surgical intervention and then once daily. The dose depends on body weight. For the first 3 days: 1,900 IU for patients weighing up to 50 kg; 2,850 IU (0.3 mL) for 50 to 69 kg; 3,800 IU (0.4 mL) for patients weighing 70 kg or more. From the fourth postoperative day: 1,900 IU for patients weighing up to 50 kg; 3,800 IU (0.4 mL) for 50 to 69 kg; and 5,700 IU (0.6 mL) for patients weighing 70 kg or more;
- Enoxaparin | §ENO§ 4,000 IU (0.4 mL) subcutaneously 12 hours before surgical intervention, then on the following days 4,000 IU (0.4 mL) once daily subcutaneously.
> At high risk of bleeding, the medical indications for drug thromboprophylaxis are determined by the surgeon, who may limit the approach to non-specific medical prophylaxis. Bleeding risk is assessed using the IMPROVE bleeding score according to Appendix 8;
26.5. duration of medical prophylaxis of PE/VTE:
- the entire period of bed rest in the pre- and postoperative periods;
- until the ability to walk is restored (not less than 3 hours per day), but not less than 14 days after surgical interventions in patients with moderate risk of PE/VTE; not less than 21 days after surgical interventions in patients with high risk, and not less than 28 days in patients with very high risk of PE/VTE.
27. Medical prophylaxis of PE/VTE in patients with gynecological diseases:
27.1. patients with a low degree of risk of PE/VTE are women requiring gynecological surgical interventions lasting less than 45 minutes.
> Patients with a low degree of risk of PE/VTE do not need preventive measures with anticoagulant MPs. Non-specific medical prophylaxis by early increase of motor activity is carried out;
27.2. patients with moderate risk of PE/VTE are women without RFs requiring surgical interventions lasting more than 45 minutes.
> Patients with moderate risk of PE/VTE are prescribed enoxaparin §ENO§ 2,000 IU (0.2 mL) subcutaneously 4-6 hours after surgical intervention, then on the following days 2,000 IU (0.2 mL) once daily subcutaneously. Non-specific medical prophylaxis using elastic compression of the lower limbs during surgical intervention and in the postoperative period is additionally prescribed;
27.3. patients with high risk of PE/VTE are women with RFs requiring surgical interventions lasting more than 45 minutes.
> Patients with high risk of PE/VTE are indicated for preoperative preparation with enoxaparin §ENO§ 4,000 IU (0.4 mL) subcutaneously 12-24 hours before surgical intervention, followed in the postoperative period by 4,000 IU (0.4 mL) subcutaneously once daily for at least 5 days. The first subcutaneous administration of enoxaparin should be given 4-6 hours after surgical intervention. LMWH prescription is supplemented by non-specific medical prophylaxis: elastic compression of the lower limbs during surgical intervention, intermittent pneumatic compression of the lower limbs, and elastic compression of the lower limbs in the postoperative period.
28. Medical prophylaxis of PE/VTE in patients with oncological diseases:
28.1. during antitumor (drug and/or radiation) therapy, the risk of PE/VTE is assessed in patients with oncological diseases receiving antitumor (drug and/or radiation) therapy using the Khorana score according to Appendix 9.
> If a high risk of PE/VTE is determined, medical prophylaxis of PE/VTE is started 2 hours before the start of therapy and continued throughout the entire course of antitumor (drug and/or radiation) therapy, and for 1-2 days after the end of each course of therapy. One of the following LMWHs is used for this:
- Dalteparin | §DAL§ 5,000 IU subcutaneously once daily;
- Nadroparin | §NAD§ 2,850 IU (0.3 mL) - 5,700 IU (0.6 mL) subcutaneously once daily;
- Enoxaparin | §ENO§ 4,000 IU (0.4 mL);
-- or
- Fondaparinux | §FON§ 2.5 mg subcutaneously once daily;
-- or
- Low-dose UFH | §UFH§ 5,000 U subcutaneously every 8 hours;
-- or one of the OACs (administration regimen - continuously during antitumor (drug and/or radiation) therapy and for two weeks after its completion):
- Apixaban | §APX§ 2.5 mg twice daily orally;
- Rivaroxaban | §RIV§ 10 mg once daily orally (except for tumors of the gastrointestinal tract);
28.2. in surgical treatment:
> For patients with an oncological disease undergoing surgical interventions lasting more than 45 minutes, medical prophylaxis is recommended in the absence of direct medical contraindications (active bleeding, high risk of bleeding) with one of the following MPs:
- Dalteparin sodium | §DAL§ 5,000 IU subcutaneously once daily, 12 hours before surgical intervention and then from the first day of the postoperative period;
- Nadroparin | §NAD§ 2,850-5,700 IU subcutaneously once daily, 12 hours before surgical intervention and then from the first day of the postoperative period;
- Enoxaparin | §ENO§ 4,000 IU subcutaneously once daily, 12 hours before surgical intervention and then from the first day of the postoperative period;
- UFH | §UFH§ 5,000 U every 8 hours subcutaneously, 12 hours before surgical intervention and then from the first day of the postoperative period;
- Fondaparinux | §FON§ 2.5 mg once daily.
> Doses of LMWH and fondaparinux must be reduced 2-fold in severe renal failure (GFR < 30 mL/min) and low body weight of the patient, and increased 1.5-fold at body weight above 120 kg.
> Duration of medical prophylaxis of PE/VTE in surgical interventions: after surgical intervention lasting more than 45 minutes - not less than 7-10 days; after surgical interventions lasting more than 45 minutes and endoscopic interventions on the abdominal organs and small pelvis - up to 4 weeks. At high risk of bleeding, pharmacological thromboprophylaxis must be started 2-3 days after surgical intervention. In addition to drug treatment, non-specific (physical) methods of medical prophylaxis are used.
29. To assess the risk of PE/VTE in patients with internal diseases, the Padua score is used according to Appendix 10.
> In high risk of PE/VTE, medical prophylaxis (in the absence of active bleeding and high risk of bleeding) is prescribed with one of the following MPs:
- Enoxaparin | §ENO§ at a dose of 4,000 anti-Xa IU/0.4 mL (40 mg) subcutaneously once daily;
- Nadroparin | §NAD§ at a dose of 3,800 IU anti-Xa/0.4 mL subcutaneously once daily (at patient body weight of 70 kg and more), 5,700 IU anti-Xa/0.6 mL subcutaneously once daily (at patient body weight above 70 kg) [as printed in the source];
- Fondaparinux | §FON§ at a dose of 2.5 mg subcutaneously once daily.
# CHAPTER 6 - MEDICAL FOLLOW-UP OF PATIENTS AFTER PE IN OUTPATIENT SETTINGS
30. Medical follow-up of patients after acute PE is carried out by general practitioners, internists and cardiologists and is performed at 3-6 months. It includes:
- medical examination of the patient to assess clinical status (the presence and severity of dyspnea are determined, with assignment of the functional class of pulmonary hypertension (hereinafter - PH) according to the functional classification of pulmonary hypertension per Appendix 11);
- assessment of adherence to treatment (regularity of anticoagulant treatment).
> When anticoagulant treatment is extended beyond 6 months, medical follow-up is carried out at least once a year, with assessment of liver and kidney function and assessment of the risk of bleeding (IMPROVE bleeding score) according to Appendix 8.
31. If functional class is > II and there are complaints of dyspnea, the following diagnostic examinations are performed:
- NT-proBNP level;
- TTE (to assess for pulmonary hypertension);
- if the mean PA pressure is > 25 mm Hg and NT-proBNP is elevated - ventilation-perfusion lung scintigraphy is performed;
- if no perfusion defects are found on ventilation-perfusion lung scintigraphy, contrast-enhanced CT of the PA is performed;
- if the mean PA pressure is > 25 mm Hg and perfusion defects are present, the patient is referred to the state institution "Republican Scientific and Practical Center 'Cardiology'" of the Ministry of Health.
"""
~/belarus-pe-protocol/src/build.py
# -*- coding: utf-8 -*-
import re, os, sys
sys.path.insert(0, os.path.dirname(__file__))
from xml.sax.saxutils import escape
import matplotlib
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer, Table, TableStyle,
PageBreak, CondPageBreak, KeepTogether)
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from content import BODY, T
fd = os.path.join(os.path.dirname(matplotlib.__file__), 'mpl-data/fonts/ttf')
pdfmetrics.registerFont(TTFont('DV', fd + '/DejaVuSans.ttf'))
pdfmetrics.registerFont(TTFont('DV-B', fd + '/DejaVuSans-Bold.ttf'))
pdfmetrics.registerFont(TTFont('DV-I', fd + '/DejaVuSans-Oblique.ttf'))
pdfmetrics.registerFont(TTFont('DV-BI', fd + '/DejaVuSans-BoldOblique.ttf'))
pdfmetrics.registerFontFamily('DV', normal='DV', bold='DV-B', italic='DV-I', boldItalic='DV-BI')
NAVY = colors.HexColor('#12355B'); TEAL = colors.HexColor('#0F8B8D'); RED = colors.HexColor('#C0392B')
ORANGE = colors.HexColor('#E67E22'); GOLD = colors.HexColor('#F2B134'); GREEN = colors.HexColor('#2E9E5B')
PURPLE = colors.HexColor('#6C4AB6'); BLUE = colors.HexColor('#2E86C1'); PINK = colors.HexColor('#D6336C')
PALE = colors.HexColor('#EAF4F8'); PALE2 = colors.HexColor('#F7FAFC'); NOTEBG = colors.HexColor('#FFF6E0')
BANDS = [BLUE, TEAL, PURPLE, RED, GREEN, ORANGE]
W, H = A4
LM = RM = 17 * mm
CW = W - LM - RM
def st(name, **kw):
base = dict(fontName='DV', fontSize=8.6, leading=12.2, textColor=colors.HexColor('#1B1B1B'))
base.update(kw)
return ParagraphStyle(name, **base)
S_BODY = st('body', alignment=TA_JUSTIFY, spaceAfter=3)
S_NOTE = st('note', fontSize=8.4, leading=11.8, alignment=TA_JUSTIFY)
S_H2 = st('h2', fontName='DV-B', fontSize=10, textColor=NAVY, spaceBefore=6, spaceAfter=3)
S_APP = st('app', fontSize=8, leading=11, alignment=TA_LEFT, textColor=colors.HexColor('#333333'))
S_APPT = st('appt', fontName='DV-B', fontSize=11, leading=14.5, textColor=NAVY, spaceBefore=4, spaceAfter=6)
S_CELL = st('cell', fontSize=7.8, leading=10.2)
S_CELLC = st('cellc', fontSize=7.8, leading=10.2, alignment=TA_CENTER)
S_CELLH = st('cellh', fontName='DV-B', fontSize=7.8, leading=10.2, alignment=TA_CENTER, textColor=colors.white)
S_FOOT = st('foot', fontSize=7.4, leading=10, textColor=colors.HexColor('#444444'))
def fmt(t):
t = escape(t)
t = re.sub(r'\*\*(.+?)\*\*', r'<b>\1</b>', t)
t = t.replace('SpO2', 'SpO<sub>2</sub>').replace('kg/m2', 'kg/m<super>2</super>')
t = t.replace('mL/min/m2', 'mL/min/m<super>2</super>')
return t
def P(t, s=S_CELL): return Paragraph(fmt(t), s)
def PC(t): return Paragraph(fmt(t), S_CELLC)
def PH(t): return Paragraph(fmt(t), S_CELLH)
def band(num, title, color):
inner = Table([[Paragraph('<font color="#FFFFFF" size="8">%s</font>' % escape(num), st('b1', fontName='DV-B', leading=10)),],
[Paragraph('<font color="#FFFFFF" size="12.5"><b>%s</b></font>' % escape(title), st('b2', leading=16))]],
colWidths=[CW])
inner.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, -1), color), ('LEFTPADDING', (0, 0), (-1, -1), 10),
('TOPPADDING', (0, 0), (-1, 0), 6), ('BOTTOMPADDING', (0, 0), (-1, 0), 0),
('TOPPADDING', (0, 1), (-1, 1), 0), ('BOTTOMPADDING', (0, 1), (-1, 1), 7),
('LINEBELOW', (0, 1), (-1, 1), 3, GOLD)]))
return [CondPageBreak(40 * mm), Spacer(1, 6), inner, Spacer(1, 6)]
def note(text, color):
t = Table([[Paragraph(fmt(text), S_NOTE)]], colWidths=[CW - 8])
t.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, -1), NOTEBG), ('LINEBEFORE', (0, 0), (0, -1), 3, color),
('LEFTPADDING', (0, 0), (-1, -1), 8), ('RIGHTPADDING', (0, 0), (-1, -1), 6),
('TOPPADDING', (0, 0), (-1, -1), 4), ('BOTTOMPADDING', (0, 0), (-1, -1), 4)]))
t.hAlign = 'RIGHT'
return [t, Spacer(1, 4)]
def sub(text): return text
def build_body():
flow = []
body = BODY
for k, v in T.items():
body = body.replace('§%s§' % k, v)
cidx = -1
color = BLUE
for raw in body.split('\n'):
line = raw.rstrip()
if not line: continue
if line == '@RESOLUTION':
flow += resolution(); continue
if line.startswith('# '):
parts = line[2:].split('|')
if len(parts) == 3:
flow += title_block(parts[0], parts[1])
parts = [parts[2]]
cidx += 1; color = BANDS[cidx % len(BANDS)]
m = re.match(r'(CHAPTER \d+) - (.+)', parts[0])
flow += band(m.group(1), m.group(2), color)
continue
if line.startswith('## '):
flow.append(Paragraph(fmt(line[3:]), S_H2)); continue
if line.startswith('> '):
flow += note(line[2:], color); continue
if line.startswith('-- '):
flow.append(Paragraph(fmt(line[3:]), st('sb', alignment=TA_JUSTIFY, leftIndent=34, fontName='DV-I', spaceAfter=2, textColor=NAVY))); continue
if line.startswith('- '):
txt = line[2:]
if ' | ' in txt:
a, b = txt.split(' | ', 1); txt = '**%s** %s' % (a, b)
s = st('bl', alignment=TA_JUSTIFY, leftIndent=28, bulletIndent=17, spaceAfter=1.5)
flow.append(Paragraph(fmt(txt), s, bulletText='\u25A0'))
flow[-1].style.bulletFontSize = 5
flow[-1].style.bulletColor = color
continue
m = re.match(r'^(\d+(?:\.\d+)*)\.\s+(.*)$', line)
if m:
num, txt = m.group(1), m.group(2)
depth = num.count('.')
ind = [0, 10, 20][min(depth, 2)]
hexc = color.hexval()[2:]
s = st('np%d' % depth, alignment=TA_JUSTIFY, leftIndent=ind, spaceBefore=(5 if depth == 0 else 2), spaceAfter=2)
flow.append(Paragraph('<font color="#%s"><b>%s.</b></font> %s' % (hexc, num, fmt(txt)), s))
continue
flow.append(Paragraph(fmt(line), S_BODY))
return flow
def title_block(t1, t2):
t = Table([[Paragraph('<font color="#FFFFFF" size="9"><b>%s</b></font>' % escape(t1), st('t1', alignment=TA_CENTER, leading=12))],
[Paragraph('<font color="#FFFFFF" size="14"><b>%s</b></font>' % escape(t2.strip('"')), st('t2', alignment=TA_CENTER, leading=19))]],
colWidths=[CW])
t.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, -1), NAVY), ('TOPPADDING', (0, 0), (-1, 0), 12),
('BOTTOMPADDING', (0, 1), (-1, 1), 14), ('LEFTPADDING', (0, 0), (-1, -1), 14), ('RIGHTPADDING', (0, 0), (-1, -1), 14),
('LINEBELOW', (0, 1), (-1, 1), 4, TEAL)]))
return [Spacer(1, 8), t, Spacer(1, 6)]
def resolution():
f = []
hb = Table([[Paragraph('<font color="#FFFFFF" size="9.5"><b>RESOLUTION OF THE MINISTRY OF HEALTH</b></font><br/><font color="#FFFFFF" size="9.5"><b>OF THE REPUBLIC OF BELARUS</b></font>', st('r1', alignment=TA_CENTER, leading=14))],
[Paragraph('<font color="#FFFFFF" size="9">28 April 2026 No. 43</font>', st('r2', alignment=TA_CENTER))]], colWidths=[CW])
hb.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, -1), TEAL), ('TOPPADDING', (0, 0), (-1, 0), 12), ('BOTTOMPADDING', (0, 1), (-1, 1), 10),
('LINEBELOW', (0, 1), (-1, 1), 4, GOLD)]))
f += [hb, Spacer(1, 10), Paragraph('<font size="12" color="#12355B"><b>On approval of the clinical protocol</b></font>', st('r3', alignment=TA_CENTER, leading=16)), Spacer(1, 8)]
f.append(Paragraph(fmt('On the basis of paragraph nine of part one of Article 1 of the Law of the Republic of Belarus of 18 June 1993 No. 2435-XII "On Healthcare" and subparagraph 8.3 of paragraph 8 of the Regulation on the Ministry of Health of the Republic of Belarus, approved by Resolution of the Council of Ministers of the Republic of Belarus of 28 October 2011 No. 1446, the Ministry of Health of the Republic of Belarus **RESOLVES:**'), S_BODY))
f.append(Paragraph('<font color="#0F8B8D"><b>1.</b></font> ' + fmt('To approve the clinical protocol "Diagnosis, treatment and medical prophylaxis of pulmonary embolism (adult population)".'), S_BODY))
f.append(Paragraph('<font color="#0F8B8D"><b>2.</b></font> ' + fmt('This resolution shall enter into force after its official publication.'), S_BODY))
f.append(Spacer(1, 6))
f.append(Paragraph('<b>Minister</b> <font color="#C0392B"><b>A.V. Khodzhayev</b></font>', st('r4', fontSize=10, leading=14)))
f.append(Spacer(1, 10))
ag = ['Brest Regional Executive Committee', 'Vitebsk Regional Executive Committee', 'Gomel Regional Executive Committee',
'Grodno Regional Executive Committee', 'Mogilev Regional Executive Committee', 'Minsk Regional Executive Committee',
'Minsk City Executive Committee', 'Administration of Affairs of the President of the Republic of Belarus']
left = [Paragraph('<font color="#FFFFFF"><b>AGREED</b></font>', st('ag', alignment=TA_CENTER, leading=13))] + [Paragraph(fmt(a), st('ag2', fontSize=8.4, leading=11.5, spaceAfter=2)) for a in ag]
right = [Paragraph('<font color="#FFFFFF"><b>APPROVED</b></font>', st('ap', alignment=TA_CENTER, leading=13)),
Paragraph(fmt('Resolution of the Ministry of Health of the Republic of Belarus'), st('ap2', fontSize=8.4, leading=11.5, spaceAfter=2)),
Paragraph(fmt('28.04.2026 No. 43'), st('ap3', fontName='DV-B', fontSize=8.8))]
t = Table([[Paragraph('<font color="#FFFFFF"><b>AGREED</b></font>', st('x', alignment=TA_CENTER)), Paragraph('<font color="#FFFFFF"><b>APPROVED</b></font>', st('y', alignment=TA_CENTER))],
[left[1:], right[1:]]], colWidths=[CW * 0.55, CW * 0.45])
t.setStyle(TableStyle([('BACKGROUND', (0, 0), (0, 0), PURPLE), ('BACKGROUND', (1, 0), (1, 0), GREEN),
('BACKGROUND', (0, 1), (0, 1), colors.HexColor('#F0EBFA')), ('BACKGROUND', (1, 1), (1, 1), colors.HexColor('#E7F6EE')),
('VALIGN', (0, 1), (-1, 1), 'TOP'), ('BOX', (0, 0), (-1, -1), 0.6, colors.HexColor('#999999')),
('LEFTPADDING', (0, 0), (-1, -1), 8), ('TOPPADDING', (0, 0), (-1, -1), 5), ('BOTTOMPADDING', (0, 0), (-1, -1), 5)]))
f += [t, Spacer(1, 6)]
return f
# ---------------- tables ----------------
def tbl(data, widths, color=NAVY, extra=None, zebra=True, header_rows=1):
t = Table(data, colWidths=widths, repeatRows=header_rows)
style = [('BACKGROUND', (0, 0), (-1, header_rows - 1), color), ('GRID', (0, 0), (-1, -1), 0.4, colors.HexColor('#9BB0C1')),
('VALIGN', (0, 0), (-1, -1), 'MIDDLE'), ('TOPPADDING', (0, 0), (-1, -1), 3), ('BOTTOMPADDING', (0, 0), (-1, -1), 3),
('LEFTPADDING', (0, 0), (-1, -1), 4), ('RIGHTPADDING', (0, 0), (-1, -1), 4)]
if zebra:
for i in range(header_rows, len(data)):
if (i - header_rows) % 2 == 1: style.append(('BACKGROUND', (0, i), (-1, i), PALE))
if extra: style += extra
t.setStyle(TableStyle(style))
return t
def appendix(n, title, color):
head = Table([[Paragraph('<font color="#FFFFFF"><b>Appendix %d</b></font><br/><font color="#FFFFFF" size="7.5">to the clinical protocol "Diagnosis, treatment and medical prophylaxis of pulmonary embolism (adult population)"</font>' % n,
st('ah', fontSize=10, leading=13))]], colWidths=[CW])
head.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, -1), color), ('LEFTPADDING', (0, 0), (-1, -1), 10), ('TOPPADDING', (0, 0), (-1, -1), 6),
('BOTTOMPADDING', (0, 0), (-1, -1), 6), ('LINEBELOW', (0, 0), (-1, -1), 3, GOLD)]))
return [CondPageBreak(70 * mm), Spacer(1, 8), head, Spacer(1, 4), Paragraph(fmt(title), S_APPT)]
def foot(text): return [Spacer(1, 3), Paragraph(fmt(text), S_FOOT)]
def appendices():
f = []
f += [PageBreak()]
banner = Table([[Paragraph('<font color="#FFFFFF" size="15"><b>APPENDICES</b></font>', st('ab', alignment=TA_CENTER, leading=20))]], colWidths=[CW])
banner.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, -1), NAVY), ('TOPPADDING', (0, 0), (-1, -1), 10), ('BOTTOMPADDING', (0, 0), (-1, -1), 10), ('LINEBELOW', (0, 0), (-1, -1), 4, GOLD)]))
f += [banner, Spacer(1, 6)]
# 1 Geneva
f += appendix(1, 'Clinical assessment of the probability of PE (pretest probability) using the revised Geneva score', BLUE)
d = [[PH('No.'), PH('Clinical sign or category'), PH('Original version (points)'), PH('Simplified version (points)')]]
rows = [('1', 'History of VTE', '3', '1'), ('2', 'Heart rate (HR):', '', ''), ('2.1', '75-94 beats/min', '3', '1'),
('2.2', '\u2265 95 beats/min (printed as "75-94" in the source document)', '5', '2'),
('3', 'Surgery or fracture within the last month', '2', '1'), ('4', 'Hemoptysis', '2', '1'),
('5', 'Cancer in the active phase', '2', '1'), ('6', 'Pain in one leg', '3', '1'),
('7', 'Pain on palpation of the deep veins of the lower limb or edema of one leg', '4', '1'),
('8', 'Age > 65 years', '1', '1'), ('9', 'Three-level categories:', '', ''),
('9.1', 'Low', '0-3', '0-1'), ('9.2', 'Intermediate', '4-10', '2-4'), ('9.3', 'High', '\u2265 11', '\u2265 5'),
('10', 'Two-level categories:', '', ''), ('10.1', 'PE unlikely', '0-5', '0-2'), ('10.2', 'PE likely', '\u2265 6', '\u2265 3')]
for r in rows: d.append([PC(r[0]), P(r[1]), PC(r[2]), PC(r[3])])
ex = [('BACKGROUND', (0, 2), (-1, 2), colors.HexColor('#D6EAF8')), ('BACKGROUND', (0, 10), (-1, 10), colors.HexColor('#D6EAF8')), ('BACKGROUND', (0, 15), (-1, 15), colors.HexColor('#D6EAF8')),
('BACKGROUND', (0, 11), (-1, 11), colors.HexColor('#D5F5E3')), ('BACKGROUND', (0, 12), (-1, 12), colors.HexColor('#FCF3CF')), ('BACKGROUND', (0, 13), (-1, 13), colors.HexColor('#FADBD8')),
('BACKGROUND', (0, 16), (-1, 16), colors.HexColor('#D5F5E3')), ('BACKGROUND', (0, 17), (-1, 17), colors.HexColor('#FADBD8'))]
# fix indices (header is row 0, rows start at 1)
ex = [('BACKGROUND', (0, 2), (-1, 2), colors.HexColor('#D6EAF8')), ('BACKGROUND', (0, 10), (-1, 10), colors.HexColor('#D6EAF8')), ('BACKGROUND', (0, 14), (-1, 14), colors.HexColor('#D6EAF8')),
('BACKGROUND', (0, 11), (-1, 11), colors.HexColor('#D5F5E3')), ('BACKGROUND', (0, 12), (-1, 12), colors.HexColor('#FCF3CF')), ('BACKGROUND', (0, 13), (-1, 13), colors.HexColor('#FADBD8')),
('BACKGROUND', (0, 15), (-1, 15), colors.HexColor('#D5F5E3')), ('BACKGROUND', (0, 16), (-1, 16), colors.HexColor('#FADBD8'))]
f.append(tbl(d, [14 * mm, CW - 14 * mm - 70 * mm, 35 * mm, 35 * mm], BLUE, ex, zebra=False))
# 2 PESI
f += appendix(2, 'PE severity index (PESI) (risk of death within 30 days)', TEAL)
d = [[PH('No.'), PH('Indicator'), PH('Original version (points)'), PH('Simplified version (points)')]]
rows = [('1', 'Age', 'Age value in years', '1, when > 80 years'), ('2', 'Male sex', '10', 'Not assessed'),
('3', 'Malignant neoplasm', '30', '1'), ('4', 'Chronic heart failure', '10', '1'),
('5', 'Chronic lung disease', '10', '(combined with item 4)'), ('6', 'HR \u2265 110 beats/min', '20', '1'),
('7', 'Systolic BP < 100 mm Hg', '30', '1'), ('8', 'Respiratory rate > 30 per minute', '20', 'Not assessed'),
('9', 'Body temperature < 36 \u00b0C', '20', 'Not assessed'), ('10', 'Altered mental status', '60', 'Not assessed'),
('11', 'Arterial blood oxygen saturation < 90 %', '20', '1')]
for r in rows: d.append([PC(r[0]), P(r[1]), PC(r[2]), PC(r[3])])
f.append(tbl(d, [14 * mm, CW - 14 * mm - 70 * mm, 35 * mm, 35 * mm], TEAL))
f.append(Spacer(1, 6))
d = [[PH('Sum of points'), PH('Risk / PESI class'), PH('Expected 30-day mortality')]]
rows = [('\u2264 65 points', 'Very low risk - class I', '0-1.6 %', '#D5F5E3'), ('66-85 points', 'Low risk - class II', '1.7-3.5 %', '#E8F8E0'),
('86-105 points', 'Moderate risk - class III', '3.2-7.1 %', '#FCF3CF'), ('106-125 points', 'High risk - class IV', '4.0-11.4 %', '#FAD7A0'),
('> 125 points', 'Very high risk - class V', '10.0-24.5 %', '#F5B7B1'),
('Simplified version: 0 points', 'Expected mortality', '1.0 %', '#EAF4F8'), ('Simplified version: \u2265 1 point', 'Expected mortality', '10.9 %', '#EAF4F8')]
d += [[PC(a), PC(b), PC(c)] for a, b, c, _ in rows]
ex = [('BACKGROUND', (0, i + 1), (-1, i + 1), colors.HexColor(r[3])) for i, r in enumerate(rows)]
f.append(tbl(d, [CW * 0.34, CW * 0.36, CW * 0.30], TEAL, ex, zebra=False))
# 3 algorithm
f += appendix(3, 'ALGORITHM for assessing the risk of early death (within the next 30 days)', PURPLE)
hdr = [PH('No.'), PH('Risk of early death'), PH('Hemodynamic instability (cardiac arrest, obstructive shock or persistent hypotension)'),
PH('PESI class III-IV or simplified PESI \u2265 1 point'), PH('RV dysfunction on TTE or CT of the PA'), PH('Elevated troponin level in blood')]
rows = [[PC('1'), PC('**High**'), PC('+'), PC('(+)*'), PC('+'), PC('(+)*')],
[PC('2'), PC('**Intermediate-high**'), PC('\u2212'), PC('+'), PC('+'), PC('+')],
[PC('3'), PC('**Intermediate-low**'), PC('\u2212'), PC('+'), PC('Positive only one of the two, or both negative'), ''],
[PC('4'), PC('**Low**'), PC('\u2212'), PC('\u2212'), PC('Assessment optional; if assessed, not elevated'), '']]
cols = ['#F5B7B1', '#FAD7A0', '#FCF3CF', '#D5F5E3']
ex = [('BACKGROUND', (0, i), (-1, i), colors.HexColor(cols[i - 1])) for i in range(1, 5)] + [('SPAN', (4, 3), (5, 3)), ('SPAN', (4, 4), (5, 4))]
f.append(tbl([hdr] + rows, [10 * mm, 30 * mm, 38 * mm, 32 * mm, 32 * mm, CW - 142 * mm], PURPLE, ex, zebra=False))
f += foot('* In unstable hemodynamics, determination is not required.')
# 4 aPTT
f += appendix(4, 'Correction of UFH doses depending on the aPTT value', RED)
d = [[PH('No.'), PH('aPTT'), PH('Change of UFH dose')]]
rows = [('1', '< 35 sec. (< 1.2 x normal*)', 'Bolus 80 U/kg, increase infusion rate by 4 U/kg/h'),
('2', '35-45 sec. (1.2-1.5 x normal*)', 'Bolus 40 U/kg, increase infusion rate by 2 U/kg/h'),
('3', '46-70 sec. (1.5-2.3 x normal*)', 'No change'),
('4', '71-90 sec. (2.3-3.0 x normal*)', 'Decrease infusion rate by 2 U/kg/h'),
('5', '> 90 sec. (> 3.0 x normal*)', 'Stop the infusion for 1 hour, then resume, but decrease the infusion rate by 3 U/kg/h')]
d += [[PC(a), PC(b), P(c)] for a, b, c in rows]
ex = [('BACKGROUND', (0, i + 1), (-1, i + 1), colors.HexColor(c)) for i, c in enumerate(['#D6EAF8', '#EAF4F8', '#D5F5E3', '#FCF3CF', '#F5B7B1'])]
f.append(tbl(d, [14 * mm, 55 * mm, CW - 69 * mm], RED, ex, zebra=False))
f += foot('* The aPTT value considered normal in the particular laboratory.')
# 5 warfarin
f += appendix(5, 'Selection of warfarin dosing by INR level', GREEN)
h = [PH('No.'), PH('Day / dose'), PH('INR at 9-11 h'), PH('Warfarin dose, taken at 17-19 h'), PH('INR at 9-11 h'), PH('Warfarin dose, taken at 17-19 h'), PH('INR at 9-11 h'), PH('Warfarin dose, taken at 17-19 h')]
c = PC
r1 = [c('1'), P('1st dose'), c('-'), c('5.0 mg'), c('-'), c('5.0 mg'), c('-'), c('5.0 mg')]
r2 = [c(''), c(''), PC('**High sensitivity to warfarin**'), '', PC('**Usual sensitivity to warfarin**'), '', PC('**Low sensitivity to warfarin**'), '']
r3 = [c('2'), P('Day 1'), c('Test not performed'), c('5.0 mg'), c('Test not performed'), c('5.0 mg'), c('Test not performed'), c('5.0 mg')]
r4a = [c('3'), P('Day 2'), c('2.0-2.5'), c('2.5 mg'), c('-'), c('-'), c('-'), c('-')]
r4b = ['', '', c('> 2.5'), c('Skip one day, continue at 2.5 mg dose'), c('1.5-2.0'), c('5.0-7.5 mg'), c('< 1.5'), c('7.5 mg')]
r5a = [c('4'), P('Day 3-4'), c('2.0-3.0'), c('1.25-2.5 mg'), c('1.5-2.0'), c('7.5-10 mg'), c('< 1.5'), c('10.0 mg')]
r5b = ['', '', c('> 3.0'), c('Skip one day, continue at 1.25 mg dose'), c('2.0-3.0'), c('5.0-7.5 mg'), c('1.5-2.0'), c('7.5 mg')]
r6a = [c('5'), P('Day 5-6'), c('2.0-3.0'), c('Keep the dose'), c('1.5-2.0'), c('10 mg'), c('< 1.5'), c('12.5-15 mg')]
r6b = ['', '', c('> 3.0'), c('Skip one day, continue at 1.25 mg dose every other day'), c('2.0-3.0'), c('Keep the dose'), c('1.5-2.0'), c('10.0-12.5 mg')]
r6c = ['', '', '', '', c('3.0-4.0'), c('Reduce the dose by 30 %'), c('2.0-3.0'), c('Keep the dose')]
r6d = ['', '', '', '', c('> 4.0'), c('Skip one day, continue at a dose 30 % lower'), c('3.0-4.0'), c('Reduce the dose by 30 %')]
r6e = ['', '', '', '', '', '', c('> 4.0'), c('Skip one day, continue at a dose 30 % lower')]
data = [h, r1, r2, r3, r4a, r4b, r5a, r5b, r6a, r6b, r6c, r6d, r6e]
ex = [('SPAN', (0, 2), (1, 2)), ('SPAN', (2, 2), (3, 2)), ('SPAN', (4, 2), (5, 2)), ('SPAN', (6, 2), (7, 2)),
('BACKGROUND', (0, 2), (-1, 2), colors.HexColor('#D5F5E3')),
('SPAN', (0, 4), (0, 5)), ('SPAN', (1, 4), (1, 5)), ('SPAN', (0, 6), (0, 7)), ('SPAN', (1, 6), (1, 7)),
('SPAN', (0, 8), (0, 12)), ('SPAN', (1, 8), (1, 12)), ('SPAN', (2, 9), (2, 12)), ('SPAN', (3, 9), (3, 12)),
('SPAN', (4, 11), (4, 12)), ('SPAN', (5, 11), (5, 12)),
('BACKGROUND', (2, 3), (3, 12), colors.HexColor('#FDEDEC')), ('BACKGROUND', (4, 3), (5, 12), colors.HexColor('#FEF9E7')), ('BACKGROUND', (6, 3), (7, 12), colors.HexColor('#EAF2F8')),
('BACKGROUND', (2, 1), (3, 1), colors.HexColor('#FDEDEC')), ('BACKGROUND', (4, 1), (5, 1), colors.HexColor('#FEF9E7')), ('BACKGROUND', (6, 1), (7, 1), colors.HexColor('#EAF2F8'))]
wd = [8 * mm, 17 * mm] + [(CW - 25 * mm) / 6] * 6
f.append(tbl(data, wd, GREEN, ex, zebra=False))
# 6 recurrence
f += appendix(6, 'Stratification of the risk of PE/VTE recurrence', ORANGE)
d = [[PH('No.'), PH('Recurrence risk'), PH('Risk factor (RF)'), PH('Probable causes')]]
rows = [('1', '**Low** (< 3 % per year)', 'Major transient RF associated with > 10 % probability of connection with the index episode',
'Surgery with general anesthesia > 30 minutes; acute illness with hospitalization and bed rest > 3 days; trauma + fracture', '#D5F5E3'),
('2', '**Intermediate** (3-8 % per year)', 'Major transient RF associated with < 10 % probability of connection with the index episode',
'Surgery with general anesthesia < 30 minutes; acute illness with hospitalization and bed rest < 3 days; estrogen therapy or contraception; pregnancy and early postpartum period; trauma with limited mobility without fracture; long-distance flight', '#FCF3CF'),
('3', '**High** (> 8 % per year)', '', 'Progressive malignant neoplasm; antiphospholipid syndrome; recurrent PE/VTE in the absence of a major transient RF', '#F5B7B1')]
d += [[PC(a), P(b), P(c), P(dd)] for a, b, c, dd, _ in rows]
ex = [('BACKGROUND', (0, i + 1), (-1, i + 1), colors.HexColor(r[4])) for i, r in enumerate(rows)]
f.append(tbl(d, [10 * mm, 34 * mm, 50 * mm, CW - 94 * mm], ORANGE, ex, zebra=False))
# 7 Caprini
f += appendix(7, 'Degree of risk of PE/VTE (Caprini score)*', PINK)
items = [
(1, ['Age 41-60 years', 'Lower limb edema', 'Varicose veins', 'Body mass index > 25 kg/m2', 'Minor surgical intervention', 'Sepsis (within the last month)',
'Lung diseases (bronchial asthma, chronic obstructive pulmonary disease, pulmonary emphysema, others, including pneumonia within the last month)',
'Combined oral contraceptives, hormone replacement therapy', 'Pregnancy and postpartum period (within the last month)',
'History of: unexplained stillbirths, miscarriages (> 3), premature births with toxemia or intrauterine growth restriction', 'Acute myocardial infarction',
'Chronic heart failure', 'Bed rest in patients with internal diseases', 'Inflammatory bowel disease (history)', 'Surgical intervention lasting more than 45 min (within the last month)']),
(2, ['Age 61-74 years', 'Arthroscopic surgery', 'Malignant neoplasm', 'Laparoscopic intervention (lasting more than 60 min)', 'Bed rest (more than 72 hours)',
'Immobilization of a limb (within the last month)', 'Central venous catheterization', 'Surgical intervention lasting more than 45 min']),
(3, ['Age over 75 years', 'Personal history of VTE', 'Family history of VTE', 'Factor V Leiden mutation (FVL)', 'Prothrombin mutation (FII G20210A)', 'Hyperhomocysteinemia',
'Heparin-induced thrombocytopenia', 'Elevated anticardiolipin antibody level', 'Lupus anticoagulant (positive test)', 'Other congenital or acquired thrombophilia']),
(5, ['Stroke (within the last month)', 'Multiple trauma (within the last month)', 'Arthroplasty of large joints', 'Fracture of the femur and tibia bones (within the last month)',
'Spinal cord injury and/or paralysis (within the last month)'])]
d = [[PH('No.'), PH('Risk factor (RF)'), PH('Points')]]
ex = []; n = 0; pcol = {1: '#EAF4F8', 2: '#FCF3CF', 3: '#FAD7A0', 5: '#F5B7B1'}
for pts, lst in items:
start = len(d)
for it in lst:
n += 1; d.append([PC(str(n)), P(it), PC(str(pts)) if it == lst[0] else PC('')])
ex += [('SPAN', (2, start), (2, len(d) - 1)), ('BACKGROUND', (0, start), (-1, len(d) - 1), colors.HexColor(pcol[pts])), ('LINEBELOW', (0, len(d) - 1), (-1, len(d) - 1), 1, PINK)]
f.append(tbl(d, [12 * mm, CW - 32 * mm, 20 * mm], PINK, ex, zebra=False))
f += foot('* Low risk: 0-2 points; moderate risk: 3-4 points; high risk: 5 points and more.')
# 8 IMPROVE
f += appendix(8, 'Assessment of the risk of bleeding (IMPROVE bleeding score)*', RED)
rows = [('GFR less than 60 mL/min/m2', '1'), ('Male sex', '1'), ('Age over 40 years', '1.5'), ('Progressive malignant neoplasm', '2'), ('Rheumatologic disease', '2'),
('Presence of a central venous catheter', '2'), ('Stay in the department of anesthesiology and intensive care', '2.5'), ('GFR less than 30 mL/min/m2', '2.5'), ('INR > 1.5', '2.5'),
('Age over 85 years', '3.5'), ('Platelet count < 50 thousand', '4'), ('Bleeding that occurred within 3 months before hospitalization', '4'), ('Active gastroduodenal ulcer', '4.5')]
d = [[PH('No.'), PH('Risk factor (RF)'), PH('Points')]] + [[PC(str(i + 1)), P(a), PC(b)] for i, (a, b) in enumerate(rows)]
f.append(tbl(d, [12 * mm, CW - 32 * mm, 20 * mm], RED))
f += foot('* High risk of bleeding when the sum of points is > 7.')
# 9 Khorana
f += appendix(9, 'Assessment of the risk of PE/VTE in patients with oncological diseases receiving antitumor (drug and/or radiation) therapy (Khorana score)', GREEN)
d = [[PH('No.'), PH('Risk factor (RF)'), PH('Points')],
[PC('1'), P('Tumor localization (primary focus):'), PC('')],
[PC('1.1'), P('very high risk (pancreas, stomach)'), PC('2')],
[PC('1.2'), P('high risk (lung, lymphatic system, gynecological organs, urinary bladder, testes)'), PC('1')],
[PC('2'), P('Platelet count before antitumor therapy > 350 x 10\u2079/L'), PC('1')],
[PC('3'), P('Hemoglobin concentration < 100 g/L or use of erythropoietin'), PC('1')],
[PC('4'), P('Leukocyte count before antitumor therapy > 11 x 10\u2079/L'), PC('1')],
[PC('5'), P('Body mass index > 35 kg/m2'), PC('1')],
[PC('6'), P('Probability of developing VTE:'), PC('')],
[PC('6.1'), P('low risk'), PC('0')], [PC('6.2'), P('moderate risk'), PC('1-2')], [PC('6.3'), P('high risk'), PC('> 3 points')]]
ex = [('BACKGROUND', (0, 9), (-1, 9), colors.HexColor('#D5F5E3')), ('BACKGROUND', (0, 10), (-1, 10), colors.HexColor('#FCF3CF')), ('BACKGROUND', (0, 11), (-1, 11), colors.HexColor('#F5B7B1')),
('BACKGROUND', (0, 1), (-1, 1), colors.HexColor('#D4EFDF')), ('BACKGROUND', (0, 8), (-1, 8), colors.HexColor('#D4EFDF'))]
f.append(tbl(d, [12 * mm, CW - 37 * mm, 25 * mm], GREEN, ex, zebra=False))
# 10 Padua
f += appendix(10, 'Assessment of the risk of PE/VTE in patients with internal diseases (Padua score)*', BLUE)
rows = [('Oncological disease (patients with metastases in regional lymph nodes or with distant metastases who received antitumor (drug and/or radiation) therapy within the last 6 months)', '3'),
('PE, VTE in history (except thrombosis of superficial veins)', '3'),
('Immobilization (bed rest planned (with access to a bathroom/commode) because of reduced mobility of the patient or physician recommendations > 3 days)', '3'),
('Diagnosed thrombophilia (antithrombin deficiency, protein C or S deficiency, factor V Leiden, prothrombin gene G20210A mutation or antiphospholipid syndrome)', '3'),
('Trauma or surgical intervention (\u2264 1 month)', '2'), ('Age > 70 years', '2'), ('Heart or respiratory failure', '1'), ('Acute myocardial infarction or ischemic stroke', '1'),
('Acute infection or rheumatologic disease', '1'), ('Obesity (body mass index > 30 kg/m2)', '1'), ('Use of hormone replacement therapy or oral contraceptives', '1')]
d = [[PH('No.'), PH('Risk factor (RF)'), PH('Points')]] + [[PC(str(i + 1)), P(a), PC(b)] for i, (a, b) in enumerate(rows)]
f.append(tbl(d, [12 * mm, CW - 32 * mm, 20 * mm], BLUE))
f += foot('* High risk of PE/VTE when the sum of points is > 4.')
# 11 FC
f += appendix(11, 'Functional classification of pulmonary hypertension', PURPLE)
rows = [('I', 'No limitation of ordinary physical activity, which does not cause dyspnea, fatigue, chest pain or presyncope.', '#D5F5E3'),
('II', 'Slight limitation of physical activity. No discomfort at rest, but ordinary physical activity causes dyspnea, weakness, chest pain or presyncope.', '#FCF3CF'),
('III', 'Marked limitation of physical activity. No discomfort at rest, but less than ordinary physical activity causes dyspnea, fatigue, chest pain or presyncope.', '#FAD7A0'),
('IV', 'Dyspnea and/or fatigue at rest, increasing with practically minimal physical activity. Signs of right ventricular failure may be present.', '#F5B7B1')]
d = [[PH('No.'), PH('FC'), PH('Description')]] + [[PC(str(i + 1)), PC('**%s**' % a), P(b)] for i, (a, b, _) in enumerate(rows)]
ex = [('BACKGROUND', (0, i + 1), (-1, i + 1), colors.HexColor(r[2])) for i, r in enumerate(rows)]
f.append(tbl(d, [12 * mm, 16 * mm, CW - 28 * mm], PURPLE, ex, zebra=False))
# translator's note
f += [Spacer(1, 14)]
nt = Table([[Paragraph(fmt('**Translator\'s note.** This is an English translation of the Belarusian-language text of Resolution of the Ministry of Health of the Republic of Belarus of 28 April 2026 No. 43 (National Legal Internet Portal of the Republic of Belarus, 01.07.2026, 11-3/45011), prepared for information purposes. Abbreviations: PE - pulmonary embolism (TEЛА); VTE - venous thromboembolic complications; PA - pulmonary artery; RV/LV - right/left ventricle; UFH - unfractionated heparin; LMWH - low-molecular-weight heparin; OAC - oral anticoagulant; MP - medicinal product; RF - risk factor; aPTT - activated partial thromboplastin time; INR - international normalized ratio; GFR - glomerular filtration rate. Wording that appears inconsistent in the source (for example "1 5000 000 IU" of streptokinase, rendered here as 1,500,000 IU, and the body-weight thresholds for nadroparin in paragraph 29) is reproduced as printed. For clinical or legal use, rely on the official Russian-language text.'), S_NOTE)]], colWidths=[CW])
nt.setStyle(TableStyle([('BACKGROUND', (0, 0), (-1, -1), PALE), ('BOX', (0, 0), (-1, -1), 0.8, TEAL), ('LEFTPADDING', (0, 0), (-1, -1), 10), ('RIGHTPADDING', (0, 0), (-1, -1), 10), ('TOPPADDING', (0, 0), (-1, -1), 7), ('BOTTOMPADDING', (0, 0), (-1, -1), 7)]))
f.append(nt)
return f
def deco(canv, doc):
canv.saveState()
canv.setFillColor(NAVY); canv.rect(0, H - 11 * mm, W, 11 * mm, stroke=0, fill=1)
canv.setFillColor(GOLD); canv.rect(0, H - 12.2 * mm, W, 1.2 * mm, stroke=0, fill=1)
canv.setFillColor(colors.white); canv.setFont('DV-I', 7.6)
canv.drawCentredString(W / 2, H - 7.2 * mm, 'National Legal Internet Portal of the Republic of Belarus, 01.07.2026, 11-3/45011 | English translation')
canv.setFillColor(TEAL); canv.rect(LM, 11 * mm, CW, 0.6, stroke=0, fill=1)
canv.setFillColor(NAVY); canv.setFont('DV-B', 8)
canv.drawCentredString(W / 2, 7 * mm, str(doc.page))
canv.restoreState()
def main():
out = '/tmp/workspace/belarus-pe-protocol/output/Belarus_PE_Clinical_Protocol_English.pdf'
doc = BaseDocTemplate(out, pagesize=A4, leftMargin=LM, rightMargin=RM, topMargin=19 * mm, bottomMargin=16 * mm,
title='Clinical protocol: Diagnosis, treatment and medical prophylaxis of pulmonary embolism (adult population) - English translation',
author='Translation of Resolution of the Ministry of Health of the Republic of Belarus No. 43 of 28.04.2026')
fr = Frame(LM, 16 * mm, CW, H - 35 * mm, id='f', leftPadding=0, rightPadding=0, topPadding=0, bottomPadding=0)
doc.addPageTemplates([PageTemplate(id='p', frames=[fr], onPage=deco)])
flow = build_body() + appendices()
doc.build(flow)
print(out)
main()
cd /tmp/workspace/belarus-pe-protocol/src && python build.py 2>&1 | tail -15 && python - <<'EOF' import pdfplumber p='/tmp/workspace/belarus-pe-protocol/output/Belarus_PE_Clinical_Protocol_English.pdf' with pdfplumber.open(p) as pdf: print(len(pdf.pages)) for n in (1,2,len(pdf.pages)-3): pdf.pages[n-1 if n>0 else 0].to_image(resolution=70).save(f'/tmp/workspace/belarus-pe-protocol/src/o{n}.png') EOF
cd /tmp/workspace/belarus-pe-protocol/src && sed -i 's/ (TEЛА)//; s/wd = \[8 \* mm, 17 \* mm\] + \[(CW - 25 \* mm) \/ 6\] \* 6/wd = [10 * mm, 16 * mm] + [(CW - 26 * mm) \/ 6] * 6/' build.py && python build.py && python - <<'EOF' import pdfplumber p='/tmp/workspace/belarus-pe-protocol/output/Belarus_PE_Clinical_Protocol_English.pdf' with pdfplumber.open(p) as pdf: print(len(pdf.pages)) pdf.pages[6].to_image(resolution=70).save('/tmp/workspace/belarus-pe-protocol/src/o7.png') EOF
Belarus PE Clinical Protocol English
PDF Document · PDF