|
|
|
|
@ -6,7 +6,6 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
|
|
|
|
@ -19,23 +18,23 @@ class HealthSummaryPage extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _HealthSummaryPageState extends State<HealthSummaryPage> {
|
|
|
|
|
PatiantInformtion patient;
|
|
|
|
|
late PatiantInformtion patient;
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
|
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
|
String patientType = routeArgs['patientType'];
|
|
|
|
|
String arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
bool isInpatient = routeArgs['isInpatient'];
|
|
|
|
|
return BaseView<MedicalFileViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
|
|
|
|
|
builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold(
|
|
|
|
|
appBar: PatientProfileAppBar(
|
|
|
|
|
patient,
|
|
|
|
|
builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold(
|
|
|
|
|
patientProfileAppBarModel: PatientProfileAppBarModel(
|
|
|
|
|
patient: patient,
|
|
|
|
|
isInpatient: isInpatient,
|
|
|
|
|
),
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
|
|
|
|
|
appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(),
|
|
|
|
|
body: NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
@ -75,86 +74,88 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
|
|
|
|
|
),
|
|
|
|
|
(model.medicalFileList != null && model.medicalFileList.length != 0)
|
|
|
|
|
? ListView.builder(
|
|
|
|
|
//physics: ,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: model.medicalFileList[0].entityList[0].timelines.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if (model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
|
|
|
|
|
.consulations.length !=
|
|
|
|
|
0)
|
|
|
|
|
await locator<AnalyticsService>().logEvent(
|
|
|
|
|
eventCategory: "Health Summary Page",
|
|
|
|
|
eventAction: "Health Summary Details",
|
|
|
|
|
);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => MedicalFileDetails(
|
|
|
|
|
age: patient.age is String ? patient.age ?? "" : "${patient.age}",
|
|
|
|
|
firstName: patient.firstName,
|
|
|
|
|
lastName: patient.lastName,
|
|
|
|
|
gender: patient.genderDescription,
|
|
|
|
|
encounterNumber: index,
|
|
|
|
|
pp: patient.patientId,
|
|
|
|
|
patient: patient,
|
|
|
|
|
doctorName: model.medicalFileList[0].entityList[0].timelines[index]
|
|
|
|
|
.timeLineEvents[0].consulations.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList[0].timelines[index].doctorName
|
|
|
|
|
: "",
|
|
|
|
|
clinicName: model.medicalFileList[0].entityList[0].timelines[index]
|
|
|
|
|
.timeLineEvents[0].consulations.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList[0].timelines[index].clinicName
|
|
|
|
|
: "",
|
|
|
|
|
doctorImage: model.medicalFileList[0].entityList[0].timelines[index]
|
|
|
|
|
.timeLineEvents[0].consulations.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList[0].timelines[index].doctorImage
|
|
|
|
|
: "",
|
|
|
|
|
episode: model.medicalFileList[0].entityList[0].timelines[index]
|
|
|
|
|
.timeLineEvents[0].consulations.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
|
|
|
|
|
.consulations[0].episodeID
|
|
|
|
|
.toString()
|
|
|
|
|
: "",
|
|
|
|
|
vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()),
|
|
|
|
|
settings: RouteSettings(name: 'MedicalFileDetails'),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
doctorName: model.medicalFileList[0].entityList[0].timelines[index].doctorName,
|
|
|
|
|
clinic: model.medicalFileList[0].entityList[0].timelines[index].clinicName,
|
|
|
|
|
branch: model.medicalFileList[0].entityList[0].timelines[index].projectName,
|
|
|
|
|
profileUrl: model.medicalFileList[0].entityList[0].timelines[index].doctorImage,
|
|
|
|
|
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
model.medicalFileList[0].entityList[0].timelines[index].date,
|
|
|
|
|
),
|
|
|
|
|
isPrescriptions: true,
|
|
|
|
|
isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
|
|
|
|
|
.consulations.length !=
|
|
|
|
|
0
|
|
|
|
|
? true
|
|
|
|
|
: false),
|
|
|
|
|
//physics: ,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: model.medicalFileList[0].entityList![0].timelines!.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () async{
|
|
|
|
|
if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0]
|
|
|
|
|
.consulations!.length !=
|
|
|
|
|
0)
|
|
|
|
|
await locator<AnalyticsService>().logEvent(
|
|
|
|
|
eventCategory: "Health Summary Page",
|
|
|
|
|
eventAction: "Health Summary Details",
|
|
|
|
|
);Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => MedicalFileDetails(
|
|
|
|
|
age: patient.age is String ? patient.age ?? "" : "${patient.age}",
|
|
|
|
|
firstName: patient.firstName ?? "",
|
|
|
|
|
lastName: patient.lastName ?? "",
|
|
|
|
|
gender: patient.genderDescription ?? "",
|
|
|
|
|
encounterNumber: index,
|
|
|
|
|
pp: patient.patientId,
|
|
|
|
|
patient: patient,
|
|
|
|
|
doctorName: model.medicalFileList[0].entityList![0].timelines![index]
|
|
|
|
|
.timeLineEvents![0].consulations!.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList![0].timelines![index].doctorName
|
|
|
|
|
: "",
|
|
|
|
|
clinicName: model.medicalFileList[0].entityList![0].timelines![index]
|
|
|
|
|
.timeLineEvents![0].consulations!.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList![0].timelines![index].clinicName
|
|
|
|
|
: "",
|
|
|
|
|
doctorImage: model.medicalFileList[0].entityList![0].timelines![index]
|
|
|
|
|
.timeLineEvents![0].consulations!.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList![0].timelines![index].doctorImage
|
|
|
|
|
: "",
|
|
|
|
|
episode: model.medicalFileList[0].entityList![0].timelines![index]
|
|
|
|
|
.timeLineEvents![0].consulations!.isNotEmpty
|
|
|
|
|
? model.medicalFileList[0].entityList![0].timelines![index]
|
|
|
|
|
.timeLineEvents![0]
|
|
|
|
|
.consulations![0].episodeID
|
|
|
|
|
.toString()
|
|
|
|
|
: "",
|
|
|
|
|
vistDate: model.medicalFileList[0].entityList![0].timelines![index].date
|
|
|
|
|
.toString()),
|
|
|
|
|
settings: RouteSettings(name: 'MedicalFileDetails'),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 100,
|
|
|
|
|
},
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
doctorName:
|
|
|
|
|
model.medicalFileList[0].entityList![0].timelines![index].doctorName ?? "",
|
|
|
|
|
clinic: model.medicalFileList[0].entityList![0].timelines![index].clinicName ?? "",
|
|
|
|
|
branch: model.medicalFileList[0].entityList![0].timelines![index].projectName ?? "",
|
|
|
|
|
profileUrl:
|
|
|
|
|
model.medicalFileList[0].entityList![0].timelines![index].doctorImage ?? "",
|
|
|
|
|
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
model.medicalFileList[0].entityList![0].timelines![index].date ?? "",
|
|
|
|
|
),
|
|
|
|
|
Image.asset('assets/images/no-data.png'),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: AppText(TranslationBase.of(context).noMedicalFileFound),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
isPrescriptions: true,
|
|
|
|
|
isShowEye: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.length !=
|
|
|
|
|
0
|
|
|
|
|
? true
|
|
|
|
|
: false),
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 100,
|
|
|
|
|
),
|
|
|
|
|
Image.asset('assets/images/no-data.png'),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: AppText(TranslationBase.of(context).noMedicalFileFound),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|