|
|
|
@ -2,7 +2,6 @@ import dayjs from 'dayjs' |
|
|
|
|
|
|
|
|
|
|
|
const app = getApp<IAppOption>() |
|
|
|
const app = getApp<IAppOption>() |
|
|
|
|
|
|
|
|
|
|
|
let echarts: any = null |
|
|
|
|
|
|
|
Page({ |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
toastShow: false, |
|
|
|
toastShow: false, |
|
|
|
@ -17,33 +16,6 @@ Page({ |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
remark: '', |
|
|
|
remark: '', |
|
|
|
detail: {} as any, |
|
|
|
detail: {} as any, |
|
|
|
ec: { |
|
|
|
|
|
|
|
lazyLoad: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fields: { |
|
|
|
|
|
|
|
1: 'day', |
|
|
|
|
|
|
|
2: 'month', |
|
|
|
|
|
|
|
3: 'year', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StartDate: '', |
|
|
|
|
|
|
|
EndDate: '', |
|
|
|
|
|
|
|
typeRange: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '1', |
|
|
|
|
|
|
|
value: '按天', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '2', |
|
|
|
|
|
|
|
value: '按月', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: '3', |
|
|
|
|
|
|
|
value: '按年', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
type: '3', |
|
|
|
|
|
|
|
typeName: '按年', |
|
|
|
|
|
|
|
userInfo: {}, |
|
|
|
userInfo: {}, |
|
|
|
|
|
|
|
|
|
|
|
popupRemarkShow: false, |
|
|
|
popupRemarkShow: false, |
|
|
|
@ -122,8 +94,6 @@ Page({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
nav: '0', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ageRangeMap: { |
|
|
|
ageRangeMap: { |
|
|
|
1: '<40岁', |
|
|
|
1: '<40岁', |
|
|
|
2: '40-49岁', |
|
|
|
2: '40-49岁', |
|
|
|
@ -139,40 +109,6 @@ Page({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
adlList: [] as any, |
|
|
|
adlList: [] as any, |
|
|
|
tableData: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '说话', |
|
|
|
|
|
|
|
key: 'TalkingScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '咀嚼', |
|
|
|
|
|
|
|
key: 'ChewScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '吞咽', |
|
|
|
|
|
|
|
key: 'SwallowScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '呼吸', |
|
|
|
|
|
|
|
key: 'BreathScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '刷牙梳头能力受损', |
|
|
|
|
|
|
|
key: 'BrushTeethAndCombHairScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '从椅子上起身能力受损', |
|
|
|
|
|
|
|
key: 'GetUpFromChairScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '复视/重影', |
|
|
|
|
|
|
|
key: 'DoubleVisionScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '眼睑下垂', |
|
|
|
|
|
|
|
key: 'DroopyEyelidsScore', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pagination: { |
|
|
|
pagination: { |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
@ -180,25 +116,14 @@ Page({ |
|
|
|
count: 1, |
|
|
|
count: 1, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
ecDataTrendComponent1: null as any, |
|
|
|
onLoad(option) { |
|
|
|
ecDataTrendComponent2: null as any, |
|
|
|
|
|
|
|
ecDataTrendComponent3: null as any, |
|
|
|
|
|
|
|
ecDataTrendComponent4: null as any, |
|
|
|
|
|
|
|
async onLoad(option) { |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
id: option.id, |
|
|
|
id: option.id, |
|
|
|
}) |
|
|
|
}) |
|
|
|
echarts = await require.async('../../../resource/components/echart/echarts.js') |
|
|
|
|
|
|
|
this.ecDataTrendComponent1 = this.selectComponent('#chart1') |
|
|
|
|
|
|
|
this.ecDataTrendComponent2 = this.selectComponent('#chart2') |
|
|
|
|
|
|
|
this.ecDataTrendComponent3 = this.selectComponent('#chart3') |
|
|
|
|
|
|
|
this.ecDataTrendComponent4 = this.selectComponent('#chart4') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.waitLogin().then(async (_res) => { |
|
|
|
app.waitLogin().then(async (_res) => { |
|
|
|
app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTDETAIL' }) |
|
|
|
app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTDETAIL' }) |
|
|
|
this.getDoctorDetail() |
|
|
|
this.getDoctorDetail() |
|
|
|
await this.getDetail() |
|
|
|
await this.getDetail() |
|
|
|
this.handleNav({ currentTarget: { dataset: { index: '0' } } }, false) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getDoctorDetail() { |
|
|
|
getDoctorDetail() { |
|
|
|
@ -242,10 +167,13 @@ Page({ |
|
|
|
res.HealthQA.questions.forEach((q: any) => { |
|
|
|
res.HealthQA.questions.forEach((q: any) => { |
|
|
|
q.isAnswerArray = Array.isArray(q.AnswerText) |
|
|
|
q.isAnswerArray = Array.isArray(q.AnswerText) |
|
|
|
if (q.isAnswerArray) { |
|
|
|
if (q.isAnswerArray) { |
|
|
|
q.AnswerTextArr = q.AnswerText |
|
|
|
q.AnswerTextArr = q.AnswerText.filter((a: any) => a !== null && a !== undefined) |
|
|
|
q.AnswerTextStr = q.AnswerText.join('、') + (q.OtherText ? `(${q.OtherText})` : '') |
|
|
|
q.AnswerTextStr = q.AnswerTextArr.join('、') + (q.OtherText ? `(${q.OtherText})` : '') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
q.AnswerTextStr = q.AnswerText + (q.OtherText ? `(${q.OtherText})` : '') |
|
|
|
q.AnswerTextStr = q.AnswerText || '' |
|
|
|
|
|
|
|
if (q.AnswerTextStr && q.OtherText) { |
|
|
|
|
|
|
|
q.AnswerTextStr += `(${q.OtherText})` |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -257,72 +185,7 @@ Page({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleTypeChange(e) { |
|
|
|
handleRemark() { |
|
|
|
const index = e.detail.value |
|
|
|
|
|
|
|
const { typeRange, nav } = this.data |
|
|
|
|
|
|
|
const type = typeRange[index].id |
|
|
|
|
|
|
|
const typeName = typeRange[index].value |
|
|
|
|
|
|
|
let EndDate = '' |
|
|
|
|
|
|
|
let StartDate = '' |
|
|
|
|
|
|
|
if (type === '1') { |
|
|
|
|
|
|
|
EndDate = dayjs().format('YYYY-MM-DD') |
|
|
|
|
|
|
|
StartDate = dayjs().subtract(6, 'd').format('YYYY-MM-DD') |
|
|
|
|
|
|
|
} else if (type === '2') { |
|
|
|
|
|
|
|
EndDate = dayjs().format('YYYY-MM') |
|
|
|
|
|
|
|
StartDate = dayjs().subtract(1, 'M').format('YYYY-MM') |
|
|
|
|
|
|
|
} else if (type === '3') { |
|
|
|
|
|
|
|
EndDate = dayjs().format('YYYY') |
|
|
|
|
|
|
|
StartDate = dayjs().subtract(1, 'y').format('YYYY') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
type, |
|
|
|
|
|
|
|
typeName, |
|
|
|
|
|
|
|
EndDate, |
|
|
|
|
|
|
|
StartDate, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if (nav === '0') { |
|
|
|
|
|
|
|
this.getGraph() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.getAdlList() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleChange() { |
|
|
|
|
|
|
|
const { nav } = this.data |
|
|
|
|
|
|
|
if (nav === '0') { |
|
|
|
|
|
|
|
this.getGraph() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.getAdlList() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getGraph() { |
|
|
|
|
|
|
|
wx.ajax({ |
|
|
|
|
|
|
|
method: 'GET', |
|
|
|
|
|
|
|
url: '?r=igg4/doctor/patient/adl-graph', |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
patientId: this.data.id, |
|
|
|
|
|
|
|
StartDate: this.data.StartDate, |
|
|
|
|
|
|
|
EndDate: this.data.EndDate, |
|
|
|
|
|
|
|
DateType: this.data.type, |
|
|
|
|
|
|
|
count: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}).then(async (res) => { |
|
|
|
|
|
|
|
this.initChart1(res.adlSummary) |
|
|
|
|
|
|
|
this.initChart2(res.adlSummary) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const medication = res.medication.map((item) => { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
Date: item.InjectionDate, |
|
|
|
|
|
|
|
...item, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
const list = res.list |
|
|
|
|
|
|
|
const newList: any[] = this.mergeArr(list, medication) |
|
|
|
|
|
|
|
const chart3 = await this.initChart3(newList as never[]) |
|
|
|
|
|
|
|
const chart4 = await this.initChart4(newList as never[]) |
|
|
|
|
|
|
|
echarts.connect([chart3, chart4]) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
mergeArr(array1: any[] = [], array2: any[] = []) { |
|
|
|
|
|
|
|
// 合并两个数组中相同Date字段的对象
|
|
|
|
// 合并两个数组中相同Date字段的对象
|
|
|
|
const mergedArray: any[] = [] |
|
|
|
const mergedArray: any[] = [] |
|
|
|
const mergedMap = new Map() |
|
|
|
const mergedMap = new Map() |
|
|
|
|