medical file hot fix

merge-requests/572/head
hussam al-habibeh 4 years ago
parent 45e9ee60a9
commit 0e836c67c8

@ -85,80 +85,103 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.push( if (model
context, .medicalFileList[0]
MaterialPageRoute( .entityList[0]
builder: (context) => MedicalFileDetails( .timelines[index]
age: patient.age is String .timeLineEvents[0]
? patient.age ?? "" .consulations
: "${patient.age}", .length !=
firstName: patient.firstName, 0)
lastName: patient.lastName, Navigator.push(
gender: patient.genderDescription, context,
encounterNumber: index, MaterialPageRoute(
pp: patient.patientId, builder: (context) => MedicalFileDetails(
patient: patient, age: patient.age is String
doctorName: model ? patient.age ?? ""
.medicalFileList[0] : "${patient.age}",
.entityList[0] firstName: patient.firstName,
.timelines[index] lastName: patient.lastName,
.timeLineEvents[0] gender: patient.genderDescription,
.consulations encounterNumber: index,
.isNotEmpty pp: patient.patientId,
? model patient: patient,
.medicalFileList[0] doctorName: model
.entityList[0] .medicalFileList[0]
.timelines[index] .entityList[0]
.doctorName .timelines[index]
: "", .timeLineEvents[0]
clinicName: model .consulations
.medicalFileList[0] .isNotEmpty
.entityList[0] ? model
.timelines[index] .medicalFileList[0]
.timeLineEvents[0] .entityList[0]
.consulations .timelines[index]
.isNotEmpty .doctorName
? model : "",
.medicalFileList[0] clinicName: model
.entityList[0] .medicalFileList[0]
.timelines[index] .entityList[0]
.clinicName .timelines[index]
: "", .timeLineEvents[0]
doctorImage: model .consulations
.medicalFileList[0] .isNotEmpty
.entityList[0] ? model
.timelines[index] .medicalFileList[0]
.timeLineEvents[0] .entityList[0]
.consulations .timelines[index]
.isNotEmpty .clinicName
? model : "",
.medicalFileList[0] doctorImage: model
.entityList[0] .medicalFileList[0]
.timelines[index] .entityList[0]
.doctorImage .timelines[index]
: "", .timeLineEvents[0]
episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty .consulations
? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() .isNotEmpty
: "", ? model
vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), .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())),
);
}, },
child: DoctorCard( child: DoctorCard(
doctorName: model.medicalFileList[0] doctorName: model
.entityList[0].timelines[index].doctorName, .medicalFileList[0]
clinic: model.medicalFileList[0].entityList[0] .entityList[0]
.timelines[index].clinicName, .timelines[index]
branch: model.medicalFileList[0].entityList[0] .doctorName,
.timelines[index].projectName, clinic: model.medicalFileList[0].entityList[0]
profileUrl: model.medicalFileList[0] .timelines[index].clinicName,
.entityList[0].timelines[index].doctorImage, branch: model.medicalFileList[0].entityList[0]
appointmentDate: .timelines[index].projectName,
DateUtils.getDateTimeFromServerFormat( profileUrl: model
model.medicalFileList[0].entityList[0] .medicalFileList[0]
.timelines[index].date, .entityList[0]
), .timelines[index]
isPrescriptions: true, .doctorImage,
), appointmentDate:
DateUtils.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),
); );
}) })
: Center( : Center(

@ -21,6 +21,7 @@ class DoctorCard extends StatelessWidget {
final Function onTap; final Function onTap;
final bool isPrescriptions; final bool isPrescriptions;
final String clinic; final String clinic;
final bool isShowEye;
DoctorCard( DoctorCard(
{this.doctorName, {this.doctorName,
@ -31,7 +32,8 @@ class DoctorCard extends StatelessWidget {
this.appointmentDate, this.appointmentDate,
this.orderNo, this.orderNo,
this.isPrescriptions = false, this.isPrescriptions = false,
this.clinic}); this.clinic,
this.isShowEye = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -50,7 +52,7 @@ class DoctorCard extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: InkWell( child: InkWell(
onTap: onTap, onTap: (isShowEye) ? onTap : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -169,9 +171,10 @@ class DoctorCard extends StatelessWidget {
]), ]),
), ),
), ),
Icon( if (isShowEye)
EvaIcons.eye, Icon(
) EvaIcons.eye,
)
], ],
), ),
), ),

Loading…
Cancel
Save