attachment
attachment
attachment
attachment
attachment
attachment

Do Compalation work of proffesional secery and privileged communication from above refernced image

analyse_media
analyse_media
analyse_media
Reading File
Running Command

ls -la /home/daytona/workspace/ && ls /home/daytona/skills/docx/

Running Command

mkdir -p /home/daytona/workspace/professional-secrecy && ls /home/daytona/skills/docx/scripts/

Writing File

~/professional-secrecy/generate.js

const {
  Document, Packer, Paragraph, TextRun, HeadingLevel, AlignmentType,
  BorderStyle, UnderlineType
} = require('docx');
const fs = require('fs');

const doc = new Document({
  styles: {
    default: {
      document: {
        run: { font: "Times New Roman", size: 24 }
      }
    }
  },
  sections: [{
    properties: {},
    children: [

      // ─── TITLE ───────────────────────────────────────────────────────────
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { after: 200 },
        children: [
          new TextRun({
            text: "PROFESSIONAL SECRECY AND PRIVILEGED COMMUNICATION",
            bold: true,
            size: 32,
            font: "Times New Roman",
            underline: { type: UnderlineType.SINGLE }
          })
        ]
      }),
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { after: 400 },
        children: [
          new TextRun({
            text: "(Medical Law and Ethics)",
            bold: false,
            italics: true,
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),

      // ─── PART I HEADING ──────────────────────────────────────────────────
      new Paragraph({
        spacing: { before: 200, after: 120 },
        children: [
          new TextRun({
            text: "(XV) PROFESSIONAL SECRECY (Confidentiality)",
            bold: true,
            underline: { type: UnderlineType.SINGLE },
            size: 26,
            font: "Times New Roman"
          })
        ]
      }),

      // ─── DEFINITION ──────────────────────────────────────────────────────
      new Paragraph({
        spacing: { after: 160 },
        children: [
          new TextRun({
            text: "Definition: ",
            bold: true,
            size: 24,
            font: "Times New Roman"
          }),
          new TextRun({
            text: "It is an implied term of contract between the doctor and his patient. The doctor is obliged to keep secret all that he comes to know concerning the patient in the course of his professional work. Everything said by a patient or his family members to a physician in the context of medical diagnosis and treatment is confidential.",
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),
      new Paragraph({
        spacing: { after: 160 },
        children: [
          new TextRun({
            text: "Its disclosure would be a breach of trust and confidence. The patient can sue the doctor for damages",
            bold: true,
            size: 24,
            font: "Times New Roman"
          }),
          new TextRun({
            text: " (mental suffering, shame or humiliation), if the disclosure is voluntary, has resulted in harm to the patient, and is not in the interest of the public.",
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),

      // ─── EXAMPLES HEADING ────────────────────────────────────────────────
      new Paragraph({
        spacing: { before: 200, after: 100 },
        children: [
          new TextRun({
            text: "Examples:",
            bold: true,
            underline: { type: UnderlineType.SINGLE },
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),

      // Examples 1-14
      ...[
        "(1) A doctor should not discuss the illness of his patient with others without the consent of the patient.",
        "(2) If the patient is a major, the doctor should not disclose any facts about the illness without his consent to parents or relatives even though they may be paying the doctor's fees. In the case of a minor or an insane person, guardians or parents should be informed of the nature of the illness.",
        "(3) A doctor should not answer any enquiry by third parties, even when enquired by near relatives of the patient, either with regard to the nature of the illness or with regard to any subsequent effect of such illness on the patient, without the consent of the patient.",
        "(4) A doctor should not disclose any information about the illness of his patient, without the consent of the patient, even when requested by a public or statutory body, except in case of notifiable diseases.",
        "(5) Even in the case of husband and wife, the facts relating to the nature of illness of the one, must not be disclosed to the other, without the consent of the concerned person.",
        "(6) In divorce and nullity cases, no information should be given without getting the consent of the person concerned.",
        "(7) Medical Officers in Government service are also bound by the code of professional secrecy, even when the patient is treated free.",
        "(8) When a doctor examines a Government servant on behalf of the Government, he cannot disclose the nature of illness to the Government without the patient's consent.",
        "(9) When a domestic servant is examined at the request of the master, the doctor should not disclose any facts about the illness to the master without the consent of the servant, even though the master is paying the fees.",
        "(10) The medical officer of a firm or factory should not disclose the result of his examination of an employee to the employer without the consent of the employee.",
        "(11) A person in police custody as an under-trial prisoner has the right not to permit the doctor who has examined him, to disclose the nature of his illness to any person. If a person is convicted, he has no such right and the doctor can disclose the result to the authorities.",
        "(12) In reporting a case in any medical journal, care should be taken that the patient's identity is not revealed from the case notes or photographs.",
        "(13) In the examination of a dead body certain facts may be found, the disclosure of which may affect the reputation of the deceased or cause anguish to his relatives, and as such, the doctor should maintain secrecy.",
        "(14) The medical examination for taking out life insurance policy is a voluntary act by the examinee and therefore, consent to the disclosure of the finding may be taken as implied."
      ].map(text => new Paragraph({
        spacing: { after: 120 },
        indent: { left: 360 },
        children: [
          new TextRun({ text, size: 24, font: "Times New Roman" })
        ]
      })),

      // ─── PART II HEADING ─────────────────────────────────────────────────
      new Paragraph({
        spacing: { before: 400, after: 120 },
        children: [
          new TextRun({
            text: "PRIVILEGED COMMUNICATION",
            bold: true,
            underline: { type: UnderlineType.SINGLE },
            size: 26,
            font: "Times New Roman"
          })
        ]
      }),

      new Paragraph({
        spacing: { after: 160 },
        children: [
          new TextRun({
            text: "Definition: ",
            bold: true,
            size: 24,
            font: "Times New Roman"
          }),
          new TextRun({
            text: "It is a statement made bonafide upon any subject matter, by a doctor to the concerned authority, due to his duty to protect the interests of the community or of the State.",
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),
      new Paragraph({
        spacing: { after: 160 },
        children: [
          new TextRun({
            text: "To be privileged, the communication must be made to a person having interest in it, or in reference of which he has a duty. If made to more than one person, or to a person who has not a direct interest in it, the plea of privilege fails.",
            bold: true,
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),
      new Paragraph({
        spacing: { after: 200 },
        children: [
          new TextRun({
            text: "The doctor should first persuade the patient to get his consent before notifying the proper authority. If the doctor discloses professional secrets for the purpose of protecting the interest of the community (under a moral and social obligation), ",
            size: 24,
            font: "Times New Roman"
          }),
          new TextRun({
            text: "he will not be liable to damages.",
            bold: true,
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),

      // ─── EXAMPLES / EXCEPTIONS HEADING ──────────────────────────────────
      new Paragraph({
        spacing: { before: 200, after: 120 },
        children: [
          new TextRun({
            text: "The following are the examples of privileged communication or in other words, exceptions to the general rule of professional secrecy:",
            bold: true,
            size: 24,
            font: "Times New Roman"
          })
        ]
      }),

      // (1) Infectious Diseases
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(1) Infectious Diseases: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "If a patient suffering from an infectious disease is employed as cook or waiter in a hotel, or a food-handler with an enteric infection, or a teacher with tuberculosis or other infective disease, or as children's nurse, etc., he should be persuaded to leave the job until he becomes noninfectious. If the patient refuses to accept this advice, the doctor can inform the employer.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // (2) Venereal Diseases
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(2) Venereal Diseases: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "If a person suffering from syphilis is about to marry, it is the duty of the doctor to advise the patient not to marry till he is cured; if the person refuses, the doctor can disclose the syphilitic condition of the patient to the woman concerned or to her parents. Swimming pools should be prohibited to those having syphilis or gonorrhoea; but if the person refuses, the authorities can be informed. The doctor can inform the warden of a hostel, if any boarder is suffering from venereal disease.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // (3) Servants and Employees
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(3) Servants and Employees: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "An engine driver or a bus driver may be suffering from epilepsy, high blood pressure, alcoholism, drug addiction, or colour blindness. The doctor should persuade the patient to change his employment, because of the danger of his present occupation, both to himself and to the public. If this fails, the doctor should inform the employer, that the patient is unfit for that kind of employment.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // (4) Notifiable Diseases
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(4) Notifiable Diseases: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "A medical practitioner has a statutory duty to notify births, deaths, infectious diseases, etc., to the Public Health authorities.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // (5) Patient's own Interest
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(5) Patient's own Interest: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "The doctor should disclose to the parents or guardians of signs in the patient of melancholia, suicidal tendencies, etc., so that proper care may be taken.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // (6) Self-interest
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(6) Self-interest: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "Both in civil and criminal actions by the patient against the doctor, evidence about the patient's condition may be given.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // (7) Courts of Law
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(7) Courts of Law: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "In a Court of law, a doctor cannot claim privilege concerning communications between himself and his patient, if it is relevant to the inquiry before the Court. ",
            bold: true, size: 24, font: "Times New Roman"
          }),
          new TextRun({
            text: "In all cases, the doctor should appeal to the Judge, before disclosing a professional secret. The doctor may request the Judge that he will give the information in writing, so that it is not made public. The witness should not voluntarily disclose information either in Court or out of it, but ",
            size: 24, font: "Times New Roman"
          }),
          new TextRun({
            text: "for the actual evidence demanded by the Court, he is protected from civil action against breach of confidence.",
            bold: true, size: 24, font: "Times New Roman"
          })
        ]
      }),

      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({
            text: "A doctor can disclose and discuss the medical facts of a case with other doctors and paramedical staff, such as nurses, radiologist, physiotherapist, etc., to provide better service to the patient.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // (8) Suspected Crime
      new Paragraph({
        spacing: { before: 160, after: 80 },
        children: [
          new TextRun({ text: "(8) Suspected Crime: ", bold: true, size: 24, font: "Times New Roman" }),
          new TextRun({
            text: "If the doctor learns of a serious crime, such as murder, assault, rape, etc., by treating the victim or assailant, he is bound to give information to the police (S.39, Cr.P.C). Thus, if a doctor treats a person suffering from gunshot or stab wounds due to criminal assault, he must inform the police.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

      // ─── PHYSICIAN'S RESPONSIBILITY IN CRIMINAL MATTERS ──────────────────
      new Paragraph({
        spacing: { before: 400, after: 120 },
        children: [
          new TextRun({
            text: "Physician's Responsibility in Criminal Matters",
            bold: true,
            underline: { type: UnderlineType.SINGLE },
            size: 26,
            font: "Times New Roman"
          })
        ]
      }),
      new Paragraph({
        spacing: { after: 160 },
        children: [
          new TextRun({
            text: "In medicolegal cases, treatment gets priority. Thereafter procedural criminal law will operate. ",
            bold: true, size: 24, font: "Times New Roman"
          }),
          new TextRun({
            text: "A doctor who is aware of the commission of crimes, such as murder, dacoity, waging war against the lawful Government, helping the escape of prisoners, etc., is legally bound to report them to the nearest Magistrate or police officer (S.39, Cr.P.C., S.176, I.P.C.). The doctor knowing or having reason to believe that an offence has been committed by a patient whom he is treating, intentionally omits to inform the police, shall be punished with imprisonment upto 6 months (S.202, I.P.C.).",
            size: 24, font: "Times New Roman"
          })
        ]
      }),
      new Paragraph({
        spacing: { after: 160 },
        children: [
          new TextRun({
            text: "The practitioner should hand over to the police a man whom, from the nature of injury, he may suspect to be an assailant in a murder case. But, if he treats a person who has attempted to commit suicide, he is not legally bound to report, but if the person dies he has to inform the police.",
            size: 24, font: "Times New Roman"
          })
        ]
      }),

    ]
  }]
});

Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync('/home/daytona/workspace/professional-secrecy/Professional_Secrecy_and_Privileged_Communication.docx', buffer);
  console.log('Document created successfully.');
});
Running Command

cd /home/daytona/workspace/professional-secrecy && node generate.js

Running Command

python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/professional-secrecy/Professional_Secrecy_and_Privileged_Communication.docx

Running Command

python3 -c "import zipfile; z = zipfile.ZipFile('/home/daytona/workspace/professional-secrecy/Professional_Secrecy_and_Privileged_Communication.docx'); print('Valid ZIP/DOCX - files:', z.namelist()[:5])"

The document is valid. Here is your compiled document:

Professional Secrecy and Privileged Communication

Word Document · DOCX


Below is the full compiled text from your reference images:

(XV) PROFESSIONAL SECRECY (Confidentiality)

Definition: It is an implied term of contract between the doctor and his patient. The doctor is obliged to keep secret all that he comes to know concerning the patient in the course of his professional work. Everything said by a patient or his family members to a physician in the context of medical diagnosis and treatment is confidential.
Its disclosure would be a breach of trust and confidence. The patient can sue the doctor for damages (mental suffering, shame or humiliation), if the disclosure is voluntary, has resulted in harm to the patient, and is not in the interest of the public.

Examples:

  1. A doctor should not discuss the illness of his patient with others without the consent of the patient.
  2. If the patient is a major, the doctor should not disclose any facts about the illness without his consent to parents or relatives even though they may be paying the doctor's fees. In the case of a minor or an insane person, guardians or parents should be informed of the nature of the illness.
  3. A doctor should not answer any enquiry by third parties, even when enquired by near relatives of the patient, either with regard to the nature of the illness or with regard to any subsequent effect of such illness on the patient, without the consent of the patient.
  4. A doctor should not disclose any information about the illness of his patient, without the consent of the patient, even when requested by a public or statutory body, except in case of notifiable diseases.
  5. Even in the case of husband and wife, the facts relating to the nature of illness of the one must not be disclosed to the other, without the consent of the concerned person.
  6. In divorce and nullity cases, no information should be given without getting the consent of the person concerned.
  7. Medical Officers in Government service are also bound by the code of professional secrecy, even when the patient is treated free.
  8. When a doctor examines a Government servant on behalf of the Government, he cannot disclose the nature of illness to the Government without the patient's consent.
  9. When a domestic servant is examined at the request of the master, the doctor should not disclose any facts about the illness to the master without the consent of the servant, even though the master is paying the fees.
  10. The medical officer of a firm or factory should not disclose the result of his examination of an employee to the employer without the consent of the employee.
  11. A person in police custody as an under-trial prisoner has the right not to permit the doctor who has examined him to disclose the nature of his illness to any person. If a person is convicted, he has no such right and the doctor can disclose the result to the authorities.
  12. In reporting a case in any medical journal, care should be taken that the patient's identity is not revealed from the case notes or photographs.
  13. In the examination of a dead body certain facts may be found, the disclosure of which may affect the reputation of the deceased or cause anguish to his relatives, and as such, the doctor should maintain secrecy.
  14. The medical examination for taking out life insurance policy is a voluntary act by the examinee and therefore, consent to the disclosure of the finding may be taken as implied.

PRIVILEGED COMMUNICATION

Definition: It is a statement made bonafide upon any subject matter, by a doctor to the concerned authority, due to his duty to protect the interests of the community or of the State.
To be privileged, the communication must be made to a person having interest in it, or in reference of which he has a duty. If made to more than one person, or to a person who has not a direct interest in it, the plea of privilege fails.
The doctor should first persuade the patient to get his consent before notifying the proper authority. If the doctor discloses professional secrets for the purpose of protecting the interest of the community (under a moral and social obligation), he will not be liable to damages.
The following are the examples of privileged communication - or in other words, exceptions to the general rule of professional secrecy:
(1) Infectious Diseases: If a patient suffering from an infectious disease is employed as cook or waiter in a hotel, or a food-handler with an enteric infection, or a teacher with tuberculosis or other infective disease, or as children's nurse, etc., he should be persuaded to leave the job until he becomes noninfectious. If the patient refuses, the doctor can inform the employer.
(2) Venereal Diseases: If a person suffering from syphilis is about to marry, it is the duty of the doctor to advise the patient not to marry till he is cured; if the person refuses, the doctor can disclose the syphilitic condition to the woman concerned or to her parents. Swimming pools should be prohibited to those having syphilis or gonorrhoea; but if the person refuses, the authorities can be informed. The doctor can inform the warden of a hostel if any boarder is suffering from venereal disease.
(3) Servants and Employees: An engine driver or a bus driver may be suffering from epilepsy, high blood pressure, alcoholism, drug addiction, or colour blindness. The doctor should persuade the patient to change his employment. If this fails, the doctor should inform the employer that the patient is unfit for that kind of employment.
(4) Notifiable Diseases: A medical practitioner has a statutory duty to notify births, deaths, infectious diseases, etc., to the Public Health authorities.
(5) Patient's own Interest: The doctor should disclose to the parents or guardians signs of melancholia, suicidal tendencies, etc., in the patient so that proper care may be taken.
(6) Self-interest: Both in civil and criminal actions by the patient against the doctor, evidence about the patient's condition may be given.
(7) Courts of Law: In a Court of law, a doctor cannot claim privilege concerning communications between himself and his patient, if it is relevant to the inquiry before the Court. In all cases, the doctor should appeal to the Judge, before disclosing a professional secret. The doctor may request the Judge that he will give the information in writing, so that it is not made public. The witness should not voluntarily disclose information either in Court or out of it, but for the actual evidence demanded by the Court, he is protected from civil action against breach of confidence.
A doctor can disclose and discuss the medical facts of a case with other doctors and paramedical staff, such as nurses, radiologist, physiotherapist, etc., to provide better service to the patient.
(8) Suspected Crime: If the doctor learns of a serious crime, such as murder, assault, rape, etc., by treating the victim or assailant, he is bound to give information to the police (S.39, Cr.P.C). Thus, if a doctor treats a person suffering from gunshot or stab wounds due to criminal assault, he must inform the police.

Physician's Responsibility in Criminal Matters

In medicolegal cases, treatment gets priority. Thereafter procedural criminal law will operate. A doctor aware of crimes such as murder, dacoity, waging war against the lawful Government, or helping the escape of prisoners, is legally bound to report to the nearest Magistrate or police officer (S.39, Cr.P.C., S.176, I.P.C.). A doctor who intentionally omits to inform the police shall be punished with imprisonment upto 6 months (S.202, I.P.C.). The practitioner should hand over to the police a man whom, from the nature of injury, he may suspect to be an assailant in a murder case. If a person has attempted suicide, the doctor is not legally bound to report, but if the person dies he has to inform the police.

Make it a ppt form

Reading File
Reading File
Writing File

~/professional-secrecy/ppt.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Professional Secrecy and Privileged Communication";

// ─── COLOR PALETTE ────────────────────────────────────────────────────────────
const C = {
  darkNavy:   "0D1B2A",   // dominant dark bg
  midBlue:    "1B3A5C",   // section headers / card bg
  accent:     "E8B84B",   // gold accent
  lightGray:  "F0F4F8",   // light slide bg
  white:      "FFFFFF",
  bodyText:   "1A2533",
  lightText:  "CBD5E0",
  red:        "C0392B",
  teal:       "1A7F8A",
};

// ─── HELPER: add a header bar ─────────────────────────────────────────────────
function headerBar(slide, title, subtitle) {
  // dark bg
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkNavy } });
  // accent stripe
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.545, w: 10, h: 0.08, fill: { color: C.accent } });
  // title
  slide.addText(title, {
    x: 0.5, y: 1.5, w: 9, h: 1.5,
    fontSize: 40, bold: true, color: C.white,
    align: "center", fontFace: "Calibri",
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.5, y: 3.1, w: 9, h: 0.7,
      fontSize: 22, italic: true, color: C.accent,
      align: "center", fontFace: "Calibri",
    });
  }
}

// ─── HELPER: section title slide ──────────────────────────────────────────────
function sectionSlide(slide, label, title) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.midBlue } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent } });
  slide.addText(label, {
    x: 0.5, y: 1.4, w: 9, h: 0.5,
    fontSize: 16, color: C.accent, bold: true, fontFace: "Calibri",
  });
  slide.addText(title, {
    x: 0.5, y: 1.95, w: 9, h: 1.6,
    fontSize: 34, bold: true, color: C.white, fontFace: "Calibri",
  });
}

// ─── HELPER: content slide (dark) ─────────────────────────────────────────────
function contentSlide(slide, title, items, opts = {}) {
  const bg = opts.light ? C.lightGray : C.darkNavy;
  const titleColor = opts.light ? C.midBlue : C.white;
  const textColor  = opts.light ? C.bodyText : C.lightText;

  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: bg } });
  // accent left stripe
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  // title bar
  slide.addShape(pres.ShapeType.rect, { x: 0.12, y: 0, w: 9.88, h: 0.75, fill: { color: C.midBlue } });
  slide.addText(title, {
    x: 0.28, y: 0.05, w: 9.5, h: 0.65,
    fontSize: 20, bold: true, color: C.accent, fontFace: "Calibri",
    valign: "middle",
  });

  const bulletItems = items.map((item, i) => {
    const isLast = i === items.length - 1;
    return {
      text: item.text || item,
      options: {
        bullet: item.bullet !== false ? { indent: 15 } : false,
        bold: item.bold || false,
        color: item.color || textColor,
        fontSize: item.size || 14,
        breakLine: !isLast,
        paraSpaceBefore: 4,
        paraSpaceAfter: 4,
      }
    };
  });

  slide.addText(bulletItems, {
    x: 0.28, y: 0.85, w: 9.4, h: 4.65,
    fontFace: "Calibri", valign: "top", wrap: true,
  });
}

// ─── HELPER: two-column slide ─────────────────────────────────────────────────
function twoColSlide(slide, title, leftItems, rightItems) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkNavy } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0.12, y: 0, w: 9.88, h: 0.75, fill: { color: C.midBlue } });
  slide.addText(title, {
    x: 0.28, y: 0.05, w: 9.5, h: 0.65,
    fontSize: 20, bold: true, color: C.accent, fontFace: "Calibri", valign: "middle",
  });
  // divider
  slide.addShape(pres.ShapeType.rect, { x: 5.05, y: 0.85, w: 0.04, h: 4.6, fill: { color: C.midBlue } });

  const makeBullets = (arr) => arr.map((item, i) => ({
    text: item.text || item,
    options: {
      bullet: item.bullet !== false ? { indent: 12 } : false,
      bold: item.bold || false,
      color: item.color || C.lightText,
      fontSize: 13,
      breakLine: i < arr.length - 1,
      paraSpaceBefore: 3,
    }
  }));

  slide.addText(makeBullets(leftItems), {
    x: 0.28, y: 0.9, w: 4.6, h: 4.5, fontFace: "Calibri", valign: "top", wrap: true,
  });
  slide.addText(makeBullets(rightItems), {
    x: 5.2, y: 0.9, w: 4.6, h: 4.5, fontFace: "Calibri", valign: "top", wrap: true,
  });
}

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 1 — TITLE
// ─────────────────────────────────────────────────────────────────────────────
let sl = pres.addSlide();
headerBar(sl,
  "Professional Secrecy\n& Privileged Communication",
  "Medical Law and Ethics"
);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 2 — AGENDA
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Agenda / Overview", [
  { text: "Part 1: Professional Secrecy (Confidentiality) — Definition", bold: true, color: C.accent },
  { text: "Legal basis and implied contract" },
  { text: "14 Illustrative examples" },
  { text: "" },
  { text: "Part 2: Privileged Communication — Definition", bold: true, color: C.accent },
  { text: "When privilege applies (and when it fails)" },
  { text: "8 Exceptions to the rule of professional secrecy" },
  { text: "" },
  { text: "Part 3: Physician's Responsibility in Criminal Matters", bold: true, color: C.accent },
  { text: "Medicolegal duty to report crimes to police" },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 3 — SECTION BREAK: Professional Secrecy
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
sectionSlide(sl, "PART 1", "Professional Secrecy\n(Confidentiality)");

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 4 — DEFINITION
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Definition of Professional Secrecy", [
  { text: "It is an implied term of contract between the doctor and his patient.", bold: true, color: C.accent },
  { text: "The doctor is obliged to keep secret all that he comes to know concerning the patient in the course of his professional work.", bullet: false },
  { text: "Everything said by a patient or family members to a physician in the context of medical diagnosis and treatment is confidential.", bullet: false },
  { text: "" },
  { text: "Disclosure = Breach of trust and confidence.", bold: true, color: C.red },
  { text: "The patient can sue the doctor for damages (mental suffering, shame, humiliation) if:", bullet: false },
  { text: "Disclosure was voluntary" },
  { text: "It resulted in harm to the patient" },
  { text: "It was not in the interest of the public" },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 5 — EXAMPLES 1–5
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Examples of Professional Secrecy (1–5)", [
  { text: "(1) A doctor should not discuss a patient's illness with others without the patient's consent.", bold: false },
  { text: "(2) For a major patient, facts cannot be disclosed to parents/relatives paying the fees. For a minor or insane person, guardians must be informed.", bold: false },
  { text: "(3) A doctor must not answer enquiries by third parties — even near relatives — regarding the illness or its effects, without the patient's consent.", bold: false },
  { text: "(4) A doctor must not disclose information to any public or statutory body without the patient's consent, except for notifiable diseases.", bold: false },
  { text: "(5) Even between husband and wife, the illness of one must not be disclosed to the other without the concerned person's consent.", bold: false },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 6 — EXAMPLES 6–10
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Examples of Professional Secrecy (6–10)", [
  { text: "(6) In divorce and nullity cases, no information should be given without the consent of the person concerned.", bold: false },
  { text: "(7) Medical Officers in Government service are bound by professional secrecy, even when the patient is treated free.", bold: false },
  { text: "(8) A doctor examining a Government servant on behalf of the Government cannot disclose the illness to the Government without the patient's consent.", bold: false },
  { text: "(9) A doctor examining a domestic servant at the master's request must not disclose facts to the master without the servant's consent — even though the master pays the fees.", bold: false },
  { text: "(10) A medical officer of a firm or factory must not disclose the result of an employee's examination to the employer without the employee's consent.", bold: false },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 7 — EXAMPLES 11–14
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Examples of Professional Secrecy (11–14)", [
  { text: "(11) An under-trial prisoner in police custody can refuse disclosure of his illness. A convicted person has no such right — the doctor can disclose to authorities.", bold: false },
  { text: "(12) In reporting a case in any medical journal, the patient's identity must not be revealed from case notes or photographs.", bold: false },
  { text: "(13) In examination of a dead body, facts that may harm the deceased's reputation or cause anguish to relatives should be kept secret by the doctor.", bold: false },
  { text: "(14) The medical examination for a life insurance policy is a voluntary act by the examinee; consent to disclosure of the finding may be taken as implied.", bold: false },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 8 — SECTION BREAK: Privileged Communication
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
sectionSlide(sl, "PART 2", "Privileged Communication");

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 9 — DEFINITION OF PRIVILEGED COMMUNICATION
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Definition of Privileged Communication", [
  { text: "A statement made bonafide upon any subject matter, by a doctor to the concerned authority, due to his duty to protect the interests of the community or of the State.", bold: true, color: C.accent, bullet: false },
  { text: "" },
  { text: "To be privileged:", bold: true, color: C.white },
  { text: "Communication must be made to a person having interest in it, OR" },
  { text: "In reference of which the person has a duty." },
  { text: "" },
  { text: "Privilege FAILS if:", bold: true, color: C.red },
  { text: "Made to more than one person, OR" },
  { text: "Made to a person with no direct interest in it." },
  { text: "" },
  { text: "If the doctor discloses professional secrets to protect community interest (moral/social obligation) → he will NOT be liable to damages.", bold: true, color: C.accent, bullet: false },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 10 — EXCEPTIONS 1 & 2
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
twoColSlide(sl,
  "Exceptions to Professional Secrecy — Infectious & Venereal Diseases",
  [
    { text: "(1) Infectious Diseases", bold: true, color: C.accent, bullet: false },
    { text: "Patient with infectious disease employed as cook, waiter, food-handler, teacher, or children's nurse" },
    { text: "Doctor should persuade patient to leave job until non-infectious" },
    { text: "If patient refuses → doctor can inform the employer" },
  ],
  [
    { text: "(2) Venereal Diseases", bold: true, color: C.accent, bullet: false },
    { text: "Syphilitic patient about to marry → advise not to marry till cured" },
    { text: "If patient refuses → doctor can disclose to woman/her parents" },
    { text: "Swimming pools prohibited for syphilis/gonorrhoea patients" },
    { text: "Doctor can inform hostel warden if a boarder has venereal disease" },
  ]
);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 11 — EXCEPTIONS 3 & 4
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
twoColSlide(sl,
  "Exceptions — Servants/Employees & Notifiable Diseases",
  [
    { text: "(3) Servants and Employees", bold: true, color: C.accent, bullet: false },
    { text: "Engine/bus driver with epilepsy, hypertension, alcoholism, drug addiction, or colour blindness" },
    { text: "Danger to self and the public" },
    { text: "Doctor persuades patient to change job" },
    { text: "If this fails → inform employer that patient is unfit" },
  ],
  [
    { text: "(4) Notifiable Diseases", bold: true, color: C.accent, bullet: false },
    { text: "Statutory duty to notify:" },
    { text: "Births, deaths" },
    { text: "Infectious diseases" },
    { text: "Reported to the Public Health authorities" },
  ]
);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 12 — EXCEPTIONS 5 & 6
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
twoColSlide(sl,
  "Exceptions — Patient's Interest & Self-Interest",
  [
    { text: "(5) Patient's Own Interest", bold: true, color: C.accent, bullet: false },
    { text: "Signs of melancholia or suicidal tendencies in patient" },
    { text: "Doctor should disclose to parents or guardians" },
    { text: "So that proper care may be taken" },
  ],
  [
    { text: "(6) Self-Interest", bold: true, color: C.accent, bullet: false },
    { text: "In civil or criminal actions by the patient against the doctor" },
    { text: "Evidence about the patient's condition may be given by the doctor" },
  ]
);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 13 — EXCEPTION 7: COURTS OF LAW
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "(7) Courts of Law", [
  { text: "In a Court of law, a doctor CANNOT claim privilege concerning communications between himself and his patient, if it is relevant to the inquiry before the Court.", bold: true, color: C.accent, bullet: false },
  { text: "" },
  { text: "Before disclosing, doctor should appeal to the Judge" },
  { text: "Doctor may request the Judge to receive information in writing (to keep it non-public)" },
  { text: "Witness should NOT voluntarily disclose information in or out of court" },
  { text: "" },
  { text: "For evidence actually demanded by the Court:", bold: true, color: C.white },
  { text: "Doctor is protected from civil action against breach of confidence.", bold: true, color: C.accent },
  { text: "" },
  { text: "A doctor can discuss medical facts with other doctors and paramedical staff (nurses, radiologist, physiotherapist, etc.) to provide better patient care.", bullet: false },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 14 — EXCEPTION 8: SUSPECTED CRIME
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "(8) Suspected Crime", [
  { text: "If a doctor learns of a serious crime (murder, assault, rape, etc.) by treating the victim or assailant:", bold: true, color: C.accent, bullet: false },
  { text: "He is bound to give information to the police (S.39, Cr.P.C.)" },
  { text: "" },
  { text: "Examples:", bold: true, color: C.white },
  { text: "Doctor treats a person with gunshot or stab wounds due to criminal assault → must inform police" },
  { text: "" },
  { text: "Note:", bold: true, color: C.white },
  { text: "The doctor should first try to persuade the patient to consent before notifying the proper authority." },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 15 — SECTION BREAK: Criminal Responsibility
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
sectionSlide(sl, "PART 3", "Physician's Responsibility\nin Criminal Matters");

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 16 — PHYSICIAN'S CRIMINAL RESPONSIBILITY
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Physician's Responsibility in Criminal Matters", [
  { text: "In medicolegal cases, treatment gets priority. Thereafter procedural criminal law will operate.", bold: true, color: C.accent, bullet: false },
  { text: "" },
  { text: "A doctor who is aware of crimes (murder, dacoity, waging war against the Government, helping escape of prisoners, etc.) is legally bound to report to the nearest Magistrate or police officer (S.39, Cr.P.C., S.176, I.P.C.)" },
  { text: "A doctor who intentionally omits to inform the police about a crime committed by his patient shall be punished with imprisonment upto 6 months (S.202, I.P.C.)" },
  { text: "The practitioner should hand over to police a person suspected to be an assailant in a murder case (from the nature of injury)" },
  { text: "" },
  { text: "Attempted suicide:", bold: true, color: C.white },
  { text: "Doctor is NOT legally bound to report" },
  { text: "But if the person dies → must inform the police" },
]);

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 17 — SUMMARY TABLE
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkNavy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.midBlue } });
sl.addText("Summary: 8 Exceptions (Privileged Communication)", {
  x: 0.2, y: 0.08, w: 9.6, h: 0.6,
  fontSize: 20, bold: true, color: C.accent, fontFace: "Calibri",
});

const rows = [
  [{ text: "#", options: { bold: true, color: C.accent } }, { text: "Exception", options: { bold: true, color: C.accent } }, { text: "Who is informed", options: { bold: true, color: C.accent } }],
  [{ text: "1" }, { text: "Infectious Diseases" }, { text: "Employer" }],
  [{ text: "2" }, { text: "Venereal Diseases" }, { text: "Partner / Parents / Hostel Warden" }],
  [{ text: "3" }, { text: "Servants & Employees" }, { text: "Employer" }],
  [{ text: "4" }, { text: "Notifiable Diseases" }, { text: "Public Health Authorities" }],
  [{ text: "5" }, { text: "Patient's Own Interest" }, { text: "Parents / Guardians" }],
  [{ text: "6" }, { text: "Self-Interest" }, { text: "Court (civil/criminal action by patient)" }],
  [{ text: "7" }, { text: "Courts of Law" }, { text: "Judge / Court" }],
  [{ text: "8" }, { text: "Suspected Crime" }, { text: "Police" }],
];

sl.addTable(rows, {
  x: 0.3, y: 0.85, w: 9.4, h: 4.6,
  colW: [0.5, 5.2, 3.7],
  border: { pt: 1, color: C.midBlue },
  fill: { color: C.darkNavy },
  fontFace: "Calibri",
  fontSize: 13,
  color: C.lightText,
  rowH: 0.44,
  align: "left",
  valign: "middle",
});

// ─────────────────────────────────────────────────────────────────────────────
//  SLIDE 18 — CLOSING
// ─────────────────────────────────────────────────────────────────────────────
sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkNavy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.accent } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.545, w: 10, h: 0.08, fill: { color: C.accent } });
sl.addText("Key Takeaways", {
  x: 0.5, y: 0.5, w: 9, h: 0.6,
  fontSize: 26, bold: true, color: C.accent, align: "center", fontFace: "Calibri",
});
sl.addText([
  { text: "Professional Secrecy is an implied term of every doctor-patient contract.", options: { bullet: { indent: 20 }, breakLine: true, fontSize: 16, color: C.white } },
  { text: "Breach is actionable in law — patient can sue for damages.", options: { bullet: { indent: 20 }, breakLine: true, fontSize: 16, color: C.white } },
  { text: "Privileged Communication allows disclosure to protect community/State interest.", options: { bullet: { indent: 20 }, breakLine: true, fontSize: 16, color: C.white } },
  { text: "8 recognized exceptions exist to the general rule of confidentiality.", options: { bullet: { indent: 20 }, breakLine: true, fontSize: 16, color: C.white } },
  { text: "In criminal matters, treatment is priority — but legal reporting duties apply.", options: { bullet: { indent: 20 }, breakLine: true, fontSize: 16, color: C.white } },
  { text: "Omitting to report a crime by a patient can result in 6 months imprisonment (S.202 IPC).", options: { bullet: { indent: 20 }, fontSize: 16, color: C.white } },
], { x: 0.5, y: 1.25, w: 9, h: 3.6, fontFace: "Calibri", valign: "top" });

