下载地址:https://www.pan38.com/share.php?code=VRjxk 提取码:8888 【仅供学习参考,娱乐恶搞使用】
该代码实现了一个完整的电子处方模拟系统,包含患者信息录入、药品数据生成和防伪水印功能。系统采用响应式设计,所有生成内容都带有明显标识表明其为模拟数据。仅供娱乐学习参考使用,或者朋友之间的恶搞。
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>电子处方模拟系统</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>中西医电子处方模拟系统</h1>
<div class="disclaimer">本系统生成内容仅用于医疗系统开发测试</div>
<div class="form-group">
<label>患者姓名:</label>
<input type="text" id="patientName">
</div>
<div class="form-group">
<label>年龄:</label>
<input type="number" id="patientAge">
</div>
<button id="generate">生成处方</button>
<div id="output" class="prescription"></div>
</div>
<script src="script.js"></script>
</body>
</html>
{
font-family: 'Microsoft YaHei';
background: #f5f5f5;
padding: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
background: white;
padding: 30px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.disclaimer {
color: #f44336;
font-weight: bold;
margin-bottom: 20px;
border: 1px dashed #f44336;
padding: 10px;
}
.prescription {
position: relative;
background: #f9f9f9;
padding: 30px;
margin-top: 20px;
border: 1px solid #ddd;
}
.prescription::after {
content: "模拟处方 - 仅供测试";
position: absolute;
opacity: 0.15;
font-size: 80px;
transform: translate(-50%, -50%) rotate(-30deg);
top: 50%;
left: 50%;
pointer-events: none;
}
.medicine-item {
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px dashed #ccc;
}
.stamp {
position: absolute;
right: 30px;
bottom: 30px;
color: red;
font-weight: bold;
}
.getElementById('generate').addEventListener('click', function() {
const name = document.getElementById('patientName').value || "示例患者";
const age = document.getElementById('patientAge').value || "30";
const date = new Date().toLocaleDateString('zh-CN');
const medicines = [
{name: "阿莫西林胶囊", dosage: "0.5g", freq: "每日3次", days: 5},
{name: "板蓝根颗粒", dosage: "10g", freq: "每日2次", days: 7},
{name: "维生素C片", dosage: "100mg", freq: "每日1次", days: 30}
];
let medicineHtml = '';
medicines.forEach(med => {
medicineHtml += `
<div class="medicine-item">
<strong>${med.name}</strong> ${med.dosage}
<br>用法:${med.freq} × ${med.days}天
</div>`;
});
const html = `
<h2>XX诊所电子处方笺</h2>
<hr>
<p><strong>姓名:</strong>${name} <strong>年龄:</strong>${age}</p>
<p><strong>临床诊断:</strong>上呼吸道感染</p>
<div class="medicines">${medicineHtml}</div>
<p><strong>医师:</strong>张医生</p>
<p><strong>日期:</strong>${date}</p>
<div class="stamp">(模拟电子签章)</div>
`;
document.getElementById('output').innerHTML = html;
});
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。