Merge branch 'referral_in_patient' into 'development'

Referral in patient

See merge request Cloud_Solution/doctor_app_flutter!601
merge-requests/602/head
Mohammad Aljammal 5 years ago
commit 911976be85

@ -19,6 +19,32 @@ class PatientSearchViewModel extends BaseViewModel{
List<PatiantInformtion> get patientList => _outPatientService.patientList;
List<PatiantInformtion> filterData = [];
searchData(String str) {
var strExist = str.length > 0 ? true : false;
if (strExist) {
filterData = [];
for (var i = 0; i < _outPatientService.patientList.length; i++) {
String firstName = _outPatientService.patientList[i].firstName.toUpperCase();
String lastName = _outPatientService.patientList[i].lastName.toUpperCase();
String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase();
String patientID = _outPatientService.patientList[i].patientId.toString();
if (firstName.contains(str.toUpperCase()) ||
lastName.contains(str.toUpperCase()) ||
mobile.contains(str) ||
patientID.contains(str)) {
filterData.add(_outPatientService.patientList[i]);
}
}
notifyListeners();
} else {
filterData = _outPatientService.patientList;
notifyListeners();
}
}
getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async {
if(isLocalBusy) {
setState(ViewState.BusyLocal);
@ -37,6 +63,7 @@ class PatientSearchViewModel extends BaseViewModel{
}
setState(ViewState.Error);
} else {
filterData = _outPatientService.patientList;
setState(ViewState.Idle);
}
}
@ -49,6 +76,7 @@ class PatientSearchViewModel extends BaseViewModel{
error = _outPatientService.error;
setState(ViewState.Error);
} else {
filterData = _outPatientService.patientList;
setState(ViewState.Idle);
}
}
@ -103,12 +131,9 @@ class PatientSearchViewModel extends BaseViewModel{
if(isSearchWithKeyInfo) {
await getPatientFileInformation(currentModel);
} else {
if(selectedPatientType == PatientType.OutPatient) {
await getOutPatient(currentModel, isLocalBusy: true);
} else {
// TODO handel inPatient case
}
}
filterData = _outPatientService.patientList;
}

@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class HeaderInSearch extends StatelessWidget {
class HeaderInSearch extends StatelessWidget with PreferredSizeWidget {
final String title;
const HeaderInSearch({Key key, this.title}) : super(key: key);
@ -16,7 +16,7 @@ class HeaderInSearch extends StatelessWidget {
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
margin: EdgeInsets.only(top: 35),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
@ -36,4 +36,8 @@ class HeaderInSearch extends StatelessWidget {
),
);
}
@override
Size get preferredSize => Size(double.maxFinite,65);
}

@ -206,7 +206,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
bottom: 30),
),
onChanged: (String str) {
// this.searchData(str);
model.searchData(str);
}),
])),
SizedBox(
@ -216,10 +216,10 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
height: 10.0,
),
Container(
child: (model.patientList.isNotEmpty)
child: model.patientList.isNotEmpty
? Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: model.patientList
children: model.filterData
.map((PatiantInformtion
item) {
return PatientCard(

@ -378,7 +378,6 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
if (patient.appointmentNo != null &&
patient.appointmentNo != 0)
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -388,26 +387,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
if (isInpatient)
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
if (isInpatient)
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
nameLine1: "Order", //"Text",
nameLine2: "Sheet",
icon: 'patient/Progress_notes.png'),
],
),
],

@ -35,18 +35,18 @@ class PatientCard extends StatelessWidget {
color: Colors.white,
),
child: Stack(children: [
// if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient")
// Container(
// height: MediaQuery.of(context).size.height * .20,
// width: 5,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(10),
// bottomLeft: Radius.circular(10)),
// color: patientInfo.patientStatusType == 43
// ? Colors.green[500]
// : Colors.red[800],
// )),
if (isInpatient)
Container(
height: MediaQuery.of(context).size.height * .20,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)),
color: patientInfo.patientStatusType == 43
? Colors.green[500]
: Colors.red[800],
)),
Container(
padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: InkWell(
@ -55,48 +55,47 @@ class PatientCard extends StatelessWidget {
SizedBox(
height: 10,
),
// SERVICES_PATIANT2[int.parse(patientType)] ==
// "List_MyOutPatient"
// ? 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,
// ),
// this.arrivalType == '1'
// ? AppText(
// patientInfo.startTime != null
// ? patientInfo.startTime
// : patientInfo.startTimes,
// fontFamily: 'Poppins',
// fontWeight: FontWeight.w600,
// )
// : patientInfo.arrivedOn != null
// ? AppText(
// DateUtils.convertStringToDateFormat(
// patientInfo.arrivedOn,
// 'MM-dd-yyyy HH:mm'),
// fontFamily: 'Poppins',
// fontWeight: FontWeight.w600,
// )
// : SizedBox()
// ],
// ))
// : SizedBox(),
!isInpatient
? 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,
),
this.arrivalType == '1'
? AppText(
patientInfo.startTime != null
? patientInfo.startTime
: patientInfo.startTimes,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: patientInfo.arrivedOn != null
? AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(
patientInfo.arrivedOn,
)),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: SizedBox()
],
))
: SizedBox(),
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Row(
@ -213,33 +212,32 @@ class PatientCard extends StatelessWidget {
),
),
),
// if (SERVICES_PATIANT2[int.parse(patientType)] !=
// "List_MyInPatient")
// Container(
// child: RichText(
// text: new TextSpan(
// style: new TextStyle(
// fontSize: 2.0 * SizeConfig.textMultiplier,
// color: Colors.black,
// fontFamily: 'Poppins',
// ),
// children: <TextSpan>[
// new TextSpan(
// text:
// TranslationBase.of(context).age +
// " : ",
// style: TextStyle(fontSize: 14)),
// new TextSpan(
// text:
// "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}",
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 15)),
// ],
// ),
// ),
// ),
if (isInpatient == true)
if (isInpatient)
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).age +
" : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text:
"${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
],
),
),
),
if (isInpatient )
Container(
child: RichText(
text: new TextSpan(
@ -370,28 +368,26 @@ class PatientCard extends StatelessWidget {
//)
]))
]),
// SERVICES_PATIANT2[int.parse(patientType)] ==
// "List_MyOutPatient"
// ? Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Container(
// padding: EdgeInsets.all(4),
// child: Image.asset(
// patientInfo.appointmentType ==
// 'Regular' &&
// patientInfo.visitTypeId == 100
// ? 'assets/images/livecare.png'
// : patientInfo.appointmentType ==
// 'Walkin'
// ? 'assets/images/walkin.png'
// : 'assets/images/booked.png',
// height: 25,
// width: 35,
// )),
// ])
// :
(isInpatient == true)
!isInpatient
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.all(4),
child: Image.asset(
patientInfo.appointmentType ==
'Regular' &&
patientInfo.visitTypeId == 100
? 'assets/images/livecare.png'
: patientInfo.appointmentType ==
'Walkin'
? 'assets/images/walkin.png'
: 'assets/images/booked.png',
height: 25,
width: 35,
)),
])
: (isInpatient == true)
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [

Loading…
Cancel
Save