sl.addText("Source: Medical Law and Ethics — The Synopsis", {
  x: 0.5, y: 5.0, w: 9, h: 0.4,
  fontSize: 12, italic: true, color: C.lightText, align: "center", fontFace: "Calibri",
});

// ─── WRITE FILE ───────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/professional-secrecy/Professional_Secrecy_Privileged_Communication.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("PPT created:", outPath);
});
Running Command

cd /home/daytona/workspace/professional-secrecy && node ppt.js

Editing File

~/professional-secrecy/ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/professional-secrecy/ppt.js'
Running Command

cd /home/daytona/workspace/professional-secrecy && node ppt.js 2>&1

Editing File

~/professional-secrecy/ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/professional-secrecy/ppt.js'
Writing File

~/professional-secrecy/ppt.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Professional Secrecy and Privileged Communication";

const C = {
  darkNavy: "0D1B2A",
  midBlue:  "1B3A5C",
  accent:   "E8B84B",
  white:    "FFFFFF",
  lightText:"CBD5E0",
  red:      "C0392B",
  bodyText: "1A2533",
  lightGray:"F0F4F8",
};

// ─── helpers ──────────────────────────────────────────────────────────────────

function bg(slide, color) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color} });
}
function stripe(slide, color, x, w, y, h) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill:{color} });
}
function titleBar(slide, text) {
  stripe(slide, C.midBlue, 0.12, 9.88, 0, 0.75);
  slide.addText(text, { x:0.28, y:0.05, w:9.5, h:0.65, fontSize:20, bold:true, color:C.accent, fontFace:"Calibri", valign:"middle" });
}

