患者相关

This commit is contained in:
xiaoxiao 2025-07-18 17:24:31 +08:00
parent cbf50189cc
commit 1cdb5a3311
25 changed files with 1721 additions and 7 deletions

View File

@ -40,6 +40,14 @@ export class BasicConstant {
static readonly patientListNoInThisGroup = BasicConstant.urlExpertAPI+'patientListNoInThisGroup' static readonly patientListNoInThisGroup = BasicConstant.urlExpertAPI+'patientListNoInThisGroup'
static readonly patientCard = BasicConstant.urlExpertAPI+'patientCard' static readonly patientCard = BasicConstant.urlExpertAPI+'patientCard'
static readonly toAddNickname = BasicConstant.urlExpert+'toAddNickname' static readonly toAddNickname = BasicConstant.urlExpert+'toAddNickname'
static readonly cancelRes = BasicConstant.urlExpert+'cancelRes'
static readonly caseDetail = BasicConstant.urlExpert+'caseDetail'
static readonly getFollowUp = BasicConstant.urlExpert+'getFollowUp'
static readonly deleteFollowUp = BasicConstant.urlExpert+'deleteFollowUp'
static readonly addFollowUps = BasicConstant.urlExpert+'addFollowUps'
static readonly addFollowUp = BasicConstant.urlExpert+'addFollowUp'
static readonly followUpList = BasicConstant.urlExpert+'followUpList'
static readonly conditionRecordList = BasicConstant.urlExpert+'conditionRecordList'
static readonly patientDetail = BasicConstant.urlExpert+'patientDetail' static readonly patientDetail = BasicConstant.urlExpert+'patientDetail'
static readonly GroupList = BasicConstant.urlExpertApp+'GroupList' static readonly GroupList = BasicConstant.urlExpertApp+'GroupList'
static readonly getStartpage=BasicConstant.urlExpertApp + "startpage"; static readonly getStartpage=BasicConstant.urlExpertApp + "startpage";

View File

@ -737,6 +737,33 @@ export class PatientDatabaseManager {
} }
} }
// 在 PatientDatabaseManager 类内添加
async updatePatientByData(patient: PatientData): Promise<boolean> {
try {
if (!this.isDatabaseReady()) {
console.error('数据库未准备好,无法更新患者数据');
return false;
}
// 构造 PatientEntity
const entity = new PatientEntity(
patient.uuid || '',
patient.nickname || '',
patient.mobile || '',
patient.realName || '',
patient.nation || '',
patient.sex || 0,
patient.type || 0,
patient.photo || '',
patient.expertUuid || '' // 注意PatientData 里 expertUuid 字段必须有
);
await this.getPatientDao().updatePatient(entity);
return true;
} catch (error) {
console.error('updatePatientByData 更新患者信息失败:', error);
return false;
}
}
// 删除患者 // 删除患者
async deletePatient(uuid: string): Promise<boolean> { async deletePatient(uuid: string): Promise<boolean> {
try { try {

View File

@ -1,9 +1,10 @@
import { systemDateTime } from '@kit.BasicServicesKit'; import { systemDateTime } from '@kit.BasicServicesKit';
import { isDate, isNumber, isString } from '@nimsdk/vendor';
export class TimestampUtil { export class TimestampUtil {
static format(timestamp: number | string, formatStr: string): string { static format(timestamp: number | string | Date, formatStr: string): string {
const date = new Date(timestamp); const date = isString(timestamp)||isNumber(timestamp)?new Date(timestamp):timestamp as Date;
const padZero = (num: number, len: number = 2) => num.toString().padStart(len, '0'); const padZero = (num: number, len: number = 2) => num.toString().padStart(len, '0');
const map: Record<string, string> = { const map: Record<string, string> = {
'YYYY': date.getFullYear().toString(), 'YYYY': date.getFullYear().toString(),
@ -47,4 +48,9 @@ export class TimestampUtil {
return false; return false;
} }
} }
static getWeekday(date: Date): string {
const weekdays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
return weekdays[date.getDay()];
}
} }

View File

@ -0,0 +1,247 @@
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter";
import {
authStore,
BasicConstant, ChangeUtil, hdHttp, HdLoadingDialog, HdNav,
HdResponse,
logger, TimestampUtil } from "@itcast/basic";
import { isDate } from "@nimsdk/vendor";
import { promptAction } from "@kit.ArkUI";
import { BusinessError } from "@kit.BasicServicesKit";
@HMRouter({ pageUrl:'AddFollowPlanComp' })
@Component
export struct AddFollowPlanComp {
scroller:Scroller = new Scroller()
private params: ESObject = HMRouterMgr.getCurrentParam()
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?String(this.params.realName):String(this.params.nickname)
@State followList:Array<Record<string,string>> = [{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)}]
@State isNotiMe:boolean = false
@State isNotiPa:boolean = false
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
submitFollowListAction() {
for (const item of this.followList) {
if (item.time == '请选择时间') {
promptAction.showToast({ message: '请选择时间', duration: 1000 })
return
}
}
const noteStr = this.followList
.map(item => item.content)
.join('☆');
const timeStr = this.followList
.map(item => item.date)
.join('☆');
const entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patientUuid,
"datetime":timeStr,
"note":noteStr,
"type":"2",
"isremindme":this.isNotiMe?"1":"0",
"isremindpatient":this.isNotiPa?"1":"0"
} as Record<string,string>
this.dialog.open()
hdHttp.post<string>(BasicConstant.addFollowUps, entity).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response caseUuid'+res);
let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
if(json.code == '1') {
HMRouterMgr.pop({param:{"isRefresh":"1"}})
promptAction.showToast({ message:'添加随访计划成功', duration: 1000 })
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.error(`Response fails: ${err}`);
})
}
build() {
Column() {
HdNav({title:'添加随访计划',isLeftAction:true,showRightIcon:false,showRightText:true,rightText:'提交',leftItemAction:()=>{
HMRouterMgr.pop()
},rightItemAction:()=>{
this.submitFollowListAction()
}})
Scroll(this.scroller){
Column() {
Row() {
Text('患者')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.margin({ left: 10 })
.layoutWeight(1)
Text(this.name)
.fontSize(15)
.margin({ right: 10 })
}
.width('100%')
.height(40)
.margin({top:10})
.backgroundColor(Color.White)
Text('随访内容')
.height(40)
.width('100%')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.padding({ left: 10 })
.margin({top:10})
.backgroundColor(Color.White)
this.followListBuild()
this.selectedNotification()
}
}
.width('100%')
.scrollBar(BarState.Off)
.height('calc(100% - 120vp)')
.align(Alignment.TopStart)
.backgroundColor('#f4f4f4')
}
.width('100%')
}
@Builder
followListBuild() {
List(){
ListItemGroup({footer:this.followListFooterView()}){
ForEach(this.followList,(item:Record<string,string>,index:number)=>{
ListItem(){
Column() {
Row() {
Image($r('app.media.follow_delete_plan'))
.width(20)
.height(20)
.onClick(() => {
this.followList.splice(index, 1)
this.followList = [...this.followList]
})
Text(String(item.content))
.fontSize(14)
.fontColor('#666666')
.layoutWeight(1)
.onClick(()=>{
HMRouterMgr.push({pageUrl:'InputFollowContentComp',param:{"content":item.content}},{
onResult: (popInfo: HMPopInfo) => {
if (popInfo && popInfo.result && popInfo.result["content"] !== undefined) {
this.followList[index].content = popInfo.result["content"]
this.followList = [...this.followList]
}
}
})
})
Blank()
.width(1)
.backgroundColor('#f4f4f4')
Text(String(item.time))
.fontSize(14)
.fontColor('#666666')
.onClick(()=>this.selectedData(index))
}
Blank()
.width('100%')
.height(1)
.backgroundColor('#f4f4f4')
}
.padding({left:10,top:20,right:10,bottom:20})
}
})
}
}
.width('100%')
.margin({top:10})
.backgroundColor(Color.White)
}
@Builder
selectedNotification() {
Column(){
Row(){
Text('提醒我')
.fontSize(15)
.margin({left:10})
.fontColor($r('app.color.main_color'))
.layoutWeight(1)
Image(this.isNotiMe?$r('app.media.patiemts_list_selected'):$r('app.media.patients_no_selected'))
.width(20)
.height(20)
.margin({right:10})
}
.height(50)
.width('100%')
.margin({bottom:1})
.backgroundColor(Color.White)
.onClick(()=>{
this.isNotiMe = !this.isNotiMe
})
Row(){
Text('提醒患者')
.fontSize(15)
.margin({left:10})
.fontColor($r('app.color.main_color'))
.layoutWeight(1)
Image(this.isNotiPa?$r('app.media.patiemts_list_selected'):$r('app.media.patients_no_selected'))
.width(20)
.height(20)
.margin({right:10})
}
.height(50)
.width('100%')
.backgroundColor(Color.White)
.onClick(()=>{
this.isNotiPa = !this.isNotiPa
})
}
.width('100%')
.margin({top:10})
}
@Builder
followListFooterView() {
Row(){
Text(''+' 添加随访计划')
.fontSize(18)
.fontColor($r('app.color.main_color'))
}
.height(50)
.width('100%')
.padding({left:10})
.onClick(()=>{
const newItem: Record<string, string> = { "content": "请于近日来院复诊、复查", "time": "请选择时间" ,"date":String(new Date) };
this.followList.push(newItem);
})
}
selectedData(index:number){
CalendarPickerDialog.show({
selected: new Date(this.followList[index].date),
backgroundColor: Color.White,
backgroundBlurStyle: BlurStyle.NONE,
shadow: ShadowStyle.OUTER_FLOATING_SM,
onAccept: (value) => {
const today = new Date();
today.setHours(0, 0, 0, 0);
const selected = new Date(value);
selected.setHours(0, 0, 0, 0);
if (selected < today) {
promptAction.showToast({ message: '只能选择今天及以后的日期', duration: 1500 })
return
}
this.followList[index].time = TimestampUtil.format(value,'YYYY-MM-DD')+'('+TimestampUtil.getWeekday(value)+')'
this.followList[index].date = TimestampUtil.format(value,'YYYY-MM-DD')
this.followList = [...this.followList]
}
});
}
}

View File

@ -0,0 +1,22 @@
import { HMRouter } from "@hadss/hmrouter";
@HMRouter({pageUrl:'AddRecordIllnessComp'})
@Component
export struct AddRecordIllnessComp {
@State message: string = 'Hello World';
build() {
Row() {
Column() {
Text(this.message)
.fontSize($r('app.float.page_text_font_size'))
.fontWeight(FontWeight.Bold)
.onClick(() => {
this.message = 'Welcome';
})
}
.width('100%')
}
.height('100%')
}
}

View File

@ -0,0 +1,210 @@
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter";
import {
authStore,
BasicConstant, ChangeUtil, hdHttp, HdLoadingDialog, HdNav,
HdResponse,
logger, TimestampUtil } from "@itcast/basic";
import { promptAction } from "@kit.ArkUI";
import { BusinessError } from "@kit.BasicServicesKit";
@HMRouter({ pageUrl:'AddScheduleFollowComp' })
@Component
export struct AddScheduleFollowComp {
scroller:Scroller = new Scroller()
controller:TextAreaController = new TextAreaController()
private params: ESObject = HMRouterMgr.getCurrentParam()
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?String(this.params.realName):String(this.params.nickname)
@State note:string = '请于近日来院复诊、复查'
@State date:string = ''
@State time:string = '请选择日期'
@State isNotiMe:boolean = false
@State isNotiPa:boolean = false
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
submitFollowListAction() {
if (this.time == '请选择日期') {
promptAction.showToast({ message:'请选择日期', duration: 1000 })
return
}
if (this.note.length <= 0) {
promptAction.showToast({ message:'请编辑随访计划', duration: 1000 })
return
}
const entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patientUuid,
"datetime":this.date,
"note":this.note,
"type":"1",
"isremindme":this.isNotiMe?"1":"0",
"isremindpatient":this.isNotiPa?"1":"0"
} as Record<string,string>
this.dialog.open()
hdHttp.post<string>(BasicConstant.addFollowUp, entity).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response caseUuid'+res);
let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
if(json.code == '1') {
HMRouterMgr.pop({param:{"isRefresh":"1"}})
promptAction.showToast({ message:'添加日程成功', duration: 1000 })
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.error(`Response fails: ${err}`);
})
}
build() {
Column() {
HdNav({title:'添加日程',isLeftAction:true,showRightIcon:false,showRightText:true,rightText:'提交',leftItemAction:()=>{
HMRouterMgr.pop()
},rightItemAction:()=>{
this.submitFollowListAction()
}})
Scroll(this.scroller){
Column() {
Row() {
Text('患者')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.margin({ left: 10 })
.layoutWeight(1)
Text(this.name)
.fontSize(15)
.margin({ right: 10 })
}
.width('100%')
.height(40)
.margin({top:10})
.backgroundColor(Color.White)
Row(){
Text('日期')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.margin({ left: 10 })
.layoutWeight(1)
Text(this.time)
.fontSize(15)
.margin({ right: 10 })
.onClick(()=>this.selectedData())
}
.width('100%')
.height(40)
.margin({top:10})
.backgroundColor(Color.White)
Text('随访内容')
.height(40)
.width('100%')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.padding({ left: 10 })
.margin({top:10})
.backgroundColor(Color.White)
TextArea({
placeholder:'在这里输入内容...200字以内',
controller:this.controller,
text:this.note
})
.onChange((value: string) => {
this.note = value
})
.placeholderFont({size:15})
.placeholderColor('#999999')
.width('100%')
.padding({left:10,top:10,right:10,bottom:50})
.fontSize(15)
.maxLength(200)
.backgroundColor(Color.White)
.border({
radius: 0
})
this.selectedNotification()
}
}
.width('100%')
.scrollBar(BarState.Off)
.height('calc(100% - 120vp)')
.align(Alignment.TopStart)
.backgroundColor('#f4f4f4')
}
.width('100%')
}
@Builder
selectedNotification() {
Column(){
Row(){
Text('提醒我')
.fontSize(15)
.margin({left:10})
.fontColor($r('app.color.main_color'))
.layoutWeight(1)
Image(this.isNotiMe?$r('app.media.patiemts_list_selected'):$r('app.media.patients_no_selected'))
.width(20)
.height(20)
.margin({right:10})
}
.height(50)
.width('100%')
.margin({bottom:1})
.backgroundColor(Color.White)
.onClick(()=>{
this.isNotiMe = !this.isNotiMe
})
Row(){
Text('提醒患者')
.fontSize(15)
.margin({left:10})
.fontColor($r('app.color.main_color'))
.layoutWeight(1)
Image(this.isNotiPa?$r('app.media.patiemts_list_selected'):$r('app.media.patients_no_selected'))
.width(20)
.height(20)
.margin({right:10})
}
.height(50)
.width('100%')
.backgroundColor(Color.White)
.onClick(()=>{
this.isNotiPa = !this.isNotiPa
})
}
.width('100%')
.margin({top:10})
}
selectedData(){
CalendarPickerDialog.show({
selected: new Date(),
backgroundColor: Color.White,
backgroundBlurStyle: BlurStyle.NONE,
shadow: ShadowStyle.OUTER_FLOATING_SM,
onAccept: (value) => {
const today = new Date();
today.setHours(0, 0, 0, 0);
const selected = new Date(value);
selected.setHours(0, 0, 0, 0);
if (selected < today) {
promptAction.showToast({ message: '只能选择今天及以后的日期', duration: 1500 })
return
}
this.time = TimestampUtil.format(value,'YYYY-MM-DD')+'('+TimestampUtil.getWeekday(value)+')'
this.date = TimestampUtil.format(value,'YYYY-MM-DD')
}
});
}
}

