Browse Source

feat: 辅助工具 签名

main
wally 2 years ago
parent
commit
a5bd57c23e
  1. 1
      .vscode/settings.json
  2. 14
      TODO.md
  3. 7
      api/modules/service.ts
  4. 12
      components/CodeFormItem/CodeFormItem.vue
  5. 5
      components/DetailAidRecord/DetailAidRecord.vue
  6. 65
      components/JMRS/JMRS.vue
  7. 120
      components/Sign/Sign.vue
  8. 54
      components/Tool/Tool.vue
  9. 6
      config/code.ts
  10. 3
      hooks/useNextNode.ts
  11. 6
      pages.json
  12. 43
      pages/detail1/detail1.vue
  13. 9
      pages/detail2/detail2.vue
  14. 106
      pages/thrombolysisRecord/thrombolysisRecord.vue
  15. 44
      store/modules/service.ts

1
.vscode/settings.json

@ -25,6 +25,7 @@
"SFXHCZ", "SFXHCZ",
"SFYNCZ", "SFYNCZ",
"splashscreen", "splashscreen",
"Thrombolysis",
"TZCZYS", "TZCZYS",
"TZJL", "TZJL",
"uniui", "uniui",

14
TODO.md

@ -0,0 +1,14 @@
# TODOList
1. 配置路径的使用
2. 代理路径的加入, 在http 或 post方法封装的地方统一修改就行
3. token过期重新请求的问题
4. 节点列表 服务端数据不全 没写
5. 详情直接显示对应的模块 url里填个type的参数 onLoad根据参数显示
6. 辅助工具 与 签名的默认显示
7. 签名的上传? 没有接口
H5默认生成的是base64
APP端生成的是文件路径
建议根据条件 两种上传方式
8. 详情表单里 如: 选了其他 需要填写的 建议将其他填写的内容独立为一个字段 前端好回显
ra(mg) 那个也是一样的道理

7
api/modules/service.ts

@ -1,4 +1,5 @@
import { post } from '@/api/base' import { post } from '@/api/base'
// import { useUserStoreWidthOut } from '@/store/modules/user' // import { useUserStoreWidthOut } from '@/store/modules/user'
// const userStore = useUserStoreWidthOut() // const userStore = useUserStoreWidthOut()
@ -33,4 +34,10 @@ export const serviceApi = {
// 查 下一个节点 // 查 下一个节点
getNextNode: (firstAidId: string) => post('/firstAid/next', { param: { firstAidId } }), getNextNode: (firstAidId: string) => post('/firstAid/next', { param: { firstAidId } }),
// 查溶栓记录
getThrombolysisRecord: (firstAidId: string) => post('/firstAid/queryThrombolysisRecord', { param: { firstAidId } }),
// 导出溶栓记录
exportThrombolysisRecord: (firstAidId: string) => post('/firstAid/exportThrombolysisRecord', { param: { firstAidId } }),
} }

12
components/CodeFormItem/CodeFormItem.vue