// Build a safe text run array for addText
// Each item: { txt, bold, color, size, bullet, breakLine }
function runs(items) {
  return items.map((item, i) => {
    const isLast = i === items.length - 1;
    const opts = {
      fontSize: item.size || 14,
      bold: item.bold || false,
      color: item.color || C.lightText,
      breakLine: !isLast,
      paraSpaceBefore: 3,
      paraSpaceAfter: 3,
    };
    if (item.bullet !== false) {
      opts.bullet = { indent: 15 };
    }
    return { text: String(item.txt || ""), options: opts };
  });
}

function contentSlide(slide, title, items) {
  bg(slide, C.darkNavy);
  stripe(slide, C.accent, 0, 0.12, 0, 5.625);
  titleBar(slide, title);
  slide.addText(runs(items), { x:0.28, y:0.85, w:9.4, h:4.65, fontFace:"Calibri", valign:"top", wrap:true });
}

function sectionSlide(slide, label, title) {
  bg(slide, C.midBlue);
  stripe(slide, C.accent, 0, 0.18, 0, 5.625);
  slide.addText(label,  { x:0.5, y:1.4,  w:9, h:0.5, fontSize:16, color:C.accent, bold:true, fontFace:"Calibri" });
  slide.addText(title,  { x:0.5, y:1.95, w:9, h:1.8, fontSize:34, bold:true,  color:C.white,  fontFace:"Calibri" });
}

function twoColSlide(slide, title, leftItems, rightItems) {
  bg(slide, C.darkNavy);
  stripe(slide, C.accent, 0, 0.12, 0, 5.625);
  titleBar(slide, title);
  stripe(slide, C.midBlue, 5.05, 0.04, 0.85, 4.6);
  slide.addText(runs(leftItems),  { x:0.28, y:0.9, w:4.6, h:4.5, fontFace:"Calibri", valign:"top", wrap:true });
  slide.addText(runs(rightItems), { x:5.2,  y:0.9, w:4.6, h:4.5, fontFace:"Calibri", valign:"top", wrap:true });
}

// ─── SLIDE 1: Title ───────────────────────────────────────────────────────────
let sl = pres.addSlide();
bg(sl, C.darkNavy);
stripe(sl, C.accent, 0, 10, 0, 0.08);
stripe(sl, C.accent, 0, 10, 5.545, 0.08);
sl.addText("Professional Secrecy\n& Privileged Communication", {
  x:0.5, y:1.5, w:9, h:1.8, fontSize:38, bold:true, color:C.white, align:"center", fontFace:"Calibri"
});
sl.addText("Medical Law and Ethics", {
  x:0.5, y:3.3, w:9, h:0.7, fontSize:22, italic:true, color:C.accent, align:"center", fontFace:"Calibri"
});

// ─── SLIDE 2: Agenda ──────────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Agenda / Overview", [
  { txt:"PART 1: Professional Secrecy (Confidentiality)", bold:true, color:C.accent, bullet:false },
  { txt:"Definition, legal basis, 14 illustrative examples" },
  { txt:"PART 2: Privileged Communication", bold:true, color:C.accent, bullet:false },
  { txt:"When privilege applies (and when it fails)" },
  { txt:"8 exceptions to the rule of professional secrecy" },
  { txt:"PART 3: Physician's Responsibility in Criminal Matters", bold:true, color:C.accent, bullet:false },
  { txt:"Medicolegal duty — crimes must be reported to police" },
]);

// ─── SLIDE 3: Section break ───────────────────────────────────────────────────
sl = pres.addSlide();
sectionSlide(sl, "PART 1", "Professional Secrecy\n(Confidentiality)");

// ─── SLIDE 4: Definition ──────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Definition of Professional Secrecy", [
  { txt:"Implied term of contract between doctor and patient.", bold:true, color:C.accent, bullet:false },
  { txt:"The doctor is obliged to keep secret all that he comes to know concerning the patient in the course of his professional work.", bullet:false },
  { txt:"Everything said by a patient or family members in the context of medical diagnosis and treatment is confidential.", bullet:false },
  { txt:"Breach = breach of trust and confidence. Patient can sue for damages:", bold:true, color:C.red, bullet:false },
  { txt:"Disclosure was voluntary" },
  { txt:"It resulted in harm to the patient" },
  { txt:"It was not in the interest of the public" },
]);

// ─── SLIDE 5: Examples 1–5 ────────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Examples of Professional Secrecy (1-5)", [
  { txt:"(1) Doctor must not discuss patient's illness with others without consent." },
  { txt:"(2) For a major patient, no disclosure to parents/relatives even if they pay the fees. For minor/insane person, guardians must be informed." },
  { txt:"(3) No answers to third-party enquiries — even near relatives — about illness or its effects, without patient's consent." },
  { txt:"(4) No disclosure to any public/statutory body without patient's consent, except for notifiable diseases." },
  { txt:"(5) Between husband and wife, illness of one must not be disclosed to the other without the concerned person's consent." },
]);

// ─── SLIDE 6: Examples 6–10 ───────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Examples of Professional Secrecy (6-10)", [
  { txt:"(6) In divorce and nullity cases, no information without consent of the person concerned." },
  { txt:"(7) Medical Officers in Government service are bound by professional secrecy, even when patient is treated free." },
  { txt:"(8) Doctor examining a Government servant on behalf of the Government cannot disclose illness to the Government without patient's consent." },
  { txt:"(9) Domestic servant examined at master's request — doctor must not disclose facts to master without servant's consent, even if master pays." },
  { txt:"(10) Medical officer of a firm/factory must not disclose examination results to employer without employee's consent." },
]);

// ─── SLIDE 7: Examples 11–14 ──────────────────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Examples of Professional Secrecy (11-14)", [
  { txt:"(11) Under-trial prisoner can refuse disclosure of illness. A convicted person has no such right — doctor can disclose to authorities." },
  { txt:"(12) In medical journals, patient's identity must not be revealed from case notes or photographs." },
  { txt:"(13) In examination of a dead body, facts that may harm reputation of deceased or cause anguish to relatives should be kept secret." },
  { txt:"(14) Medical examination for life insurance policy is voluntary — consent to disclosure of findings may be taken as implied." },
]);

// ─── SLIDE 8: Section break ───────────────────────────────────────────────────
sl = pres.addSlide();
sectionSlide(sl, "PART 2", "Privileged Communication");

// ─── SLIDE 9: Definition of Privileged Communication ─────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Definition of Privileged Communication", [
  { txt:"A statement made bonafide upon any subject matter, by a doctor to the concerned authority, due to his duty to protect the interests of the community or of the State.", bold:true, color:C.accent, bullet:false },
  { txt:"Communication must be to a person having interest in it, OR in reference of which the person has a duty.", bullet:false },
  { txt:"Privilege FAILS if:", bold:true, color:C.red, bullet:false },
  { txt:"Made to more than one person, OR" },
  { txt:"Made to a person with no direct interest in it" },
  { txt:"If doctor discloses professional secrets to protect community interest (moral/social obligation) — he will NOT be liable to damages.", bold:true, color:C.accent, bullet:false },
  { txt:"Doctor should first persuade the patient to consent before notifying the proper authority.", bullet:false },
]);

// ─── SLIDE 10: Exceptions 1 & 2 ──────────────────────────────────────────────
sl = pres.addSlide();
twoColSlide(sl, "Exceptions to Professional Secrecy (1 & 2)",
  [
    { txt:"(1) Infectious Diseases", bold:true, color:C.accent, bullet:false },
    { txt:"Patient with infectious disease working as cook, waiter, food-handler, teacher, or children's nurse" },
    { txt:"Doctor persuades patient to leave job until non-infectious" },
    { txt:"If patient refuses — doctor can inform the employer" },
  ],
  [
    { txt:"(2) Venereal Diseases", bold:true, color:C.accent, bullet:false },
    { txt:"Syphilitic patient about to marry — advise not to marry till cured" },
    { txt:"If patient refuses — doctor can disclose to woman concerned or her parents" },
    { txt:"Swimming pools prohibited for syphilis/gonorrhoea patients" },
    { txt:"Doctor can inform hostel warden if boarder has venereal disease" },
  ]
);

// ─── SLIDE 11: Exceptions 3 & 4 ──────────────────────────────────────────────
sl = pres.addSlide();
twoColSlide(sl, "Exceptions to Professional Secrecy (3 & 4)",
  [
    { txt:"(3) Servants and Employees", bold:true, color:C.accent, bullet:false },
    { txt:"Engine/bus driver with epilepsy, hypertension, alcoholism, drug addiction, or colour blindness" },
    { txt:"Danger to self and to the public" },
    { txt:"Doctor persuades patient to change job" },
    { txt:"If this fails — inform employer that patient is unfit" },
  ],
  [
    { txt:"(4) Notifiable Diseases", bold:true, color:C.accent, bullet:false },
    { txt:"Statutory duty to notify:" },
    { txt:"Births and deaths" },
    { txt:"Infectious diseases" },
    { txt:"Reported to Public Health authorities" },
  ]
);

// ─── SLIDE 12: Exceptions 5 & 6 ──────────────────────────────────────────────
sl = pres.addSlide();
twoColSlide(sl, "Exceptions to Professional Secrecy (5 & 6)",
  [
    { txt:"(5) Patient's Own Interest", bold:true, color:C.accent, bullet:false },
    { txt:"Signs of melancholia or suicidal tendencies" },
    { txt:"Doctor discloses to parents or guardians" },
    { txt:"So that proper care may be taken" },
  ],
  [
    { txt:"(6) Self-Interest", bold:true, color:C.accent, bullet:false },
    { txt:"In civil or criminal actions by patient against the doctor" },
    { txt:"Evidence about the patient's condition may be given by the doctor" },
  ]
);

// ─── SLIDE 13: Exception 7 — Courts of Law ───────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "(7) Courts of Law", [
  { txt:"In a Court of law, a doctor CANNOT claim privilege concerning communications between himself and his patient, if it is relevant to the inquiry before the Court.", bold:true, color:C.accent, bullet:false },
  { txt:"Before disclosing, doctor should appeal to the Judge" },
  { txt:"Doctor may request the Judge to receive information in writing (so it is not made public)" },
  { txt:"Witness should NOT voluntarily disclose information in or out of court" },
  { txt:"For evidence actually demanded by the Court — doctor is protected from civil action against breach of confidence.", bold:true, color:C.accent, bullet:false },
  { txt:"Doctor can discuss medical facts with other doctors and paramedical staff (nurses, radiologist, physiotherapist, etc.) to provide better care.", bullet:false },
]);

// ─── SLIDE 14: Exception 8 — Suspected Crime ─────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "(8) Suspected Crime", [
  { txt:"If doctor learns of a serious crime (murder, assault, rape, etc.) by treating victim or assailant:", bold:true, color:C.accent, bullet:false },
  { txt:"He is bound to give information to the police (S.39, Cr.P.C.)" },
  { txt:"Doctor who treats a person with gunshot or stab wounds due to criminal assault must inform the police" },
  { txt:"Doctor should first try to persuade the patient to consent before notifying the proper authority.", bullet:false },
]);

// ─── SLIDE 15: Section break ──────────────────────────────────────────────────
sl = pres.addSlide();
sectionSlide(sl, "PART 3", "Physician's Responsibility\nin Criminal Matters");

// ─── SLIDE 16: Criminal Responsibility ───────────────────────────────────────
sl = pres.addSlide();
contentSlide(sl, "Physician's Responsibility in Criminal Matters", [
  { txt:"In medicolegal cases, treatment gets priority. Thereafter procedural criminal law will operate.", bold:true, color:C.accent, bullet:false },
  { txt:"A doctor aware of crimes (murder, dacoity, waging war against the Government, helping escape of prisoners, etc.) is legally bound to report to the nearest Magistrate or police officer (S.39, Cr.P.C., S.176, I.P.C.)" },
  { txt:"A doctor who intentionally omits to inform the police about a crime committed by his patient shall be punished with imprisonment up to 6 months (S.202, I.P.C.)" },
  { txt:"The practitioner should hand over to police a person suspected to be an assailant in a murder case (from the nature of injury)" },
  { txt:"Attempted suicide: Doctor is NOT legally bound to report, but if the person dies — must inform the police.", bold:true, color:C.white, bullet:false },
]);

// ─── SLIDE 17: Summary Table ──────────────────────────────────────────────────
sl = pres.addSlide();
bg(sl, C.darkNavy);
stripe(sl, C.midBlue, 0, 10, 0, 0.75);
sl.addText("Summary: 8 Exceptions (Privileged Communication)", {
  x:0.2, y:0.08, w:9.6, h:0.6, fontSize:20, bold:true, color:C.accent, fontFace:"Calibri"
});

const tableRows = [
  [
    { text:"#",               options:{ bold:true, color:C.accent, fill:{color:C.midBlue} } },
    { text:"Exception",       options:{ bold:true, color:C.accent, fill:{color:C.midBlue} } },
    { text:"Who is Informed", options:{ bold:true, color:C.accent, fill:{color:C.midBlue} } },
  ],
  [{ text:"1" }, { text:"Infectious Diseases"     }, { text:"Employer" }],
  [{ text:"2" }, { text:"Venereal Diseases"        }, { text:"Partner / Parents / Hostel Warden" }],
  [{ text:"3" }, { text:"Servants & Employees"     }, { text:"Employer" }],
  [{ text:"4" }, { text:"Notifiable Diseases"      }, { text:"Public Health Authorities" }],
  [{ text:"5" }, { text:"Patient's Own Interest"   }, { text:"Parents / Guardians" }],
  [{ text:"6" }, { text:"Self-Interest"             }, { text:"Court" }],
  [{ text:"7" }, { text:"Courts of Law"             }, { text:"Judge / Court" }],
  [{ text:"8" }, { text:"Suspected Crime"           }, { text:"Police" }],
];

sl.addTable(tableRows, {
  x:0.3, y:0.85, w:9.4, h:4.6,
  colW:[0.5, 5.2, 3.7],
  border:{ pt:1, color:C.midBlue },
  fill:{ color:C.darkNavy },
  fontFace:"Calibri",
  fontSize:13,
  color:C.lightText,
  rowH:0.44,
  align:"left",
  valign:"middle",
});

// ─── SLIDE 18: Key Takeaways ──────────────────────────────────────────────────
sl = pres.addSlide();
bg(sl, C.darkNavy);
stripe(sl, C.accent, 0, 10, 0, 0.08);
stripe(sl, C.accent, 0, 10, 5.545, 0.08);
sl.addText("Key Takeaways", {
  x:0.5, y:0.4, w:9, h:0.7, fontSize:28, bold:true, color:C.accent, align:"center", fontFace:"Calibri"
});

