pharmacy web services

merge-requests/44/head
unknown 6 years ago
parent 3f6599eb90
commit a59a2d5ad3

@ -1,5 +1,10 @@
const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://hmgwebservices.com/Services/';
const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z]";
const ONLY_DATE = "[0-9/]";
//Ibrahim Albitar
const BASE_URL = 'https://hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems";

@ -0,0 +1,26 @@
//Ibrahim Albitar
class PharmaciesRequestModel {
String PHR_itemName;
int LanguageID;
String stamp;
String IPAdress;
double VersionID;
String TokenID;
String SessionID;
bool IsLoginForDoctorApp;
bool PatientOutSA;
int PatientTypeID;
PharmaciesRequestModel(
{this.PHR_itemName,
this.PatientTypeID,
this.LanguageID,
this.stamp,
this.IPAdress,
this.VersionID,
this.TokenID,
this.SessionID,
this.IsLoginForDoctorApp,
this.PatientOutSA});
}

@ -0,0 +1,30 @@
import 'dart:convert';
import 'package:doctor_app_flutter/client/app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/pharmacies_request_model.dart';
import 'package:flutter/cupertino.dart';
class MedicineProvider with ChangeNotifier {
Future<Map> getPharmacyList(PharmaciesRequestModel pharmacy) async {
try {
final response = await AppClient.post(PHARMACY_ITEMS_URL,
body: json.encode({
"PHR_itemName": pharmacy.PHR_itemName,
"LanguageID": pharmacy.LanguageID,
"stamp": pharmacy.stamp,
"IPAdress": pharmacy.IPAdress,
"VersionID": pharmacy.VersionID,
"TokenID": pharmacy.TokenID,
"SessionID": pharmacy.SessionID,
"IsLoginForDoctorApp": pharmacy.IsLoginForDoctorApp,
"PatientOutSA": pharmacy.PatientOutSA,
"PatientTypeID": pharmacy.PatientTypeID
}));
return Future.value(json.decode(response.body));
} catch (error) {
throw error;
}
}
}

