Merge branch 'textfield-validation' into 'development'

referral changes

See merge request Cloud_Solution/doctor_app_flutter!501
merge-requests/502/merge
Mohammad Aljammal 5 years ago
commit 963c40b8d5

@ -145,7 +145,7 @@ class PatientReferralService extends LookupService {
MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); MyReferredPatientModel item = MyReferredPatientModel.fromJson(v);
if (doctorProfile != null) { if (doctorProfile != null) {
item.isReferralDoctorSameBranch = item.isReferralDoctorSameBranch =
doctorProfile.projectID == item.projectId; doctorProfile.projectID == item.projectID;
} else { } else {
item.isReferralDoctorSameBranch = false; item.isReferralDoctorSameBranch = false;
} }

@ -34,31 +34,4 @@ class ReferredPatientService extends BaseService {
); );
} }
Future verify(MyReferredPatientModel model) async {
_verifyreferraldoctorremarks.patientID = model.projectId;
_verifyreferraldoctorremarks.admissionNo = model.admissionNo;
_verifyreferraldoctorremarks.lineItemNo = model.lineItemNo;
_verifyreferraldoctorremarks.referredDoctorRemarks =
model.referredDoctorRemarks;
_verifyreferraldoctorremarks.referringDoctor = model.referringDoctor;
_verifyreferraldoctorremarks.firstName = model.firstName;
_verifyreferraldoctorremarks.middleName = model.middleName;
_verifyreferraldoctorremarks.lastName = model.lastName;
_verifyreferraldoctorremarks.patientMobileNumber = model.mobileNumber;
_verifyreferraldoctorremarks.patientIdentificationID =
model.patientIdentificationNo;
await baseAppClient.post(
GET_MY_REFERRED_PATIENT,
onSuccess: (dynamic response, int statusCode) {
listMyReferredPatientModel[listMyReferredPatientModel.indexOf(model)] =
model;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _verifyreferraldoctorremarks.toJson(),
);
}
} }

