ข้ามไปที่เนื้อหา

Check List Master Data

ระบบการเงิน (Financial Management System)

โรงพยาบาลค่ายธนรัชน์


เอกสารเลขที่: SRS-1.2.14-MASTERDATA
เวอร์ชัน: 1.0
วันที่: 8 ตุลาคม 2568
ผู้จัดทำ: ทีมพัฒนาระบบ
ผู้อนุมัติ: ผู้อำนวยการโรงพยาบาลค่ายธนรัชน์
การปรับปรุง: ใหม่ - เพิ่มเติมตามข้อเสนอแนะการปรับปรุงเอกสาร


🚨 การตรวจสอบความสอดคล้องกับ TOR

✅ ข้อกำหนดที่ได้รับการครอบคลุมแล้ว

  • ✅ TOR 1.2.14.1.1: ข้อมูลสิทธิการรักษา (ชื่อสิทธิ, ประเภทการชำระ, รหัส สนย.)
  • ✅ TOR 1.2.14.1.2: วันที่หมดอายุของสิทธิบัตร
  • ✅ TOR 1.2.14.1.3: ผังการคิดค่าบริการ
  • ✅ TOR 1.2.14.1.4: ส่วนลดเป็น % ในหมวดค่ารักษา OPD/IPD

⚠️ ข้อกำหนดที่ต้องเพิ่มเติม

  • 🔴 API Integration กับระบบตรวจสอบสิทธิ (1.2.15) - ต้องเชื่อมโยงข้อมูลสิทธิ
  • 🔴 การซิงค์ข้อมูลหมวดค่ารักษากับระบบอื่น - เช่น ระบบเภสัชกรรม (1.2.13)
  • 🔴 การตั้งค่า Auto-numbering ใบเสร็จ - ตาม TOR 1.2.14.3.5

สารบัญ

  1. วัตถุประสงค์เอกสาร
  2. ข้อมูลสิทธิการรักษาทางการเงิน
  3. ข้อมูลหมวดค่ารักษาพยาบาล
  4. ข้อมูลประเภทการชำระเงิน
  5. ข้อมูลการลดหย่อนและยกเว้น
  6. ข้อมูลจุดรับชำระเงิน
  7. ข้อมูลเทมเพลตใบเสร็จ
  8. ข้อมูลการเชื่อมต่อระบบภายนอก
  9. การซิงค์ข้อมูลระหว่างระบบ

1. วัตถุประสงค์เอกสาร

เอกสารนี้มีวัตถุประสงค์เพื่อรายงาน ข้อมูลหลัก (Master Data) ทั้งหมดที่จำเป็นสำหรับการทำงานของระบบการเงิน โรงพยาบาลค่ายธนรัชน์ ให้สามารถทำงานได้อย่างครบถ้วนและถูกต้องตามมาตรฐาน

ความสำคัญของ Master Data

  • การคำนวณที่ถูกต้อง: สิทธิและอัตราค่าบริการต้องถูกต้องตามระเบียบ
  • การรายงานที่สอดคล้อง: ข้อมูลต้องตรงตามมาตรฐาน 43 แฟ้ม สปสช.
  • การเชื่อมโยงระบบ: ข้อมูลต้องสอดคล้องกับระบบอื่นๆ ใน HIS
  • การตรวจสอบและควบคุม: มีระบบ Audit Trail และการอนุมัติ

2. ข้อมูลสิทธิการรักษาทางการเงิน

2.1 📊 รายการสิทธิหลัก (Main Insurance Types)