View File

@ -0,0 +1,152 @@
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter"
import { BasicConstant, ChangeUtil, hdHttp, HdLoadingDialog, HdNav, HdResponse, logger } from "@itcast/basic"
import { promptAction } from "@kit.ArkUI"
import { BusinessError } from "@kit.BasicServicesKit"
@HMRouter({ pageUrl:'FollowDetailsComp' })
@Component
export struct FollowDetailsComp {
private params: ESObject = HMRouterMgr.getCurrentParam()
@State name:string = ''
@State time:string = ''
@State content:string = ''
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
aboutToAppear(): void {
this.getFollowDetailsAction()
}
getFollowDetailsAction() {
this.dialog.open()
hdHttp.post<string>(BasicConstant.getFollowUp, {
"uuid": this.params.uuid
} as Record<string,string>).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response caseUuid'+res);
let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
if(json.code == '1') {
this.name = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?String(this.params.realName):String(this.params.nickname)
this.time = json.data["datetime"] as string
this.content = json.data["note"] as string
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.error(`Response fails: ${err}`);
})
}
delegateFollowList() {
this.dialog.open()
hdHttp.post<string>(BasicConstant.deleteFollowUp, {
"uuid": this.params.uuid
} as Record<string,string>).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response caseUuid'+res);
let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
if(json.code == '1') {
HMRouterMgr.pop({param:{"isRefresh":"1"}})
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.error(`Response fails: ${err}`);
})
}
build() {
Column() {
HdNav({title:'随访详情',isLeftAction:true,showRightIcon:false,leftItemAction:()=>{
HMRouterMgr.pop()
}})
Column(){
Blank()
.width('100%')
.height(10)
.backgroundColor('#f4f4f4')
Row(){
Text('患者')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.margin({left:10})
.layoutWeight(1)
Text(this.name)
.fontSize(15)
.margin({right:10})
}
.width('100%')
.height(40)
.backgroundColor(Color.White)
Blank()
.width('100%')
.height(10)
.backgroundColor('#f4f4f4')
Column(){
Row(){
Text('日期')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.margin({left:10})
.layoutWeight(1)
Text(this.time)
.fontSize(15)
.margin({right:10})
}
.width('100%')
.height(40)
.backgroundColor(Color.White)
Blank()
.width('100%')
.height(1)
.backgroundColor('#f4f4f4')
Text('随访内容')
.height(40)
.width('100%')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.padding({left:10})
.backgroundColor(Color.White)
Blank()
.width('100%')
.height(1)
.backgroundColor('#f4f4f4')
Text(this.content)
.width('100%')
.fontSize(15)
.padding({left:10,right:10,top:10})
Blank()
.width('100%')
.height(10)
.backgroundColor('#f4f4f4')
.margin({top:30})
}
.layoutWeight(1)
Text('删除该条记录')
.textAlign(TextAlign.Center)
.fontSize(17)
.fontColor(Color.White)
.margin({left:20,right:20,bottom:80})
.backgroundColor($r('app.color.main_color'))
.borderRadius(5)
.width('90%')
.height(50)
.onClick(()=>this.delegateFollowList())
}
.width('100%')
.height('calc(100% - 56vp)')
.backgroundColor(Color.White)
.justifyContent(FlexAlign.Start)
}
.width('100%')
}
}

