Translate this medical report of computed topography into english language as this report is in Russian language
Make this report in pdf form so that I can print this out for doctor's reference
mkdir -p /home/daytona/workspace/ct-report && ls /home/daytona/workspace/ct-repo…
~/ct-report/generate_report.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, HRFlowable, Table, TableStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
output_path = "/home/daytona/workspace/ct-report/CT_Report_Khakve_Amanul.pdf"
doc = SimpleDocTemplate(
output_path,
pagesize=A4,
rightMargin=2.5*cm,
leftMargin=2.5*cm,
topMargin=2.5*cm,
bottomMargin=2.5*cm
)
styles = getSampleStyleSheet()
# Custom styles
title_style = ParagraphStyle(
'Title',
parent=styles['Heading1'],
fontSize=14,
alignment=TA_CENTER,
spaceAfter=6,
fontName='Helvetica-Bold',
textColor=colors.black
)
header_style = ParagraphStyle(
'Header',
parent=styles['Normal'],
fontSize=10,
alignment=TA_LEFT,
spaceAfter=2,
fontName='Helvetica',
textColor=colors.black
)
body_style = ParagraphStyle(
'Body',
parent=styles['Normal'],
fontSize=10,
alignment=TA_JUSTIFY,
spaceAfter=6,
fontName='Helvetica',
leading=16,
textColor=colors.black
)
bold_body_style = ParagraphStyle(
'BoldBody',
parent=styles['Normal'],
fontSize=10,
alignment=TA_JUSTIFY,
spaceAfter=6,
fontName='Helvetica-Bold',
leading=16,
textColor=colors.black
)
conclusion_style = ParagraphStyle(
'Conclusion',
parent=styles['Normal'],
fontSize=11,
alignment=TA_LEFT,
spaceAfter=6,
fontName='Helvetica-Bold',
leading=16,
textColor=colors.black
)
small_style = ParagraphStyle(
'Small',
parent=styles['Normal'],
fontSize=9,
alignment=TA_LEFT,
spaceAfter=3,
fontName='Helvetica',
textColor=colors.grey
)
label_style = ParagraphStyle(
'Label',
parent=styles['Normal'],
fontSize=9,
alignment=TA_LEFT,
spaceAfter=2,
fontName='Helvetica-Oblique',
textColor=colors.grey
)
story = []
# Patient header info
story.append(Paragraph("Khakve A. Card No. 10145", header_style))
story.append(Paragraph("02.07.2026 11:17:14", header_style))
story.append(Spacer(1, 0.3*cm))
# Title
story.append(HRFlowable(width="100%", thickness=1.5, color=colors.black))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("CT EXAMINATION REPORT", title_style))
story.append(Paragraph("(Computed Tomography — English Translation)", ParagraphStyle(
'Subtitle', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER,
fontName='Helvetica-Oblique', textColor=colors.grey, spaceAfter=4
)))
story.append(Spacer(1, 0.2*cm))
story.append(HRFlowable(width="100%", thickness=1.5, color=colors.black))
story.append(Spacer(1, 0.4*cm))
# Patient info table
patient_data = [
[Paragraph("<b>Patient:</b>", body_style), Paragraph("Khakve Amanul", body_style)],
[Paragraph("<b>Age:</b>", body_style), Paragraph("24 years", body_style)],
[Paragraph("<b>Referred from:</b>", body_style), Paragraph("Emergency Department", body_style)],
[Paragraph("<b>Examination:</b>", body_style), Paragraph("Multislice CT (MSCT) of the brain, performed according to standard protocol, <b>without intravenous contrast enhancement</b>", body_style)],
]
patient_table = Table(patient_data, colWidths=[4*cm, 12*cm])
patient_table.setStyle(TableStyle([
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('BACKGROUND', (0, 0), (-1, -1), colors.white),
('GRID', (0, 0), (-1, -1), 0, colors.white),
('ROWBACKGROUNDS', (0, 0), (-1, -1), [colors.HexColor('#F5F5F5'), colors.white]),
('LEFTPADDING', (0, 0), (-1, -1), 4),
('RIGHTPADDING', (0, 0), (-1, -1), 4),
('TOPPADDING', (0, 0), (-1, -1), 3),
('BOTTOMPADDING', (0, 0), (-1, -1), 3),
]))
story.append(patient_table)
story.append(Spacer(1, 0.5*cm))
# Section divider
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
story.append(Spacer(1, 0.3*cm))
# Findings heading
story.append(Paragraph("FINDINGS", ParagraphStyle(
'FindingsHead', parent=styles['Normal'], fontSize=10,
fontName='Helvetica-Bold', textColor=colors.HexColor('#333333'),
spaceAfter=8
)))
# Findings
findings = [
"The midline structures are <b>not displaced</b>. The subarachnoid spaces and convexital sulci are <b>not widened</b>.",
"The lateral ventricles are <b>symmetrical and not enlarged</b>. The third ventricle is <b>not enlarged</b>. The fourth ventricle is <b>not enlarged and not deformed</b>.",
"The choroid plexuses of the ventricles are <b>symmetrical</b>.",
"The pineal gland is of <b>normal structure and size</b>.",
"The Sylvian fissures are <b>symmetrical and not widened</b>. The basal cisterns are well-differentiated, clearly defined, and symmetrical. The ambient cistern is symmetrical and patent.",
"The great occipital (cisterna magna) cistern is <b>patent</b>.",
"<b>No pathological masses or focal changes</b> in the brain are identified.",
"<b>No pathological changes</b> of the bones of the cranial vault or skull base are identified.",
]
for finding in findings:
story.append(Paragraph(f"• {finding}", body_style))
story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="100%", thickness=1, color=colors.black))
story.append(Spacer(1, 0.3*cm))
# Conclusion
story.append(Paragraph("CONCLUSION", ParagraphStyle(
'ConcHead', parent=styles['Normal'], fontSize=11,
fontName='Helvetica-Bold', textColor=colors.black, spaceAfter=4
)))
story.append(Paragraph(
"MSCT — <b>No signs of acute focal cerebral pathology detected.</b>",
conclusion_style
))
story.append(Spacer(1, 0.8*cm))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
story.append(Spacer(1, 0.4*cm))
# Signature section
sig_data = [
[
Paragraph("<i>Radiologist</i>", label_style),
Paragraph("<b>Chomaev Eldar Khamitovich</b><br/><i>(Radiology)</i>", body_style)
],
]
sig_table = Table(sig_data, colWidths=[4*cm, 12*cm])
sig_table.setStyle(TableStyle([
('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
('GRID', (0, 0), (-1, -1), 0, colors.white),
('LEFTPADDING', (0, 0), (-1, -1), 4),
]))
story.append(sig_table)
story.append(Spacer(1, 0.2*cm))
# Digital signature note
story.append(Paragraph(
"<i>Document signed with electronic digital signature. Certificate: 05793c2648a1cb434883258073e9b016<br/>"
"Valid: 07.05.2025 — 31.07.2026</i>",
small_style
))
story.append(Spacer(1, 0.8*cm))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
# Footer note
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"<i>This document is an English translation of the original Russian-language CT examination report "
"issued on 02.07.2026. For clinical reference only.</i>",
ParagraphStyle('Footer', parent=styles['Normal'], fontSize=8,
fontName='Helvetica-Oblique', textColor=colors.grey,
alignment=TA_CENTER)
))
doc.build(story)
print(f"PDF created: {output_path}")
python /home/daytona/workspace/ct-report/generate_report.py
CT Report Khakve Amanul
PDF Document · PDF
Translate this priscription also from Russian language to English language and make a pdf out of this
~/ct-report/generate_neuro.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, HRFlowable, Table, TableStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
output_path = "/home/daytona/workspace/ct-report/Neurology_Consultation_Khakve_Amanul.pdf"
doc = SimpleDocTemplate(
output_path,
pagesize=A4,
rightMargin=2.2*cm,
leftMargin=2.2*cm,
topMargin=2.0*cm,
bottomMargin=2.0*cm
)
styles = getSampleStyleSheet()
center_bold = ParagraphStyle('CenterBold', parent=styles['Normal'], fontSize=10,
alignment=TA_CENTER, fontName='Helvetica-Bold', spaceAfter=2, textColor=colors.black)
center_normal = ParagraphStyle('CenterNormal', parent=styles['Normal'], fontSize=9,
alignment=TA_CENTER, fontName='Helvetica', spaceAfter=2, textColor=colors.black)
section_title = ParagraphStyle('SecTitle', parent=styles['Normal'], fontSize=11,
alignment=TA_CENTER, fontName='Helvetica-Bold', spaceAfter=6, spaceBefore=4, textColor=colors.black)
label = ParagraphStyle('Label', parent=styles['Normal'], fontSize=10,
alignment=TA_LEFT, fontName='Helvetica-Bold', spaceAfter=1, textColor=colors.black)
body = ParagraphStyle('Body', parent=styles['Normal'], fontSize=10,
alignment=TA_JUSTIFY, fontName='Helvetica', spaceAfter=5, leading=15, textColor=colors.black)
body_bold = ParagraphStyle('BodyBold', parent=styles['Normal'], fontSize=10,
alignment=TA_JUSTIFY, fontName='Helvetica-Bold', spaceAfter=5, leading=15, textColor=colors.black)
small_italic = ParagraphStyle('SmallItalic', parent=styles['Normal'], fontSize=8,
alignment=TA_CENTER, fontName='Helvetica-Oblique', spaceAfter=2, textColor=colors.grey)
rx_style = ParagraphStyle('Rx', parent=styles['Normal'], fontSize=10,
alignment=TA_LEFT, fontName='Helvetica', spaceAfter=4, leading=15,
leftIndent=10, textColor=colors.black)
story = []
# --- Hospital Header ---
story.append(Paragraph("RGBLPU «Karachay-Cherkess Republican Clinical Hospital»", center_bold))
story.append(Paragraph("369000 Karachay-Cherkess Republic,", center_normal))
story.append(Paragraph("Cherkessk, 1 Gvardeyskaya St.", center_normal))
story.append(Paragraph("Tel/Fax: 8(8782)20-44-43 | Email: kchrb@yandex.ru", center_normal))
story.append(Spacer(1, 0.3*cm))
story.append(HRFlowable(width="100%", thickness=1.5, color=colors.black))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("NEUROLOGY CONSULTATION", section_title))
story.append(HRFlowable(width="100%", thickness=1.5, color=colors.black))
story.append(Spacer(1, 0.35*cm))
# --- Patient Info Table ---
info_data = [
[Paragraph("<b>Date / Time:</b>", body), Paragraph("02 July 2026, 11:28:44", body)],
[Paragraph("<b>Patient Name:</b>", body), Paragraph("Khakve Amanul", body)],
[Paragraph("<b>Date of Birth:</b>", body), Paragraph("18.02.2002", body)],
[Paragraph("<b>Address:</b>", body), Paragraph("Karachay-Cherkess Rep., Cherkessk, 22 Stavropolskaya St.", body)],
[Paragraph("<b>Complaints:</b>", body), Paragraph("Paroxysmal (episodic) pain in the area innervated by the occipital nerve.", body)],
[Paragraph("<b>History:</b>", body), Paragraph("Symptoms present for approximately 3 days, against a background of relative well-being.", body)],
[Paragraph("<b>General Condition:</b>", body), Paragraph("Satisfactory", body)],
]
info_table = Table(info_data, colWidths=[4.2*cm, 12.2*cm])
info_table.setStyle(TableStyle([
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('ROWBACKGROUNDS', (0, 0), (-1, -1), [colors.HexColor('#F5F5F5'), colors.white]),
('LEFTPADDING', (0, 0), (-1, -1), 5),
('RIGHTPADDING', (0, 0), (-1, -1), 5),
('TOPPADDING', (0, 0), (-1, -1), 3),
('BOTTOMPADDING', (0, 0), (-1, -1), 3),
('GRID', (0, 0), (-1, -1), 0, colors.white),
]))
story.append(info_table)
story.append(Spacer(1, 0.4*cm))
# --- Neurological Status ---
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
story.append(Spacer(1, 0.25*cm))
story.append(Paragraph("NEUROLOGICAL STATUS", ParagraphStyle('NSHead', parent=styles['Normal'],
fontSize=10, fontName='Helvetica-Bold', textColor=colors.HexColor('#222222'), spaceAfter=6)))
neuro_items = [
("Consciousness:", "Clear"),
("Hyperhidrosis:", "None"),
("Skull percussion:", "Non-tender"),
("Cranial Nerves (CN):", ""),
("I - Olfaction:", "Normal"),
("II - Vision:", "Preserved"),
("III, IV, VI - Eye movements:", "Full range of motion; Pupils D=S; Photoreaction brisk"),
("V - Corneal reflexes:", "Preserved; Facial sensation intact"),
("VII - Face:", "Symmetrical; Palpebral fissures D=S"),
("VIII - Hearing:", "Normal"),
("IX - Soft palate:", "No paresis; Gag reflex preserved"),
("X - Swallowing:", "Preserved"),
("XI - Head position:", "Normal"),
("XII - Tongue deviation:", "None"),
("Speech:", "No disturbances"),
("Deep tendon reflexes (DTR):", "Arms D=S active; Legs D=S active"),
("Hemiparesis:", "None"),
("Romberg stance:", "Stable"),
("Coordination tests:", "Performed correctly"),
("Pathological foot reflexes:", "Negative"),
("Meningeal signs:", "Negative"),
("Sensation:", "Preserved"),
("MSCT brain:", "No data for acute pathology identified"),
]
neuro_data = [[Paragraph(f"<b>{k}</b>", body), Paragraph(v, body)] for k, v in neuro_items if v]
neuro_data_full = []
for k, v in neuro_items:
if k == "Cranial Nerves (CN):":
neuro_data_full.append([Paragraph(f"<b>{k}</b>", body), Paragraph("(see below)", body)])
else:
neuro_data_full.append([Paragraph(f"<b>{k}</b>", body), Paragraph(v, body)])
neuro_table = Table(neuro_data_full, colWidths=[5.0*cm, 11.4*cm])
neuro_table.setStyle(TableStyle([
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('ROWBACKGROUNDS', (0, 0), (-1, -1), [colors.white, colors.HexColor('#FAFAFA')]),
('LEFTPADDING', (0, 0), (-1, -1), 5),
('RIGHTPADDING', (0, 0), (-1, -1), 5),
('TOPPADDING', (0, 0), (-1, -1), 2),
('BOTTOMPADDING', (0, 0), (-1, -1), 2),
('GRID', (0, 0), (-1, -1), 0.3, colors.HexColor('#DDDDDD')),
]))
story.append(neuro_table)
story.append(Spacer(1, 0.4*cm))
# --- Diagnosis ---
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
story.append(Spacer(1, 0.25*cm))
story.append(Paragraph("DIAGNOSIS", ParagraphStyle('DxHead', parent=styles['Normal'],
fontSize=10, fontName='Helvetica-Bold', textColor=colors.HexColor('#222222'), spaceAfter=5)))
story.append(Paragraph(
"<b>Primary:</b> Based on objective neurological examination at the time of consultation, "
"<b>no acute neurological pathology is identified.</b> Hospitalization is not required. "
"<b>Diagnosis: Occipital Neuralgia.</b>",
body
))
story.append(Spacer(1, 0.3*cm))
# --- Recommendations ---
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
story.append(Spacer(1, 0.25*cm))
story.append(Paragraph("RECOMMENDATIONS", ParagraphStyle('RxHead', parent=styles['Normal'],
fontSize=10, fontName='Helvetica-Bold', textColor=colors.HexColor('#222222'), spaceAfter=5)))
story.append(Paragraph(
"Follow-up and ongoing treatment with a neurologist at place of residence.",
body
))
story.append(Spacer(1, 0.1*cm))
# Prescription table
rx_items = [
("1.", "Tramadol", "2 ml IM", "Single dose (once only)"),
("2.", "Lornoxicam", "8 mg — 2 ml IM", "5 days"),
("3.", "Mydocalm (Tolperisone)", "1 ml IM", "10 days"),
("4.", "Milgamma (B-vitamins)", "2 ml IM", "10 days"),
("5.", "Carbamazepine tablets", "200 mg — ½ tablet at night", "5 days; then if well tolerated: ½ tablet × 2 times/day for 2 months"),
]
rx_header = [
Paragraph("<b>#</b>", body),
Paragraph("<b>Medication</b>", body),
Paragraph("<b>Dose / Route</b>", body),
Paragraph("<b>Duration / Notes</b>", body),
]
rx_rows = [rx_header]
for num, drug, dose, dur in rx_items:
rx_rows.append([
Paragraph(num, body),
Paragraph(f"<b>{drug}</b>", body),
Paragraph(dose, body),
Paragraph(dur, body),
])
rx_table = Table(rx_rows, colWidths=[0.7*cm, 4.5*cm, 4.0*cm, 7.2*cm])
rx_table.setStyle(TableStyle([
('BACKGROUND', (0, 0), (-1, 0), colors.HexColor('#EEEEEE')),
('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('ROWBACKGROUNDS', (0, 1), (-1, -1), [colors.white, colors.HexColor('#FAFAFA')]),
('LEFTPADDING', (0, 0), (-1, -1), 5),
('RIGHTPADDING', (0, 0), (-1, -1), 5),
('TOPPADDING', (0, 0), (-1, -1), 3),
('BOTTOMPADDING', (0, 0), (-1, -1), 3),
('GRID', (0, 0), (-1, -1), 0.5, colors.HexColor('#CCCCCC')),
]))
story.append(rx_table)
story.append(Spacer(1, 0.6*cm))
# --- Signature ---
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
story.append(Spacer(1, 0.3*cm))
sig_data = [
[Paragraph("<i>Attending Physician:</i>", ParagraphStyle('SigL', parent=styles['Normal'],
fontSize=9, fontName='Helvetica-Oblique', textColor=colors.grey)),
Paragraph("<b>Balkarova Zalina Nabievna</b><br/><i>(24-hour inpatient department)</i>",
body)]
]
sig_table = Table(sig_data, colWidths=[4.2*cm, 12.2*cm])
sig_table.setStyle(TableStyle([
('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
('LEFTPADDING', (0, 0), (-1, -1), 5),
]))
story.append(sig_table)
story.append(Spacer(1, 0.6*cm))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.lightgrey))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"<i>This document is an English translation of the original Russian-language Neurology Consultation report "
"issued on 02.07.2026. For clinical reference only.</i>",
ParagraphStyle('Footer', parent=styles['Normal'], fontSize=8,
fontName='Helvetica-Oblique', textColor=colors.grey, alignment=TA_CENTER)
))
doc.build(story)
print(f"PDF created: {output_path}")
python /home/daytona/workspace/ct-report/generate_neuro.py
Neurology Consultation Khakve Amanul
PDF Document · PDF
| # | Drug | Dose | Duration |
|---|---|---|---|
| 1 | Tramadol | 2 ml IM | Single dose |
| 2 | Lornoxicam | 8 mg / 2 ml IM | 5 days |
| 3 | Mydocalm (Tolperisone) | 1 ml IM | 10 days |
| 4 | Milgamma (B-vitamins) | 2 ml IM | 10 days |
| 5 | Carbamazepine tabs | 200 mg - ½ tab at night | 5 days, then ½ tab × 2/day for 2 months if tolerated |