|
|
|
@ -6,8 +6,8 @@ import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientFo
|
|
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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/app_texts_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
@ -23,13 +23,10 @@ class RegisterSearchPatientPage extends StatefulWidget {
|
|
|
|
final Function? changePageViewIndex;
|
|
|
|
final Function? changePageViewIndex;
|
|
|
|
final PatientRegistrationViewModel? model;
|
|
|
|
final PatientRegistrationViewModel? model;
|
|
|
|
|
|
|
|
|
|
|
|
const RegisterSearchPatientPage(
|
|
|
|
const RegisterSearchPatientPage({Key? key, this.changePageViewIndex, this.model}) : super(key: key);
|
|
|
|
{Key? key, this.changePageViewIndex, this.model})
|
|
|
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_RegisterSearchPatientPageState createState() =>
|
|
|
|
_RegisterSearchPatientPageState createState() => _RegisterSearchPatientPageState();
|
|
|
|
_RegisterSearchPatientPageState();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
@ -42,14 +39,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
|
|
|
|
|
|
|
|
bool isSubmitted = false;
|
|
|
|
bool isSubmitted = false;
|
|
|
|
|
|
|
|
|
|
|
|
TextEditingController _phoneController =
|
|
|
|
TextEditingController _phoneController = TextEditingController(text: "508079569");
|
|
|
|
TextEditingController(text: "508079569");
|
|
|
|
|
|
|
|
TextEditingController _phoneCode = TextEditingController(text: "966");
|
|
|
|
TextEditingController _phoneCode = TextEditingController(text: "966");
|
|
|
|
|
|
|
|
|
|
|
|
String phoneError = '';
|
|
|
|
String phoneError = '';
|
|
|
|
|
|
|
|
|
|
|
|
TextEditingController _idController =
|
|
|
|
TextEditingController _idController = TextEditingController(text: "1062938285");
|
|
|
|
TextEditingController(text: "1062938285");
|
|
|
|
|
|
|
|
String idError = '';
|
|
|
|
String idError = '';
|
|
|
|
|
|
|
|
|
|
|
|
DateTime? _birthDateInGregorian;
|
|
|
|
DateTime? _birthDateInGregorian;
|
|
|
|
@ -111,9 +106,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final screenSize = MediaQuery
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// TODO Elham* add transaltion
|
|
|
|
/// TODO Elham* add transaltion
|
|
|
|
|
|
|
|
|
|
|
|
@ -131,9 +124,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).askForIdentification,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.askForIdentification,
|
|
|
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 2.2,
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 2.2,
|
|
|
|
fontWeight: FontWeight.w800,
|
|
|
|
fontWeight: FontWeight.w800,
|
|
|
|
@ -163,19 +154,17 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: MediaQuery
|
|
|
|
width: MediaQuery.of(context).size.width * 0.28,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width * 0.28,
|
|
|
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
hintText: TranslationBase
|
|
|
|
hintText: TranslationBase.of(context).codeNo,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.codeNo,
|
|
|
|
|
|
|
|
inputType: TextInputType.phone,
|
|
|
|
inputType: TextInputType.phone,
|
|
|
|
controller: _phoneCode,
|
|
|
|
controller: _phoneCode,
|
|
|
|
validationError: phoneError,
|
|
|
|
validationError: phoneError,
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
|
|
|
|
onClick: () {},
|
|
|
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (_phoneController.text.isEmpty && isSubmitted)
|
|
|
|
if (_phoneController.text.isEmpty && isSubmitted)
|
|
|
|
@ -192,17 +181,13 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
// width: MediaQuery.of(context).size.width*0.7,
|
|
|
|
// width: MediaQuery.of(context).size.width*0.7,
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
hintText: TranslationBase
|
|
|
|
hintText: TranslationBase.of(context).phoneNumber,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.phoneNumber,
|
|
|
|
|
|
|
|
inputType: TextInputType.phone,
|
|
|
|
inputType: TextInputType.phone,
|
|
|
|
controller: _phoneController,
|
|
|
|
controller: _phoneController,
|
|
|
|
validationError:
|
|
|
|
validationError: _phoneController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
|
|
|
|
_phoneController.text.isEmpty && isSubmitted
|
|
|
|
onClick: () {},
|
|
|
|
? TranslationBase
|
|
|
|
onChanged: (value) {},
|
|
|
|
.of(context)
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
.emptyMessage
|
|
|
|
|
|
|
|
: "",
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -213,24 +198,19 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AppTextFieldCustom(
|
|
|
|
AppTextFieldCustom(
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
hintText: TranslationBase
|
|
|
|
hintText: TranslationBase.of(context).iDNumber,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.iDNumber,
|
|
|
|
|
|
|
|
inputType: TextInputType.phone,
|
|
|
|
inputType: TextInputType.phone,
|
|
|
|
controller: _idController,
|
|
|
|
controller: _idController,
|
|
|
|
validationError: _idController.text.isEmpty && isSubmitted
|
|
|
|
validationError: _idController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
|
|
|
|
? TranslationBase
|
|
|
|
onClick: () {},
|
|
|
|
.of(context)
|
|
|
|
onChanged: (value) {},
|
|
|
|
.emptyMessage
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
: "",
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 12,
|
|
|
|
height: 12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).calender,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.calender,
|
|
|
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.8,
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.8,
|
|
|
|
fontWeight: FontWeight.w800,
|
|
|
|
fontWeight: FontWeight.w800,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -241,10 +221,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: RadioListTile<CalenderType>(
|
|
|
|
child: RadioListTile<CalenderType>(
|
|
|
|
title:
|
|
|
|
title: AppText(TranslationBase.of(context).gregorian),
|
|
|
|
AppText(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.gregorian),
|
|
|
|
|
|
|
|
value: CalenderType.Gregorian,
|
|
|
|
value: CalenderType.Gregorian,
|
|
|
|
groupValue: calenderType,
|
|
|
|
groupValue: calenderType,
|
|
|
|
onChanged: (CalenderType? value) {
|
|
|
|
onChanged: (CalenderType? value) {
|
|
|
|
@ -256,9 +233,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: RadioListTile<CalenderType>(
|
|
|
|
child: RadioListTile<CalenderType>(
|
|
|
|
title: AppText(TranslationBase
|
|
|
|
title: AppText(TranslationBase.of(context).hijri),
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.hijri),
|
|
|
|
|
|
|
|
value: CalenderType.Hijri,
|
|
|
|
value: CalenderType.Hijri,
|
|
|
|
groupValue: calenderType,
|
|
|
|
groupValue: calenderType,
|
|
|
|
onChanged: (CalenderType? value) {
|
|
|
|
onChanged: (CalenderType? value) {
|
|
|
|
@ -275,18 +250,11 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AppTextFieldCustom(
|
|
|
|
AppTextFieldCustom(
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
hintText: TranslationBase
|
|
|
|
hintText: TranslationBase.of(context).birthdate,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.birthdate,
|
|
|
|
|
|
|
|
dropDownText: getBirthdate(),
|
|
|
|
dropDownText: getBirthdate(),
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
validationError:
|
|
|
|
validationError: _birthDateInGregorian == null && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
|
|
|
|
_birthDateInGregorian == null && isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.emptyMessage
|
|
|
|
|
|
|
|
: "",
|
|
|
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
icon: Icon(
|
|
|
|
icon: Icon(
|
|
|
|
Icons.calendar_today,
|
|
|
|
Icons.calendar_today,
|
|
|
|
@ -298,8 +266,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
if (_birthDateInGregorian == null) {
|
|
|
|
if (_birthDateInGregorian == null) {
|
|
|
|
_birthDateInGregorian = DateTime.now();
|
|
|
|
_birthDateInGregorian = DateTime.now();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_selectDate(context, _birthDateInGregorian!,
|
|
|
|
_selectDate(context, _birthDateInGregorian!, (dynamic selectedDate) {
|
|
|
|
(dynamic selectedDate) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
birthDateInHijri = selectedDate;
|
|
|
|
birthDateInHijri = selectedDate;
|
|
|
|
@ -310,12 +277,8 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
// birthDateInHijri.hDay);
|
|
|
|
// birthDateInHijri.hDay);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
_birthDateInGregorian = DateTime.parse(JHijri(
|
|
|
|
_birthDateInGregorian =
|
|
|
|
fDay: birthDateInHijri.jhijri!.day,
|
|
|
|
DateTime.parse(JHijri(fDay: birthDateInHijri.jhijri!.day, fMonth: birthDateInHijri.jhijri!.month, fYear: birthDateInHijri.jhijri!.year).toString());
|
|
|
|
fMonth: birthDateInHijri.jhijri!.month,
|
|
|
|
|
|
|
|
fYear: birthDateInHijri.jhijri!.year)
|
|
|
|
|
|
|
|
.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(_birthDateInGregorian);
|
|
|
|
print(_birthDateInGregorian);
|
|
|
|
print(birthDateInHijri);
|
|
|
|
print(birthDateInHijri);
|
|
|
|
@ -327,8 +290,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
// selectedDate.month,
|
|
|
|
// selectedDate.month,
|
|
|
|
// selectedDate.day) as HijriCalendar;
|
|
|
|
// selectedDate.day) as HijriCalendar;
|
|
|
|
|
|
|
|
|
|
|
|
birthDateInHijri =
|
|
|
|
birthDateInHijri = JDateModel(dateTime: selectedDate);
|
|
|
|
JDateModel(dateTime: selectedDate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(_birthDateInGregorian);
|
|
|
|
print(_birthDateInGregorian);
|
|
|
|
print(birthDateInHijri.dateTime);
|
|
|
|
print(birthDateInHijri.dateTime);
|
|
|
|
@ -337,6 +299,8 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 70,
|
|
|
|
height: 70,
|
|
|
|
@ -356,9 +320,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: AppButton(
|
|
|
|
child: AppButton(
|
|
|
|
title: TranslationBase
|
|
|
|
title: TranslationBase.of(context).cancel,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.cancel,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
hasBorder: true,
|
|
|
|
// vPadding: 12,
|
|
|
|
// vPadding: 12,
|
|
|
|
hPadding: 8,
|
|
|
|
hPadding: 8,
|
|
|
|
@ -377,9 +339,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: AppButton(
|
|
|
|
child: AppButton(
|
|
|
|
title: TranslationBase
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.next,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
hasBorder: true,
|
|
|
|
borderColor: Color(0xFFB8382B),
|
|
|
|
borderColor: Color(0xFFB8382B),
|
|
|
|
color: AppGlobal.appRedColor,
|
|
|
|
color: AppGlobal.appRedColor,
|
|
|
|
@ -389,21 +349,15 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
isSubmitted = true;
|
|
|
|
isSubmitted = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (country == null) {
|
|
|
|
if (country == null) {
|
|
|
|
countryError = TranslationBase
|
|
|
|
countryError = TranslationBase.of(context).fieldRequired;
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.fieldRequired;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
countryError = "";
|
|
|
|
countryError = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isFormValid()) {
|
|
|
|
if (isFormValid()) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
CheckPatientForRegistrationModel
|
|
|
|
CheckPatientForRegistrationModel checkPatientForRegistrationModel = CheckPatientForRegistrationModel(
|
|
|
|
checkPatientForRegistrationModel =
|
|
|
|
patientIdentificationID: int.parse(_idController.text),
|
|
|
|
CheckPatientForRegistrationModel(
|
|
|
|
patientMobileNumber: int.parse(_phoneController.text),
|
|
|
|
patientIdentificationID:
|
|
|
|
|
|
|
|
int.parse(_idController.text),
|
|
|
|
|
|
|
|
patientMobileNumber:
|
|
|
|
|
|
|
|
int.parse(_phoneController.text),
|
|
|
|
|
|
|
|
zipCode: _phoneCode.text,
|
|
|
|
zipCode: _phoneCode.text,
|
|
|
|
isHijri: 0,
|
|
|
|
isHijri: 0,
|
|
|
|
patientID: 0,
|
|
|
|
patientID: 0,
|
|
|
|
@ -411,14 +365,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
isDentalAllowedBackend: false,
|
|
|
|
isDentalAllowedBackend: false,
|
|
|
|
patientOutSA: 0,
|
|
|
|
patientOutSA: 0,
|
|
|
|
generalid: GENERAL_ID,
|
|
|
|
generalid: GENERAL_ID,
|
|
|
|
dOB:
|
|
|
|
dOB: "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}");
|
|
|
|
"${AppDateUtils.convertStringToDateFormat(
|
|
|
|
await widget.model!.checkPatientForRegistration(checkPatientForRegistrationModel);
|
|
|
|
_birthDateInGregorian.toString(),
|
|
|
|
GetPatientInfoRequestModel getPatientInfoRequestModel = GetPatientInfoRequestModel(
|
|
|
|
"yyyy/MM/dd")}");
|
|
|
|
|
|
|
|
await widget.model!.checkPatientForRegistration(
|
|
|
|
|
|
|
|
checkPatientForRegistrationModel);
|
|
|
|
|
|
|
|
GetPatientInfoRequestModel getPatientInfoRequestModel =
|
|
|
|
|
|
|
|
GetPatientInfoRequestModel(
|
|
|
|
|
|
|
|
//TODO Elham* this return the static to dynamic
|
|
|
|
//TODO Elham* this return the static to dynamic
|
|
|
|
patientIdentificationID: "1062938285",
|
|
|
|
patientIdentificationID: "1062938285",
|
|
|
|
// _idController.text,
|
|
|
|
// _idController.text,
|
|
|
|
@ -427,14 +376,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
patientOutSA: 0,
|
|
|
|
patientOutSA: 0,
|
|
|
|
generalid: GENERAL_ID,
|
|
|
|
generalid: GENERAL_ID,
|
|
|
|
sessionID: null,
|
|
|
|
sessionID: null,
|
|
|
|
dOB:
|
|
|
|
dOB: "31/07/1988", //"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}"
|
|
|
|
"31/07/1988", //"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}"
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if (widget.model!.state == ViewState.ErrorLocal) {
|
|
|
|
if (widget.model!.state == ViewState.ErrorLocal) {
|
|
|
|
Utils.showErrorToast(widget.model!.error);
|
|
|
|
Utils.showErrorToast(widget.model!.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
await widget.model!
|
|
|
|
await widget.model!.getPatientInfo(getPatientInfoRequestModel);
|
|
|
|
.getPatientInfo(getPatientInfoRequestModel);
|
|
|
|
|
|
|
|
if (widget.model!.state == ViewState.ErrorLocal) {
|
|
|
|
if (widget.model!.state == ViewState.ErrorLocal) {
|
|
|
|
Utils.showErrorToast(widget.model!.error);
|
|
|
|
Utils.showErrorToast(widget.model!.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -454,18 +401,13 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
isFormValid() {
|
|
|
|
isFormValid() {
|
|
|
|
if (_phoneController.text != null &&
|
|
|
|
if (_phoneController.text != null && _phoneController.text.isNotEmpty && _idController.text != null && _idController.text.isNotEmpty && _birthDateInGregorian != null) {
|
|
|
|
_phoneController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
_idController.text != null &&
|
|
|
|
|
|
|
|
_idController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
_birthDateInGregorian != null) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future _selectDate(BuildContext context, DateTime dateTime,
|
|
|
|
Future _selectDate(BuildContext context, DateTime dateTime, Function(dynamic) updateDate) async {
|
|
|
|
Function(dynamic) updateDate) async {
|
|
|
|
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
JDateModel hijriDate = JDateModel(dateTime: DateTime.now());
|
|
|
|
JDateModel hijriDate = JDateModel(dateTime: DateTime.now());
|
|
|
|
final JPickerValue? pickedH = await showGlobalDatePicker(
|
|
|
|
final JPickerValue? pickedH = await showGlobalDatePicker(
|
|
|
|
@ -487,9 +429,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
final DateTime? picked = await showDatePicker(
|
|
|
|
final DateTime? picked = await showDatePicker(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
initialDate: dateTime ?? DateTime.now(),
|
|
|
|
initialDate: dateTime ?? DateTime.now(),
|
|
|
|
firstDate: DateTime(DateTime
|
|
|
|
firstDate: DateTime(DateTime.now().year - 150),
|
|
|
|
.now()
|
|
|
|
|
|
|
|
.year - 150),
|
|
|
|
|
|
|
|
lastDate: DateTime.now(),
|
|
|
|
lastDate: DateTime.now(),
|
|
|
|
initialEntryMode: DatePickerEntryMode.calendar,
|
|
|
|
initialEntryMode: DatePickerEntryMode.calendar,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -499,16 +439,13 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void openListDialogField(String attributeName, String attributeValueId,
|
|
|
|
void openListDialogField(String attributeName, String attributeValueId, List<dynamic> list, Function(dynamic selectedValue) okFunction) {
|
|
|
|
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
|
|
|
|
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
list: list,
|
|
|
|
list: list,
|
|
|
|
attributeName: attributeName,
|
|
|
|
attributeName: attributeName,
|
|
|
|
attributeValueId: attributeValueId,
|
|
|
|
attributeValueId: attributeValueId,
|
|
|
|
usingSearch: true,
|
|
|
|
usingSearch: true,
|
|
|
|
okText: TranslationBase
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.ok,
|
|
|
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction(selectedValue);
|
|
|
|
okFunction(selectedValue);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -526,10 +463,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
if (calenderType == CalenderType.Hijri) {
|
|
|
|
return birthDateInHijri != null ? "$birthDateInHijri" : null;
|
|
|
|
return birthDateInHijri != null ? "$birthDateInHijri" : null;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return _birthDateInGregorian != null
|
|
|
|
return _birthDateInGregorian != null ? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}" : null;
|
|
|
|
? "${AppDateUtils.convertStringToDateFormat(
|
|
|
|
|
|
|
|
_birthDateInGregorian.toString(), "yyyy/MM/dd")}"
|
|
|
|
|
|
|
|
: null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|