Merge branch 'referral_in_patient' into 'development'

hot fixes

See merge request Cloud_Solution/doctor_app_flutter!605
merge-requests/606/merge
Mohammad Aljammal 5 years ago
commit 3e2323fbc0

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

@ -61,6 +61,7 @@ class PatiantInformtion {
int visitTypeId; int visitTypeId;
String startTimes; String startTimes;
String dischargeDate; String dischargeDate;
int status;
PatiantInformtion( PatiantInformtion(
{this.patientDetails, {this.patientDetails,
this.projectId, this.projectId,
@ -120,7 +121,7 @@ class PatiantInformtion {
this.nationalityFlagURL, this.nationalityFlagURL,
this.patientStatusType, this.patientStatusType,
this.visitTypeId, this.visitTypeId,
this.startTimes,this.dischargeDate}); this.startTimes,this.dischargeDate,this.status});
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => factory PatiantInformtion.fromJson(Map<String, dynamic> json) =>
PatiantInformtion( PatiantInformtion(
@ -197,5 +198,6 @@ class PatiantInformtion {
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'] ,
); );
} }

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

@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
patientFileInfoController.text.isNotEmpty ? true : false, patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true, isSearch: true,
searchKey: patientFileInfoController.text, 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( Container(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
if(!widget.isInpatient) if(!widget.isInpatient && !widget.isSearch)
Container( Container(
// color: Colors.red, // color: Colors.red,
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -249,6 +249,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
"7", "7",
}); });
}, },
isFromSearch: widget.isSearch,
); );
}).toList(), }).toList(),
) )

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

@ -290,6 +290,15 @@ class DateUtils {
return ""; 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 /// get data formatted like 10:45 PM
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getHour(DateTime dateTime) { static String getHour(DateTime dateTime) {

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

Loading…
Cancel
Save