{
  "financial_rights": [
    {
      "right_id": "UC",
      "right_name": "หลักประกันสุขภาพแห่งชาติ",
      "right_name_eng": "Universal Coverage",
      "payment_type": "DRG",
      "nhso_code": "01",
      "nhso_standard_name": "หลักประกันสุขภาพแห่งชาติ",
      "copayment_amount": 30.00,
      "payment_method": "DRG",
      "coverage_percentage": 100,
      "effective_date": "2025-01-01",
      "expiry_date": null,
      "is_active": true,
      "requires_verification": true,
      "online_verification": true,
      "external_system_id": "NHSO_API"
    },
    {
      "right_id": "SS",
      "right_name": "ประกันสังคม",
      "right_name_eng": "Social Security",
      "payment_type": "FEE_FOR_SERVICE",
      "nhso_code": "02",
      "nhso_standard_name": "ประกันสังคม",
      "copayment_amount": 0.00,
      "payment_method": "FEE_FOR_SERVICE",
      "coverage_percentage": 80,
      "effective_date": "2025-01-01",
      "expiry_date": null,
      "is_active": true,
      "requires_verification": true,
      "online_verification": true,
      "external_system_id": "SSO_API"
    },
    {
      "right_id": "CS",
      "right_name": "ข้าราชการ",
      "right_name_eng": "Civil Servant",
      "payment_type": "FEE_FOR_SERVICE",
      "nhso_code": "03",
      "nhso_standard_name": "ข้าราชการ",
      "copayment_amount": 0.00,
      "payment_method": "FEE_FOR_SERVICE",
      "coverage_percentage": 90,
      "effective_date": "2025-01-01",
      "expiry_date": null,
      "is_active": true,
      "requires_verification": false,
      "online_verification": false,
      "external_system_id": "CGD_API"
    },
    {
      "right_id": "SLF",
      "right_name": "จ่ายเอง",
      "right_name_eng": "Self Payment",
      "payment_type": "SELF_PAY",
      "nhso_code": "99",
      "nhso_standard_name": "จ่ายเอง",
      "copayment_amount": 0.00,
      "payment_method": "FEE_FOR_SERVICE",
      "coverage_percentage": 0,
      "effective_date": "2025-01-01",
      "expiry_date": null,
      "is_active": true,
      "requires_verification": false,
      "online_verification": false,
      "external_system_id": null
    },
    {
      "right_id": "LGO",
      "right_name": "องค์กรปกครองส่วนท้องถิ่น",
      "right_name_eng": "Local Government",
      "payment_type": "FEE_FOR_SERVICE",
      "nhso_code": "04",
      "nhso_standard_name": "อปท.",
      "copayment_amount": 0.00,
      "payment_method": "FEE_FOR_SERVICE",
      "coverage_percentage": 85,
      "effective_date": "2025-01-01",
      "expiry_date": null,
      "is_active": true,
      "requires_verification": false,
      "online_verification": false,
      "external_system_id": null
    },
    {
      "right_id": "WCF",
      "right_name": "กองทุนเงินทดแทน",
      "right_name_eng": "Workers Compensation Fund",
      "payment_type": "FEE_FOR_SERVICE",
      "nhso_code": "05",
      "nhso_standard_name": "กองทุนเงินทดแทน",
      "copayment_amount": 0.00,
      "payment_method": "FEE_FOR_SERVICE",
      "coverage_percentage": 100,
      "effective_date": "2025-01-01",
      "expiry_date": null,
      "is_active": true,
      "requires_verification": true,
      "online_verification": false,
      "external_system_id": null
    },
    {
      "right_id": "FOR",
      "right_name": "ชาวต่างชาติ",
      "right_name_eng": "Foreigner",
      "payment_type": "SELF_PAY",
      "nhso_code": "97",
      "nhso_standard_name": "ชาวต่างชาติ",
      "copayment_amount": 0.00,
      "payment_method": "FEE_FOR_SERVICE",
      "coverage_percentage": 0,
      "effective_date": "2025-01-01",
      "expiry_date": null,
      "is_active": true,
      "requires_verification": false,
      "online_verification": false,
      "external_system_id": null
    }
  ]
}

2.2 🔧 ผังการคิดค่าบริการ (Payment Chart Configuration)

{
  "payment_charts": [
    {
      "chart_id": "UC_CHART_2025",
      "right_id": "UC",
      "category_configs": [
        {
          "category_code": "CONSULTATION",
          "calculation_method": "DRG",
          "discount_percent": 100.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_NEAREST",
          "tax_included": true
        },
        {
          "category_code": "MEDICINE",
          "calculation_method": "PERCENTAGE",
          "discount_percent": 90.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": 5000.00,
          "rounding_rule": "ROUND_UP",
          "tax_included": true
        },
        {
          "category_code": "LABORATORY",
          "calculation_method": "DRG",
          "discount_percent": 100.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_NEAREST",
          "tax_included": true
        },
        {
          "category_code": "XRAY",
          "calculation_method": "DRG",
          "discount_percent": 100.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_NEAREST",
          "tax_included": true
        },
        {
          "category_code": "ROOM",
          "calculation_method": "DRG",
          "discount_percent": 100.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_NEAREST",
          "tax_included": true
        }
      ]
    },
    {
      "chart_id": "SS_CHART_2025",
      "right_id": "SS",
      "category_configs": [
        {
          "category_code": "CONSULTATION",
          "calculation_method": "PERCENTAGE",
          "discount_percent": 80.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_NEAREST",
          "tax_included": true
        },
        {
          "category_code": "MEDICINE",
          "calculation_method": "PERCENTAGE",
          "discount_percent": 80.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_UP",
          "tax_included": true
        },
        {
          "category_code": "LABORATORY",
          "calculation_method": "PERCENTAGE",
          "discount_percent": 80.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_NEAREST",
          "tax_included": true
        }
      ]
    },
    {
      "chart_id": "CS_CHART_2025",
      "right_id": "CS",
      "category_configs": [
        {
          "category_code": "CONSULTATION",
          "calculation_method": "PERCENTAGE",
          "discount_percent": 90.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_NEAREST",
          "tax_included": true
        },
        {
          "category_code": "MEDICINE",
          "calculation_method": "PERCENTAGE",
          "discount_percent": 90.00,
          "fixed_amount": 0.00,
          "minimum_amount": 0.00,
          "maximum_amount": null,
          "rounding_rule": "ROUND_UP",
          "tax_included": true
        }
      ]
    }
  ]
}

