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

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

@ -361,60 +361,63 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
), ),
Container( if (referralPatient.referralStatus != 46)
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), Container(
child: Row( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
children: [ child: Row(
Expanded( children: [
child: AppButton( Expanded(
title: TranslationBase.of(context).accept, child: AppButton(
color: Color(0xFF4BA821), title: TranslationBase.of(context).accept,
fontColor: Colors.white, color: Color(0xFF4BA821),
fontSize: 1.6, fontColor: Colors.white,
hPadding: 8, fontSize: 1.6,
vPadding: 12, hPadding: 8,
onPressed: () async { vPadding: 12,
await model.responseReferral(referralPatient, true); disabled: model.state == ViewState.Busy,
if (model.state == ViewState.ErrorLocal) { onPressed: () async {
DrAppToastMsg.showErrorToast(model.error); await model.responseReferral(referralPatient, true);
} else { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showErrorToast(model.error);
TranslationBase.of(context) } else {
.referralSuccessMsgAccept); DrAppToastMsg.showSuccesToast(
Navigator.pop(context); TranslationBase.of(context)
Navigator.pop(context); .referralSuccessMsgAccept);
} Navigator.pop(context);
}, Navigator.pop(context);
}
},
),
), ),
), SizedBox(
SizedBox( width: 8,
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);
}
},
), ),
), 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'; 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; PatientType patientType = PatientType.IN_PATIENT;
@override @override
@ -33,7 +38,9 @@ class MyReferralInPatientScreen extends StatelessWidget {
margin: EdgeInsets.only(top: 70), margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget( child: PatientTypeRadioWidget(
(patientType) async { (patientType) async {
this.patientType = patientType; setState(() {
this.patientType = patientType;
});
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patientType == PatientType.IN_PATIENT) { if (patientType == PatientType.IN_PATIENT) {
await model.getMyReferralPatientService(localBusy: true); await model.getMyReferralPatientService(localBusy: true);

Loading…
Cancel
Save