fix Discharged Patient

merge-requests/590/head
Mohammad Aljammal 5 years ago
parent 57d22aca13
commit 55c63c9531

@ -39,7 +39,7 @@ class RadiologyService extends BaseService {
await baseAppClient.postPatient(url, await baseAppClient.postPatient(url,
patient: patient, patient: patient,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear(); finalRadiologyList = [];
String label = "ListRAD"; String label = "ListRAD";
if(isInPatient) { if(isInPatient) {
label ="List_GetRadOreders"; label ="List_GetRadOreders";

@ -13,15 +13,12 @@ class DischargedPatientViewModel extends BaseViewModel {
_dischargedPatientService.myDischargedPatients; _dischargedPatientService.myDischargedPatients;
List<PatiantInformtion> filterData = [];
List<PatiantInformtion> get filterData => filterData2.isNotEmpty? filterData2:myDischargedPatient;
List<PatiantInformtion> filterData2 = [];
searchData(String str) { searchData(String str) {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {
filterData2 = []; filterData = [];
for (var i = 0; i < myDischargedPatient.length; i++) { for (var i = 0; i < myDischargedPatient.length; i++) {
String firstName = myDischargedPatient[i].firstName.toUpperCase(); String firstName = myDischargedPatient[i].firstName.toUpperCase();
String lastName = myDischargedPatient[i].lastName.toUpperCase(); String lastName = myDischargedPatient[i].lastName.toUpperCase();
@ -32,12 +29,12 @@ class DischargedPatientViewModel extends BaseViewModel {
lastName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) ||
mobile.contains(str) || mobile.contains(str) ||
patientID.contains(str)) { patientID.contains(str)) {
filterData2.add(myDischargedPatient[i]); filterData.add(myDischargedPatient[i]);
} }
} }
notifyListeners(); notifyListeners();
} else { } else {
filterData2 = myDischargedPatient; filterData = myDischargedPatient;
notifyListeners(); notifyListeners();
} }
} }
@ -49,8 +46,9 @@ class DischargedPatientViewModel extends BaseViewModel {
if (_dischargedPatientService.hasError) { if (_dischargedPatientService.hasError) {
error = _dischargedPatientService.error; error = _dischargedPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else{
setState(ViewState.Idle); filterData = myDischargedPatient;
setState(ViewState.Idle);}
} }
Future gtMyDischargeReferralPatient() async { Future gtMyDischargeReferralPatient() async {

@ -30,7 +30,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200],
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
body: model.filterData.isEmpty?Center( body: model.myDischargedPatient.isEmpty?Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [

@ -168,6 +168,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
clinic: labOrder.clinicDescription, clinic: labOrder.clinicDescription,
appointmentDate: labOrder.orderDate, appointmentDate: labOrder.orderDate,
orderNo: labOrder.orderNo, orderNo: labOrder.orderNo,
isShowTime: false,
); );
}).toList(), }).toList(),
), ),

@ -19,6 +19,7 @@ class DoctorCard extends StatelessWidget {
final bool isPrescriptions; final bool isPrescriptions;
final String clinic; final String clinic;
final bool isShowEye; final bool isShowEye;
final bool isShowTime;
DoctorCard( DoctorCard(
{this.doctorName, {this.doctorName,
@ -30,7 +31,7 @@ class DoctorCard extends StatelessWidget {
this.orderNo, this.orderNo,
this.isPrescriptions = false, this.isPrescriptions = false,
this.clinic, this.clinic,
this.isShowEye = true}); this.isShowEye = true, this.isShowTime= true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -71,7 +72,7 @@ class DoctorCard extends StatelessWidget {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
if (!isPrescriptions) if (!isPrescriptions&& isShowTime)
AppText( AppText(
'${DateUtils.getHour(appointmentDate)}', '${DateUtils.getHour(appointmentDate)}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

Loading…
Cancel
Save