ereferral fixes

merge-update-with-lab-changes
haroon amjad 4 years ago
parent 28c0450544
commit 85d68b0388

@ -16,9 +16,6 @@ class VaccineService extends BaseService {
body['To'] = "0"; body['To'] = "0";
body['From'] = "0"; body['From'] = "0";
// body['PatientID'] = 1018977;
// body['TokenID'] = "@dm!n";
hasError = false; hasError = false;
_vaccineList.clear(); _vaccineList.clear();
await baseAppClient.post(GET_VACCINES, await baseAppClient.post(GET_VACCINES,

@ -10,13 +10,12 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
@ -28,13 +27,10 @@ class NewEReferralStepOnePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel; final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
const NewEReferralStepOnePage( const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
: super(key: key);
@override @override
_NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState();
_NewEReferralStepOnePageState();
} }
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> { class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
@ -49,14 +45,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
// todo create a model for Country // todo create a model for Country
// todo use country from the json // todo use country from the json
dynamic _selectedCountry = { dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
};
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
@ -120,16 +109,14 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
), ),
Center( Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).referralRequesterInformation,
.referralRequesterInformation,
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).enterReferralRequesterName,
.enterReferralRequesterName,
controller: _nameTextController, controller: _nameTextController,
), ),
SizedBox( SizedBox(
@ -141,15 +128,10 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
Texts(getCountryName()),
Icon(Icons.arrow_drop_down)
],
), ),
), ),
), ),
@ -158,9 +140,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
), ),
MobileNumberTextFiled( MobileNumberTextFiled(
controller: _mobileTextController, controller: _mobileTextController,
code: _selectedCountry == null code: _selectedCountry == null ? "11" : _selectedCountry["code"],
? "11"
: _selectedCountry["code"],
), ),
SizedBox( SizedBox(
height: 12, height: 12,
@ -175,21 +155,15 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
height: 12, height: 12,
), ),
InkWell( InkWell(
onTap: () => confirmSelectRelationTypeDialog( onTap: () => confirmSelectRelationTypeDialog(model.relationTypes),
model.relationTypes),
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(getRelationName()), Icon(Icons.arrow_drop_down)],
Texts(getRelationName()),
Icon(Icons.arrow_drop_down)
],
), ),
), ),
), ),
@ -204,22 +178,19 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
padding: EdgeInsets.all(9), padding: EdgeInsets.all(9),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
(_nameTextController.text.isEmpty || (_nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty)
_selectedRelation == null ||
_mobileTextController.text.isEmpty)
? null ? null
: () async { : () async {
SendActivationCodeForEReferralRequestModel Future.delayed(new Duration(milliseconds: 300)).then((value) async {
sendActivationCodeForEReferralRequestModel = GifLoaderDialogUtils.showMyDialog(context);
SendActivationCodeForEReferralRequestModel( SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel(
zipCode: _selectedCountry['code'], zipCode: _selectedCountry['code'],
patientMobileNumber: patientMobileNumber: int.parse(_mobileTextController.text),
int.parse(_mobileTextController.text), );
); await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
await model.sendActivationCodeForEReferral( GifLoaderDialogUtils.hideDialog(context);
sendActivationCodeForEReferralRequestModel); showSMSDialog(model);
});
showSMSDialog(model);
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
), ),
@ -228,30 +199,24 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
void submit(EReferralViewModel model, code) async { void submit(EReferralViewModel model, code) async {
final activationCode = code; final activationCode = code;
// ToDo call service Future.delayed(new Duration(milliseconds: 300)).then((value) async {
CheckActivationCodeForEReferralResponseModel GifLoaderDialogUtils.showMyDialog(context);
checkActivationCodeForEReferralRequestModel = CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel = new CheckActivationCodeForEReferralResponseModel(activationCode: activationCode);
new CheckActivationCodeForEReferralResponseModel( await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
activationCode: activationCode); if (model.state == ViewState.ErrorLocal) {
await model.checkActivationCodeForEReferral( GifLoaderDialogUtils.hideDialog(context);
checkActivationCodeForEReferralRequestModel); } else {
if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context);
// Utils.showErrorToast(model.error); Navigator.of(context).pop();
} else { widget.changePageViewIndex(1);
Navigator.of(context).pop(); widget.createEReferralRequestModel.requesterName = _nameTextController.text;
widget.changePageViewIndex(1); widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + _mobileTextController.text;
widget.createEReferralRequestModel.requesterName = widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD;
_nameTextController.text; }
widget.createEReferralRequestModel.requesterContactNo = });
_selectedCountry['code'].toString().substring(1) +
_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship =
_selectedRelation.iD;
}
} }
void confirmSelectRelationTypeDialog( void confirmSelectRelationTypeDialog(List<GetAllRelationshipTypeResponseModel> relations) {
List<GetAllRelationshipTypeResponseModel> relations) {
showDialog( showDialog(
context: context, context: context,
child: SelectRelationTypeDialog( child: SelectRelationTypeDialog(
@ -302,9 +267,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
} }
class MobileNumberTextFiled extends StatelessWidget { class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled( const MobileNumberTextFiled({Key key, this.controller, this.code, this.onChange}) : super(key: key);
{Key key, this.controller, this.code, this.onChange})
: super(key: key);
final TextEditingController controller; final TextEditingController controller;
final String code; final String code;
@ -314,8 +277,7 @@ class MobileNumberTextFiled extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.white),
borderRadius: BorderRadius.circular(15), color: Colors.white),
child: Row(textDirection: TextDirection.ltr, children: <Widget>[ child: Row(textDirection: TextDirection.ltr, children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
@ -337,8 +299,7 @@ class MobileNumberTextFiled extends StatelessWidget {
controller: controller, controller: controller,
onChanged: onChange, onChanged: onChange,
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
decoration: InputDecoration( decoration: InputDecoration(border: InputBorder.none, hintText: '5xxxxxxxx'),
border: InputBorder.none, hintText: '5xxxxxxxx'),
), ),
), ),
) )

@ -11,12 +11,12 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -29,13 +29,10 @@ class NewEReferralStepThreePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel; final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
const NewEReferralStepThreePage( const NewEReferralStepThreePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
: super(key: key);
@override @override
_NewEReferralStepThreePageState createState() => _NewEReferralStepThreePageState createState() => _NewEReferralStepThreePageState();
_NewEReferralStepThreePageState();
} }
class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> { class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
@ -104,8 +101,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 9),
horizontal: 9),
child: Texts( child: Texts(
TranslationBase.of(context).medicalReport, TranslationBase.of(context).medicalReport,
color: Colors.grey, color: Colors.grey,
@ -120,21 +116,14 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
context, context,
(String image, File file) { (String image, File file) {
setState(() { setState(() {
EReferralAttachment EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
eReferralAttachment = medicalReportImages.add(eReferralAttachment);
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
medicalReportImages
.add(eReferralAttachment);
}); });
}, },
); );
}, },
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, right: 10, top: 15),
left: 10, right: 10, top: 15),
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey), border: Border.all(color: Colors.grey),
@ -144,10 +133,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
), ),
child: Center( child: Center(
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Icon(Icons.attach_file), Icon(Icons.attach_file),
Texts( Texts(
@ -169,30 +156,24 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon( Icon(FontAwesomeIcons.paperclip),
FontAwesomeIcons.paperclip),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
Texts( Texts(
medicalReportImages[index] medicalReportImages[index].fileName,
.fileName,
), ),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
medicalReportImages.remove( medicalReportImages.remove(medicalReportImages[index]);
medicalReportImages[
index]);
}); });
}, },
child: Icon( child: Icon(
@ -210,27 +191,22 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
), ),
Container( Container(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column( child: Column(
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
decoration: containerRadius(Colors.white, 12), decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20), margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
left: 10, right: 10, top: 12, bottom: 12),
child: Row( child: Row(
children: [ children: [
Flexible( Flexible(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context) TranslationBase.of(context).preferredBranch,
.preferredBranch,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
letterSpacing: -0.44, letterSpacing: -0.44,
@ -239,38 +215,24 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
), ),
Container( Container(
height: 18, height: 18,
child: child: DropdownButtonHideUnderline(
DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
key: projectDropdownKey, key: projectDropdownKey,
hint: Text(TranslationBase.of( hint: Text(TranslationBase.of(context).selectPreferredBranch),
context)
.selectPreferredBranch),
value: projectDropdownValue, value: projectDropdownValue,
iconSize: 0, iconSize: 0,
isExpanded: true, isExpanded: true,
style: TextStyle( style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
fontSize: 14, items: projectsList.map((item) {
letterSpacing: -0.56, return new DropdownMenuItem<String>(
color: Colors.black), value: item.mainProjectID.toString() + "," + item.name.toString(),
items: child: new Text(item.name),
projectsList.map((item) {
return new DropdownMenuItem<
String>(
value: item.mainProjectID
.toString() +
"," +
item.name.toString(),
child:
new Text(item.name),
); );
}).toList(), }).toList(),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
projectDropdownValue = projectDropdownValue = newValue;
newValue; print(projectDropdownValue);
print(
projectDropdownValue);
}); });
}, },
), ),
@ -289,9 +251,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
height: 12, height: 12,
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -337,25 +297,16 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
ImageOptions.showImageOptions(context, ImageOptions.showImageOptions(context, (String image, File file) {
(String image, File file) {
setState(() { setState(() {
EReferralAttachment EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
insuredPatientImages = [ insuredPatientImages = [eReferralAttachment];
eReferralAttachment
];
}); });
}); });
}, },
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, right: 10, top: 15),
left: 10, right: 10, top: 15),
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey), border: Border.all(color: Colors.grey),
@ -365,10 +316,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
), ),
child: Center( child: Center(
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Icon(Icons.attach_file), Icon(Icons.attach_file),
Texts( Texts(
@ -390,15 +339,12 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon(FontAwesomeIcons Icon(FontAwesomeIcons.paperclip),
.paperclip),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
@ -410,9 +356,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
insuredPatientImages.remove( insuredPatientImages.remove(insuredPatientImages[index]);
insuredPatientImages[
index]);
}); });
}, },
child: Icon( child: Icon(
@ -444,44 +388,24 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
medicalReportImages.length == 0 medicalReportImages.length == 0
? null ? null
: () async { : () async {
this Future.delayed(new Duration(milliseconds: 300)).then((value) async {
.widget GifLoaderDialogUtils.showMyDialog(context);
.createEReferralRequestModel this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages;
.medicalReportAttachment = medicalReportImages; this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length != 0 ? insuredPatientImages[0] : null;
this this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
.widget // ToDo make the preferred Branch info dynamic
.createEReferralRequestModel this.widget.createEReferralRequestModel.preferredBranchCode = num.tryParse(projectDropdownValue.split(",")[0]);
.insuranceCardAttachment = this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue.split(",")[1];
insuredPatientImages.length != 0 this.widget.createEReferralRequestModel.otherRelationship = "";
? insuredPatientImages[0] await model.createEReferral(this.widget.createEReferralRequestModel);
: null; if (model.state == ViewState.ErrorLocal) {
this GifLoaderDialogUtils.hideDialog(context);
.widget Utils.showErrorToast(model.error);
.createEReferralRequestModel } else {
.isInsuredPatient = isPatientInsured; GifLoaderDialogUtils.hideDialog(context);
// ToDo make the preferred Branch info dynamic AppToast.showSuccessToast(message: "Referral sent successfully");
this }
.widget });
.createEReferralRequestModel
.preferredBranchCode =
num.tryParse(projectDropdownValue.split(",")[0]);
this
.widget
.createEReferralRequestModel
.preferredBranchName =
projectDropdownValue.split(",")[1];
this
.widget
.createEReferralRequestModel
.otherRelationship = "";
await model.createEReferral(
this.widget.createEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message: "Referral sent successfully");
}
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
color: Color(0xff359846), color: Color(0xff359846),

@ -57,25 +57,29 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
return BaseView<EReferralViewModel>( return BaseView<EReferralViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
SearchEReferralRequestModel searchEReferralRequestModel = Future.delayed(new Duration(milliseconds: 300)).then((value) async {
new SearchEReferralRequestModel( GifLoaderDialogUtils.showMyDialog(context);
patientMobileNumber: (projectViewModel.user.outSA == 0 SearchEReferralRequestModel searchEReferralRequestModel =
? "966" new SearchEReferralRequestModel(
: "971") + patientMobileNumber: (projectViewModel.user.outSA == 0
projectViewModel.user.mobileNumber ? "966"
.substring(1, projectViewModel.user.mobileNumber.length), : "971") +
); projectViewModel.user.mobileNumber
if (selectedCriteria.value == 1) { .substring(1, projectViewModel.user.mobileNumber.length),
searchEReferralRequestModel.identificationNo = );
_searchTextController.text; if (selectedCriteria.value == 1) {
searchEReferralRequestModel.referralNumber = 0; searchEReferralRequestModel.identificationNo =
} else { _searchTextController.text;
searchEReferralRequestModel.referralNumber = searchEReferralRequestModel.referralNumber = 0;
int.parse(_searchTextController.text); } else {
searchEReferralRequestModel.identificationNo = searchEReferralRequestModel.referralNumber =
projectViewModel.user.patientIdentificationNo; int.parse(_searchTextController.text);
} searchEReferralRequestModel.identificationNo =
await model.getEReferrals(searchEReferralRequestModel); projectViewModel.user.patientIdentificationNo;
}
await model.getEReferrals(searchEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context);
});
} }
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(

Loading…
Cancel
Save