attachment
attachment

Create this proforma pn janu sandhigata vata

analyse_media
Reading File
Running Command

mkdir -p /tmp/workspace/sandhigata-vata && ls /tmp/workspace/sandhigata-vata/

Writing File

~/sandhigata-vata/create_proforma.py

from docx import Document
from docx.shared import Pt, Inches, RGBColor, Cm
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_TABLE_ALIGNMENT, WD_ALIGN_VERTICAL
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
import copy

doc = Document()

# ── Page margins ──────────────────────────────────────────────────────────────
section = doc.sections[0]
section.page_width  = Inches(8.27)   # A4
section.page_height = Inches(11.69)
section.left_margin   = Inches(1.0)
section.right_margin  = Inches(1.0)
section.top_margin    = Inches(0.8)
section.bottom_margin = Inches(0.8)

# ── Default Normal style ───────────────────────────────────────────────────────
normal = doc.styles["Normal"]
normal.font.name = "Times New Roman"
normal.font.size = Pt(11)

def set_font(run, bold=False, size=11, name="Times New Roman"):
    run.bold = bold
    run.font.size = Pt(size)
    run.font.name = name

def add_centered(doc, text, bold=True, size=12):
    p = doc.add_paragraph()
    p.alignment = WD_ALIGN_PARAGRAPH.CENTER
    run = p.add_run(text)
    set_font(run, bold=bold, size=size)
    p.paragraph_format.space_before = Pt(0)
    p.paragraph_format.space_after  = Pt(0)
    return p

def add_label_value(doc, label, value="", bold_label=True, size=11):
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(2)
    p.paragraph_format.space_after  = Pt(2)
    r1 = p.add_run(label)
    set_font(r1, bold=bold_label, size=size)
    r2 = p.add_run(value)
    set_font(r2, bold=False, size=size)
    return p

def set_cell_border(cell, top=None, bottom=None, left=None, right=None):
    tc = cell._tc
    tcPr = tc.get_or_add_tcPr()
    tcBorders = OxmlElement('w:tcBorders')
    for side, val in [('top', top), ('bottom', bottom), ('left', left), ('right', right)]:
        if val is not None:
            el = OxmlElement(f'w:{side}')
            el.set(qn('w:val'), val)
            el.set(qn('w:sz'), '4')
            el.set(qn('w:space'), '0')
            el.set(qn('w:color'), '000000')
            tcBorders.append(el)
    tcPr.append(tcBorders)

def set_table_border(table):
    tbl = table._tbl
    tblPr = tbl.find(qn('w:tblPr'))
    if tblPr is None:
        tblPr = OxmlElement('w:tblPr')
        tbl.insert(0, tblPr)
    tblBorders = OxmlElement('w:tblBorders')
    for side in ['top', 'left', 'bottom', 'right', 'insideH', 'insideV']:
        el = OxmlElement(f'w:{side}')
        el.set(qn('w:val'), 'single')
        el.set(qn('w:sz'), '4')
        el.set(qn('w:space'), '0')
        el.set(qn('w:color'), '000000')
        tblBorders.append(el)
    tblPr.append(tblBorders)

def cell_text(cell, text, bold=False, size=11, align=WD_ALIGN_PARAGRAPH.LEFT):
    cell.text = ""
    p = cell.paragraphs[0]
    p.alignment = align
    p.paragraph_format.space_before = Pt(1)
    p.paragraph_format.space_after  = Pt(1)
    run = p.add_run(text)
    set_font(run, bold=bold, size=size)

def add_section_heading(doc, text):
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(8)
    p.paragraph_format.space_after  = Pt(2)
    run = p.add_run(text)
    set_font(run, bold=True, size=11)
    return p

def add_indented(doc, label, value="", indent=0.3):
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(2)
    p.paragraph_format.space_after  = Pt(2)
    p.paragraph_format.left_indent  = Inches(indent)
    r1 = p.add_run(label)
    set_font(r1, bold=False, size=11)
    r2 = p.add_run(value)
    set_font(r2, bold=False, size=11)
    return p

# ══════════════════════════════════════════════════════════════════════════════
# HEADER
# ══════════════════════════════════════════════════════════════════════════════
add_centered(doc, "PRACTICAL No.5", bold=True, size=13)
add_centered(doc, "ASSESSMENT OF DISEASES BASED ON TRIVIDHA BODHYASANGRAHA", bold=True, size=13)
add_centered(doc, "(Minimum three cases)", bold=False, size=10)

