finish fix referral

merge-requests/763/head
Elham Rababah 5 years ago
parent 7d6123f9cb
commit 74294bfaf5

@ -57,20 +57,6 @@ class MyReferralPatientModel {
bool isDoctorLate;
bool isDoctorResponse;
String nationalityFlagURL;
String nursingStationName;
String priorityDescription;
String referringClinicDescription;
@ -84,6 +70,7 @@ class MyReferralPatientModel {
int targetDoctorID;
int sourceAppointmentNo;
int targetAppointmentNo;
String remarksFromSource;
MyReferralPatientModel(
{this.rowID,
@ -146,7 +133,7 @@ class MyReferralPatientModel {
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName,
this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID});
this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID, this.remarksFromSource});
MyReferralPatientModel.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
@ -230,7 +217,10 @@ class MyReferralPatientModel {
targetClinicID = json['TargetClinicID'];
targetDoctorID = json['TargetDoctorID'];
sourceAppointmentNo = json['SourceAppointmentNo'];
targetAppointmentNo = json['TargetAppointmentNo']; }
targetAppointmentNo = json['TargetAppointmentNo'];
remarksFromSource = json['RemarksFromSource'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
@ -303,6 +293,7 @@ class MyReferralPatientModel {
data['TargetDoctorID'] = this.targetDoctorID;
data['SourceAppointmentNo'] = this.sourceAppointmentNo;
data['TargetAppointmentNo'] = this.targetAppointmentNo;
data['RemarksFromSource'] = this.remarksFromSource;
return data;
}

@ -254,7 +254,7 @@ class PatientReferralService extends LookupService {
body['ProjectID'] = referralPatient.targetProjectId;
body['IsAccepted'] = isAccepted;
body['PatientName'] = referralPatient.patientName;
body['ReferralResponse'] = referralPatient.referringDoctorRemarks;
body['ReferralResponse'] = referralPatient.remarksFromSource;
body['DoctorName'] = doctorProfile.doctorName;
await baseAppClient.post(

@ -361,60 +361,63 @@ class MyReferralDetailScreen extends StatelessWidget {
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).accept,
color: Color(0xFF4BA821),
fontColor: Colors.white,
fontSize: 1.6,
hPadding: 8,
vPadding: 12,
onPressed: () async {
await model.responseReferral(referralPatient, true);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgAccept);
Navigator.pop(context);
Navigator.pop(context);
}
},
if (referralPatient.referralStatus != 46)
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).accept,
color: Color(0xFF4BA821),
fontColor: Colors.white,
fontSize: 1.6,
hPadding: 8,
vPadding: 12,
disabled: model.state == ViewState.Busy,
onPressed: () async {
await model.responseReferral(referralPatient, true);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgAccept);
Navigator.pop(context);
Navigator.pop(context);
}
},
),
),
),
SizedBox(
width: 8,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).reject,
color: Color(0xFFB9382C),
fontColor: Colors.white,
fontSize: 1.6,
hPadding: 8,
vPadding: 12,
onPressed: () async {
await model.responseReferral(referralPatient, false);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgReject);
Navigator.pop(context);
Navigator.pop(context);
}
},
SizedBox(
width: 8,
),
),
],
Expanded(
child: AppButton(
title: TranslationBase.of(context).reject,
color: Color(0xFFB9382C),
fontColor: Colors.white,
fontSize: 1.6,
hPadding: 8,
vPadding: 12,
disabled: model.state == ViewState.Busy,
onPressed: () async {
await model.responseReferral(referralPatient, false);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgReject);
Navigator.pop(context);
Navigator.pop(context);
}
},
),
),
],
),
),
),
],
)),
);

@ -16,7 +16,12 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'my-referral-patient-screen.dart';
class MyReferralInPatientScreen extends StatelessWidget {
class MyReferralInPatientScreen extends StatefulWidget {
@override
_MyReferralInPatientScreenState createState() => _MyReferralInPatientScreenState();
}
class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
PatientType patientType = PatientType.IN_PATIENT;
@override
@ -33,7 +38,9 @@ class MyReferralInPatientScreen extends StatelessWidget {
margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget(
(patientType) async {
this.patientType = patientType;
setState(() {
this.patientType = patientType;
});
GifLoaderDialogUtils.showMyDialog(context);
if (patientType == PatientType.IN_PATIENT) {
await model.getMyReferralPatientService(localBusy: true);

Loading…
Cancel
Save