View File

@ -0,0 +1,312 @@
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter";
import { HdNav,EmptyViewComp, authStore, HdLoadingDialog, hdHttp, BasicConstant, logger,
HdResponse,
ChangeUtil} from "@itcast/basic";
import { PullToRefreshLayout, RefreshController } from "refreshlib";
import { promptAction } from "@kit.ArkUI";
import { BusinessError } from "@kit.BasicServicesKit";
import { it } from "@ohos/hypium";
@HMRouter({pageUrl:'FollowPlanListComp'})
@Component
export struct FollowPlanListComp {
@State planList: AppointmentGroup[] = []
private params: ESObject = HMRouterMgr.getCurrentParam()
scroller = new Scroller()
@State pageNumber:number = 1
@State totalPageNumer:number = 1
public controller:RefreshController = new RefreshController()
@State isShowAddPlan:boolean = false
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
aboutToAppear(): void {
this.getFollowListData()
}
getFollowListData() {
const entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patient_uuid,
"page":this.pageNumber.toString()
} as Record<string,string>
this.dialog.open()
hdHttp.post<string>(BasicConstant.followUpList, entity).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response followUpList'+res);
let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
if(json.code == '1') {
this.controller.refreshSuccess();
this.controller.loadSuccess();
this.totalPageNumer = Number(json.data["totalPage"])
const list: AppointmentItem[] = json.data["list"] as AppointmentItem[]
const groupMap: Record<string, AppointmentItem[]> = {}
list.forEach(item => {
const groupKey = item.datetime ? item.datetime.substring(0, 7) : '未知'
if (!groupMap[groupKey]) {
groupMap[groupKey] = []
}
groupMap[groupKey].push(item)
})
if (this.pageNumber == 1) {
this.planList = Object.keys(groupMap).map(key => ({
group: key,
items: groupMap[key]
} as AppointmentGroup))
} else {
let newPlanList = [...this.planList]
Object.keys(groupMap).forEach(key => {
const existGroup = newPlanList.find(g => g.group === key)
if (existGroup) {
existGroup.items = existGroup.items.concat(groupMap[key])
} else {
newPlanList.push({
group: key,
items: groupMap[key]
})
}
})
this.planList = newPlanList
}
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
this.controller.refreshError();
console.error(`Response fails: ${err}`);
})
}
build() {
Column() {
HdNav({title:'随访计划',isLeftAction:true,rightText:'添加',showRightText:true,showRightIcon:false,rightItemAction:()=>{
this.isShowAddPlan = !this.isShowAddPlan
},leftItemAction:()=>{
HMRouterMgr.pop()
}})
PullToRefreshLayout({
scroller:this.scroller,
viewKey:"FollowPlanList",
controller:this.controller,
contentView:()=>{
this.contentView()
},
onRefresh:()=>{
this.pageNumber = 1
this.getFollowListData()
},
onCanPullRefresh:()=>{
if (!this.scroller.currentOffset()) {
/*处理无数据,为空的情况*/
return true
}
//如果列表到顶返回true表示可以下拉返回false表示无法下拉
return this.scroller.currentOffset().yOffset <= 0
},
onCanPullLoad: () => {
if (this.pageNumber >= this.totalPageNumer) {
return false;
} else {
return true;
}
},
onLoad:()=>{
this.pageNumber++;
this.getFollowListData()
}
}).width('100%').height('calc(100% - 106vp)').clip(true)
}
.width('100%')
}
@Builder
headerView(item:AppointmentGroup) {
Text(item.group)
.fontSize(15)
.width('100%')
.textAlign(TextAlign.Center)
.backgroundColor('#e3e4e5')
.padding({top:10,bottom:10})
}
@Builder
contentView() {
List({ scroller: this.scroller }) {
ForEach(this.planList,(item:AppointmentGroup)=>{
ListItemGroup({header:this.headerView(item)}) {
ForEach(item.items,(listItem:AppointmentItem)=>{
ListItem() {
Column() {
Row() {
Text(listItem.datetime.slice(-2) + ' 日')
.fontColor($r('app.color.main_color'))
.fontSize(14)
Image($r('app.media.follow_list_rowLine'))
.width(7)
.margin({ left: 10 })
Column() {
Text(listItem.note)
.fontSize(16)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
Text(listItem.patientname)
.fontSize(16)
.maxLines(1)
.fontColor($r('app.color.main_color'))
}
.alignItems(HorizontalAlign.Start)
.margin({ left: 10 })
.layoutWeight(1)
Image($r('app.media.course_invoice_to_details'))
.width(20)
.height(20)
}
.width('100%')
.height(70)
.backgroundColor(Color.White)
.padding({
left: 10,
top: 10,
right: 10,
bottom: 10
})
.onClick(()=>{
HMRouterMgr.push({pageUrl:'FollowDetailsComp',param:{"uuid":listItem.uuid,"nickname":listItem.patientname}},{
onResult:()=>{
this.pageNumber = 1
this.getFollowListData()
}
})
})
Blank()
.margin({left:20})
.height(1)
.backgroundColor('#f4f4f4')
}
}
})
}
})
}
.width('100%')
.height('100%')
.scrollBar(BarState.Off)
EmptyViewComp({promptText:'暂无随访计划',isVisibility:true})
.width('100%')
.height('100%')
.visibility(this.planList.length>0?Visibility.None:Visibility.Visible)
this.addPlanPopWindows()
}
@Builder
addPlanPopWindows() {
Stack(){
Image($r('app.media.follow_add_plan_back'))
.objectFit(ImageFit.Fill)
.width(140)
.height(120)
.margin({right:10})
Column() {
Row() {
Image($r('app.media.follow_add_plan_suifang'))
.width(20)
.height(20)
.margin({left:15})
Text('添加日程')
.fontSize(15)
.fontColor('rgba(146,60,53,1)')
.margin({left:5})
}.height(60).width('100%')
.onClick(()=>{
this.isShowAddPlan = false
HMRouterMgr.push({
pageUrl:'AddScheduleFollowComp',
param:{
"uuid":this.params.FollowUpUuid,
"patientUuid":this.params.patient_uuid,
"nickname":this.params.nickname,
"realName":this.params.realName
}},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
this.pageNumber = 1
this.getFollowListData()
}
}
})
})
Blank()
.width(110)
.height(1)
.margin({left:15,right:15})
.backgroundColor('rgba(146,60,53,1)')
Row() {
Image($r('app.media.follow_add_plan_plan'))
.width(20)
.height(20)
.margin({left:15})
Text('添加随访计划')
.fontSize(15)
.fontColor('rgba(146,60,53,1)')
.margin({left:5})
}.height(60).width('100%')
.onClick(()=>{
this.isShowAddPlan = false
HMRouterMgr.push({
pageUrl:'AddFollowPlanComp',
param:{
"uuid":this.params.FollowUpUuid,
"patientUuid":this.params.patient_uuid,
"nickname":this.params.nickname,
"realName":this.params.realName
}},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
this.pageNumber = 1
this.getFollowListData()
}
}
})
})
}
.width(140)
.height(120)
.margin({right:10})
.alignItems(HorizontalAlign.End)
.justifyContent(FlexAlign.Start)
}
.alignContent(Alignment.TopEnd)
.width('100%')
.height('100%')
.backgroundColor('rgba(0,0,0,0.2)')
.visibility(this.isShowAddPlan?Visibility.Visible:Visibility.None)
}
}
interface AppointmentItem {
datetime: string
isremindme: number
isremindpatient: number
patientname: string
expertname:string
expert_uuid:string
uuid:string
createdate:string
patient_uuid:string
status:string
note:string
type:string
}
interface AppointmentGroup {
group: string
items: AppointmentItem[]
}

