Browse Source

feat: detail1

main
wally 2 years ago
parent
commit
5cc88cf11f
  1. 2
      components/CodeFormItem/CodeFormItem.vue
  2. 2
      components/DetailAidRecord/DetailAidRecord.vue
  3. 14
      components/NameGenderAge/NameGenderAge.vue
  4. 156
      config/service.ts
  5. 6
      hooks/useGetFirstAidId.ts
  6. 3
      pages/MRS/MRS.vue
  7. 57
      pages/NIHSS/NIHSS.vue
  8. 67
      pages/detail1/detail1.vue
  9. 23
      pages/detail2/detail2.vue
  10. 49
      store/modules/service.ts

2
components/CodeFormItem/CodeFormItem.vue

@ -52,7 +52,7 @@ const config = computed<IConfig>(() => CODE_DICT[props.code])
// code
function onOpenPage() {
const name = CODE_DICT[props.code].page?.name
uni.$u.openPage(name, false, `code=${props.code}&firstAidId=${firstAidId?.value}`)
uni.$u.openPage(name, true, `code=${props.code}&firstAidId=${firstAidId?.value}`)
}
</script>

2
components/DetailAidRecord/DetailAidRecord.vue

@ -122,11 +122,11 @@ async function onChange(code: string, value: string) {
function init() {
console.log('aid record init');
// store
if (!currentPatient.value) return
// console.log('aid record init', currentPatient.value.recordValDict['RYPG-NIHSS'][0]);
// code
const { recordValDict, patientGender } = currentPatient.value
if (!recordValDict) return

14
components/NameGenderAge/NameGenderAge.vue

@ -1,9 +1,13 @@
<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 class="flex justify-between">
<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>
<view v-if="rightText">{{ rightText }}</view>
</view>
</uni-card>
</template>
@ -13,6 +17,8 @@ import { useServiceStore } from '@/store/modules/service';
import { computed } from 'vue';
import { GET_GENDER_TEXT_BY_CODE } from '@/config/service';
defineProps({ rightText: String })
const serviceStore = useServiceStore()
const currentPatient = computed(() => serviceStore.currentPatient)

156
config/service.ts

@ -9,7 +9,8 @@ export const GENDER_LIST = [
* @param {number} code gender value
* @return {string | undefined} /
*/
export function GET_GENDER_TEXT_BY_CODE(code: number): string | undefined {
export function GET_GENDER_TEXT_BY_CODE(code: number | undefined): string | undefined {
if (!code) return ''
const target = GENDER_LIST.find(item => item.value === code)
return target?.text
}
@ -52,3 +53,156 @@ export const MRS_LIST = [
{ value: '4', text: '中重度残疾,不能独立行走,日常生活需别人帮助(4分)' },
{ value: '5', text: '重度残疾,卧床,二便失禁,日常生活完全依赖他人(5分)' },
]
// nihss
export const NIHSS_LIST = [
{
text: '1a.意识水平',
description:
'即使不能全面评价 (如气管插管、语言障碍、气管创伤及绷带包扎等),检查者也必须选择1个反应。只在患者对有害刺激无反应时 (不是反射)才能记录3分',
value: 0,
range: [
{ value: 0, text: '清醒,反应灵敏(0分)' },
{ value: 1, text: '嗜睡,轻微刺激能唤醒,可回答问题,执行指令' },
{ value: 2, text: '昏睡或反应迟钝,需反复刺激强烈或疼痛刺激才有非刻板的反应' },
{ value: 3, text: '昏迷,仅有反射性活动或自发性反应或完全无反应、软瘫、无反射' },
],
},
{
text: '1b.意识水平提问',
description:
'月份、年龄。仅对初次回答评分。失语和昏迷者不能理解问题记2分,因气管插管、气管创伤、严重构音障碍、语言障碍或其他任何原因不能完成者(非失语所致)记1分。可书面回答',
value: 0,
range: [
{ value: 0, text: '两项均正确' },
{ value: 1, text: '一项正确' },
{ value: 2, text: '两项均不正确' },
],
},
{
text: '1c.意识水平指令',
description:
'睁闭眼;非瘫痪侧握拳松开。仅对最初反应评分,有明确努力但未完成的也给分。若对指令无反应,用动作示意,然后记录评分。对创伤、截肢或其他生理缺陷者,应予适当的指令',
value: 0,
range: [
{ value: 0, text: '两项均正确' },
{ value: 1, text: '一项正确' },
{ value: 2, text: '两项均不正确' },
],
},
{
text: '2.凝视',
description:
'只测试水平眼球运动。对随意或反射性眼球运动计分。若眼球偏斜能被随意或反射性活动纠正,记1分。若为孤立的周围性眼肌麻痹记1分。对失语者,凝视是可以测试的。对眼球创伤、绷带包扎、盲人或有其他视力、视野障碍者,由检查者选择一种反射性运动来测试,确定眼球的联系,然后从一侧向另一侧运动,偶尔能发现部分性凝视麻痹。',
value: 0,
range: [
{ value: 0, text: '正常' },
{ value: 1, text: '部分凝视麻痹(单眼或双眼凝视异常,但无强迫凝视或全凝视麻痹)' },
{ value: 2, text: '强迫凝视或完全凝视麻痹(不能被头眼反射克服)' },
],
},
{
text: '3.视野',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
],
},
{
text: '4.面瘫',
description: '',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
],
},
{
text: '5.上肢运动',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
{ value: 4, text: '4' },
{ value: 9, text: '9' },
],
},
{
text: '6.下肢运动',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
{ value: 4, text: '4' },
{ value: 9, text: '9' },
],
},
{
text: '7.肢体共济失调',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
],
},
{
text: '8.感觉',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
],
},
{
text: '9.语言',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
],
},
{
text: '10.构音障碍',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
],
},
{
text: '11.忽视',
description: '描述',
value: 0,
range: [
{ value: 0, text: '0' },
{ value: 1, text: '1' },
{ value: 2, text: '2' },
{ value: 3, text: '3' },
],
},
]

