add patient lookup

merge-requests/1/merge
Elham Rababah 6 years ago
parent 046ef17b21
commit 79055145c6

@ -0,0 +1,15 @@
const PATIENT_TYPE = const [
{"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"},
];
const LOCATIONS = const[
{"text": "In Sudia Arabia", "val": "1"},
{"text": "Out Sudia Arabia", "val": "2"},
];

@ -28,6 +28,27 @@ class HomeScreen extends StatelessWidget {
title: 'Patient Search', title: 'Patient Search',
image: 'assets/images/user_id_icon.png', image: 'assets/images/user_id_icon.png',
), ),
Category(
id: 'c1',
title: 'My Schedule',
image: 'assets/images/user_id_icon.png',
),
Category(
id: 'c2',
title: 'Patient Search',
image: 'assets/images/user_id_icon.png',
),
Category(
id: 'c1',
title: 'My Schedule',
image: 'assets/images/user_id_icon.png',
),
Category(
id: 'c2',
title: 'Patient Search',
image: 'assets/images/user_id_icon.png',
),
]; ];
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(

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

@ -9,30 +9,35 @@ class HomeItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: () => selectItem(context,id), onTap: () => selectItem(context, id),
splashColor: Colors.red, splashColor: Colors.red,
child: Container( child: Container(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
child: CircleAvatar( child: CircleAvatar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
child: Image.asset( child: Container(
child: Image.asset(
image, image,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
),
), ),
)), )),
Text(title,style: TextStyle(fontSize: 20),) Text(
title,
style: TextStyle(fontSize: 16),
)
], ],
), ),
), ),
); );
} }
void selectItem(BuildContext ctx, id ) { void selectItem(BuildContext ctx, id) {
String route; String route;
if (id =='c2') { if (id == 'c2') {
route = PATIENT_SEARCH; route = PATIENT_SEARCH;
} }
Navigator.of(ctx).pushNamed(route, arguments: { Navigator.of(ctx).pushNamed(route, arguments: {

Loading…
Cancel
Save