View File

@ -181,7 +181,7 @@ export struct GroupManagementComp {
}, },
isLeftAction:true, isLeftAction:true,
leftItemAction:()=>{ leftItemAction:()=>{
HMRouterMgr.pop() HMRouterMgr.pop({param:{'nameString':this.params.groupNames,"uuidString":this.params.groupUuids}})
} }) } })
// 已选分组 // 已选分组
Row() { Row() {

View File

@ -0,0 +1,48 @@
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter";
import { ChangeUtil, HdNav } from "@itcast/basic";
import { promptAction } from "@kit.ArkUI";
@HMRouter({pageUrl:'InputFollowContentComp'})
@Component
export struct InputFollowContentComp {
controller:TextAreaController = new TextAreaController()
private params: ESObject = HMRouterMgr.getCurrentParam()
@State followInput:string = ''
build() {
Column() {
HdNav({ title: '请输入随访内容', showRightIcon: false,showRightText:true,rightText:'保存', isLeftAction:true,rightItemAction:()=>{
if (this.followInput.length<=0) {
promptAction.showToast({ message: '请输入随访内容', duration: 1000 })
return
}
HMRouterMgr.pop({param:{"content":this.followInput}})
},leftItemAction:()=>{
HMRouterMgr.pop({param:{"content":'请于近日来院复诊、复查'}})
}})
// 输入框区域
TextArea({
placeholder:'在这里输入内容...200字以内',
controller:this.controller,
text:ChangeUtil.stringIsUndefinedAndNull(this.params.content)||String(this.params.content)=='请于近日来院复诊、复查'?'':String(this.params.content)
})
.onChange((value: string) => {
this.followInput = value
})
.placeholderFont({size:16})
.placeholderColor('#999999')
.width('95%')
.height(230)
.margin(10)
.fontSize(16)
.maxLength(200)
.backgroundColor(Color.White)
.borderRadius(5)
.border({
width:1,
color:'#999999'
})
}
.width('100%')
}
}

View File

@ -0,0 +1,148 @@
import { authStore, BasicConstant, hdHttp, HdLoadingDialog, HdNav, HdResponse, logger } from "@itcast/basic"
import { BusinessError } from "@kit.BasicServicesKit"
import { promptAction } from "@kit.ArkUI"
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter"
@HMRouter({ pageUrl: 'InspectionReportComp' })
@Component
export struct InspectionReportComp {
scroller:Scroller = new Scroller()
private params: ESObject = HMRouterMgr.getCurrentParam()
@State jsonData:Record<string, string> = {}
@State imgArray:Array<Record<string, string>> = []
@State scrollIndex:number = 1
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
aboutToAppear(): void {
this.getCaseDetailAction()
}
getCaseDetailAction() {
this.dialog.open()
hdHttp.post<string>(BasicConstant.caseDetail, {
"caseUuid": this.params.uuid
} as Record<string,string>).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response caseUuid'+res);
let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
if(json.code == '1') {
this.jsonData = json.data as Record<string, string>
this.imgArray = json.img as Record<string, string>[]
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.error(`Response fails: ${err}`);
})
}
build() {
Column() {
HdNav({title:this.params.diseaseName,showRightIcon:false,isLeftAction:true,showLeftIcon:true,leftItemAction:()=>{
HMRouterMgr.pop()
}})
Scroll(this.scroller) {
Column() {
Row() {
Text('疾病诊断:' + String(this.jsonData["diseaseName"]))
.fontSize(15)
.fontColor(Color.White)
.margin({ left: 15 })
.layoutWeight(1)
Text(String(this.jsonData["createDate"]).substring(0,10))
.fontSize(15)
.fontColor(Color.White)
.margin({ right: 15 })
}
.width('100%')
.height(40)
.backgroundColor($r('app.color.main_color'))
Column() {
Text('化验报告')
.fontSize(15)
.fontColor('#333333')
.width('100%')
.height(40)
.backgroundColor(Color.White)
.padding({ left: 15 })
if (this.imgArray.length > 0) {
Swiper() {
ForEach(this.imgArray, (item: Record<string, string>) => {
Stack({alignContent:Alignment.Bottom}) {
Image(BasicConstant.urlImage + item.path)
.alt($r('app.media.home_scroll_default1'))
.objectFit(ImageFit.Cover)
.width('85%')
.height('100%')
}.width('100%')
})
}
.indicator(false)
.loop(false)
.autoPlay(false)
.onChange((index: number) => {
this.scrollIndex = index+1
})
.height('60%')
Text(this.scrollIndex+'/'+this.imgArray.length)
.zIndex(2)
.fontColor($r('app.color.main_color'))
.width('100%')
.textAlign(TextAlign.Center)
.align(Alignment.Center)
.margin({ bottom: 10 })
} else {
Text('无检查化验报告')
.fontSize(15)
.fontColor('#666666')
.padding({ left: 15 })
.height(60)
}
}
.width('100%')
.backgroundColor('#f4f4f4')
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
Column(){
Text('疾病描述')
.fontSize(15)
.fontColor('#333333')
.backgroundColor(Color.White)
.padding({left:15})
.width('100%')
.height(40)
Blank()
.width('100%')
.height(1)
.backgroundColor('#f4f4f4')
Text(String(this.jsonData['des']))
.fontSize(15)
.fontColor('#333333')
.backgroundColor(Color.White)
.width('100%')
.padding({left:15,right:15,top:15})
}
.width('100%')
.align(Alignment.TopStart)
}
.width('100%')
.align(Alignment.TopStart)
}
.width('100%')
.height('calc(100% - 56vp)')
.backgroundColor(Color.White)
.scrollBar(BarState.Off)
.align(Alignment.TopStart)
}
}
}

View File

@ -0,0 +1,325 @@
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
import { BasicConstant, hdHttp, HdNav, HdLoadingDialog, logger, HdResponse, ChangeUtil,
DefaultHintProWindows,
authStore,
PatientData,
patientDbManager} from "@itcast/basic"
import { HashMap } from "@kit.ArkTS";
import { promptAction, router } from "@kit.ArkUI";
import { BusinessError } from "@kit.BasicServicesKit";
@HMRouter({ pageUrl: 'PatientCommonSettingComp' })
@Component
export struct PatientCommonSettingComp {
private params: ESObject = HMRouterMgr.getCurrentParam()
@State itemList:Record<string,string> = {}
scroller:Scroller = new Scroller()
private hintWindowDialog!: CustomDialogController
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
private hintPopWindowDialog() {
this.hintWindowDialog = new CustomDialogController({
builder:DefaultHintProWindows({
controller:this.hintWindowDialog,
message:'解除患者随访关系',
cancleTitleColor: '#333333',
confirmTitleColor: '#333333',
selectedButton: (index:number)=>{
if (index === 1) {
this.deletePatientAction()
}
this.hintWindowDialog.close();
}
}),
alignment: DialogAlignment.Center,
cornerRadius:24,
backgroundColor: ('rgba(0,0,0,0.5)'),
})
}
aboutToAppear(): void {
this.getPatientsInfo()
this.hintPopWindowDialog()
}
getPatientsInfo() {
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('patient_uuid',String(this.params.patient_uuid));
this.dialog.open()
hdHttp.httpReq<string>(BasicConstant.patientCard,hashMap).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response patientCard'+res);
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>
const isFriend = String(json.isFriend)
if (isFriend == '0') {
promptAction.showToast({ message: '随访关系已解除', duration: 1000 })
HMRouterMgr.pop()
} else {
if(json.code == '200') {
this.itemList = {"photo":String(json.patient["photo"]),
"realName":String(json.patient["realname"]),
"nickname":String(json.group["nickname"]),
"groupType":String(json.group["name"]),
"is_star":String(json.group["is_star"]),
"group_type":String(json.group["group_type"]),
"groupUuid":String(json.group["uuid"]),
"FollowUpDate":String(json.FollowUpDate),
"FollowUpUuid":String(json.FollowUpUuid),
"note":String(json.group["note"]),
"patientUuid":String(this.params.patient_uuid)}
} else {
console.error('患者详情请求失败:'+json.message)
}
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.info(`Response fails: ${err}`);
})
}
deletePatientAction() {
this.dialog.open()
hdHttp.post<string>(BasicConstant.cancelRes, {
"expertUuid": authStore.getUser().uuid,
"patientUuid":String(this.params.patient_uuid)
} as Record<string,string>).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response toAddNickname'+res);
let json:Record<string,string | Record<string,string>> = JSON.parse(res+'') as Record<string,string | Record<string,string>>
promptAction.showToast({ message: String(json.message), duration: 1000 })
if(json.code == '1') {
const singlePatient: PatientData = {
uuid:this.params.patient_uuid as string,
nickname: '',
mobile: '',
realName: '',
nation: '',
sex: 0,
type: 2,
photo: '',
expertUuid: authStore.getUser().uuid
}
const success = await patientDbManager.updatePatientByData(singlePatient)
if (success) {
console.info('修改成功')
} else {
console.info('修改失败')
}
HMRouterMgr.removeAll()
HMRouterMgr.pop()
} else {
console.error('获取患者信息失败:'+json.message)
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.error(`Response fails: ${err}`);
})
}
build() {
Column() {
HdNav({
title: '常用设置',
showRightIcon: false,
hasBorder: true,
showRightText: false,
isLeftAction:true,
leftItemAction:()=>{
HMRouterMgr.pop()
}
})
Scroll(this.scroller) {
Column() {
Row() {
Image(BasicConstant.urlImage + this.itemList.photo)
.width(60)
.height(60)
.borderRadius(6)
.margin({ left: 15 })
Text(ChangeUtil.stringIsUndefinedAndNull(this.itemList.nickname) ? this.itemList.realName :
this.itemList.nickname)
.fontSize(15)
.fontColor('#333333')
.margin({ left: 15 })
.layoutWeight(1)
Image($r('app.media.course_invoice_to_details'))
.width(11)
.height(20)
.margin({ right: 15 })
}
.width('100%')
.height(80)
.margin({ bottom: 10 })
.backgroundColor(Color.White)
.visibility(this.params.title == '患者详情' ? Visibility.None : Visibility.Visible)
.onClick(()=> HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":String(this.params.patient_uuid)}}))
Row() {
Text('设置备注')
.fontSize(15)
.fontColor('#333333')
.margin({ left: 15 })
.layoutWeight(1)
Text(ChangeUtil.stringIsUndefinedAndNull(this.itemList.nickname) ? '给患者添加备注名' :
this.itemList.nickname)
.textAlign(TextAlign.End)
.width('50%')
.margin({ right: 10 })
.fontSize(15)
.fontColor('#666666')
Image($r('app.media.course_invoice_to_details'))
.width(11)
.height(20)
.margin({ right: 15 })
}
.width('100%')
.height(50)
.backgroundColor(Color.White)
.margin({ bottom: 1 })
.onClick(()=> HMRouterMgr.push({pageUrl: 'PatientSetMsgPage',param:{"model":this.itemList}}))
Row() {
Text('设置分组')
.fontSize(15)
.fontColor('#333333')
.margin({ left: 15 })
.layoutWeight(1)
Text(ChangeUtil.stringIsUndefinedAndNull(this.itemList.groupType) ? '通过分组给患者分类' : this.itemList.groupType)
.width('50%')
.textAlign(TextAlign.End)
.margin({ right: 10 })
.fontSize(15)
.fontColor('#666666')
Image($r('app.media.course_invoice_to_details'))
.width(11)
.height(20)
.margin({ right: 15 })
}
.width('100%')
.height(50)
.backgroundColor(Color.White)
.margin({ bottom: 10 })
.onClick(()=> HMRouterMgr.push({pageUrl: 'PatientSetMsgPage',param:{"model":this.itemList}}))
Row() {
Text('患者描述')
.fontSize(15)
.fontColor('#333333')
.margin({ left: 15 })
.layoutWeight(1)
Text(ChangeUtil.stringIsUndefinedAndNull(this.itemList.note) ? '补充患者关键信息,方便随访患者' :
this.itemList.note)
.textOverflow({overflow:TextOverflow.Ellipsis})
.maxLines(1)
.textAlign(TextAlign.End)
.width('50%')
.margin({ right: 10 })
.fontSize(15)
.fontColor('#666666')
Image($r('app.media.course_invoice_to_details'))
.width(11)
.height(20)
.margin({ right: 15 })
}
.width('100%')
.height(50)
.backgroundColor(Color.White)
.margin({ bottom: 10 })
.onClick(()=> HMRouterMgr.push({pageUrl: 'PatientSetMsgPage',param:{"model":this.itemList}}))
Row() {
Text('下次随访时间')
.fontSize(15)
.fontColor('#333333')
.margin({ left: 15 })
.layoutWeight(1)
Text(ChangeUtil.stringIsUndefinedAndNull(this.itemList.FollowUpDate) ? '添加随访提醒' : this.itemList.FollowUpDate)
.textAlign(TextAlign.End)
.width('50%')
.margin({ right: 10 })
.fontSize(15)
.fontColor('#666666')
Image($r('app.media.course_invoice_to_details'))
.width(11)
.height(20)
.margin({ right: 15 })
}
.width('100%')
.height(50)
.backgroundColor(Color.White)
.margin({ bottom: 10 })
.onClick(()=>{
if (ChangeUtil.stringIsUndefinedAndNull(this.itemList.FollowUpDate)) {
HMRouterMgr.push({
pageUrl:'AddFollowPlanComp',
param:{
"uuid":this.itemList.FollowUpUuid,
"patientUuid":this.itemList.patientUuid,
"nickname":this.itemList.nickname,
"realName":this.itemList.realName}},{
onResult:(popInfo:HMPopInfo)=>{
this.getPatientsInfo()
}
})
} else {
HMRouterMgr.push({
pageUrl:'FollowDetailsComp',
param:{
"uuid":this.itemList.FollowUpUuid,
"nickname":this.itemList.nickname,
"realName":this.itemList.realName}},{
onResult: (popInfo: HMPopInfo) => {
this.getPatientsInfo()
}
})
}
})
Row() {
Text('投诉反馈')
.fontSize(15)
.fontColor('#333333')
.margin({ left: 15 })
.layoutWeight(1)
Image($r('app.media.course_invoice_to_details'))
.width(11)
.height(20)
.margin({ right: 15 })
}
.width('100%')
.height(50)
.backgroundColor(Color.White)
.margin({ bottom: 10 })
.onClick(()=>{
router.pushUrl({url:'pages/MinePage/FeedbackPage',params:{"title":"投诉反馈"}})
})
Row() {
Text('解除随访')
.width('100%')
.fontSize(15)
.fontColor($r('app.color.main_color'))
.textAlign(TextAlign.Center)
.onClick(() => this.hintWindowDialog.open())
}
.width('100%')
.height(50)
.alignItems(VerticalAlign.Center)
.backgroundColor(Color.White)
}
.width('100%')
}
.width('100%')
.align(Alignment.TopStart)
.height('calc(100% - 56vp)')
.scrollBar(BarState.Off)
.backgroundColor('#f4f4f4')
}
.height('100%')
}
}

