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/hcemr_new/d3/partogram/partogram.html

149 lines
5.8 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.container {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.label_tb {
text-anchor:middle;
font-family:sans-serif;
font-size: 14;
writing-mode : horizontal-tb
}
.label_lr {
text-anchor:middle;
font-family:sans-serif;
font-size: 14;
writing-mode : vertical-lr
}
.date{
font-family:sans-serif;
font-size: 12px;
writing-mode : vertical-lr
}
.text{
font-family:sans-serif;
font-size: 14px;
writing-mode : vertical-lr
}
.bp {
font-family:sans-serif;
font-size: 11px;
}
.gs {
font-family:sans-serif;
font-size: 14px;
}
.title{
font-family:sans-serif;
font-size: 24px;
}
</style>
<script src="../d3.v6.min.js"></script>
<script src="./partogram.js"></script>
<script src="./jquery.print-preview.js"></script>
</head>
<body onload="load()" >
<div class="container">
<svg id="svgTop" width="900" height="500" background="#fff" display="block"></svg>
<svg id="svgBottom" width="900" height="780" background="#fff" display="block"></svg>
</div>
<script >
var partoGram ;
function watResultToIFrame(data){
var jsonData = JSON.parse(data);
console.log("平台传入的数据event:"+jsonData);
let event = jsonData.event;
if("print" == event){//打印
window.print();
}else if("preview" == event){//预览
}else{
//普通文本的绘制
partoGram.setText("svgTop","姓名:"+jsonData.patInfo.Name,120,95)
partoGram.setText("svgTop","性别:"+jsonData.patInfo.Sex,260,95)
partoGram.setText("svgTop","年龄:"+jsonData.patInfo.Age,360,95)
partoGram.setText("svgTop","胎次:"+jsonData.patInfo.Para,480,95);
partoGram.setText("svgTop","孕周:"+jsonData.patInfo.GA,580,95);
partoGram.setText("svgTop","孕产号:"+jsonData.patInfo.MaternityNo,680,95);
partoGram.setText("svgTop","医疗机构:"+jsonData.patInfo.choscode,120,70);
partoGram.setText("svgTop","科室:"+jsonData.patInfo.Ks,360,70);
partoGram.setText("svgTop","床号:"+jsonData.patInfo.BedNo,480,70);
partoGram.setText("svgTop","住院号:"+jsonData.patInfo.Zyh,680,70);
partoGram.setText("svgTop","伴行产程图",380,40,"title");
partoGram.setText("svgBottom",jsonData.patInfo.Doctor,150,726);
partoGram.setText("svgBottom",jsonData.patInfo.JCZDoctor,420,726);
partoGram.setText("svgBottom",jsonData.patInfo.XHDoctor,660,726);
//宫颈扩张
partoGram.setDilatationCervix(jsonData.gjkz);
//胎头下降
partoGram.setFetalHeadDescent(jsonData.ttxj);
partoGram.setTextData(jsonData.time,0,0.5,0.1,"date");
partoGram.setTextData(jsonData.DBP,2,0,0.3,"bp");
partoGram.setTextData(jsonData.SBP,2,0.2,1,"bp");
partoGram.setTextData(jsonData.fetalHeart,1,0.1,0.4,"gs");
partoGram.setTextData(jsonData.GS,3,0.4,0.7,"gs");
partoGram.setTextData(jsonData.treatMeasure,4,0.4,0.1,"text");
partoGram.setTextData(jsonData.signature,9,0.5,0.2,"text");
partoGram.setBottomTextStr(jsonData.fraction,0,12-0.3);
let summary = jsonData.summary;
let sumLen = summary.length;
let maxShowLen = 49;
if (sumLen>0) {
let i = 0;
while (sumLen> i * maxShowLen + maxShowLen) {
partoGram.setBottomTextStr(summary.substring(i * maxShowLen, maxShowLen + i * maxShowLen),0,(13-0.5)+(i*0.5));
i++;
}
if (sumLen> i * maxShowLen) {
partoGram.setBottomTextStr(summary.substring(i * maxShowLen, sumLen),0,(13-0.5)+(i*0.5));
}
}
partoGram.setBottomTextStr(jsonData.remarks,0,16-0.3);
}
}
function load(){
let args ={
topSvg : document.getElementById("svgTop"),
bottomSvg : document.getElementById("svgBottom"),
marginLeft : 100,
marginTop : 100
}
partoGram = new PartoGram(args);
feedbackDataToWat(JSON.stringify({"event":"loadEnd"}));
}
function feedbackDataToWat(data){
return window.parent.top.DxURLPage.action(GetQueryString('strwinid'),GetQueryString('strctrid'),data);
}
function GetQueryString(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null){
return unescape(r[2]);
}
return null;
}
</script>
</body>
</html>