Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into favorite_procedure_templates

merge-requests/704/head
Mohammad Aljammal 5 years ago
commit 80a751ae4d

@ -17,19 +17,23 @@ class LiveCarePatientViewModel extends BaseViewModel {
LiveCarePatientServices _liveCarePatientServices = LiveCarePatientServices _liveCarePatientServices =
locator<LiveCarePatientServices>(); locator<LiveCarePatientServices>();
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
DashboardService _dashboardService = DashboardService _dashboardService = locator<DashboardService>();
locator<DashboardService>();
getPendingPatientERForDoctorApp({bool isFromTimer = false}) async {
if (isFromTimer) {
setState(ViewState.Idle);
} else {
setState(ViewState.BusyLocal);
}
getPendingPatientERForDoctorApp() async {
setState(ViewState.BusyLocal);
PendingPatientERForDoctorAppRequestModel PendingPatientERForDoctorAppRequestModel
pendingPatientERForDoctorAppRequestModel = pendingPatientERForDoctorAppRequestModel =
PendingPatientERForDoctorAppRequestModel(sErServiceID:_dashboardService.sServiceID, outSA: false); PendingPatientERForDoctorAppRequestModel(
await _liveCarePatientServices sErServiceID: _dashboardService.sServiceID, outSA: false);
.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); await _liveCarePatientServices.getPendingPatientERForDoctorApp(
pendingPatientERForDoctorAppRequestModel);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
@ -49,8 +53,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
endCallReq.isDestroy = isPatient; endCallReq.isDestroy = isPatient;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _liveCarePatientServices await _liveCarePatientServices.endCall(endCallReq);
.endCall(endCallReq);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -59,7 +62,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
} }
} }
getToken()async{ getToken() async {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
return token; return token;
} }
@ -86,12 +89,11 @@ class LiveCarePatientViewModel extends BaseViewModel {
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future endCallWithCharge(int vcID) async { Future endCallWithCharge(int vcID) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _liveCarePatientServices await _liveCarePatientServices.endCallWithCharge(vcID);
.endCallWithCharge(vcID);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -103,8 +105,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
Future transferToAdmin(int vcID, String notes) async { Future transferToAdmin(int vcID, String notes) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _liveCarePatientServices await _liveCarePatientServices.transferToAdmin(vcID, notes);
.transferToAdmin(vcID, notes);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -115,19 +116,20 @@ class LiveCarePatientViewModel extends BaseViewModel {
} }
searchData(String str) { searchData(String str) {
var strExist= str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {
filterData = []; filterData = [];
for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) {
String fullName = String fullName =
_liveCarePatientServices.patientList[i].fullName.toUpperCase(); _liveCarePatientServices.patientList[i].fullName.toUpperCase();
String patientID = String patientID =
_liveCarePatientServices.patientList[i].patientId.toString(); _liveCarePatientServices.patientList[i].patientId.toString();
String mobile = String mobile =
_liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase();
if (fullName.contains(str.toUpperCase()) || if (fullName.contains(str.toUpperCase()) ||
patientID.contains(str)|| mobile.contains(str)) { patientID.contains(str) ||
mobile.contains(str)) {
filterData.add(_liveCarePatientServices.patientList[i]); filterData.add(_liveCarePatientServices.patientList[i]);
} }
} }

@ -7,6 +7,15 @@ class PatiantInformtion {
String appointmentDate; String appointmentDate;
dynamic appointmentNo; dynamic appointmentNo;
dynamic appointmentType; dynamic appointmentType;
String arrivalTime;
String arrivalTimeD;
int callStatus;
Null callStatusDisc;
int callTypeID;
String clientRequestID;
String clinicName;
String consoltationEnd;
String consultationNotes;
int appointmentTypeId; int appointmentTypeId;
String arrivedOn; String arrivedOn;
int clinicGroupId; int clinicGroupId;
@ -57,12 +66,14 @@ class PatiantInformtion {
String startTime; String startTime;
String visitType; String visitType;
String nationalityFlagURL; String nationalityFlagURL;
int patientStatus;
int patientStatusType; int patientStatusType;
int visitTypeId; int visitTypeId;
String startTimes; String startTimes;
String dischargeDate; String dischargeDate;
int status; int status;
int vcId; int vcId;
String voipToken;
PatiantInformtion( PatiantInformtion(
{this.patientDetails, {this.patientDetails,
@ -102,6 +113,15 @@ class PatiantInformtion {
this.appointmentDate, this.appointmentDate,
this.startTime, this.startTime,
this.appointmentNo, this.appointmentNo,
this.arrivalTime,
this.arrivalTimeD,
this.callStatus,
this.callStatusDisc,
this.callTypeID,
this.clientRequestID,
this.clinicName,
this.consoltationEnd,
this.consultationNotes,
this.appointmentType, this.appointmentType,
this.appointmentTypeId, this.appointmentTypeId,
this.arrivedOn, this.arrivedOn,
@ -122,20 +142,27 @@ class PatiantInformtion {
this.fullNameN, this.fullNameN,
this.nationalityFlagURL, this.nationalityFlagURL,
this.patientStatusType, this.patientStatusType,
this.patientStatus,
this.visitTypeId, this.visitTypeId,
this.startTimes,this.dischargeDate,this.status, this.vcId}); this.startTimes,
this.dischargeDate,
this.status,
this.vcId,
this.voipToken});
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => factory PatiantInformtion.fromJson(Map<String, dynamic> json) =>
PatiantInformtion( PatiantInformtion(
patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) patientDetails: json['patientDetails'] != null
? new PatiantInformtion.fromJson(json['patientDetails'])
: null, : null,
projectId: json["ProjectID"] ?? json["projectID"], projectId: json["ProjectID"] ?? json["projectID"],
clinicId: json["ClinicID"] ?? json["clinicID"], clinicId: json["ClinicID"] ?? json["clinicID"],
doctorId: json["DoctorID"] ?? json["doctorID"], doctorId: json["DoctorID"] ?? json["doctorID"],
patientId: json["PatientID"]!= null ?json["PatientID"] is String ? int.parse(json["PatientID"]):json["PatientID"]: patientId: json["PatientID"] != null
json["patientID"] ?? ? json["PatientID"] is String
json['patientMRN'] ?? ? int.parse(json["PatientID"])
json['PatientMRN'], : json["PatientID"]
: json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'],
doctorName: json["DoctorName"] ?? json["doctorName"], doctorName: json["DoctorName"] ?? json["doctorName"],
doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"],
firstName: json["FirstName"] ?? json["firstName"], firstName: json["FirstName"] ?? json["firstName"],
@ -144,17 +171,22 @@ class PatiantInformtion {
firstNameN: json["FirstNameN"] ?? json["firstNameN"], firstNameN: json["FirstNameN"] ?? json["firstNameN"],
middleNameN: json["MiddleNameN"] ?? json["middleNameN"], middleNameN: json["MiddleNameN"] ?? json["middleNameN"],
lastNameN: json["LastNameN"] ?? json["lastNameN"], lastNameN: json["LastNameN"] ?? json["lastNameN"],
gender: json["Gender"]!= null? json["Gender"]is String ?int.parse(json["Gender"]):json["Gender"] :json["gender"], gender: json["Gender"] != null
fullName: json["fullName"] ?? json["fullName"]??json["PatientName"], ? json["Gender"] is String
fullNameN: json["fullNameN"] ?? json["fullNameN"]??json["PatientName"], ? int.parse(json["Gender"])
dateofBirth: json["DateofBirth"] ?? json["dob"]??json['DateOfBirth'], : json["Gender"]
: json["gender"],
fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"],
fullNameN:
json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"],
dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'],
nationalityId: json["NationalityID"] ?? json["nationalityID"], nationalityId: json["NationalityID"] ?? json["nationalityID"],
mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], mobileNumber: json["MobileNumber"] ?? json["mobileNumber"],
emailAddress: json["EmailAddress"] ?? json["emailAddress"], emailAddress: json["EmailAddress"] ?? json["emailAddress"],
patientIdentificationNo: patientIdentificationNo:
json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], json["PatientIdentificationNo"] ?? json["patientIdentificationNo"],
//TODO make 7 dynamic when the backend retrun it in patient arrival //TODO make 7 dynamic when the backend retrun it in patient arrival
patientType: json["PatientType"] ?? json["patientType"]??1, patientType: json["PatientType"] ?? json["patientType"] ?? 1,
admissionNo: json["AdmissionNo"] ?? json["admissionNo"], admissionNo: json["AdmissionNo"] ?? json["admissionNo"],
admissionDate: json["AdmissionDate"] ?? json["admissionDate"], admissionDate: json["AdmissionDate"] ?? json["admissionDate"],
createdOn: json["CreatedOn"] ?? json["CreatedOn"], createdOn: json["CreatedOn"] ?? json["CreatedOn"],
@ -176,10 +208,11 @@ class PatiantInformtion {
genderDescription: json["GenderDescription"], genderDescription: json["GenderDescription"],
nursingStationName: json["NursingStationName"], nursingStationName: json["NursingStationName"],
appointmentDate: json["AppointmentDate"] ?? '', appointmentDate: json["AppointmentDate"] ?? '',
startTime: json["startTime"]??json['StartTime'], startTime: json["startTime"] ?? json['StartTime'],
appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'],
appointmentType: json['appointmentType'], appointmentType: json['appointmentType'],
appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], appointmentTypeId:
json['appointmentTypeId'] ?? json['appointmentTypeid'],
arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'],
clinicGroupId: json['clinicGroupId'], clinicGroupId: json['clinicGroupId'],
companyName: json['companyName'], companyName: json['companyName'],
@ -192,15 +225,28 @@ class PatiantInformtion {
medicationOrders: json['medicationOrders'], medicationOrders: json['medicationOrders'],
nationality: json['nationality'] ?? json['NationalityNameN'], nationality: json['nationality'] ?? json['NationalityNameN'],
patientMRN: json['patientMRN'] ?? json['PatientMRN'], patientMRN: json['patientMRN'] ?? json['PatientMRN'],
visitType: json['visitType'] ?? json['visitType']?? json['visitType'], visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'],
nationalityFlagURL: nationalityFlagURL:
json['NationalityFlagURL'] ?? json['NationalityFlagURL'], json['NationalityFlagURL'] ?? json['NationalityFlagURL'],
patientStatusType: patientStatusType:
json['patientStatusType'] ?? json['PatientStatusType'], json['patientStatusType'] ?? json['PatientStatusType'],
visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], visitTypeId:
json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'],
startTimes: json['StartTime'] ?? json['StartTime'], startTimes: json['StartTime'] ?? json['StartTime'],
dischargeDate: json['DischargeDate'] , dischargeDate: json['DischargeDate'],
status: json['Status'] , status: json['Status'],
vcId: json['VC_ID'] , vcId: json['VC_ID'],
arrivalTime: json['ArrivalTime'],
arrivalTimeD: json['ArrivalTimeD'],
callStatus: json['CallStatus'],
callStatusDisc: json['CallStatusDisc'],
callTypeID: json['CallTypeID'],
clientRequestID: json['ClientRequestID'],
clinicName: json['ClinicName'],
consoltationEnd: json['ConsoltationEnd'],
consultationNotes: json['ConsultationNotes'],
patientStatus: json['PatientStatus'],
voipToken: json['VoipToken'],
); );
} }

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
@ -22,10 +24,30 @@ class LiveCarePatientScreen extends StatefulWidget {
class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> { class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
final _controller = TextEditingController(); final _controller = TextEditingController();
Timer timer;
LiveCarePatientViewModel _liveCareViewModel;
@override
void initState() {
super.initState();
timer = Timer.periodic(Duration(seconds: 10), (Timer t) {
if(_liveCareViewModel != null){
_liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true);
}
});
}
@override
void dispose() {
_liveCareViewModel = null;
timer?.cancel();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
_liveCareViewModel = model;
await model.getPendingPatientERForDoctorApp(); await model.getPendingPatientERForDoctorApp();
}, },

@ -43,15 +43,25 @@ class PatientCard extends StatelessWidget {
), ),
child: CardWithBgWidget( child: CardWithBgWidget(
padding: 0, padding: 0,
marginLeft: (!isMyPatient && isInpatient)?0:10, marginLeft: (!isMyPatient && isInpatient) ? 0 : 10,
marginSymmetric:isFromSearch ? 10 : 0.0, marginSymmetric: isFromSearch ? 10 : 0.0,
hasBorder: false, hasBorder: false,
bgColor:isFromLiveCare?Colors.white:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43 bgColor: isFromLiveCare
? Colors.green[500] ? Colors.white
:isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white, : (isMyPatient && !isFromSearch)
? Colors.green[500]
: patientInfo.patientStatusType == 43
? Colors.green[500]
: isMyPatient
? Colors.green[500]
: isInpatient
? Colors.white
: !isFromSearch
? Colors.red[800]
: Colors.white,
widget: Container( widget: Container(
color: Colors.white, color: Colors.white,
// padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: InkWell( child: InkWell(
child: Column( child: Column(
children: [ children: [
@ -66,67 +76,120 @@ class PatientCard extends StatelessWidget {
children: [ children: [
patientInfo.patientStatusType == 43 patientInfo.patientStatusType == 43
? Row( ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).arrivedP, TranslationBase.of(context)
.arrivedP,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 10, fontSize: 10,
), ),
SizedBox(width: 8,), SizedBox(
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), width: 8,
SizedBox(width: 8,), ),
AppText( SizedBox(
patientInfo.status==2? 'Confirmed':'Booked', height: 12,
color: patientInfo.status==2? Colors.green:Colors.grey , width: 1.5,
fontWeight: FontWeight.bold, child: Container(
fontFamily: 'Poppins', color: Colors.grey,
fontSize: 10, ),
), ),
], SizedBox(
) width: 8,
: patientInfo.patientStatusType == 42?Row( ),
children: [ AppText(
AppText( patientInfo.status == 2
TranslationBase.of(context).notArrived, ? 'Confirmed'
color: Colors.red[800], : 'Booked',
color: patientInfo.status == 2
? Colors.green
: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 10, fontSize: 10,
), ),
SizedBox(width: 8,), ],
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), )
SizedBox(width: 8,), : patientInfo.patientStatusType == 42
AppText( ? Row(
patientInfo.status==2? 'Confirmed':'Booked', children: [
color: patientInfo.status==2? Colors.green:Colors.grey , AppText(
fontWeight: FontWeight.bold, TranslationBase.of(context)
fontFamily: 'Poppins', .notArrived,
fontSize: 10, color: Colors.red[800],
), fontWeight: FontWeight.bold,
], fontFamily: 'Poppins',
): !isFromSearch&&!isFromLiveCare && patientInfo.patientStatusType==null ? Row( fontSize: 10,
children: [ ),
AppText( SizedBox(
TranslationBase.of(context).notArrived, width: 8,
color: Colors.red[800], ),
fontWeight: FontWeight.bold, SizedBox(
fontFamily: 'Poppins', height: 12,
fontSize: 12, width: 1.5,
), child: Container(
SizedBox(width: 8,), color: Colors.grey,
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), ),
SizedBox(width: 8,), ),
AppText( SizedBox(
patientInfo.status==2? 'Booked':'Confirmed', width: 8,
color: patientInfo.status==2? Colors.grey:Colors.green , ),
fontWeight: FontWeight.bold, AppText(
fontFamily: 'Poppins', patientInfo.status == 2
fontSize: 12, ? 'Confirmed'
) : 'Booked',
], color: patientInfo.status == 2
):SizedBox(), ? Colors.green
: Colors.grey,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 10,
),
],
)
: !isFromSearch &&
!isFromLiveCare &&
patientInfo.patientStatusType ==
null
? Row(
children: [
AppText(
TranslationBase.of(context)
.notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
SizedBox(
width: 8,
),
SizedBox(
height: 12,
width: 1.5,
child: Container(
color: Colors.grey,
),
),
SizedBox(
width: 8,
),
AppText(
patientInfo.status == 2
? 'Booked'
: 'Confirmed',
color:
patientInfo.status == 2
? Colors.grey
: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
],
)
: SizedBox(),
this.arrivalType == '1' this.arrivalType == '1'
? AppText( ? AppText(
patientInfo.startTime != null patientInfo.startTime != null
@ -137,27 +200,39 @@ class PatientCard extends StatelessWidget {
) )
: patientInfo.arrivedOn != null : patientInfo.arrivedOn != null
? AppText( ? AppText(
AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.arrivedOn,) AppDateUtils.getDayMonthYearDate(
)+" "+ "${AppDateUtils.getStartTime(patientInfo.startTime)}", AppDateUtils
.convertStringToDate(
patientInfo.arrivedOn,
)) +
" " +
"${AppDateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15, fontSize: 15,
) )
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? : (patientInfo.appointmentDate !=
AppText( null &&
patientInfo
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", .appointmentDate.isNotEmpty)
fontFamily: 'Poppins', ? AppText(
fontWeight: FontWeight.w400, "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
fontSize: 15, patientInfo.appointmentDate,
):SizedBox() ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
)
: SizedBox()
], ],
)) ))
: SizedBox(), : SizedBox(),
if(isInpatient && isMyPatient && !isFromSearch) if (isInpatient && isMyPatient && !isFromSearch)
Row( Row(
children: [ children: [
SizedBox(width: 12,), SizedBox(
width: 12,
),
AppText( AppText(
'My Patient', 'My Patient',
color: Colors.green, color: Colors.green,
@ -177,9 +252,14 @@ class PatientCard extends StatelessWidget {
Expanded( Expanded(
// width: MediaQuery.of(context).size.width*0.51, // width: MediaQuery.of(context).size.width*0.51,
child: AppText( child: AppText(
isFromLiveCare? Helpers.capitalize(patientInfo.fullName): (Helpers.capitalize(patientInfo.firstName) + isFromLiveCare
" " + ? Helpers.capitalize(
Helpers.capitalize(patientInfo.lastName)), patientInfo.fullName)
: (Helpers.capitalize(
patientInfo.firstName) +
" " +
Helpers.capitalize(
patientInfo.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xff2e303a), color: Color(0xff2e303a),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -189,12 +269,14 @@ class PatientCard extends StatelessWidget {
), ),
if (patientInfo.gender == 1) if (patientInfo.gender == 1)
Icon( Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
) else Icon( )
DoctorApp.female_1, else
color: Colors.pink, Icon(
), DoctorApp.female_1,
color: Colors.pink,
),
]), ]),
), ),
Row( Row(
@ -286,31 +368,30 @@ class PatientCard extends StatelessWidget {
), ),
), ),
//if (isInpatient) //if (isInpatient)
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).age +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
],
), ),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
],
), ),
), ),
if (isInpatient ) ),
if (isInpatient)
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
@ -342,61 +423,75 @@ class PatientCard extends StatelessWidget {
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: fontSize:
2.0 * SizeConfig.textMultiplier, 2.0 * SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context).numOfDays + " : ", text: TranslationBase.of(context)
style: TextStyle(fontSize: 12)), .numOfDays +
new TextSpan( " : ",
text: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", style: TextStyle(fontSize: 12)),
style: TextStyle( new TextSpan(
fontWeight: FontWeight.w700, text:
fontSize: 13)), "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
]))), style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
])) ]))
]), ]),
!isInpatient && !isFromSearch isFromLiveCare
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Container( Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
child: Image.asset( child: Image.asset(
patientInfo.appointmentType == 'assets/images/livecare.png',
'Regular' && height: 25,
patientInfo.visitTypeId == 100 width: 35,
? 'assets/images/livecare.png' color: Colors.grey.shade700,
: patientInfo.appointmentType == )),
'Walkin' ],
? 'assets/images/walkin.png' )
: 'assets/images/booked.png', : !isInpatient && !isFromSearch
height: 25,
width: 35,
)),
])
: (isInpatient == true)
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Container( Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
child: Image.asset( child: Image.asset(
'assets/images/inpatient.png', patientInfo.appointmentType ==
'Regular' &&
patientInfo.visitTypeId == 100
? 'assets/images/livecare.png'
: patientInfo.appointmentType ==
'Walkin'
? 'assets/images/walkin.png'
: 'assets/images/booked.png',
height: 25, height: 25,
width: 35, width: 35,
)), )),
]) ])
: SizedBox() : (isInpatient == true)
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.all(4),
child: Image.asset(
'assets/images/inpatient.png',
height: 25,
width: 35,
)),
])
: SizedBox()
], ],
), ),
onTap: onTap, onTap: onTap,
)), )),
)); ));
} }
} }

Loading…
Cancel
Save