Initial commit

This commit is contained in:
Porawit Dongwang
2026-09-16 23:20:08 +07:00
commit 0041668dbb
32577 changed files with 3687927 additions and 0 deletions
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TTMQMS Enterprise - API Swagger UI</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui.css" />
<link rel="icon" type="image/png" href="https://unpkg.com/swagger-ui-dist@5.11.0/favicon-32x32.png" />
<style>
html { box-sizing: border-box; overflow: -moz-scrollbars-vertical; overflow-y: scroll; }
*, *:before, *:after { box-sizing: inherit; }
body { margin:0; background: #0f172a; }
.swagger-ui .topbar { background-color: #064e3b; border-bottom: 2px solid #10b981; }
.swagger-ui .info .title { color: #10b981; }
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-bundle.js" charset="UTF-8"></script>
<script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-standalone-preset.js" charset="UTF-8"></script>
<script>
window.onload = function() {
const ui = SwaggerUIBundle({
url: "/api-docs/openapi.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
window.ui = ui;
};
</script>
</body>
</html>
@@ -0,0 +1,151 @@
{
"openapi": "3.0.3",
"info": {
"title": "TTMQMS Enterprise REST API Specification",
"description": "API Specification สำหรับระบบบริหารจัดการคิวนวดแผนไทย (Thai Traditional Massage Queue Management System) เชื่อมต่อ AI, Smart Card, ESC/POS Printer และ HIS FHIR R4",
"version": "1.0.0",
"contact": {
"name": "Antigravity AI Engineering Team",
"email": "support@ttmqms.hospital.go.th"
}
},
"servers": [
{
"url": "https://ttmqms.hospital.go.th/api/v1",
"description": "Production Server (Hospital DMZ)"
},
{
"url": "http://localhost:8000/api/v1",
"description": "Local Development Server"
}
],
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
"security": [
{ "BearerAuth": [] }
],
"paths": {
"/auth/login": {
"post": {
"summary": "เข้าสู่ระบบและรับ JWT Token",
"security": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"username": { "type": "string", "example": "1100000000001" },
"password": { "type": "string", "example": "SecurePassword@2026" },
"totp_code": { "type": "string", "example": "123456" }
}
}
}
}
},
"responses": {
"200": { "description": "เข้าสู่ระบบสำเร็จ คืนค่า JWT Token" },
"401": { "description": "รหัสผ่านหรือรหัส 2FA ไม่ถูกต้อง" }
}
}
},
"/queues/walkin": {
"post": {
"summary": "ลงทะเบียนคิวใหม่และจัดสรรหมอนวดด้วย Smart Queue AI",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"branch_id": { "type": "integer", "example": 1 },
"patient_id": { "type": "integer", "example": 1 },
"service_id": { "type": "integer", "example": 2 },
"priority": { "type": "string", "enum": ["Normal", "VIP", "Emergency"], "example": "Normal" }
}
}
}
}
},
"responses": {
"200": { "description": "จัดสรรคิวสำเร็จ พร้อมระบุห้องและหมอนวด" }
}
}
},
"/queues": {
"get": {
"summary": "ดึงรายการคิวประจำวัน (สำหรับ Queue Board / Smart TV)",
"parameters": [
{ "name": "branch_id", "in": "query", "required": false, "schema": { "type": "integer", "default": 1 } },
{ "name": "status", "in": "query", "required": false, "schema": { "type": "string", "example": "Waiting,Assigned,In_Progress" } }
],
"responses": {
"200": { "description": "ดึงรายการคิวสำเร็จ" }
}
}
},
"/clinical/soap": {
"post": {
"summary": "บันทึกเวชระเบียน SOAP Note พร้อมลายเซ็นและส่ง Sync HIS FHIR",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"queue_id": { "type": "integer", "example": 15 },
"patient_id": { "type": "integer", "example": 1 },
"subjective": { "type": "string", "example": "ปวดหลังและต้นคอมา 3 วัน" },
"objective_vas_pre": { "type": "integer", "example": 7 },
"objective_vas_post": { "type": "integer", "example": 2 },
"assessment": { "type": "string", "example": "โรคลมปลายปัตฆาตสัญญาณ 4 หลัง" },
"plan_treatment": { "type": "string", "example": "นวดไทยราชสำนักและประคบสมุนไพร" },
"signature_base64": { "type": "string", "example": "data:image/png;base64,iVBORw0K..." }
}
}
}
}
},
"responses": {
"200": { "description": "บันทึกเวชระเบียนสำเร็จ" }
}
}
},
"/billing/checkout": {
"post": {
"summary": "คิดเงิน ชำระค่าบริการ และสั่งพิมพ์ใบเสร็จ ESC/POS",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"queue_id": { "type": "integer", "example": 15 },
"payment_method": { "type": "string", "enum": ["Cash", "PromptPay", "Credit"], "example": "PromptPay" },
"subtotal": { "type": "number", "example": 750.00 },
"discount": { "type": "number", "example": 50.00 },
"vat": { "type": "number", "example": 49.00 },
"grand_total": { "type": "number", "example": 749.00 }
}
}
}
}
},
"responses": {
"200": { "description": "ชำระเงินสำเร็จ ออกเลขใบเสร็จและคำสั่งพิมพ์" }
}
}
}
}
}