Ereferral fixes, smartwatch health data integration

merge-requests/253/head
haroon amjad 4 years ago
parent 97b8aeeff5
commit 0181043da8

@ -1132,5 +1132,9 @@ const Map localizedValues = {
"en": "UPDATE THE APP",
"ar": "تحديث التطبيق"
},
"ereferralSaveSuccess": {
"en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process. Referral request no is ",
"ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية. رقم طلب الإحالة"
},
};

@ -0,0 +1,76 @@
class GetAllProjectsResponseModel {
String desciption;
Null desciptionN;
int iD;
String legalName;
String legalNameN;
String name;
Null nameN;
String phoneNumber;
String setupID;
int distanceInKilometers;
bool isActive;
String latitude;
String longitude;
int mainProjectID;
Null projectOutSA;
bool usingInDoctorApp;
GetAllProjectsResponseModel(
{this.desciption,
this.desciptionN,
this.iD,
this.legalName,
this.legalNameN,
this.name,
this.nameN,
this.phoneNumber,
this.setupID,
this.distanceInKilometers,
this.isActive,
this.latitude,
this.longitude,
this.mainProjectID,
this.projectOutSA,
this.usingInDoctorApp});
GetAllProjectsResponseModel.fromJson(Map<String, dynamic> json) {
desciption = json['Desciption'];
desciptionN = json['DesciptionN'];
iD = json['ID'];
legalName = json['LegalName'];
legalNameN = json['LegalNameN'];
name = json['Name'];
nameN = json['NameN'];
phoneNumber = json['PhoneNumber'];
setupID = json['SetupID'];
distanceInKilometers = json['DistanceInKilometers'];
isActive = json['IsActive'];
latitude = json['Latitude'];
longitude = json['Longitude'];
mainProjectID = json['MainProjectID'];
projectOutSA = json['ProjectOutSA'];
usingInDoctorApp = json['UsingInDoctorApp'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Desciption'] = this.desciption;
data['DesciptionN'] = this.desciptionN;
data['ID'] = this.iD;
data['LegalName'] = this.legalName;
data['LegalNameN'] = this.legalNameN;
data['Name'] = this.name;
data['NameN'] = this.nameN;
data['PhoneNumber'] = this.phoneNumber;
data['SetupID'] = this.setupID;
data['DistanceInKilometers'] = this.distanceInKilometers;
data['IsActive'] = this.isActive;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['MainProjectID'] = this.mainProjectID;
data['ProjectOutSA'] = this.projectOutSA;
data['UsingInDoctorApp'] = this.usingInDoctorApp;
return data;
}
}

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
@ -14,6 +15,9 @@ class EReferralService extends BaseService {
List<GetAllCitiesResponseModel> _allCities = List();
List<GetAllCitiesResponseModel> get allCities => _allCities;
List<GetAllProjectsResponseModel> _allProjects = List();
List<GetAllProjectsResponseModel> get allProjects => _allProjects;
List<SearchEReferralResponseModel> _allReferral = List();
List<SearchEReferralResponseModel> get allReferral => _allReferral;
String _activationCode;
@ -53,6 +57,20 @@ class EReferralService extends BaseService {
}, body: {});
}
Future getAllProjects() async {
await baseAppClient.post(GET_PROJECT,
onSuccess: (dynamic response, int statusCode) {
_allProjects.clear();
response['ListProject'].forEach((city) {
_allProjects
.add(GetAllProjectsResponseModel.fromJson(city));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {});
}
Future sendActivationCodeForEReferral(
SendActivationCodeForEReferralRequestModel
@ -60,6 +78,7 @@ class EReferralService extends BaseService {
hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_E_REFERRAL,
onSuccess: (dynamic response, int statusCode) {
print(response["VerificationCode"]);
_activationCode = response["VerificationCode"];
_logInTokenID = response["LogInTokenID"];
@ -86,19 +105,20 @@ class EReferralService extends BaseService {
}, body: checkActivationCodeForEReferralRequestModel.toJson());
}
Future createEReferral(
Future<dynamic> createEReferral(
CreateEReferralRequestModel createEReferralRequestModel
) async {
hasError = false;
dynamic localRes;
await baseAppClient.post(CREATE_E_REFERRAL/*'Services/Patients.svc/REST/CreateEReferral'*/,
onSuccess: (dynamic response, int statusCode) {
// TODO Waiting for fix service
var asd= ("EEEEEE");
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: createEReferralRequestModel.toJson());
return Future.value(localRes);
}
Future getEReferrals(

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
@ -18,64 +19,92 @@ class EReferralViewModel extends BaseViewModel {
List<GetAllRelationshipTypeResponseModel> get relationTypes =>
_eReferralService.relationTypes;
List<GetAllCitiesResponseModel> get allCities => _eReferralService.allCities;
List<SearchEReferralResponseModel> get allReferral => _eReferralService.allReferral;
List<GetAllProjectsResponseModel> get allHospitals =>
_eReferralService.allProjects;
List<SearchEReferralResponseModel> get allReferral =>
_eReferralService.allReferral;
void getRelationTypes() async {
void getRelationTypes() async {
setState(ViewState.Busy);
await _eReferralService.getRelationTypes();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else{
} else {
setState(ViewState.Idle);
}
}
void getAllCities() async {
void getAllCities() async {
setState(ViewState.Busy);
await _eReferralService.getAllCities();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else{
} else {
setState(ViewState.Idle);
}
}
void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async {
void getAllProjects() async {
setState(ViewState.Busy);
await _eReferralService.getAllProjects();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
void sendActivationCodeForEReferral(
SendActivationCodeForEReferralRequestModel
sendActivationCodeForEReferralRequestModel) async {
setState(ViewState.BusyLocal);
await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
await _eReferralService.sendActivationCodeForEReferral(
sendActivationCodeForEReferralRequestModel);
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else{
} else {
setState(ViewState.Idle);
}
}
checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async {
checkActivationCodeForEReferral(
CheckActivationCodeForEReferralResponseModel
checkActivationCodeForEReferralRequestModel) async {
setState(ViewState.BusyLocal);
await _eReferralService.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
await _eReferralService.checkActivationCodeForEReferral(
checkActivationCodeForEReferralRequestModel);
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else{
} else {
setState(ViewState.Idle);
}
}
void createEReferral(
Future<dynamic> createEReferral(
CreateEReferralRequestModel createEReferralRequestModel) async {
dynamic localRes;
setState(ViewState.BusyLocal);
await _eReferralService.createEReferral(createEReferralRequestModel);
await _eReferralService
.createEReferral(createEReferralRequestModel)
.then((response) {
localRes = response;
});
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
return Future.value(localRes);
}
getEReferrals(SearchEReferralRequestModel searchEReferralRequestModel) async {

@ -40,34 +40,32 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
),
),

@ -6,28 +6,29 @@ import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_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/e_referral_confirm_sms_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class NewEReferralStepOnePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
const NewEReferralStepOnePage(
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
: super(key: key);
@override
_NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState();
_NewEReferralStepOnePageState createState() =>
_NewEReferralStepOnePageState();
}
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
@ -64,27 +65,25 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
context: context,
barrierDismissible: false,
child: EReferralConfirmSMSDialog(
phoneNumber: _selectedCountry['code']+_mobileTextController.text,
onSucces: (){
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName=_nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD;
}
),
phoneNumber: _selectedCountry['code'] + _mobileTextController.text,
onSucces: () {
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName =
_nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo =
_selectedCountry['code'].toString().substring(1) +
_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship =
_selectedRelation.iD;
}),
).then((value) {
print("dialog dismissed");
print(value);
if (value != null && value) {
}
if (value != null && value) {}
});
}
return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getRelationTypes(),
builder: (_, model, widget) => AppScaffold(
@ -92,7 +91,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
margin: EdgeInsets.all(10),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
@ -100,11 +99,10 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
height: 80,
),
Center(
child: Texts(
// TranslationBase.of(context).advancePaymentLabel,
"Referral requester information",
textAlign: TextAlign.center,
),
@ -185,34 +183,30 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
),
),
bottomSheet: Container(
height: MediaQuery
.of(context)
.size
.height * 0.1,
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(9),
child: SecondaryButton(
textColor: Colors.white,
label: "Next",
onTap: () async {
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel =
SendActivationCodeForEReferralRequestModel(
onTap: () async {
SendActivationCodeForEReferralRequestModel
sendActivationCodeForEReferralRequestModel =
SendActivationCodeForEReferralRequestModel(
zipCode: _selectedCountry['code'],
patientMobileNumber: int.parse(
_mobileTextController.text),);
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
patientMobileNumber: int.parse(_mobileTextController.text),
);
await model.sendActivationCodeForEReferral(
sendActivationCodeForEReferralRequestModel);
showSMSDialog();
},
loading: model.state == ViewState.BusyLocal,
disabled:
_nameTextController.text.isEmpty ||
disabled: _nameTextController.text.isEmpty ||
_selectedRelation == null ||
_mobileTextController.text.isEmpty,
),
)));
}
void confirmSelectRelationTypeDialog(
@ -261,12 +255,8 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
}
class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled({
Key key,
this.controller,
this.code
}) : super(key: key);
const MobileNumberTextFiled({Key key, this.controller, this.code})
: super(key: key);
final TextEditingController controller;
final String code;

@ -1,21 +1,23 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_project_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../dialogs/select_city_dialog.dart';
class NewEReferralStepThreePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
@ -32,7 +34,8 @@ class NewEReferralStepThreePage extends StatefulWidget {
class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
TextEditingController _nameTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController();
GetAllCitiesResponseModel _selectedCity;
GetAllProjectsResponseModel _selectedHospital;
GetAllSharedRecordsByStatusList selectedPatientFamily;
List<EReferralAttachment> medicalReportImages = [];
@ -50,6 +53,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
@override
Widget build(BuildContext context) {
return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getAllProjects(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
@ -64,7 +68,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
height: 80,
),
Center(
child: Texts(
@ -103,8 +107,13 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
ImageOptions.showImageOptions(context,
(String image) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
medicalReportImages.add(eReferralAttachment);
EReferralAttachment eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
medicalReportImages
.add(eReferralAttachment);
});
});
},
@ -158,15 +167,17 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
width: 8,
),
Texts(
medicalReportImages[index].fileName,
medicalReportImages[index]
.fileName,
),
],
),
InkWell(
onTap: () {
setState(() {
medicalReportImages
.remove(medicalReportImages[index]);
medicalReportImages.remove(
medicalReportImages[
index]);
});
},
child: Icon(
@ -205,7 +216,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
InkWell(
onTap: () =>
confirmSelectCityDialog(model.allCities),
confirmSelectHospital(model.allHospitals),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
@ -262,12 +273,12 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
],
),
),
if(isPatientInsured)
SizedBox(
height: 12,
),
if (isPatientInsured)
SizedBox(
height: 12,
),
Opacity(
opacity: isPatientInsured?1:0,
opacity: isPatientInsured ? 1 : 0,
child: Container(
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
@ -276,16 +287,21 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
child: Column(
children: [
InkWell(
onTap: () {
ImageOptions.showImageOptions(context,
(String image) {
setState(() {
EReferralAttachment
eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
insuredPatientImages=[eReferralAttachment];
insuredPatientImages = [
eReferralAttachment
];
});
});
},
@ -333,8 +349,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Icon(
FontAwesomeIcons.paperclip),
Icon(FontAwesomeIcons
.paperclip),
SizedBox(
width: 8,
),
@ -346,8 +362,9 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
InkWell(
onTap: () {
setState(() {
insuredPatientImages
.remove(insuredPatientImages[index]);
insuredPatientImages.remove(
insuredPatientImages[
index]);
});
},
child: Icon(
@ -378,50 +395,72 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
textColor: Colors.white,
label: "Submit",
onTap: () async {
this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages;
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null;
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
this
.widget
.createEReferralRequestModel
.medicalReportAttachment = medicalReportImages;
this
.widget
.createEReferralRequestModel
.insuranceCardAttachment =
insuredPatientImages.length != 0
? insuredPatientImages[0]
: null;
this.widget.createEReferralRequestModel.isInsuredPatient =
isPatientInsured;
// ToDo make the preferred Branch info dynamic
this.widget.createEReferralRequestModel.preferredBranchCode = 15;
this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
this.widget.createEReferralRequestModel.preferredBranchCode =
_selectedHospital.iD;
this.widget.createEReferralRequestModel.preferredBranchName =
_selectedHospital.desciption;
this.widget.createEReferralRequestModel.otherRelationship =
"";
// this.widget.createEReferralRequestModel.fullName= "";
this.widget.createEReferralRequestModel.otherRelationship= "";
// this.widget.createEReferralRequestModel.;
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
await model.createEReferral(this.widget.createEReferralRequestModel);
await model
.createEReferral(this.widget.createEReferralRequestModel)
.then((value) {
AlertDialogBox(
context: context,
confirmMessage:
TranslationBase.of(context).ereferralSaveSuccess +
value['ReferralNumber'].toString(),
okText: TranslationBase.of(context).ok,
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
navigateToHome(context);
}).showAlertDialog(context);
});
},
loading: model.state == ViewState.BusyLocal,
disabled: medicalReportImages.length == 0 ,
disabled: medicalReportImages.length == 0,
),
)));
}
void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
Future navigateToHome(context) async {
Navigator.of(context).popAndPushNamed(HOME);
}
void confirmSelectHospital(List<GetAllProjectsResponseModel> projects) {
showDialog(
context: context,
child: SelectCityDialog(
cities: cities,
selectedCity: _selectedCity,
child: SelectHospitalDialog(
hospitals: projects,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedCity = value;
_selectedHospital = value;
});
},
),
);
}
String getRelationName() {
if (_selectedCity != null)
return _selectedCity.description;
if (_selectedHospital != null)
return _selectedHospital.desciption;
else
return "Select Relationship" /*TranslationBase.of(context).selectHospital*/;
return "Select Hospital*" /*TranslationBase.of(context).selectHospital*/;
}
}

@ -71,7 +71,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 30,
height: 80,
),
Center(
child: Texts(

@ -0,0 +1,129 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
class SelectHospitalDialog extends StatefulWidget {
final List<GetAllProjectsResponseModel> hospitals;
final Function(GetAllProjectsResponseModel) onValueSelected;
GetAllProjectsResponseModel selectedHospital;
SelectHospitalDialog(
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState();
}
class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
@override
void initState() {
super.initState();
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.hospitals.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedHospital = widget.hospitals[index];
});
},
child: ListTile(
title: Text(widget.hospitals[index].desciption),
leading: Radio(
value: widget.hospitals[index],
groupValue: widget.selectedHospital,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedHospital = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedHospital);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
],
)
],
);
}
}

