diff --git a/components/CodeFormItem/CodeFormItem.vue b/components/CodeFormItem/CodeFormItem.vue index 3062f0d..1a372f7 100644 --- a/components/CodeFormItem/CodeFormItem.vue +++ b/components/CodeFormItem/CodeFormItem.vue @@ -52,7 +52,7 @@ const config = computed(() => 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}`) } diff --git a/components/DetailAidRecord/DetailAidRecord.vue b/components/DetailAidRecord/DetailAidRecord.vue index 9c53613..f8d66c5 100644 --- a/components/DetailAidRecord/DetailAidRecord.vue +++ b/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 diff --git a/components/NameGenderAge/NameGenderAge.vue b/components/NameGenderAge/NameGenderAge.vue index fc11f7d..73fe3f7 100644 --- a/components/NameGenderAge/NameGenderAge.vue +++ b/components/NameGenderAge/NameGenderAge.vue @@ -1,9 +1,13 @@ @@ -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) diff --git a/config/service.ts b/config/service.ts index 70b36da..f545eb3 100644 --- a/config/service.ts +++ b/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' }, + ], + }, +] diff --git a/hooks/useGetFirstAidId.ts b/hooks/useGetFirstAidId.ts index a9bd284..83731fe 100644 --- a/hooks/useGetFirstAidId.ts +++ b/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 } } diff --git a/pages/MRS/MRS.vue b/pages/MRS/MRS.vue index 9a9b15c..8683156 100644 --- a/pages/MRS/MRS.vue +++ b/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) } diff --git a/pages/NIHSS/NIHSS.vue b/pages/NIHSS/NIHSS.vue index a7cd2a8..d080392 100644 --- a/pages/NIHSS/NIHSS.vue +++ b/pages/NIHSS/NIHSS.vue @@ -1,8 +1,59 @@ +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) - \ No newline at end of file +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 +} + + diff --git a/pages/detail1/detail1.vue b/pages/detail1/detail1.vue index 2078573..75aebf1 100644 --- a/pages/detail1/detail1.vue +++ b/pages/detail1/detail1.vue @@ -29,52 +29,43 @@ - {{ '脏兵' }} - {{ '男' }} - {{ '24 ' }} + {{ currentPatient?.patientName }} + {{ GET_GENDER_TEXT_BY_CODE(currentPatient?.patientGender) }} + {{ currentPatient?.patientAge }} - - - 身份证:1222222222 - - - - - - {{ '脏兵' }} - - + + + + + 身份证:{{ currentPatient?.patientIdCardNo }} - - + + 2023- 距发病时间 194′′ - - 身份证:1222222222 - + 距CT25′′剩余9′′ 距CT25′′剩余9′′ - - mRS评分:{{ '4' }} - NIHSS评分:{{ '4' }} + mRS评分:{{ mrs }} + NIHSS评分:{{ nihss }} - 舒张压/收缩压:{{ '4' }} + 舒张压/收缩压:{{ szy }}/{{ ssy }} @@ -146,10 +137,19 @@ diff --git a/pages/detail2/detail2.vue b/pages/detail2/detail2.vue index 3b8118b..b0168f9 100644 --- a/pages/detail2/detail2.vue +++ b/pages/detail2/detail2.vue @@ -79,10 +79,10 @@ - + - + @@ -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() diff --git a/store/modules/service.ts b/store/modules/service.ts index 37e9e05..4c952f7 100644 --- a/store/modules/service.ts +++ b/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: {