3. ข้อมูลหมวดค่ารักษาพยาบาล

3.1 📋 หมวดค่ารักษาหลัก (Medical Categories)

{
  "financial_categories": [
    {
      "category_code": "CONSULTATION",
      "category_name": "ค่าตรวจรักษา",
      "category_name_eng": "Consultation Fee",
      "category_type": "BOTH",
      "parent_category_code": null,
      "display_order": 1,
      "is_chargeable": true,
      "nhso_category_code": "01",
      "description": "ค่าบริการการตรวจรักษาโดยแพทย์และพยาบาล",
      "default_price": 150.00,
      "price_range": {
        "min": 100.00,
        "max": 500.00
      }
    },
    {
      "category_code": "MEDICINE",
      "category_name": "ค่ายา",
      "category_name_eng": "Medicine",
      "category_type": "BOTH",
      "parent_category_code": null,
      "display_order": 2,
      "is_chargeable": true,
      "nhso_category_code": "02",
      "description": "ค่ายาและเวชภัณฑ์ที่จ่ายให้ผู้ป่วย",
      "default_price": null,
      "price_range": {
        "min": 5.00,
        "max": 50000.00
      }
    },
    {
      "category_code": "LABORATORY",
      "category_name": "ค่าตรวจทางห้องปฏิบัติการ",
      "category_name_eng": "Laboratory",
      "category_type": "BOTH",
      "parent_category_code": null,
      "display_order": 3,
      "is_chargeable": true,
      "nhso_category_code": "03",
      "description": "ค่าตรวจเลือด ปัสสาวะ และสิ่งส่งตรวจอื่นๆ",
      "default_price": 200.00,
      "price_range": {
        "min": 50.00,
        "max": 5000.00
      }
    },
    {
      "category_code": "XRAY",
      "category_name": "ค่าตรวจเอกซเรย์",
      "category_name_eng": "X-Ray",
      "category_type": "BOTH",
      "parent_category_code": null,
      "display_order": 4,
      "is_chargeable": true,
      "nhso_category_code": "04",
      "description": "ค่าถ่ายภาพรังสีและการวินิจฉัยด้วยภาพ",
      "default_price": 300.00,
      "price_range": {
        "min": 200.00,
        "max": 3000.00
      }
    },
    {
      "category_code": "ROOM",
      "category_name": "ค่าห้อง",
      "category_name_eng": "Room",
      "category_type": "IPD",
      "parent_category_code": null,
      "display_order": 5,
      "is_chargeable": true,
      "nhso_category_code": "05",
      "description": "ค่าห้องพักผู้ป่วยใน รายวัน",
      "default_price": 800.00,
      "price_range": {
        "min": 500.00,
        "max": 5000.00
      }
    },
    {
      "category_code": "SURGERY",
      "category_name": "ค่าผ่าตัด",
      "category_name_eng": "Surgery",
      "category_type": "BOTH",
      "parent_category_code": null,
      "display_order": 6,
      "is_chargeable": true,
      "nhso_category_code": "06",
      "description": "ค่าการผ่าตัดและหัตถการทางการแพทย์",
      "default_price": 5000.00,
      "price_range": {
        "min": 1000.00,
        "max": 100000.00
      }
    },
    {
      "category_code": "SUPPLIES",
      "category_name": "ค่าเวชภัณฑ์",
      "category_name_eng": "Medical Supplies",
      "category_type": "BOTH",
      "parent_category_code": null,
      "display_order": 7,
      "is_chargeable": true,
      "nhso_category_code": "07",
      "description": "ค่าเวชภัณฑ์และอุปกรณ์การแพทย์",
      "default_price": null,
      "price_range": {
        "min": 10.00,
        "max": 10000.00
      }
    },
    {
      "category_code": "EMERGENCY",
      "category_name": "ค่าฉุกเฉิน",
      "category_name_eng": "Emergency",
      "category_type": "OPD",
      "parent_category_code": null,
      "display_order": 8,
      "is_chargeable": true,
      "nhso_category_code": "08",
      "description": "ค่าบริการแผนกฉุกเฉิน",
      "default_price": 200.00,
      "price_range": {
        "min": 150.00,
        "max": 1000.00
      }
    }
  ]
}

3.2 🔧 หมวดย่อย (Sub-Categories)

{
  "sub_categories": [
    {
      "category_code": "LAB_BLOOD",
      "category_name": "ตรวจเลือด",
      "parent_category_code": "LABORATORY",
      "display_order": 1,
      "nhso_category_code": "03.01",
      "services": [
        {"code": "CBC", "name": "ตรวจนับเม็ดเลือด", "price": 120.00},
        {"code": "BUN", "name": "ตรวจยูเรียไนโตรเจน", "price": 80.00},
        {"code": "CREATININE", "name": "ตรวจครีเอตินิน", "price": 90.00},
        {"code": "FBS", "name": "ตรวจน้ำตาลในเลือด", "price": 70.00}
      ]
    },
    {
      "category_code": "LAB_URINE",
      "category_name": "ตรวจปัสสาวะ",
      "parent_category_code": "LABORATORY",
      "display_order": 2,
      "nhso_category_code": "03.02",
      "services": [
        {"code": "UA", "name": "ตรวจปัสสาวะทั่วไป", "price": 50.00},
        {"code": "URINE_MICRO", "name": "ตรวจจุลินทรีย์ในปัสสาวะ", "price": 100.00}
      ]
    }
  ]
}

4. ข้อมูลประเภทการชำระเงิน

4.1 💳 วิธีการชำระเงิน (Payment Methods)

{
  "payment_methods": [
    {
      "method_code": "CASH",
      "method_name": "เงินสด",
      "method_name_eng": "Cash",
      "is_active": true,
      "requires_change": true,
      "requires_approval": false,
      "display_order": 1,
      "icon": "💵",
      "max_amount": 50000.00,
      "min_amount": 0.01
    },
    {
      "method_code": "CARD",
      "method_name": "บัตรเครดิต/เดบิต",
      "method_name_eng": "Credit/Debit Card",
      "is_active": true,
      "requires_change": false,
      "requires_approval": false,
      "display_order": 2,
      "icon": "💳",
      "max_amount": 500000.00,
      "min_amount": 20.00,
      "supported_cards": ["VISA", "MASTERCARD", "JCB", "AMEX"]
    },
    {
      "method_code": "TRANSFER",
      "method_name": "เงินโอน",
      "method_name_eng": "Bank Transfer",
      "is_active": true,
      "requires_change": false,
      "requires_approval": false,
      "display_order": 3,
      "icon": "🏦",
      "max_amount": 1000000.00,
      "min_amount": 100.00
    },
    {
      "method_code": "QR",
      "method_name": "QR Code PromptPay",
      "method_name_eng": "QR Code Payment",
      "is_active": true,
      "requires_change": false,
      "requires_approval": false,
      "display_order": 4,
      "icon": "📱",
      "max_amount": 50000.00,
      "min_amount": 1.00
    },
    {
      "method_code": "DEPOSIT",
      "method_name": "หักเงินรับฝาก",
      "method_name_eng": "Deduct from Deposit",
      "is_active": true,
      "requires_change": false,
      "requires_approval": false,
      "display_order": 5,
      "icon": "💰",
      "max_amount": 999999.99,
      "min_amount": 0.01
    },
    {
      "method_code": "RIGHTS",
      "method_name": "หักสิทธิการรักษา",
      "method_name_eng": "Insurance Coverage",
      "is_active": true,
      "requires_change": false,
      "requires_approval": false,
      "display_order": 6,
      "icon": "🆔",
      "max_amount": 999999.99,
      "min_amount": 0.01
    }
  ]
}

4.2 🏪 การตั้งค่าจุดรับชำระเงิน (Terminal Payment Config)

{
  "terminal_payment_config": [
    {
      "terminal_id": "TERM001",
      "terminal_name": "เคาน์เตอร์หลัก",
      "location": "ชั้น 1 อาคารผู้ป่วยนอก",
      "allowed_methods": ["CASH", "CARD", "QR", "TRANSFER", "DEPOSIT", "RIGHTS"],
      "cash_limit": 50000.00,
      "requires_supervisor_approval": false,
      "default_printer": "THERMAL_001",
      "backup_printer": "LASER_001"
    },
    {
      "terminal_id": "TERM002",
      "terminal_name": "เคาน์เตอร์เร่งด่วน",
      "location": "ชั้น 1 หน้าแผนกฉุกเฉิน",
      "allowed_methods": ["CASH", "QR", "RIGHTS"],
      "cash_limit": 10000.00,
      "requires_supervisor_approval": true,
      "default_printer": "THERMAL_002"
    },
    {
      "terminal_id": "TERM003",
      "terminal_name": "จุดเคลื่อนที่",
      "location": "Tablet เคลื่อนที่",
      "allowed_methods": ["QR", "CARD"],
      "cash_limit": 0.00,
      "requires_supervisor_approval": false,
      "default_printer": "MOBILE_PRINTER"
    }
  ]
}

5. ข้อมูลการลดหย่อนและยกเว้น

5.1 🏷️ ประเภทส่วนลด (Discount Types)

{
  "discount_types": [
    {
      "discount_type_code": "STAFF_DISCOUNT",
      "discount_type_name": "ส่วนลดพนักงาน",
      "discount_category": "DISCOUNT",
      "calculation_method": "PERCENTAGE",
      "default_percent": 10.00,
      "max_discount_percent": 20.00,
      "requires_approval": false,
      "approval_level": 0,
      "is_active": true,
      "applicable_categories": ["CONSULTATION", "MEDICINE", "LABORATORY"]
    },
    {
      "discount_type_code": "SENIOR_DISCOUNT",
      "discount_type_name": "ส่วนลดผู้สูงอายุ",
      "discount_category": "DISCOUNT",
      "calculation_method": "PERCENTAGE",
      "default_percent": 5.00,
      "max_discount_percent": 10.00,
      "requires_approval": false,
      "approval_level": 0,
      "is_active": true,
      "applicable_categories": ["CONSULTATION"]
    },
    {
      "discount_type_code": "HARDSHIP",
      "discount_type_name": "ยกเว้นผู้ยากไร้",
      "discount_category": "EXEMPTION",
      "calculation_method": "FULL_EXEMPTION",
      "default_percent": 100.00,
      "max_discount_percent": 100.00,
      "requires_approval": true,
      "approval_level": 2,
      "is_active": true,
      "applicable_categories": ["ALL"]
    },
    {
      "discount_type_code": "EMERGENCY_WAIVER",
      "discount_type_name": "ยกเว้นกรณีฉุกเฉิน",
      "discount_category": "EXEMPTION",
      "calculation_method": "PERCENTAGE",
      "default_percent": 50.00,
      "max_discount_percent": 100.00,
      "requires_approval": true,
      "approval_level": 1,
      "is_active": true,
      "applicable_categories": ["EMERGENCY", "CONSULTATION"]
    },
    {
      "discount_type_code": "BULK_DISCOUNT",
      "discount_type_name": "ส่วนลดรายการเยอะ",
      "discount_category": "SPECIAL",
      "calculation_method": "FIXED_AMOUNT",
      "default_amount": 500.00,
      "max_discount_amount": 2000.00,
      "requires_approval": false,
      "approval_level": 0,
      "is_active": true,
      "conditions": {
        "min_items": 5,
        "min_amount": 2000.00
      }
    }
  ]
}

5.2 👨‍💼 ระดับการอนุมัติ (Approval Levels)

{
  "approval_levels": [
    {
      "level": 0,
      "name": "ไม่ต้องอนุมัติ",
      "max_amount": 500.00,
      "max_percentage": 10.00,
      "approvers": []
    },
    {
      "level": 1,
      "name": "หัวหน้าการเงิน",
      "max_amount": 5000.00,
      "max_percentage": 50.00,
      "approvers": ["FINANCE_SUPERVISOR", "FINANCE_MANAGER"]
    },
    {
      "level": 2,
      "name": "ผู้อำนวยการ",
      "max_amount": 50000.00,
      "max_percentage": 100.00,
      "approvers": ["HOSPITAL_DIRECTOR", "DEPUTY_DIRECTOR"]
    },
    {
      "level": 3,
      "name": "คณะกรรมการ",
      "max_amount": 999999.99,
      "max_percentage": 100.00,
      "approvers": ["BOARD_COMMITTEE"]
    }
  ]
}

6. ข้อมูลจุดรับชำระเงิน

6.1 🖥️ ข้อมูลจุดรับชำระ (Payment Terminals)

{
  "payment_terminals": [
    {
      "terminal_id": "TERM001",
      "terminal_name": "เคาน์เตอร์หลัก",
      "terminal_code": "MAIN_COUNTER",
      "location": "ชั้น 1 อาคารผู้ป่วยนอก",
      "department": "การเงิน",
      "terminal_type": "DESKTOP",
      "ip_address": "192.168.1.101",
      "mac_address": "00:1B:44:11:3A:B7",
      "is_active": true,
      "operating_hours": {
        "monday": {"open": "08:00", "close": "16:30"},
        "tuesday": {"open": "08:00", "close": "16:30"},
        "wednesday": {"open": "08:00", "close": "16:30"},
        "thursday": {"open": "08:00", "close": "16:30"},
        "friday": {"open": "08:00", "close": "16:30"},
        "saturday": {"open": "08:00", "close": "12:00"},
        "sunday": {"open": null, "close": null}
      },
      "hardware": {
        "thermal_printer": "EPSON_TM_T88V",
        "laser_printer": "HP_LASERJET_P1102W",
        "cash_drawer": "EPSON_DM_D110",
        "card_reader": "INGENICO_ICT250",
        "barcode_scanner": "HONEYWELL_1250G"
      },
      "receipt_settings": {
        "default_format": "STANDARD_TH",
        "paper_width": "80mm",
        "auto_cut": true,
        "logo": true
      }
    },
    {
      "terminal_id": "TERM002",
      "terminal_name": "เคาน์เตอร์เร่งด่วน",
      "terminal_code": "EXPRESS_COUNTER",
      "location": "ชั้น 1 หน้าแผนกฉุกเฉิน",
      "department": "ฉุกเฉิน",
      "terminal_type": "DESKTOP",
      "ip_address": "192.168.1.102",
      "is_active": true,
      "operating_hours": {
        "all_days": {"open": "00:00", "close": "23:59"}
      },
      "hardware": {
        "thermal_printer": "EPSON_TM_T20II",
        "cash_drawer": "STAR_CD_3_1616",
        "card_reader": "SUMUP_AIR"
      }
    },
    {
      "terminal_id": "TERM003",
      "terminal_name": "จุดเคลื่อนที่ - แท็บเล็ต",
      "terminal_code": "MOBILE_TAB01",
      "location": "เคลื่อนที่ตามสถานการณ์",
      "department": "การเงิน",
      "terminal_type": "MOBILE",
      "device_id": "TABLET_SAMSUNG_A8",
      "is_active": true,
      "operating_hours": {
        "all_days": {"open": "08:00", "close": "20:00"}
      },
      "hardware": {
        "mobile_printer": "ZEBRA_ZQ520",
        "card_reader": "SQUARE_READER"
      }
    }
  ]
}

