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