@ -176,22 +176,18 @@ class PatientReferralViewModel extends BaseViewModel {
} }
} }
/*
* model
.getPatientArrivalList()*/
String getReferralStatusNameByCode(int statusCode, BuildContext context) { String getReferralStatusNameByCode(int statusCode, BuildContext context) {
switch (statusCode) { switch (statusCode) {
case 1: case 1:
return TranslationBase.of(context).referralStatusHold; return TranslationBase.of(context).pending/*referralStatusHold*/;
case 2: case 2:
return TranslationBase.of(context).referralStatusActive; return TranslationBase.of(context).accepted/*referralStatusActive*/;
case 4: case 4:
return TranslationBase.of(context).referralStatusCancelled; return TranslationBase.of(context).rejected/*referralStatusCancelled*/;
case 46: case 46:
return TranslationBase.of(context).referralStatusCompleted; return TranslationBase.of(context).accepted/*referralStatusCompleted*/;
case 63: case 63:
return TranslationBase.of(context).referralStatusNotSeen; return TranslationBase.of(context).rejected/*referralStatusNotSeen*/;
default: default:
return "-"; return "-";
} }

@ -20,13 +20,4 @@ class ReferredPatientViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future verify(MyReferredPatientModel model) async {
setState(ViewState.BusyLocal);
await _referralPatientService.verify(model);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
} }

@ -1,223 +1,259 @@
import 'dart:convert'; import 'dart:convert';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
MyReferredPatientModel myReferredPatientModelFromJson(String str) => MyReferredPatientModel.fromJson(json.decode(str));
String myReferredPatientModelToJson(MyReferredPatientModel data) => json.encode(data.toJson());
class MyReferredPatientModel { class MyReferredPatientModel {
MyReferredPatientModel({ String rowID;
this.projectId, int projectID;
this.lineItemNo, int lineItemNo;
this.doctorId, int doctorID;
this.patientId, int patientID;
this.doctorName, String doctorName;
this.doctorNameN, String doctorNameN;
this.firstName, String firstName;
this.middleName, String middleName;
this.lastName, String lastName;
this.firstNameN, String firstNameN;
this.middleNameN, String middleNameN;
this.lastNameN, String lastNameN;
this.gender, int gender;
this.dateofBirth, String dateofBirth;
this.mobileNumber, String mobileNumber;
this.emailAddress, String emailAddress;
this.patientIdentificationNo, String patientIdentificationNo;
this.patientType, int patientType;
this.admissionNo, String admissionNo;
this.admissionDate, String admissionDate;
this.roomId, String roomID;
this.bedId, String bedID;
this.nursingStationId, String nursingStationID;
this.description, String description;
this.nationalityName, String nationalityName;
this.nationalityNameN, String nationalityNameN;
this.clinicDescription, String clinicDescription;
this.clinicDescriptionN, String clinicDescriptionN;
this.referralDoctor, int referralDoctor;
this.referringDoctor, int referringDoctor;
this.referralClinic, int referralClinic;
this.referringClinic, int referringClinic;
this.referralStatus, int referralStatus;
this.referralDate, String referralDate;
this.referringDoctorRemarks, String referringDoctorRemarks;
this.referredDoctorRemarks, String referredDoctorRemarks;
this.referralResponseOn, String referralResponseOn;
this.priority, int priority;
this.frequency, int frequency;
this.maxResponseTime, String mAXResponseTime;
this.dischargeDate, int episodeID;
this.age, int appointmentNo;
this.frequencyDescription, String appointmentDate;
this.genderDescription, int appointmentType;
this.isDoctorLate, int patientMRN;
this.isDoctorResponse, String createdOn;
this.nursingStationName, int clinicID;
this.priorityDescription, String nationalityID;
this.referralClinicDescription, String age;
this.referralDoctorName, String doctorImageURL;
this.isReferralDoctorSameBranch, String frequencyDescription;
}); String genderDescription;
bool isDoctorLate;
bool isDoctorResponse;
String nationalityFlagURL;
String nursingStationName;
String priorityDescription;
String referringClinicDescription;
String referringDoctorName;
bool isReferralDoctorSameBranch;
int projectId; MyReferredPatientModel({
int lineItemNo; this.rowID,
int doctorId; this.projectID,
int patientId; this.lineItemNo,
String doctorName; this.doctorID,
dynamic doctorNameN; this.patientID,
String firstName; this.doctorName,
String middleName; this.doctorNameN,
String lastName; this.firstName,
dynamic firstNameN; this.middleName,
dynamic middleNameN; this.lastName,
dynamic lastNameN; this.firstNameN,
int gender; this.middleNameN,
String dateofBirth; this.lastNameN,
String mobileNumber; this.gender,
String emailAddress; this.dateofBirth,
String patientIdentificationNo; this.mobileNumber,
int patientType; this.emailAddress,
String admissionNo; this.patientIdentificationNo,
String admissionDate; this.patientType,
String roomId; this.admissionNo,
String bedId; this.admissionDate,
dynamic nursingStationId; this.roomID,
dynamic description; this.bedID,
String nationalityName; this.nursingStationID,
dynamic nationalityNameN; this.description,
String clinicDescription; this.nationalityName,
dynamic clinicDescriptionN; this.nationalityNameN,
int referralDoctor; this.clinicDescription,
int referringDoctor; this.clinicDescriptionN,
int referralClinic; this.referralDoctor,
int referringClinic; this.referringDoctor,
int referralStatus; this.referralClinic,
String referralDate; this.referringClinic,
String referringDoctorRemarks; this.referralStatus,
String referredDoctorRemarks; this.referralDate,
String referralResponseOn; this.referringDoctorRemarks,
int priority; this.referredDoctorRemarks,
int frequency; this.referralResponseOn,
DateTime maxResponseTime; this.priority,
dynamic dischargeDate; this.frequency,
String age; this.mAXResponseTime,
String frequencyDescription; this.episodeID,
String genderDescription; this.appointmentNo,
bool isDoctorLate; this.appointmentDate,
bool isDoctorResponse; this.appointmentType,
String nursingStationName; this.patientMRN,
String priorityDescription; this.createdOn,
String referralClinicDescription; this.clinicID,
String referralDoctorName; this.nationalityID,
bool isReferralDoctorSameBranch; this.age,
this.doctorImageURL,
this.frequencyDescription,
this.genderDescription,
this.isDoctorLate,
this.isDoctorResponse,
this.nationalityFlagURL,
this.nursingStationName,
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName,
this.isReferralDoctorSameBranch,
});
factory MyReferredPatientModel.fromJson(Map<String, dynamic> json) => MyReferredPatientModel( MyReferredPatientModel.fromJson(Map<String, dynamic> json) {
projectId: json["ProjectID"], rowID = json['RowID'];
lineItemNo: json["LineItemNo"], projectID = json['ProjectID'];
doctorId: json["DoctorID"], lineItemNo = json['LineItemNo'];
patientId: json["PatientID"], doctorID = json['DoctorID'];
doctorName: json["DoctorName"], patientID = json['PatientID'];
doctorNameN: json["DoctorNameN"], doctorName = json['DoctorName'];
firstName: json["FirstName"], doctorNameN = json['DoctorNameN'];
middleName: json["MiddleName"], firstName = json['FirstName'];
lastName: json["LastName"], middleName = json['MiddleName'];
firstNameN: json["FirstNameN"], lastName = json['LastName'];
middleNameN: json["MiddleNameN"], firstNameN = json['FirstNameN'];
lastNameN: json["LastNameN"], middleNameN = json['MiddleNameN'];
gender: json["Gender"], lastNameN = json['LastNameN'];
dateofBirth: json["DateofBirth"], gender = json['Gender'];
mobileNumber: json["MobileNumber"], dateofBirth = json['DateofBirth'];
emailAddress: json["EmailAddress"], mobileNumber = json['MobileNumber'];
patientIdentificationNo: json["PatientIdentificationNo"], emailAddress = json['EmailAddress'];
patientType: json["PatientType"], patientIdentificationNo = json['PatientIdentificationNo'];
admissionNo: json["AdmissionNo"], patientType = json['PatientType'];
admissionDate: json["AdmissionDate"], admissionNo = json['AdmissionNo'];
roomId: json["RoomID"], admissionDate = json['AdmissionDate'];
bedId: json["BedID"], roomID = json['RoomID'];
nursingStationId: json["NursingStationID"], bedID = json['BedID'];
description: json["Description"], nursingStationID = json['NursingStationID'];
nationalityName: json["NationalityName"], description = json['Description'];
nationalityNameN: json["NationalityNameN"], nationalityName = json['NationalityName'];
clinicDescription: json["ClinicDescription"], nationalityNameN = json['NationalityNameN'];
clinicDescriptionN: json["ClinicDescriptionN"], clinicDescription = json['ClinicDescription'];
referralDoctor: json["ReferralDoctor"], clinicDescriptionN = json['ClinicDescriptionN'];
referringDoctor: json["ReferringDoctor"], referralDoctor = json['ReferralDoctor'];
referralClinic: json["ReferralClinic"], referringDoctor = json['ReferringDoctor'];
referringClinic: json["ReferringClinic"], referralClinic = json['ReferralClinic'];
referralStatus: json["ReferralStatus"], referringClinic = json['ReferringClinic'];
referralDate: json["ReferralDate"], referralStatus = json['ReferralStatus'];
referringDoctorRemarks: json["ReferringDoctorRemarks"], referralDate = json['ReferralDate'];
referredDoctorRemarks: json["ReferredDoctorRemarks"], referringDoctorRemarks = json['ReferringDoctorRemarks'];
referralResponseOn: json["ReferralResponseOn"], referredDoctorRemarks = json['ReferredDoctorRemarks'];
priority: json["Priority"], referralResponseOn = json['ReferralResponseOn'];
frequency: json["Frequency"], priority = json['Priority'];
maxResponseTime: Helpers.convertStringToDate(json['MAXResponseTime']),//json["MAXResponseTime"], frequency = json['Frequency'];
dischargeDate: json["DischargeDate"], mAXResponseTime = json['MAXResponseTime'];
age: json["Age"], episodeID = json['EpisodeID'];
frequencyDescription: json["FrequencyDescription"], appointmentNo = json['AppointmentNo'];
genderDescription: json["GenderDescription"], appointmentDate = json['AppointmentDate'];
isDoctorLate: json["IsDoctorLate"], appointmentType = json['AppointmentType'];
isDoctorResponse: json["IsDoctorResponse"], patientMRN = json['PatientMRN'];
nursingStationName: json["NursingStationName"], createdOn = json['CreatedOn'];
priorityDescription: json["PriorityDescription"], clinicID = json['ClinicID'];
referralClinicDescription: json["ReferralClinicDescription"], nationalityID = json['NationalityID'];
referralDoctorName: json["ReferralDoctorName"], age = json['Age'];
); doctorImageURL = json['DoctorImageURL'];
frequencyDescription = json['FrequencyDescription'];
genderDescription = json['GenderDescription'];
isDoctorLate = json['IsDoctorLate'];
isDoctorResponse = json['IsDoctorResponse'];
nationalityFlagURL = json['NationalityFlagURL'];
nursingStationName = json['NursingStationName'];
priorityDescription = json['PriorityDescription'];
referringClinicDescription = json['ReferringClinicDescription'];
referringDoctorName = json['ReferringDoctorName'];
}
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() {
"ProjectID": projectId, final Map<String, dynamic> data = new Map<String, dynamic>();
"LineItemNo": lineItemNo, data['RowID'] = this.rowID;
"DoctorID": doctorId, data['ProjectID'] = this.projectID;
"PatientID": patientId, data['LineItemNo'] = this.lineItemNo;
"DoctorName": doctorName, data['DoctorID'] = this.doctorID;
"DoctorNameN": doctorNameN, data['PatientID'] = this.patientID;
"FirstName": firstName, data['DoctorName'] = this.doctorName;
"MiddleName": middleName, data['DoctorNameN'] = this.doctorNameN;
"LastName": lastName, data['FirstName'] = this.firstName;
"FirstNameN": firstNameN, data['MiddleName'] = this.middleName;
"MiddleNameN": middleNameN, data['LastName'] = this.lastName;
"LastNameN": lastNameN, data['FirstNameN'] = this.firstNameN;
"Gender": gender, data['MiddleNameN'] = this.middleNameN;
"DateofBirth": dateofBirth, data['LastNameN'] = this.lastNameN;
"MobileNumber": mobileNumber, data['Gender'] = this.gender;
"EmailAddress": emailAddress, data['DateofBirth'] = this.dateofBirth;
"PatientIdentificationNo": patientIdentificationNo, data['MobileNumber'] = this.mobileNumber;
"PatientType": patientType, data['EmailAddress'] = this.emailAddress;
"AdmissionNo": admissionNo, data['PatientIdentificationNo'] = this.patientIdentificationNo;
"AdmissionDate": admissionDate, data['PatientType'] = this.patientType;
"RoomID": roomId, data['AdmissionNo'] = this.admissionNo;
"BedID": bedId, data['AdmissionDate'] = this.admissionDate;
"NursingStationID": nursingStationId, data['RoomID'] = this.roomID;
"Description": description, data['BedID'] = this.bedID;
"NationalityName": nationalityName, data['NursingStationID'] = this.nursingStationID;
"NationalityNameN": nationalityNameN, data['Description'] = this.description;
"ClinicDescription": clinicDescription, data['NationalityName'] = this.nationalityName;
"ClinicDescriptionN": clinicDescriptionN, data['NationalityNameN'] = this.nationalityNameN;
"ReferralDoctor": referralDoctor, data['ClinicDescription'] = this.clinicDescription;
"ReferringDoctor": referringDoctor, data['ClinicDescriptionN'] = this.clinicDescriptionN;
"ReferralClinic": referralClinic, data['ReferralDoctor'] = this.referralDoctor;
"ReferringClinic": referringClinic, data['ReferringDoctor'] = this.referringDoctor;
"ReferralStatus": referralStatus, data['ReferralClinic'] = this.referralClinic;
"ReferralDate": referralDate, data['ReferringClinic'] = this.referringClinic;
"ReferringDoctorRemarks": referringDoctorRemarks, data['ReferralStatus'] = this.referralStatus;
"ReferredDoctorRemarks": referredDoctorRemarks, data['ReferralDate'] = this.referralDate;
"ReferralResponseOn": referralResponseOn, data['ReferringDoctorRemarks'] = this.referringDoctorRemarks;
"Priority": priority, data['ReferredDoctorRemarks'] = this.referredDoctorRemarks;
"Frequency": frequency, data['ReferralResponseOn'] = this.referralResponseOn;
"MAXResponseTime": maxResponseTime, data['Priority'] = this.priority;
"DischargeDate": dischargeDate, data['Frequency'] = this.frequency;
"Age": age, data['MAXResponseTime'] = this.mAXResponseTime;
"FrequencyDescription": frequencyDescription, data['EpisodeID'] = this.episodeID;
"GenderDescription": genderDescription, data['AppointmentNo'] = this.appointmentNo;
"IsDoctorLate": isDoctorLate, data['AppointmentDate'] = this.appointmentDate;
"IsDoctorResponse": isDoctorResponse, data['AppointmentType'] = this.appointmentType;
"NursingStationName": nursingStationName, data['PatientMRN'] = this.patientMRN;
"PriorityDescription": priorityDescription, data['CreatedOn'] = this.createdOn;
"ReferralClinicDescription": referralClinicDescription, data['ClinicID'] = this.clinicID;
"ReferralDoctorName": referralDoctorName, data['NationalityID'] = this.nationalityID;
}; data['Age'] = this.age;
data['DoctorImageURL'] = this.doctorImageURL;
data['FrequencyDescription'] = this.frequencyDescription;
data['GenderDescription'] = this.genderDescription;
data['IsDoctorLate'] = this.isDoctorLate;
data['IsDoctorResponse'] = this.isDoctorResponse;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NursingStationName'] = this.nursingStationName;
data['PriorityDescription'] = this.priorityDescription;
data['ReferringClinicDescription'] = this.referringClinicDescription;
data['ReferringDoctorName'] = this.referringDoctorName;
return data;
}
} }