@ -30,7 +30,7 @@ const String PATIENTS = 'patients/patients';
const String PATIENTS_PROFILE = 'patients/patients-profile';
const String BLOOD_BANK = 'blood-bank';
const String DOCTOR_REPLY = 'doctor-reply';
const String MEDICINE_SEARCH = 'medicine-search';
const String MEDICINE_SEARCH = 'medicine/medicine-search';
const String SETTINGS = 'settings';
var routes = {

@ -23,217 +23,216 @@ class _DashboardScreenState extends State<DashboardScreen> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle:'Home',
body: Container(
appBarTitle: 'Home',
body: Container(
child: Column(
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
"Today's Statistics",
fontWeight: FontWeight.bold,
),
alignment: Alignment.centerLeft,
)),
Expanded(
flex: 3,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: RoundedContainer(child:CircularPercentIndicator(
radius: 90.0,
animation: true,
animationDuration: 1200,
lineWidth: 7.0,
percent: .75,
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppText(
"38",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 4
),
AppText(
"Out-Patients",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.5,
color: Colors.grey[800]
),
],
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100],
progressColor: Colors.red,
))),
Expanded(
flex: 2,
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: DashboardItemTexts(
"Arrived",
"23",
)),
Expanded(
child: DashboardItemTexts(
"Not Arrived",
"23",
)),
],
)),
Expanded(
child: Column(
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
"Today's Statistics",
fontWeight: FontWeight.bold,
),
alignment: Alignment.centerLeft,
)),
Expanded(
flex: 3,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: RoundedContainer(
child: CircularPercentIndicator(
radius: 90.0,
animation: true,
animationDuration: 1200,
lineWidth: 7.0,
percent: .75,
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppText("38",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 4),
AppText("Out-Patients",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.5,
color: Colors.grey[800]),
],
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100],
progressColor: Colors.red,
))),
Expanded(
flex: 2,
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: DashboardItemTexts(
"ER",
"Arrived",
"23",
)),
Expanded(
child: DashboardItemTexts(
"Walk-in",
"Not Arrived",
"23",
)),
],
)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: DashboardItemTexts(
"ER",
"23",
)),
Expanded(
child: DashboardItemTexts(
"Walk-in",
"23",
)),
],
))
])),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"08",
"Lab Result",
backgroundColor: Colors.red,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"10",
"Radiology",
backgroundColor: Colors.red,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"05",
"Referral",
backgroundColor: Colors.red,
)),
],
)),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"In-Patient",
showBorder: true,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"Operations",
showBorder: true,
)),
],
)),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
"Patient Services",
fontWeight: FontWeight.bold,
),
alignment: Alignment.centerLeft,
)),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: InkWell( child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"Search Patient",
showBorder: false,
backgroundColor: Colors.green[200],
),
onTap: () {
Navigator.of(context).pushNamed(PATIENT_SEARCH);
},
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"",
"Out Patient",
showBorder: false,
backgroundColor: Colors.deepPurple[300],
)),
],
)),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"",
"In Patient",
showBorder: false,
backgroundColor: Colors.blueGrey[900],
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"",
"Discharge Patient",
showBorder: false,
backgroundColor: Colors.brown[400],
)),
],
)),
],
)));
)),
],
))
])),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"08",
"Lab Result",
backgroundColor: Colors.red,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"10",
"Radiology",
backgroundColor: Colors.red,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"05",
"Referral",
backgroundColor: Colors.red,
)),
],
)),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"In-Patient",
showBorder: true,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"Operations",
showBorder: true,
)),
],
)),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
"Patient Services",
fontWeight: FontWeight.bold,
),
alignment: Alignment.centerLeft,
)),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: InkWell(
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"Search Patient",
showBorder: false,
backgroundColor: Colors.green[200],
),
onTap: () {
Navigator.of(context).pushNamed(PATIENT_SEARCH);
},
)),
Expanded(
flex: 2,
child: InkWell(
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"Out Patient",
showBorder: false,
backgroundColor: Colors.deepPurple[300],
),
onTap: () {
Navigator.of(context).pushNamed(MEDICINE_SEARCH);
},
)),
],
)),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"",
"In Patient",
showBorder: false,
backgroundColor: Colors.blueGrey[900],
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"",
"Discharge Patient",
showBorder: false,
backgroundColor: Colors.brown[400],
)),
],
)),
],
)));
}
}

@ -1,9 +1,67 @@
import 'package:doctor_app_flutter/models/pharmacies_request_model.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class MedicineSearchScreen extends StatelessWidget {
import 'package:provider/provider.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg {
MedicineSearchScreen({this.changeLoadingStata});
final Function changeLoadingStata;
@override
_MedicineSearchState createState() => _MedicineSearchState();
}
class _MedicineSearchState extends State<MedicineSearchScreen> {
var _medicineModel = PharmaciesRequestModel(
IsLoginForDoctorApp: true,
PHR_itemName: "Panadol",
PatientOutSA: false,
PatientTypeID: 1,
LanguageID: 2,
IPAdress: "11.11.11.11",
VersionID: 1.2,
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
stamp: "2020-04-23T21:01:21.492Z",
SessionID: "e29zoooEJ4");
@override
Widget build(BuildContext context) {
return Container(
);
return ChangeNotifierProvider(
create: (context) => MedicineProvider(), //change builder to create
child: Consumer<MedicineProvider>(
builder: (context, provider, child) => AppScaffold(
appBarTitle: "Search Medicine",
body: RaisedButton(
onPressed: () {
MedicineProvider medicineProvider =
Provider.of<MedicineProvider>(context);
searchMedicine(context, medicineProvider);
},
))));
}
searchMedicine(
context, MedicineProvider medicineProvider) {
medicineProvider.getPharmacyList(_medicineModel).then((res) {
if (res['MessageStatus'] == 1) {
print("ListPharmcy " + res['ListPharmcy'].toString());
//Navigator.of(context).pushNamed();
} else {
// handel error
// widget.showCenterShortLoadingToast("watting");
//helpers.showErrorToast(res['ErrorEndUserMessage']);
}
// Navigator.of(context).pushNamed(HOME);
}).catchError((err) {
print('$err');
//helpers.showErrorToast();
});
}
}
}

Loading…
Cancel
Save