|
|
|
@ -44,7 +44,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
bool _autoValidate = false;
|
|
|
|
bool _autoValidate = false;
|
|
|
|
bool onlyArrived = true;
|
|
|
|
bool onlyArrived = true;
|
|
|
|
|
|
|
|
|
|
|
|
bool isFormSubmitted = false;
|
|
|
|
bool isFormSubmitted = false;
|
|
|
|
|
|
|
|
|
|
|
|
FocusNode _nodeText1 = FocusNode();
|
|
|
|
FocusNode _nodeText1 = FocusNode();
|
|
|
|
FocusNode _nodeText2 = FocusNode();
|
|
|
|
FocusNode _nodeText2 = FocusNode();
|
|
|
|
@ -70,23 +70,24 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
PatientOutSA: false);
|
|
|
|
PatientOutSA: false);
|
|
|
|
|
|
|
|
|
|
|
|
void _validateInputs() async {
|
|
|
|
void _validateInputs() async {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isFormSubmitted = true;
|
|
|
|
isFormSubmitted = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (_formKey.currentState.validate()) {
|
|
|
|
if (_formKey.currentState.validate()) {
|
|
|
|
_formKey.currentState.save();
|
|
|
|
_formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
|
|
if ((_patientSearchFormValues.From == "0" ||
|
|
|
|
if ((_patientSearchFormValues.From == "0" ||
|
|
|
|
_patientSearchFormValues.To == "0") &&
|
|
|
|
_patientSearchFormValues.To == "0") &&
|
|
|
|
_selectedType == "7" || ((_patientSearchFormValues.From == "0" ||
|
|
|
|
_selectedType == "7" ||
|
|
|
|
_patientSearchFormValues.To == "0") &&
|
|
|
|
((_patientSearchFormValues.From == "0" ||
|
|
|
|
_selectedType == "6") ) {
|
|
|
|
_patientSearchFormValues.To == "0") &&
|
|
|
|
|
|
|
|
_selectedType == "6")) {
|
|
|
|
// helpers.showErrorToast("Please Choose The Dates");
|
|
|
|
// helpers.showErrorToast("Please Choose The Dates");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isFormSubmitted = false;
|
|
|
|
isFormSubmitted = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS, arguments: {
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS, arguments: {
|
|
|
|
"patientSearchForm": _patientSearchFormValues,
|
|
|
|
"patientSearchForm": _patientSearchFormValues,
|
|
|
|
@ -116,11 +117,12 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
projectsProvider = Provider.of(context);
|
|
|
|
projectsProvider = Provider.of(context);
|
|
|
|
return GestureDetector(
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: (){
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: AppScaffold(
|
|
|
|
child: AppScaffold(
|
|
|
|
appBarTitle: TranslationBase.of(context).searchPatient,
|
|
|
|
appBarTitle: TranslationBase.of(context).searchPatient,
|
|
|
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
body: ListView(
|
|
|
|
body: ListView(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
RoundedContainer(
|
|
|
|
RoundedContainer(
|
|
|
|
@ -262,14 +264,15 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
borderColor: Colors.white,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
onSaved: (value) {
|
|
|
|
onSaved: (value) {
|
|
|
|
value == null || value == ''
|
|
|
|
value == null || value == ''
|
|
|
|
? _patientSearchFormValues.setFirstName =
|
|
|
|
? _patientSearchFormValues
|
|
|
|
"0"
|
|
|
|
.setFirstName = "0"
|
|
|
|
: _patientSearchFormValues.setFirstName =
|
|
|
|
: _patientSearchFormValues
|
|
|
|
value;
|
|
|
|
.setFirstName = value;
|
|
|
|
|
|
|
|
|
|
|
|
if (value != null &&
|
|
|
|
if (value != null &&
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
_patientSearchFormValues.setFirstName = "0";
|
|
|
|
_patientSearchFormValues.setFirstName =
|
|
|
|
|
|
|
|
"0";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// validator: (value) {
|
|
|
|
// validator: (value) {
|
|
|
|
@ -293,16 +296,14 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
borderColor: Colors.white,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
onSaved: (value) {
|
|
|
|
onSaved: (value) {
|
|
|
|
value == null || value == ''
|
|
|
|
value == null || value == ''
|
|
|
|
? _patientSearchFormValues.setMiddleName =
|
|
|
|
? _patientSearchFormValues
|
|
|
|
"0"
|
|
|
|
.setMiddleName = "0"
|
|
|
|
: _patientSearchFormValues.setMiddleName =
|
|
|
|
: _patientSearchFormValues
|
|
|
|
value;
|
|
|
|
.setMiddleName = value;
|
|
|
|
if (value != null && value
|
|
|
|
if (value != null &&
|
|
|
|
.toString()
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
.trim()
|
|
|
|
|
|
|
|
.isEmpty) {
|
|
|
|
|
|
|
|
_patientSearchFormValues.setMiddleName =
|
|
|
|
_patientSearchFormValues.setMiddleName =
|
|
|
|
"0";
|
|
|
|
"0";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// validator: (value) {
|
|
|
|
// validator: (value) {
|
|
|
|
@ -321,7 +322,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
child: AppTextFormField(
|
|
|
|
child: AppTextFormField(
|
|
|
|
labelText: TranslationBase.of(context).lastName,
|
|
|
|
labelText:
|
|
|
|
|
|
|
|
TranslationBase.of(context).lastName,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
onSaved: (value) {
|
|
|
|
onSaved: (value) {
|
|
|
|
value == null || value == ''
|
|
|
|
value == null || value == ''
|
|
|
|
@ -329,11 +331,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
"0"
|
|
|
|
"0"
|
|
|
|
: _patientSearchFormValues.setLastName =
|
|
|
|
: _patientSearchFormValues.setLastName =
|
|
|
|
value;
|
|
|
|
value;
|
|
|
|
if (value != null && value
|
|
|
|
if (value != null &&
|
|
|
|
.toString()
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
.trim()
|
|
|
|
_patientSearchFormValues.setLastName =
|
|
|
|
.isEmpty) {
|
|
|
|
"0";
|
|
|
|
_patientSearchFormValues.setLastName = "0";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
@ -341,39 +342,38 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if(_selectedType!='7')
|
|
|
|
if (_selectedType != '7')
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
border: Border.all(
|
|
|
|
border: Border.all(
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
width: 1.0,
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: AppTextFormField(
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
labelText:
|
|
|
|
child: AppTextFormField(
|
|
|
|
TranslationBase.of(context).phoneNumber,
|
|
|
|
labelText:
|
|
|
|
borderColor: Colors.white,
|
|
|
|
TranslationBase.of(context).phoneNumber,
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
focusNode: _nodeText1,
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
onSaved: (value) {
|
|
|
|
focusNode: _nodeText1,
|
|
|
|
value == null || value == ''
|
|
|
|
onSaved: (value) {
|
|
|
|
? _patientSearchFormValues
|
|
|
|
value == null || value == ''
|
|
|
|
.setPatientMobileNumber = "0"
|
|
|
|
? _patientSearchFormValues
|
|
|
|
: _patientSearchFormValues
|
|
|
|
.setPatientMobileNumber = "0"
|
|
|
|
.setPatientMobileNumber = value;
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
|
|
|
.setPatientMobileNumber = value;
|
|
|
|
|
|
|
|
|
|
|
|
if (value != null && value
|
|
|
|
if (value != null &&
|
|
|
|
.toString()
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
.trim()
|
|
|
|
_patientSearchFormValues
|
|
|
|
.isEmpty) {
|
|
|
|
.setPatientMobileNumber = "0";
|
|
|
|
_patientSearchFormValues
|
|
|
|
}
|
|
|
|
.setPatientMobileNumber = "0";
|
|
|
|
},
|
|
|
|
}
|
|
|
|
),
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -392,15 +392,13 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
focusNode: _nodeText2,
|
|
|
|
focusNode: _nodeText2,
|
|
|
|
onSaved: (value) {
|
|
|
|
onSaved: (value) {
|
|
|
|
value == null || value==''
|
|
|
|
value == null || value == ''
|
|
|
|
? _patientSearchFormValues.setPatientID =
|
|
|
|
? _patientSearchFormValues
|
|
|
|
0
|
|
|
|
.setPatientID = 0
|
|
|
|
: _patientSearchFormValues.setPatientID =
|
|
|
|
: _patientSearchFormValues
|
|
|
|
int.parse(value);
|
|
|
|
.setPatientID = int.parse(value);
|
|
|
|
if (value != null && value
|
|
|
|
if (value != null &&
|
|
|
|
.trim()
|
|
|
|
value.trim().toString().isEmpty) {
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
.isEmpty) {
|
|
|
|
|
|
|
|
_patientSearchFormValues.setPatientID = 0;
|
|
|
|
_patientSearchFormValues.setPatientID = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
@ -426,7 +424,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(!(_selectedType == '2' || _selectedType == '4'))
|
|
|
|
(!(_selectedType == '2' || _selectedType == '4'))
|
|
|
|
? DynamicElements(_patientSearchFormValues, isFormSubmitted)
|
|
|
|
? DynamicElements(
|
|
|
|
|
|
|
|
_patientSearchFormValues, isFormSubmitted)
|
|
|
|
: SizedBox(
|
|
|
|
: SizedBox(
|
|
|
|
height: 0,
|
|
|
|
height: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|