View File

@ -8,7 +8,7 @@ import { TextSectionAttribute,LastSpanAttribute } from '../utils/Models'
import { applyListModel } from '../models/ApplyModel' import { applyListModel } from '../models/ApplyModel'
import { TextExpandView } from '../views/TextExpandView' import { TextExpandView } from '../views/TextExpandView'
import call from '@ohos.telephony.call' import call from '@ohos.telephony.call'
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter" import { HMLifecycleContext, HMRouter, HMRouterMgr, IHMLifecycle } from "@hadss/hmrouter"
@HMRouter({ pageUrl: 'PatientDetailsComp' }) @HMRouter({ pageUrl: 'PatientDetailsComp' })
@Component @Component
@ -18,7 +18,7 @@ export struct PatientDetailsComp {
private params: ESObject = HMRouterMgr.getCurrentParam() private params: ESObject = HMRouterMgr.getCurrentParam()
// @State params:Record<string, string> = router.getParams() as Record<string, string> // @State params:Record<string, string> = router.getParams() as Record<string, string>
@State groupArray:Array<Record<string,string>> = [] @State groupArray:Array<Record<string,string>> = []
@State footerArray:Array<Record<string,string | ResourceStr>> = [] @State footerArray:Array<Record<string,string | ResourceStr>> = [{"img":$r('app.media.sendMessage_blackBtn'),"title":"发消息"},{"img":$r('app.media.fuifangPlan_blackBtn'),"title":"制定随访计划"},{"img":$r('app.media.listBing_blackBtn'),"title":"记录病情"}]
@State patientCase:Array<Record<string,string>> = [] @State patientCase:Array<Record<string,string>> = []
@State patientData:Record<string,string> = {} @State patientData:Record<string,string> = {}
@State patientData2:applyListModel = {} @State patientData2:applyListModel = {}
@ -41,7 +41,6 @@ export struct PatientDetailsComp {
aboutToAppear(): void { aboutToAppear(): void {
this.getPatientCardData() this.getPatientCardData()
this.footerArray = [{"img":$r('app.media.sendMessage_blackBtn'),"title":"发消息"},{"img":$r('app.media.fuifangPlan_blackBtn'),"title":"制定随访计划"},{"img":$r('app.media.listBing_blackBtn'),"title":"记录病情"}]
} }
getPatientCardData(){ getPatientCardData(){
@ -343,6 +342,10 @@ export struct PatientDetailsComp {
.backgroundColor('#f4f4f4') .backgroundColor('#f4f4f4')
.borderRadius(3) .borderRadius(3)
} }
.padding({right:10})
.onClick(()=>{
HMRouterMgr.push({pageUrl:'InspectionReportComp',param:item})
})
}) })
} }
} }
@ -370,7 +373,30 @@ export struct PatientDetailsComp {
.justifyContent(FlexAlign.Center) .justifyContent(FlexAlign.Center)
.backgroundColor(Color.White) .backgroundColor(Color.White)
}.width('100%').height(50) }.width('100%').height(50)
.onClick(()=>{
if (index == 1) {
HMRouterMgr.push({pageUrl:"FollowPlanListComp",
param:{
"patient_uuid":this.params.patient_uuid,
"FollowUpUuid":this.patientGroupData.FollowUpUuid,
"nickname":this.patientData2.nickname,
"realName":this.patientData2.realName}})
} else if (index == 2) {
HMRouterMgr.push({pageUrl:"RecordTheIllnessComp",
param:{"patient_uuid":this.params.patient_uuid}})
}
})
}) })
} }
} }
} }
class TestLifecycle implements IHMLifecycle {
onWillShow(ctx: HMLifecycleContext): void {
console.info('PatientDetailsComp-onWillShow:',ctx);
}
onShown(ctx: HMLifecycleContext): void {
console.info('PatientDetailsComp-onShown:',ctx);
}
}