@ -3,9 +3,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
@ -13,12 +11,8 @@ import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/doctor/patient_arrival_screen.dart';
import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patients_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -32,16 +26,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import '../routes.dart'; import '../routes.dart';
import '../widgets/shared/app_texts_widget.dart'; import '../widgets/shared/app_texts_widget.dart';
import 'doctor/doctor_reply_screen.dart';
import 'doctor/my_referral_patient_screen.dart';
import 'doctor/my_referred_patient_screen.dart';
import 'medicine/medicine_search_screen.dart';
import 'patients/profile/referral/referred-patient-screen.dart';
import '../widgets/shared/rounded_container_widget.dart'; import '../widgets/shared/rounded_container_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();

@ -1,54 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/referred_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_referred_patient_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class MyReferredPatient extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<ReferredPatientViewModel>(
onModelReady: (model) => model.getMyReferredPatient(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).myReferredPatient,
body: model.listMyReferredPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0),
child: ListView(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 100,
),
Container(
child: Column(
//children: referredPatientProvider.listMyReferralPatientModel.map((item) {
children: model.listMyReferredPatientModel
.map((item) {
return MyReferredPatientWidget(
myReferredPatientModel: item,
model: model);
}).toList(),
),
),
],
),
],
),
),
));
}
}

@ -1,12 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patients_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';

@ -1,15 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patients_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';

@ -1,6 +1,4 @@
import 'dart:ui'; import 'dart:ui';
import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';

@ -51,33 +51,28 @@ class ReferredPatientScreen extends StatelessWidget {
...List.generate( ...List.generate(
model.listMyReferredPatientModel.length, model.listMyReferredPatientModel.length,
(index) => (index) =>
Container() /*PatientReferralItemWidget( PatientReferralItemWidget(
"${model.getReferredPatientItem(index).patientId}", referralStatus: "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}",
patientName: patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", patientGender: model.getReferredPatientItem(index).gender,
referralStatus: referredDate: DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy"),
"${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}", referredTime: " ",
isReferredTo: true, patientID:
isSameBranch: model "${model.getReferredPatientItem(index).patientID}",
.getReferredPatientItem(index) isSameBranch: model.getReferredPatientItem(index)
.isReferralDoctorSameBranch, .isReferralDoctorSameBranch,
referralDoctorName: model isReferral: false,
.getReferredPatientItem(index) remark:
.referralDoctorName, model.getReferredPatientItem(index).referringDoctorRemarks,
clinicDescription: model nationality: model.getReferredPatientItem(index)
.getReferredPatientItem(index) .nationalityName,
.referralClinicDescription, nationalityFlag:
remark: model model.getReferredPatientItem(index).nationalityFlagURL,
.getReferredPatientItem(index) doctorAvatar:
.referringDoctorRemarks, model.getReferredPatientItem(index).doctorImageURL,
referredOn: model referralDoctorName: "${model.getReferredPatientItem(index).referringDoctorName}(${model.getReferredPatientItem(index).referringClinicDescription})",
.getReferredPatientItem(index) clinicDescription: null,
.referralDate != ),
null
? DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy")
: null,
)*/
,
), ),
], ],
), ),

