Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan
commit
47c42808fd
@ -0,0 +1,21 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
|
||||
class MedicalService extends BaseService {
|
||||
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List();
|
||||
|
||||
getAppointmentHistory() async {
|
||||
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
|
||||
onSuccess: (response, statusCode) async {
|
||||
appoitmentAllHistoryResultList.clear();
|
||||
response['AppoimentAllHistoryResultList'].forEach((appoitment) {
|
||||
appoitmentAllHistoryResultList
|
||||
.add(AppoitmentAllHistoryResultList.fromJson(appoitment));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: Map());
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/locator.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
|
||||
class MedicalViewModel extends BaseViewModel {
|
||||
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList =>
|
||||
List();
|
||||
|
||||
MedicalService _medicalService = locator<MedicalService>();
|
||||
|
||||
getAppointmentHistory() {
|
||||
setState(ViewState.Busy);
|
||||
_medicalService.getAppointmentHistory();
|
||||
if (_medicalService.hasError) {
|
||||
error = _medicalService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
class AskDocRequestType {
|
||||
String setupID;
|
||||
int parameterGroup;
|
||||
int parameterType;
|
||||
int parameterCode;
|
||||
String description;
|
||||
String descriptionN;
|
||||
String alias;
|
||||
String aliasN;
|
||||
String prefix;
|
||||
String suffix;
|
||||
String isColorCodingRequired;
|
||||
String backColor;
|
||||
String foreColor;
|
||||
bool isBuiltIn;
|
||||
bool isActive;
|
||||
int createdBy;
|
||||
String createdOn;
|
||||
String editedBy;
|
||||
String editedOn;
|
||||
String rowVer;
|
||||
|
||||
AskDocRequestType(
|
||||
{this.setupID,
|
||||
this.parameterGroup,
|
||||
this.parameterType,
|
||||
this.parameterCode,
|
||||
this.description,
|
||||
this.descriptionN,
|
||||
this.alias,
|
||||
this.aliasN,
|
||||
this.prefix,
|
||||
this.suffix,
|
||||
this.isColorCodingRequired,
|
||||
this.backColor,
|
||||
this.foreColor,
|
||||
this.isBuiltIn,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.createdOn,
|
||||
this.editedBy,
|
||||
this.editedOn,
|
||||
this.rowVer});
|
||||
|
||||
AskDocRequestType.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
parameterGroup = json['ParameterGroup'];
|
||||
parameterType = json['ParameterType'];
|
||||
parameterCode = json['ParameterCode'];
|
||||
description = json['Description'];
|
||||
descriptionN = json['DescriptionN'];
|
||||
alias = json['Alias'];
|
||||
aliasN = json['AliasN'];
|
||||
prefix = json['Prefix'];
|
||||
suffix = json['Suffix'];
|
||||
isColorCodingRequired = json['IsColorCodingRequired'];
|
||||
backColor = json['BackColor'];
|
||||
foreColor = json['ForeColor'];
|
||||
isBuiltIn = json['IsBuiltIn'];
|
||||
isActive = json['IsActive'];
|
||||
createdBy = json['CreatedBy'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
rowVer = json['RowVer'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ParameterGroup'] = this.parameterGroup;
|
||||
data['ParameterType'] = this.parameterType;
|
||||
data['ParameterCode'] = this.parameterCode;
|
||||
data['Description'] = this.description;
|
||||
data['DescriptionN'] = this.descriptionN;
|
||||
data['Alias'] = this.alias;
|
||||
data['AliasN'] = this.aliasN;
|
||||
data['Prefix'] = this.prefix;
|
||||
data['Suffix'] = this.suffix;
|
||||
data['IsColorCodingRequired'] = this.isColorCodingRequired;
|
||||
data['BackColor'] = this.backColor;
|
||||
data['ForeColor'] = this.foreColor;
|
||||
data['IsBuiltIn'] = this.isBuiltIn;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['RowVer'] = this.rowVer;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PrescriptionReportPage extends StatefulWidget {
|
||||
List<PrescriptionReportEnh> prescriptionReportEnhList;
|
||||
dynamic listPres;
|
||||
AppoitmentAllHistoryResultList appo;
|
||||
|
||||
PrescriptionReportPage({@required this.prescriptionReportEnhList, @required this.listPres, @required this.appo});
|
||||
|
||||
@override
|
||||
_PrescriptionReportState createState() => _PrescriptionReportState();
|
||||
}
|
||||
|
||||
class _PrescriptionReportState extends State<PrescriptionReportPage> {
|
||||
@override
|
||||
void initState() {
|
||||
print(widget.prescriptionReportEnhList.length);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: 'Items',
|
||||
body: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.8,
|
||||
child: ListView.builder(
|
||||
itemBuilder: (context, index) => InkWell(
|
||||
onTap: () {
|
||||
navigateToPrescriptionDetails(
|
||||
widget.prescriptionReportEnhList[index]);
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
border: Border.all(color: Colors.grey[200], width: 0.5),
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
child: Image.network(
|
||||
widget.prescriptionReportEnhList[index].imageSRCUrl,
|
||||
fit: BoxFit.cover,
|
||||
width: 60,
|
||||
height: 70,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(widget
|
||||
.prescriptionReportEnhList[index].itemDescription)),
|
||||
)),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 18,
|
||||
color: Colors.grey[500],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
itemCount: widget.prescriptionReportEnhList.length,
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height * 0.2,
|
||||
color: Colors.grey[100],
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Divider(),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: Button(
|
||||
label: 'Send Copy',
|
||||
onTap: () {
|
||||
sendPrescriptionReportEmail();
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: Button(
|
||||
label: 'Resend order & deliver',
|
||||
backgroundColor: Colors.green[200],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
sendPrescriptionReportEmail() {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, widget.listPres, context).then((res) {
|
||||
AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail');
|
||||
Utils.hideProgressDialog();
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
Utils.hideProgressDialog();
|
||||
AppToast.showErrorToast(message: err);
|
||||
});
|
||||
}
|
||||
|
||||
navigateToPrescriptionDetails(PrescriptionReportEnh prescriptionReportEnh) {
|
||||
final PrescriptionReport prescriptionReport = new PrescriptionReport();
|
||||
|
||||
prescriptionReport.imageSRCUrl = prescriptionReportEnh.imageSRCUrl;
|
||||
prescriptionReport.itemDescription = prescriptionReportEnh.itemDescription;
|
||||
prescriptionReport.itemID = prescriptionReportEnh.itemID;
|
||||
|
||||
prescriptionReport.routeN = prescriptionReportEnh.route;
|
||||
prescriptionReport.route = prescriptionReportEnh.route;
|
||||
|
||||
prescriptionReport.frequency = prescriptionReportEnh.frequency;
|
||||
prescriptionReport.frequencyN = prescriptionReportEnh.frequency;
|
||||
|
||||
prescriptionReport.doseDailyQuantity =
|
||||
prescriptionReportEnh.doseDailyQuantity;
|
||||
|
||||
prescriptionReport.days = prescriptionReportEnh.days;
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: PrescriptionDetailsPage(
|
||||
prescriptionReport: prescriptionReport,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'custom_radio.dart';
|
||||
|
||||
class AskDocDialog extends StatefulWidget {
|
||||
|
||||
List<AskDocRequestType> requestData;
|
||||
|
||||
static int selectedParameterCode = 0;
|
||||
|
||||
AskDocDialog({@required this.requestData});
|
||||
|
||||
@override
|
||||
_AskDocDialogState createState() => _AskDocDialogState();
|
||||
}
|
||||
|
||||
class _AskDocDialogState extends State<AskDocDialog> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Dialog(
|
||||
shape:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.77,
|
||||
width: 450.0,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.all(20.0),
|
||||
child: Text(TranslationBase.of(context).requestType,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: "Open-Sans-Bold")),
|
||||
),
|
||||
Container(
|
||||
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
|
||||
child: CustomRadio(requestData: widget.requestData),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 40.0,
|
||||
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
|
||||
child: RaisedButton(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
side: BorderSide(color: Colors.blue)),
|
||||
color: Colors.blue,
|
||||
onPressed: () {
|
||||
if(AskDocDialog.selectedParameterCode != 0)
|
||||
Navigator.pop(context, AskDocDialog.selectedParameterCode);
|
||||
else
|
||||
AppToast.showErrorToast(message: "Please select request type to continue");
|
||||
},
|
||||
child: Text(TranslationBase.of(context).confirm,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Open-Sans-Bold')),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0),
|
||||
child: OutlineButton(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0)),
|
||||
color: Colors.red,
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
highlightColor: Colors.red,
|
||||
highlightedBorderColor: Colors.red,
|
||||
onPressed: () {
|
||||
Navigator.pop(context, null);
|
||||
},
|
||||
child: Text(TranslationBase.of(context).cancel_nocaps,
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Open-Sans-Bold')),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue