add prescription add radiology
parent
4309a2141a
commit
1a98e37a7f
@ -0,0 +1,64 @@
|
||||
class PrescriptionReqModel {
|
||||
int patientID;
|
||||
int setupID;
|
||||
int projectID;
|
||||
int languageID;
|
||||
String stamp;
|
||||
String iPAdress;
|
||||
double versionID;
|
||||
int channel;
|
||||
String tokenID;
|
||||
String sessionID;
|
||||
bool isLoginForDoctorApp;
|
||||
bool patientOutSA;
|
||||
int patientTypeID;
|
||||
|
||||
PrescriptionReqModel(
|
||||
{this.patientID,
|
||||
this.setupID,
|
||||
this.projectID,
|
||||
this.languageID,
|
||||
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.tokenID,
|
||||
this.isLoginForDoctorApp = true,
|
||||
this.patientOutSA = false,
|
||||
this.patientTypeID});
|
||||
|
||||
PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
|
||||
patientID = json['PatientID'];
|
||||
setupID = json['SetupID'];
|
||||
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'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientID'] = this.patientID;
|
||||
data['SetupID'] = this.setupID;
|
||||
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;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,64 +1,144 @@
|
||||
class PrescriptionReqModel {
|
||||
int patientID;
|
||||
int setupID;
|
||||
class PrescriptionResModel {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int languageID;
|
||||
String stamp;
|
||||
String iPAdress;
|
||||
double versionID;
|
||||
int channel;
|
||||
String tokenID;
|
||||
String sessionID;
|
||||
bool isLoginForDoctorApp;
|
||||
bool patientOutSA;
|
||||
int patientTypeID;
|
||||
int patientID;
|
||||
int appointmentNo;
|
||||
String appointmentDate;
|
||||
String doctorName;
|
||||
String clinicDescription;
|
||||
String name;
|
||||
int episodeID;
|
||||
int actualDoctorRate;
|
||||
int admission;
|
||||
int clinicID;
|
||||
String companyName;
|
||||
String despensedStatus;
|
||||
String dischargeDate;
|
||||
int dischargeNo;
|
||||
int doctorID;
|
||||
String doctorImageURL;
|
||||
int doctorRate;
|
||||
String doctorTitle;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
bool isActiveDoctorProfile;
|
||||
bool isDoctorAllowVedioCall;
|
||||
bool isExecludeDoctor;
|
||||
bool isInOutPatient;
|
||||
String isInOutPatientDescription;
|
||||
String isInOutPatientDescriptionN;
|
||||
bool isInsurancePatient;
|
||||
String nationalityFlagURL;
|
||||
int noOfPatientsRate;
|
||||
String qR;
|
||||
List<String> speciality;
|
||||
|
||||
PrescriptionReqModel(
|
||||
{this.patientID,
|
||||
this.setupID,
|
||||
PrescriptionResModel(
|
||||
{this.setupID,
|
||||
this.projectID,
|
||||
this.languageID,
|
||||
this.stamp,
|
||||
this.iPAdress,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.tokenID,
|
||||
this.sessionID,
|
||||
this.isLoginForDoctorApp,
|
||||
this.patientOutSA,
|
||||
this.patientTypeID});
|
||||
this.patientID,
|
||||
this.appointmentNo,
|
||||
this.appointmentDate,
|
||||
this.doctorName,
|
||||
this.clinicDescription,
|
||||
this.name,
|
||||
this.episodeID,
|
||||
this.actualDoctorRate,
|
||||
this.admission,
|
||||
this.clinicID,
|
||||
this.companyName,
|
||||
this.despensedStatus,
|
||||
this.dischargeDate,
|
||||
this.dischargeNo,
|
||||
this.doctorID,
|
||||
this.doctorImageURL,
|
||||
this.doctorRate,
|
||||
this.doctorTitle,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.isActiveDoctorProfile,
|
||||
this.isDoctorAllowVedioCall,
|
||||
this.isExecludeDoctor,
|
||||
this.isInOutPatient,
|
||||
this.isInOutPatientDescription,
|
||||
this.isInOutPatientDescriptionN,
|
||||
this.isInsurancePatient,
|
||||
this.nationalityFlagURL,
|
||||
this.noOfPatientsRate,
|
||||
this.qR,
|
||||
this.speciality});
|
||||
|
||||
PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
|
||||
patientID = json['PatientID'];
|
||||
PrescriptionResModel.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
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'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
appointmentDate = json['AppointmentDate'];
|
||||
doctorName = json['DoctorName'];
|
||||
clinicDescription = json['ClinicDescription'];
|
||||
name = json['Name'];
|
||||
episodeID = json['EpisodeID'];
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
admission = json['Admission'];
|
||||
clinicID = json['ClinicID'];
|
||||
companyName = json['CompanyName'];
|
||||
despensedStatus = json['Despensed_Status'];
|
||||
dischargeDate = json['DischargeDate'];
|
||||
dischargeNo = json['DischargeNo'];
|
||||
doctorID = json['DoctorID'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
|
||||
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||
isInOutPatient = json['IsInOutPatient'];
|
||||
isInOutPatientDescription = json['IsInOutPatientDescription'];
|
||||
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
|
||||
isInsurancePatient = json['IsInsurancePatient'];
|
||||
nationalityFlagURL = json['NationalityFlagURL'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
qR = json['QR'];
|
||||
speciality = json['Speciality'].cast<String>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientID'] = this.patientID;
|
||||
data['SetupID'] = this.setupID;
|
||||
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;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['AppointmentDate'] = this.appointmentDate;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['ClinicDescription'] = this.clinicDescription;
|
||||
data['Name'] = this.name;
|
||||
data['EpisodeID'] = this.episodeID;
|
||||
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||
data['Admission'] = this.admission;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['CompanyName'] = this.companyName;
|
||||
data['Despensed_Status'] = this.despensedStatus;
|
||||
data['DischargeDate'] = this.dischargeDate;
|
||||
data['DischargeNo'] = this.dischargeNo;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
|
||||
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||
data['IsInOutPatient'] = this.isInOutPatient;
|
||||
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
|
||||
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
|
||||
data['IsInsurancePatient'] = this.isInsurancePatient;
|
||||
data['NationalityFlagURL'] = this.nationalityFlagURL;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['QR'] = this.qR;
|
||||
data['Speciality'] = this.speciality;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
class RadiologyReqModel {
|
||||
int patientID;
|
||||
int projectID;
|
||||
int languageID;
|
||||
String stamp;
|
||||
String iPAdress;
|
||||
double versionID;
|
||||
int channel;
|
||||
String tokenID;
|
||||
String sessionID;
|
||||
bool isLoginForDoctorApp;
|
||||
bool patientOutSA;
|
||||
int patientTypeID;
|
||||
|
||||
RadiologyReqModel(
|
||||
{this.patientID,
|
||||
this.projectID,
|
||||
this.languageID,
|
||||
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.tokenID,
|
||||
this.isLoginForDoctorApp = true,
|
||||
this.patientOutSA = false,
|
||||
this.patientTypeID});
|
||||
|
||||
RadiologyReqModel.fromJson(Map<String, dynamic> json) {
|
||||
patientID = json['PatientID'];
|
||||
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'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientID'] = this.patientID;
|
||||
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;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
class RadiologyResModel {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int patientID;
|
||||
int invoiceLineItemNo;
|
||||
int invoiceNo;
|
||||
String reportData;
|
||||
String imageURL;
|
||||
int clinicId;
|
||||
int doctorId;
|
||||
String reportDate;
|
||||
String clinicName;
|
||||
String doctorImageURL;
|
||||
String doctorName;
|
||||
String projectName;
|
||||
Null statusDescription;
|
||||
|
||||
RadiologyResModel(
|
||||
{this.setupID,
|
||||
this.projectID,
|
||||
this.patientID,
|
||||
this.invoiceLineItemNo,
|
||||
this.invoiceNo,
|
||||
this.reportData,
|
||||
this.imageURL,
|
||||
this.clinicId,
|
||||
this.doctorId,
|
||||
this.reportDate,
|
||||
this.clinicName,
|
||||
this.doctorImageURL,
|
||||
this.doctorName,
|
||||
this.projectName,
|
||||
this.statusDescription});
|
||||
|
||||
RadiologyResModel.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
patientID = json['PatientID'];
|
||||
invoiceLineItemNo = json['InvoiceLineItemNo'];
|
||||
invoiceNo = json['InvoiceNo'];
|
||||
reportData = json['ReportData'];
|
||||
imageURL = json['ImageURL'];
|
||||
clinicId = json['ClinicId'];
|
||||
doctorId = json['DoctorId'];
|
||||
reportDate = json['ReportDate'];
|
||||
clinicName = json['ClinicName'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorName = json['DoctorName'];
|
||||
projectName = json['ProjectName'];
|
||||
statusDescription = json['StatusDescription'];
|
||||
}
|
||||
|
||||
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['InvoiceLineItemNo'] = this.invoiceLineItemNo;
|
||||
data['InvoiceNo'] = this.invoiceNo;
|
||||
data['ReportData'] = this.reportData;
|
||||
data['ImageURL'] = this.imageURL;
|
||||
data['ClinicId'] = this.clinicId;
|
||||
data['DoctorId'] = this.doctorId;
|
||||
data['ReportDate'] = this.reportDate;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['StatusDescription'] = this.statusDescription;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,161 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../config/shared_pref_kay.dart';
|
||||
import '../../../../models/patient/vital_sign_req_model.dart';
|
||||
import '../../../../providers/patients_provider.dart';
|
||||
|
||||
import '../../../../util/dr_app_shared_pref.dart';
|
||||
import '../../../../widgets/shared/app_scaffold_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:PrescriptionScreen
|
||||
*@desc: PrescriptionScreen class
|
||||
*/
|
||||
|
||||
class PrescriptionScreen extends StatefulWidget {
|
||||
@override
|
||||
_PrescriptionScreenState createState() => _PrescriptionScreenState();
|
||||
}
|
||||
|
||||
class _PrescriptionScreenState extends State<PrescriptionScreen> {
|
||||
PatientsProvider patientsProv;
|
||||
var _isInit = true;
|
||||
|
||||
/*
|
||||
*@author: Elham Rababah
|
||||
*@Date:28/4/2020
|
||||
*@param: context
|
||||
*@return:
|
||||
*@desc: getPrescriptionsList Function
|
||||
*/
|
||||
getPrescriptionsList(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);
|
||||
PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel(
|
||||
patientID: patient.patientId,
|
||||
projectID: patient.projectId,
|
||||
tokenID: token,
|
||||
patientTypeID: patient.patientType,
|
||||
languageID: 2,
|
||||
setupID: 0
|
||||
);
|
||||
patientsProv.getPatientPrescriptions(prescriptionReqModel.toJson());
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if (_isInit) {
|
||||
patientsProv = Provider.of<PatientsProvider>(context);
|
||||
getPrescriptionsList(context);
|
||||
}
|
||||
_isInit = false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "Prescriptions",
|
||||
showAppDrawer: false,
|
||||
showBottomBar: false,
|
||||
body: patientsProv.isLoading
|
||||
? DrAppCircularProgressIndeicator()
|
||||
: patientsProv.isError
|
||||
? Center(
|
||||
child: Text(
|
||||
patientsProv.error,
|
||||
style: TextStyle(color: Theme.of(context).errorColor),
|
||||
),
|
||||
)
|
||||
: patientsProv.patientPrescriptionsList.length == 0
|
||||
? Center(
|
||||
child: Text(
|
||||
'You don\'t have any Prescriptions',
|
||||
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.patientPrescriptionsList.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
|
||||
.patientPrescriptionsList[index]
|
||||
.doctorImageURL),
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
8, 0, 0, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
'${patientsProv.patientPrescriptionsList[index].doctorName}',
|
||||
fontSize: 2.5 *
|
||||
SizeConfig.textMultiplier,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
AppText(
|
||||
' ${patientsProv.patientPrescriptionsList[index].clinicDescription}',
|
||||
fontSize: 2.5 *
|
||||
SizeConfig
|
||||
.textMultiplier),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,168 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/radiology_req_model.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../config/shared_pref_kay.dart';
|
||||
import '../../../../models/patient/vital_sign_req_model.dart';
|
||||
import '../../../../providers/patients_provider.dart';
|
||||
|
||||
import '../../../../util/dr_app_shared_pref.dart';
|
||||
import '../../../../widgets/shared/app_scaffold_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:RadiologyScreen
|
||||
*@desc: RadiologyScreen class
|
||||
*/
|
||||
|
||||
class RadiologyScreen extends StatefulWidget {
|
||||
@override
|
||||
_RadiologyScreenState createState() => _RadiologyScreenState();
|
||||
}
|
||||
|
||||
class _RadiologyScreenState extends State<RadiologyScreen> {
|
||||
PatientsProvider patientsProv;
|
||||
var _isInit = true;
|
||||
|
||||
/*
|
||||
*@author: Elham Rababah
|
||||
*@Date:28/4/2020
|
||||
*@param: context
|
||||
*@return:
|
||||
*@desc: getRadiologyList Function
|
||||
*/
|
||||
getRadiologyList(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);
|
||||
RadiologyReqModel radiologyReqModel = RadiologyReqModel(
|
||||
patientID: patient.patientId,
|
||||
projectID: patient.projectId,
|
||||
tokenID: token,
|
||||
patientTypeID: patient.patientType,
|
||||
languageID: 2,
|
||||
);
|
||||
patientsProv.getPatientRadiology(radiologyReqModel.toJson());
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if (_isInit) {
|
||||
patientsProv = Provider.of<PatientsProvider>(context);
|
||||
getRadiologyList(context);
|
||||
}
|
||||
_isInit = false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "Radiology",
|
||||
showAppDrawer: false,
|
||||
showBottomBar: false,
|
||||
body: patientsProv.isLoading
|
||||
? DrAppCircularProgressIndeicator()
|
||||
: patientsProv.isError
|
||||
? Center(
|
||||
child: Text(
|
||||
patientsProv.error,
|
||||
style: TextStyle(color: Theme.of(context).errorColor),
|
||||
),
|
||||
)
|
||||
: patientsProv.patientRadiologyList.length == 0
|
||||
? Center(
|
||||
child: Text(
|
||||
'You don\'t have any Vital Sign',
|
||||
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.patientRadiologyList.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
|
||||
.patientRadiologyList[index]
|
||||
.doctorImageURL),
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
8, 0, 0, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
'${patientsProv.patientRadiologyList[index].doctorName}',
|
||||
fontSize: 2.5 *
|
||||
SizeConfig.textMultiplier,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
AppText(
|
||||
'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}',
|
||||
fontSize: 2.5 *
|
||||
SizeConfig.textMultiplier,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
AppText(
|
||||
' ${patientsProv.patientRadiologyList[index].clinicName}',
|
||||
fontSize: 2.5 *
|
||||
SizeConfig
|
||||
.textMultiplier),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue