|
|
|
|
@ -65,15 +65,26 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(doctorProfiles[0]);
|
|
|
|
|
print(doctorProfile.doctorName);
|
|
|
|
|
if (_formKey.currentState.validate()) {
|
|
|
|
|
// If all data are correct then save data to out variables
|
|
|
|
|
// _formKey.currentState.save();
|
|
|
|
|
sharedPref.setString(TOKEN,'@dm!n');
|
|
|
|
|
sharedPref.setString(SLECTED_PATIENT_TYPE,_selectedType);
|
|
|
|
|
//*****If all data are correct then save data to out variables****
|
|
|
|
|
|
|
|
|
|
_patientSearchFormValues.setFrom = "0";
|
|
|
|
|
_patientSearchFormValues.setTo = "0";
|
|
|
|
|
print("***************Check validate1*************");
|
|
|
|
|
|
|
|
|
|
print(_patientSearchFormValues.getFirstName.trim().length);
|
|
|
|
|
print("***************Check validate2*************");
|
|
|
|
|
_formKey.currentState.save();
|
|
|
|
|
_patientSearchFormValues.setFrom = "0";
|
|
|
|
|
_patientSearchFormValues.setTo = "0";
|
|
|
|
|
|
|
|
|
|
//*********************************** */
|
|
|
|
|
sharedPref.setString(TOKEN, '@dm!n');
|
|
|
|
|
sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
|
|
|
|
|
print('_selectedType${_selectedType}');
|
|
|
|
|
String token = await sharedPref.getString(TOKEN);
|
|
|
|
|
int projectID = await sharedPref.getInt(PROJECT_ID);
|
|
|
|
|
_patientSearchFormValues.TokenID = token;
|
|
|
|
|
_patientSearchFormValues.ProjectID = 15;//projectID;
|
|
|
|
|
_patientSearchFormValues.ProjectID = 15; //projectID;
|
|
|
|
|
// print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf");
|
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS, arguments: {
|
|
|
|
|
"patientSearchForm": _patientSearchFormValues,
|
|
|
|
|
@ -176,7 +187,19 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
hintText: 'First Name',
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.FirstName = value;
|
|
|
|
|
// _patientSearchFormValues.FirstName = value;
|
|
|
|
|
value == null
|
|
|
|
|
? _patientSearchFormValues.setFirstName =
|
|
|
|
|
"0"
|
|
|
|
|
: _patientSearchFormValues.setFirstName =
|
|
|
|
|
value;
|
|
|
|
|
print("**********Value********");
|
|
|
|
|
print(value.toString().trim().isEmpty);
|
|
|
|
|
print("**********Value********");
|
|
|
|
|
if (value.toString().trim().isEmpty) {
|
|
|
|
|
|
|
|
|
|
_patientSearchFormValues.setFirstName = "0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
@ -188,7 +211,19 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
hintText: 'Middle Name',
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.MiddleName = value;
|
|
|
|
|
//_patientSearchFormValues.MiddleName = value;
|
|
|
|
|
|
|
|
|
|
value == null
|
|
|
|
|
? _patientSearchFormValues.setMiddleName =
|
|
|
|
|
"0"
|
|
|
|
|
: _patientSearchFormValues.setMiddleName =
|
|
|
|
|
value;
|
|
|
|
|
|
|
|
|
|
// value.toString().trim().isEmpty
|
|
|
|
|
// ? _patientSearchFormValues.setMiddleName =
|
|
|
|
|
// "0"
|
|
|
|
|
// : _patientSearchFormValues.setMiddleName =
|
|
|
|
|
// value;
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
@ -200,7 +235,16 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
hintText: 'Last Name',
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.LastName = value;
|
|
|
|
|
// _patientSearchFormValues.LastName = value;
|
|
|
|
|
value == null
|
|
|
|
|
? _patientSearchFormValues.setLastName = "0"
|
|
|
|
|
: _patientSearchFormValues.setLastName =
|
|
|
|
|
value;
|
|
|
|
|
|
|
|
|
|
// value.toString().trim().isEmpty
|
|
|
|
|
// ? _patientSearchFormValues.setLastName = "0"
|
|
|
|
|
// : _patientSearchFormValues.setLastName =
|
|
|
|
|
// value;
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
@ -217,8 +261,13 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.PatientMobileNumber =
|
|
|
|
|
value;
|
|
|
|
|
value == null
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = value;
|
|
|
|
|
// _patientSearchFormValues.PatientMobileNumber =
|
|
|
|
|
// value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
@ -230,7 +279,12 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
//
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.PatientID = 89000;
|
|
|
|
|
// _patientSearchFormValues.PatientID = 89000;
|
|
|
|
|
|
|
|
|
|
value == null
|
|
|
|
|
? _patientSearchFormValues.setPatientID = 0
|
|
|
|
|
: _patientSearchFormValues.setPatientID =
|
|
|
|
|
int.parse(value);
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
|