You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
klhis/scd/temperature/TemperatureList.html

215 lines
6.6 KiB

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
.patInfo{
font-size: 16px;
}
.hospital{
font-size: 28px;
font-weight: bold;
}
.date{
font-size: 16px;
}
.R{
font-size: 16px;
}
.event{
font-size: 16px;
}
.xueya{
font-size: 14px;
}
.ps{
font-size: 12px;
}
</style>
</head>
<body style="height: 100%;" onload="init()">
<div id="test-svg">
<svg id="scd" width="1030" height="1480">
<defs>
<!--脉搏-->
<g id="P">
<circle cx="0" cy="0" r="4" fill="red" />
</g>
<!--口表-->
<g id="T1">
<circle cx="0" cy="0" r="4" fill="blue" />
</g>
<!--心率-->
<g id="HR">
<circle cx="0" cy="0" r="4" stroke="red" stroke-width="1" fill="transparent" />
</g>
<!--肛表-->
<g id="T2">
<circle cx="0" cy="0" r="4" stroke="blue" stroke-width="1" fill="none" />
</g>
<!--体温-->
<g id="T">
<line x1="0" y1="0" x2="6" y2="6" style="stroke:rgb(0,0,255);stroke-width:2" />
<line x1="0" y1="6" x2="6" y2="0" style="stroke:rgb(0,0,255);stroke-width:2" />
</g>
<g id="tips">
<rect x="0" y="0" width="60" height="30" style="stroke:yellow;fill:none" rx="10" ry="10"/>
<text x="10" y="20" fill="blue"></text>
</g>
</defs>
</svg>
</div>
<script src="../d3.v6.min.js"></script>
<script src="./TemperatureList.js?155"></script>
<script >
var twd ;
function init(){
var enterData = {
width:1000,
height:1410,
leftPadding:45,
topPadding:100,
rightPadding:0,
bottomPadding:0,
svg:document.getElementById("scd"),
showScale:false
}
twd= new TemperatureList(enterData);
}
//定义打印前事件
const beforePrint = function () {
console.log("打印前");
};
//定义打印后事件
const afterPrint = function () {
let cbData = new TwdToWatData("printNext","");
TwdToWatData.feedbackDataToWat(JSON.stringify(cbData));
}
//监听window状态
if (window.matchMedia) {
let mediaQueryList = window.matchMedia('print');
//为印添加事件
mediaQueryList.addListener(function (mql) {
if (mql.matches) {
beforePrint();
} else {
afterPrint();
}
});
}
//打印前事件
window.onbeforeprint = beforePrint;
//打印后事件
window.onafterprint = afterPrint;
// 体温单渲染
function twdRender(jsonData){
//先删除绘制的信息,不包括table.
twd.removeOuterData();
//腋表
var ybjl = jsonData.phyInfo.T;
//呼吸次数
var rRecord = jsonData.phyInfo.R;
twd.setRrecord(rRecord,46.9,45.6,"R");
twd.makeTempCrossLine(ybjl,3);
//患者基本信息
var name = jsonData.patInfo.name;
var sex = jsonData.patInfo.sex;
var age = jsonData.patInfo.age;
var depart = jsonData.patInfo.depart;
var bq = jsonData.patInfo.ward;
var ch = jsonData.patInfo.bedNo;
var djrq = jsonData.patInfo.djrq;
var zyh = jsonData.patInfo.zyh;
var choscode = jsonData.patInfo.choscode;
var pageNo = jsonData.patInfo.pageNo;
twd.setText(0,-0.1,"姓名:"+name,"patInfo");
twd.setText(1.5,-0.1,"性别:"+sex,"patInfo");
twd.setText(2.0,-0.1,"年龄:"+age,"patInfo");
twd.setText(3.1,-0.1,"科室:"+depart,"patInfo");//2.7
//twd.setText(3.6,-0.1,"病区:"+bq,"patInfo");
twd.setText(4.2,-0.1,"床号:"+ch,"patInfo");
twd.setText(5.1,-0.1,"入院时间:"+djrq,"patInfo");
twd.setText(6.7,-0.1,"病历号:"+zyh,"patInfo");
twd.setText(2,-2,choscode+"体温单","hospital");
twd.setText(3.8,60,"第"+pageNo+"页","patInfo");
//录入日期
var lrrq = jsonData.textData.lrrq;
twd.setTextData(lrrq,1,"date");
//住院日数
var zyts = jsonData.textData.zyts;
twd.setTextData(zyts,2,"date");
//手术后天数
var shts = jsonData.textData.shts;
twd.setTextData(shts,3,"date");
//大便次数
var dbcs = jsonData.textData.dbcs;
twd.setTextData(dbcs,51,"date");
//小便次数
var urineVolume= jsonData.textData.urineVolume;
twd.setTextData(urineVolume,52,"date");
//入量
var input = jsonData.textData.input;
twd.setTextData(input,49,"date");
//出量
var quantity= jsonData.textData.quantity;
twd.setTextData(quantity,50,"date");
//体重
var bodyWeight= jsonData.textData.bodyWeight;
twd.setTextData(bodyWeight,53,"date");
//身高
var height= jsonData.textData.height;
twd.setTextData(height,54,"date");
//血糖
var glu= jsonData.textData.glu;
twd.setTextData(glu,58,"date");
//血压
var BPRecord = jsonData.textData.bp;
twd.setBPrecord(BPRecord,47.8,48.9,"xueya");
//事件1
var evOneRecord = jsonData.phyInfo.eventOne;
twd.setEvent(evOneRecord,42.05,42,"event");
//事件1
var evOneRecord = jsonData.phyInfo.eventTwo;
twd.setEvent(evOneRecord,35.05,35,"event");
//脉搏
var pRecord = jsonData.phyInfo.P;
twd.makePulseCrossLine(pRecord);
//心率
var hrRecord = jsonData.phyInfo.HR;
twd.makePulseCrossLine(hrRecord);
//房颤
var phRecord = jsonData.phyInfo.PH;
twd.setPHrecord(phRecord);
//过敏药物
var allergy = jsonData.textData.allergy;
twd.setAllergyMedical(allergy,55,"date");
//皮试
var ps= jsonData.textData.ps;
twd.setAllergyMedical(ps,57,"ps");
}
function watResultToIFrame(data){
var jsonData = JSON.parse(data);
if(jsonData.event=="render"){
twdRender(jsonData);
}else if(jsonData.event=="print"){
window.print();
}else if(jsonData.event=="renderPrint"){
twdRender(jsonData);
window.print();
}
}
</script>
</body>
</html>