NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN

def create_presentation():
prs = Presentation()

# Define the headers
headers = ['Sl. No', 'Details', 'Date of birth', 'Date Of Admission', 'Date of Death', 'Diagnosis', 'Remarks']

# Define the data structure
# Each entry is (Slide Title, List of Rows)
data_pages = [
(
"Mortality Month of April 2025",
[
["1", "B/O RANUMA BEGUM, B.W – 800gms, G.A – 28wks", "07/04/25", "07/04/25, 06:34 am", "10/04/25, 07:40 pm", "Preterm/ ELBW/EOS in shock", "Extreme prematurity and low birth weight"],
["2", "B/O FAGUNI BORO, B.W – 3kg, G.A – 39wks", "31/03/25, 5:56pm", "31/03/25, 08:20pm", "1/04/25, n9:15am", "Birth asphyxia with HIE 2 in shock", ""]
]
),
(
"Mortality Month of May 2025",
[
["1", "B/O Surya KhatunnB.W – 2.6 kg, G.A - NA", "24/05/25, 06:00pm", "25/05/25, 01:10am", "25/05/25, 06:15am", "Milk Aspiration", "Received In NICU In Gasping State"],
["2", "B/O Tajimun BegumnB.W – 2KGnG.A -38wks", "20/5/25, 03:50pm", "22/05/25, 09:15pm", "26/05/25, 07:30pm", "Early Onset Neonatal Sepsis With ?Cyanotic Congenital Heart Disease With Intractable Shock", "?Delayed Ventilation & Antibiotics Upgradation"]
]
),
(
"Mortality Month of June 2025",
[
["1", "B/O SAHERA BHANU, B.W – 2.4kg, G.A – 36wks", "13/05/25", "03/06/25, 10pm", "04/06/25, 08:15pm", "Late Onset Sepsis", ""]
]
),
(
"Mortality Month of August 2025",
[
["1", "B/O POMPI DAS,nB.W – 2.5KG, GA – 38WKS", "8/08/25, 12:30PM", "8/08/25,n7:30PM", "12/08/25,n7:15AM", "BA WITH HIE 3", ""],
["2", "B/O SAMINA BEGUM,nBW – 3.3KG, GA – 39 WKS", "5/8/25,n4PM", "8/8/25, 12:45AM", "8/8/25 4:40AM", "Septicemia", ""],
["3", "B/O MARAMI BEGUMnB.W – 2.5kg, G.A – NA", "11/08/25, 12am", "11/08/25, 2pm", "13/08/25,n11:15am", "BA with HIE 3", ""]
]
),
(
"Mortality Month of September 2025",
[
["1", "B/O JESMIN AKHTARA,nBW- 2.7KG , GA- na", "17/9/25 12AM", "17/9/25 5PM", "18/9/25 6:30PM", "BA WITH HIE 3 IN SHOCK", ""],
["2", "B/O RUPALI NATH BAROnBW- 3.5KG, GA-", "31/8/25 7:30PM", "31/8/25 9:30PM", "4/9/25 3:30PM", "BA WITH HIE 3", ""],
["3", "B/O ASHMA BEGUM, BW- 3.1KG, GA- NA", "5/9/25 9:08AM", "6/9/25 , 9:50PM", "8/9/25 12:15AM", "BA WITH HIE 3", ""],
["4", "B/O JOYMATI BISWAS,nBW – 1.1KGnGA – 32 WKS", "28/8/25 , 7:05AM", "28/8/25 8:15AM", "12/09/25 6:05AM", "Prematurity with septicemia with LBW", ""]
]
),
(
"Mortality Month of October 2025",
[
["1", "B/O NOMITA DAS, BW-2.5KG, GA- 40WKS", "3/10/25 7:33PM", "6/10/25 01:35PM", "11/10/25 07:20 AM", "PERINATAL ASPHYXIA/HIE III/INTRACTABLE SHOCK", "POOR condition at the time of admission"],
["2", "B/O MALATI MARDI, BW- 2.8", "13/10/25, 12:24am", "13/10/24 1:45am", "18/10/25,n1:05pm", "INTRACTABLE SHOCK/BA/HIE III", ""]
]
),
(
"Mortality Month of November 2025",
[
["1", "B/O JARINA KARMAKAR, BW- 1.1KG, GA- NA", "22/11/25 7AM", "22/11/25 9AM", "25/11/25 7AM", "PREMATURITY WITH VLBW WITH RDS WITH EOS", ""],
["2", "B/O PURABI KAKATI,nBW-3.1KG, GA-39WKS", "5/11/25, 7:52AM", "13/11/25, 12PM", "15/11/25 1:33AM", "LONS WITH INTRACTABLE SHOCK", ""],
["3", "B/O KALPANA THAPA, BW- 1.8KG , GA- 36WKS", "10/11/25, 6:09AM", "10/11/25 ,9:30am", "11/11/25, 8am", "PREMATURITY WITH LBW WITH RDS", ""]
]
)
]

for title, rows in data_pages:
# Use a blank layout with a title
slide_layout = prs.slide_layouts[5] # Title Only
slide = prs.slides.add_slide(slide_layout)
title_shape = slide.shapes.title
title_shape.text = title

# Define Table Dimensions
rows_count = len(rows) + 2 # +1 for Header, +1 for "OUTBORN" label row
cols_count = 7
left = Inches(0.5)
top = Inches(1.5)
width = Inches(9.0)
height = Inches(0.8) # Arbitrary, will expand

table = slide.shapes.add_table(rows_count, cols_count, left, top, width, height).table

# Set Column Widths (Adjusting for content)
table.columns[0].width = Inches(0.4) # Sl No
table.columns[1].width = Inches(2.0) # Details
table.columns[2].width = Inches(1.0) # DOB
table.columns[3].width = Inches(1.0) # DOA
table.columns[4].width = Inches(1.0) # DOD
table.columns[5].width = Inches(2.0) # Diagnosis
table.columns[6].width = Inches(1.6) # Remarks

# Write Headers
for i, heading in enumerate(headers):
cell = table.cell(0, i)
cell.text = heading
cell.text_frame.paragraphs[0].font.bold = True
cell.text_frame.paragraphs[0].font.size = Pt(10)

# Write "OUTBORN" Label Row
outborn_cell = table.cell(1, 0)
outborn_cell.text = "OUTBORN"
outborn_cell.text_frame.paragraphs[0].font.bold = True
outborn_cell.text_frame.paragraphs[0].font.size = Pt(10)
# We leave the rest of this row blank to mimic the source style

# Write Data Rows
for row_idx, row_data in enumerate(rows):
for col_idx, cell_data in enumerate(row_data):
cell = table.cell(row_idx + 2, col_idx) # +2 because of Header and Outborn label
cell.text = cell_data
cell.text_frame.paragraphs[0].font.size = Pt(9)

output_path = "Outborn_Mortality_2025.pptx"
prs.save(output_path)
return output_path

file_path = create_presentation()
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.