55
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/ViewConfig.js
Executable file
55
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/ViewConfig.js
Executable file
@@ -0,0 +1,55 @@
|
||||
import {bodyTemperature, HEAD_HEIGHT, LINE_HEIGHT, TOP_KEYS} from './config';
|
||||
|
||||
export default class viewConfig {
|
||||
constructor({
|
||||
width = 640, // outer width, in pixels
|
||||
height = 400, // outer height, in pixels
|
||||
marginTop = 20, // top margin, in pixels
|
||||
marginRight = 20, // right margin, in pixels
|
||||
marginBottom = 50, // bottom margin, in pixels
|
||||
marginLeft = 30, // left margin, in pixels
|
||||
stroke = 'currentColor', // stroke color of line and dots
|
||||
strokeWidth = 2, // stroke width of line and dots
|
||||
strokeLinecap = 'round', // stroke line cap of line
|
||||
strokeLinejoin = 'round', // stroke line join of line
|
||||
renderData,
|
||||
} = {}) {
|
||||
// 基础配置赋值
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.stroke = stroke;
|
||||
this.strokeWidth = strokeWidth;
|
||||
this.strokeLinecap = strokeLinecap;
|
||||
this.renderData = renderData;
|
||||
this.strokeLinejoin = strokeLinejoin;
|
||||
this.marginRight = marginRight;
|
||||
this.marginLeft = marginLeft;
|
||||
this.marginBottom = marginBottom;
|
||||
this.marginTop = marginTop;
|
||||
// 计算属性赋值
|
||||
this.contentWidth = width - marginLeft - marginRight;
|
||||
this.step = this.contentWidth / 8;
|
||||
this.bottomPos = height - HEAD_HEIGHT - marginTop - (marginBottom - 30); // 底部坐标,30是因为默认的30,忘记计算了,后续的按照30的偏移量计算
|
||||
this.tableHeight = height - marginBottom - HEAD_HEIGHT;
|
||||
const { micoStep, verticalHeight } = this.utilsGetMicoPos(this.step, this.bottomPos);
|
||||
this.micoStep = micoStep;
|
||||
this.verticalHeight = verticalHeight;
|
||||
this.X_OFFSET = micoStep / 2; // 为了让图标在小格子居中展示,需要进行一个偏移
|
||||
this.xRange = [this.step, width - marginLeft - marginRight]; // [60, 860]
|
||||
this.topPos = marginTop + HEAD_HEIGHT;
|
||||
this.topKeysPos = LINE_HEIGHT * (TOP_KEYS.length + 1); // 1 是时间那一行
|
||||
this.bottomKeysPosStart = this.topKeysPos + verticalHeight + 20;
|
||||
this.yRange = [this.bottomKeysPosStart - 20, this.topKeysPos];
|
||||
}
|
||||
|
||||
// 获取折线区域的高度
|
||||
utilsGetMicoPos(step, botpos) {
|
||||
const micoStep = (step * 7) / 42; // 折线小格子的宽度
|
||||
const verticalLength = bodyTemperature[1] - bodyTemperature[0]; // 根据体温来计算格子
|
||||
const verticalHeight = micoStep * 5 * verticalLength;
|
||||
return {
|
||||
micoStep,
|
||||
verticalHeight,
|
||||
};
|
||||
}
|
||||
}
|
||||
208
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/config.js
Executable file
208
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/config.js
Executable file
@@ -0,0 +1,208 @@
|
||||
import dayjs from 'dayjs';
|
||||
import {getBottomKeys, getInfoKeys, HospitalName, showPainFlag, temperatureName,} from './template';
|
||||
|
||||
// 存放体温单的配置信息
|
||||
export const Header = {
|
||||
HospitalName,
|
||||
temperatureName,
|
||||
};
|
||||
// 患者信息
|
||||
export const INFO_KEYS = getInfoKeys();
|
||||
// 头部信息标签
|
||||
export const TOP_KEYS = [
|
||||
{
|
||||
name: '日 期',
|
||||
getValue: (i, renderData) => {
|
||||
const { beginDate, outdate = '', hospDate = '', dateClosed } = renderData.infoData;
|
||||
const tieml = new Date();
|
||||
const timeNew = new Date((tieml / 1000 + 86400) * 1000);
|
||||
const todayDate = dayjs(timeNew).format('YYYY-MM-DD');
|
||||
const endDate = dayjs(outdate).format('YYYY-MM-DD');
|
||||
let eachDate = dayjs(beginDate).add(i, 'day');
|
||||
const eachTime = eachDate.format('YYYY-MM-DD');
|
||||
if (eachTime === endDate || eachTime === todayDate) {
|
||||
dateClosed.stopTime = true;
|
||||
}
|
||||
// 统一补零格式:月份和日期都始终两位补零
|
||||
const month = eachDate.format('MM'); // 月份始终两位补零
|
||||
const date = eachDate.format('DD'); // 日期始终两位补零
|
||||
// 每月1号显示 MM月DD日,其他日期只显示 DD日
|
||||
return `${month}月${date}日`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '住院日数',
|
||||
getValue: (i, renderData) => {
|
||||
const { beginDate, hospDays, outdate = '', dateClosed } = renderData.infoData;
|
||||
const beginDayjs = dayjs(beginDate);
|
||||
let num = '';
|
||||
// 只要 beginDate 有效,每一天都计算显示住院日数
|
||||
if (beginDayjs.isValid()) {
|
||||
if (hospDays !== undefined && hospDays !== null) {
|
||||
num = hospDays + i + 1;
|
||||
} else {
|
||||
// hospDays 不存在时,从入院开始直接计算
|
||||
num = i + 1;
|
||||
}
|
||||
}
|
||||
let hosNum = '';
|
||||
if (num !== '') {
|
||||
hosNum = '第' + '\xa0\xa0\xa0' + num + '\xa0\xa0\xa0' + '日';
|
||||
} else {
|
||||
hosNum = '第' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + '日';
|
||||
}
|
||||
return hosNum;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '术/娩后日数',
|
||||
getValue: (i, renderData) => {
|
||||
const { beginDate } = renderData.infoData;
|
||||
const surgeryNumDays = renderData.surgeryNumDays;
|
||||
const eachTime = dayjs(beginDate).add(i, 'day').format('YYYY-MM-DD');
|
||||
let num = surgeryNumDays.filter((item) => item.date === eachTime);
|
||||
let hosNum = '';
|
||||
if (num.length > 0) {
|
||||
hosNum = '第' + '\xa0\xa0\xa0' + num[0].typeValue + '\xa0\xa0\xa0' + '日';
|
||||
} else {
|
||||
hosNum = '第' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + '日';
|
||||
}
|
||||
return hosNum;
|
||||
},
|
||||
},
|
||||
];
|
||||
// 最底部的字段绘制
|
||||
export const BOTTOM_KEYS = getBottomKeys();
|
||||
// 是否显示疼痛评分
|
||||
export const showPain = showPainFlag;
|
||||
|
||||
/** *********** 以下是固定选项 **************************/
|
||||
export const timeNumber = [2, 6, 10, 14, 18, 22]; // 时间展示
|
||||
export const nightTime = [2, 18, 22]; // 夜间红色高亮时间
|
||||
export const leftTEXT = [
|
||||
['脉搏,(次/分),', '180', '160', '140', '120', '100', '80', '60', '40'],
|
||||
['体温,(℃), ', '42', '41', '40', '39', '38', '37', '36', '35'],
|
||||
];
|
||||
export const painTEXT = [['疼 痛 强 度'], ['10', '8', '6', '4', '2', '0']];
|
||||
export const inOutItem = ['入观', '分娩', '手术', '转入', '出观', '死亡'];
|
||||
export const otherItem = ['外出', '请假', '拒测', '离院', '其他'];
|
||||
export const sheetOptions = {
|
||||
locations: [
|
||||
{
|
||||
code: '1',
|
||||
display: '体温',
|
||||
},
|
||||
{
|
||||
code: '2',
|
||||
display: '口温',
|
||||
},
|
||||
{
|
||||
code: '3',
|
||||
display: '肛温',
|
||||
},
|
||||
{
|
||||
code: '4',
|
||||
display: '耳温',
|
||||
},
|
||||
],
|
||||
breath: [
|
||||
{
|
||||
code: '',
|
||||
display: '自主呼吸',
|
||||
},
|
||||
{
|
||||
code: '®',
|
||||
display: '机械通气',
|
||||
},
|
||||
],
|
||||
poop: [
|
||||
{
|
||||
code: '',
|
||||
display: '正常',
|
||||
},
|
||||
{
|
||||
code: '※',
|
||||
display: '失禁',
|
||||
},
|
||||
{
|
||||
code: '☆',
|
||||
display: '人工肛门',
|
||||
},
|
||||
{
|
||||
code: '/E',
|
||||
display: '灌肠',
|
||||
},
|
||||
],
|
||||
pee: [
|
||||
{
|
||||
code: '',
|
||||
display: '正常',
|
||||
},
|
||||
{
|
||||
code: '※',
|
||||
display: '失禁',
|
||||
},
|
||||
{
|
||||
code: 'C+',
|
||||
display: '导尿',
|
||||
},
|
||||
],
|
||||
heart: ['窦性心律', '起搏心律', '房性心律', '异常心律'],
|
||||
weight: ['正常', '卧床', '轮椅', '平车'],
|
||||
};
|
||||
// 此处是显示数字的 要和leftTEXT保持一直
|
||||
export const bodyTemperature = [33, 43];
|
||||
export const starNumEnv = bodyTemperature[0]; // 开始体温
|
||||
export const endNumEnv = bodyTemperature[1]; // 结束体温
|
||||
export const heartRange = [0, 200];
|
||||
export const painScore = [0, 10];
|
||||
|
||||
// 中间图表字段对应
|
||||
export const CHART_KEYS = [
|
||||
{
|
||||
key: '001',
|
||||
code: 'breath',
|
||||
name: '呼吸',
|
||||
},
|
||||
{
|
||||
key: '002',
|
||||
code: 'sphygmus',
|
||||
name: '脉搏',
|
||||
},
|
||||
{
|
||||
key: '003',
|
||||
code: 'temperature',
|
||||
name: '体温',
|
||||
},
|
||||
{
|
||||
key: '012',
|
||||
code: 'inOut',
|
||||
name: '特殊标记',
|
||||
},
|
||||
{
|
||||
key: '013',
|
||||
code: 'refuse',
|
||||
name: '标记内容',
|
||||
},
|
||||
{
|
||||
key: '014',
|
||||
code: 'heartRate',
|
||||
name: '心率',
|
||||
},
|
||||
{
|
||||
key: '015',
|
||||
code: 'lowerTemp',
|
||||
name: '物理降温',
|
||||
},
|
||||
{
|
||||
key: '016',
|
||||
code: 'painScore',
|
||||
name: '疼痛评分',
|
||||
},
|
||||
];
|
||||
|
||||
export const HEAD_HEIGHT = 120; // 头部文字预留位置
|
||||
export const LINE_HEIGHT = 20; // 一行的行高
|
||||
export const textLeftMargin = 4; // 文字左边边距
|
||||
export const TEXT_MARGIN_BOTTOM = 6; // 文字向上偏移量
|
||||
export const symbolArrowHeight = 20;
|
||||
35
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/dataProcess.js
Executable file
35
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/dataProcess.js
Executable file
@@ -0,0 +1,35 @@
|
||||
// 用于处理数据相关函数
|
||||
// {
|
||||
// date: "2022-03-02"
|
||||
// index: 0
|
||||
// value: 36
|
||||
// }
|
||||
export function getMaxList({ list = [], max = 0, min = 0, maxDefault = 0, minDefault = 0 } = {}) {
|
||||
return list.map((item) => {
|
||||
if ((item.value > max || item.value < min) && item.value !== null) {
|
||||
const ismax = item.value > max;
|
||||
return {
|
||||
...item,
|
||||
value: ismax ? maxDefault : minDefault,
|
||||
sourceValue: item.value,
|
||||
ismax: ismax,
|
||||
max,
|
||||
min,
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function levelingData({ list = [], maxDefault = 0, minDefault = 0 }) {
|
||||
return list.map((item) => {
|
||||
if (item.value === null) return item;
|
||||
if (item.value > maxDefault) {
|
||||
item.value = maxDefault;
|
||||
} else if (item.value < minDefault) {
|
||||
item.value = minDefault;
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
3279
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/datas.js
Executable file
3279
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/datas.js
Executable file
File diff suppressed because it is too large
Load Diff
683
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/drawfn.js
Executable file
683
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/drawfn.js
Executable file
@@ -0,0 +1,683 @@
|
||||
// 数据处理
|
||||
import * as d3 from 'd3';
|
||||
import {symbol} from 'd3-shape';
|
||||
import {
|
||||
degreesOnline,
|
||||
disconnectEvents,
|
||||
getBrokenLine,
|
||||
getHeartRate,
|
||||
getType,
|
||||
getTypeAnimalHeat,
|
||||
getTypeData,
|
||||
getTypeDatas,
|
||||
postpartumDays,
|
||||
setMergeTag,
|
||||
} from './utils';
|
||||
import {BOTTOM_KEYS, HEAD_HEIGHT, LINE_HEIGHT, symbolArrowHeight, textLeftMargin, TOP_KEYS,} from './config';
|
||||
|
||||
export const iconDrawObj = {
|
||||
// 绘制圆形图标
|
||||
getDrawRoundIcon: ({ content, data, x, y, fill = 'blue', stroke = 'blue', r = 5 }) => {
|
||||
// 增加icon 红色空心
|
||||
content
|
||||
.append('g')
|
||||
.attr('fill', fill)
|
||||
.attr('stroke', stroke)
|
||||
.attr('stroke-width', 1)
|
||||
.selectAll('circle')
|
||||
.data(data)
|
||||
.join('circle')
|
||||
.attr('transform', (i) => {
|
||||
const yVal = y(i) || 0;
|
||||
if (!yVal) {
|
||||
return 'scale(0)';
|
||||
}
|
||||
return '';
|
||||
})
|
||||
.attr('cx', x)
|
||||
.attr('cy', y)
|
||||
.attr('r', (i) => {
|
||||
if (y(i)) {
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
},
|
||||
// 绘制圆形点图标
|
||||
getDrawRoundDotIcon: ({
|
||||
content,
|
||||
data,
|
||||
x,
|
||||
y,
|
||||
fill = 'white',
|
||||
stroke = 'blue',
|
||||
deepFill = 'blue',
|
||||
r = 6,
|
||||
}) => {
|
||||
content
|
||||
.append('g')
|
||||
.attr('fill', fill)
|
||||
.attr('stroke', stroke)
|
||||
.attr('stroke-width', 1)
|
||||
.selectAll('circle')
|
||||
.data(data)
|
||||
.join('circle')
|
||||
.attr('transform', (i) => {
|
||||
const yVal = y(i) || 0;
|
||||
if (!yVal) {
|
||||
return 'scale(0)';
|
||||
}
|
||||
return '';
|
||||
})
|
||||
.attr('cx', x)
|
||||
.attr('cy', y)
|
||||
.attr('r', r)
|
||||
.clone()
|
||||
.attr('cx', x)
|
||||
.attr('cy', y)
|
||||
.attr('r', 1)
|
||||
.attr('fill', deepFill);
|
||||
},
|
||||
// 绘制x
|
||||
getDrawXIcon: ({ content, data, x, y, fill = 'blue', stroke = 'blue' }) => {
|
||||
content
|
||||
.append('g')
|
||||
.attr('fill', fill)
|
||||
.attr('stroke', stroke)
|
||||
.attr('stroke-width', 1)
|
||||
.selectAll('line')
|
||||
.data(data)
|
||||
.join('line')
|
||||
.attr('transform', (i) => {
|
||||
let yVal = y;
|
||||
if (typeof y === 'function') {
|
||||
yVal = y(i) || 0;
|
||||
}
|
||||
if (!yVal) {
|
||||
return 'scale(0)';
|
||||
}
|
||||
return '';
|
||||
})
|
||||
.attr('x1', function (d) {
|
||||
return x(d) - 4;
|
||||
})
|
||||
.attr('y1', function (d) {
|
||||
return y(d) - 4;
|
||||
})
|
||||
.attr('x2', function (d) {
|
||||
return x(d) + 4;
|
||||
})
|
||||
.attr('y2', function (d) {
|
||||
return y(d) + 4;
|
||||
})
|
||||
.clone()
|
||||
.attr('x1', function (d) {
|
||||
return x(d) + 4;
|
||||
})
|
||||
.attr('y1', function (d) {
|
||||
return y(d) - 4;
|
||||
})
|
||||
.attr('x2', function (d) {
|
||||
return x(d) - 4;
|
||||
})
|
||||
.attr('y2', function (d) {
|
||||
return y(d) + 4;
|
||||
});
|
||||
},
|
||||
// 绘制三角形
|
||||
drawThreeIcon: ({ content, data, x, y, fill = 'blue', stroke = 'blue', riangle = 48 }) => {
|
||||
// 蓝色三角形
|
||||
content
|
||||
.append('g')
|
||||
.attr('class', 'ceshiname')
|
||||
.selectAll('g')
|
||||
.data(data)
|
||||
.join('g')
|
||||
.attr('transform', (i) => {
|
||||
const yVal = y(i) || 0;
|
||||
if (!yVal) {
|
||||
return 'scale(0)';
|
||||
}
|
||||
return `translate(${x(i)},${yVal})`;
|
||||
})
|
||||
.append('path')
|
||||
.call((path) => {
|
||||
const symbolThree = symbol();
|
||||
const symbolIndex = 5;
|
||||
symbolThree.type(d3.symbols[symbolIndex]);
|
||||
path.attr('d', symbolThree.size(riangle)).attr('fill', fill).attr('stroke', stroke);
|
||||
// .transition()
|
||||
// .duration(1500)
|
||||
// .attr('d', symbolThree.size(48))
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export function getG(svg, viewConfig) {
|
||||
return svg
|
||||
.append('g')
|
||||
.attr('transform', `translate(${viewConfig.marginLeft},${viewConfig.marginTop + HEAD_HEIGHT})`);
|
||||
}
|
||||
|
||||
// 设置数据
|
||||
export function getData(allData) {
|
||||
const rowsData = allData.rows; // allData, '【全部数据】'
|
||||
const infoData = allData.grParamBOS;
|
||||
const typesData = getTypeDatas(allData.types, allData.grParamBOS.beginDate);
|
||||
const selectOp = allData.selectOp;
|
||||
const symbolTextArr = getTypeData('018', rowsData, false, allData.grParamBOS.beginDate); // 【特殊标记】
|
||||
const symbolGoUp = getType('003', rowsData, allData.grParamBOS.beginDate); // 不升
|
||||
// 体温单特殊数据
|
||||
const dicData = JSON.parse(window.localStorage.getItem('transDictCode'));
|
||||
const signsManagementList = dicData
|
||||
? dicData
|
||||
.filter((item) => item.name === '95')[0]
|
||||
.concept.sort((a, b) => {
|
||||
return a.displayOrder - b.displayOrder;
|
||||
})
|
||||
: [];
|
||||
const otherArr = [];
|
||||
if (signsManagementList.length > 0) {
|
||||
for (let j = 0; j < signsManagementList.length; j++) {
|
||||
if ((signsManagementList[j].code !== '9502') & (signsManagementList[j].code !== '9503')) {
|
||||
const otherArrItem = getTypeData(
|
||||
signsManagementList[j].code,
|
||||
rowsData,
|
||||
false,
|
||||
allData.grParamBOS.beginDate
|
||||
);
|
||||
otherArr.push(otherArrItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
const surgeryNumDays = allData.types.filter((item) => item.typeCode === '031');
|
||||
const surgeryArr = getTypeData('9502', rowsData, false, allData.grParamBOS.beginDate); // '【手术】'
|
||||
const minSurgeryArr = getTypeData('9503', rowsData, false, allData.grParamBOS.beginDate); // '【小手术】'
|
||||
const temArr = getTypeData('00301', rowsData, false, allData.grParamBOS.beginDate); // '【体温拒测等】'
|
||||
// const symbolGoUp = getType('003', rowsData, allData.grParamBOS.beginDate) // symbolGoUp, '不升'
|
||||
// 35度线上的内容
|
||||
const symbolDegreesEvents = degreesOnline(symbolTextArr, selectOp, 0);
|
||||
const symbolDegreesOnline = disconnectEvents(symbolTextArr, selectOp, 'isBeforeAfter', 0);
|
||||
// 40~42线上的内容
|
||||
const symbolTopOnline = degreesOnline(symbolTextArr, selectOp, 1);
|
||||
const symbolTopDegreesOnline = disconnectEvents(symbolTextArr, selectOp, 'isBeforeAfter', 1);
|
||||
const symbolContent = getTypeData('013', rowsData, false, allData.grParamBOS.beginDate); // symbolContent, '【标记内容】'
|
||||
const mergeTag = setMergeTag(symbolTopOnline, symbolContent); // mergeTag, '【合并标记,标记内容】'
|
||||
// 产后日数
|
||||
infoData.postpartum = postpartumDays('031', typesData); // infoData, '产后日数'
|
||||
// 写死的先
|
||||
infoData.dateClosed = {
|
||||
stopTime: true, // 控制结束日期
|
||||
stopNumber: true, // 控制住院天数
|
||||
};
|
||||
// 折线
|
||||
const brokenLineData = getBrokenLine(
|
||||
'003',
|
||||
rowsData,
|
||||
symbolDegreesOnline,
|
||||
symbolGoUp,
|
||||
symbolTopDegreesOnline,
|
||||
allData.grParamBOS.beginDate
|
||||
);
|
||||
// 模拟数据 体温
|
||||
const datasetAnus = getTypeAnimalHeat('003', rowsData, '1', allData.grParamBOS.beginDate); // datasetAnus, '腋温【x】'
|
||||
const bodyData = getTypeAnimalHeat('003', rowsData, '2', allData.grParamBOS.beginDate); // dbodyData, '口温'
|
||||
// const datasetHeartrate = getTypeAnimalHeat('003', rowsData)
|
||||
const datasetHeartrate = getTypeAnimalHeat('003', rowsData, '3', allData.grParamBOS.beginDate); // datasetHeartrate, '肛温【红空圆】'
|
||||
const earCool = getTypeAnimalHeat('003', rowsData, '4', allData.grParamBOS.beginDate); // earCool, '耳朵温'
|
||||
const painScore = getHeartRate(
|
||||
// painScore, '疼痛'
|
||||
'016',
|
||||
rowsData,
|
||||
symbolDegreesOnline,
|
||||
symbolTopDegreesOnline,
|
||||
true,
|
||||
allData.grParamBOS.beginDate
|
||||
);
|
||||
const allTemperatureData = [bodyData, datasetAnus, datasetHeartrate, earCool]; // 所有的温度记录
|
||||
// '脉搏【红实圆】'
|
||||
const datasetPulse = getHeartRate(
|
||||
'002',
|
||||
rowsData,
|
||||
symbolDegreesOnline,
|
||||
symbolTopDegreesOnline,
|
||||
true,
|
||||
allData.grParamBOS.beginDate
|
||||
);
|
||||
// 心率【空心】
|
||||
const datasetHeartRate = getHeartRate(
|
||||
'014',
|
||||
rowsData,
|
||||
symbolDegreesOnline,
|
||||
symbolTopDegreesOnline,
|
||||
true,
|
||||
allData.grParamBOS.beginDate
|
||||
);
|
||||
// const allTemperatureData = getDrawData('003', rowsData, '1', allData.grParamBOS.beginDate) // datasetAnus, '腋温【x】'
|
||||
// const dataCool = getDrawCoolData('015', rowsData, true, allData.grParamBOS.beginDate) // dataCool, '【物理降温】'
|
||||
const dataCool = getTypeData('015', rowsData, true, allData.grParamBOS.beginDate); // 【物理降温】
|
||||
// 呼吸【黑实圆】
|
||||
const datasetPain = getTypeData('001', rowsData, false, allData.grParamBOS.beginDate); // 呼吸
|
||||
|
||||
const title = infoData.title;
|
||||
return {
|
||||
title,
|
||||
datasetHeartRate,
|
||||
bodyData,
|
||||
datasetAnus,
|
||||
datasetHeartrate,
|
||||
earCool,
|
||||
painScore,
|
||||
allTemperatureData,
|
||||
datasetPulse,
|
||||
symbolContent,
|
||||
symbolTextArr,
|
||||
mergeTag,
|
||||
dataCool,
|
||||
datasetPain,
|
||||
typesData,
|
||||
infoData,
|
||||
rowsData,
|
||||
symbolDegreesOnline,
|
||||
symbolGoUp,
|
||||
symbolDegreesEvents,
|
||||
brokenLineData,
|
||||
otherArr,
|
||||
temArr,
|
||||
surgeryArr,
|
||||
minSurgeryArr,
|
||||
surgeryNumDays,
|
||||
};
|
||||
}
|
||||
|
||||
export function drawTopMask(svg, viewConfig) {
|
||||
// ===================== //
|
||||
// 遮罩层挡住超出的折线 //
|
||||
// =====================//
|
||||
svg
|
||||
.append('g')
|
||||
.attr('transform', `translate(${viewConfig.marginLeft},${HEAD_HEIGHT - LINE_HEIGHT})`)
|
||||
.append('rect')
|
||||
.attr('class', 'mask-rect')
|
||||
.attr('x', 0)
|
||||
.attr('y', -100)
|
||||
.attr('width', viewConfig.contentWidth)
|
||||
// 2.5是上下的一个区域 1 是原来有 2的宽度
|
||||
.attr('height', LINE_HEIGHT * (TOP_KEYS.length + 7.5) - 1)
|
||||
.attr('stroke', viewConfig.stroke)
|
||||
.attr('fill', '#fff')
|
||||
.attr('style', 'stroke-width: 0');
|
||||
|
||||
drawTopVerticalLine(svg, viewConfig);
|
||||
}
|
||||
|
||||
export function drawTopVerticalLine(svg, viewConfig) {
|
||||
// 补上下竖线
|
||||
let start = viewConfig.step;
|
||||
const lineG = getG(svg, viewConfig).append('g').attr('class', 'maskline-top');
|
||||
while (start < viewConfig.contentWidth) {
|
||||
// const isLastLine = (start + viewConfig.step) >= viewConfig.contentWidth
|
||||
lineG
|
||||
.append('line')
|
||||
.attr('fill', 'stroke')
|
||||
.attr('x1', start)
|
||||
.attr('y1', 0)
|
||||
.attr('y2', (TOP_KEYS.length + 1) * LINE_HEIGHT)
|
||||
.attr('x2', start)
|
||||
.attr('stroke', start > viewConfig.step ? '#B22222' : viewConfig.stroke)
|
||||
// .attr('stroke', isLastLine ? 'black' : (start > viewConfig.step ? '#B22222' : viewConfig.stroke))
|
||||
.attr('stroke-width', 4); // 设置线条宽度为2
|
||||
start = start + viewConfig.step;
|
||||
}
|
||||
}
|
||||
|
||||
export function drawBottomMask(svg, viewConfig) {
|
||||
const g = getG(svg, viewConfig);
|
||||
// 遮罩层挡住超出的折线
|
||||
g.append('rect')
|
||||
.attr('class', 'mask-rect')
|
||||
.attr('x', 4)
|
||||
.attr('y', viewConfig.bottomKeysPosStart + viewConfig.micoStep * 2)
|
||||
.attr('width', viewConfig.contentWidth)
|
||||
.attr('height', LINE_HEIGHT * (BOTTOM_KEYS.length + 5))
|
||||
.attr('stroke', viewConfig.stroke)
|
||||
.attr('fill', '#ffffff')
|
||||
.attr('style', 'stroke-width: 0');
|
||||
drawBottomMaskLine(svg, viewConfig);
|
||||
}
|
||||
|
||||
function drawBottomMaskLine(svg, viewConfig) {
|
||||
// 补上下竖线
|
||||
let start = viewConfig.step;
|
||||
const lineG = getG(svg, viewConfig).append('g').attr('class', 'maskline');
|
||||
while (start < viewConfig.contentWidth) {
|
||||
// const isLastLine = (start + viewConfig.step) >= viewConfig.contentWidth;
|
||||
lineG
|
||||
.append('line')
|
||||
.attr('fill', 'stroke')
|
||||
.attr('x1', start)
|
||||
.attr('y1', viewConfig.bottomKeysPosStart)
|
||||
.attr('y2', viewConfig.tableHeight)
|
||||
.attr('x2', start)
|
||||
.attr('stroke', start > viewConfig.step ? '#B22222' : viewConfig.stroke)
|
||||
//.attr('stroke', isLastLine ? 'black' : (start > viewConfig.step ? '#B22222' : viewConfig.stroke))
|
||||
.attr('stroke-width', 4); // 设置线条宽度为2
|
||||
start = start + viewConfig.step;
|
||||
}
|
||||
}
|
||||
|
||||
// 绘制特殊事件文字 --- 有时间
|
||||
export function drawSpecialText(svg, viewConfig, textData) {
|
||||
const g = getG(svg, viewConfig);
|
||||
g.append('g')
|
||||
.selectAll('text')
|
||||
.data(textData)
|
||||
.join('text')
|
||||
.attr('style', 'font-size:14px; fill: red;')
|
||||
.attr('class', 'mytext')
|
||||
.html((d, i) => {
|
||||
const t = (d?.value || '').split(',');
|
||||
let time = '';
|
||||
if (t.length > 1) {
|
||||
time =
|
||||
t[0] + '于' + transNum(t[1].split(':')[0]) + '时' + transNum(t[1].split(':')[1]) + '分';
|
||||
// time = t[0] + '㇑' + transNum(t[1].split(':')[0]) + '时' + transNum(t[1].split(':')[1]) + '分'
|
||||
}
|
||||
const texts = time.split('');
|
||||
return texts
|
||||
.map((text, i) => {
|
||||
return `<tspan dx="${
|
||||
i === 1 ? -14 : i === 0 ? 0 : Number(text) ? -8 : -14
|
||||
}" dy="${20}">${text}</tspan>`;
|
||||
})
|
||||
.join('');
|
||||
})
|
||||
.attr('x', (d, i) => {
|
||||
return viewConfig.step + d.index * viewConfig.micoStep + textLeftMargin;
|
||||
})
|
||||
.attr('y', () => {
|
||||
return viewConfig.topKeysPos - textLeftMargin;
|
||||
});
|
||||
}
|
||||
// 绘制特殊事件文字 --- 大手术小手术
|
||||
export function drawSurgery(svg, viewConfig, textData) {
|
||||
const g = getG(svg, viewConfig);
|
||||
const textDatas = [];
|
||||
if (textData.length > 0) {
|
||||
for (let j = 0; j < textData.length; j++) {
|
||||
let item = {};
|
||||
if (textData[j].value) {
|
||||
item = {
|
||||
index: textData[j].index,
|
||||
value: textData[j].value.split(',')[0],
|
||||
date: textData[j].date,
|
||||
};
|
||||
} else {
|
||||
item = textData[j];
|
||||
}
|
||||
textDatas.push(item);
|
||||
}
|
||||
}
|
||||
g.append('g')
|
||||
.selectAll('text')
|
||||
.data(textDatas)
|
||||
.join('text')
|
||||
.attr('style', 'font-size:15px; fill: red;')
|
||||
.attr('class', 'mytext')
|
||||
.html((d, i) => {
|
||||
const texts = (d?.value || '').split('');
|
||||
return texts
|
||||
.map((text, i) => {
|
||||
return `<tspan dx="${
|
||||
i === 1 ? -15 : i === 0 ? 0 : Number(text) ? -8 : -15
|
||||
}" dy="${20}">${text}</tspan>`;
|
||||
})
|
||||
.join('');
|
||||
})
|
||||
.attr('x', (d, i) => {
|
||||
return viewConfig.step + d.index * viewConfig.micoStep + textLeftMargin - 2;
|
||||
})
|
||||
.attr('y', () => {
|
||||
return viewConfig.topKeysPos - textLeftMargin;
|
||||
});
|
||||
}
|
||||
// 绘制特殊事件文字 --- 无时间
|
||||
export function drawSpecialNoTimeText(svg, viewConfig, textData) {
|
||||
const g = getG(svg, viewConfig);
|
||||
const textDatas = [];
|
||||
if (textData.length > 0) {
|
||||
for (let j = 0; j < textData.length; j++) {
|
||||
let item = {};
|
||||
if (textData[j].value) {
|
||||
item = {
|
||||
index: textData[j].index,
|
||||
value: textData[j].value.split(',')[0],
|
||||
date: textData[j].date,
|
||||
};
|
||||
} else {
|
||||
item = textData[j];
|
||||
}
|
||||
textDatas.push(item);
|
||||
}
|
||||
}
|
||||
g.append('g')
|
||||
.selectAll('text')
|
||||
.data(textDatas)
|
||||
.join('text')
|
||||
.attr('style', 'font-size:15px; fill: red;')
|
||||
.attr('class', 'mytext')
|
||||
.html((d, i) => {
|
||||
const texts = (d?.value || '').split('');
|
||||
// let time = ''
|
||||
// if (t.length > 1) {
|
||||
// time = t[0] + '㇑' + transNum(t[1].split(':')[0]) + '时' + transNum(t[1].split(':')[1]) + '分'
|
||||
// }
|
||||
// const texts = time.split('')
|
||||
return texts
|
||||
.map((text, i) => {
|
||||
return `<tspan dx="${i === 1 ? -15 : i === 0 ? 0 : Number(text) ? -8 : -15}" dy="${
|
||||
i === 0 ? 20 : 80
|
||||
}">${text}</tspan>`;
|
||||
})
|
||||
.join('');
|
||||
})
|
||||
.attr('x', (d, i) => {
|
||||
return viewConfig.step + d.index * viewConfig.micoStep + textLeftMargin - 2;
|
||||
})
|
||||
.attr('y', () => {
|
||||
return viewConfig.topKeysPos - textLeftMargin;
|
||||
});
|
||||
}
|
||||
|
||||
// 数字转换成文字
|
||||
function transNum(num) {
|
||||
const arr1 = ['', '十'];
|
||||
const arr2 = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
|
||||
const sw = num.split('')[0];
|
||||
const gw = num.split('')[1];
|
||||
const str1 = sw > 1 ? arr2[sw] + '十' : arr1[sw];
|
||||
let strNum = str1 + arr2[gw];
|
||||
// 若H为十点整小时,则把零去掉,若m为十分,则去掉零
|
||||
if (strNum.indexOf('十') > 0 || strNum.indexOf('零') === 1) {
|
||||
strNum = strNum.replace('零', '');
|
||||
}
|
||||
return strNum;
|
||||
}
|
||||
|
||||
// 绘制标签文字
|
||||
export function drawTagText(svg, viewConfig, textData) {
|
||||
const g = getG(svg, viewConfig);
|
||||
g.append('g')
|
||||
.selectAll('text')
|
||||
.data(textData)
|
||||
.join('text')
|
||||
.attr('style', 'font-size:14px; fill: black;')
|
||||
.attr('class', 'mytext')
|
||||
.html((d, i) => {
|
||||
const texts = (d?.value || '').split('');
|
||||
return texts
|
||||
.map((text, i) => {
|
||||
return `<tspan dx="${
|
||||
i === 1 ? -14 : i === 0 ? 0 : Number(text) ? -8 : -14
|
||||
}" dy="${20}">${text}</tspan>`;
|
||||
})
|
||||
.join('');
|
||||
})
|
||||
.attr('x', (d, i) => viewConfig.step + d.index * viewConfig.micoStep + textLeftMargin)
|
||||
.attr('y', () => {
|
||||
return viewConfig.topKeysPos - textLeftMargin + 198;
|
||||
});
|
||||
}
|
||||
|
||||
// 绘制特殊事件文字底部
|
||||
export function drawBottomSpecialText(svg, viewConfig, textData) {
|
||||
const g = getG(svg, viewConfig);
|
||||
g.append('g')
|
||||
.selectAll('text')
|
||||
.data(textData)
|
||||
.join('text')
|
||||
.attr('style', 'font-size:14px; fill: blue;')
|
||||
.attr('class', 'mytext')
|
||||
.html((d, i) => {
|
||||
const texts = (d?.value || '').split('');
|
||||
return texts
|
||||
.map((text, i) => {
|
||||
return `<tspan dx="${
|
||||
i === 1 ? -14 : i === 0 ? 0 : Number(text) ? -8 : -14
|
||||
}" dy="${20}">${text}</tspan>`;
|
||||
})
|
||||
.join('');
|
||||
})
|
||||
.attr('x', (d, i) => viewConfig.step + d.index * viewConfig.micoStep + textLeftMargin)
|
||||
.attr('y', (d) => {
|
||||
const texts = (d?.value || '').split('');
|
||||
return viewConfig.bottomKeysPosStart - texts.length * LINE_HEIGHT - 6 - 58;
|
||||
});
|
||||
}
|
||||
|
||||
export function initArrow(svg) {
|
||||
const arrowMarkerRed = svg
|
||||
.append('defs')
|
||||
.append('marker')
|
||||
.attr('id', 'redArrow')
|
||||
.attr('markerUnits', 'strokeWidth')
|
||||
.attr('markerWidth', '12')
|
||||
.attr('markerHeight', '12')
|
||||
.attr('viewBox', '0 0 12 12')
|
||||
.attr('refX', '6')
|
||||
.attr('refY', '6')
|
||||
.attr('orient', 'auto');
|
||||
const arrowPath = 'M2,2 L10,6 L2,10 L6,6 L2,2';
|
||||
arrowMarkerRed.append('path').attr('d', arrowPath).attr('fill', 'red');
|
||||
const arrowMarkerBlue = svg
|
||||
.append('defs')
|
||||
.append('marker')
|
||||
.attr('id', 'blueArrow')
|
||||
.attr('markerUnits', 'strokeWidth')
|
||||
.attr('markerWidth', '12')
|
||||
.attr('markerHeight', '12')
|
||||
.attr('viewBox', '0 0 12 12')
|
||||
.attr('refX', '6')
|
||||
.attr('refY', '6')
|
||||
.attr('orient', 'auto');
|
||||
arrowMarkerBlue.append('path').attr('d', arrowPath).attr('fill', 'blue');
|
||||
}
|
||||
|
||||
export function lineArrow({ svg, viewConfig, scale, data } = {}) {
|
||||
const g = getG(svg, viewConfig);
|
||||
const vaildData = data.filter((item) => item);
|
||||
// {
|
||||
// ...item,
|
||||
// value: ismax ? maxDefault : minDefault,
|
||||
// sourceValue: item,
|
||||
// ismax: ismax ,
|
||||
// max,
|
||||
// min
|
||||
// }
|
||||
// 绘制直线
|
||||
g.selectAll('line')
|
||||
.data(vaildData)
|
||||
.join('line')
|
||||
.attr('x1', (d, i) => {
|
||||
return scale(d.index) + +viewConfig.X_OFFSET;
|
||||
})
|
||||
.attr('y1', (d, i) => {
|
||||
if (d.ismax) {
|
||||
// 顶部箭头
|
||||
return viewConfig.topKeysPos + symbolArrowHeight * 1.5;
|
||||
} else {
|
||||
// 底部箭头
|
||||
return viewConfig.bottomKeysPosStart - symbolArrowHeight * 1.5;
|
||||
}
|
||||
})
|
||||
.attr('x2', (d, i) => {
|
||||
return scale(d.index) + +viewConfig.X_OFFSET;
|
||||
})
|
||||
.attr('y2', (d, i) => {
|
||||
if (d.ismax) {
|
||||
// 顶部箭头
|
||||
return viewConfig.topKeysPos + symbolArrowHeight / 2;
|
||||
} else {
|
||||
// 底部箭头
|
||||
return viewConfig.bottomKeysPosStart - symbolArrowHeight / 2;
|
||||
}
|
||||
})
|
||||
.attr('stroke', (d) => {
|
||||
return d.ismax ? 'red' : 'blue';
|
||||
})
|
||||
.attr('stroke-width', 2)
|
||||
.attr('marker-end', (d, i) => {
|
||||
return d.ismax ? 'url(#redArrow)' : 'url(#blueArrow)';
|
||||
});
|
||||
g.selectAll('text')
|
||||
.data(vaildData)
|
||||
.join('text')
|
||||
.attr('class', 'desctextname')
|
||||
.html((item, i) => {
|
||||
const value = `${item.sourceValue}`.split('');
|
||||
const dotIndex = value.indexOf('.');
|
||||
return value
|
||||
.map((d, index) => {
|
||||
let y;
|
||||
let multiple = index;
|
||||
let addition = 0; // dot height
|
||||
if (item.ismax) {
|
||||
if (index >= dotIndex) {
|
||||
addition = 8;
|
||||
multiple = index - 1;
|
||||
}
|
||||
y =
|
||||
viewConfig.topKeysPos +
|
||||
symbolArrowHeight * 1.5 +
|
||||
(2 + multiple * 1.5) * viewConfig.X_OFFSET +
|
||||
addition;
|
||||
} else {
|
||||
if (index >= dotIndex) {
|
||||
addition = 9;
|
||||
multiple = index - 1;
|
||||
}
|
||||
y =
|
||||
viewConfig.bottomKeysPosStart -
|
||||
(2 + (value.length - multiple) * 1.5) * viewConfig.X_OFFSET +
|
||||
addition;
|
||||
}
|
||||
return `
|
||||
<tspan rotate="90" x="${scale(item.index) + viewConfig.X_OFFSET - 4}"
|
||||
y="${y}">${d}</tspan>`;
|
||||
})
|
||||
.join('');
|
||||
})
|
||||
.attr('x', (item, i) => {
|
||||
return scale(item.index) + viewConfig.X_OFFSET - 4;
|
||||
})
|
||||
.attr('y', (item) => {
|
||||
if (item.ismax) {
|
||||
return viewConfig.topKeysPos + symbolArrowHeight * 1.5 + LINE_HEIGHT / 2;
|
||||
} else {
|
||||
return viewConfig.bottomKeysPosStart - symbolArrowHeight / 2 - LINE_HEIGHT / 2;
|
||||
}
|
||||
})
|
||||
.attr('style', (item) => {
|
||||
return `font-size:14px;fill:${item.ismax ? 'red' : 'blue'};font-weight: bold;`;
|
||||
});
|
||||
}
|
||||
121
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/index.js
Executable file
121
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/index.js
Executable file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* @Author: 程堡
|
||||
* @Date: 2022-04-01 09:31:59
|
||||
* @LastEditTime: 2022-04-01 09:31:59
|
||||
* @LastEditors: 程堡
|
||||
* @Description: 体温单
|
||||
* @FilePath: src\action\nurseStation\temperatureSheet\index.js
|
||||
*/
|
||||
import Request from '@/axios/index.js';
|
||||
|
||||
const temperaturePath = 'app/temperature';
|
||||
const getTemperaturePath = 'app/temperature/by-encounter-id';
|
||||
const delTemperaturePath = 'app/temperature/retired';
|
||||
// import data from '../temperatureSheet/datas.js';
|
||||
export const API = {
|
||||
/**
|
||||
* @description 查询患者体温单
|
||||
* @param encounterId
|
||||
*/
|
||||
getTemperatures(id) {
|
||||
return Request({
|
||||
url: getTemperaturePath, // hash地址
|
||||
method: 'get', // 提交方法get
|
||||
verification: true, // 是否统一拦截验证
|
||||
untoken: false, // 是否不带token
|
||||
params: {
|
||||
// 参数列表
|
||||
id,
|
||||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* @description 创建体温单
|
||||
* @param encounterId
|
||||
*/
|
||||
createTemperature(encounterId, hisNo, clinicCode, recordTime, type, content) {
|
||||
return Request({
|
||||
url: temperaturePath,
|
||||
method: 'post',
|
||||
verification: true,
|
||||
untoken: false,
|
||||
data: {
|
||||
// 参数列表
|
||||
encounterId,
|
||||
hisNo,
|
||||
clinicCode,
|
||||
recordTime,
|
||||
operCode: sessionStorage.getItem('userCode'),
|
||||
operName: sessionStorage.getItem('userName'),
|
||||
type,
|
||||
content,
|
||||
hospitalOrgId: sessionStorage.getItem('hospitalOrgId'),
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 修改体温单
|
||||
* @param encounterId
|
||||
*/
|
||||
updateTemperature(encounterId, hisNo, clinicCode, recordTime, type, content, id) {
|
||||
return Request({
|
||||
url: temperaturePath,
|
||||
method: 'put',
|
||||
verification: true,
|
||||
untoken: false,
|
||||
data: {
|
||||
// 参数列表
|
||||
encounterId,
|
||||
hisNo,
|
||||
clinicCode,
|
||||
recordTime,
|
||||
operCode: sessionStorage.getItem('userCode'),
|
||||
operName: sessionStorage.getItem('userName'),
|
||||
type,
|
||||
content,
|
||||
id,
|
||||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* @description 删除记录
|
||||
* @param encounterId
|
||||
*/
|
||||
deleteTemperature(id) {
|
||||
return Request({
|
||||
url: delTemperaturePath,
|
||||
method: 'post',
|
||||
verification: true,
|
||||
untoken: false,
|
||||
data: {
|
||||
// 参数列表
|
||||
id,
|
||||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* @description 获取患者时间线
|
||||
* @param EncounterId
|
||||
*/
|
||||
NewSheet(patientInfo) {
|
||||
return {
|
||||
grParamBOS: {
|
||||
age: patientInfo.age,
|
||||
birth: 868723200000,
|
||||
cwh: patientInfo.bedName,
|
||||
cardNo: patientInfo.hisId,
|
||||
hospDate: patientInfo.firstInBedTime.substring(0, 10),
|
||||
inDate: patientInfo.firstInBedTime,
|
||||
inDiagName: patientInfo.diag,
|
||||
name: patientInfo.patientName,
|
||||
deptName: patientInfo.deptName,
|
||||
operaDays: null,
|
||||
outdate: patientInfo.checkOutWardTime,
|
||||
sex: patientInfo.gender.display,
|
||||
},
|
||||
rows: [],
|
||||
types: [],
|
||||
};
|
||||
},
|
||||
};
|
||||
1702
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/line.js
Executable file
1702
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/line.js
Executable file
File diff suppressed because it is too large
Load Diff
296
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/template.js
Executable file
296
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/template.js
Executable file
@@ -0,0 +1,296 @@
|
||||
// 医院名称
|
||||
export const HospitalName = '';
|
||||
// 体温单名称
|
||||
export const temperatureName = '体 温 单';
|
||||
// 患者信息显示项目(修改显示顺序及是否显示)
|
||||
export const INFO_KEYS = [
|
||||
{
|
||||
name: '姓名',
|
||||
key: 'name',
|
||||
order: 1,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '性别',
|
||||
key: 'sex',
|
||||
order: 2,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '年龄',
|
||||
key: 'age',
|
||||
order: 3,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '病室',
|
||||
key: 'deptName',
|
||||
order: 4,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '床号',
|
||||
key: 'cwh',
|
||||
order: 5,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '病历号',
|
||||
key: 'hosNum',
|
||||
order: 6,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '入院日期',
|
||||
key: 'hospDate',
|
||||
order: 6,
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
name: '诊断',
|
||||
key: 'inDiagName',
|
||||
order: 8,
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
// 体温单录入项目(修改显示顺序及是否显示)
|
||||
// 新增项目注意 key值、code值唯一性,不要与之前的项目重复
|
||||
export const BOTTOM_KEYS = [
|
||||
{
|
||||
name: '血压(mmHg)',
|
||||
code: 'bloodPressure',
|
||||
key: '008',
|
||||
times: 2,
|
||||
order: 1,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '大\u00A0便\u00A0次\u00A0数',
|
||||
code: 'poop',
|
||||
key: '005',
|
||||
order: 2,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '小\u00A0便\u00A0次\u00A0数',
|
||||
code: 'urine',
|
||||
key: '004',
|
||||
order: 3,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '液体总入量(ml)',
|
||||
code: 'input',
|
||||
key: '006',
|
||||
order: 4,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '其\u00A0\u00A0他(ml)',
|
||||
code: 'output',
|
||||
key: '007',
|
||||
order: 5,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '尿\u00A0\u00A0量(ml)',
|
||||
code: 'urineOutput',
|
||||
key: '011',
|
||||
order: 6,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '体\u00A0\u00A0重(kg)',
|
||||
code: 'weight',
|
||||
key: '009',
|
||||
order: 8,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: '身\u00A0\u00A0高(cm)',
|
||||
code: 'height',
|
||||
key: '030',
|
||||
order: 9,
|
||||
show: true,
|
||||
},
|
||||
{
|
||||
name: 'SPO2',
|
||||
code: 'SPO2',
|
||||
key: '021',
|
||||
times: 2,
|
||||
order: 10,
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
name: '皮\u00A0试\u00A0阳\u00A0性',
|
||||
code: 'allergy',
|
||||
key: '017',
|
||||
order: 11,
|
||||
show: true,
|
||||
lines: 2,
|
||||
},
|
||||
{
|
||||
name: '过\u00A0敏\u00A0试\u00A0验',
|
||||
code: 'allergyTest',
|
||||
key: '020',
|
||||
order: 12,
|
||||
show: false,
|
||||
lines: 2,
|
||||
},
|
||||
{
|
||||
name: '其\u00A0\u00A0他',
|
||||
code: 'other',
|
||||
key: '025',
|
||||
order: 7,
|
||||
show: false,
|
||||
lines: 2,
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
code: 'useless1',
|
||||
key: '100',
|
||||
order: 20,
|
||||
show: true,
|
||||
},
|
||||
];
|
||||
// 是否显示疼痛评分
|
||||
export const showPainFlag = true;
|
||||
|
||||
/** *********** 以上信息是本地化可以修改的部分 **************************/
|
||||
// 获取患者信息显示项目
|
||||
export function getInfoKeys() {
|
||||
return INFO_KEYS.filter((x) => x.show).sort((a, b) => a.order - b.order);
|
||||
}
|
||||
// 获取患者信息显示项目
|
||||
export function getBottomKeys() {
|
||||
return BOTTOM_KEYS.filter((x) => x.show).sort((a, b) => a.order - b.order);
|
||||
}
|
||||
|
||||
export const timeNumber = [2, 6, 10, 14, 18, 22]; // 时间展示
|
||||
export const nightTime = [2, 18, 22]; // 夜间红色高亮时间
|
||||
export const leftTEXT = [
|
||||
['脉搏,(次/分),180', '160', '140', '120', '100', '80', '60', '40'],
|
||||
['体温,(℃), 42', '41', '40', '39', '38', '37', '36', '35'],
|
||||
];
|
||||
|
||||
export const inOutItem = ['入观', '分娩', '手术', '转入', '出观', '死亡'];
|
||||
export const otherItem = ['外出', '请假', '拒测', '离院', '其他'];
|
||||
export const sheetOptions = {
|
||||
locations: [
|
||||
{
|
||||
code: '1',
|
||||
display: '体温',
|
||||
},
|
||||
{
|
||||
code: '2',
|
||||
display: '口温',
|
||||
},
|
||||
{
|
||||
code: '3',
|
||||
display: '肛温',
|
||||
},
|
||||
{
|
||||
code: '4',
|
||||
display: '耳温',
|
||||
},
|
||||
],
|
||||
breath: [
|
||||
{
|
||||
code: '',
|
||||
display: '自主呼吸',
|
||||
},
|
||||
{
|
||||
code: '®',
|
||||
display: '机械通气',
|
||||
},
|
||||
],
|
||||
poop: [
|
||||
{
|
||||
code: '',
|
||||
display: '正常',
|
||||
},
|
||||
{
|
||||
code: '※',
|
||||
display: '失禁',
|
||||
},
|
||||
{
|
||||
code: '☆',
|
||||
display: '人工肛门',
|
||||
},
|
||||
{
|
||||
code: '/E',
|
||||
display: '灌肠',
|
||||
},
|
||||
],
|
||||
pee: [
|
||||
{
|
||||
code: '',
|
||||
display: '正常',
|
||||
},
|
||||
{
|
||||
code: '※',
|
||||
display: '失禁',
|
||||
},
|
||||
{
|
||||
code: 'C+',
|
||||
display: '导尿',
|
||||
},
|
||||
],
|
||||
heart: ['窦性心律', '起搏心律', '房性心律', '异常心律'],
|
||||
weight: ['正常', '卧床', '轮椅', '平车'],
|
||||
};
|
||||
// 此处是显示数字的 要和leftTEXT保持一直
|
||||
export const bodyTemperature = [34, 42];
|
||||
export const starNumEnv = bodyTemperature[0]; // 开始体温
|
||||
export const endNumEnv = bodyTemperature[1]; // 结束体温
|
||||
export const heartRange = [20, 180];
|
||||
|
||||
// 中间图表字段对应
|
||||
export const CHART_KEYS = [
|
||||
{
|
||||
key: '001',
|
||||
code: 'breath',
|
||||
name: '呼吸',
|
||||
},
|
||||
{
|
||||
key: '002',
|
||||
code: 'sphygmus',
|
||||
name: '脉搏',
|
||||
},
|
||||
{
|
||||
key: '003',
|
||||
code: 'temperature',
|
||||
name: '不升',
|
||||
},
|
||||
{
|
||||
key: '012',
|
||||
code: 'inOut',
|
||||
name: '特殊标记',
|
||||
},
|
||||
{
|
||||
key: '013',
|
||||
code: 'refuse',
|
||||
name: '标记内容',
|
||||
},
|
||||
{
|
||||
key: '014',
|
||||
code: 'heartRate',
|
||||
name: '心率',
|
||||
},
|
||||
{
|
||||
key: '015',
|
||||
code: 'lowerTemp',
|
||||
name: '物理降温',
|
||||
},
|
||||
{
|
||||
key: '016',
|
||||
code: 'painScore',
|
||||
name: '疼痛评分',
|
||||
},
|
||||
];
|
||||
|
||||
export const HEAD_HEIGHT = 120; // 头部文字预留位置
|
||||
export const LINE_HEIGHT = 20; // 一行的行高
|
||||
export const textLeftMargin = 4; // 文字左边边距
|
||||
export const TEXT_MARGIN_BOTTOM = 6; // 文字向上偏移量
|
||||
export const symbolArrowHeight = 20;
|
||||
307
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/utils.js
Executable file
307
openhis-ui-vue3/src/action/nurseStation/temperatureSheet/utils.js
Executable file
@@ -0,0 +1,307 @@
|
||||
import moment from 'moment';
|
||||
|
||||
export function getG(svg, translateX, translateY) {
|
||||
return svg.append('g').attr('transform', `translate(${translateX},${translateY})`);
|
||||
}
|
||||
|
||||
// function generatePointer ({ pathData, type, yScaleInstance }) {
|
||||
// return (event) => {
|
||||
// var index = Math.round(
|
||||
// (d3.pointer(event)[0] - step - textLeftMargin) / xScale.step()
|
||||
// )
|
||||
// var val = xScale.domain()[index]
|
||||
// const i = d3.bisectCenter(d3.range(pathData.length), val)
|
||||
// console.log(val, index, '=====', pathData[i], 'pathData[i]')
|
||||
// const yPos = yScaleInstance(pathData[i].value) + marginTop + HEAD_HEIGHT
|
||||
// console.log(`translate(${xScale(i)},${yPos})`)
|
||||
// tooltip.style('display', null)
|
||||
// tooltip.attr('class', 'myTooltip')
|
||||
// tooltip.attr('transform', `translate(${xScale(i) + micoStep},${yPos})`)
|
||||
|
||||
// const path = tooltip
|
||||
// .selectAll('path')
|
||||
// .data(['', ''])
|
||||
// .join('path')
|
||||
// .attr('fill', 'white')
|
||||
// .attr('stroke', 'black')
|
||||
|
||||
// const text = tooltip
|
||||
// .selectAll('text')
|
||||
// .data(['', ''])
|
||||
// .join('text')
|
||||
// .call((text) =>
|
||||
// text
|
||||
// .selectAll('tspan')
|
||||
// .data([`${type}: ${pathData[i].value}`, `${pathData[i].date}`])
|
||||
// .join('tspan')
|
||||
// .attr('x', 0)
|
||||
// .attr('y', (_, i) => `${i * 1.2}em`)
|
||||
// .attr('font-weight', (_, i) => (i ? null : 'bold'))
|
||||
// .text((d) => d)
|
||||
// )
|
||||
|
||||
// const { x, y, width: w, height: h } = text.node().getBBox()
|
||||
// text.attr('transform', `translate(${-w / 2},${15 - y})`)
|
||||
// path.attr(
|
||||
// 'd',
|
||||
// `M${-w / 2 - 10},5H-5l5,-5l5,5H${w / 2 + 10}v${h + 20}h-${w + 20}z`
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
export function getTypeDatas(typeData, beginDate) {
|
||||
const types = typeData.sort((a, b) => new Date(a.date) - new Date(b.date));
|
||||
return types.map((item) => {
|
||||
return {
|
||||
index: getIndex(beginDate, item.date, '00:00:00') / 6,
|
||||
times: 0,
|
||||
date: item.date,
|
||||
typeCode: item.typeCode,
|
||||
typeValue: item.typeValue || null,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export function getTypeData(type, allData = [], isNumber = true, beginDate) {
|
||||
const getList = allData
|
||||
.map((rowBOSItem, index) => {
|
||||
const rowBOS = rowBOSItem.rowBOS;
|
||||
const cur =
|
||||
rowBOS.find((item) => {
|
||||
return item.typeCode === type;
|
||||
}) || {};
|
||||
return {
|
||||
index: getIndex(beginDate, cur.date, cur.times),
|
||||
date: cur.date,
|
||||
value: (isNumber ? +cur.typeValue : cur.typeValue) || null,
|
||||
};
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.value) {
|
||||
// item.value = NaN
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return getList.sort((a, b) => a.index - b.index);
|
||||
}
|
||||
// 获取不升
|
||||
export function getType(type, allData = [], beginDate) {
|
||||
const getList = allData
|
||||
.map((rowBOSItem, index) => {
|
||||
const rowBOS = rowBOSItem.rowBOS;
|
||||
const cur =
|
||||
rowBOS.find((item) => {
|
||||
return item.typeCode === type;
|
||||
}) || {};
|
||||
return {
|
||||
index: getIndex(beginDate, cur.date, cur.times),
|
||||
date: cur.date,
|
||||
value: cur.typeValue !== '' ? (parseFloat(cur.typeValue) <= 35 ? '不升' : null) : null,
|
||||
};
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.value) {
|
||||
// item.value = NaN
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return getList.sort((a, b) => a.index - b.index);
|
||||
}
|
||||
// 合并标记内容
|
||||
export function setMergeTag(ymbolTextArr = [], symbolContent = []) {
|
||||
const arr = [];
|
||||
ymbolTextArr.forEach((item) => {
|
||||
symbolContent.forEach((res) => {
|
||||
if (item.index === res.index) {
|
||||
arr.push({
|
||||
...item,
|
||||
...res,
|
||||
value: (item.value !== null ? item.value : '') + (res.value !== null ? res.value : ''),
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
// 筛选手术产后日数
|
||||
export function postpartumDays(type, arr) {
|
||||
return arr.filter((item) => item.typeCode === type).map((i) => i.typeValue);
|
||||
}
|
||||
// 筛选体温
|
||||
export function getTypeAnimalHeat(type, allData = [], code, beginDate) {
|
||||
const getList = allData
|
||||
.map((rowBOSItem, index) => {
|
||||
const rowBOS = rowBOSItem.rowBOS;
|
||||
const cur =
|
||||
rowBOS.find((item) => {
|
||||
return item.typeCode === type;
|
||||
}) || {};
|
||||
return {
|
||||
index: getIndex(beginDate, cur.date, cur.times),
|
||||
date: cur.date,
|
||||
value: (+cur.collectionMode === +code ? +cur.typeValue : null) || null,
|
||||
};
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.value) {
|
||||
// item.value = NaN
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return getList.sort((a, b) => a.index - b.index);
|
||||
}
|
||||
// 设置折线
|
||||
export function getBrokenLine(type, allData = [], arr = [], list = [], topList = [], beginDate) {
|
||||
const result = [];
|
||||
const getList = allData
|
||||
.map((rowBOSItem, index) => {
|
||||
const rowBOS = rowBOSItem.rowBOS;
|
||||
const cur =
|
||||
rowBOS.find((item) => {
|
||||
return item.typeCode === type;
|
||||
}) || {};
|
||||
return {
|
||||
index: getIndex(beginDate, cur.date, cur.times),
|
||||
date: cur.date,
|
||||
value: +cur.typeValue,
|
||||
};
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.value) {
|
||||
// item.value = NaN
|
||||
}
|
||||
return item;
|
||||
});
|
||||
const _a = arr.filter((item) => item.value);
|
||||
const _b = list.filter((item) => item.value);
|
||||
const _c = topList.filter((item) => item.value);
|
||||
const mergingData = [..._a, ..._b, ..._c, { index: 50 }].sort((a, b) => a.index - b.index);
|
||||
let start = 0;
|
||||
mergingData.forEach((item) => {
|
||||
const _p = getList.sort((a, b) => a.index - b.index).slice(start, item.index);
|
||||
start = item.index + 1;
|
||||
result.push(_p);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
// 处理脉搏心率
|
||||
export function getHeartRate(
|
||||
type,
|
||||
allData = [],
|
||||
arr = [],
|
||||
topList = [],
|
||||
isNumber = true,
|
||||
beginDate
|
||||
) {
|
||||
const result = [];
|
||||
const getList = allData
|
||||
.map((rowBOSItem, index) => {
|
||||
const rowBOS = rowBOSItem.rowBOS;
|
||||
const cur =
|
||||
rowBOS.find((item) => {
|
||||
return item.typeCode === type;
|
||||
}) || {};
|
||||
return {
|
||||
index: getIndex(beginDate, cur.date, cur.times),
|
||||
date: cur.date,
|
||||
value: (isNumber ? +cur.typeValue : cur.typeValue) || null,
|
||||
};
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.value) {
|
||||
// item.value = NaN
|
||||
}
|
||||
return item;
|
||||
});
|
||||
const _a = arr.filter((item) => item.value);
|
||||
const _c = topList.filter((item) => item.value);
|
||||
const mergingData = [..._a, ..._c, { index: 50 }].sort((a, b) => a.index - b.index);
|
||||
let start = 0;
|
||||
mergingData.forEach((item) => {
|
||||
const _p = getList.slice(start, item.index).sort((a, b) => {
|
||||
return a.index - b.index;
|
||||
});
|
||||
start = item.index;
|
||||
result.push(_p);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function getIndex(beginDate, date, time) {
|
||||
if (beginDate === undefined || date === undefined) return;
|
||||
const diffTime =
|
||||
moment(date.substring(0, 10)).diff(moment(beginDate.substring(0, 10))) / 1000 / 3600 / 24;
|
||||
const diffIndex = parseInt(time.substring(0, 2));
|
||||
return diffTime * 6 + Math.floor(diffIndex / 4);
|
||||
}
|
||||
// 筛选35和40~42数据
|
||||
export function degreesOnline(allData, data, type) {
|
||||
const arr = allData.map((item, index) => {
|
||||
const cur = data?.find((res) => item.value === res.name && +res.isShowPlace === type) || null;
|
||||
return {
|
||||
index: index,
|
||||
date: item.date,
|
||||
value: cur?.name || null,
|
||||
};
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
// 35或42上断开的事件
|
||||
export function disconnectEvents(allData, data, code, type) {
|
||||
const arr = allData.map((item, index) => {
|
||||
const cur =
|
||||
data?.find(
|
||||
(res) => item.value === res.name && +res.isShowPlace === type && +res[code] === 1
|
||||
) || null;
|
||||
return {
|
||||
index: index,
|
||||
date: item.date,
|
||||
value: cur?.name || null,
|
||||
};
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
|
||||
export function getDrawCoolData(type, allData = [], isNumber = true, beginDate) {
|
||||
const getList = allData
|
||||
.map((rowBOSItem, index) => {
|
||||
const rowBOS = rowBOSItem.rowBOS;
|
||||
const cur =
|
||||
rowBOS.find((item) => {
|
||||
return item.typeCode === type;
|
||||
}) || {};
|
||||
return {
|
||||
index: getIndex(beginDate, cur.date, cur.times),
|
||||
date: cur.date + cur.times,
|
||||
value: (isNumber ? +cur.typeValue : cur.typeValue) || null,
|
||||
};
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.value) {
|
||||
// item.value = NaN
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return getList.sort((a, b) => a.index - b.index);
|
||||
}
|
||||
// 筛选降温getDrawData
|
||||
export function getDrawData(type, allData = [], code, beginDate) {
|
||||
const getList = allData
|
||||
.map((rowBOSItem, index) => {
|
||||
const rowBOS = rowBOSItem.rowBOS;
|
||||
const cur =
|
||||
rowBOS.find((item) => {
|
||||
return item.typeCode === type;
|
||||
}) || {};
|
||||
return {
|
||||
index: getIndex(beginDate, cur.date, cur.times),
|
||||
date: cur.date + cur.times,
|
||||
value: (+cur.collectionMode === +code ? +cur.typeValue : null) || null,
|
||||
};
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.value) {
|
||||
// item.value = NaN
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return getList.sort((a, b) => a.index - b.index);
|
||||
}
|
||||
Reference in New Issue
Block a user