File size: 7,645 Bytes
cdacbba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html lang="th">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>สร้างคำเบิกยาใหม่ | MedTrackRx</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-50">
    <custom-navbar></custom-navbar>
    
    <main class="container mx-auto px-4 py-8">
        <div class="flex items-center mb-6">
            <a href="/" class="text-indigo-600 hover:text-indigo-800 mr-2">
                <i data-feather="home"></i>
            </a>
            <i data-feather="chevron-right" class="text-gray-400 mx-2"></i>
            <h1 class="text-2xl font-bold text-gray-800">สร้างคำเบิกยาใหม่</h1>
        </div>
        
        <div class="bg-white rounded-lg shadow-md p-6">
            <form id="medRequestForm">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
                    <div>
                        <h2 class="text-xl font-semibold mb-4 text-gray-800">ข้อมูลผู้ป่วย</h2>
                        
                        <div class="mb-4">
                            <label for="patientId" class="block text-sm font-medium text-gray-700 mb-1">เลขประจำตัวผู้ป่วย</label>
                            <input type="text" id="patientId" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
                        </div>
                        
                        <div class="mb-4">
                            <label for="patientName" class="block text-sm font-medium text-gray-700 mb-1">ชื่อ-สกุลผู้ป่วย</label>
                            <input type="text" id="patientName" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
                        </div>
                        
                        <div class="mb-4">
                            <label for="patientWard" class="block text-sm font-medium text-gray-700 mb-1">แผนก/หอผู้ป่วย</label>
                            <select id="patientWard" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
                                <option value="">เลือกแผนก</option>
                                <option value="ward1">หอผู้ป่วยศัลยกรรม</option>
                                <option value="ward2">หอผู้ป่วยอายุรกรรม</option>
                                <option value="ward3">หอผู้ป่วยกุมารเวชกรรม</option>
                                <option value="ward4">หอผู้ป่วย ICU</option>
                            </select>
                        </div>
                    </div>
                    
                    <div>
                        <h2 class="text-xl font-semibold mb-4 text-gray-800">ข้อมูลแพทย์ผู้สั่งจ่าย</h2>
                        
                        <div class="mb-4">
                            <label for="doctorId" class="block text-sm font-medium text-gray-700 mb-1">รหัสแพทย์</label>
                            <input type="text" id="doctorId" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
                        </div>
                        
                        <div class="mb-4">
                            <label for="doctorName" class="block text-sm font-medium text-gray-700 mb-1">ชื่อแพทย์ผู้สั่งจ่าย</label>
                            <input type="text" id="doctorName" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
                        </div>
                        
                        <div class="mb-4">
                            <label for="requestDate" class="block text-sm font-medium text-gray-700 mb-1">วันที่สั่งจ่าย</label>
                            <input type="date" id="requestDate" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" required>
                        </div>
                    </div>
                </div>
                
                <div class="mb-8">
                    <h2 class="text-xl font-semibold mb-4 text-gray-800">รายการยา</h2>
                    
                    <div id="medicationItems" class="space-y-4">
                        <!-- Medication items will be added here -->
                        <div class="medication-item bg-gray-50 p-4 rounded-lg border border-gray-200">
                            <div class="grid grid-cols-1 md:grid-cols-4 gap-4">
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">ชื่อยา</label>
                                    <select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 medication-name" required>
                                        <option value="">เลือกยา</option>
                                        <option value="morphine">Morphine</option>
                                        <option value="fentanyl">Fentanyl</option>
                                        <option value="oxycodone">Oxycodone</option>
                                        <option value="methadone">Methadone</option>
                                        <option value="codeine">Codeine</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">ปริมาณ</label>
                                    <input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 medication-dose" required>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">หน่วย</label>
                                    <select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 medication-unit" required>
                                        <option value="mg">mg</option>
                                        <option value="ml">ml</option>
                                        <option value="tablet">เม็ด</option>
                                        <option value="ampoule">แอมพูล</option>
                                    </select>
                                </div>
                                <{"ok":false,"message":"Request timeout: The AI model took too long to respond. Please try again with a simpler prompt or try a different model."}
</body>
</html>