6.2 💵 การตั้งค่าลิ้นชักเงิน (Cash Drawer Settings)

{
  "cash_drawer_config": [
    {
      "terminal_id": "TERM001",
      "drawer_slots": [
        {"denomination": 1000, "slot": 1, "max_count": 20},
        {"denomination": 500, "slot": 2, "max_count": 30},
        {"denomination": 100, "slot": 3, "max_count": 50},
        {"denomination": 50, "slot": 4, "max_count": 40},
        {"denomination": 20, "slot": 5, "max_count": 50},
        {"denomination": 10, "slot": 6, "max_count": 30},
        {"denomination": 5, "slot": 7, "max_count": 20},
        {"denomination": 1, "slot": 8, "max_count": 50}
      ],
      "opening_balance": 5000.00,
      "max_balance": 50000.00,
      "alert_threshold": 45000.00
    }
  ]
}

7. ข้อมูลเทมเพลตใบเสร็จ

7.1 🧾 รูปแบบใบเสร็จ (Receipt Formats)

{
  "receipt_formats": [
    {
      "format_id": "STANDARD_TH",
      "format_name": "ใบเสร็จมาตรฐาน (ภาษาไทย)",
      "language": "TH",
      "paper_size": "80mm",
      "template": {
        "header": {
          "hospital_name": "โรงพยาบาลค่ายธนรัชน์",
          "hospital_name_eng": "THANARAT MILITARY HOSPITAL",
          "address": "123 ถนนราชวิถี แขวงดุสิต เขตดุสิต กรุงเทพมหานคร 10300",
          "phone": "02-xxx-xxxx",
          "tax_id": "0994000158378",
          "logo": true
        },
        "title": "ใบเสร็จรับเงิน",
        "title_eng": "RECEIPT",
        "fields": [
          "receipt_number",
          "datetime",
          "cashier",
          "terminal",
          "patient_info",
          "service_items",
          "payment_summary",
          "payment_methods",
          "signature",
          "barcode",
          "footer_message"
        ]
      }
    },
    {
      "format_id": "STANDARD_EN",
      "format_name": "Standard Receipt (English)",
      "language": "EN",
      "paper_size": "80mm",
      "template": {
        "header": {
          "hospital_name": "THANARAT MILITARY HOSPITAL",
          "hospital_name_th": "โรงพยาบาลค่ายธนรัชน์",
          "address": "123 Ratchavithi Road, Dusit, Dusit, Bangkok 10300",
          "phone": "02-xxx-xxxx",
          "tax_id": "0994000158378",
          "logo": true
        },
        "title": "OFFICIAL RECEIPT",
        "title_th": "ใบเสร็จรับเงิน",
        "fields": [
          "receipt_number",
          "datetime",
          "cashier",
          "terminal",
          "patient_info",
          "service_items",
          "payment_summary",
          "payment_methods",
          "signature",
          "barcode",
          "footer_message"
        ]
      }
    },
    {
      "format_id": "DEPOSIT_RECEIPT",
      "format_name": "ใบรับฝากเงิน",
      "language": "TH",
      "paper_size": "80mm",
      "template": {
        "title": "ใบรับฝากเงิน (มัดจำ)",
        "title_eng": "DEPOSIT RECEIPT",
        "special_fields": [
          "deposit_type",
          "deposit_purpose",
          "deposit_amount",
          "depositor_name",
          "relationship"
        ]
      }
    }
  ]
}

7.2 📄 เทมเพลตใบแจ้งหนี้ (Invoice Templates)