View File

@ -0,0 +1,183 @@
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter";
import { authStore, hdHttp, BasicConstant, HdNav, HdResponse, logger, HdLoadingDialog,
EmptyViewComp } from "@itcast/basic";
import { PullToRefreshLayout, RefreshController } from "refreshlib";
import { promptAction } from "@kit.ArkUI";
import { BusinessError } from "@kit.BasicServicesKit";
@HMRouter({pageUrl:'RecordTheIllnessComp'})
@Component
export struct RecordTheIllnessComp {
scroller = new Scroller()
private params: ESObject = HMRouterMgr.getCurrentParam()
public controller:RefreshController = new RefreshController()
@State recordList:recordList[] = []
@State totalPageNumer:number = 1
@State pageNumber:number = 1
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
aboutToAppear(): void {
this.getRecordListData()
}
getRecordListData() {
const entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patient_uuid,
"page":this.pageNumber.toString()
} as Record<string,string>
this.dialog.open()
hdHttp.post<string>(BasicConstant.conditionRecordList, entity).then(async (res: HdResponse<string>) => {
this.dialog.close();
logger.info('Response conditionRecordList'+res);
let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
if(json.code == '1') {
this.controller.refreshSuccess();
this.controller.loadSuccess();
this.totalPageNumer = Number(json.data["totalPage"])
let list = json.data["list"] as recordList[];
if (this.pageNumber === 1) {
this.recordList = list;
} else {
this.recordList = this.recordList.concat(list);
}
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
this.controller.refreshError();
console.error(`Response fails: ${err}`);
})
}
build() {
Column() {
HdNav({isLeftAction:true,title:'病情记录',showRightText:false,rightIcon:$r('app.media.record_add_list'),rightItemAction:()=>{
HMRouterMgr.push({pageUrl:'AddRecordIllnessComp'})
},leftItemAction:()=>{
HMRouterMgr.pop()
}})
PullToRefreshLayout({
scroller:this.scroller,
viewKey:"RecordListPage",
controller:this.controller,
contentView:()=>{
this.contentView()
},
onRefresh:()=>{
this.pageNumber = 1
this.recordList = []
this.getRecordListData()
},
onCanPullRefresh:()=>{
if (!this.scroller.currentOffset()) {
/*处理无数据,为空的情况*/
return true
}
//如果列表到顶返回true表示可以下拉返回false表示无法下拉
return this.scroller.currentOffset().yOffset <= 0
},
onCanPullLoad: () => {
if (this.pageNumber >= this.totalPageNumer) {
return false;
} else {
return true;
}
},
onLoad:()=>{
this.pageNumber++;
this.getRecordListData()
}
}).width('100%').height('calc(100% - 106vp)').clip(true)
}
.width('100%')
}
@Builder
contentView(){
List({scroller:this.scroller}){
ForEach(this.recordList,(item:recordList)=>{
ListItem(){
Stack(){
Text()
.width(2)
.backgroundColor($r('app.color.main_color'))
.margin({left:13})
Image($r('app.media.record_list_time_dian'))
.width(20).height(20)
.margin({left:4,top:20})
Image($r('app.media.record_list_time_back'))
.objectFit(ImageFit.Fill)
.width(140)
.height(30)
.margin({left:25,top:15})
Text(item.create_date)
.fontSize(16)
.textAlign(TextAlign.Center)
.width(140)
.height(30)
.margin({left:25,top:15})
Column() {
Text(item.des)
.fontSize(16)
.width('100%')
Grid() {
ForEach(item.photo, (photo: string) => {
GridItem() {
Image(BasicConstant.urlImage + photo)
.alt($r('app.media.record_list_default'))
}
.width(item.photo.length<=1?160:80)
.height(item.photo.length<=1?160:80)
.margin({ right: 10, bottom: 10 })
})
}
.width('100%')
.margin({top:20})
Blank()
.width('100%')
.height(1)
.backgroundColor('#f4f4f4')
.margin({top: 10})
}
.margin({left:35,top:60,right:15})
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
}
.width('100%')
.alignContent(Alignment.TopStart)
}
.width('100%')
})
}
.width('100%')
.height('100%')
.scrollBar(BarState.Off)
EmptyViewComp({promptText:'暂无病情记录',isVisibility:true})
.width('100%')
.height('100%')
.visibility(this.recordList.length>0?Visibility.None:Visibility.Visible)
}
}
interface recordList {
create_date: string
des: string
patient_uuid: string
expert_uuid: string
uuid:string
photo:Array<string>
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -146,7 +146,7 @@ struct SettingPage {
} else if (index == 5) { } else if (index == 5) {
this.clearCache(); this.clearCache();
} else if (index == 6) { } else if (index == 6) {
router.pushUrl({url:'pages/MinePage/FeedbackPage'}) router.pushUrl({url:'pages/MinePage/FeedbackPage',params:{"title":"意见反馈"}})
} else if (index == 7) { } else if (index == 7) {
router.pushUrl({url:'pages/MinePage/CancelAccount'}) router.pushUrl({url:'pages/MinePage/CancelAccount'})
} else if (index == 8) { } else if (index == 8) {