doc.add_paragraph().paragraph_format.space_after = Pt(4)

# ══════════════════════════════════════════════════════════════════════════════
# PATIENT INFO TABLE
# ══════════════════════════════════════════════════════════════════════════════
tbl = doc.add_table(rows=7, cols=4)
tbl.alignment = WD_TABLE_ALIGNMENT.CENTER
tbl.style = "Table Grid"
set_table_border(tbl)

col_widths = [Inches(0.9), Inches(2.4), Inches(1.5), Inches(2.0)]
for row in tbl.rows:
    for i, cell in enumerate(row.cells):
        cell.width = col_widths[i]

# Row 0: No. | Date | Resident | Rural/Urban
cell_text(tbl.cell(0,0), "No.", bold=True)
cell_text(tbl.cell(0,1), "")
cell_text(tbl.cell(0,2), "Resident:", bold=True)
cell_text(tbl.cell(0,3), "Rural / Urban")

# Row 1: Name | XYZ | So.Eco.Status | Lower/Middle/Upper
cell_text(tbl.cell(1,0), "Name:", bold=True)
cell_text(tbl.cell(1,1), "XYZ")
cell_text(tbl.cell(1,2), "So. Eco. Status:", bold=True)
cell_text(tbl.cell(1,3), "Lower / Middle / Upper")

# Row 2: Address | | Education | I/P/S/HS/G/PG
cell_text(tbl.cell(2,0), "Address:", bold=True)
cell_text(tbl.cell(2,1), "")
cell_text(tbl.cell(2,2), "Education:", bold=True)
cell_text(tbl.cell(2,3), "I / P / S / HS / G / PG")

# Row 3: (address cont) | | Occupation |
cell_text(tbl.cell(3,0), "")
cell_text(tbl.cell(3,1), "")
cell_text(tbl.cell(3,2), "Occupation:", bold=True)
cell_text(tbl.cell(3,3), "")

# Row 4: Age | | OPD no. |
cell_text(tbl.cell(4,0), "Age:", bold=True)
cell_text(tbl.cell(4,1), "")
cell_text(tbl.cell(4,2), "OPD no.", bold=True)
cell_text(tbl.cell(4,3), "")

# Row 5: Gender | | IPD no. |
cell_text(tbl.cell(5,0), "Gender:", bold=True)
cell_text(tbl.cell(5,1), "")
cell_text(tbl.cell(5,2), "IPD no.", bold=True)
cell_text(tbl.cell(5,3), "")

# Row 6: Mo. No. | | K/C/O |
cell_text(tbl.cell(6,0), "Mo. No.", bold=True)
cell_text(tbl.cell(6,1), "")
cell_text(tbl.cell(6,2), "K/C/O", bold=True)
cell_text(tbl.cell(6,3), "Sandhigata Vata")

doc.add_paragraph().paragraph_format.space_after = Pt(4)

# ══════════════════════════════════════════════════════════════════════════════
# VIKARAPRAKRUTI
# ══════════════════════════════════════════════════════════════════════════════
add_section_heading(doc, "VIKARAPRAKRUTI")

add_indented(doc, "Poorvarupa:  ",
    "Sandhi shoola (joint pain), sandhi stabdhata (stiffness), crackling sound in joints on movement, mild swelling around joints; symptoms worsen in cold/dry weather and early morning.")

doc.add_paragraph().paragraph_format.space_after = Pt(2)

add_indented(doc, "Rupa:  ",
    "Sandhi shoola (pain in joints), sandhi shopha (swelling of joints), vatapurna druti sparsha (feels like a bag filled with air on palpation), sandhi stabdhata (stiffness), atopa (crepitus/cracking sound), hanti sandhigatan (destruction of joint structure), Kharva / Vikuja (deformity in chronic cases), difficulty in flexion and extension of affected joints.")

doc.add_paragraph().paragraph_format.space_after = Pt(2)

add_indented(doc, "Samprapti:  ",
    "Nidana sevana (consumption of causative factors such as Vata-prakopaka ahara-vihara) → Vata prakopa → Vata enters Sandhis (joints) via Asthi-majja vaha srotas → Srotorodha at Sandhi level → Shoola, Shopha, Stabdhata, Atopa → Kshaya of Sandhi components (Sleshaka Kapha, Asthi, Majja) → Sandhigata Vata.\n\nSamprapti Ghataka:\n  Dosha: Vata (predominant), Kapha kshaya\n  Dushya: Asthi, Majja, Sleshaka Kapha\n  Srotas: Asthi-majja vaha srotas\n  Adhisthana: Sandhi (joints)\n  Vyakta sthana: Sandhi (knee joint most commonly)")

doc.add_paragraph().paragraph_format.space_after = Pt(2)

add_indented(doc, "Upasaya / Anupasaya:  ",
    "Upasaya: Snigdha ahara (oily/unctuous food), Ushna ahara (warm food), Tila taila abhyanga (sesame oil massage), Swedana (sudation/fomentation), Basti karma, rest, gentle movement.\n"
    "Anupasaya: Ruksha ahara (dry food), Laghu ahara (light food), Ati vyayama (excessive exercise), cold exposure, excessive fasting, night-awakening.")

doc.add_paragraph().paragraph_format.space_after = Pt(4)

# ══════════════════════════════════════════════════════════════════════════════
# ADHISTHANA
# ══════════════════════════════════════════════════════════════════════════════
add_section_heading(doc, "ADHISTHANA")

add_indented(doc, "Roga-adhisthana (site of disease):  ", "Sandhi (Joints) – predominantly Janu sandhi (knee), also Kati sandhi (hip), Kaphoni (elbow), Manibandha (wrist)")
add_indented(doc, "Rogamarga:  ", "Madhyama rogamarga (middle pathway – affecting muscles, vessels, joints and bones)")
add_indented(doc, "Dosha involved:  ", "Vata (primarily – Vyana Vata and Apana Vata); Kapha kshaya (Sleshaka Kapha depletion)")
add_indented(doc, "Dhatu / Upadhatu / Mala involved:  ", "Dhatu: Asthi, Majja; Upadhatu: Snayu (ligaments), Kandara (tendons); Mala: Purisha (constipation may be present)")
add_indented(doc, "Srotas involved:  ", "Asthi-majja vaha srotas; Sleshmadhara kala at sandhi")
add_indented(doc, "Type of srotodushti:  ", "Sanga (obstruction/stagnation) and Kshaya (depletion/atrophy)")

doc.add_paragraph().paragraph_format.space_after = Pt(4)

# ══════════════════════════════════════════════════════════════════════════════
# SAMUTHANA
# ══════════════════════════════════════════════════════════════════════════════
add_section_heading(doc, "SAMUTHANA (Causative factors)")

add_indented(doc, "Ahara:  ",
    "Vata prakopaka ahara – Ruksha (dry), Laghu (light), Sheeta (cold), Katu (pungent), Tikta (bitter), Kashaya (astringent) rasa pradhana ahara; excessive intake of dry/stale food, low-fat diet, skipping meals, excessive raw vegetables, pulses (chanaka, masura), popcorn, cold beverages.")

doc.add_paragraph().paragraph_format.space_after = Pt(2)

add_indented(doc, "Vihara:  ",
    "Ati vyayama (excessive physical exertion), Ati prajagarana (excessive night-awakening), Vegadharana (suppression of natural urges), Ati maithuna, prolonged standing/walking, exposure to cold and wind (sheeta-vata sevana), sedentary lifestyle (Ati asana), trauma/injury to joint.")

doc.add_paragraph().paragraph_format.space_after = Pt(2)

add_indented(doc, "Agantu:  ",
    "External trauma (Abhighata) to joints, fractures, surgical procedures affecting joint integrity, old age (Vriddhavastha) causing natural Dhatu kshaya.")

doc.add_paragraph().paragraph_format.space_after = Pt(2)

add_indented(doc, "Manasa:  ",
    "Chinta (anxiety), Shoka (grief), Bhaya (fear) – these cause Vata prakopa through Rajas-dominated mental disturbances.")

doc.add_paragraph().paragraph_format.space_after = Pt(4)

# ══════════════════════════════════════════════════════════════════════════════
# INTERPRETATION BASED ON TREATMENT
# ══════════════════════════════════════════════════════════════════════════════
add_section_heading(doc, "Interpretation based on treatment adopted:")

doc.add_paragraph().paragraph_format.space_after = Pt(2)

