Browse Source

feat: 急救记录 mrs评分

main
wally 2 years ago
parent
commit
d214c07562
  1. 5
      .vscode/settings.json
  2. 27
      components/CodeFormItem/CodeFormItem.vue
  3. 25
      components/DetailAidRecord/DetailAidRecord.vue
  4. 28
      components/DetailBase/DetailBase.vue
  5. 95
      components/JMRS/JMRS.vue
  6. 25
      components/NameGenderAge/NameGenderAge.vue
  7. 184
      config/code.ts
  8. 10
      config/service.ts
  9. 17
      hooks/useGetFirstAidId.ts
  10. 24
      pages.json
  11. 8
      pages/JMRS-SIGN/JMRS-SIGN.vue
  12. 8
      pages/JMRS-TOOL/JMRS-TOOL.vue
  13. 37
      pages/MRS/MRS.vue
  14. 8
      pages/NIHSS/NIHSS.vue
  15. 26
      pages/detail2/detail2.vue
  16. 2
      pages/loading/loading.vue
  17. 30
      store/modules/service.ts
  18. 8
      uni.scss
  19. 15
      utils/common.ts

5
.vscode/settings.json

@ -8,20 +8,25 @@
"easyinput", "easyinput",
"FBSJ", "FBSJ",
"FILESYSTEMS", "FILESYSTEMS",
"GYSD",
"idcard", "idcard",
"JBXX", "JBXX",
"JCWB", "JCWB",
"JDJL",
"JMRS", "JMRS",
"localdata", "localdata",
"LYFS", "LYFS",
"NIHSS", "NIHSS",
"nvue", "nvue",
"plusempty", "plusempty",
"RSCS",
"RSYW",
"RYPG", "RYPG",
"SFXHCZ", "SFXHCZ",
"SFYNCZ", "SFYNCZ",
"splashscreen", "splashscreen",
"TZCZYS", "TZCZYS",
"TZJL",
"uniui", "uniui",
"uview", "uview",
"vueuse", "vueuse",

27
components/CodeFormItem/CodeFormItem.vue