@ -1,28 +1,34 @@
<template> <template>
<view> <view>
<!-- input -->
<uni-easyinput :value="value" type="text" placeholder="请输入" @change="$emit('on-change', $event)" @confirm="$emit('on-change', $event)" <uni-easyinput :value="value" type="text" placeholder="请输入" @change="$emit('on-change', $event)" @confirm="$emit('on-change', $event)"
v-if="config.type === 'input'" /> v-if="config.type === 'input'" />
<!-- datetime -->
<uni-datetime-picker type="datetime" :value="value" :modelValue="value" @change="$emit('on-change', $event)" <uni-datetime-picker type="datetime" :value="value" :modelValue="value" @change="$emit('on-change', $event)"
v-else-if="config.type === 'datetime'" /> v-else-if="config.type === 'datetime'" />
<!-- radio -->
<uni-data-checkbox :value="value" :localdata="config.range" @change="$emit('on-change', $event.detail.value)" <uni-data-checkbox :value="value" :localdata="config.range" @change="$emit('on-change', $event.detail.value)"
v-else-if="config.type === 'radio'" /> v-else-if="config.type === 'radio'" />
<!-- checkbox -->
<uni-data-checkbox :value="value" :multiple="true" :localdata="config.range" @change="$emit('on-change', $event.detail.value)" <uni-data-checkbox :value="value" :multiple="true" :localdata="config.range" @change="$emit('on-change', $event.detail.value)"
v-else-if="config.type === 'checkbox'" /> v-else-if="config.type === 'checkbox'" />
<!-- select -->
<uni-data-select :value="value" :modelValue="value" :localdata="config.range" @change="$emit('on-change', $event)" <uni-data-select :value="value" :modelValue="value" :localdata="config.range" @change="$emit('on-change', $event)"
v-else-if="config.type === 'select'"></uni-data-select> v-else-if="config.type === 'select'"></uni-data-select>
<!-- text -->
<view v-else-if="config.type === 'text'" class="flex-1 flex justify-end uni-secondary-color u-font-sm" style="height: 35px;" <view v-else-if="config.type === 'text'" class="flex-1 flex justify-end uni-secondary-color u-font-sm" style="height: 35px;"
@click="$emit('on-click', config.text)"> @click="$emit('on-click', code)">
{{ value }} {{ value }}
<uni-icons type="forward" v-if="config.rightArrow" size="16" /> <uni-icons type="forward" v-if="config.rightArrow" size="16" />
</view> </view>
<!-- 跳页面的 --> <!-- 跳页面的 page -->
<view v-else-if="config.type === 'page'" class="flex-1 flex justify-end uni-secondary-color u-font-sm" style="height: 35px;" <view v-else-if="config.type === 'page'" class="flex-1 flex justify-end uni-secondary-color u-font-sm" style="height: 35px;"
@click="onOpenPage"> @click="onOpenPage">
<text class="u-m-r-20">{{ value || config.rightText }}</text> <text class="u-m-r-20">{{ value || config.rightText }}</text>
@ -44,7 +50,7 @@ interface IProps {
const firstAidId = inject<Ref<string>>('firstAidId') const firstAidId = inject<Ref<string>>('firstAidId')
const props = defineProps<IProps>() const props = defineProps<IProps>()
defineEmits(['on-change']) defineEmits(['on-change', 'on-click'])
const config = computed<IConfig>(() => CODE_DICT[props.code]) const config = computed<IConfig>(() => CODE_DICT[props.code])

5
components/DetailAidRecord/DetailAidRecord.vue

@ -52,6 +52,8 @@
</view> </view>
</uni-forms> </uni-forms>
</view> </view>
</template> </template>
@ -120,10 +122,7 @@ async function onChange(code: string, value: string) {
} }
} }
function init() { function init() {
// store // store
if (!currentPatient.value) return if (!currentPatient.value) return
// console.log('aid record init', currentPatient.value.recordValDict['RYPG-NIHSS'][0]); // console.log('aid record init', currentPatient.value.recordValDict['RYPG-NIHSS'][0]);

65
components/JMRS/JMRS.vue

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<uni-forms-item v-for="key in CODE_LIST_1" :key="key" :label="CODE_DICT[key].text" :name="key"> <uni-forms-item v-for="key in CODE_LIST_1" :key="key" :label="CODE_DICT[key].text" :name="key">
<CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" /> <CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" @on-click="onClickCodeItem" />
</uni-forms-item> </uni-forms-item>
<!-- 溶栓开始前 --> <!-- 溶栓开始前 -->
@ -35,12 +35,26 @@
<CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" /> <CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" />
</uni-forms-item> </uni-forms-item>
</template> </template>
<uni-popup ref="popupRef" type="center">
<view class="modal-wrap">
<view class="tab-wrap">
<view class="tab-item" :class="{ active: showType === 'sign' }" @click="showType = 'sign'">家属签名</view>
<view class="tab-item" :class="{ active: showType === 'tool' }" @click="showType = 'tool'">辅助工具</view>
</view>
<!-- 辅助工具 -->
<Tool v-if="showType === 'tool'" />
<!-- 家属签名 -->
<Sign v-else @on-close="popupRef.close()" />
</view>
</uni-popup>
</view> </view>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { CODE_DICT } from '@/config/code'; import { CODE_DICT } from '@/config/code';
import { computed, reactive } from 'vue'; import { computed, reactive, ref } from 'vue';
import { computeShow } from '@/utils/common' import { computeShow } from '@/utils/common'
import { useServiceStore } from '@/store/modules/service'; import { useServiceStore } from '@/store/modules/service';
@ -48,8 +62,10 @@ const emits = defineEmits(['on-change'])
const serviceStore = useServiceStore() const serviceStore = useServiceStore()
const popupRef = ref()
const showType = ref('tool') // tool sign ->
const currentPatient = computed(() => serviceStore.currentPatient) const currentPatient = computed(() => serviceStore.currentPatient)
const currentCar = computed(() => serviceStore.currentCar)
const CODE_LIST_1 = ['JMRS-TOOL', 'JMRS-TH-TIME', 'JMRS-SIGN'] const CODE_LIST_1 = ['JMRS-TOOL', 'JMRS-TH-TIME', 'JMRS-SIGN']
// form item list // form item list
@ -72,6 +88,19 @@ function onChange(key, event) {
emits('on-change', key, event) emits('on-change', key, event)
} }
//
function onClickCodeItem(code: string) {
console.log(code);
if (code === 'JMRS-TOOL') {
showType.value = 'tool'
popupRef.value.open()
} else if (code === 'JMRS-SIGN') {
showType.value = 'sign'
popupRef.value.open()
}
}
function init() { function init() {
// store // store
@ -93,3 +122,33 @@ function init() {
init() init()
</script> </script>
<style lang="scss" scoped>
.modal-wrap {
width: 800px;
background-color: #fff;
border-radius: 20px 20px 0 0;
overflow: hidden;
.tab-wrap {
display: flex;
align-items: center;
height: 5vw;
justify-content: stretch;
.tab-item {
height: 100%;
flex: 1;
display: flex;
justify-content: center;
align-items: center;
background-color: #ccc;
&.active {
background-color: #fff;
}
}
}
}
</style>

120
components/Sign/Sign.vue

@ -0,0 +1,120 @@
<template>
<view class="u-p-50">
<uni-collapse>
<uni-collapse-item :border="false" :open="false" title="知情同意书存档">
<view class="u-p-l-40">知情同意书内容</view>
</uni-collapse-item>
</uni-collapse>
<canvas ref="canvasRef" style="width: 100%; height: 400px; background-color: #eee;" canvas-id="canvas" id="canvas" @touchstart="onStart"
@touchmove="onMove" @touchend="onEnd"></canvas>
<view class="flex u-p-t-40">
<u-button size="medium" class="bg-main" type="primary" shape="circle" @click="onReset">重写</u-button>
<u-button size="medium" class="bg-main" type="primary" shape="circle" @click="onSubmit">确认签名</u-button>
</view>
</view>
</template>
<script >
import { createInjectionState } from '@vueuse/core'
let ctx
let startX = 0
let startY = 0
let drawing = false
let pathArr = []
let canvasWidth, canvasHeight
export default {
name: 'SignComp',
mounted() {
ctx = uni.createCanvasContext('canvas')
ctx.setStrokeStyle('#333')
ctx.setLineWidth(3)
const query = uni.createSelectorQuery().in(this);
query.select('#canvas').boundingClientRect(data => {
canvasWidth = data.width
canvasHeight = data.height
}).exec();
},
methods: {
onStart(event) {
drawing = true
startX = event.changedTouches[0].x
startY = event.changedTouches[0].y
pathArr.push([])
},
onMove(event) {
event.preventDefault()
if (!drawing) return
const { x, y } = event.changedTouches[0]
// console.log(x, y);
pathArr[pathArr.length - 1].push([x, y])
this.drawLine()
ctx.stroke()
ctx.draw()
},
onEnd(event) {
drawing = false
},
drawLine() {
if (!pathArr.length) return
pathArr.forEach(path => {
// path
if (path.length > 0) {
path.forEach((point, index) => {
if (index === 0) {
ctx.moveTo(point[0], point[1])
} else {
ctx.lineTo(point[0], point[1])
}
})
}
})
},
onReset() {
pathArr = []
ctx.clearRect(0, 0, canvasWidth, canvasHeight)
ctx.draw()
},
onSubmit() {
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: canvasWidth,
height: canvasHeight,
canvasId: 'canvas',
success: res => {
// H5tempFilePath base64
// #ifdef APP-PLUS
//
this.uploadFile(res.tempFilePath)
// #endif
// #ifdef H5
// TODO: base64
this.uploadBase64(res.tempFilePath)
// #endif
//
this.$emit('on-close')
}
})
},
async uploadFile(filePath) {
console.log(filePath);
},
async uploadBase64(base64) { }
}
}
</script>

54
components/Tool/Tool.vue

@ -0,0 +1,54 @@
<template>
<view class="tool-wrap">
<video class="tool-video" src="" />
<view class="tool-footer">
<view class="uni-font-16 font-bold u-m-b-16">百人中使用药物结果分布情况</view>
<view class="flex justify-between">
<view v-for="(item, index) in list" :key="index" class="tool-footer-item">
<image class="image-icon" :src="item.image" mode="scaleToFill" />
<text>{{ item.text }}</text>
</view>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
const list = [
{ image: '/static/images/car.png', text: '改善' },
{ image: '/static/images/car.png', text: '正常或接近正常' },
{ image: '/static/images/car.png', text: '严重残疾或死亡' },
{ image: '/static/images/car.png', text: '无明显变化' },
{ image: '/static/images/car.png', text: '脑出血后早期加重' },
{ image: '/static/images/car.png', text: '加重' },
]
</script>
<style lang="scss" scoped>
.tool-wrap {
padding: 24px;
.tool-video {
display: block;
width: 100%;
margin-bottom: 20px;
height: 400px;
}
.tool-footer {
.tool-footer-item {
display: flex;
align-items: center;
color: #666
}
.image-icon {
width: 24px;
height: 24px;
margin-right: 3px;
}
}
}
</style>

6
config/code.ts

@ -199,10 +199,9 @@ export const AID_RECORD_DICT = {
export const CODE_JMRS = { export const CODE_JMRS = {
'JMRS-TOOL': { 'JMRS-TOOL': {
text: '辅助工具', text: '辅助工具',
type: 'page', type: 'text',
rightText: '去查看', rightText: '去查看',
rightArrow: true, rightArrow: true,
page: { name: 'JMRS-TOOL' },
}, },
'JMRS-TH-TIME': { 'JMRS-TH-TIME': {
text: '谈话开始时间', text: '谈话开始时间',
@ -212,10 +211,9 @@ export const CODE_JMRS = {
}, },
'JMRS-SIGN': { 'JMRS-SIGN': {
text: '签署知情同意书', text: '签署知情同意书',
type: 'page', type: 'text',
rightText: '去签署', rightText: '去签署',
rightArrow: true, rightArrow: true,
page: { name: 'JMRS-SIGN' },
}, },
'JMRS-Q-NIHSS': { 'JMRS-Q-NIHSS': {
text: 'NIHSS评分', text: 'NIHSS评分',

3
hooks/useNextNode.ts

@ -24,7 +24,7 @@ export function useNextNode() {
async function getNextNode() { async function getNextNode() {
if (!currentFirstAidId.value) { if (!currentFirstAidId.value) {
uni.$u.alertError('没有急救id信息') uni.$u.toast('没有急救id信息')
return return
} }
try { try {
@ -50,6 +50,7 @@ export function useNextNode() {
// 循环查下个节点 // 循环查下个节点
function intervalGetNextCode() { function intervalGetNextCode() {
getNextNode()
timer && clearInterval(timer) timer && clearInterval(timer)
timer = setInterval(() => { timer = setInterval(() => {
getNextNode() getNextNode()

6
pages.json

@ -64,6 +64,12 @@
"style": { "style": {
"navigationBarTitleText": "JMRS-SIGN" "navigationBarTitleText": "JMRS-SIGN"
} }
},
{
"path": "pages/thrombolysisRecord/thrombolysisRecord",
"style": {
"navigationBarTitleText": "thrombolysisRecord"
}
} }
], ],
"globalStyle": { "globalStyle": {

43
pages/detail1/detail1.vue

@ -16,7 +16,7 @@
<text>高效 便捷 精准</text> <text>高效 便捷 精准</text>
</view> </view>
<view class="btn-create"> <view class="btn-create" @click="openThrombolysisRecord">
<image class="icon-plus" src="@/static/images/plus.png" mode="scaleToFill" /> <image class="icon-plus" src="@/static/images/plus.png" mode="scaleToFill" />
急诊溶栓记录 急诊溶栓记录
</view> </view>
@ -36,7 +36,7 @@
<uni-icons type="compose" color="#888" size="24" /> <uni-icons type="compose" color="#888" size="24" />
</view> </view>
<u-tag text="AS急性脑卒中" class="u-m-r-20" type="primary" size="mini" /> <u-tag :text="firstAidZlType" class="u-m-r-20" type="primary" size="mini" />
<u-tag text="发病时间" type="primary" size="mini" /> <u-tag text="发病时间" type="primary" size="mini" />
<view class="u-tips-color u-font-sm u-p-t-20"> <view class="u-tips-color u-font-sm u-p-t-20">
@ -69,16 +69,16 @@
</view> </view>
</view> </view>
<u-tag text="AS急性脑卒中" type="primary" size="mini" /> <u-tag :text="zdjg" type="primary" size="mini" />
<view class="u-tips-color u-font-sm u-p-t-20 flex "> <view class="u-tips-color u-font-sm u-p-t-20 flex ">
身高<text class="u-m-r-20">1222222222</text> 身高<text class="u-m-r-20">{{ height }}</text>
体重<text class="u-m-r-20">1222222222</text> 体重<text class="u-m-r-20">{{ weight }}</text>
BMI<text class="u-m-r-20">1222222222</text> BMI<text class="u-m-r-20">{{ bmi }}</text>
</view> </view>
<view class="u-tips-color u-font-sm u-p-t-20 flex "> <view class="u-tips-color u-font-sm u-p-t-20 flex ">
脉搏<text class="u-m-r-20">1222222222</text> 脉搏<text class="u-m-r-20">{{ pulse }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -131,7 +131,7 @@
<!-- <CreatePatient @on-scan="uploadImage" @on-cancel="onCancel" @on-confirm="onConfirm" /> --> <!-- <CreatePatient @on-scan="uploadImage" @on-cancel="onCancel" @on-confirm="onConfirm" /> -->
<!-- float button --> <!-- float button -->
<FloatButton /> <!-- <FloatButton /> -->
</view> </view>
</template> </template>
@ -140,15 +140,29 @@ import { onLoad } from '@dcloudio/uni-app';
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { useServiceStore } from '@/store/modules/service'; import { useServiceStore } from '@/store/modules/service';
import { GET_GENDER_TEXT_BY_CODE } from '@/config/service'; import { GET_GENDER_TEXT_BY_CODE } from '@/config/service';
import { computeBMI } from '@/utils/common';
import { FIRST_AID_ZL_TYPE } from '@/config/service'
const serviceStore = useServiceStore() const serviceStore = useServiceStore()
const firstAidId = ref('') const firstAidId = ref('')
const currentPatient = computed(() => serviceStore.currentPatient) const currentPatient = computed(() => serviceStore.currentPatient)
const mrs = computed(() => serviceStore.getMRS) const mrs = computed(() => serviceStore.getCodeValue('RYPG-MRS'))
const nihss = computed(() => serviceStore.getNIHSS) const nihss = computed(() => serviceStore.getCodeValue('RYPG-NIHSS'))
const ssy = computed(() => serviceStore.getSSY) const ssy = computed(() => serviceStore.getCodeValue('RYPG-SYSTOLIC-PRESSURE')) //
const szy = computed(() => serviceStore.getSZY) const szy = computed(() => serviceStore.getCodeValue('RYPG-DIASTOLIC-PRESSURE')) //
const height = computed(() => serviceStore.getCodeValue('RYPG-HEIGHT'))
const weight = computed(() => serviceStore.getCodeValue('RYPG-WEIGHT'))
const bmi = computed(() => computeBMI(height.value, weight.value))
const pulse = computed(() => serviceStore.getCodeValue("RYPG-PULSE")) //
const zdjg = computed(() => serviceStore.getCodeValue("RYPG-ZDJG")) //
//
const firstAidZlType = computed(() => {
const value = currentPatient.value?.firstAidZlType
return value === undefined ? '' : FIRST_AID_ZL_TYPE[value].text
})
function onClickLeft() { function onClickLeft() {
@ -171,6 +185,11 @@ async function getAidInfo(firstAidId: string) {
} }
} }
//
function openThrombolysisRecord() {
uni.$u.openPage('thrombolysisRecord', false, `firstAidId=${firstAidId.value}`)
}
onLoad((option) => { onLoad((option) => {
if (!option?.firstAidId) { if (!option?.firstAidId) {
uni.$u.toast('url中缺少急救id参数') uni.$u.toast('url中缺少急救id参数')

9
pages/detail2/detail2.vue

@ -70,7 +70,7 @@
</view> </view>
</view> </view>
<view class="btn-create" @click="onCreateRecord"> <view class="btn-create" @click="openThrombolysisRecord">
<image class="icon-plus" src="@/static/images/plus-white.png" mode="scaleToFill" /> <image class="icon-plus" src="@/static/images/plus-white.png" mode="scaleToFill" />
急诊溶栓记录 急诊溶栓记录
</view> </view>
@ -126,10 +126,9 @@ async function getAidInfo(firstAidId: string) {
function onClickRight() { function onClickRight() {
uni.$u.openPage('detail1', true, `firstAidId=${firstAidId.value}`) uni.$u.openPage('detail1', true, `firstAidId=${firstAidId.value}`)
} }
//
// function openThrombolysisRecord() {
function onCreateRecord() { uni.$u.openPage('thrombolysisRecord', false, `firstAidId=${firstAidId.value}`)
} }
onBackPress(() => { onBackPress(() => {

106
pages/thrombolysisRecord/thrombolysisRecord.vue

@ -0,0 +1,106 @@
<template>
<uni-card>
<template v-slot:title>
<view class="flex u-p-30 justify-between">
<text class="flex-1 u-font-16 font-bold">溶栓记录</text>
<u-button size="mini" class="bg-main" type="primary" @click="onExport">导出</u-button>
</view>
</template>
<u-time-line>
<u-time-line-item node-top="4" v-for="(item, index) in data" :key="index">
<template v-slot:node>
<uni-icons type="smallcircle" :color="computeColor(item.exceed)" size="16" />
</template>
<template v-slot:content>
<view class="flex justify-between">
<text class="font-xl font-bold">{{ item.name }}</text>
</view>
<view class="u-m-t-20">{{ item.text }}</view>
</template>
</u-time-line-item>
</u-time-line>
</uni-card>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue';
interface IDataItem {
name: string;
time: string;
text: string;
exceed: number
}
const firstAidId = ref('')
const data = ref<IDataItem[]>([])
//
async function onExport() {
try {
const res = await uni.$u.api.exportThrombolysisRecord(firstAidId.value)
if (!res) {
uni.$u.alertError('返回路径无效')
return
}
// #ifdef APP-PLUS
uni.downloadFile({
url: res,
success(res) {
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
});
}
});
// #endif
// #ifdef H5
location.href = res
// #endif
} catch (error) {
uni.$u.alertError(error)
}
}
//
async function getData(id) {
try {
const res = await uni.$u.api.getThrombolysisRecord(id)
if (res?.recordList?.length > 0) {
data.value = res.recordList || []
} else {
data.value = []
}
console.log(res);
} catch (error) {
data.value = []
uni.$u.alertError(error)
}
}
//
function computeColor(status: number) {
const config = {
0: '#00C767', //
1: '#FF4A44' //
}
return config[status] || '#888'
}
onLoad((option) => {
if (!option?.firstAidId) {
uni.$u.alertError('url缺少急救id信息')
return
}
firstAidId.value = option.firstAidId
getData(option.firstAidId)
})
</script>
<style lang="scss" scoped>
</style>

44
store/modules/service.ts

@ -47,48 +47,18 @@ export const useServiceStore = defineStore({
host: ({ device }) => device?.host || '', host: ({ device }) => device?.host || '',
carNo: ({ currentCar }) => currentCar?.carNo || '', // 平车编号 carNo: ({ currentCar }) => currentCar?.carNo || '', // 平车编号
currentFirstAidId: ({ currentPatient }) => currentPatient?.firstAidId, currentFirstAidId: ({ currentPatient }) => currentPatient?.firstAidId,
// 查mrs NIHSS评分 // 获取急救信息 code 对应的answer
getScore: getCodeValue({ currentPatient }) {
({ score }) => return (code: string) => {
(type: string) => if (!currentPatient?.recordValDict || !currentPatient.recordValDict[code] || !currentPatient.recordValDict[code][0]) {
score[type], return ''
}
getMRS({ currentPatient }) { return currentPatient?.recordValDict[code][0]?.answer[0] || ''
if (!currentPatient?.recordValDict || !currentPatient.recordValDict['RYPG-MRS'] || !currentPatient.recordValDict['RYPG-MRS'][0]) {
return ''
}
return currentPatient?.recordValDict['RYPG-MRS'][0]?.answer[0] || ''
},
getNIHSS({ currentPatient }) {
if (!currentPatient?.recordValDict || !currentPatient.recordValDict['RYPG-NIHSS'] || !currentPatient.recordValDict['RYPG-NIHSS'][0]) {
return ''
}
return currentPatient?.recordValDict['RYPG-NIHSS'][0]?.answer[0] || ''
},
// 收缩压
getSSY({ currentPatient }) {
const code = 'RYPG-SYSTOLIC-PRESSURE'
if (!currentPatient?.recordValDict || !currentPatient.recordValDict[code] || !currentPatient.recordValDict[code][0]) {
return ''
} }
return currentPatient?.recordValDict[code][0]?.answer[0] || ''
},
// 舒张压压
getSZY({ currentPatient }) {
const code = 'RYPG-DIASTOLIC-PRESSURE'
if (!currentPatient?.recordValDict || !currentPatient.recordValDict[code] || !currentPatient.recordValDict[code][0]) {
return ''
}
return currentPatient?.recordValDict[code][0]?.answer[0] || ''
}, },
}, },
actions: { actions: {
// 设置 mrs NIHSS评分
setScore(type: string, value: string) {
this.score[type] = value
},
setCurrentPatient(patient: IPatient | null) { setCurrentPatient(patient: IPatient | null) {
this.currentPatient = patient this.currentPatient = patient
}, },

Loading…
Cancel
Save