You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/screens/medical-file/medical_file_details.dart

1027 lines
63 KiB
Dart

4 years ago
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
4 years ago
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
4 years ago
import 'package:doctor_app_flutter/widgets/shared/Text.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/expandable-widget-header-body.dart';
4 years ago
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
4 years ago
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
class MedicalFileDetails extends StatefulWidget {
String age;
String firstName;
String lastName;
String gender;
4 years ago
int encounterNumber;
int pp;
PatiantInformtion patient;
4 years ago
MedicalFileDetails(
{this.age,
this.firstName,
this.lastName,
this.gender,
this.encounterNumber,
this.pp,
this.patient});
4 years ago
@override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState(
firstName: firstName,
age: age,
lastName: lastName,
gender: gender,
encounterNumber: encounterNumber,
pp: pp,
patient: patient,
);
4 years ago
}
class _MedicalFileDetailsState extends State<MedicalFileDetails> {
4 years ago
int encounterNumber;
4 years ago
String age;
String firstName;
String lastName;
String gender;
4 years ago
int pp;
PatiantInformtion patient;
4 years ago
_MedicalFileDetailsState(
4 years ago
{this.age,
this.firstName,
this.lastName,
this.gender,
this.encounterNumber,
this.pp,
this.patient});
4 years ago
bool isPhysicalExam = false;
bool isProcedureExpand = false;
bool isHistoryExpand = false;
bool isAssessmentExpand = false;
@override
Widget build(BuildContext context) {
return BaseView<MedicalFileViewModel>(
4 years ago
onModelReady: (model) => model.getMedicalFile(mrn: pp),
4 years ago
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
4 years ago
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
4 years ago
child: Center(
child: Container(
child: Column(
children: [
PatientProfileHeaderNewDesign(patient,
patient.patientType.toString(), patient.arrivedOn),
4 years ago
model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0
? Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
4 years ago
),
border: Border.all(
color: Colors.grey[200], width: 0.5),
),
child: Column(
4 years ago
children: [
Row(
children: [
if (model.medicalFileList.length !=
0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Expanded(
child: AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.doctorName
.toUpperCase(),
fontWeight: FontWeight.w700,
),
),
],
4 years ago
),
if (model.medicalFileList.length != 0)
Row(
children: [
AppText(
TranslationBase.of(context)
.clinic +
": ",
),
if (model.medicalFileList
.length !=
0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.clinicName,
fontWeight: FontWeight.w700,
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.episode +
": ",
fontWeight: FontWeight.w700,
),
if (model.medicalFileList.length !=
0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
AppText(
model
4 years ago
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.episodeID
.toString(),
fontWeight: FontWeight.w700,
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.visitDate +
": ",
fontWeight: FontWeight.w700,
),
if (model.medicalFileList.length !=
0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.appointmentDate
.toString(),
fontWeight: FontWeight.w700,
),
SizedBox(width: 35.0),
// AppText(
// 'Appt Date : ',
// fontWeight: FontWeight.w700,
// ),
// AppText(
// '23/12/2020',
// ),
],
),
],
),
4 years ago
),
4 years ago
SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
4 years ago
children: [
Row(
children: [
Texts(
TranslationBase.of(
context)
.historyOfPresentIllness
.toUpperCase(),
variant: isHistoryExpand
? "bodyText"
: '',
bold: isHistoryExpand
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand =
!isHistoryExpand;
});
},
child: Icon(isHistoryExpand
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
4 years ago
],
),
bodyWidget: ListView.builder(
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstCheifComplaint
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment:
MainAxisAlignment
.center,
4 years ago
children: [
Row(
children: [
Expanded(
child: AppText(
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstCheifComplaint[
index]
.hOPI
.trim(),
),
),
SizedBox(
width: 35.0),
],
4 years ago
),
],
),
),
);
}),
isExpand: isHistoryExpand,
),
),
),
// SizedBox(
// height: 30,
// ),
4 years ago
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
4 years ago
children: [
Row(
children: [
Texts(
TranslationBase.of(
context)
.assessment
.toUpperCase(),
variant:
isAssessmentExpand
? "bodyText"
: '',
bold: isAssessmentExpand
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand =
!isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
4 years ago
],
),
bodyWidget: ListView.builder(
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment:
MainAxisAlignment
.center,
4 years ago
children: [
Row(
children: [
AppText(
'ICD',
fontWeight:
FontWeight
.w700,
),
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.iCD10
.trim(),
),
SizedBox(
width: 35.0),
AppText(
'Condition: ',
fontWeight:
FontWeight
.w700,
),
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.condition
.trim(),
),
],
4 years ago
),
Row(
children: [
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.description,
fontWeight:
FontWeight
.w700,
)
],
),
Row(
children: [
AppText(
'Type: ',
fontWeight:
FontWeight
.w700,
),
AppText(model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[0]
.lstAssessments[
index]
.type),
],
),
SizedBox(
height: 15.0,
4 years ago
),
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[
index]
.remarks
4 years ago
.trim(),
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
4 years ago
),
],
),
),
);
}),
isExpand: isAssessmentExpand,
),
),
),
// SizedBox(
// height: 30,
// ),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
4 years ago
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
4 years ago
children: [
Row(
children: [
Texts(
TranslationBase.of(
context)
.test
.toUpperCase(),
variant: isProcedureExpand
? "bodyText"
: '',
bold: isProcedureExpand
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isProcedureExpand =
!isProcedureExpand;
});
},
child: Icon(isProcedureExpand
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
4 years ago
],
),
bodyWidget: ListView.builder(
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstProcedure
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment:
MainAxisAlignment
.center,
4 years ago
children: [
Row(
children: [
Column(
children: [
AppText(
'Procedure ID: ',
fontWeight:
FontWeight
.w700,
),
AppText(
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.procedureId
.trim(),
),
],
),
SizedBox(
width: 35.0),
Column(
children: [
AppText(
'Order Date: ',
fontWeight:
FontWeight
.w700,
),
AppText(
Helpers.getDateFormatted(
DateTime
.parse(
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.orderDate
.trim(),
)),
fontSize:
13.5,
),
],
),
],
4 years ago
),
SizedBox(
height: 20.0,
),
Row(
children: [
Expanded(
child: AppText(
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.procName,
fontWeight:
FontWeight
.w700,
),
)
],
4 years ago
),
Row(
children: [
AppText(
'CPT Code : ',
fontWeight:
FontWeight
.w700,
),
AppText(model
4 years ago
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[0]
.lstProcedure[
index]
.patientID
.toString()),
],
4 years ago
),
SizedBox(
height: 15.0,
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
4 years ago
),
],
),
),
);
}),
isExpand: isProcedureExpand,
),
),
4 years ago
),
// SizedBox(
// height: 30,
// ),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
4 years ago
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
4 years ago
children: [
Row(
children: [
Texts(
TranslationBase.of(
context)
.physicalSystemExamination
.toUpperCase(),
variant: isPhysicalExam
? "bodyText"
: '',
bold: isPhysicalExam
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isPhysicalExam =
!isPhysicalExam;
});
},
child: Icon(isPhysicalExam
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
4 years ago
],
),
bodyWidget: ListView.builder(
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
4 years ago
children: [
Row(
children: [
AppText(
'Exam Type: ',
fontWeight:
FontWeight
.w700,
),
AppText(model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[0]
.lstPhysicalExam[
index]
.examDesc),
],
),
Row(
children: [
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.examDesc,
fontWeight:
FontWeight
.w700,
)
],
),
Row(
children: [
AppText(
'Abnormal: ',
fontWeight:
FontWeight
.w700,
),
AppText(model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[0]
.lstPhysicalExam[
index]
.abnormal),
],
),
SizedBox(
height: 15.0,
4 years ago
),
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
4 years ago
.lstPhysicalExam[
index]
.remarks,
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
),
4 years ago
],
),
),
);
}),
isExpand: isPhysicalExam,
),
),
4 years ago
),
SizedBox(
height: 30,
),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
4 years ago
],
),
4 years ago
),
4 years ago
)
: Text("There's no medical file for this patient")
],
),
4 years ago
),
4 years ago
),
),
),
),
);
}
}