const takeaways = [
  "Professional Secrecy is an implied term of every doctor-patient contract.",
  "Breach is actionable — patient can sue for damages (mental suffering, shame, humiliation).",
  "Privileged Communication allows disclosure to protect community or State interest.",
  "8 recognized exceptions exist to the general rule of confidentiality.",
  "In criminal matters, treatment is priority — but legal reporting duties follow.",
  "Omitting to report a crime by a patient can result in imprisonment up to 6 months (S.202 IPC).",
];

slide18Items = takeaways.map((txt, i) => ({
  text: txt,
  options: { bullet:{ indent:20 }, breakLine: i < takeaways.length-1, fontSize:15, color:C.white }
}));

sl.addText(slide18Items, {
  x:0.5, y:1.25, w:9, h:3.8, fontFace:"Calibri", valign:"top"
});
sl.addText("Source: Medical Law and Ethics — The Synopsis", {
  x:0.5, y:5.1, w:9, h:0.4, fontSize:12, italic:true, color:C.lightText, align:"center", fontFace:"Calibri"
});

// ─── WRITE ────────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/professional-secrecy/Professional_Secrecy_Privileged_Communication.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("Done:", outPath);
}).catch(e => console.error(e));
Running Command

cat > /home/daytona/workspace/professional-secrecy/ppt.js << 'JSEOF' const pptxgen = require("pptxgenjs"); const pres = new pptxgen(); pres.layout = "LAYOUT_16x9"; const C = { darkNavy: "0D1B2A", midBlue:"1B3A5C", accent:"E8B84B", white:"FFFFFF", lightText:"CBD5E0", red:"C0392B", }; function bg(slide, color) { slide.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:5.625,fill:{color}}); } function rect(slide, color, x, y, w, h) { slide.addShape(pres.ShapeType.rect, {x,y,w,h,fill:{color}}); } function titleBar(slide, text) { rect(slide, C.midBlue, 0.12, 0, 9.88, 0.75); slide.addText(text, {x:0.28,y:0.05,w:9.5,h:0.65,fontSize:20,bold:true,color:C.accent,fontFace:"Calibri",valign:"middle"}); } function runs(items) { return items.map((item, i) => { const isLast = i === items.length - 1; const opts = { fontSize: item.size || 14, bold: !!item.bold, color: item.color || C.lightText, breakLine: !isLast, paraSpaceBefore: 3, }; if (item.bullet !== false) opts.bullet = {indent:15}; return { text: String(item.txt == null ? "" : item.txt), options: opts }; }); } function contentSlide(slide, title, items) { bg(slide, C.darkNavy); rect(slide, C.accent, 0, 0, 0.12, 5.625); titleBar(slide, title); slide.addText(runs(items), {x:0.28,y:0.85,w:9.4,h:4.65,fontFace:"Calibri",valign:"top",wrap:true}); } function sectionSlide(slide, label, title) { bg(slide, C.midBlue); rect(slide, C.accent, 0, 0, 0.18, 5.625); slide.addText(label, {x:0.5,y:1.4,w:9,h:0.5,fontSize:16,color:C.accent,bold:true,fontFace:"Calibri"}); slide.addText(title, {x:0.5,y:1.95,w:9,h:1.8,fontSize:34,bold:true,color:C.white,fontFace:"Calibri"}); } function twoCol(slide, title, L, R) { bg(slide, C.darkNavy); rect(slide, C.accent, 0, 0, 0.12, 5.625); titleBar(slide, title); rect(slide, C.midBlue, 5.05, 0.85, 0.04, 4.6); slide.addText(runs(L), {x:0.28,y:0.9,w:4.6,h:4.5,fontFace:"Calibri",valign:"top",wrap:true}); slide.addText(runs(R), {x:5.2,y:0.9,w:4.6,h:4.5,fontFace:"Calibri",valign:"top",wrap:true}); } // Slide 1: Title let sl = pres.addSlide(); bg(sl, C.darkNavy); rect(sl, C.accent, 0, 0, 10, 0.08); rect(sl, C.accent, 0, 5.545, 10, 0.08); sl.addText("Professional Secrecy\n& Privileged Communication", {x:0.5,y:1.5,w:9,h:1.8,fontSize:38,bold:true,color:C.white,align:"center",fontFace:"Calibri"}); sl.addText("Medical Law and Ethics", {x:0.5,y:3.3,w:9,h:0.7,fontSize:22,italic:true,color:C.accent,align:"center",fontFace:"Calibri"}); // Slide 2: Agenda sl = pres.addSlide(); contentSlide(sl, "Agenda / Overview", [ {txt:"PART 1: Professional Secrecy (Confidentiality)",bold:true,color:C.accent,bullet:false}, {txt:"Definition, legal basis, 14 illustrative examples"}, {txt:"PART 2: Privileged Communication",bold:true,color:C.accent,bullet:false}, {txt:"When privilege applies and when it fails"}, {txt:"8 exceptions to the rule of professional secrecy"}, {txt:"PART 3: Physician's Responsibility in Criminal Matters",bold:true,color:C.accent,bullet:false}, {txt:"Medicolegal duty to report crimes to police"}, ]); // Slide 3: Section 1 sl = pres.addSlide(); sectionSlide(sl, "PART 1", "Professional Secrecy\n(Confidentiality)"); // Slide 4: Definition sl = pres.addSlide(); contentSlide(sl, "Definition of Professional Secrecy", [ {txt:"Implied term of contract between doctor and patient.",bold:true,color:C.accent,bullet:false}, {txt:"Doctor is obliged to keep secret all that he comes to know concerning the patient in the course of his professional work.",bullet:false}, {txt:"Everything said by a patient or family members in the context of diagnosis and treatment is confidential.",bullet:false}, {txt:"Breach = breach of trust. Patient can sue for damages if:",bold:true,color:"C0392B",bullet:false}, {txt:"Disclosure was voluntary"}, {txt:"It resulted in harm to the patient"}, {txt:"It was not in the interest of the public"}, ]); // Slide 5: Examples 1-5 sl = pres.addSlide(); contentSlide(sl, "Examples of Professional Secrecy (1-5)", [ {txt:"(1) Doctor must not discuss patient illness with others without consent."}, {txt:"(2) For a major patient, no disclosure to parents/relatives even if they pay. For minor/insane person, guardians must be informed."}, {txt:"(3) No answers to third-party enquiries about illness or effects, without patient consent."}, {txt:"(4) No disclosure to any public/statutory body without consent, except for notifiable diseases."}, {txt:"(5) Between husband and wife, illness of one must not be disclosed to the other without the concerned person's consent."}, ]); // Slide 6: Examples 6-10 sl = pres.addSlide(); contentSlide(sl, "Examples of Professional Secrecy (6-10)", [ {txt:"(6) In divorce and nullity cases, no information without consent of the person concerned."}, {txt:"(7) Medical Officers in Government service are bound by professional secrecy, even when the patient is treated free."}, {txt:"(8) Doctor examining a Government servant cannot disclose illness to the Government without patient's consent."}, {txt:"(9) Doctor examining a domestic servant at master's request must not disclose facts to master without servant's consent."}, {txt:"(10) Medical officer of a firm/factory must not disclose examination results to employer without employee's consent."}, ]); // Slide 7: Examples 11-14 sl = pres.addSlide(); contentSlide(sl, "Examples of Professional Secrecy (11-14)", [ {txt:"(11) Under-trial prisoner can refuse disclosure. A convicted person has no such right — doctor can disclose to authorities."}, {txt:"(12) In medical journals, patient's identity must not be revealed from case notes or photographs."}, {txt:"(13) In examination of a dead body, facts that may harm reputation or cause anguish to relatives should be kept secret."}, {txt:"(14) Medical examination for life insurance policy is voluntary — consent to disclosure of findings may be taken as implied."}, ]); // Slide 8: Section 2 sl = pres.addSlide(); sectionSlide(sl, "PART 2", "Privileged Communication"); // Slide 9: Definition sl = pres.addSlide(); contentSlide(sl, "Definition of Privileged Communication", [ {txt:"A statement made bonafide upon any subject matter by a doctor to the concerned authority, due to his duty to protect the interests of the community or of the State.",bold:true,color:C.accent,bullet:false}, {txt:"To be privileged, communication must be to a person having interest in it, or in reference of which the person has a duty.",bullet:false}, {txt:"Privilege FAILS if made to more than one person, or to a person with no direct interest.",bold:true,color:"C0392B",bullet:false}, {txt:"If doctor discloses professional secrets to protect community interest — he will NOT be liable to damages.",bold:true,color:C.accent,bullet:false}, {txt:"Doctor should first persuade the patient to consent before notifying the proper authority.",bullet:false}, ]); // Slide 10: Exceptions 1 & 2 sl = pres.addSlide(); twoCol(sl, "Exceptions (1 & 2) — Infectious & Venereal Diseases", [ {txt:"(1) Infectious Diseases",bold:true,color:C.accent,bullet:false}, {txt:"Patient with infectious disease working as cook, waiter, food-handler, teacher, children's nurse"}, {txt:"Persuade patient to leave job until non-infectious"}, {txt:"If patient refuses — inform the employer"}, ], [ {txt:"(2) Venereal Diseases",bold:true,color:C.accent,bullet:false}, {txt:"Syphilitic patient about to marry — advise not to marry till cured"}, {txt:"If patient refuses — disclose to woman concerned or her parents"}, {txt:"Swimming pools prohibited for syphilis/gonorrhoea"}, {txt:"Inform hostel warden if boarder has venereal disease"}, ] ); // Slide 11: Exceptions 3 & 4 sl = pres.addSlide(); twoCol(sl, "Exceptions (3 & 4) — Servants/Employees & Notifiable Diseases", [ {txt:"(3) Servants and Employees",bold:true,color:C.accent,bullet:false}, {txt:"Engine/bus driver with epilepsy, hypertension, alcoholism, drug addiction, colour blindness"}, {txt:"Danger to self and public"}, {txt:"Persuade patient to change job"}, {txt:"If fails — inform employer that patient is unfit"}, ], [ {txt:"(4) Notifiable Diseases",bold:true,color:C.accent,bullet:false}, {txt:"Statutory duty to notify:"}, {txt:"Births and deaths"}, {txt:"Infectious diseases"}, {txt:"Reported to Public Health authorities"}, ] ); // Slide 12: Exceptions 5 & 6 sl = pres.addSlide(); twoCol(sl, "Exceptions (5 & 6) — Patient's Interest & Self-Interest", [ {txt:"(5) Patient's Own Interest",bold:true,color:C.accent,bullet:false}, {txt:"Signs of melancholia or suicidal tendencies"}, {txt:"Doctor discloses to parents or guardians"}, {txt:"So that proper care may be taken"}, ], [ {txt:"(6) Self-Interest",bold:true,color:C.accent,bullet:false}, {txt:"In civil or criminal actions by patient against the doctor"}, {txt:"Evidence about the patient's condition may be given"}, ] ); // Slide 13: Exception 7 — Courts sl = pres.addSlide(); contentSlide(sl, "(7) Courts of Law", [ {txt:"In a Court of law, a doctor CANNOT claim privilege if the communication is relevant to the inquiry before the Court.",bold:true,color:C.accent,bullet:false}, {txt:"Before disclosing, doctor should appeal to the Judge"}, {txt:"Doctor may request the Judge to receive information in writing (not made public)"}, {txt:"Witness should NOT voluntarily disclose information in or out of court"}, {txt:"For evidence demanded by the Court — doctor is protected from civil action against breach of confidence.",bold:true,color:C.accent,bullet:false}, {txt:"Doctor can discuss facts with other doctors and paramedical staff to provide better patient care.",bullet:false}, ]); // Slide 14: Exception 8 — Suspected Crime sl = pres.addSlide(); contentSlide(sl, "(8) Suspected Crime", [ {txt:"If doctor learns of a serious crime (murder, assault, rape, etc.) by treating victim or assailant:",bold:true,color:C.accent,bullet:false}, {txt:"He is bound to give information to the police (S.39, Cr.P.C.)"}, {txt:"Doctor treating a person with gunshot or stab wounds due to criminal assault must inform the police"}, {txt:"Doctor should first try to persuade the patient to consent before notifying the proper authority.",bullet:false}, ]); // Slide 15: Section 3 sl = pres.addSlide(); sectionSlide(sl, "PART 3", "Physician's Responsibility\nin Criminal Matters"); // Slide 16: Criminal Responsibility sl = pres.addSlide(); contentSlide(sl, "Physician's Responsibility in Criminal Matters", [ {txt:"In medicolegal cases, treatment gets priority. Thereafter procedural criminal law will operate.",bold:true,color:C.accent,bullet:false}, {txt:"A doctor aware of crimes (murder, dacoity, waging war against the Government, helping escape of prisoners) is legally bound to report to the nearest Magistrate or police officer (S.39, Cr.P.C., S.176, I.P.C.)"}, {txt:"Doctor who intentionally omits to inform police about a crime by his patient shall be punished with imprisonment up to 6 months (S.202, I.P.C.)"}, {txt:"The practitioner should hand over to police a person suspected to be an assailant in a murder case"}, {txt:"Attempted suicide: NOT legally bound to report, but if the person dies — must inform the police.",bold:true,color:C.white,bullet:false}, ]); // Slide 17: Summary table sl = pres.addSlide(); bg(sl, C.darkNavy); rect(sl, C.midBlue, 0, 0, 10, 0.75); sl.addText("Summary: 8 Exceptions (Privileged Communication)", {x:0.2,y:0.08,w:9.6,h:0.6,fontSize:20,bold:true,color:C.accent,fontFace:"Calibri"}); const tbl = [ [{text:"#",options:{bold:true,color:C.accent,fill:{color:C.midBlue}}},{text:"Exception",options:{bold:true,color:C.accent,fill:{color:C.midBlue}}},{text:"Who is Informed",options:{bold:true,color:C.accent,fill:{color:C.midBlue}}}], [{text:"1"},{text:"Infectious Diseases"},{text:"Employer"}], [{text:"2"},{text:"Venereal Diseases"},{text:"Partner / Parents / Hostel Warden"}], [{text:"3"},{text:"Servants & Employees"},{text:"Employer"}], [{text:"4"},{text:"Notifiable Diseases"},{text:"Public Health Authorities"}], [{text:"5"},{text:"Patient's Own Interest"},{text:"Parents / Guardians"}], [{text:"6"},{text:"Self-Interest"},{text:"Court"}], [{text:"7"},{text:"Courts of Law"},{text:"Judge / Court"}], [{text:"8"},{text:"Suspected Crime"},{text:"Police"}], ]; sl.addTable(tbl, {x:0.3,y:0.85,w:9.4,h:4.6,colW:[0.5,5.2,3.7],border:{pt:1,color:C.midBlue},fill:{color:C.darkNavy},fontFace:"Calibri",fontSize:13,color:C.lightText,rowH:0.44,align:"left",valign:"middle"}); // Slide 18: Takeaways sl = pres.addSlide(); bg(sl, C.darkNavy); rect(sl, C.accent, 0, 0, 10, 0.08); rect(sl, C.accent, 0, 5.545, 10, 0.08); sl.addText("Key Takeaways", {x:0.5,y:0.4,w:9,h:0.7,fontSize:28,bold:true,color:C.accent,align:"center",fontFace:"Calibri"}); const ta = [ "Professional Secrecy is an implied term of every doctor-patient contract.", "Breach is actionable — patient can sue for damages (mental suffering, shame, humiliation).", "Privileged Communication allows disclosure to protect community or State interest.", "8 recognized exceptions exist to the general rule of confidentiality.", "In criminal matters, treatment is priority but legal reporting duties follow.", "Omitting to report a crime by a patient can result in imprisonment up to 6 months (S.202 IPC).", ]; const taRuns = ta.map((text, i) => ({text, options:{bullet:{indent:20},breakLine:i<ta.length-1,fontSize:15,color:C.white}})); sl.addText(taRuns, {x:0.5,y:1.25,w:9,h:3.8,fontFace:"Calibri",valign:"top"}); sl.addText("Source: Medical Law and Ethics — The Synopsis", {x:0.5,y:5.1,w:9,h:0.4,fontSize:12,italic:true,color:C.lightText,align:"center",fontFace:"Calibri"}); const outPath = "/home/daytona/workspace/professional-secrecy/Professional_Secrecy_Privileged_Communication.pptx"; pres.writeFile({fileName: outPath}).then(() => console.log("Done:", outPath)).catch(e => console.error(e)); JSEOF

Running Command

cd /home/daytona/workspace/professional-secrecy && node ppt.js 2>&1

Your presentation is ready for download:

Professional Secrecy Privileged Communication

Presentation · PPTX


The PPT contains 18 slides organized in 3 parts:
SlidesContent
1Title slide
2Agenda / Overview
3-7Part 1: Professional Secrecy — Definition + 14 Examples
8-14Part 2: Privileged Communication — Definition + all 8 exceptions (Infectious Diseases, Venereal Diseases, Servants/Employees, Notifiable Diseases, Patient's Own Interest, Self-Interest, Courts of Law, Suspected Crime)
15-16Part 3: Physician's Criminal Responsibility
17Summary table of all 8 exceptions
18Key Takeaways
Design: Dark navy background with gold accents, clean two-column layouts for exceptions, and a professional summary table.
This is a shared conversation. Sign in to Orris to start your own chat.