referral changes

merge-requests/731/head
mosazaid 5 years ago
parent f1d1cc6243
commit 10441e4af0

@ -181,7 +181,7 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_OUTPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";

@ -1008,4 +1008,6 @@ const Map<String, Map<String, String>> localizedValues = {
"allLab": {"en": "All Lab", "ar": "جميع المختبرات"}, "allLab": {"en": "All Lab", "ar": "جميع المختبرات"},
"allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"}, "allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"},
"addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"}, "addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"},
"edit": {"en": "Edit", "ar": "تعديل"},
"summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"},
}; };

@ -159,7 +159,12 @@ class MyReferralPatientModel {
referralClinic = json['ReferralClinic']; referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic']; referringClinic = json['ReferringClinic'];
referralStatus = json["ReferralStatus"] is String ?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0: json["ReferralStatus"]; referralStatus = json["ReferralStatus"] is String ?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0: json["ReferralStatus"];
try {
referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']); referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']);
} catch (e){
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
}
referringDoctorRemarks = json['ReferringDoctorRemarks']; referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn']; referralResponseOn = json['ReferralResponseOn'];

@ -63,7 +63,7 @@ class MyReferralInPatientService extends BaseService {
patientTypeID: 1); patientTypeID: 1);
myReferralPatients.clear(); myReferralPatients.clear();
await baseAppClient.post( await baseAppClient.post(
GET_MY_REFERRAL_OUTPATIENT, GET_MY_REFERRAL_OUT_PATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if (response['List_MyOutPatientReferral'] != null) { if (response['List_MyOutPatientReferral'] != null) {
response['List_MyOutPatientReferral'].forEach((v) { response['List_MyOutPatientReferral'].forEach((v) {

@ -14,17 +14,24 @@ 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';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'ReplySummeryOnReferralPatient.dart';
class AddReplayOnReferralPatient extends StatefulWidget { class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel; final MyReferralPatientModel myReferralInPatientModel;
final bool isEdited;
const AddReplayOnReferralPatient( const AddReplayOnReferralPatient(
{Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) {Key key,
this.patientReferralViewModel,
this.myReferralInPatientModel,
this.isEdited})
: super(key: key); : super(key: key);
@override @override
@ -39,10 +46,13 @@ class _AddReplayOnReferralPatientState
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
TextEditingController replayOnReferralController = TextEditingController(); TextEditingController replayOnReferralController = TextEditingController();
@override @override
void initState() { void initState() {
requestPermissions(); requestPermissions();
super.initState(); super.initState();
replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks?? "";
} }
@override @override
@ -51,11 +61,9 @@ class _AddReplayOnReferralPatientState
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.0,
child: Padding(
padding: EdgeInsets.all(0.0),
child: Column( child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
BottomSheetTitle(title: 'Replay'), BottomSheetTitle(title: 'Replay'),
@ -103,10 +111,7 @@ class _AddReplayOnReferralPatientState
), ),
], ],
), ),
), Container(
),
),
bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty ? 130 : 70, height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column( child: Column(
@ -150,6 +155,15 @@ class _AddReplayOnReferralPatientState
"Your Replay Added Successfully"); "Your Replay Added Successfully");
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.push(
context,
FadePage(
page: ReplySummeryOnReferralPatient(
widget.myReferralInPatientModel,
replayOnReferralController.text.trim()),
),
);
} }
} else { } else {
Helpers.showErrorToast("You can't add empty replay"); Helpers.showErrorToast("You can't add empty replay");
@ -161,6 +175,9 @@ class _AddReplayOnReferralPatientState
], ],
), ),
), ),
],
),
),
); );
} }

@ -0,0 +1,119 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
class ReplySummeryOnReferralPatient extends StatefulWidget {
final MyReferralPatientModel referredPatient;
final String doctorReply;
ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply);
@override
_ReplySummeryOnReferralPatientState createState() =>
_ReplySummeryOnReferralPatientState(this.referredPatient);
}
class _ReplySummeryOnReferralPatientState
extends State<ReplySummeryOnReferralPatient> {
final MyReferralPatientModel referredPatient;
_ReplySummeryOnReferralPatientState(this.referredPatient);
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).summeryReply,
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
width: double.infinity,
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: Colors.white,
width: 1.0,
)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
widget.doctorReply ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
height: 8,
),
],
),
),
),
),
Container(
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
children: [
Expanded(
child: AppButton(
onPressed: () {
Navigator.of(context).pop();
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
),
),
SizedBox(width: 4,),
Expanded(
child: AppButton(
onPressed: () {},
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: Colors.green[600],
),
),
],
),
),
],
),
),
));
}
}

@ -64,7 +64,6 @@ class MyReferralInPatientScreen extends StatelessWidget {
) )
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(top: 70),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -19,6 +19,7 @@ import 'AddReplayOnReferralPatient.dart';
class ReferralPatientDetailScreen extends StatelessWidget { 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);
@ -217,6 +218,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).refClinic}: ", "${TranslationBase.of(context).refClinic}: ",
@ -226,7 +229,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
SizeConfig.textMultiplier, SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( Expanded(
child: AppText(
referredPatient referredPatient
.referringClinicDescription, .referringClinicDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -235,9 +239,10 @@ class ReferralPatientDetailScreen extends StatelessWidget {
SizeConfig.textMultiplier, SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
),
], ],
), ),
if(referredPatient.frequency != null) if (referredPatient.frequency != null)
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
@ -257,11 +262,13 @@ class ReferralPatientDetailScreen extends StatelessWidget {
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),
), ),
), ),
@ -304,22 +311,25 @@ class ReferralPatientDetailScreen extends StatelessWidget {
) )
], ],
), ),
if(referredPatient.priorityDescription != null) if (referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
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: 1.7 * SizeConfig.textMultiplier, fontSize:
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:
@ -329,10 +339,11 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if(referredPatient.mAXResponseTime != null) if (referredPatient.mAXResponseTime != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
@ -340,14 +351,20 @@ class ReferralPatientDetailScreen extends StatelessWidget {
": ", ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize:
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.mAXResponseTime != null? AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime !=
referredPatient.mAXResponseTime, null
"dd MMM,yyyy"):'', ? AppDateUtils
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime,
"dd MMM,yyyy")
: '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize:
@ -448,10 +465,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Column(
children: [
Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin:
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), 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,
@ -472,7 +493,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient.referringDoctorRemarks??'', referredPatient.referringDoctorRemarks ?? '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -484,12 +505,53 @@ 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),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: Colors.white,
width: 1.0,
)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referredDoctorRemarks ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
height: 8,
),
],
),
),
],
),
), ),
), ),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).replay, title: referredPatient.referredDoctorRemarks.isEmpty ? TranslationBase.of(context).replay : TranslationBase.of(context).edit,
color: Colors.red[700], color: Colors.red[700],
fontColor: Colors.white, fontColor: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -503,6 +565,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
widget: AddReplayOnReferralPatient( widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel, patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient, myReferralInPatientModel: referredPatient,
isEdited: referredPatient.referredDoctorRemarks.isNotEmpty,
), ),
), ),
); );

@ -1363,6 +1363,8 @@ class TranslationBase {
String get allLab => localizedValues['allLab'][locale.languageCode]; String get allLab => localizedValues['allLab'][locale.languageCode];
String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; String get allPrescription => localizedValues['allPrescription'][locale.languageCode];
String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; String get addPrescription => localizedValues['addPrescription'][locale.languageCode];
String get edit => localizedValues['edit'][locale.languageCode];
String get summeryReply => localizedValues['summeryReply'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -155,6 +155,7 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic,
@ -163,14 +164,15 @@ class PatientReferralItemWidget extends StatelessWidget {
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded(
AppText( child: AppText(
!isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
),
], ],
), ),
], ],

Loading…
Cancel
Save