@ -88,13 +88,13 @@ class _EReferralPageState extends State<EReferralPage>
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts("New Referral"),
child: Texts("New Referral", fontSize: 14.0),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts("Search for Referrals"),
child: Texts("Search for Referrals", fontSize: 14.0),
),
),
],

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
class HealthDataList extends StatefulWidget {
@ -8,6 +9,19 @@ class HealthDataList extends StatefulWidget {
}
class _HealthDataListState extends State<HealthDataList> {
List<DataType> dataTypes = List();
@override
void initState() {
dataTypes.add(DataType.DISTANCE);
dataTypes.add(DataType.STEP_COUNT);
dataTypes.add(DataType.HEART_RATE);
dataTypes.add(DataType.SLEEP);
dataTypes.add(DataType.ENERGY);
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -132,7 +146,7 @@ class _HealthDataListState extends State<HealthDataList> {
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
// launch(model.radImageURL);
readAll();
},
label: 'Sync Health Data',
backgroundColor: Colors.grey[800],
@ -142,4 +156,26 @@ class _HealthDataListState extends State<HealthDataList> {
),
));
}
void readLast() async {
final result = await FitKit.readLast(DataType.DISTANCE);
print(result);
print(result);
}
void readAll() async {
if (await FitKit.requestPermissions(dataTypes)) {
for (DataType type in dataTypes) {
final results = await FitKit.read(
type,
dateFrom: DateTime.now().subtract(Duration(days: 15)),
dateTo: DateTime.now(),
limit: 100,
);
print(results);
print(results.length);
}
readLast();
}
}
}

