Referrel Doctor reply

merge-requests/736/head
hussam al-habibeh 3 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 LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
var selectedPatientType = 1;

@ -61,6 +61,7 @@ class MyReferralPatientModel {
String priorityDescription;
String referringClinicDescription;
String referringDoctorName;
int referalStatus;
MyReferralPatientModel(
{this.rowID,
@ -122,10 +123,12 @@ class MyReferralPatientModel {
this.nursingStationName,
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName});
this.referringDoctorName,
this.referalStatus});
MyReferralPatientModel.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
referalStatus = json['ReferalStatus'];
projectID = json['ProjectID'];
lineItemNo = json['LineItemNo'];
doctorID = json['DoctorID'];
@ -203,6 +206,7 @@ class MyReferralPatientModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['ReferalStatus'] = this.referalStatus;
data['ProjectID'] = this.projectID;
data['LineItemNo'] = this.lineItemNo;
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/core/model/referral/MyReferralPatientModel.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/models/doctor/request_add_referred_doctor_remarks.dart';
@ -11,8 +12,7 @@ class MyReferralInPatientService extends BaseService {
hasError = false;
await getDoctorProfile();
MyReferralPatientRequestModel myReferralPatientRequestModel =
MyReferralPatientRequestModel(
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
doctorID: doctorProfile.doctorID,
firstName: "0",
middleName: "0",
@ -47,8 +47,7 @@ class MyReferralInPatientService extends BaseService {
hasError = false;
await getDoctorProfile();
MyReferralPatientRequestModel myReferralPatientRequestModel =
MyReferralPatientRequestModel(
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
doctorID: doctorProfile.doctorID,
firstName: "0",
middleName: "0",
@ -79,18 +78,14 @@ class MyReferralInPatientService extends BaseService {
);
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel referral) async {
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
hasError = false;
await getDoctorProfile();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo =
referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.patientID = referral.patientID;
_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/model/referral/DischargeReferralPatient.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/MyReferralPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart';
@ -18,16 +19,13 @@ import 'package:flutter/cupertino.dart';
import '../../locator.dart';
class PatientReferralViewModel extends BaseViewModel {
PatientReferralService _referralPatientService =
locator<PatientReferralService>();
PatientReferralService _referralPatientService = locator<PatientReferralService>();
ReferralService _referralService = locator<ReferralService>();
MyReferralInPatientService _myReferralService =
locator<MyReferralInPatientService>();
MyReferralInPatientService _myReferralService = locator<MyReferralInPatientService>();
DischargedPatientService _dischargedPatientService =
locator<DischargedPatientService>();
DischargedPatientService _dischargedPatientService = locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients;
@ -36,28 +34,21 @@ class PatientReferralViewModel extends BaseViewModel {
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList =>
_referralPatientService.frequencyList;
List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList;
List<dynamic> doctorsList = [];
List<ClinicDoctor> get clinicDoctorsList =>
_referralPatientService.doctorsList;
List<ClinicDoctor> get clinicDoctorsList => _referralPatientService.doctorsList;
List<MyReferralPatientModel> get myReferralPatients =>
_myReferralService.myReferralPatients;
List<MyReferralPatientModel> get myReferralPatients => _myReferralService.myReferralPatients;
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
List<MyReferredPatientModel> get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel;
List<PendingReferral> get pendingReferral =>
_referralPatientService.pendingReferralList;
List<PendingReferral> get pendingReferral => _referralPatientService.pendingReferralList;
List<PendingReferral> get patientReferral =>
_referralPatientService.patientReferralList;
List<PendingReferral> get patientReferral => _referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList =>
_referralPatientService.patientArrivalList;
List<PatiantInformtion> get patientArrivalList => _referralPatientService.patientArrivalList;
Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy);
@ -106,8 +97,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getClinicDoctors(
PatiantInformtion patient, int clinicId, int branchId) async {
Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async {
setState(ViewState.BusyLocal);
await _referralPatientService.getDoctorsList(patient, clinicId, branchId);
if (_referralPatientService.hasError) {
@ -125,10 +115,7 @@ class PatientReferralViewModel extends BaseViewModel {
Future<dynamic> getDoctorBranch() async {
DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) {
dynamic _selectedBranch = {
"facilityId": doctorProfile.projectID,
"facilityName": doctorProfile.projectName
};
dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName};
return _selectedBranch;
}
return null;
@ -175,27 +162,38 @@ class PatientReferralViewModel extends BaseViewModel {
}
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();
if (_myReferralService.hasError) {
error = _myReferralService.error;
if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error);
if (localBusy)
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
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();
if (_myReferralService.hasError) {
error = _myReferralService.error;
if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error);
if (localBusy)
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel referral) async {
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
setState(ViewState.Busy);
await _myReferralService.replay(referredDoctorRemarks, referral);
if (_myReferralService.hasError) {
@ -205,8 +203,7 @@ class PatientReferralViewModel extends BaseViewModel {
getMyReferralPatientService();
}
Future responseReferral(
PendingReferral pendingReferral, bool isAccepted) async {
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
setState(ViewState.Busy);
await _referralPatientService.responseReferral(pendingReferral, isAccepted);
if (_referralPatientService.hasError) {
@ -216,11 +213,10 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future makeReferral(PatiantInformtion patient, String isoStringDate,
int projectID, int clinicID, int doctorID, String remarks) async {
Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID,
String remarks) async {
setState(ViewState.Busy);
await _referralPatientService.makeReferral(
patient, isoStringDate, projectID, clinicID, doctorID, remarks);
await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
@ -260,12 +256,10 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
Future getPatientDetails(
String fromDate, String toDate, int patientMrn, int appointmentNo) async {
Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(toDate,
fromDate: fromDate, patientMrn: patientMrn);
await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
@ -284,8 +278,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future verifyReferralDoctorRemarks(
MyReferredPatientModel referredPatient) async {
Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async {
setState(ViewState.Busy);
await _referralPatientService.verifyReferralDoctorRemarks(referredPatient);
if (_referralPatientService.hasError) {
@ -324,8 +317,7 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
PatiantInformtion getPatientFromReferral(
MyReferredPatientModel referredPatient) {
PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -350,8 +342,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient;
}
PatiantInformtion getPatientFromReferralO(
MyReferralPatientModel referredPatient) {
PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -376,8 +367,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient;
}
PatiantInformtion getPatientFromDischargeReferralPatient(
DischargeReferralPatient referredPatient) {
PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -396,10 +386,19 @@ class PatientReferralViewModel extends BaseViewModel {
patient.roomId = referredPatient.roomID;
patient.bedId = referredPatient.bedID;
patient.nationalityName = referredPatient.nationalityName;
patient.nationalityFlagURL =
''; // TODO from backend referredPatient.nationalityFlagURL;
patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL;
patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription;
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/size_config.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/add_referred_remarks_request.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/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/speech-text-popup.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:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
@ -25,23 +24,25 @@ import 'ReplySummeryOnReferralPatient.dart';
class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel;
final AddReferredRemarksRequestModel myReferralInPatientRequestModel;
final bool isEdited;
const AddReplayOnReferralPatient(
{Key key,
this.patientReferralViewModel,
this.myReferralInPatientModel,
this.isEdited})
this.isEdited,
this.myReferralInPatientRequestModel})
: super(key: key);
@override
_AddReplayOnReferralPatientState createState() =>
_AddReplayOnReferralPatientState();
_AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState();
}
class _AddReplayOnReferralPatientState
extends State<AddReplayOnReferralPatient> {
class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient> {
bool isSubmitted = false;
int replay = 1;
int reject = 2;
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
@ -51,8 +52,7 @@ class _AddReplayOnReferralPatientState
void initState() {
requestPermissions();
super.initState();
replayOnReferralController.text =
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
}
@override
@ -84,9 +84,7 @@ class _AddReplayOnReferralPatientState
maxLines: 35,
minLines: 25,
hasBorder: true,
validationError: replayOnReferralController
.text.isEmpty &&
isSubmitted
validationError: replayOnReferralController.text.isEmpty && isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
),
@ -139,8 +137,33 @@ class _AddReplayOnReferralPatientState
children: [
Expanded(
child: AppButton(
onPressed: () {
onPressed: () async {
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,
fontColor: Colors.white,
@ -158,32 +181,26 @@ class _AddReplayOnReferralPatientState
});
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay(
replayOnReferralController.text.trim(),
widget.myReferralInPatientModel);
if (widget.patientReferralViewModel.state ==
ViewState.ErrorLocal) {
Helpers.showErrorToast(
widget.patientReferralViewModel.error);
await widget.patientReferralViewModel.replayReferred(
replayOnReferralController.text.trim(), widget.myReferralInPatientModel, replay);
if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.patientReferralViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
"Your Reply Added Successfully");
DrAppToastMsg.showSuccesToast("Your Reply Added Successfully");
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.push(
context,
FadePage(
page: ReplySummeryOnReferralPatient(
widget.myReferralInPatientModel,
replayOnReferralController.text.trim()),
),
);
// Navigator.push(
// context,
// FadePage(
// page: ReplySummeryOnReferralPatient(
// widget.myReferralInPatientModel, replayOnReferralController.text.trim()),
// ),
// );
}
} else {
Helpers.showErrorToast(
"You can't add empty reply");
Helpers.showErrorToast("You can't add empty reply");
setState(() {
isSubmitted = false;
});
@ -250,8 +267,7 @@ class _AddReplayOnReferralPatientState
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,

@ -16,7 +16,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MyReferralInPatientScreen extends StatelessWidget {
PatientType patientType = PatientType.IN_PATIENT;
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
@ -79,11 +78,13 @@ class MyReferralInPatientScreen extends StatelessWidget {
);
},
child: PatientReferralItemWidget(
referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context),
referralStatus: model.getReferralStatusNameByCode(
model.myReferralPatients[index].referralStatus, context),
referralStatusCode: model.myReferralPatients[index].referralStatus,
patientName: model.myReferralPatients[index].patientName,
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),
patientID: "${model.myReferralPatients[index].patientID}",
isSameBranch: false,
@ -96,8 +97,7 @@ class MyReferralInPatientScreen extends StatelessWidget {
doctorAvatar: model.myReferralPatients[index].doctorImageURL,
referralDoctorName: model.myReferralPatients[index].referringDoctorName,
clinicDescription: model.myReferralPatients[index].referringClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black),
),
),
),

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

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

@ -629,7 +629,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.4"
mime:
dependency: transitive
description:
@ -921,7 +921,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0-nullsafety.2"
sticky_headers:
dependency: "direct main"
description:
@ -1119,5 +1119,5 @@ packages:
source: hosted
version: "2.2.1"
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"

Loading…
Cancel
Save