Referrel Doctor reply

merge-requests/736/head
hussam al-habibeh 4 years ago
parent e77f5773dc
commit 142fbb93fd

@ -224,6 +224,7 @@ const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RE
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
var selectedPatientType = 1; var selectedPatientType = 1;

@ -61,6 +61,7 @@ class MyReferralPatientModel {
String priorityDescription; String priorityDescription;
String referringClinicDescription; String referringClinicDescription;
String referringDoctorName; String referringDoctorName;
int referalStatus;
MyReferralPatientModel( MyReferralPatientModel(
{this.rowID, {this.rowID,
@ -122,10 +123,12 @@ class MyReferralPatientModel {
this.nursingStationName, this.nursingStationName,
this.priorityDescription, this.priorityDescription,
this.referringClinicDescription, this.referringClinicDescription,
this.referringDoctorName}); this.referringDoctorName,
this.referalStatus});
MyReferralPatientModel.fromJson(Map<String, dynamic> json) { MyReferralPatientModel.fromJson(Map<String, dynamic> json) {
rowID = json['RowID']; rowID = json['RowID'];
referalStatus = json['ReferalStatus'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
lineItemNo = json['LineItemNo']; lineItemNo = json['LineItemNo'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
@ -203,6 +206,7 @@ class MyReferralPatientModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID; data['RowID'] = this.rowID;
data['ReferalStatus'] = this.referalStatus;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['LineItemNo'] = this.lineItemNo; data['LineItemNo'] = this.lineItemNo;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;

@ -0,0 +1,72 @@
class AddReferredRemarksRequestModel {
int projectID;
int admissionNo;
int lineItemNo;
String referredDoctorRemarks;
int editedBy;
int referalStatus;
bool isLoginForDoctorApp;
String iPAdress;
bool patientOutSA;
String tokenID;
int languageID;
double versionID;
int channel;
String sessionID;
int deviceTypeID;
AddReferredRemarksRequestModel(
{this.projectID,
this.admissionNo,
this.lineItemNo,
this.referredDoctorRemarks,
this.editedBy,
this.referalStatus,
this.isLoginForDoctorApp,
this.iPAdress,
this.patientOutSA,
this.tokenID,
this.languageID,
this.versionID,
this.channel,
this.sessionID,
this.deviceTypeID});
AddReferredRemarksRequestModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
admissionNo = json['AdmissionNo'];
lineItemNo = json['LineItemNo'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
editedBy = json['EditedBy'];
referalStatus = json['ReferalStatus'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
iPAdress = json['IPAdress'];
patientOutSA = json['PatientOutSA'];
tokenID = json['TokenID'];
languageID = json['LanguageID'];
versionID = json['VersionID'];
channel = json['Channel'];
sessionID = json['SessionID'];
deviceTypeID = json['DeviceTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['LineItemNo'] = this.lineItemNo;
data['ReferredDoctorRemarks'] = this.referredDoctorRemarks;
data['EditedBy'] = this.editedBy;
data['ReferalStatus'] = this.referalStatus;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['IPAdress'] = this.iPAdress;
data['PatientOutSA'] = this.patientOutSA;
data['TokenID'] = this.tokenID;
data['LanguageID'] = this.languageID;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['SessionID'] = this.sessionID;
data['DeviceTypeID'] = this.deviceTypeID;
return data;
}
}

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
@ -11,20 +12,19 @@ class MyReferralInPatientService extends BaseService {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
MyReferralPatientRequestModel( doctorID: doctorProfile.doctorID,
doctorID: doctorProfile.doctorID, firstName: "0",
firstName: "0", middleName: "0",
middleName: "0", lastName: "0",
lastName: "0", patientMobileNumber: "0",
patientMobileNumber: "0", patientIdentificationID: "0",
patientIdentificationID: "0", patientID: 0,
patientID: 0, from: "0",
from: "0", to: "0",
to: "0", stamp: DateTime.now().toIso8601String(),
stamp: DateTime.now().toIso8601String(), isLoginForDoctorApp: true,
isLoginForDoctorApp: true, patientTypeID: 1);
patientTypeID: 1);
myReferralPatients.clear(); myReferralPatients.clear();
await baseAppClient.post( await baseAppClient.post(
GET_MY_REFERRAL_INPATIENT, GET_MY_REFERRAL_INPATIENT,
@ -47,8 +47,7 @@ class MyReferralInPatientService extends BaseService {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
MyReferralPatientRequestModel(
doctorID: doctorProfile.doctorID, doctorID: doctorProfile.doctorID,
firstName: "0", firstName: "0",
middleName: "0", middleName: "0",
@ -79,18 +78,14 @@ class MyReferralInPatientService extends BaseService {
); );
} }
Future replay( Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
String referredDoctorRemarks, MyReferralPatientModel referral) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.projectID = referral.projectID; _requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo = _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString();
referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.patientID = referral.patientID; _requestAddReferredDoctorRemarks.patientID = referral.patientID;
_requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;
@ -104,4 +99,32 @@ class MyReferralInPatientService extends BaseService {
}, },
); );
} }
Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async {
hasError = false;
await getDoctorProfile();
AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel(
editedBy: doctorProfile.doctorID,
projectID: doctorProfile.projectID,
referredDoctorRemarks: referredDoctorRemarks,
referalStatus: referalStatus);
_requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo);
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.referalStatus = referalStatus;
// _requestAddReferredDoctorRemarks.patientID = referral.patientID;
// _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;
await baseAppClient.post(
ADD_REFERRED_REMARKS_NEW,
body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
);
}
} }

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart';
import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart'; import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart';
@ -18,16 +19,13 @@ import 'package:flutter/cupertino.dart';
import '../../locator.dart'; import '../../locator.dart';
class PatientReferralViewModel extends BaseViewModel { class PatientReferralViewModel extends BaseViewModel {
PatientReferralService _referralPatientService = PatientReferralService _referralPatientService = locator<PatientReferralService>();
locator<PatientReferralService>();
ReferralService _referralService = locator<ReferralService>(); ReferralService _referralService = locator<ReferralService>();
MyReferralInPatientService _myReferralService = MyReferralInPatientService _myReferralService = locator<MyReferralInPatientService>();
locator<MyReferralInPatientService>();
DischargedPatientService _dischargedPatientService = DischargedPatientService _dischargedPatientService = locator<DischargedPatientService>();
locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient => List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients; _dischargedPatientService.myDischargeReferralPatients;
@ -36,28 +34,21 @@ class PatientReferralViewModel extends BaseViewModel {
List<dynamic> get clinicsList => _referralPatientService.clinicsList; List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList => List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList;
_referralPatientService.frequencyList;
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<ClinicDoctor> get clinicDoctorsList => List<ClinicDoctor> get clinicDoctorsList => _referralPatientService.doctorsList;
_referralPatientService.doctorsList;
List<MyReferralPatientModel> get myReferralPatients => List<MyReferralPatientModel> get myReferralPatients => _myReferralService.myReferralPatients;
_myReferralService.myReferralPatients;
List<MyReferredPatientModel> get listMyReferredPatientModel => List<MyReferredPatientModel> get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel;
_referralPatientService.listMyReferredPatientModel;
List<PendingReferral> get pendingReferral => List<PendingReferral> get pendingReferral => _referralPatientService.pendingReferralList;
_referralPatientService.pendingReferralList;
List<PendingReferral> get patientReferral => List<PendingReferral> get patientReferral => _referralPatientService.patientReferralList;
_referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList => List<PatiantInformtion> get patientArrivalList => _referralPatientService.patientArrivalList;
_referralPatientService.patientArrivalList;
Future getPatientReferral(PatiantInformtion patient) async { Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -106,8 +97,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getClinicDoctors( Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async {
PatiantInformtion patient, int clinicId, int branchId) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _referralPatientService.getDoctorsList(patient, clinicId, branchId); await _referralPatientService.getDoctorsList(patient, clinicId, branchId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -125,10 +115,7 @@ class PatientReferralViewModel extends BaseViewModel {
Future<dynamic> getDoctorBranch() async { Future<dynamic> getDoctorBranch() async {
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) { if (doctorProfile != null) {
dynamic _selectedBranch = { dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName};
"facilityId": doctorProfile.projectID,
"facilityName": doctorProfile.projectName
};
return _selectedBranch; return _selectedBranch;
} }
return null; return null;
@ -175,27 +162,38 @@ class PatientReferralViewModel extends BaseViewModel {
} }
Future getMyReferralPatientService({bool localBusy = false}) async { Future getMyReferralPatientService({bool localBusy = false}) async {
if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); if (localBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _myReferralService.getMyReferralPatientService(); await _myReferralService.getMyReferralPatientService();
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
error = _myReferralService.error; error = _myReferralService.error;
if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error); if (localBusy)
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMyReferralOutPatientService({bool localBusy = false}) async { Future getMyReferralOutPatientService({bool localBusy = false}) async {
if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); if (localBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _myReferralService.getMyReferralOutPatientService(); await _myReferralService.getMyReferralOutPatientService();
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
error = _myReferralService.error; error = _myReferralService.error;
if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error); if (localBusy)
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future replay( Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
String referredDoctorRemarks, MyReferralPatientModel referral) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myReferralService.replay(referredDoctorRemarks, referral); await _myReferralService.replay(referredDoctorRemarks, referral);
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
@ -205,8 +203,7 @@ class PatientReferralViewModel extends BaseViewModel {
getMyReferralPatientService(); getMyReferralPatientService();
} }
Future responseReferral( Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
PendingReferral pendingReferral, bool isAccepted) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.responseReferral(pendingReferral, isAccepted); await _referralPatientService.responseReferral(pendingReferral, isAccepted);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -216,11 +213,10 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future makeReferral(PatiantInformtion patient, String isoStringDate, Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID,
int projectID, int clinicID, int doctorID, String remarks) async { String remarks) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.makeReferral( await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks);
patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -260,12 +256,10 @@ class PatientReferralViewModel extends BaseViewModel {
} }
} }
Future getPatientDetails( Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async {
String fromDate, String toDate, int patientMrn, int appointmentNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(toDate, await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn);
fromDate: fromDate, patientMrn: patientMrn);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -284,8 +278,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future verifyReferralDoctorRemarks( Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async {
MyReferredPatientModel referredPatient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -324,8 +317,7 @@ class PatientReferralViewModel extends BaseViewModel {
} }
} }
PatiantInformtion getPatientFromReferral( PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) {
MyReferredPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion(); PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID; patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName; patient.doctorName = referredPatient.doctorName;
@ -350,8 +342,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient; return patient;
} }
PatiantInformtion getPatientFromReferralO( PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) {
MyReferralPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion(); PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID; patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName; patient.doctorName = referredPatient.doctorName;
@ -376,8 +367,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient; return patient;
} }
PatiantInformtion getPatientFromDischargeReferralPatient( PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) {
DischargeReferralPatient referredPatient) {
PatiantInformtion patient = PatiantInformtion(); PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID; patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName; patient.doctorName = referredPatient.doctorName;
@ -396,10 +386,19 @@ class PatientReferralViewModel extends BaseViewModel {
patient.roomId = referredPatient.roomID; patient.roomId = referredPatient.roomID;
patient.bedId = referredPatient.bedID; patient.bedId = referredPatient.bedID;
patient.nationalityName = referredPatient.nationalityName; patient.nationalityName = referredPatient.nationalityName;
patient.nationalityFlagURL = patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL;
''; // TODO from backend referredPatient.nationalityFlagURL;
patient.age = referredPatient.age; patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription; patient.clinicDescription = referredPatient.clinicDescription;
return patient; return patient;
} }
Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async {
setState(ViewState.Busy);
await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus);
if (_myReferralService.hasError) {
error = _myReferralService.error;
setState(ViewState.ErrorLocal);
} else
getMyReferralPatientService();
}
} }

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
@ -25,23 +24,25 @@ import 'ReplySummeryOnReferralPatient.dart';
class AddReplayOnReferralPatient extends StatefulWidget { class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel; final MyReferralPatientModel myReferralInPatientModel;
final AddReferredRemarksRequestModel myReferralInPatientRequestModel;
final bool isEdited; final bool isEdited;
const AddReplayOnReferralPatient( const AddReplayOnReferralPatient(
{Key key, {Key key,
this.patientReferralViewModel, this.patientReferralViewModel,
this.myReferralInPatientModel, this.myReferralInPatientModel,
this.isEdited}) this.isEdited,
this.myReferralInPatientRequestModel})
: super(key: key); : super(key: key);
@override @override
_AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState();
_AddReplayOnReferralPatientState();
} }
class _AddReplayOnReferralPatientState class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient> {
extends State<AddReplayOnReferralPatient> {
bool isSubmitted = false; bool isSubmitted = false;
int replay = 1;
int reject = 2;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
@ -51,8 +52,7 @@ class _AddReplayOnReferralPatientState
void initState() { void initState() {
requestPermissions(); requestPermissions();
super.initState(); super.initState();
replayOnReferralController.text = replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
} }
@override @override
@ -84,9 +84,7 @@ class _AddReplayOnReferralPatientState
maxLines: 35, maxLines: 35,
minLines: 25, minLines: 25,
hasBorder: true, hasBorder: true,
validationError: replayOnReferralController validationError: replayOnReferralController.text.isEmpty && isSubmitted
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
), ),
@ -139,8 +137,33 @@ class _AddReplayOnReferralPatientState
children: [ children: [
Expanded( Expanded(
child: AppButton( child: AppButton(
onPressed: () { onPressed: () async {
Navigator.of(context).pop(); if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replayReferred(
replayOnReferralController.text.trim(), widget.myReferralInPatientModel, reject);
if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.patientReferralViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast("Has been rejected");
Navigator.of(context).pop();
Navigator.of(context).pop();
// Navigator.push(
// context,
// FadePage(
// page: ReplySummeryOnReferralPatient(
// widget.myReferralInPatientModel, replayOnReferralController.text.trim()),
// ),
// );
}
} else {
Helpers.showErrorToast("You can't add empty reply");
setState(() {
isSubmitted = false;
});
}
}, },
title: TranslationBase.of(context).reject, title: TranslationBase.of(context).reject,
fontColor: Colors.white, fontColor: Colors.white,
@ -158,32 +181,26 @@ class _AddReplayOnReferralPatientState
}); });
if (replayOnReferralController.text.isNotEmpty) { if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay( await widget.patientReferralViewModel.replayReferred(
replayOnReferralController.text.trim(), replayOnReferralController.text.trim(), widget.myReferralInPatientModel, replay);
widget.myReferralInPatientModel); if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) {
if (widget.patientReferralViewModel.state == Helpers.showErrorToast(widget.patientReferralViewModel.error);
ViewState.ErrorLocal) {
Helpers.showErrorToast(
widget.patientReferralViewModel.error);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("Your Reply Added Successfully");
"Your Reply Added Successfully");
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.push( // Navigator.push(
context, // context,
FadePage( // FadePage(
page: ReplySummeryOnReferralPatient( // page: ReplySummeryOnReferralPatient(
widget.myReferralInPatientModel, // widget.myReferralInPatientModel, replayOnReferralController.text.trim()),
replayOnReferralController.text.trim()), // ),
), // );
);
} }
} else { } else {
Helpers.showErrorToast( Helpers.showErrorToast("You can't add empty reply");
"You can't add empty reply");
setState(() { setState(() {
isSubmitted = false; isSubmitted = false;
}); });
@ -250,8 +267,7 @@ class _AddReplayOnReferralPatientState
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize( bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,

@ -16,7 +16,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MyReferralInPatientScreen extends StatelessWidget { class MyReferralInPatientScreen extends StatelessWidget {
PatientType patientType = PatientType.IN_PATIENT; PatientType patientType = PatientType.IN_PATIENT;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
@ -30,7 +29,7 @@ class MyReferralInPatientScreen extends StatelessWidget {
Container( Container(
margin: EdgeInsets.only(top: 70), margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget( child: PatientTypeRadioWidget(
(patientType) async { (patientType) async {
this.patientType = patientType; this.patientType = patientType;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patientType == PatientType.IN_PATIENT) { if (patientType == PatientType.IN_PATIENT) {
@ -62,7 +61,7 @@ class MyReferralInPatientScreen extends StatelessWidget {
), ),
) )
: Expanded( : Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -74,30 +73,31 @@ class MyReferralInPatientScreen extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ReferralPatientDetailScreen(model.myReferralPatients[index],model), page: ReferralPatientDetailScreen(model.myReferralPatients[index], model),
), ),
); );
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context), referralStatus: model.getReferralStatusNameByCode(
model.myReferralPatients[index].referralStatus, context),
referralStatusCode: model.myReferralPatients[index].referralStatus, referralStatusCode: model.myReferralPatients[index].referralStatus,
patientName: model.myReferralPatients[index].patientName, patientName: model.myReferralPatients[index].patientName,
patientGender: model.myReferralPatients[index].gender, patientGender: model.myReferralPatients[index].gender,
referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), referredDate: AppDateUtils.getDayMonthYearDateFormatted(
model.myReferralPatients[index].referralDate),
referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate),
patientID: "${model.myReferralPatients[index].patientID}", patientID: "${model.myReferralPatients[index].patientID}",
isSameBranch: false, isSameBranch: false,
isReferral: true, isReferral: true,
isReferralClinic: true, isReferralClinic: true,
referralClinic:"${model.myReferralPatients[index].referringClinicDescription}", referralClinic: "${model.myReferralPatients[index].referringClinicDescription}",
remark: model.myReferralPatients[index].referringDoctorRemarks, remark: model.myReferralPatients[index].referringDoctorRemarks,
nationality: model.myReferralPatients[index].nationalityName, nationality: model.myReferralPatients[index].nationalityName,
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, nationalityFlag: model.myReferralPatients[index].nationalityFlagURL,
doctorAvatar: model.myReferralPatients[index].doctorImageURL, doctorAvatar: model.myReferralPatients[index].doctorImageURL,
referralDoctorName: model.myReferralPatients[index].referringDoctorName, referralDoctorName: model.myReferralPatients[index].referringDoctorName,
clinicDescription: model.myReferralPatients[index].referringClinicDescription, clinicDescription: model.myReferralPatients[index].referringClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight, infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black),
size: 25, color: Colors.black),
), ),
), ),
), ),
@ -105,7 +105,7 @@ class MyReferralInPatientScreen extends StatelessWidget {
), ),
), ),
), ),
), ),
], ],
), ),
), ),

@ -20,8 +20,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
final MyReferralPatientModel referredPatient; final MyReferralPatientModel referredPatient;
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
ReferralPatientDetailScreen( ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel);
this.referredPatient, this.patientReferralViewModel);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -52,8 +51,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Helpers.capitalize( (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
"${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -70,18 +68,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = model PatiantInformtion patient = model.getPatientFromReferralO(referredPatient);
.getPatientFromReferralO(referredPatient); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Icon( child: Icon(
@ -98,18 +92,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = model PatiantInformtion patient = model.getPatientFromReferralO(referredPatient);
.getPatientFromReferralO(referredPatient); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Padding( child: Padding(
@ -144,8 +134,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}",
@ -170,28 +159,23 @@ class ReferralPatientDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).fileNumber,
.fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
"${referredPatient.patientID}", "${referredPatient.patientID}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -208,35 +192,29 @@ class ReferralPatientDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).refClinic}: ", "${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient.referringClinicDescription,
.referringClinicDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -244,31 +222,22 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
if (referredPatient.frequency != null) if (referredPatient.frequency != null)
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).frequency + ": ",
.frequency +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient.frequencyDescription ?? '',
.frequencyDescription ??
'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 * SizeConfig.textMultiplier,
SizeConfig
.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -280,29 +249,22 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
referredPatient.nationalityName != referredPatient.nationalityName != null
null
? referredPatient.nationalityName ? referredPatient.nationalityName
: "", : "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: fontSize: 1.4 * SizeConfig.textMultiplier,
1.4 * SizeConfig.textMultiplier,
), ),
referredPatient.nationalityFlagURL != referredPatient.nationalityFlagURL != null
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient referredPatient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext errorBuilder:
context, (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -314,26 +276,21 @@ class ReferralPatientDetailScreen extends StatelessWidget {
if (referredPatient.priorityDescription != null) if (referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).priority + TranslationBase.of(context).priority + ": ",
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.priorityDescription ?? referredPatient.priorityDescription ?? '',
'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -342,33 +299,24 @@ class ReferralPatientDetailScreen extends StatelessWidget {
if (referredPatient.mAXResponseTime != null) if (referredPatient.mAXResponseTime != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).maxResponseTime + ": ",
.maxResponseTime +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.mAXResponseTime != referredPatient.mAXResponseTime != null
null ? AppDateUtils.convertDateFromServerFormat(
? AppDateUtils referredPatient.mAXResponseTime, "dd MMM,yyyy")
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime,
"dd MMM,yyyy")
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -378,8 +326,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(left: 10, right: 0),
EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png', 'assets/images/patient/ic_ref_arrow_up.png',
height: 50, height: 50,
@ -387,26 +334,17 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
left: 0, padding: EdgeInsets.only(left: 4.0, right: 4.0),
top: 25, child: referredPatient.doctorImageURL != null
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL !=
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL, referredPatient.doctorImageURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
(BuildContext context, (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -422,30 +360,22 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0),
left: 10,
top: 30,
right: 10,
bottom: 0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.5 * fontSize: 1.5 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
), ),
AppText( AppText(
referredPatient referredPatient.referringClinicDescription,
.referringClinicDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.3 * fontSize: 1.3 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -469,10 +399,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
margin: margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
EdgeInsets.symmetric(horizontal: 16, vertical: 16), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -508,10 +436,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
if (referredPatient.referredDoctorRemarks.isNotEmpty) if (referredPatient.referredDoctorRemarks.isNotEmpty)
Container( Container(
width: double.infinity, width: double.infinity,
margin: margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0),
EdgeInsets.symmetric(horizontal: 16, vertical: 0), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -566,8 +492,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
widget: AddReplayOnReferralPatient( widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel, patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient, myReferralInPatientModel: referredPatient,
isEdited: referredPatient isEdited: referredPatient.referredDoctorRemarks.isNotEmpty,
.referredDoctorRemarks.isNotEmpty,
), ),
), ),
); );

@ -61,8 +61,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: appBarTitle: TranslationBase.of(context).qr + TranslationBase.of(context).reader,
TranslationBase.of(context).qr + TranslationBase.of(context).reader,
body: Center( body: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
@ -80,9 +79,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
height: 7, height: 7,
), ),
AppText(TranslationBase.of(context).scanQrCode, AppText(TranslationBase.of(context).scanQrCode,
fontSize: 14, fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center),
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
@ -106,18 +103,13 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
color: color: Theme.of(context).errorColor.withOpacity(0.06),
Theme.of(context).errorColor.withOpacity(0.06),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
vertical: 8.0, horizontal: 12.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: AppText( child: AppText(error ?? TranslationBase.of(context).errorMessage,
error ??
TranslationBase.of(context)
.errorMessage,
color: Theme.of(context).errorColor)), color: Theme.of(context).errorColor)),
], ],
), ),
@ -162,9 +154,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
case "0": case "0":
if (response['List_MyOutPatient'] != null) { if (response['List_MyOutPatient'] != null) {
setState(() { setState(() {
patientList = patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list;
ModelResponse.fromJson(response['List_MyOutPatient'])
.list;
isLoading = false; isLoading = false;
}); });
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
@ -181,8 +171,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
case "1": case "1":
if (response['List_MyInPatient'] != null) { if (response['List_MyInPatient'] != null) {
setState(() { setState(() {
patientList = patientList = ModelResponse.fromJson(response['List_MyInPatient']).list;
ModelResponse.fromJson(response['List_MyInPatient']).list;
isLoading = false; isLoading = false;
error = ""; error = "";
}); });
@ -203,8 +192,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
isLoading = false; isLoading = false;
isError = true; isError = true;
}); });
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
} }
}).catchError((error) { }).catchError((error) {
setState(() { setState(() {

@ -629,7 +629,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -921,7 +921,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1119,5 +1119,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save