@ -31,6 +31,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
return AppScaffold(
appBarTitle: "Sync Health Data",
isShowAppBar: true,
isShowDecPage: false,
body: Container(
child: Platform.isIOS
? _getAppleWatchInstructions()
@ -88,6 +89,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 1",
style: TextStyle(
@ -108,8 +111,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 2",
overflow: TextOverflow.clip,
softWrap: true,
style: TextStyle(
fontSize: 12.0)),
)
@ -135,6 +142,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 3",
style: TextStyle(
@ -155,6 +164,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 4",
style: TextStyle(
@ -182,6 +193,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 5",
style: TextStyle(
@ -202,6 +215,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 6",
style: TextStyle(
@ -427,7 +442,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 0.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -657,7 +672,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(15.0),
margin: EdgeInsets.all(12.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:

@ -46,7 +46,7 @@ class VitalSignItem extends StatelessWidget {
des,
style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
color: HexColor('#B8382C'),
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold,
),
),
@ -76,11 +76,11 @@ class VitalSignItem extends StatelessWidget {
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(text: lastVal),
TextSpan(text: lastVal + " "),
TextSpan(
text: unit,
style: TextStyle(
color: HexColor('#B8382C'),
color: Theme.of(context).textTheme.headline1.color,
),
),
]),

@ -65,6 +65,7 @@ final blueBackground = Color(0xFFFFFFFF);
},
),
hintColor: Colors.grey[400],
accentColor: Color(0xffB8382C),
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),

@ -890,6 +890,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get descriptionVaccination => localizedValues['description-vaccination'][locale.languageCode];
String get dueDate => localizedValues['due-date'][locale.languageCode];
String get appUpdate => localizedValues['appUpdate'][locale.languageCode];
String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode];
}

@ -15,7 +15,7 @@ class ImageOptions {
return _BottomSheet(
children: <Widget>[
_BottomSheetItem(
title: "Select file souse",
title: "Select file source",
),
_BottomSheetItem(
title: "Gallery",

Loading…
Cancel
Save