interp_lines = [
    ("Principle of treatment: ", "Vata shamana and Brimhana (nourishment/strengthening). Since Sandhigata Vata involves both Vata prakopa and Dhatu kshaya, both Shodhana (purification) and Shamana (palliative) treatments are employed."),
    ("Bahya chikitsa (External): ", "Abhyanga (oleation massage) with Mahanarayana taila / Tila taila; Swedana (sudation) – Nadi sweda, Bashpa sweda; Janu Basti (pooling warm medicated oil over knee joint) for local nutrition and Vata shamana; Pinda sweda (Shashtika shali pinda sweda) to nourish and reduce stiffness."),
    ("Shodhana chikitsa: ", "Snehapana (internal oleation) followed by Virechana (therapeutic purgation) for Vata-Pitta involvement; Basti karma (enema) – considered the best treatment for Vata vyadhi:\n     a) Anuvasana basti: Mahanarayana taila basti\n     b) Niruha/Asthapana basti: Dashamula kashaya basti"),
    ("Shamana aushadha (Oral medications): ", "Yogaraja guggulu / Mahayogaraja guggulu (Vatahara + asthi-dhatu poshaka); Rasna saptaka kashaya (reduces pain and inflammation); Guggulutiktaka ghrita (for asthi-dhatu kshaya); Ashwagandha churna / Bala taila (for Vata shamana and strengthening); Shallaki (Boswellia serrata) – anti-inflammatory."),
    ("Pathya (Wholesome diet & regimen): ", "Warm, unctuous food; milk with Ashwagandha; green gram soup (mudga yusha); sesame seeds; garlic; Castor oil with milk at bedtime (for Vata); warm water intake; regular gentle yoga/exercise."),
    ("Apathya (Unwholesome): ", "Cold/dry/stale food, excessive fasting, cold water bath, prolonged standing, heavy exertion, suppression of natural urges."),
    ("Correlation with modern medicine: ", "Sandhigata Vata closely correlates with Osteoarthritis (OA) – a degenerative joint disease characterized by cartilage loss, joint space narrowing, osteophyte formation, and synovial changes. Both share features of age-related degeneration, involvement of weight-bearing joints, morning stiffness, crepitus, and progressive loss of joint function."),
]

for label, value in interp_lines:
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(3)
    p.paragraph_format.space_after  = Pt(3)
    p.paragraph_format.left_indent  = Inches(0.3)
    r1 = p.add_run(label)
    set_font(r1, bold=True, size=11)
    r2 = p.add_run(value)
    set_font(r2, bold=False, size=11)

# ── Save ──────────────────────────────────────────────────────────────────────
out = "/tmp/workspace/sandhigata-vata/Practical5_Sandhigata_Vata.docx"
doc.save(out)
print(f"Saved: {out}")
Running Command

cd /tmp/workspace/sandhigata-vata && python3 create_proforma.py

The document has been created. Here is your download link:

Practical5 Sandhigata Vata

Word Document · DOCX


The Word document follows the exact layout from your image and is fully filled in for Sandhigata Vata. Here is a summary of what was included in each section:
Patient Info Table - All fields (No., Date, Name, Address, Age, Gender, Mo. No., Resident, So. Eco. Status, Education, Occupation, OPD no., IPD no., K/C/O: Sandhigata Vata)
VIKARAPRAKRUTI
  • Poorvarupa - Sandhi shoola, stabdhata, crackling sounds, mild swelling; aggravation in cold/dry weather
  • Rupa - All classical features: shoola, shopha, vatapurna druti sparsha, atopa (crepitus), stabdhata, hanti sandhigatan, kharva/deformity
  • Samprapti - Full pathogenesis chain + Samprapti Ghataka (Dosha, Dushya, Srotas, Adhisthana, Vyakta sthana)
  • Upasaya/Anupasaya - Snigdha/ushna/abhyanga as upasaya; ruksha/sheeta/ati vyayama as anupasaya
ADHISTHANA
  • Site: Sandhi (Janu, Kati, Kaphoni); Madhyama rogamarga; Vyana/Apana Vata + Sleshaka Kapha kshaya; Asthi-majja vaha srotas; Sanga + Kshaya type srotodushti
SAMUTHANA
  • Ahara, Vihara, Agantu (trauma, old age), Manasa (Chinta, Shoka, Bhaya)
Interpretation based on treatment
  • Bahya chikitsa (Abhyanga, Janu Basti, Shashtika shali pinda sweda)
  • Shodhana (Virechana, Anuvasana + Niruha Basti)
  • Shamana aushadha (Yogaraja guggulu, Rasna saptaka, Ashwagandha, Shallaki)
  • Pathya/Apathya
  • Modern correlation: Osteoarthritis (OA)
This is a shared conversation. Sign in to Orris to start your own chat.