add patient route
parent
96d3201ccc
commit
49f9841079
@ -1,2 +1,3 @@
|
||||
final TOKEN = 'token';
|
||||
final PROJECT_ID="projectID";
|
||||
final PROJECT_ID="projectID";
|
||||
final SLECTED_PATIENT_TYPE="slectedPatientType";
|
@ -0,0 +1,60 @@
|
||||
class LabOrdersReqModel {
|
||||
int patientID;
|
||||
int patientTypeID;
|
||||
int projectID;
|
||||
int languageID;
|
||||
String stamp;
|
||||
String iPAdress;
|
||||
double versionID;
|
||||
int channel;
|
||||
String tokenID;
|
||||
String sessionID;
|
||||
bool isLoginForDoctorApp;
|
||||
bool patientOutSA;
|
||||
|
||||
LabOrdersReqModel(
|
||||
{this.patientID,
|
||||
this.patientTypeID,
|
||||
this.projectID,
|
||||
this.languageID,
|
||||
this.tokenID,
|
||||
this.stamp = '2020-04-26T09:32:18.317Z',
|
||||
this.iPAdress='11.11.11.11',
|
||||
this.versionID=1.2,
|
||||
this.channel=9,
|
||||
this.sessionID='E2bsEeYEJo',
|
||||
this.isLoginForDoctorApp =true,
|
||||
this.patientOutSA=false});
|
||||
|
||||
LabOrdersReqModel.fromJson(Map<String, dynamic> json) {
|
||||
patientID = json['PatientID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
projectID = json['ProjectID'];
|
||||
languageID = json['LanguageID'];
|
||||
stamp = json['stamp'];
|
||||
iPAdress = json['IPAdress'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
tokenID = json['TokenID'];
|
||||
sessionID = json['SessionID'];
|
||||
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['stamp'] = this.stamp;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
class LabOrdersResModel {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int patientID;
|
||||
int patientType;
|
||||
int orderNo;
|
||||
String orderDate;
|
||||
int invoiceTransactionType;
|
||||
int invoiceNo;
|
||||
int clinicId;
|
||||
int doctorId;
|
||||
int status;
|
||||
String createdBy;
|
||||
Null createdByN;
|
||||
String createdOn;
|
||||
String editedBy;
|
||||
Null editedByN;
|
||||
String editedOn;
|
||||
String clinicName;
|
||||
String doctorImageURL;
|
||||
String doctorName;
|
||||
String projectName;
|
||||
|
||||
LabOrdersResModel(
|
||||
{this.setupID,
|
||||
this.projectID,
|
||||
this.patientID,
|
||||
this.patientType,
|
||||
this.orderNo,
|
||||
this.orderDate,
|
||||
this.invoiceTransactionType,
|
||||
this.invoiceNo,
|
||||
this.clinicId,
|
||||
this.doctorId,
|
||||
this.status,
|
||||
this.createdBy,
|
||||
this.createdByN,
|
||||
this.createdOn,
|
||||
this.editedBy,
|
||||
this.editedByN,
|
||||
this.editedOn,
|
||||
this.clinicName,
|
||||
this.doctorImageURL,
|
||||
this.doctorName,
|
||||
this.projectName});
|
||||
|
||||
LabOrdersResModel.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
patientID = json['PatientID'];
|
||||
patientType = json['PatientType'];
|
||||
orderNo = json['OrderNo'];
|
||||
orderDate = json['OrderDate'];
|
||||
invoiceTransactionType = json['InvoiceTransactionType'];
|
||||
invoiceNo = json['InvoiceNo'];
|
||||
clinicId = json['ClinicId'];
|
||||
doctorId = json['DoctorId'];
|
||||
status = json['Status'];
|
||||
createdBy = json['CreatedBy'];
|
||||
createdByN = json['CreatedByN'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedByN = json['EditedByN'];
|
||||
editedOn = json['EditedOn'];
|
||||
clinicName = json['ClinicName'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorName = json['DoctorName'];
|
||||
projectName = json['ProjectName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['OrderNo'] = this.orderNo;
|
||||
data['OrderDate'] = this.orderDate;
|
||||
data['InvoiceTransactionType'] = this.invoiceTransactionType;
|
||||
data['InvoiceNo'] = this.invoiceNo;
|
||||
data['ClinicId'] = this.clinicId;
|
||||
data['DoctorId'] = this.doctorId;
|
||||
data['Status'] = this.status;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['CreatedByN'] = this.createdByN;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedByN'] = this.editedByN;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['ProjectName'] = this.projectName;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../config/shared_pref_kay.dart';
|
||||
import '../../../../config/size_config.dart';
|
||||
import '../../../../models/patient/lab_orders_req_model.dart';
|
||||
import '../../../../models/patient/patiant_info_model.dart';
|
||||
import '../../../../providers/patients_provider.dart';
|
||||
import '../../../../util/dr_app_shared_pref.dart';
|
||||
import '../../../../widgets/shared/app_scaffold_widget.dart';
|
||||
import '../../../../widgets/shared/app_texts_widget.dart';
|
||||
import '../../../../widgets/shared/card_with_bg_widget.dart';
|
||||
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
||||
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
/*
|
||||
*@author: Elham Rababah
|
||||
*@Date:26/4/2020
|
||||
*@param:
|
||||
*@return:LabOrdersScreen
|
||||
*@desc: LabOrdersScreen class
|
||||
*/
|
||||
|
||||
class LabOrdersScreen extends StatefulWidget {
|
||||
@override
|
||||
_LabOrdersScreenState createState() => _LabOrdersScreenState();
|
||||
}
|
||||
|
||||
class _LabOrdersScreenState extends State<LabOrdersScreen> {
|
||||
PatientsProvider patientsProv;
|
||||
var _isInit = true;
|
||||
|
||||
/*
|
||||
*@author: Elham Rababah
|
||||
*@Date:28/4/2020
|
||||
*@param: context
|
||||
*@return:
|
||||
*@desc: getVitalSignList Function
|
||||
*/
|
||||
getLabResultOrders(context) async {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
String token = await sharedPref.getString(TOKEN);
|
||||
// String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
|
||||
// int inOutpatientType = 1;
|
||||
// if (type == '0') {
|
||||
// inOutpatientType = 2;
|
||||
// }
|
||||
// print(type);
|
||||
LabOrdersReqModel labOrdersReqModel = LabOrdersReqModel(
|
||||
patientID: patient.patientId,
|
||||
projectID: patient.projectId,
|
||||
tokenID: token,
|
||||
patientTypeID: patient.patientType,
|
||||
languageID: 2);
|
||||
|
||||
patientsProv.getLabResultOrders(labOrdersReqModel.toJson());
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if (_isInit) {
|
||||
patientsProv = Provider.of<PatientsProvider>(context);
|
||||
getLabResultOrders(context);
|
||||
}
|
||||
_isInit = false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "Lab Orders",
|
||||
showAppDrawer: false,
|
||||
showBottomBar: false,
|
||||
body: patientsProv.isLoading
|
||||
? DrAppCircularProgressIndeicator()
|
||||
: patientsProv.isError
|
||||
? Center(
|
||||
child: Text(
|
||||
patientsProv.error,
|
||||
style: TextStyle(color: Theme.of(context).errorColor),
|
||||
),
|
||||
)
|
||||
: patientsProv.patientLabResultOrdersList.length == 0
|
||||
? Center(
|
||||
child: Text(
|
||||
'You don\'t have any Orders',
|
||||
style: TextStyle(color: Theme.of(context).errorColor),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
margin: EdgeInsets.fromLTRB(
|
||||
SizeConfig.realScreenWidth * 0.05,
|
||||
0,
|
||||
SizeConfig.realScreenWidth * 0.05,
|
||||
0),
|
||||
child: ListView.builder(
|
||||
itemCount: patientsProv.patientLabResultOrdersList.length,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return InkWell(
|
||||
child: CardWithBgWidget(
|
||||
widget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
CircleAvatar(
|
||||
radius:
|
||||
SizeConfig.imageSizeMultiplier *
|
||||
12,
|
||||
backgroundImage: NetworkImage(
|
||||
patientsProv
|
||||
.patientLabResultOrdersList[index]
|
||||
.doctorImageURL),
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
8, 0, 0, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
'${patientsProv.patientLabResultOrdersList[index].doctorName}',
|
||||
fontSize: 2.5 *
|
||||
SizeConfig.textMultiplier,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
AppText(
|
||||
' ${patientsProv.patientLabResultOrdersList[index].clinicName}',
|
||||
fontSize: 2.5 *
|
||||
SizeConfig
|
||||
.textMultiplier),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue