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> 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 { getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async {
if(isLocalBusy) { if(isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -37,6 +63,7 @@ class PatientSearchViewModel extends BaseViewModel{
} }
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
filterData = _outPatientService.patientList;
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -49,6 +76,7 @@ class PatientSearchViewModel extends BaseViewModel{
error = _outPatientService.error; error = _outPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
filterData = _outPatientService.patientList;
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -103,12 +131,9 @@ class PatientSearchViewModel extends BaseViewModel{
if(isSearchWithKeyInfo) { if(isSearchWithKeyInfo) {
await getPatientFileInformation(currentModel); await getPatientFileInformation(currentModel);
} else { } else {
if(selectedPatientType == PatientType.OutPatient) {
await getOutPatient(currentModel, isLocalBusy: true); 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:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HeaderInSearch extends StatelessWidget { class HeaderInSearch extends StatelessWidget with PreferredSizeWidget {
final String title; final String title;
const HeaderInSearch({Key key, this.title}) : super(key: key); const HeaderInSearch({Key key, this.title}) : super(key: key);
@ -16,7 +16,7 @@ class HeaderInSearch extends StatelessWidget {
), ),
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 35),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), 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), bottom: 30),
), ),
onChanged: (String str) { onChanged: (String str) {
// this.searchData(str); model.searchData(str);
}), }),
])), ])),
SizedBox( SizedBox(
@ -216,10 +216,10 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
height: 10.0, height: 10.0,
), ),
Container( Container(
child: (model.patientList.isNotEmpty) child: model.patientList.isNotEmpty
? Column( ? Column(
// mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
children: model.patientList children: model.filterData
.map((PatiantInformtion .map((PatiantInformtion
item) { item) {
return PatientCard( return PatientCard(

@ -378,7 +378,6 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
if (patient.appointmentNo != null && if (patient.appointmentNo != null &&
patient.appointmentNo != 0) patient.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -388,26 +387,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'), 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, color: Colors.white,
), ),
child: Stack(children: [ child: Stack(children: [
// if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") if (isInpatient)
// Container( Container(
// height: MediaQuery.of(context).size.height * .20, height: MediaQuery.of(context).size.height * .20,
// width: 5, width: 5,
// decoration: BoxDecoration( decoration: BoxDecoration(
// borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
// topLeft: Radius.circular(10), topLeft: Radius.circular(10),
// bottomLeft: Radius.circular(10)), bottomLeft: Radius.circular(10)),
// color: patientInfo.patientStatusType == 43 color: patientInfo.patientStatusType == 43
// ? Colors.green[500] ? Colors.green[500]
// : Colors.red[800], : Colors.red[800],
// )), )),
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,48 +55,47 @@ class PatientCard extends StatelessWidget {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
// SERVICES_PATIANT2[int.parse(patientType)] == !isInpatient
// "List_MyOutPatient" ? 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(
// ? 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: 12,
// fontSize: 12, )
// ) : AppText(
// : AppText( TranslationBase.of(context).notArrived,
// TranslationBase.of(context).notArrived, color: Colors.red[800],
// color: Colors.red[800], fontWeight: FontWeight.bold,
// fontWeight: FontWeight.bold, fontFamily: 'Poppins',
// fontFamily: 'Poppins', fontSize: 12,
// fontSize: 12, ),
// ), 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.w600, )
// ) : patientInfo.arrivedOn != null
// : patientInfo.arrivedOn != null ? AppText(
// ? AppText( DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(
// DateUtils.convertStringToDateFormat( patientInfo.arrivedOn,
// patientInfo.arrivedOn, )),
// 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins',
// fontFamily: 'Poppins', fontWeight: FontWeight.w600,
// fontWeight: FontWeight.w600, )
// ) : SizedBox()
// : SizedBox() ],
// ], ))
// )) : SizedBox(),
// : SizedBox(),
Padding( Padding(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(left: 12.0),
child: Row( child: Row(
@ -213,33 +212,32 @@ class PatientCard extends StatelessWidget {
), ),
), ),
), ),
// if (SERVICES_PATIANT2[int.parse(patientType)] != if (isInpatient)
// "List_MyInPatient") 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>[
// children: <TextSpan>[ new TextSpan(
// new TextSpan( text:
// text: TranslationBase.of(context).age +
// TranslationBase.of(context).age + " : ",
// " : ", style: TextStyle(fontSize: 14)),
// style: TextStyle(fontSize: 14)), new TextSpan(
// new TextSpan( text:
// text: "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}",
// "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", style: TextStyle(
// style: TextStyle( fontWeight: FontWeight.w700,
// fontWeight: FontWeight.w700, fontSize: 15)),
// fontSize: 15)), ],
// ], ),
// ), ),
// ), ),
// ), if (isInpatient )
if (isInpatient == true)
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
@ -370,28 +368,26 @@ class PatientCard extends StatelessWidget {
//) //)
])) ]))
]), ]),
// SERVICES_PATIANT2[int.parse(patientType)] == !isInpatient
// "List_MyOutPatient" ? 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 ==
// patientInfo.appointmentType == 'Regular' &&
// 'Regular' && patientInfo.visitTypeId == 100
// patientInfo.visitTypeId == 100 ? 'assets/images/livecare.png'
// ? 'assets/images/livecare.png' : patientInfo.appointmentType ==
// : patientInfo.appointmentType == 'Walkin'
// 'Walkin' ? 'assets/images/walkin.png'
// ? 'assets/images/walkin.png' : 'assets/images/booked.png',
// : 'assets/images/booked.png', height: 25,
// height: 25, width: 35,
// width: 35, )),
// )), ])
// ]) : (isInpatient == true)
// :
(isInpatient == true)
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [

Loading…
Cancel
Save