{
  "invoice_templates": [
    {
      "template_id": "STANDARD_INVOICE",
      "template_name": "ใบแจ้งหนี้มาตรฐาน",
      "usage": "OPD",
      "paper_size": "A4",
      "layout": {
        "header_height": "3cm",
        "footer_height": "2cm",
        "margins": {
          "top": "1cm",
          "bottom": "1cm",
          "left": "1cm",
          "right": "1cm"
        }
      },
      "sections": [
        "hospital_header",
        "invoice_details",
        "patient_information",
        "service_breakdown",
        "payment_calculation",
        "payment_instructions",
        "terms_conditions"
      ]
    },
    {
      "template_id": "IPD_BILL_SUMMARY",
      "template_name": "ใบสรุปหน้างบผู้ป่วยใน",
      "usage": "IPD",
      "paper_size": "A4",
      "sections": [
        "patient_admission_info",
        "daily_charges_summary",
        "total_by_category",
        "insurance_calculation",
        "payment_breakdown",
        "discharge_summary"
      ]
    }
  ]
}

8. ข้อมูลการเชื่อมต่อระบบภายนอก

8.1 🌐 API Configuration

{
  "external_apis": [
    {
      "api_id": "NHSO_API",
      "api_name": "สำนักงานหลักประกันสุขภาพแห่งชาติ",
      "base_url": "https://api.nhso.go.th/",
      "version": "v2.0",
      "endpoints": {
        "verify_rights": "/eligibility/verify",
        "submit_claims": "/claims/submit",
        "check_status": "/claims/status",
        "download_drg": "/drg/download"
      },
      "authentication": {
        "type": "API_KEY",
        "key_header": "X-API-Key",
        "secret_header": "X-API-Secret"
      },
      "timeout": 30,
      "retry_attempts": 3,
      "is_active": true
    },
    {
      "api_id": "SSO_API",
      "api_name": "สำนักงานประกันสังคม",
      "base_url": "https://api.sso.go.th/",
      "version": "v1.0",
      "endpoints": {
        "verify_member": "/member/verify",
        "get_benefits": "/benefits/inquiry",
        "submit_claim": "/claims/submit"
      },
      "authentication": {
        "type": "OAUTH2",
        "token_url": "/oauth/token",
        "client_id": "hospital_client_id",
        "scopes": ["read:member", "write:claim"]
      },
      "timeout": 25,
      "retry_attempts": 2,
      "is_active": true
    },
    {
      "api_id": "CGD_API",
      "api_name": "กรมบัญชีกลาง",
      "base_url": "https://api.cgd.go.th/",
      "version": "v1.0",
      "endpoints": {
        "verify_officer": "/officer/verify",
        "get_quota": "/quota/inquiry",
        "submit_claim": "/claims/submit"
      },
      "authentication": {
        "type": "CERTIFICATE",
        "cert_file": "cgd_hospital.crt",
        "key_file": "cgd_hospital.key"
      },
      "timeout": 20,
      "retry_attempts": 2,
      "is_active": true
    },
    {
      "api_id": "BANK_API",
      "api_name": "ธนาคารพาณิชย์ (EDC)",
      "base_url": "https://payment.bank.co.th/",
      "version": "v3.0",
      "endpoints": {
        "process_payment": "/payment/process",
        "void_transaction": "/payment/void",
        "settlement": "/settlement/batch"
      },
      "authentication": {
        "type": "API_KEY",
        "merchant_id": "HOSPITAL_MERCHANT_ID",
        "terminal_id": "HOSPITAL_TERMINAL_ID"
      },
      "timeout": 60,
      "retry_attempts": 1,
      "is_active": true
    }
  ]
}

8.2 🔄 การซิงค์ข้อมูล (Data Sync Configuration)

{
  "sync_schedules": [
    {
      "sync_id": "DAILY_NHSO_DRG",
      "name": "ซิงค์ข้อมูล DRG รายวัน",
      "api_id": "NHSO_API",
      "frequency": "DAILY",
      "time": "02:00",
      "data_type": "DRG_RATES",
      "auto_apply": true,
      "backup_before_sync": true
    },
    {
      "sync_id": "MONTHLY_RIGHTS_UPDATE",
      "name": "อัปเดตข้อมูลสิทธิรายเดือน",
      "api_id": "NHSO_API",
      "frequency": "MONTHLY",
      "day": 1,
      "time": "01:00",
      "data_type": "RIGHTS_MASTER",
      "auto_apply": false,
      "requires_approval": true
    },
    {
      "sync_id": "REAL_TIME_VERIFICATION",
      "name": "ตรวจสอบสิทธิ Real-time",
      "frequency": "ON_DEMAND",
      "data_type": "RIGHTS_VERIFICATION",
      "cache_duration": 300,
      "fallback_mode": "OFFLINE_CACHE"
    }
  ]
}

🔧 การติดตั้งและการกำหนดค่าเริ่มต้น

Initial Data Setup Script

-- เพิ่มข้อมูลสิทธิการรักษาเริ่มต้น
INSERT INTO FINANCIAL_RIGHTS (RightID, RightName, PaymentTypeCode, NHSO_Code, CopaymentAmount) VALUES
('UC', 'หลักประกันสุขภาพแห่งชาติ', 'DRG', '01', 30.00),
('SS', 'ประกันสังคม', 'FFS', '02', 0.00),
('CS', 'ข้าราชการ', 'FFS', '03', 0.00),
('SLF', 'จ่ายเอง', 'SELF', '99', 0.00);

