|
|
|
|
@ -4,26 +4,22 @@ import '../../models/patient_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/routes.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import '../../lookups/patient_lookup.dart';
|
|
|
|
|
|
|
|
|
|
// const PATIENT_TYPE = [
|
|
|
|
|
// {"text": "outPatiant", "val": "1"},
|
|
|
|
|
// {"text": "Tomorrow Patient", "val": "2"},
|
|
|
|
|
// {"text": "Referral", "val": "3"},
|
|
|
|
|
// {"text": "Discharge", "val": "4"},
|
|
|
|
|
// {"text": "InPatiant", "val": "5"},
|
|
|
|
|
// {"text": "Referral Discharge", "val": "6"},
|
|
|
|
|
// ];
|
|
|
|
|
class PatientSearch extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_PatientSearchState createState() => _PatientSearchState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _PatientSearchState extends State<PatientSearch> {
|
|
|
|
|
final List<Map<String, String>> _patientType = [
|
|
|
|
|
{"text": "outPatiant", "val": "1"},
|
|
|
|
|
{"text": "Tomorrow Patient", "val": "2"},
|
|
|
|
|
{"text": "Referral", "val": "3"},
|
|
|
|
|
{"text": "Discharge", "val": "4"},
|
|
|
|
|
{"text": "InPatiant", "val": "5"},
|
|
|
|
|
{"text": "Referral Discharge", "val": "6"},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
final List<Map<String, String>> _locations = [
|
|
|
|
|
{"text": "In Sudia Arabia", "val": "1"},
|
|
|
|
|
{"text": "Out Sudia Arabia", "val": "2"},
|
|
|
|
|
];
|
|
|
|
|
String _selectedType = '1';
|
|
|
|
|
String _selectedLocation = '1';
|
|
|
|
|
TextEditingController _toDateController = new TextEditingController();
|
|
|
|
|
@ -59,7 +55,10 @@ class _PatientSearchState extends State<PatientSearch> {
|
|
|
|
|
print(_patientSearchFormValues.From);
|
|
|
|
|
print(_patientSearchFormValues.To);
|
|
|
|
|
|
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS, arguments: {'patientSearchForm':_patientSearchFormValues,'selectedType':_selectedType});
|
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS, arguments: {
|
|
|
|
|
'patientSearchForm': _patientSearchFormValues,
|
|
|
|
|
'selectedType': _selectedType
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -99,7 +98,7 @@ class _PatientSearchState extends State<PatientSearch> {
|
|
|
|
|
iconSize: 24,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
|
return _patientType.map((item) {
|
|
|
|
|
return PATIENT_TYPE.map((item) {
|
|
|
|
|
return Text(item['text'], textAlign: TextAlign.end);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
@ -108,7 +107,7 @@ class _PatientSearchState extends State<PatientSearch> {
|
|
|
|
|
_selectedType = newValue;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: _patientType.map((item) {
|
|
|
|
|
items: PATIENT_TYPE.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: Text(
|
|
|
|
|
'${item['text']}',
|
|
|
|
|
@ -496,7 +495,7 @@ class _PatientSearchState extends State<PatientSearch> {
|
|
|
|
|
iconSize: 24,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
|
return _locations.map((item) {
|
|
|
|
|
return LOCATIONS.map((item) {
|
|
|
|
|
return Text(item['text']);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
@ -505,7 +504,7 @@ class _PatientSearchState extends State<PatientSearch> {
|
|
|
|
|
_selectedLocation = newValue;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: _locations.map((item) {
|
|
|
|
|
items: LOCATIONS.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: Text('${item['text']}'),
|
|
|
|
|
value: item['val'],
|
|
|
|
|
|