@ -1,6 +1,7 @@
<template> <template>
<view> <view>
<uni-easyinput :value="value" type="text" placeholder="请输入" @input="$emit('on-change', $event)" v-if="config.type === 'input'" /> <uni-easyinput :value="value" type="text" placeholder="请输入" @change="$emit('on-change', $event)" @confirm="$emit('on-change', $event)"
v-if="config.type === 'input'" />
<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'" />
@ -8,6 +9,10 @@
<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'" />
<uni-data-checkbox :value="value" :multiple="true" :localdata="config.range" @change="$emit('on-change', $event.detail.value)"
v-else-if="config.type === 'checkbox'" />
<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>
@ -16,23 +21,39 @@
{{ value }} {{ value }}
<uni-icons type="forward" v-if="config.rightArrow" size="16" /> <uni-icons type="forward" v-if="config.rightArrow" size="16" />
</view> </view>
<!-- 跳页面的 -->
<view v-else-if="config.type === 'page'" class="flex-1 flex justify-end uni-secondary-color u-font-sm" style="height: 35px;"
@click="onOpenPage">
<text class="u-m-r-20">{{ value || config.rightText }}</text>
<uni-icons type="forward" v-if="config.rightArrow" size="16" />
</view>
</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 type { IConfig } from '@/config/code' import type { IConfig } from '@/config/code'
import { computed } from 'vue' import { computed, inject } from 'vue'
import type { Ref } from 'vue'
interface IProps { interface IProps {
code: string code: string
value: string value: string | Array<string>
} }
const firstAidId = inject<Ref<string>>('firstAidId')
const props = defineProps<IProps>() const props = defineProps<IProps>()
defineEmits(['on-change']) defineEmits(['on-change'])
const config = computed<IConfig>(() => CODE_DICT[props.code]) const config = computed<IConfig>(() => CODE_DICT[props.code])
// mrs nihss
// code
function onOpenPage() {
const name = CODE_DICT[props.code].page?.name
uni.$u.openPage(name, false, `code=${props.code}&firstAidId=${firstAidId?.value}`)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

25
components/DetailAidRecord/DetailAidRecord.vue

@ -1,7 +1,7 @@
<template> <template>
<view class=""> <view class="">
<uni-section type="line" title="患者急救记录" titleFontSize="16px"> </uni-section> <uni-section type="line" title="患者急救记录" titleFontSize="16px"> </uni-section>
<uni-forms :modelValue="codeAidForm" :label-width="160" class="white uni-radius-lg uni-pa-10"> <uni-forms :modelValue="codeAidForm" :label-width="160" err-show-type="toast" class="white uni-radius-lg uni-pa-10">
<uni-forms-item :name="key" v-for="key in part1" :key="key"> <uni-forms-item :name="key" v-for="key in part1" :key="key">
<template v-slot:label> <template v-slot:label>
<view class="full-height flex" style="width: 135px"> <view class="full-height flex" style="width: 135px">
@ -32,7 +32,9 @@
@change="onChange('JMRS-Y', $event.detail.value)"> @change="onChange('JMRS-Y', $event.detail.value)">
</uni-data-checkbox> </uni-data-checkbox>
</uni-forms-item> </uni-forms-item>
<view class="white">
<!-- 未溶栓原因 是否静脉溶栓=否的时候显示-->
<view class="white" v-if="codeAidForm['JMRS-Y'] === '否'">
<view>未溶栓原因</view> <view>未溶栓原因</view>
<uni-data-checkbox mode="list" :multiple="true" v-model="codeAidForm['JMRS-WRSYY']" :localdata="CODE_DICT['JMRS-WRSYY'].range" <uni-data-checkbox mode="list" :multiple="true" v-model="codeAidForm['JMRS-WRSYY']" :localdata="CODE_DICT['JMRS-WRSYY'].range"
class="white uni-radius-lg uni-pa-6" @change="onChange('JMRS-WRSYY', $event.detail.value)"> class="white uni-radius-lg uni-pa-6" @change="onChange('JMRS-WRSYY', $event.detail.value)">
@ -42,19 +44,26 @@
@change="onChange('JMRS-WRSYY-ELSE', $event)" /> @change="onChange('JMRS-WRSYY-ELSE', $event)" />
</view> </view>
</view> </view>
<!-- 是否静脉溶栓=是的时候显示-->
<view class="white" v-else>
<JMRS @on-change="onChange" />
</view>
</uni-forms> </uni-forms>
</view> </view>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, computed, inject, ref } from 'vue'; import { reactive, computed, inject } from 'vue';
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { GET_GENDER_TEXT_BY_CODE, CHU_BU_PAN_DUAN } from '@/config/service' import { GET_GENDER_TEXT_BY_CODE, CHU_BU_PAN_DUAN } from '@/config/service'
import { useServiceStore } from '@/store/modules/service'; import { useServiceStore } from '@/store/modules/service';
import { CODE_DICT } from '@/config/code'; import { CODE_DICT } from '@/config/code';
import { computeBMI } from '@/utils/common' import { computeBMI } from '@/utils/common'
defineExpose({ init })
const firstAidId = inject<Ref<string>>('firstAidId') const firstAidId = inject<Ref<string>>('firstAidId')
const serviceStore = useServiceStore() const serviceStore = useServiceStore()
@ -94,8 +103,14 @@ async function onChange(code: string, value: string) {
return return
} }
if (code === 'RYPG-HEIGHT') { if (code === 'RYPG-HEIGHT') {
// BMI
codeAidForm['RYPG-BMI'] = computeBMI(value, codeAidForm['RYPG-WEIGHT']) codeAidForm['RYPG-BMI'] = computeBMI(value, codeAidForm['RYPG-WEIGHT'])
} }
if (code.includes('_ELSE')) {
// TODO:
return
}
const answer = typeof value === 'string' ? [value] : value const answer = typeof value === 'string' ? [value] : value
const param = { codeAndAnswerList: [{ questionCode: code, answer, time: '' }], firstAidId: firstAidId?.value, sourceId: '', sourceType: '' } const param = { codeAndAnswerList: [{ questionCode: code, answer, time: '' }], firstAidId: firstAidId?.value, sourceId: '', sourceType: '' }
await uni.$u.api.updateAidCode(param) await uni.$u.api.updateAidCode(param)
@ -107,6 +122,8 @@ async function onChange(code: string, value: string) {
function init() { function init() {
console.log('aid record init');
// store // store
if (!currentPatient.value) return if (!currentPatient.value) return

28
components/DetailBase/DetailBase.vue

@ -1,5 +1,5 @@
<template> <template>
<view class=""> <view>
<uni-section type="line" title="患者基本信息" titleFontSize="16px"> </uni-section> <uni-section type="line" title="患者基本信息" titleFontSize="16px"> </uni-section>
<uni-forms :modelValue="baseInfo" :label-width="160" class="white uni-radius-lg uni-pa-10"> <uni-forms :modelValue="baseInfo" :label-width="160" class="white uni-radius-lg uni-pa-10">
<uni-forms-item label="扫描身份证" name="" @click="onScan"> <uni-forms-item label="扫描身份证" name="" @click="onScan">
@ -28,8 +28,8 @@
</uni-forms-item> </uni-forms-item>
<template v-for="(item, key) in codeForm" :key="key"> <template v-for="(item, key) in codeForm" :key="key">
<uni-forms-item :name="key" :label="CODE_DICT[key].text" v-if="computeShow(key)"> <uni-forms-item :name="key" :label="CODE_DICT[key].text" v-if="computeShow(key, codeForm)">
<CodeFormItem :code="key" :value="item" :show="computeShow(key)" @on-change="onChange(key, $event)" /> <CodeFormItem :code="key" :value="item" :show="computeShow(key, codeForm)" @on-change="onChange(key, $event)" />
</uni-forms-item> </uni-forms-item>
</template> </template>
</uni-forms> </uni-forms>
@ -48,6 +48,9 @@ import { useUserStore } from '@/store/modules/user'
import { GENDER_LIST, FIRST_AID_ZL_TYPE } from '@/config/service' import { GENDER_LIST, FIRST_AID_ZL_TYPE } from '@/config/service'
import { CODE_DICT } from '@/config/code'; import { CODE_DICT } from '@/config/code';
import { useServiceStore } from '@/store/modules/service'; import { useServiceStore } from '@/store/modules/service';
import { computeShow } from '@/utils/common'
defineExpose({ init })
const firstAidId = inject<Ref<string>>('firstAidId') const firstAidId = inject<Ref<string>>('firstAidId')
const userStore = useUserStore() const userStore = useUserStore()
@ -77,18 +80,6 @@ const nationList = ref([])
const token = computed(() => userStore.token) const token = computed(() => userStore.token)
const currentPatient = computed(() => serviceStore.currentPatient) const currentPatient = computed(() => serviceStore.currentPatient)
//
async function onSubmit() {
const param = { ...baseInfo, }
try {
const { firstAidId, firstAidStatus } = await uni.$u.api.createAid(param)
uni.$u.toast('创建成功')
uni.$u.openPage('detail2', false, `firstAidId=${firstAidId}&firstAidStatus=${firstAidStatus}`)
} catch (error) {
uni.$u.alertError(error)
}
}
// //
function onScan() { function onScan() {
uni.chooseImage({ uni.chooseImage({
@ -173,13 +164,6 @@ async function onChange(code: string, value: string) {
} }
} }
// code form
function computeShow(code: string) {
const { showType } = CODE_DICT[code]
if (!showType) return true
return (showType.type === 'value' && codeForm[showType.code] === showType.value)
}
// //
async function getNationList() { async function getNationList() {
try { try {

95
components/JMRS/JMRS.vue

@ -0,0 +1,95 @@
<template>
<view>
<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)" />
</uni-forms-item>
<!-- 溶栓开始前 -->
<uni-collapse ref="collapse">
<uni-collapse-item :border="false" :open="true">
<template v-slot:title><text class="uni-main-color">溶栓开始前</text></template>
<view class="u-p-l-30 u-p-t-20">
<uni-forms-item v-for="key in CODE_LIST_2" :key="key" :name="key">
<template v-slot:label>
<view class="full-height flex" style="width: 135px">
<!-- @ts-ignore -->
{{ CODE_DICT[key]?.text }} <text v-if="CODE_DICT[key].description"
class="uni-secondary-color">{{ CODE_DICT[key].description }}</text>
</view>
</template>
<CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" />
</uni-forms-item>
</view>
</uni-collapse-item>
</uni-collapse>
<template v-for="key in CODE_LIST_3" :key="key" :name="key">
<uni-forms-item v-if="computeShow(key, codeAidForm)">
<template v-slot:label>
<view class="full-height flex" style="width: 135px">
<!-- @ts-ignore -->
{{ CODE_DICT[key]?.text }} <text v-if="CODE_DICT[key].description"
class="uni-secondary-color">{{ CODE_DICT[key].description }}</text>
</view>
</template>
<CodeFormItem :code="key" :value="codeAidForm[key]" @on-change="onChange(key, $event)" />
</uni-forms-item>
</template>
</view>
</template>
<script lang="ts" setup>
import { CODE_DICT } from '@/config/code';
import { computed, reactive } from 'vue';
import { computeShow } from '@/utils/common'
import { useServiceStore } from '@/store/modules/service';
const emits = defineEmits(['on-change'])
const serviceStore = useServiceStore()
const currentPatient = computed(() => serviceStore.currentPatient)
const currentCar = computed(() => serviceStore.currentCar)
const CODE_LIST_1 = ['JMRS-TOOL', 'JMRS-TH-TIME', 'JMRS-SIGN']
// form item list
const CODE_LIST_2 = ['JMRS-Q-NIHSS', 'JMRS-Q-SYSTOLIC-PRESSURE', 'JMRS-Q-DIASTOLIC-PRESSURE']
const CODE_LIST_3 = ['JMRS-RSCS', 'JMRS-TIME', 'JMRS-RSYW-ZL', 'JMRS-RSYW-ZL-ELSE', 'JMRS-TZJL', 'JMRS-JDJL', 'JMRS-GYSD', 'JMRS-15-NIHSS', 'JMRS-30-NIHSS', 'JMRS-45-NIHSS', 'JMRS-60-NIHSS', 'JMRS-H-NIHSS', 'JMRS-BFZ']
const codeAidForm = reactive({
'JMRS-TOOL': '去查看',
'JMRS-TH-TIME': '',
'JMRS-SIGN': '去签署',
'JMRS-Q-NIHSS': '',
'JMRS-Q-SYSTOLIC-PRESSURE': '',
'JMRS-Q-DIASTOLIC-PRESSURE': '',
'JMRS-RSCS': '', 'JMRS-TIME': '', 'JMRS-RSYW-ZL': '', 'JMRS-RSYW-ZL-ELSE': '', 'JMRS-TZJL': '', 'JMRS-JDJL': '', 'JMRS-GYSD': '', 'JMRS-15-NIHSS': '', 'JMRS-30-NIHSS': '', 'JMRS-45-NIHSS': '', 'JMRS-60-NIHSS': '', 'JMRS-H-NIHSS': '', 'JMRS-BFZ': ['']
})
function onChange(key, event) {
codeAidForm[key] = event
emits('on-change', key, event)
}
function init() {
// store
if (!currentPatient.value) return
// code
const { recordValDict } = currentPatient.value
if (!recordValDict) return
for (const key in codeAidForm) {
if (!recordValDict[key]) continue
if (CODE_DICT[key].type === 'checkbox') {
codeAidForm[key] = recordValDict[key][0]?.answer || ['']
} else {
codeAidForm[key] = recordValDict[key][0]?.answer[0] || ['']
}
}
}
init()
</script>

25
components/NameGenderAge/NameGenderAge.vue

@ -0,0 +1,25 @@
<template>
<uni-card :border="false">
<view class="uni-secondary-color u-font-sm">
<text class="u-m-r-30">{{ currentPatient?.patientName }}</text>
<text class="u-m-r-30">{{ currentPatient?.patientAge }}</text>
<text>{{ gender }}</text>
</view>
</uni-card>
</template>
<script lang="ts" setup>
import { useServiceStore } from '@/store/modules/service';
import { computed } from 'vue';
import { GET_GENDER_TEXT_BY_CODE } from '@/config/service';
const serviceStore = useServiceStore()
const currentPatient = computed(() => serviceStore.currentPatient)
const gender = computed(() => {
const val = currentPatient.value?.patientGender
if (!val) return ''
return GET_GENDER_TEXT_BY_CODE(Number(val))
})
</script>

184
config/code.ts

@ -3,13 +3,16 @@ export interface IConfig {
description?: string description?: string
rightArrow?: boolean rightArrow?: boolean
type: string type: string
default: string default?: string
mode?: string
range?: { value: string; text: string }[] range?: { value: string; text: string }[]
showType?: { showType?: {
type: string type: string
code: string code: string
value: string value: string
} }
page?: { name: string }
rightText?: string
} }
// 患者基本信息 // 患者基本信息
@ -98,12 +101,7 @@ export const AID_RECORD_DICT = {
}, },
'RYPG-WEIGHT': { text: '体重', description: '(kg)', type: 'text', default: '' }, 'RYPG-WEIGHT': { text: '体重', description: '(kg)', type: 'text', default: '' },
'RYPG-GENDER': { text: '性别', description: '', type: 'text', default: '' }, 'RYPG-GENDER': { text: '性别', description: '', type: 'text', default: '' },
'RYPG-BMI': { 'RYPG-BMI': { text: 'BMI', description: '', type: 'text', default: '' },
text: 'BMI',
description: '',
type: 'text',
default: '',
},
'RYPG-SYSTOLIC-PRESSURE': { 'RYPG-SYSTOLIC-PRESSURE': {
text: '收缩压', text: '收缩压',
description: '(mmHg)', description: '(mmHg)',
@ -128,16 +126,18 @@ export const AID_RECORD_DICT = {
'RYPG-MRS': { 'RYPG-MRS': {
text: '本次入院mRS评分', text: '本次入院mRS评分',
description: '', description: '',
type: 'text', type: 'page',
rightArrow: true, rightArrow: true,
default: '', default: '',
page: { name: 'MRS' },
}, },
'RYPG-NIHSS': { 'RYPG-NIHSS': {
text: '本次入院NIHSS评分', text: '本次入院NIHSS评分',
description: '', description: '',
type: 'text', type: 'page',
rightArrow: true, rightArrow: true,
default: '', default: '',
page: { name: 'NIHSS' },
}, },
'RYPG-BLOOD-REPORT-TIME': { 'RYPG-BLOOD-REPORT-TIME': {
text: '血样完成时间', text: '血样完成时间',
@ -196,5 +196,169 @@ export const AID_RECORD_DICT = {
}, },
} }
export const CODE_JMRS = {
'JMRS-TOOL': {
text: '辅助工具',
type: 'page',
rightText: '去查看',
rightArrow: true,
page: { name: 'JMRS-TOOL' },
},
'JMRS-TH-TIME': {
text: '谈话开始时间',
type: 'datetime',
default: '',
valueType: 'string',
},
'JMRS-SIGN': {
text: '签署知情同意书',
type: 'page',
rightText: '去签署',
rightArrow: true,
page: { name: 'JMRS-SIGN' },
},
'JMRS-Q-NIHSS': {
text: 'NIHSS评分',
description: '',
type: 'page',
rightArrow: true,
default: '',
page: { name: 'NIHSS' },
},
'JMRS-Q-SYSTOLIC-PRESSURE': {
text: '收缩压',
description: '(mmHg)',
type: 'input',
inputType: 'digit',
default: '',
},
'JMRS-Q-DIASTOLIC-PRESSURE': {
text: '舒张压',
description: '(mmHg)',
type: 'input',
inputType: 'digit',
default: '',
},
'JMRS-RSCS': {
text: '开始静脉溶栓场所',
type: 'select',
range: [
{ value: '急救车', text: '急救车' },
{ value: '本院急诊科', text: '本院急诊科' },
{ value: '本院CT室', text: '本院CT室' },
{ value: '本院病房', text: '本院病房' },
{ value: '外院', text: '外院' },
],
default: '',
},
'JMRS-TIME': {
text: '开始静脉溶栓时间',
type: 'datetime',
default: '',
valueType: 'string',
},
'JMRS-RSYW-ZL': {
text: '静脉溶栓药物',
type: 'select',
range: [
{ value: 'rt-PA(mg)', text: 'rt-PA(mg)' },
{ value: '尿激酶', text: '尿激酶' },
{ value: '阿尼普酶', text: '阿尼普酶' },
{ value: '瑞替普酶', text: '瑞替普酶' },
{ value: '替奈普酶', text: '替奈普酶' },
{ value: '其他', text: '其他' },
],
default: '',
},
'JMRS-RSYW-ZL-ELSE': {
text: 'rt-PA(mg)',
type: 'input',
inputType: 'digit',
default: '',
showType: {
type: 'valueInclude',
code: 'JMRS-RSYW-ZL',
value: 'rt-PA(mg)',
},
},
'JMRS-TZJL': {
text: '团注剂量',
description: '(mm)',
type: 'input',
inputType: 'digit',
default: '',
},
'JMRS-JDJL': {
text: '静滴剂量',
description: '(mm)',
type: 'input',
inputType: 'digit',
default: '',
},
'JMRS-GYSD': {
text: '给药速度',
description: '(mm/h)',
type: 'input',
inputType: 'digit',
default: '',
},
'JMRS-15-NIHSS': {
text: 'NIHSS(15min)',
description: '',
type: 'page',
rightArrow: true,
default: '',
page: { name: 'NIHSS' },
},
'JMRS-30-NIHSS': {
text: 'NIHSS(30min)',
description: '',
type: 'page',
rightArrow: true,
default: '',
page: { name: 'NIHSS' },
},
'JMRS-45-NIHSS': {
text: 'NIHSS(45min)',
description: '',
type: 'page',
rightArrow: true,
default: '',
page: { name: 'NIHSS' },
},
'JMRS-60-NIHSS': {
text: 'NIHSS(60min)',
description: '',
type: 'page',
rightArrow: true,
default: '',
page: { name: 'NIHSS' },
},
'JMRS-H-NIHSS': {
text: 'NIHSS(溶栓后)',
description: '',
type: 'page',
rightArrow: true,
default: '',
page: { name: 'NIHSS' },
},
'JMRS-BFZ': {
text: '溶栓并发症',
type: 'checkbox',
mode: 'list',
default: '',
range: [
{ value: '无', text: '无' },
{ value: '颅内出血', text: '颅内出血' },
{ value: '消化道出血', text: '消化道出血' },
{ value: '牙龈出血', text: '牙龈出血' },
{ value: '其他部位出血', text: '其他部位出血' },
{ value: '再灌注损伤', text: '再灌注损伤' },
{ value: '血管源性唇舌水肿', text: '血管源性唇舌水肿' },
{ value: '其他', text: '其他' },
],
},
}
// all, you know? // all, you know?
export const CODE_DICT: { [key: string]: IConfig } = { ...BASE_CODE_DICT, ...AID_RECORD_DICT } export const CODE_DICT: { [key: string]: IConfig } = { ...BASE_CODE_DICT, ...AID_RECORD_DICT, ...CODE_JMRS }

10
config/service.ts

@ -42,3 +42,13 @@ export const CHU_BU_PAN_DUAN = [
{ value: '短暂性脑缺血发作', text: '短暂性脑缺血发作' }, { value: '短暂性脑缺血发作', text: '短暂性脑缺血发作' },
{ value: '其他', text: '其他' }, { value: '其他', text: '其他' },
] ]
// mrs
export const MRS_LIST = [
{ value: '0', text: '完全无症状(0分)' },
{ value: '1', text: '尽管有症状,但无明显功能障碍,能完成所有日常工作和生活(1分)' },
{ value: '2', text: '轻度残疾,不能完成病前所有活动,但不需帮助能照料自己的日常事务(2分)' },
{ value: '3', text: '中度残疾,需部分帮助,但能独立行走(3分)' },
{ value: '4', text: '中重度残疾,不能独立行走,日常生活需别人帮助(4分)' },
{ value: '5', text: '重度残疾,卧床,二便失禁,日常生活完全依赖他人(5分)' },
]

17
hooks/useGetFirstAidId.ts

@ -0,0 +1,17 @@
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
export function useGetFirstAidId(callback?: Function) {
const firstAidId = ref('')
onLoad(option => {
if (option?.firstAidId) {
firstAidId.value = option.firstAidId
// 新建过来的
callback && callback(option.firstAidId)
} else {
firstAidId.value = ''
}
})
return { firstAidId }
}

24
pages.json

@ -40,6 +40,30 @@
"style": { "style": {
"navigationBarTitleText": "create-aid" "navigationBarTitleText": "create-aid"
} }
},
{
"path": "pages/MRS/MRS",
"style": {
"navigationBarTitleText": "MRS"
}
},
{
"path": "pages/NIHSS/NIHSS",
"style": {
"navigationBarTitleText": "NIHSS"
}
},
{
"path": "pages/JMRS-TOOL/JMRS-TOOL",
"style": {
"navigationBarTitleText": "JMRS-TOOL"
}
},
{
"path": "pages/JMRS-SIGN/JMRS-SIGN",
"style": {
"navigationBarTitleText": "JMRS-SIGN"
}
} }
], ],
"globalStyle": { "globalStyle": {

8
pages/JMRS-SIGN/JMRS-SIGN.vue

@ -0,0 +1,8 @@
<template>
<div class="JMRS-SIGN">JMRS-SIGN</div>
</template>
<script lang="ts" setup>
</script>
<style lang="scss" scoped></style>

8
pages/JMRS-TOOL/JMRS-TOOL.vue

@ -0,0 +1,8 @@
<template>
<div class="JMRS-TOOL">JMRS-TOOL</div>
</template>
<script lang="ts" setup>
</script>
<style lang="scss" scoped></style>

37
pages/MRS/MRS.vue

@ -0,0 +1,37 @@
<template>
<view class="u-p-30">
<NameGenderAge />
<uni-card title="评分标准" :border="false">
<uni-data-checkbox mode="list" v-model="formData.value" :localdata="MRS_LIST"></uni-data-checkbox>
<view class="flex justify-center u-p-30">
<u-button type="primary" size="medium" @click="onSubmit" class="bg-main" shape="circle">提交</u-button>
</view>
</uni-card>
</view>
</template>
<script lang="ts" setup>
import { reactive } from 'vue';
import { MRS_LIST } from '@/config/service'
import { useGetFirstAidId } from '@/hooks/useGetFirstAidId';
const { firstAidId } = useGetFirstAidId()
const formData = reactive({ value: '' })
async function onSubmit() {
try {
const answer = [formData.value]
const param = { codeAndAnswerList: [{ questionCode: 'RYPG-MRS', answer, time: '' }], firstAidId: firstAidId?.value, sourceId: '', sourceType: '' }
await uni.$u.api.updateAidCode(param)
uni.$u.toast('更新成功')
//
uni.navigateBack()
} catch (error) {
uni.$u.alertError(error)
}
}
</script>

8
pages/NIHSS/NIHSS.vue

@ -0,0 +1,8 @@
<template>
<div class="NIHSS">NIHSS</div>
</template>
<script lang="ts" setup>
</script>
<style lang="scss" scoped></style>

26
pages/detail2/detail2.vue

@ -79,28 +79,29 @@
<!-- right --> <!-- right -->
<view class="flex-3"> <view class="flex-3">
<!-- 患者基本信息 --> <!-- 患者基本信息 -->
<DetailBase v-if="showMode === 'base'" /> <DetailBase ref="baseRef" v-show="showMode === 'base'" />
<!-- 患者急救记录 --> <!-- 患者急救记录 -->
<DetailAidRecord v-else /> <DetailAidRecord ref="recordRef" v-show="showMode === 'record'" />
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { useServiceStore } from '@/store/modules/service'; import { useServiceStore } from '@/store/modules/service';
import { computed, ref, provide } from 'vue'; import { computed, ref, provide } from 'vue';
import { GET_GENDER_TEXT_BY_CODE } from '@/config/service'; import { GET_GENDER_TEXT_BY_CODE } from '@/config/service';
import { useNextNode } from '@/hooks/useNextNode' import { useNextNode } from '@/hooks/useNextNode'
import { useGetFirstAidId } from '@/hooks/useGetFirstAidId';
import { onShow } from '@dcloudio/uni-app'
const serviceStore = useServiceStore() const serviceStore = useServiceStore()
const { nextNode, intervalGetNextCode, leftTime } = useNextNode() const { nextNode, intervalGetNextCode, leftTime } = useNextNode()
const { firstAidId } = useGetFirstAidId(getAidInfo)
const firstAidId = ref('') const baseRef = ref()
const recordRef = ref()
const showMode = ref('base') // base , record const showMode = ref('base') // base , record
const currentPatient = computed(() => serviceStore.currentPatient) const currentPatient = computed(() => serviceStore.currentPatient)
@ -126,14 +127,11 @@ function onCreateRecord() {
} }
onLoad((option) => { onShow(async () => {
if (option?.firstAidId) { console.log('show');
firstAidId.value = option.firstAidId await getAidInfo(firstAidId.value)
// baseRef.value?.init()
getAidInfo(option.firstAidId) recordRef.value?.init()
} else {
firstAidId.value = ''
}
}) })
intervalGetNextCode() intervalGetNextCode()

2
pages/loading/loading.vue

@ -65,6 +65,8 @@ function onSettingCancel() {
// //
function openPage(name) { function openPage(name) {
timer && clearInterval(timer)
timer = 0
uni.$u.openPage(name, true) uni.$u.openPage(name, true)
} }

30
store/modules/service.ts

@ -32,6 +32,16 @@ export interface ServiceState {
currentPatient: null | IPatient currentPatient: null | IPatient
currentCar: null | ICar currentCar: null | ICar
device: null | { deviceNo: string; host: string } device: null | { deviceNo: string; host: string }
score: {
'RYPG-MRS': string
'RYPG-NIHSS': string
'JMRS-Q-NIHSS': string
'JMRS-15-NIHSS': string
'JMRS-30-NIHSS': string
'JMRS-45-NIHSS': string
'JMRS-60-NIHSS': string
'JMRS-H-NIHSS': string
}
} }
export const useServiceStore = defineStore({ export const useServiceStore = defineStore({
@ -40,6 +50,16 @@ export const useServiceStore = defineStore({
currentPatient: null, // 当前病友的信息 currentPatient: null, // 当前病友的信息
device: null, // 当前设备的信息 device: null, // 当前设备的信息
currentCar: null, // 车的信息 currentCar: null, // 车的信息
score: {
'RYPG-MRS': '',
'RYPG-NIHSS': '',
'JMRS-Q-NIHSS': '',
'JMRS-15-NIHSS': '',
'JMRS-30-NIHSS': '',
'JMRS-45-NIHSS': '',
'JMRS-60-NIHSS': '',
'JMRS-H-NIHSS': '',
},
}), }),
getters: { getters: {
@ -47,9 +67,19 @@ 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评分
getScore:
({ score }) =>
(type: string) =>
score[type],
}, },
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
}, },

8
uni.scss

@ -159,3 +159,11 @@ $u-type-success: #1bb299;
.uni-forms-item.is-direction-left { .uni-forms-item.is-direction-left {
align-items: center; align-items: center;
} }
.uni-collapse-item__title {
border: none !important;
}
.uni-collapse {
padding-bottom: 25px;
}

15
utils/common.ts

@ -1,3 +1,5 @@
import { CODE_DICT } from '@/config/code'
/** /**
* timeout 1s执行 * timeout 1s执行
* @param {string} pageName * @param {string} pageName
@ -38,3 +40,16 @@ export function computeBMI(height: string, weight: string): string {
const w = Number(weight) const w = Number(weight)
return (w / ((h * h) / 100 / 100)).toFixed(2) return (w / ((h * h) / 100 / 100)).toFixed(2)
} }
// 计算code form 前置条件的显示
export function computeShow(code: string, codeForm: any) {
const { showType } = CODE_DICT[code]
if (!showType) return true
if (showType.type === 'value' && codeForm[showType.code] === showType.value) {
return true
}
if (showType.type === 'valueInclude' && codeForm[showType.code].includes(showType.value)) {
return true
}
return false
}

Loading…
Cancel
Save