6
hooks/useGetFirstAidId.ts

@ -3,6 +3,8 @@ import { ref } from 'vue'
export function useGetFirstAidId(callback?: Function) {
const firstAidId = ref('')
const code = ref('')
onLoad(option => {
if (option?.firstAidId) {
firstAidId.value = option.firstAidId
@ -11,7 +13,9 @@ export function useGetFirstAidId(callback?: Function) {
} else {
firstAidId.value = ''
}
code.value = option?.code || ''
})
return { firstAidId }
return { firstAidId, code }
}

3
pages/MRS/MRS.vue

@ -29,7 +29,8 @@ async function onSubmit() {
uni.$u.toast('更新成功')
//
uni.navigateBack()
uni.$u.openPage('detail2', true, `firstAidId=${firstAidId.value}`)
// uni.navigateBack()
} catch (error) {
uni.$u.alertError(error)
}

57
pages/NIHSS/NIHSS.vue

@ -1,8 +1,59 @@
<template>
<div class="NIHSS">NIHSS</div>
<view class="u-p-30">
<NameGenderAge :right-text="`得分: ${score}`" />
<uni-card :title="data[index].text" :border="false">
<uni-data-checkbox mode="list" v-model="data[index].value" :localdata="data[index].range"></uni-data-checkbox>
<view class="flex justify-center u-p-30">
<u-button type="primary" size="medium" @click="onNext" class="bg-main" shape="circle" :disabled="index === 0">上一题</u-button>
<u-button type="primary" size="medium" @click="onPrev" class="bg-main" shape="circle"
v-show="index !== data.length - 1">下一题</u-button>
<u-button type="primary" size="medium" @click="onSubmit" class="bg-main" shape="circle"
v-show="index === data.length - 1">提交</u-button>
</view>
</uni-card>
</view>
</template>
<script lang="ts" setup>
</script>
import { computed, reactive, ref } from 'vue';
import { NIHSS_LIST } from '@/config/service'
import { useGetFirstAidId } from '@/hooks/useGetFirstAidId';
const { firstAidId, code } = useGetFirstAidId()
const data = reactive([...JSON.parse(JSON.stringify(NIHSS_LIST))])
const index = ref(0)
<style lang="scss" scoped></style>
const score = computed(() => {
return data.reduce((prev, current) => current.value + prev, 0)
})
async function onSubmit() {
try {
const answer = [score.value]
const param = { codeAndAnswerList: [{ questionCode: code.value, answer, time: '' }], firstAidId: firstAidId?.value, sourceId: '', sourceType: '' }
await uni.$u.api.updateAidCode(param)
uni.$u.toast('更新成功')
//
uni.$u.openPage('detail2', true, `firstAidId=${firstAidId.value}`)
// uni.navigateBack()
} catch (error) {
uni.$u.alertError(error)
}
}
function onNext() {
index.value -= 1
}
function onPrev() {
index.value += 1
}
</script>

67
pages/detail1/detail1.vue

@ -29,52 +29,43 @@
<view class="item-card u-m-r-20 bg-white">
<view class="flex justify-between u-m-b-16">
<view class="u-font-xl font-bold flex-1">
<text class="u-m-r-20">{{ '脏兵' }}</text>
<text class="u-m-r-20">{{ '男' }}</text>
<text>{{ '24 ' }}</text>
<text class="u-m-r-20">{{ currentPatient?.patientName }}</text>
<text class="u-m-r-20">{{ GET_GENDER_TEXT_BY_CODE(currentPatient?.patientGender) }}</text>
<text>{{ currentPatient?.patientAge }}</text>
</view>
<uni-icons type="compose" color="#888" size="24" />
</view>
<u-tag text="AS急性脑卒中" type="primary" size="mini" />
<view class="u-tips-color u-font-sm u-p-t-20">
身份证<text>1222222222</text>
</view>
</view>
<view class="item-card u-m-r-20 bg-white u-m-t-30">
<view class="flex justify-between u-m-b-16">
<view class="u-font-xl font-bold flex-1">
<text class="u-m-r-20">{{ '脏兵' }}</text>
</view>
<uni-icons type="compose" color="#888" size="24" />
<u-tag text="AS急性脑卒中" class="u-m-r-20" type="primary" size="mini" />
<u-tag text="发病时间" type="primary" size="mini" />
<view class="u-tips-color u-font-sm u-p-t-20">
身份证<text>{{ currentPatient?.patientIdCardNo }}</text>
</view>
<view class="flex justify-between">
<u-tag text="AS急性脑卒中" type="primary" size="mini" />
<view class="flex justify-between u-p-t-20">
<view class="font-bold">2023-</view>
<view class="u-tips-color">距发病时间 <text class="primary">194</text></view>
</view>
<view class="u-tips-color u-font-sm u-p-t-20 flex justify-between">
<view>
身份证<text>1222222222</text>
</view>
<view>距CT25剩余9</view>
<view>距CT25剩余9</view>
</view>
</view>
<view class="item-card u-m-r-20 bg-white u-m-t-30">
<view class="flex justify-between u-m-b-16">
<view class="u-font-xl font-bold flex-1">
mRS评分<text class="u-m-r-20 primary">{{ '4' }}</text>
NIHSS评分<text class="u-m-r-20 primary">{{ '4' }}</text>
mRS评分<text class="u-m-r-20 primary">{{ mrs }}</text>
NIHSS评分<text class="u-m-r-20 primary">{{ nihss }}</text>
</view>
<uni-icons type="compose" color="#888" size="24" />
</view>
<view class="flex justify-between u-m-b-16">
<view class="u-font-xl font-bold flex-1">
舒张压/收缩压<text class="u-m-r-20 primary">{{ '4' }}</text>
舒张压/收缩压<text class="u-m-r-20 primary">{{ szy }}/{{ ssy }}</text>
</view>
</view>
@ -146,10 +137,19 @@
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import { ref, computed } from 'vue';
import { useServiceStore } from '@/store/modules/service';
import { GET_GENDER_TEXT_BY_CODE } from '@/config/service';
const serviceStore = useServiceStore()
const firstAidId = ref('')
const currentPatient = computed(() => serviceStore.currentPatient)
const mrs = computed(() => serviceStore.getMRS)
const nihss = computed(() => serviceStore.getNIHSS)
const ssy = computed(() => serviceStore.getSSY)
const szy = computed(() => serviceStore.getSZY)
function onClickLeft() {
console.log('left');
@ -160,15 +160,15 @@ function onClickRight() {
uni.$u.openPage('detail2', true, `firstAidId=${firstAidId.value}`)
}
function uploadImage() {
uni.chooseImage({
count: 1,
sizeType: ['original'], //
sourceType: ['album', 'camera'], //
success: function (res) {
console.log(JSON.stringify(res.tempFilePaths));
}
});
//
async function getAidInfo(firstAidId: string) {
try {
const data = await uni.$u.api.getAidInfo(firstAidId)
serviceStore.setCurrentPatient(data)
} catch (error) {
serviceStore.setCurrentPatient(null)
uni.$u.alertError(error)
}
}
onLoad((option) => {
@ -179,6 +179,7 @@ onLoad((option) => {
}
firstAidId.value = option.firstAidId
getAidInfo(firstAidId.value)
})
</script>

23
pages/detail2/detail2.vue

@ -79,10 +79,10 @@
<!-- right -->
<view class="flex-3">
<!-- 患者基本信息 -->
<DetailBase ref="baseRef" v-show="showMode === 'base'" />
<DetailBase ref="baseRef" v-if="showMode === 'base'" />
<!-- 患者急救记录 -->
<DetailAidRecord ref="recordRef" v-show="showMode === 'record'" />
<DetailAidRecord ref="recordRef" v-else />
</view>
</view>
</view>
@ -94,7 +94,7 @@ import { computed, ref, provide } from 'vue';
import { GET_GENDER_TEXT_BY_CODE } from '@/config/service';
import { useNextNode } from '@/hooks/useNextNode'
import { useGetFirstAidId } from '@/hooks/useGetFirstAidId';
import { onShow } from '@dcloudio/uni-app'
import { onBackPress } from '@dcloudio/uni-app'
const serviceStore = useServiceStore()
const { nextNode, intervalGetNextCode, leftTime } = useNextNode()
@ -113,25 +113,30 @@ async function getAidInfo(firstAidId: string) {
try {
const data = await uni.$u.api.getAidInfo(firstAidId)
serviceStore.setCurrentPatient(data)
baseRef.value?.init()
recordRef.value?.init()
} catch (error) {
serviceStore.setCurrentPatient(null)
baseRef.value?.init()
recordRef.value?.init()
uni.$u.alertError(error)
}
}
function onClickRight() {
uni.$u.openPage('detail1', true, `firstAidId=${firstAidId.value}`)
}
//
function onCreateRecord() {
}
onShow(async () => {
console.log('show');
await getAidInfo(firstAidId.value)
baseRef.value?.init()
recordRef.value?.init()
onBackPress(() => {
console.log('back');
uni.$u.openPage('patient-list', true)
return true
})
intervalGetNextCode()

49
store/modules/service.ts

@ -32,16 +32,6 @@ export interface ServiceState {
currentPatient: null | IPatient
currentCar: null | ICar
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({
@ -50,16 +40,6 @@ export const useServiceStore = defineStore({
currentPatient: null, // 当前病友的信息
device: 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: {
@ -72,6 +52,35 @@ export const useServiceStore = defineStore({
({ score }) =>
(type: string) =>
score[type],
getMRS({ currentPatient }) {
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: {

Loading…
Cancel
Save