Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into get_pending_orders

 Conflicts:
	lib/core/viewModel/PatientRegistrationViewModel.dart
	lib/screens/patients/register_patient/RegisterPatientPage.dart
merge-requests/878/head
hussam al-habibeh 4 years ago
commit 9eadc0f0b1

@ -1,5 +1,5 @@
class AllSpecialLabResultModel { class AllSpecialLabResultModel {
int actualDoctorRate; dynamic actualDoctorRate;
dynamic admissionDate; dynamic admissionDate;
dynamic admissionNumber; dynamic admissionNumber;
dynamic appointmentDate; dynamic appointmentDate;

@ -14,6 +14,10 @@ class PatientRegistrationViewModel extends BaseViewModel {
PatientRegistrationService _patientRegistrationService = PatientRegistrationService _patientRegistrationService =
locator<PatientRegistrationService>(); locator<PatientRegistrationService>();
GetPatientInfoResponseModel get getPatientInfoResponseModel =>_patientRegistrationService.getPatientInfoResponseModel;
CheckPatientForRegistrationModel checkPatientForRegistrationModel ;
GetPatientInfoResponseModel get getPatientInfoResponseModel => GetPatientInfoResponseModel get getPatientInfoResponseModel =>
_patientRegistrationService.getPatientInfoResponseModel; _patientRegistrationService.getPatientInfoResponseModel;
@ -21,6 +25,8 @@ class PatientRegistrationViewModel extends BaseViewModel {
Future checkPatientForRegistration( Future checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async { CheckPatientForRegistrationModel registrationModel) async {
checkPatientForRegistrationModel = registrationModel; checkPatientForRegistrationModel = registrationModel;
checkPatientForRegistrationModel =CheckPatientForRegistrationModel.fromJson(registrationModel.toJson());
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _patientRegistrationService await _patientRegistrationService
.checkPatientForRegistration(registrationModel); .checkPatientForRegistration(registrationModel);
@ -34,6 +40,104 @@ class PatientRegistrationViewModel extends BaseViewModel {
Future getPatientInfo( Future getPatientInfo(
GetPatientInfoRequestModel getPatientInfoRequestModel) async { GetPatientInfoRequestModel getPatientInfoRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
/// TODO Elham* return call service when it working
_patientRegistrationService.getPatientInfoResponseModel = GetPatientInfoResponseModel.fromJson({
"Date": null,
"LanguageID": 0,
"ServiceName": 0,
"Time": null,
"AndroidLink": null,
"AuthenticationTokenID": null,
"Data": null,
"Dataw": false,
"DietType": 0,
"ErrorCode": null,
"ErrorEndUserMessage": null,
"ErrorEndUserMessageN": null,
"ErrorMessage": null,
"ErrorType": 0,
"FoodCategory": 0,
"IOSLink": null,
"IsAuthenticated": false,
"MealOrderStatus": 0,
"MealType": 0,
"MessageStatus": 1,
"NumberOfResultRecords": 0,
"PatientBlodType": null,
"SuccessMsg": null,
"SuccessMsgN": null,
"VidaUpdatedResponse": null,
"AccessTokenObject": null,
"Age": 33,
"ClientIdentifierId": null,
"CreatedBy": 0,
"DateOfBirth": "07/31/1988",
"FirstNameAr": "سفيان",
"FirstNameEn": "SUFIAN",
"Gender": "M",
"GenderAr": null,
"GenderEn": null,
"HealthId": "30000018540264",
"IdNumber": "1062938285",
"IdType": "NationalId",
"IsHijri": false,
"IsInstertedOrUpdated": 0,
"IsNull": 0,
"IsPatientExistNHIC": 0,
"IsRecordLockedByCurrentUser": false,
"LastNameAr": "عثمان",
"LastNameEn": "OTHMAN",
"List_ActiveAccessToken": null,
"MaritalStatus": "غير معروف",
"MaritalStatusCode": "U",
"NationalDateOfBirth": "18/12/1408",
"Nationality": "السعودية",
"NationalityCode": "SAU",
"Occupation": "طالب",
"PCDTransactionDataResultList": null,
"PCD_GetVidaPatientForManualVerificationList": null,
"PCD_NHIC_HMG_PatientDetailsMatchCalulationList": null,
"PCD_ReturnValue": 0,
"PatientStatus": "-",
"PlaceofBirth": "فينا",
"PractitionerStatusCode": null,
"PractitionerStatusDescAr": null,
"PractitionerStatusDescEn": null,
"RowCount": 0,
"SecondNameAr": "عبدالهادي",
"SecondNameEn": "ABDULHADI",
"ThirdNameAr": "احمد",
"ThirdNameEn": "A",
"YakeenVidaPatientDataStatisticsByPatientIdList": null,
"YakeenVidaPatientDataStatisticsList": null,
"YakeenVidaPatientDataStatisticsPrefferedList": null,
"accessToken": null,
"categoryCode": 0,
"categoryNameAr": null,
"categoryNameEn": null,
"constraintCode": 0,
"constraintNameAr": null,
"constraintNameEn": null,
"content": null,
"errorList": null,
"licenseExpiryDate": null,
"licenseIssuedDate": null,
"licenseStatusCode": null,
"licenseStatusDescAr": null,
"licenseStatusDescEn": null,
"organizations": null,
"registrationNumber": null,
"specialtyCode": 0,
"specialtyNameAr": null,
"specialtyNameEn": null
});
// await _patientRegistrationService.
// getPatientInfo(getPatientInfoRequestModel);
// if (_patientRegistrationService.hasError) {
// error = _patientRegistrationService.error;
// setState(ViewState.ErrorLocal);
// } else
// setState(ViewState.Idle);
await _patientRegistrationService await _patientRegistrationService
.getPatientInfo(getPatientInfoRequestModel); .getPatientInfo(getPatientInfoRequestModel);
if (_patientRegistrationService.hasError) { if (_patientRegistrationService.hasError) {

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -174,7 +175,9 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
clinic: model clinic: model
.allSpecialLabList[index].clinicDescription, .allSpecialLabList[index].clinicDescription,
appointmentDate: appointmentDate:
model.allSpecialLabList[index].orderDate, AppDateUtils.getDateTimeFromServerFormat(
model.allSpecialLabList[index].createdOn,
),
orderNo: model.allSpecialLabList[index].orderNo, orderNo: model.allSpecialLabList[index].orderNo,
isShowTime: false, isShowTime: false,
), ),

@ -56,11 +56,10 @@ class _RegisterConfirmationPatientPageState
extends State<RegisterConfirmationPatientPage> { extends State<RegisterConfirmationPatientPage> {
bool isSubmitted = false; bool isSubmitted = false;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
TextEditingController firstName = TextEditingController(text: "Elham"); TextEditingController firstName;
TextEditingController middleName = TextEditingController(text: "Ali"); TextEditingController middleName ;
TextEditingController lastName = TextEditingController(text: "Rababah"); TextEditingController lastName;
TextEditingController emailAddressController = TextEditingController emailAddressController;
TextEditingController(text: "Elham@Rababah.com");
@override @override
@ -132,7 +131,7 @@ class _RegisterConfirmationPatientPageState
fontSize: 12, fontSize: 12,
color: Colors.black), color: Colors.black),
AppText( AppText(
"123456", "${widget.model.getPatientInfoResponseModel.healthId}",
fontSize: 12, fontSize: 12,
color: Colors.grey[600], color: Colors.grey[600],
), ),
@ -148,7 +147,8 @@ class _RegisterConfirmationPatientPageState
fontSize: 12, fontSize: 12,
color: Colors.black), color: Colors.black),
AppText( AppText(
"ss", "${widget.model.getPatientInfoResponseModel.idNumber}",
fontSize: 12, fontSize: 12,
color: Colors.grey[600], color: Colors.grey[600],
), ),
@ -176,7 +176,7 @@ class _RegisterConfirmationPatientPageState
fontSize: 12, fontSize: 12,
color: Colors.black), color: Colors.black),
AppText( AppText(
"Jordanian", "${widget.model.getPatientInfoResponseModel.nationality}",
fontSize: 12, fontSize: 12,
color: Colors.grey[600], color: Colors.grey[600],
), ),
@ -192,7 +192,8 @@ class _RegisterConfirmationPatientPageState
fontSize: 12, fontSize: 12,
color: Colors.black), color: Colors.black),
AppText( AppText(
"--", "${widget.model.getPatientInfoResponseModel.occupation}",
fontSize: 12, fontSize: 12,
color: Colors.grey[600], color: Colors.grey[600],
), ),
@ -220,7 +221,8 @@ class _RegisterConfirmationPatientPageState
fontSize: 12, fontSize: 12,
color: Colors.black), color: Colors.black),
AppText( AppText(
"075XXXXXX", "${widget.model.checkPatientForRegistrationModel.patientMobileNumber}",
fontSize: 12, fontSize: 12,
color: Colors.grey[600], color: Colors.grey[600],
), ),

@ -99,6 +99,9 @@ class _RegisterPatientPageState extends State<RegisterPatientPage>
}, },
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,model: model),
RegisterConfirmationPatientPage(model: model,),
RegisterSearchPatientPage( RegisterSearchPatientPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
), ),

