hot fixes

merge-requests/605/head
Mohammad Aljammal 5 years ago
parent 85288cc014
commit c3ac50a859

@ -147,6 +147,7 @@ class PatientSearchViewModel extends BaseViewModel{
Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false, bool isFirstTime = true}) async {
await getDoctorProfile();
if (isFirstTime)
setState(ViewState.Busy);
else

@ -61,6 +61,7 @@ class PatiantInformtion {
int visitTypeId;
String startTimes;
String dischargeDate;
int status;
PatiantInformtion(
{this.patientDetails,
this.projectId,
@ -120,7 +121,7 @@ class PatiantInformtion {
this.nationalityFlagURL,
this.patientStatusType,
this.visitTypeId,
this.startTimes,this.dischargeDate});
this.startTimes,this.dischargeDate,this.status});
factory PatiantInformtion.fromJson(Map<String, dynamic> json) =>
PatiantInformtion(
@ -197,5 +198,6 @@ class PatiantInformtion {
visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'],
startTimes: json['StartTime'] ?? json['StartTime'],
dischargeDate: json['DischargeDate'] ,
status: json['Status'] ,
);
}

@ -107,6 +107,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {

@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true,
searchKey: patientFileInfoController.text,
isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true,
isInpatient: selectedPatientType != PatientType.OutPatient,
),
),
);

@ -108,7 +108,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
Container(
child: Column(
children: <Widget>[
if(!widget.isInpatient)
if(!widget.isInpatient && !widget.isSearch)
Container(
// color: Colors.red,
height: screenSize.height * 0.070,
@ -249,6 +249,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
"7",
});
},
isFromSearch: widget.isSearch,
);
}).toList(),
)

@ -58,6 +58,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
if (routeArgs.containsKey("isDischargedPatient")) {
isDischargedPatient = routeArgs['isDischargedPatient'];
}
if(isInpatient)
_tabController.index =0;
else
_tabController.index = 1;
}
@override

@ -290,6 +290,15 @@ class DateUtils {
return "";
}
/// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted
static String getDayMonthYearDate(DateTime dateTime,{bool isArabic = false}) {
if (dateTime != null)
return dateTime.day.toString()+"/"+ "${dateTime.month}"+ "/" + dateTime.year.toString();
else
return "";
}
/// get data formatted like 10:45 PM
/// [dateTime] convert DateTime to data formatted
static String getHour(DateTime dateTime) {

@ -16,13 +16,16 @@ class PatientCard extends StatelessWidget {
final String patientType;
final String arrivalType;
final bool isInpatient;
final bool isMyPatient;
final bool isFromSearch;
const PatientCard(
{Key key,
this.patientInfo,
this.onTap,
this.patientType,
this.arrivalType,
this.isInpatient})
this.isInpatient, this.isMyPatient = false, this.isFromSearch = false})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -35,9 +38,9 @@ class PatientCard extends StatelessWidget {
color: Colors.white,
),
child: Stack(children: [
if (isInpatient)
if (!isInpatient&& !isMyPatient && !isFromSearch)
Container(
height: MediaQuery.of(context).size.height * .20,
height: 160,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
@ -47,6 +50,16 @@ class PatientCard extends StatelessWidget {
? Colors.green[500]
: Colors.red[800],
)),
if(isMyPatient && !isFromSearch)
Container(
height: 180,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)),
color: Colors.green[500]
)),
Container(
padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: InkWell(
@ -55,47 +68,113 @@ class PatientCard extends StatelessWidget {
SizedBox(
height: 10,
),
!isInpatient
!(isInpatient && !isFromSearch)
? Padding(
padding: EdgeInsets.only(left: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patientInfo.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
? Row(
children: [
AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
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? 'Confirmed':'Booked',
color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
],
)
: patientInfo.patientStatusType == 42?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? 'Confirmed':'Booked',
color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
],
): !isFromSearch?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? 'Confirmed':'Booked',
color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
],
):SizedBox(),
this.arrivalType == '1'
? AppText(
patientInfo.startTime != null
? patientInfo.startTime
: patientInfo.startTimes,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400,
)
: patientInfo.arrivedOn != null
? AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(
patientInfo.arrivedOn,
)),
DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,)
)+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.arrivedOn,)),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400,
)
: SizedBox()
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
AppText(
DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,)
)+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)),
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
):SizedBox()
],
))
: SizedBox(),
if(isInpatient && isMyPatient && !isFromSearch)
Row(
children: [
SizedBox(width: 12,),
AppText(
'My Patient',
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
],
),
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Row(
@ -212,7 +291,7 @@ class PatientCard extends StatelessWidget {
),
),
),
if (isInpatient)
//if (isInpatient)
Container(
child: RichText(
text: new TextSpan(
@ -368,7 +447,7 @@ class PatientCard extends StatelessWidget {
//)
]))
]),
!isInpatient
!isInpatient && !isFromSearch
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [

Loading…
Cancel
Save