-- เพิ่มหมวดค่ารักษา
INSERT INTO FINANCIAL_CATEGORY (CategoryCode, CategoryName, CategoryType, IsChargeable) VALUES
('CONSULTATION', 'ค่าตรวจรักษา', 'BOTH', 1),
('MEDICINE', 'ค่ายา', 'BOTH', 1),
('LABORATORY', 'ค่าตรวจทางห้องปฏิบัติการ', 'BOTH', 1),
('XRAY', 'ค่าตรวจเอกซเรย์', 'BOTH', 1),
('ROOM', 'ค่าห้อง', 'IPD', 1);

-- เพิ่มจุดรับชำระเงิน
INSERT INTO PAYMENT_TERMINAL (TerminalID, TerminalName, Location, IsActive) VALUES
('TERM001', 'เคาน์เตอร์หลัก', 'ชั้น 1 อาคารผู้ป่วยนอก', 1),
('TERM002', 'เคาน์เตอร์เร่งด่วน', 'ชั้น 1 หน้าแผนกฉุกเฉิน', 1);

9. การซิงค์ข้อมูลระหว่างระบบ

9.1 🔗 API Integration Requirements

การเชื่อมต่อกับระบบตรวจสอบสิทธิ (1.2.15)

{
  "rights_sync_api": {
    "endpoint": "/api/rights/sync",
    "method": "GET",
    "purpose": "ดึงข้อมูลสิทธิล่าสุดจากระบบตรวจสอบสิทธิ",
    "schedule": "daily_00:00",
    "fields_mapping": {
      "rights_id": "right_id",
      "rights_name": "right_name", 
      "nhso_code": "nhso_code",
      "payment_type": "payment_type",
      "copayment_amount": "copayment_amount",
      "coverage_percentage": "coverage_percentage"
    }
  }
}

การเชื่อมต่อกับระบบเภสัชกรรม (1.2.13)

{
  "medicine_category_sync": {
    "endpoint": "/api/medicine/categories",
    "method": "GET", 
    "purpose": "ซิงค์หมวดค่ายาและเวชภัณฑ์",
    "schedule": "hourly",
    "auto_create_categories": true
  }
}

9.2 📋 ข้อมูล Auto-numbering ตาม TOR 1.2.14.3.5

การกำหนดรูปแบบเลขที่ใบเสร็จ

{
  "receipt_numbering": [
    {
      "terminal_id": "TERM001",
      "prefix": "RC",
      "date_format": "YYYYMMDD",
      "sequence_format": "000000",
      "sample": "RC20251008000001",
      "reset_period": "daily"
    },
    {
      "terminal_id": "TERM002", 
      "prefix": "ER",
      "date_format": "YYYYMMDD",
      "sequence_format": "000000",
      "sample": "ER20251008000001",
      "reset_period": "daily"
    }
  ]
}

สรุป

เอกสาร Check List Master Data นี้ได้รวบรวมข้อมูลหลักทั้งหมดที่จำเป็นสำหรับการทำงานของระบบการเงิน โดยครอบคลุม:

ข้อมูลสิทธิการรักษา - ครบถ้วนตามมาตรฐาน 43 แฟ้ม
ผังการคิดค่าบริการ - รองรับทุกสิทธิและหมวดค่ารักษา
หมวดค่ารักษาพยาบาล - แยกประเภท OPD/IPD ชัดเจน
ประเภทการชำระเงิน - รองรับทุกรูปแบบการชำระ
การลดหย่อนและยกเว้น - มีระบบอนุมัติและ Audit Trail
จุดรับชำระเงิน - จัดการหลายจุดและหลายประเภทผู้ป่วย
เทมเพลตใบเสร็จ - รองรับภาษาไทยและอังกฤษ
การเชื่อมต่อระบบภายนอก - API สำหรับระบบ สปสช., ประกันสังคม
🔄 การซิงค์ข้อมูลระหว่างระบบ - เชื่อมโยงกับระบบอื่นใน HIS

🎯 ข้อแนะนำการพัฒนา

  1. ให้ความสำคัญกับการซิงค์ข้อมูล - ระบบการเงินต้องดึงข้อมูลสิทธิจากระบบตรวจสอบสิทธิ
  2. ทดสอบการทำงานแบบ Real-time - เมื่อมีการเปลี่ยนแปลงข้อมูลสิทธิ
  3. สำรองข้อมูลและ Rollback - กรณีซิงค์ข้อมูลผิดพลาด
  4. Monitor และ Alert - แจ้งเตือนเมื่อการซิงค์ข้อมูลล้มเหลว

หมายเหตุ: Master Data เหล่านี้เป็นข้อมูลตัวอย่าง โรงพยาบาลค่ายธนรัชน์สามารถปรับแต่งให้เหมาะสมกับความต้องการจริงได้