@ -22,8 +22,10 @@ import 'package:flutter/material.dart';
class RegisterSearchPatientPage extends StatefulWidget { class RegisterSearchPatientPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final PatientRegistrationViewModel model;
const RegisterSearchPatientPage({Key key, this.changePageViewIndex})
const RegisterSearchPatientPage({Key key, this.changePageViewIndex, this.model})
: super(key: key); : super(key: key);
@override @override
@ -50,9 +52,8 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<PatientRegistrationViewModel>( return AppScaffold(
builder: (_, model, w) => AppScaffold( baseViewModel: widget.model,
baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Column( body: Column(
children: [ children: [
@ -82,9 +83,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
? _selectedCountry['nameEn'] ? _selectedCountry['nameEn']
: "Saudi Arabia", : "Saudi Arabia",
enabled: false, enabled: false,
/*onClick: model.dietTypesList != null && model.dietTypesList.length > 0 /*onClick: widget.model.dietTypesList != null && widget.model.dietTypesList.length > 0
? () { ? () {
openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { openListDialogField('nameEn', 'id', widget.model.dietTypesList, (selectedValue) {
setState(() { setState(() {
_selectedCountry = selectedValue; _selectedCountry = selectedValue;
}); });
@ -95,14 +96,14 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
await model await model
.getDietTypes(patient.patientId) .getDietTypes(patient.patientId)
.then((_) => GifLoaderDialogUtils.hideDialog(context)); .then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.dietTypesList.length > 0) { if (widget.model.state == ViewState.Idle && widget.model.dietTypesList.length > 0) {
openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { openListDialogField('nameEn', 'id', widget.model.dietTypesList, (selectedValue) {
setState(() { setState(() {
_selectedCountry = selectedValue; _selectedCountry = selectedValue;
}); });
}); });
} else if (model.state == ViewState.ErrorLocal) { } else if (widget.model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(widget.model.error);
} else { } else {
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
@ -246,7 +247,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
generalid: GENERAL_ID, generalid: GENERAL_ID,
dOB: dOB:
"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}");
await model.checkPatientForRegistration( await widget.model.checkPatientForRegistration(
checkPatientForRegistrationModel); checkPatientForRegistrationModel);
GetPatientInfoRequestModel getPatientInfoRequestModel = GetPatientInfoRequestModel getPatientInfoRequestModel =
GetPatientInfoRequestModel( GetPatientInfoRequestModel(
@ -260,9 +261,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}"
); );
await model.getPatientInfo(getPatientInfoRequestModel); await widget.model.getPatientInfo(getPatientInfoRequestModel);
if (model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(widget.model.error);
} else { } else {
widget.changePageViewIndex(1); widget.changePageViewIndex(1);
} }
@ -275,7 +276,6 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
], ],
), ),
), ),
),
); );
} }

@ -692,7 +692,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1026,7 +1026,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1231,5 +1231,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.2 <2.11.0" dart: ">=2.10.2 <=2.11.0-213.1.beta"
flutter: ">=1.22.2 <2.0.0" flutter: ">=1.22.2 <2.0.0"

Loading…
Cancel
Save