@ -1,311 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/referred_view_model.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MyReferredPatientWidget extends StatefulWidget {
final MyReferredPatientModel myReferredPatientModel;
final ReferredPatientViewModel model;
MyReferredPatientWidget({Key key, this.myReferredPatientModel, this.model});
@override
_MyReferredPatientWidgetState createState() =>
_MyReferredPatientWidgetState();
}
class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
bool _showDetails = false;
bool _isLoading = false;
TextEditingController answerController;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
padding: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffCCCCCC),
width: 2,
)),
color: Color(0xffffffff),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
AppText(
'${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
InkWell(
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Image.asset(
"assets/images/ic_circle_arrow.png",
width: 25,
height: 25,
color: Colors.black,
),
),
],
),
),
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
),
children: [
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
decoration: BoxDecoration(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.patientId}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referralDoctor,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
Texts(
widget.myReferredPatientModel
.referralDoctorName,
maxLength: 80,
readMore: true,
),
],
),
),
]),
TableRow(
children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referringClinic,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.referralClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).frequency,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.myReferredPatientModel
.frequencyDescription,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
],
),
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).priority,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.priorityDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).maxResponseTime,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferredPatientModel.maxResponseTime),
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
])
],
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
SizedBox(
height: 5,
),
Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).clinicDetailsandRemarks,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Texts(
'${widget.myReferredPatientModel.referringDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(context).answerSuggestions,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Texts(
'${widget.myReferredPatientModel.referredDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100),
],
),
),
SizedBox(
height: 5,
),
SizedBox(height: 10.0),
Container(
margin: EdgeInsets.all(10),
width: double.infinity,
child: Button(
onTap: () async {
try {
await widget.model
.verify(widget.myReferredPatientModel);
DrAppToastMsg.showSuccesToast(
'Verify Successfully');
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
},
title: TranslationBase.of(context).verify,
loading: widget.model.state == ViewState.BusyLocal,
),
)
],
)
],
),
isExpand: _showDetails,
)
],
),
);
}
}
Loading…
Cancel
Save