Merge branch 'new_prescreption' into 'development'
New prescreption See merge request Cloud_Solution/doctor_app_flutter!968merge-requests/969/head
commit
f4c7be6cc2
@ -0,0 +1,145 @@
|
||||
class PrescriptionEntityModel {
|
||||
dynamic appointmentNo;
|
||||
dynamic clinicName;
|
||||
dynamic createdBy;
|
||||
dynamic createdOn;
|
||||
dynamic doctorName;
|
||||
dynamic doseDailyQuantity;
|
||||
dynamic doseDailyUnitID;
|
||||
dynamic doseDetail;
|
||||
dynamic doseDurationDays;
|
||||
dynamic doseTimingID;
|
||||
dynamic episodeID;
|
||||
dynamic frequencyID;
|
||||
dynamic icdCode10ID;
|
||||
dynamic indication;
|
||||
dynamic isDispensed;
|
||||
dynamic isMedicineCovered;
|
||||
dynamic isSIG;
|
||||
dynamic medicationName;
|
||||
dynamic medicationPrice;
|
||||
dynamic medicineCode;
|
||||
dynamic orderTypeDescription;
|
||||
dynamic qty;
|
||||
dynamic quantity;
|
||||
dynamic remarks;
|
||||
dynamic routeID;
|
||||
dynamic startDate;
|
||||
dynamic status;
|
||||
dynamic stopDate;
|
||||
dynamic uom;
|
||||
dynamic pharmacistRemarks;
|
||||
dynamic pharmacyInervention;
|
||||
dynamic refill;
|
||||
dynamic mediSpanGPICode;
|
||||
|
||||
PrescriptionEntityModel(
|
||||
{this.appointmentNo,
|
||||
this.clinicName,
|
||||
this.createdBy,
|
||||
this.createdOn,
|
||||
this.doctorName,
|
||||
this.doseDailyQuantity,
|
||||
this.doseDailyUnitID,
|
||||
this.doseDetail,
|
||||
this.doseDurationDays,
|
||||
this.doseTimingID,
|
||||
this.episodeID,
|
||||
this.frequencyID,
|
||||
this.icdCode10ID,
|
||||
this.indication,
|
||||
this.isDispensed,
|
||||
this.isMedicineCovered,
|
||||
this.isSIG,
|
||||
this.medicationName,
|
||||
this.medicationPrice,
|
||||
this.medicineCode,
|
||||
this.orderTypeDescription,
|
||||
this.qty,
|
||||
this.quantity,
|
||||
this.remarks,
|
||||
this.routeID,
|
||||
this.startDate,
|
||||
this.status,
|
||||
this.stopDate,
|
||||
this.uom,
|
||||
this.pharmacistRemarks,
|
||||
this.mediSpanGPICode,
|
||||
this.pharmacyInervention,
|
||||
this.refill});
|
||||
|
||||
PrescriptionEntityModel.fromJson(Map<String, dynamic> json) {
|
||||
appointmentNo = json['appointmentNo'];
|
||||
clinicName = json['clinicName'];
|
||||
createdBy = json['createdBy'];
|
||||
createdOn = json['createdOn'];
|
||||
doctorName = json['doctorName'];
|
||||
doseDailyQuantity = json['doseDailyQuantity'];
|
||||
doseDailyUnitID = json['doseDailyUnitID'];
|
||||
doseDetail = json['doseDetail'];
|
||||
doseDurationDays = json['doseDurationDays'];
|
||||
doseTimingID = json['doseTimingID'];
|
||||
episodeID = json['episodeID'];
|
||||
frequencyID = json['frequencyID'];
|
||||
icdCode10ID = json['icdCode10ID'];
|
||||
indication = json['indication'];
|
||||
isDispensed = json['isDispensed'];
|
||||
isMedicineCovered = json['isMedicineCovered'];
|
||||
isSIG = json['isSIG'];
|
||||
medicationName = json['medicationName'];
|
||||
medicationPrice = json['medicationPrice'];
|
||||
medicineCode = json['medicineCode'];
|
||||
orderTypeDescription = json['orderTypeDescription'];
|
||||
qty = json['qty'];
|
||||
quantity = json['quantity'];
|
||||
remarks = json['remarks'];
|
||||
routeID = json['routeID'];
|
||||
startDate = json['startDate'];
|
||||
status = json['status'];
|
||||
stopDate = json['stopDate'];
|
||||
uom = json['uom'];
|
||||
pharmacistRemarks = json['pharmacistRemarks'];
|
||||
mediSpanGPICode = json['mediSpanGPICode'];
|
||||
refill = json['refill'];
|
||||
pharmacyInervention = json['interventionID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['appointmentNo'] = this.appointmentNo;
|
||||
data['clinicName'] = this.clinicName;
|
||||
data['createdBy'] = this.createdBy;
|
||||
data['createdOn'] = this.createdOn;
|
||||
data['doctorName'] = this.doctorName;
|
||||
data['doseDailyQuantity'] = this.doseDailyQuantity;
|
||||
data['doseDailyUnitID'] = this.doseDailyUnitID;
|
||||
data['doseDetail'] = this.doseDetail;
|
||||
data['doseDurationDays'] = this.doseDurationDays;
|
||||
data['doseTimingID'] = this.doseTimingID;
|
||||
data['episodeID'] = this.episodeID;
|
||||
data['frequencyID'] = this.frequencyID;
|
||||
data['icdCode10ID'] = this.icdCode10ID;
|
||||
data['indication'] = this.indication;
|
||||
data['isDispensed'] = this.isDispensed;
|
||||
data['isMedicineCovered'] = this.isMedicineCovered;
|
||||
data['isSIG'] = this.isSIG;
|
||||
data['medicationName'] = this.medicationName;
|
||||
data['medicationPrice'] = this.medicationPrice;
|
||||
data['medicineCode'] = this.medicineCode;
|
||||
data['orderTypeDescription'] = this.orderTypeDescription;
|
||||
data['qty'] = this.qty;
|
||||
data['quantity'] = this.quantity;
|
||||
data['remarks'] = this.remarks;
|
||||
data['routeID'] = this.routeID;
|
||||
data['startDate'] = this.startDate;
|
||||
data['status'] = this.status;
|
||||
data['stopDate'] = this.stopDate;
|
||||
data['uom'] = this.uom;
|
||||
data['pharmacistRemarks'] = this.pharmacistRemarks;
|
||||
data['mediSpanGPICode'] = this.mediSpanGPICode;
|
||||
data['refill'] = this.refill;
|
||||
data['interventionID'] = this.pharmacyInervention;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,26 +1,20 @@
|
||||
class PrescriptionReqModel {
|
||||
String vidaAuthTokenID;
|
||||
dynamic patientMRN;
|
||||
dynamic appNo;
|
||||
dynamic admissionNo;
|
||||
|
||||
PrescriptionReqModel(
|
||||
{this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo});
|
||||
{ this.patientMRN, this.appNo});
|
||||
|
||||
PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
|
||||
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||
patientMRN = json['PatientMRN'];
|
||||
appNo = json['AppointmentNo'];
|
||||
admissionNo = json['AdmissionNo'];
|
||||
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||
data['PatientMRN'] = this.patientMRN;
|
||||
data['AppointmentNo'] = this.appNo;
|
||||
data['AdmissionNo'] = this.admissionNo;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,238 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/in_patient_prescription_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import '../../base/base_service.dart';
|
||||
|
||||
class PrescriptionsService extends BaseService {
|
||||
List<Prescriptions> prescriptionsList = List();
|
||||
List<GetMedicationForInPatientModel> medicationForInPatient = List();
|
||||
List<PrescriptionsOrder> prescriptionsOrderList = List();
|
||||
List<PrescriotionInPatient> prescriptionInPatientList = List();
|
||||
|
||||
InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel =
|
||||
InPatientPrescriptionRequestModel();
|
||||
GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel =
|
||||
GetMedicationForInPatientRequestModel();
|
||||
|
||||
Future getPrescriptionInPatient({int mrn, String adn}) async {
|
||||
_inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(
|
||||
patientMRN: mrn,
|
||||
admissionNo: adn,
|
||||
);
|
||||
hasError = false;
|
||||
prescriptionInPatientList.clear();
|
||||
|
||||
await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
prescriptionsList.clear();
|
||||
response['List_PrescriptionReportForInPatient'].forEach((prescriptions) {
|
||||
prescriptionInPatientList
|
||||
.add(PrescriotionInPatient.fromJson(prescriptions));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: _inPatientPrescriptionRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future getPrescriptions(PatiantInformtion patient) async {
|
||||
hasError = false;
|
||||
Map<String, dynamic> body = Map();
|
||||
body['isDentalAllowedBackend'] = false;
|
||||
await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
prescriptionsList.clear();
|
||||
response['PatientPrescriptionList'].forEach((prescriptions) {
|
||||
prescriptionsList.add(Prescriptions.fromJson(prescriptions));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
RequestPrescriptionReport _requestPrescriptionReport =
|
||||
RequestPrescriptionReport(
|
||||
appointmentNo: 0, isDentalAllowedBackend: false);
|
||||
List<PrescriptionReport> prescriptionReportList = List();
|
||||
|
||||
Future getPrescriptionReport(
|
||||
{Prescriptions prescriptions,
|
||||
@required PatiantInformtion patient}) async {
|
||||
hasError = false;
|
||||
_requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo;
|
||||
_requestPrescriptionReport.projectID = prescriptions.projectID;
|
||||
_requestPrescriptionReport.clinicID = prescriptions.clinicID;
|
||||
_requestPrescriptionReport.setupID = prescriptions.setupID;
|
||||
_requestPrescriptionReport.episodeID = prescriptions.episodeID;
|
||||
_requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo;
|
||||
|
||||
await baseAppClient.postPatient(
|
||||
prescriptions.isInOutPatient
|
||||
? GET_PRESCRIPTION_REPORT_ENH
|
||||
: GET_PRESCRIPTION_REPORT_NEW,
|
||||
patient: patient, onSuccess: (dynamic response, int statusCode) {
|
||||
prescriptionReportList.clear();
|
||||
prescriptionReportEnhList.clear();
|
||||
if (prescriptions.isInOutPatient) {
|
||||
response['ListPRM'].forEach((prescriptions) {
|
||||
prescriptionReportList
|
||||
.add(PrescriptionReport.fromJson(prescriptions));
|
||||
prescriptionReportEnhList
|
||||
.add(PrescriptionReportEnh.fromJson(prescriptions));
|
||||
});
|
||||
} else {
|
||||
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
|
||||
prescriptionReportList
|
||||
.add(PrescriptionReport.fromJson(prescriptions));
|
||||
});
|
||||
}
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: _requestPrescriptionReport.toJson());
|
||||
}
|
||||
|
||||
RequestGetListPharmacyForPrescriptions
|
||||
requestGetListPharmacyForPrescriptions =
|
||||
RequestGetListPharmacyForPrescriptions(
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
isDentalAllowedBackend: false,
|
||||
);
|
||||
List<PharmacyPrescriptions> pharmacyPrescriptionsList = List();
|
||||
|
||||
Future getListPharmacyForPrescriptions(
|
||||
{int itemId, @required PatiantInformtion patient}) async {
|
||||
hasError = false;
|
||||
requestGetListPharmacyForPrescriptions.itemID = itemId;
|
||||
await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
pharmacyPrescriptionsList.clear();
|
||||
response['PharmList'].forEach((prescriptions) {
|
||||
pharmacyPrescriptionsList
|
||||
.add(PharmacyPrescriptions.fromJson(prescriptions));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: requestGetListPharmacyForPrescriptions.toJson());
|
||||
}
|
||||
|
||||
RequestPrescriptionReportEnh _requestPrescriptionReportEnh =
|
||||
RequestPrescriptionReportEnh(
|
||||
isDentalAllowedBackend: false,
|
||||
);
|
||||
|
||||
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
|
||||
|
||||
Future getPrescriptionReportEnh(
|
||||
{PrescriptionsOrder prescriptionsOrder,
|
||||
@required PatiantInformtion patient}) async {
|
||||
///This logic copy from the old app from class [order-history.component.ts] in line 45
|
||||
bool isInPatient = false;
|
||||
prescriptionsList.forEach((element) {
|
||||
if (prescriptionsOrder.appointmentNo == "0") {
|
||||
if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) {
|
||||
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
|
||||
_requestPrescriptionReportEnh.clinicID = element.clinicID;
|
||||
_requestPrescriptionReportEnh.projectID = element.projectID;
|
||||
_requestPrescriptionReportEnh.episodeID = element.episodeID;
|
||||
_requestPrescriptionReportEnh.setupID = element.setupID;
|
||||
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
|
||||
isInPatient = element.isInOutPatient;
|
||||
}
|
||||
} else {
|
||||
if (int.parse(prescriptionsOrder.appointmentNo) ==
|
||||
element.appointmentNo) {
|
||||
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
|
||||
_requestPrescriptionReportEnh.clinicID = element.clinicID;
|
||||
_requestPrescriptionReportEnh.projectID = element.projectID;
|
||||
_requestPrescriptionReportEnh.episodeID = element.episodeID;
|
||||
_requestPrescriptionReportEnh.setupID = element.setupID;
|
||||
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
|
||||
isInPatient = element.isInOutPatient;
|
||||
|
||||
///call inpGetPrescriptionReport
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
hasError = false;
|
||||
|
||||
await baseAppClient.postPatient(
|
||||
isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW,
|
||||
patient: patient, onSuccess: (dynamic response, int statusCode) {
|
||||
prescriptionReportEnhList.clear();
|
||||
|
||||
if (isInPatient) {
|
||||
response['ListPRM'].forEach((prescriptions) {
|
||||
prescriptionReportEnhList
|
||||
.add(PrescriptionReportEnh.fromJson(prescriptions));
|
||||
});
|
||||
} else {
|
||||
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
|
||||
PrescriptionReportEnh reportEnh =
|
||||
PrescriptionReportEnh.fromJson(prescriptions);
|
||||
reportEnh.itemDescription = prescriptions['ItemDescriptionN'];
|
||||
prescriptionReportEnhList.add(reportEnh);
|
||||
});
|
||||
}
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: _requestPrescriptionReportEnh.toJson());
|
||||
}
|
||||
|
||||
Future getPrescriptionsOrders() async {
|
||||
Map<String, dynamic> body = Map();
|
||||
body['isDentalAllowedBackend'] = false;
|
||||
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
prescriptionsOrderList.clear();
|
||||
response['PatientER_GetPatientAllPresOrdersList']
|
||||
.forEach((prescriptionsOrder) {
|
||||
prescriptionsOrderList
|
||||
.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
Future getMedicationForInPatient(PatiantInformtion patient) async {
|
||||
hasError = false;
|
||||
_getMedicationForInPatientRequestModel =
|
||||
GetMedicationForInPatientRequestModel(
|
||||
isDentalAllowedBackend: false,
|
||||
admissionNo: int.parse(patient.admissionNo),
|
||||
tokenID: "@dm!n",
|
||||
projectID: patient.projectId,
|
||||
);
|
||||
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT,
|
||||
patient: patient, onSuccess: (dynamic response, int statusCode) {
|
||||
medicationForInPatient.clear();
|
||||
response['List_GetMedicationForInpatient'].forEach((prescriptions) {
|
||||
medicationForInPatient
|
||||
.add(GetMedicationForInPatientModel.fromJson(prescriptions));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: _getMedicationForInPatientRequestModel.toJson());
|
||||
}
|
||||
}
|
||||
@ -1,163 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
|
||||
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../locator.dart';
|
||||
import 'base_view_model.dart';
|
||||
|
||||
class PrescriptionsViewModel extends BaseViewModel {
|
||||
FilterType filterType = FilterType.Clinic;
|
||||
PrescriptionsService _prescriptionsService = locator<PrescriptionsService>();
|
||||
|
||||
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
|
||||
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
|
||||
|
||||
List<PrescriptionReport> get prescriptionReportList =>
|
||||
_prescriptionsService.prescriptionReportList;
|
||||
|
||||
List<Prescriptions> get prescriptionsList =>
|
||||
_prescriptionsService.prescriptionsList;
|
||||
|
||||
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
|
||||
_prescriptionsService.pharmacyPrescriptionsList;
|
||||
|
||||
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
|
||||
_prescriptionsService.prescriptionReportEnhList;
|
||||
|
||||
List<PrescriptionsList> get prescriptionsOrderList =>
|
||||
filterType == FilterType.Clinic
|
||||
? _prescriptionsOrderListClinic
|
||||
: _prescriptionsOrderListHospital;
|
||||
|
||||
List<GetMedicationForInPatientModel> get medicationForInPatient =>
|
||||
_prescriptionsService.medicationForInPatient;
|
||||
|
||||
List<PrescriptionsList> _medicationForInPatient = List();
|
||||
|
||||
getPrescriptions(PatiantInformtion patient) async {
|
||||
setState(ViewState.Busy);
|
||||
await _prescriptionsService.getPrescriptions(patient);
|
||||
if (_prescriptionsService.hasError) {
|
||||
error = _prescriptionsService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
_filterList();
|
||||
await _getPrescriptionsOrders();
|
||||
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
_getPrescriptionsOrders() async {
|
||||
await _prescriptionsService.getPrescriptionsOrders();
|
||||
if (_prescriptionsService.hasError) {
|
||||
error = _prescriptionsService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
void _filterList() {
|
||||
_prescriptionsService.prescriptionsList.forEach((element) {
|
||||
/// PrescriptionsList list sort clinic
|
||||
List<PrescriptionsList> prescriptionsByClinic =
|
||||
_prescriptionsOrderListClinic
|
||||
.where((elementClinic) =>
|
||||
elementClinic.filterName == element.clinicDescription)
|
||||
.toList();
|
||||
|
||||
if (prescriptionsByClinic.length != 0) {
|
||||
_prescriptionsOrderListClinic[
|
||||
_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
|
||||
.prescriptionsList
|
||||
.add(element);
|
||||
} else {
|
||||
_prescriptionsOrderListClinic.add(PrescriptionsList(
|
||||
filterName: element.clinicDescription, prescriptions: element));
|
||||
}
|
||||
|
||||
/// PrescriptionsList list sort via hospital
|
||||
List<PrescriptionsList> prescriptionsByHospital =
|
||||
_prescriptionsOrderListHospital
|
||||
.where(
|
||||
(elementClinic) => elementClinic.filterName == element.name,
|
||||
)
|
||||
.toList();
|
||||
|
||||
if (prescriptionsByHospital.length != 0) {
|
||||
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital
|
||||
.indexOf(prescriptionsByHospital[0])]
|
||||
.prescriptionsList
|
||||
.add(element);
|
||||
} else {
|
||||
_prescriptionsOrderListHospital.add(PrescriptionsList(
|
||||
filterName: element.name, prescriptions: element));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setFilterType(FilterType filterType) {
|
||||
this.filterType = filterType;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
getPrescriptionReport(
|
||||
{Prescriptions prescriptions,
|
||||
@required PatiantInformtion patient}) async {
|
||||
setState(ViewState.Busy);
|
||||
await _prescriptionsService.getPrescriptionReport(
|
||||
prescriptions: prescriptions, patient: patient);
|
||||
if (_prescriptionsService.hasError) {
|
||||
error = _prescriptionsService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
getListPharmacyForPrescriptions(
|
||||
{int itemId, @required PatiantInformtion patient}) async {
|
||||
setState(ViewState.Busy);
|
||||
await _prescriptionsService.getListPharmacyForPrescriptions(
|
||||
itemId: itemId, patient: patient);
|
||||
if (_prescriptionsService.hasError) {
|
||||
error = _prescriptionsService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
getPrescriptionReportEnh(
|
||||
{PrescriptionsOrder prescriptionsOrder,
|
||||
@required PatiantInformtion patient}) async {
|
||||
setState(ViewState.Busy);
|
||||
await _prescriptionsService.getPrescriptionReportEnh(
|
||||
prescriptionsOrder: prescriptionsOrder, patient: patient);
|
||||
if (_prescriptionsService.hasError) {
|
||||
error = _prescriptionsService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
getMedicationForInPatient(PatiantInformtion patient) async {
|
||||
await _prescriptionsService.getMedicationForInPatient(patient);
|
||||
if (_prescriptionsService.hasError) {
|
||||
error = _prescriptionsService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,146 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'drug_to_drug.dart';
|
||||
|
||||
class AddDrugWidget extends StatefulWidget {
|
||||
final PatiantInformtion patient;
|
||||
final List<PrescriptionModel> prescriptionList;
|
||||
final MedicineViewModel medicineModel;
|
||||
final PrescriptionViewModel modelPrescription;
|
||||
final dynamic units;
|
||||
final dynamic route;
|
||||
final dynamic frequency;
|
||||
final dynamic duration;
|
||||
final dynamic doseTime;
|
||||
final dynamic uom;
|
||||
final dynamic x;
|
||||
final GetMedicationResponseModel selectedMedication;
|
||||
final String strength;
|
||||
final String indication;
|
||||
final String instruction;
|
||||
final DateTime selectedDate;
|
||||
|
||||
const AddDrugWidget(
|
||||
{Key key,
|
||||
this.patient,
|
||||
this.prescriptionList,
|
||||
this.medicineModel,
|
||||
this.modelPrescription,
|
||||
this.units,
|
||||
this.route,
|
||||
this.frequency,
|
||||
this.duration,
|
||||
this.doseTime,
|
||||
this.uom,
|
||||
this.x,
|
||||
this.selectedMedication,
|
||||
this.strength,
|
||||
this.indication,
|
||||
this.instruction,
|
||||
this.selectedDate})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AddDrugWidgetState createState() => _AddDrugWidgetState();
|
||||
}
|
||||
|
||||
class _AddDrugWidgetState extends State<AddDrugWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
baseViewModel: widget.medicineModel,
|
||||
appBar:
|
||||
BottomSheetTitle(title: TranslationBase.of(context).addMedication),
|
||||
body: Container(
|
||||
height: SizeConfig.realScreenHeight * .8,
|
||||
width: SizeConfig.realScreenWidth,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
DrugToDrug(
|
||||
widget.patient,
|
||||
widget.medicineModel.getPrescriptionForDrug(
|
||||
widget.prescriptionList, widget.medicineModel),
|
||||
widget.medicineModel.patientAssessmentList),
|
||||
],
|
||||
)),
|
||||
),
|
||||
bottomSheet: widget.medicineModel.state == ViewState.BusyLocal ||
|
||||
widget.medicineModel.state == ViewState.Busy
|
||||
? Container(
|
||||
height: 0,
|
||||
)
|
||||
: BottomSheetDialogButton(
|
||||
label: TranslationBase.of(context).addMedication,
|
||||
onTap: () async {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
await widget.medicineModel.postPrescription(
|
||||
isLocalBusy: true,
|
||||
icdCode: widget.medicineModel.patientAssessmentList.isNotEmpty
|
||||
? widget.medicineModel.patientAssessmentList[0]
|
||||
.icdCode10ID.isEmpty
|
||||
? "test"
|
||||
: widget.medicineModel.patientAssessmentList[0]
|
||||
.icdCode10ID
|
||||
.toString()
|
||||
: "test",
|
||||
dose: widget.strength,
|
||||
doseUnit:
|
||||
widget.medicineModel.itemMedicineListUnit.length == 1
|
||||
? widget.medicineModel
|
||||
.itemMedicineListUnit[0]['parameterCode']
|
||||
.toString()
|
||||
: widget.units['parameterCode'].toString(),
|
||||
patient: widget.patient,
|
||||
doseTimeIn: widget.doseTime['id'].toString(),
|
||||
model: widget.modelPrescription,
|
||||
duration: widget.duration['id'].toString(),
|
||||
frequency: widget.medicineModel.itemMedicineList.length == 1
|
||||
? widget
|
||||
.medicineModel.itemMedicineList[0]['parameterCode']
|
||||
.toString()
|
||||
: widget.frequency['parameterCode'].toString(),
|
||||
route: widget.medicineModel.itemMedicineListRoute.length == 1
|
||||
? widget.medicineModel
|
||||
.itemMedicineListRoute[0]['parameterCode']
|
||||
.toString()
|
||||
: widget.route['parameterCode'].toString(),
|
||||
drugId: widget.selectedMedication.itemId.toString(),
|
||||
strength: widget.strength,
|
||||
indication: widget.indication,
|
||||
instruction: widget.instruction,
|
||||
doseTime: widget.selectedDate,
|
||||
);
|
||||
if (widget.medicineModel.state == ViewState.ErrorLocal) {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
Helpers.showErrorToast(widget.medicineModel.error);
|
||||
} else if (widget.modelPrescription.state == ViewState.Idle) {
|
||||
await widget.modelPrescription.getPrescriptionListNew(
|
||||
appNo: widget.patient.appointmentNo,
|
||||
mrn: widget.patient.patientMRN,
|
||||
isLocalBusy: true);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
DrAppToastMsg.showSuccesToast(
|
||||
TranslationBase.of(context).medicationHasBeenAdded);
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
|
||||
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/add_prescription/prescription_form_widget.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/add_prescription/search_preescription_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:speech_to_text/speech_to_text.dart' as stt;
|
||||
|
||||
class AddPrescription extends StatefulWidget {
|
||||
final PrescriptionViewModel prescriptionViewModel;
|
||||
final PatiantInformtion patient;
|
||||
final List<PrescriptionModel> prescriptionList;
|
||||
|
||||
AddPrescription(
|
||||
this.prescriptionViewModel, this.patient, this.prescriptionList);
|
||||
|
||||
@override
|
||||
_AddPrescriptionState createState() => _AddPrescriptionState();
|
||||
}
|
||||
|
||||
class _AddPrescriptionState extends State<AddPrescription> {
|
||||
String routeError;
|
||||
String frequencyError;
|
||||
String doseTimeError;
|
||||
String durationError;
|
||||
String unitError;
|
||||
String strengthError;
|
||||
int selectedType;
|
||||
|
||||
bool visibilitySearch = true;
|
||||
|
||||
TextEditingController strengthController = TextEditingController();
|
||||
TextEditingController unitController = TextEditingController();
|
||||
TextEditingController indicationController = TextEditingController();
|
||||
TextEditingController instructionController = TextEditingController();
|
||||
|
||||
bool visibilityPrescriptionForm = false;
|
||||
|
||||
final myController = TextEditingController();
|
||||
DateTime selectedDate;
|
||||
int strengthChar;
|
||||
GetMedicationResponseModel _selectedMedication;
|
||||
MedicineViewModel medicineViewModel;
|
||||
|
||||
GlobalKey key =
|
||||
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
||||
|
||||
TextEditingController drugIdController = TextEditingController();
|
||||
TextEditingController doseController = TextEditingController();
|
||||
final searchController = TextEditingController();
|
||||
stt.SpeechToText speech = stt.SpeechToText();
|
||||
var event = RobotProvider();
|
||||
var recognizedWord;
|
||||
|
||||
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||
final double spaceBetweenTextFields = 12;
|
||||
dynamic route;
|
||||
dynamic frequency;
|
||||
dynamic duration;
|
||||
dynamic doseTime;
|
||||
dynamic indication;
|
||||
dynamic units;
|
||||
dynamic uom;
|
||||
dynamic box;
|
||||
dynamic x;
|
||||
|
||||
PatiantInformtion patient;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<MedicineViewModel>(
|
||||
builder: (
|
||||
BuildContext context,
|
||||
MedicineViewModel model,
|
||||
Widget child,
|
||||
) =>
|
||||
NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
FocusScope.of(context).requestFocus(new FocusNode());
|
||||
},
|
||||
child: DraggableScrollableSheet(
|
||||
initialChildSize: 0.98,
|
||||
maxChildSize: 0.98,
|
||||
minChildSize: 0.9,
|
||||
builder:
|
||||
(BuildContext context, ScrollController scrollController) {
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 1.65,
|
||||
color: Color(0xffF8F8F8),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.0, vertical: 10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 60,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: spaceBetweenTextFields,
|
||||
),
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: visibilitySearch,
|
||||
child: SearchPrescriptionWidget(
|
||||
spaceBetweenTextFields:
|
||||
spaceBetweenTextFields,
|
||||
medicineViewModel: model,
|
||||
prescriptionViewModel:
|
||||
widget.prescriptionViewModel,
|
||||
onItemSelected:
|
||||
(GetMedicationResponseModel
|
||||
medication) async {
|
||||
setState(() {
|
||||
visibilitySearch = !visibilitySearch;
|
||||
_selectedMedication = medication;
|
||||
});
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
await model.getAssessmentList(patientInfo: widget.patient, isLocalBusy: true);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
},
|
||||
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !visibilitySearch,
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
PrescriptionFormWidget(
|
||||
patient: widget.patient,
|
||||
prescriptionViewModel:
|
||||
widget.prescriptionViewModel,
|
||||
medicineViewModel: model,
|
||||
prescriptionList:
|
||||
widget.prescriptionList,
|
||||
selectedMedication: _selectedMedication,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,547 @@
|
||||
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
|
||||
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
|
||||
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
||||
import 'package:doctor_app_flutter/locator.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:speech_to_text/speech_recognition_error.dart';
|
||||
import 'package:speech_to_text/speech_to_text.dart' as stt;
|
||||
import '../../../widgets/transitions/slide_up_page.dart';
|
||||
import 'add_drug/add_drug_widget.dart';
|
||||
|
||||
class PrescriptionFormWidget extends StatefulWidget {
|
||||
final PatiantInformtion patient;
|
||||
final List<PrescriptionModel> prescriptionList;
|
||||
final PrescriptionViewModel prescriptionViewModel;
|
||||
final MedicineViewModel medicineViewModel;
|
||||
final GetMedicationResponseModel selectedMedication;
|
||||
|
||||
const PrescriptionFormWidget(
|
||||
{Key key,
|
||||
this.patient,
|
||||
this.prescriptionList,
|
||||
this.prescriptionViewModel,
|
||||
this.medicineViewModel,
|
||||
this.selectedMedication});
|
||||
|
||||
@override
|
||||
_PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState();
|
||||
}
|
||||
|
||||
class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
||||
String routeError;
|
||||
String frequencyError;
|
||||
String doseTimeError;
|
||||
String durationError;
|
||||
String unitError;
|
||||
String strengthError;
|
||||
|
||||
int selectedType;
|
||||
|
||||
TextEditingController strengthController = TextEditingController();
|
||||
TextEditingController unitController = TextEditingController();
|
||||
TextEditingController indicationController = TextEditingController();
|
||||
TextEditingController instructionController = TextEditingController();
|
||||
|
||||
bool visibilityPrescriptionForm = false;
|
||||
bool visibilitySearch = true;
|
||||
|
||||
final myController = TextEditingController();
|
||||
DateTime selectedDate;
|
||||
int strengthChar;
|
||||
GlobalKey key =
|
||||
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
||||
|
||||
TextEditingController drugIdController = TextEditingController();
|
||||
TextEditingController doseController = TextEditingController();
|
||||
final searchController = TextEditingController();
|
||||
stt.SpeechToText speech = stt.SpeechToText();
|
||||
var event = RobotProvider();
|
||||
var recognizedWord;
|
||||
|
||||
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||
final double spaceBetweenTextFields = 12;
|
||||
dynamic route;
|
||||
dynamic frequency;
|
||||
dynamic duration;
|
||||
dynamic doseTime;
|
||||
dynamic units;
|
||||
dynamic uom;
|
||||
dynamic box;
|
||||
dynamic x;
|
||||
|
||||
setSelectedType(int val) {
|
||||
setState(() {
|
||||
selectedType = val;
|
||||
});
|
||||
}
|
||||
|
||||
onVoiceText() async {
|
||||
new SpeechToText(context: context).showAlertDialog(context);
|
||||
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
|
||||
bool available = await speech.initialize(
|
||||
onStatus: statusListener, onError: errorListener);
|
||||
if (available) {
|
||||
speech.listen(
|
||||
onResult: resultListener,
|
||||
listenMode: stt.ListenMode.confirmation,
|
||||
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
|
||||
);
|
||||
} else {
|
||||
print("The user has denied the use of speech recognition.");
|
||||
}
|
||||
}
|
||||
|
||||
void errorListener(SpeechRecognitionError error) {
|
||||
event.setValue({"searchText": 'null'});
|
||||
print(error);
|
||||
}
|
||||
|
||||
void statusListener(String status) {
|
||||
recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
|
||||
}
|
||||
|
||||
void resultListener(result) {
|
||||
recognizedWord = result.recognizedWords;
|
||||
event.setValue({"searchText": recognizedWord});
|
||||
|
||||
if (result.finalResult == true) {
|
||||
setState(() {
|
||||
SpeechToText.closeAlertDialog(context);
|
||||
speech.stop();
|
||||
instructionController.text += recognizedWord + '\n';
|
||||
});
|
||||
} else {
|
||||
print(result.finalResult);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> initSpeechState() async {
|
||||
bool hasSpeech = await speech.initialize(
|
||||
onError: errorListener, onStatus: statusListener);
|
||||
print(hasSpeech);
|
||||
if (!mounted) return;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
return Form(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
AppText(
|
||||
widget.selectedMedication?.description ?? "",
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
SizedBox(
|
||||
height: 15.0,
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context).orderType,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
Radio(
|
||||
activeColor: AppGlobal.appRedColor,
|
||||
value: 1,
|
||||
groupValue: selectedType,
|
||||
onChanged: (value) {
|
||||
setSelectedType(value);
|
||||
},
|
||||
),
|
||||
Text(TranslationBase.of(context).regular),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.35,
|
||||
child: AppTextFieldCustom(
|
||||
validationError: strengthError,
|
||||
hintText: TranslationBase.of(context).strength,
|
||||
isTextFieldHasSuffix: false,
|
||||
enabled: true,
|
||||
controller: strengthController,
|
||||
onChanged: (String value) {
|
||||
setState(() {
|
||||
strengthChar = value.length;
|
||||
});
|
||||
if (strengthChar >= 5) {
|
||||
DrAppToastMsg.showErrorToast(
|
||||
TranslationBase.of(context)
|
||||
.only5DigitsAllowedForStrength,
|
||||
);
|
||||
}
|
||||
},
|
||||
inputType: TextInputType.numberWithOptions(
|
||||
decimal: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 5.0,
|
||||
),
|
||||
PrescriptionTextFiled(
|
||||
width: MediaQuery.of(context).size.width * 0.510,
|
||||
element:
|
||||
widget.medicineViewModel.itemMedicineListUnit.length == 1
|
||||
? widget.medicineViewModel.itemMedicineListUnit[0]
|
||||
: units,
|
||||
elementError: unitError,
|
||||
keyName: 'description',
|
||||
keyId: 'parameterCode',
|
||||
hintText: TranslationBase.of(context).unit,
|
||||
elementList: widget.medicineViewModel.itemMedicineListUnit,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
units = selectedValue;
|
||||
units['isDefault'] = true;
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
PrescriptionTextFiled(
|
||||
elementList: widget.medicineViewModel.itemMedicineListRoute,
|
||||
element: widget.medicineViewModel.itemMedicineListRoute.length == 1
|
||||
? route = widget.medicineViewModel.itemMedicineListRoute[0]
|
||||
: route,
|
||||
elementError: routeError,
|
||||
keyId: 'parameterCode',
|
||||
keyName: 'description',
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
route = selectedValue;
|
||||
route['isDefault'] = true;
|
||||
});
|
||||
},
|
||||
hintText: TranslationBase.of(context).route,
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
PrescriptionTextFiled(
|
||||
hintText: TranslationBase.of(context).frequency,
|
||||
elementError: frequencyError,
|
||||
// element: frequency,
|
||||
element: widget.medicineViewModel.itemMedicineListRoute.length == 1
|
||||
? frequency = widget.medicineViewModel.itemMedicineListRoute[0]
|
||||
: frequency,
|
||||
elementList: widget.medicineViewModel.itemMedicineList,
|
||||
keyId: 'parameterCode',
|
||||
keyName: 'description',
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
frequency = selectedValue;
|
||||
frequency['isDefault'] = true;
|
||||
if (widget.selectedMedication != null &&
|
||||
duration != null &&
|
||||
frequency != null &&
|
||||
strengthController.text != null) {
|
||||
widget.medicineViewModel.getBoxQuantity(
|
||||
freq: frequency['parameterCode'],
|
||||
duration: duration['id'],
|
||||
itemCode: widget.selectedMedication.itemId,
|
||||
strength: double.parse(strengthController.text));
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
}),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
PrescriptionTextFiled(
|
||||
hintText: TranslationBase.of(context).doseTime,
|
||||
elementError: doseTimeError,
|
||||
element: doseTime,
|
||||
elementList: widget.medicineViewModel.medicationDoseTimeList,
|
||||
keyId: 'id',
|
||||
keyName: 'nameEn',
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
doseTime = selectedValue;
|
||||
});
|
||||
}),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
if (widget.medicineViewModel.patientAssessmentList.isNotEmpty)
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.29,
|
||||
child: AppTextFieldCustom(
|
||||
hintText: widget
|
||||
.medicineViewModel.patientAssessmentList[0].icdCode10ID
|
||||
.toString(),
|
||||
enabled: true,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.57,
|
||||
color: Colors.white,
|
||||
child: AppTextFieldCustom(
|
||||
maxLines: 5,
|
||||
hintText: widget
|
||||
.medicineViewModel.patientAssessmentList[0].asciiDesc
|
||||
.toString(),
|
||||
enabled: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields), Container(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => selectDate(context, widget.prescriptionViewModel),
|
||||
child: AppTextFieldCustom(
|
||||
validationError: strengthError,
|
||||
hintText: TranslationBase.of(context).date,
|
||||
isTextFieldHasSuffix: true,
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
Icons.calendar_today,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
dropDownText: selectedDate != null
|
||||
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
||||
: null,
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
PrescriptionTextFiled(
|
||||
element: duration,
|
||||
elementError: durationError,
|
||||
hintText: TranslationBase.of(context).duration,
|
||||
elementList: widget.medicineViewModel.medicationDurationList,
|
||||
keyName: 'nameEn',
|
||||
keyId: 'id',
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
duration = selectedValue;
|
||||
if (widget.selectedMedication != null &&
|
||||
duration != null &&
|
||||
frequency != null &&
|
||||
strengthController.text != null) {
|
||||
box = widget.medicineViewModel.boxQuintity;
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
child: AppTextFieldCustom(
|
||||
hintText: "UOM",
|
||||
isTextFieldHasSuffix: false,
|
||||
dropDownText: uom != null ? uom : null,
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
child: AppTextFieldCustom(
|
||||
hintText: TranslationBase.of(context).boxQuantity,
|
||||
isTextFieldHasSuffix: false,
|
||||
dropDownText: box != null
|
||||
? widget.medicineViewModel.boxQuintity.toString()
|
||||
: null,
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
child: Stack(
|
||||
children: [
|
||||
TextFields(
|
||||
maxLines: 6,
|
||||
minLines: 4,
|
||||
hintText: TranslationBase.of(context).instruction,
|
||||
controller: instructionController,
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 15,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
DoctorApp.speechtotext,
|
||||
color: Colors.black,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () {
|
||||
initSpeechState().then((value) => {onVoiceText()});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: spaceBetweenTextFields),
|
||||
Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
color: Color(0xff359846),
|
||||
title: TranslationBase.of(context).addMedication,
|
||||
fontWeight: FontWeight.w600,
|
||||
onPressed: () async {
|
||||
addMedicationButton(widget.medicineViewModel);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
selectDate(BuildContext context, PrescriptionViewModel model) async {
|
||||
Helpers.hideKeyboard(context);
|
||||
DateTime selectedDate;
|
||||
selectedDate = DateTime.now();
|
||||
final DateTime picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: selectedDate,
|
||||
firstDate: DateTime.now(),
|
||||
lastDate: DateTime(2040),
|
||||
initialEntryMode: DatePickerEntryMode.calendar,
|
||||
);
|
||||
if (picked != null && picked != selectedDate) {
|
||||
setState(() {
|
||||
this.selectedDate = picked;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
addMedicationButton(MedicineViewModel model) async {
|
||||
await locator<AnalyticsService>().logEvent(
|
||||
eventCategory: "Add Prescription Form",
|
||||
eventAction: "Add Prescription",
|
||||
);
|
||||
if (duration != null &&
|
||||
doseTime != null &&
|
||||
frequency != null &&
|
||||
selectedDate != null &&
|
||||
strengthController.text != "") {
|
||||
if (widget.selectedMedication.isNarcotic == true) {
|
||||
DrAppToastMsg.showErrorToast(TranslationBase.of(context)
|
||||
.narcoticMedicineCanOnlyBePrescribedFromVida);
|
||||
Navigator.pop(context);
|
||||
return;
|
||||
}
|
||||
|
||||
if (double.parse(strengthController.text) > 1000.0) {
|
||||
DrAppToastMsg.showErrorToast(TranslationBase.of(context).thousandIsTheMAXForTheStrength);
|
||||
return;
|
||||
}
|
||||
if (double.parse(strengthController.text) < 0.0) {
|
||||
DrAppToastMsg.showErrorToast(TranslationBase.of(context).strengthCanNotBeZero);
|
||||
return;
|
||||
}
|
||||
|
||||
if (formKey.currentState.validate()) {
|
||||
Navigator.push(
|
||||
context,
|
||||
SlideUpPageRoute(
|
||||
widget: AddDrugWidget(
|
||||
patient: widget.patient,
|
||||
medicineModel: widget.medicineViewModel,
|
||||
modelPrescription: widget.prescriptionViewModel,
|
||||
prescriptionList: widget.prescriptionList,
|
||||
route: route,
|
||||
doseTime: doseTime,
|
||||
duration: duration,
|
||||
frequency: frequency,
|
||||
units: units,
|
||||
uom: uom,
|
||||
x: x,
|
||||
selectedMedication: widget.selectedMedication,
|
||||
strength: strengthController.text,
|
||||
indication: indicationController.text,
|
||||
instruction: instructionController.text,
|
||||
selectedDate: selectedDate,
|
||||
),
|
||||
),
|
||||
);
|
||||
// Navigator.pop(context);
|
||||
// openDrugToDrug(model, prescriptionViewModel);
|
||||
}
|
||||
} else {
|
||||
setState(() {
|
||||
if (duration == null) {
|
||||
durationError = TranslationBase.of(context).fieldRequired;
|
||||
} else {
|
||||
durationError = null;
|
||||
}
|
||||
if (doseTime == null) {
|
||||
doseTimeError = TranslationBase.of(context).fieldRequired;
|
||||
} else {
|
||||
doseTimeError = null;
|
||||
}
|
||||
if (route == null) {
|
||||
routeError = TranslationBase.of(context).fieldRequired;
|
||||
} else {
|
||||
routeError = null;
|
||||
}
|
||||
if (frequency == null) {
|
||||
frequencyError = TranslationBase.of(context).fieldRequired;
|
||||
} else {
|
||||
frequencyError = null;
|
||||
}
|
||||
if (units == null) {
|
||||
unitError = TranslationBase.of(context).fieldRequired;
|
||||
} else {
|
||||
unitError = null;
|
||||
}
|
||||
if (strengthController.text == "") {
|
||||
strengthError = TranslationBase.of(context).fieldRequired;
|
||||
} else {
|
||||
strengthError = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
formKey.currentState.save();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import '../../../config/config.dart';
|
||||
import '../../../core/model/search_drug/get_medication_response_model.dart';
|
||||
import '../../../core/viewModel/medicine_view_model.dart';
|
||||
import '../../../core/viewModel/prescription/prescription_view_model.dart';
|
||||
import '../../../util/helpers.dart';
|
||||
import '../../../util/translations_delegate_base.dart';
|
||||
import '../../../widgets/medicine/medicine_item_widget.dart';
|
||||
import '../../../widgets/shared/buttons/app_buttons_widget.dart';
|
||||
import '../../../widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import '../../../widgets/shared/network_base_view.dart';
|
||||
import '../../../widgets/shared/text_fields/app_text_form_field.dart';
|
||||
import '../../base/base_view.dart';
|
||||
|
||||
final myController = TextEditingController();
|
||||
|
||||
class SearchPrescriptionWidget extends StatelessWidget {
|
||||
final double spaceBetweenTextFields;
|
||||
final MedicineViewModel medicineViewModel;
|
||||
final PrescriptionViewModel prescriptionViewModel;
|
||||
final Function(GetMedicationResponseModel) onItemSelected;
|
||||
|
||||
const SearchPrescriptionWidget(
|
||||
{Key key,
|
||||
this.spaceBetweenTextFields,
|
||||
this.medicineViewModel,
|
||||
this.prescriptionViewModel,
|
||||
this.onItemSelected})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<MedicineViewModel>(
|
||||
onModelReady: (model) async {},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
MedicineViewModel model,
|
||||
Widget child,
|
||||
) =>
|
||||
NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: Column(
|
||||
children: [
|
||||
FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(10),
|
||||
child: AppTextFormField(
|
||||
borderColor: Colors.white,
|
||||
hintText: TranslationBase.of(context).searchMedicineNameHere,
|
||||
controller: myController,
|
||||
onSaved: (value) {},
|
||||
onFieldSubmitted: (value) {
|
||||
searchMedicine(context, model);
|
||||
},
|
||||
inputFormatter: ONLY_LETTERS,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15.0,
|
||||
),
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
FractionallySizedBox(
|
||||
widthFactor: 0.8,
|
||||
child: Container(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: TranslationBase.of(context).search,
|
||||
onPressed: () async {
|
||||
await searchMedicine(
|
||||
context,
|
||||
model,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (myController.text != '')
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.5,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: model.allMedicationList == null
|
||||
? 0
|
||||
: model.allMedicationList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
child: MedicineItemWidget(
|
||||
label:
|
||||
model.allMedicationList[index].description),
|
||||
onTap: () async {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
await model.getItem(itemID: model.allMedicationList[index].itemId, isLocalBusy: true);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
onItemSelected(model.allMedicationList[index]);
|
||||
// uom = _selectedMedication.uom;
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: spaceBetweenTextFields,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
searchMedicine(context, MedicineViewModel model) async {
|
||||
FocusScope.of(context).unfocus();
|
||||
if (myController.text.length < 3) {
|
||||
Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
|
||||
return;
|
||||
}
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
await model.getMedicationList(drug: myController.text, isLocalBusy: true);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,180 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../util/helpers.dart';
|
||||
import '../../widgets/shared/errors/error_message.dart';
|
||||
|
||||
class NewPrescriptionsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
bool isInpatient = routeArgs['isInpatient'];
|
||||
bool isFromLiveCare = routeArgs['isFromLiveCare'];
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) async {
|
||||
model.getPrescriptionListNew(
|
||||
mrn: patient.patientMRN, appNo: patient.appointmentNo);
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Colors.grey[100],
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
isInpatient: isInpatient,
|
||||
),
|
||||
body: FractionallySizedBox(
|
||||
widthFactor: 1.0,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ServiceTitle(
|
||||
title: TranslationBase.of(context).orders,
|
||||
subTitle: TranslationBase.of(context).prescriptions,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if ((patient.patientStatusType != null &&
|
||||
patient.patientStatusType == 43) ||
|
||||
(isFromLiveCare && patient.appointmentNo != null))
|
||||
AddNewOrder(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
SlideUpPageRoute(
|
||||
widget: BaseAddProcedureTabPage(
|
||||
patient: patient,
|
||||
prescriptionModel: model,
|
||||
procedureType: ProcedureType.PRESCRIPTION,
|
||||
),
|
||||
settingRoute: 'AddProcedureTabPage'),
|
||||
);
|
||||
},
|
||||
label: TranslationBase.of(context)
|
||||
.applyForNewPrescriptionsOrder,
|
||||
),
|
||||
Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.92,
|
||||
child: ListView.builder(
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemCount: model.prescriptionListNew.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return InkWell(
|
||||
child: CardWithBgWidget(
|
||||
bgColor: Colors.transparent,
|
||||
widget: Column(
|
||||
children: [
|
||||
CustomRow(
|
||||
label: "",
|
||||
value: Helpers.convertToTitleCase(model
|
||||
.prescriptionListNew[index]
|
||||
.medicationName),
|
||||
valueSize: SizeConfig
|
||||
.getTextMultiplierBasedOnWidth() *
|
||||
3.5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
CustomRow(
|
||||
label: "Doctor Name :",
|
||||
value: model
|
||||
.prescriptionListNew[index].doctorName,
|
||||
),
|
||||
CustomRow(
|
||||
label: "Order Type Description :",
|
||||
value: model.prescriptionListNew[index]
|
||||
.orderTypeDescription,
|
||||
),
|
||||
CustomRow(
|
||||
label: "status :",
|
||||
value:
|
||||
model.prescriptionListNew[index].status,
|
||||
),
|
||||
CustomRow(
|
||||
label: "indication :",
|
||||
value: model
|
||||
.prescriptionListNew[index].indication,
|
||||
),
|
||||
CustomRow(
|
||||
label: "doseDetail :",
|
||||
value: model
|
||||
.prescriptionListNew[index].doseDetail,
|
||||
),
|
||||
CustomRow(
|
||||
label: "quantity :",
|
||||
value: model
|
||||
.prescriptionListNew[index].quantity
|
||||
.toString(),
|
||||
),CustomRow(
|
||||
label: "start Date :",
|
||||
value: model
|
||||
.prescriptionListNew[index].startDate
|
||||
.toString(),
|
||||
),CustomRow(
|
||||
label: "stop Date :",
|
||||
value: model
|
||||
.prescriptionListNew[index].stopDate
|
||||
.toString(),
|
||||
),
|
||||
if(model
|
||||
.prescriptionListNew[index].remarks != null&& model
|
||||
.prescriptionListNew[index].remarks!= "")
|
||||
CustomRow(
|
||||
label: "Remark :",
|
||||
value: model
|
||||
.prescriptionListNew[index].remarks
|
||||
.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),);
|
||||
}),
|
||||
),
|
||||
),
|
||||
if (model.prescriptionListNew.isEmpty &&
|
||||
patient.patientStatusType != 43)
|
||||
Center(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context).noPrescriptionsFound,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,234 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../util/helpers.dart';
|
||||
import '../../widgets/shared/errors/error_message.dart';
|
||||
|
||||
class OldPrescriptionsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
String patientType = routeArgs['patientType'];
|
||||
String arrivalType = routeArgs['arrivalType'];
|
||||
bool isInpatient = routeArgs['isInpatient'];
|
||||
bool isFromLiveCare = routeArgs['isFromLiveCare'];
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) async {
|
||||
patient.admissionNo == null
|
||||
? model.getPrescriptions(patient,
|
||||
patientType: patientType, isLocalBusy: false)
|
||||
: model.getMedicationForInPatient(patient);
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Colors.grey[100],
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
isInpatient: isInpatient,
|
||||
),
|
||||
body: patient.admissionNo == null
|
||||
? FractionallySizedBox(
|
||||
widthFactor: 1.0,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ServiceTitle(
|
||||
title: TranslationBase.of(context).orders,
|
||||
subTitle: TranslationBase.of(context)
|
||||
.prescriptions + "(${TranslationBase.of(context)
|
||||
.old }) ",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
ListView.builder(
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemCount: model.prescriptionsList.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: PrescriptionItemsPage(
|
||||
prescriptions: model
|
||||
.prescriptionsList[index],
|
||||
patient: patient,
|
||||
arrivalType: arrivalType,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
DoctorCard(
|
||||
doctorName:
|
||||
Helpers.convertToTitleCase(model
|
||||
.prescriptionsList[index]
|
||||
.doctorName),
|
||||
profileUrl: model
|
||||
.prescriptionsList[index]
|
||||
.doctorImageURL,
|
||||
branch: model
|
||||
.prescriptionsList[index].name,
|
||||
clinic: model.prescriptionsList[index]
|
||||
.clinicDescription,
|
||||
isPrescriptions: true,
|
||||
appointmentDate: AppDateUtils
|
||||
.getDateTimeFromServerFormat(
|
||||
model.prescriptionsList[index]
|
||||
.appointmentDate,
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
}),
|
||||
if (model.prescriptionsList.isEmpty &&
|
||||
patient.patientStatusType != 43)
|
||||
Center(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context)
|
||||
.noPrescriptionsFound,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
ServiceTitle(
|
||||
title: TranslationBase.of(context).orders,
|
||||
subTitle: TranslationBase.of(context)
|
||||
.prescriptions + "(${TranslationBase.of(context)
|
||||
.old }) ",
|
||||
),
|
||||
model.medicationForInPatient.length == 0?
|
||||
Center(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context)
|
||||
.noPrescriptionsFound,
|
||||
)): ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: model.medicationForInPatient.length,
|
||||
itemBuilder: (context, index) {
|
||||
//model.medicationForInPatient.length,
|
||||
return InkWell(
|
||||
child: CardWithBgWidget(
|
||||
bgColor: Colors.transparent,
|
||||
widget: Column(
|
||||
children: [
|
||||
CustomRow(
|
||||
label: "",
|
||||
value: Helpers.convertToTitleCase(model
|
||||
.medicationForInPatient[index]
|
||||
.pHRItemDescription),
|
||||
valueSize: SizeConfig
|
||||
.getTextMultiplierBasedOnWidth() *
|
||||
3.5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
CustomRow(
|
||||
label: "Doctor Name :",
|
||||
value: Helpers.convertToTitleCase(model
|
||||
.medicationForInPatient[index]
|
||||
.doctorName
|
||||
.toString()),
|
||||
),
|
||||
CustomRow(
|
||||
label: "Status :",
|
||||
value: Helpers.convertToTitleCase(model
|
||||
.medicationForInPatient[index]
|
||||
.statusDescription
|
||||
.toString()),
|
||||
),
|
||||
CustomRow(
|
||||
label: "dose :",
|
||||
value: Helpers.convertToTitleCase(model
|
||||
.medicationForInPatient[index]
|
||||
.dose
|
||||
.toString()),
|
||||
), CustomRow(
|
||||
label: "comments :",
|
||||
value: Helpers.convertToTitleCase(model
|
||||
.medicationForInPatient[index]
|
||||
.comments
|
||||
.toString()),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: PrescriptionItemsInPatientPage(
|
||||
prescriptionIndex: index,
|
||||
prescriptions:
|
||||
model.medicationForInPatient[index],
|
||||
patient: patient,
|
||||
patientType: patientType,
|
||||
arrivalType: arrivalType,
|
||||
startOn: AppDateUtils
|
||||
.getDateTimeFromServerFormat(
|
||||
model.medicationForInPatient[index]
|
||||
.startDatetime,
|
||||
),
|
||||
stopOn: AppDateUtils
|
||||
.getDateTimeFromServerFormat(
|
||||
model.medicationForInPatient[index]
|
||||
.stopDatetime,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1,168 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PrescriptionDetailsPage extends StatelessWidget {
|
||||
final PrescriptionReport prescriptionReport;
|
||||
|
||||
PrescriptionDetailsPage({Key key, this.prescriptionReport});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).prescriptions,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
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(
|
||||
prescriptionReport.imageSRCUrl,
|
||||
fit: BoxFit.cover,
|
||||
width: 60,
|
||||
height: 70,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: AppText(
|
||||
prescriptionReport.itemDescription.isNotEmpty
|
||||
? prescriptionReport.itemDescription
|
||||
: prescriptionReport.itemDescriptionN),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||
child: Table(
|
||||
border: TableBorder.symmetric(
|
||||
inside: BorderSide(width: 0.5),
|
||||
outside: BorderSide(width: 0.5)),
|
||||
children: [
|
||||
TableRow(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 30,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).route,
|
||||
fontSize: 14,
|
||||
))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 30,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).frequency,
|
||||
fontSize: 14,
|
||||
))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Center(
|
||||
child: AppText(
|
||||
"${TranslationBase.of(context).dailyDoses}",
|
||||
fontSize: 14,
|
||||
))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 30,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).duration,
|
||||
fontSize: 14,
|
||||
))),
|
||||
],
|
||||
),
|
||||
TableRow(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child:
|
||||
Center(child: Text(prescriptionReport.routeN))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child:
|
||||
Text(prescriptionReport.frequencyN ?? ''))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${prescriptionReport.doseDailyQuantity}'))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child:
|
||||
Center(child: Text('${prescriptionReport.days}')))
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
AppText(TranslationBase.of(context).notes),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Divider(
|
||||
height: 0.5,
|
||||
color: Colors.grey[300],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AppText(prescriptionReport.remarks ?? ''),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,235 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PrescriptionItemsInPatientPage extends StatelessWidget {
|
||||
final GetMedicationForInPatientModel prescriptions;
|
||||
final PatiantInformtion patient;
|
||||
final String patientType;
|
||||
final String arrivalType;
|
||||
final DateTime startOn;
|
||||
final DateTime stopOn;
|
||||
final int prescriptionIndex;
|
||||
|
||||
PrescriptionItemsInPatientPage(
|
||||
{Key key,
|
||||
this.prescriptions,
|
||||
this.patient,
|
||||
this.patientType,
|
||||
this.arrivalType,
|
||||
this.stopOn,
|
||||
this.startOn,
|
||||
this.prescriptionIndex});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) async {
|
||||
if (model.medicationForInPatient.length == 0) {
|
||||
await model.getMedicationForInPatient(patient);
|
||||
}
|
||||
},
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Colors.grey[100],
|
||||
baseViewModel: model,
|
||||
appBar: PatientProfileAppBar(patient),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 18, right: 18),
|
||||
child: AppText(
|
||||
prescriptions.pHRItemDescription,
|
||||
bold: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).direction,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(" " +
|
||||
prescriptions
|
||||
.directionDescription
|
||||
.toString() ??
|
||||
'')),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).route,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
prescriptions.routeDescription
|
||||
.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).refill,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(" " +
|
||||
prescriptions
|
||||
.refillDescription
|
||||
.toString() ??
|
||||
'')),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).startDate,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
'${AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}',
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).stopDate,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
'${AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}',
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'UOM',
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
prescriptions.uomDescription
|
||||
.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).dailyDoses,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(
|
||||
" " + prescriptions.dose.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).status,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
prescriptions.statusDescription
|
||||
.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).processed,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
prescriptions.doctorName
|
||||
.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
// Row(
|
||||
// children: [
|
||||
// AppText(
|
||||
// TranslationBase.of(context).num,
|
||||
// color: Colors.grey,
|
||||
// ),
|
||||
// AppText(" " + prescriptions.dose.toString() ?? ''),
|
||||
// ],
|
||||
// ),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
AppText(prescriptions.comments ?? ''),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,373 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PrescriptionItemsPage extends StatelessWidget {
|
||||
final Prescriptions prescriptions;
|
||||
final PatiantInformtion patient;
|
||||
final String patientType;
|
||||
final String arrivalType;
|
||||
|
||||
PrescriptionItemsPage(
|
||||
{Key key,
|
||||
this.prescriptions,
|
||||
this.patient,
|
||||
this.patientType,
|
||||
this.arrivalType});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<PrescriptionsViewModel>(
|
||||
onModelReady: (model) => model.getPrescriptionReport(
|
||||
prescriptions: prescriptions, patient: patient),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Colors.grey[100],
|
||||
baseViewModel: model,
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
clinic: prescriptions.clinicDescription,
|
||||
branch: prescriptions.name,
|
||||
isPrescriptions: true,
|
||||
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
|
||||
prescriptions.appointmentDate),
|
||||
doctorName: prescriptions.doctorName,
|
||||
profileUrl: prescriptions.doctorImageURL,
|
||||
isAppointmentHeader: true,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
if (!prescriptions.isInOutPatient)
|
||||
...List.generate(
|
||||
model.prescriptionReportList.length,
|
||||
(index) => Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 18, right: 18),
|
||||
child: AppText(
|
||||
model.prescriptionReportList[index]
|
||||
.itemDescription.isNotEmpty
|
||||
? model
|
||||
.prescriptionReportList[index]
|
||||
.itemDescription
|
||||
: model
|
||||
.prescriptionReportList[index]
|
||||
.itemDescriptionN,
|
||||
bold: true,
|
||||
)),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
width: 0.5,
|
||||
color: Colors.grey)),
|
||||
height: 55,
|
||||
width: 55,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) =>
|
||||
ShowImageDialog(
|
||||
imageUrl: model
|
||||
.prescriptionReportEnhList[
|
||||
index]
|
||||
.imageSRCUrl,
|
||||
));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.network(
|
||||
model
|
||||
.prescriptionReportList[index]
|
||||
.imageSRCUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.route,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(" " +
|
||||
model
|
||||
.prescriptionReportList[
|
||||
index]
|
||||
.routeN)),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.frequency,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
model
|
||||
.prescriptionReportList[
|
||||
index]
|
||||
.frequencyN ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.dailyDoses,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
model
|
||||
.prescriptionReportList[
|
||||
index]
|
||||
.doseDailyQuantity ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.duration,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
model
|
||||
.prescriptionReportList[
|
||||
index]
|
||||
.days
|
||||
.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
AppText(model
|
||||
.prescriptionReportList[
|
||||
index]
|
||||
.remarks ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
))
|
||||
else
|
||||
...List.generate(
|
||||
model.prescriptionReportEnhList.length,
|
||||
(index) => Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 18, right: 18),
|
||||
child: AppText(
|
||||
model.prescriptionReportEnhList[index]
|
||||
.itemDescription,
|
||||
bold: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
width: 0.5, color: Colors.grey)),
|
||||
height: 55,
|
||||
width: 55,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => ShowImageDialog(
|
||||
imageUrl: model
|
||||
.prescriptionReportEnhList[
|
||||
index]
|
||||
.imageSRCUrl,
|
||||
));
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.network(
|
||||
model
|
||||
.prescriptionReportEnhList[
|
||||
index]
|
||||
.imageSRCUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 10,
|
||||
child: Icon(
|
||||
EvaIcons.search,
|
||||
color: Colors.grey,
|
||||
size: 35,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).route,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(" " +
|
||||
model
|
||||
.prescriptionReportEnhList[
|
||||
index]
|
||||
.route ??
|
||||
'')),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.frequency,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
model
|
||||
.prescriptionReportEnhList[
|
||||
index]
|
||||
.frequency ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.dailyDoses,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
model
|
||||
.prescriptionReportEnhList[
|
||||
index]
|
||||
.doseDailyQuantity
|
||||
.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.duration,
|
||||
color: Colors.grey,
|
||||
),
|
||||
AppText(" " +
|
||||
model
|
||||
.prescriptionReportList[
|
||||
index]
|
||||
.days
|
||||
.toString() ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
AppText(model
|
||||
.prescriptionReportEnhList[index]
|
||||
.remarks ??
|
||||
''),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,168 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
void prescriptionWarning(context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bc) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Container(
|
||||
height: 600,
|
||||
child: Column(
|
||||
children: [
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Container(
|
||||
child: ExpansionTile(
|
||||
title: AppText('Prescription warning and alerts(0)'),
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
'DOSESCREENINGRESULTFORETCETC',
|
||||
color: Color(0XFFB8382C),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border:
|
||||
Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
child: AppTextFormField(
|
||||
labelText: 'Remarks',
|
||||
borderColor: Colors.white,
|
||||
textInputType: TextInputType.number,
|
||||
inputFormatter: ONLY_NUMBERS,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 95.0,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: 'CONTINUE',
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
authorizationForm(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
color: Colors.white,
|
||||
title: 'remove',
|
||||
fontColor: Colors.red,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
prescriptionWarning(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
void authorizationForm(context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bc) {
|
||||
return Container(
|
||||
height: 500,
|
||||
child: Form(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
'Prescription authorization'.toUpperCase(),
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
child: AppTextFormField(
|
||||
labelText: 'Auth ID',
|
||||
borderColor: Colors.white,
|
||||
textInputType: TextInputType.number,
|
||||
inputFormatter: ONLY_NUMBERS,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
child: AppTextFormField(
|
||||
labelText: 'Password',
|
||||
borderColor: Colors.white,
|
||||
textInputType: TextInputType.text,
|
||||
inputFormatter: ONLY_LETTERS,
|
||||
obscureText: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 190.0,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: 'CONTINUE',
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
authorizationForm(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,157 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../widgets/shared/dialogs/ShowImageDialog.dart';
|
||||
|
||||
|
||||
class PrescriptionItemsWidget extends StatelessWidget {
|
||||
final String itemDescription;
|
||||
final String route;
|
||||
final String frequency;
|
||||
final int dailyDoses;
|
||||
final String imageSRCUrl;
|
||||
final String remarks;
|
||||
final int days;
|
||||
final PrescriptionViewModel prescriptionViewModel;
|
||||
|
||||
|
||||
|
||||
PrescriptionItemsWidget(
|
||||
{this.itemDescription,
|
||||
this.route,
|
||||
this.frequency,
|
||||
this.dailyDoses,
|
||||
this.imageSRCUrl,
|
||||
this.remarks,
|
||||
this.days, this.prescriptionViewModel,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
...List.generate(
|
||||
// TODO Elham* List.generate to list.builder
|
||||
prescriptionViewModel.prescriptionReportEnhList.length,
|
||||
(index) => Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 18, right: 18),
|
||||
child: AppText(
|
||||
prescriptionViewModel.prescriptionReportEnhList[index].itemDescription,
|
||||
bold: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
width: 0.5, color: Colors.grey)),
|
||||
height: 55,
|
||||
width: 55,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => ShowImageDialog(
|
||||
imageUrl: prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl,
|
||||
));
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.network(
|
||||
prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 10,
|
||||
child: Icon(
|
||||
EvaIcons.search,
|
||||
color: Colors.grey,
|
||||
size: 35,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).route + ' : ',
|
||||
value: " " + prescriptionViewModel.prescriptionReportEnhList[index].route ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).frequency + ' : ',
|
||||
value: " " + prescriptionViewModel.prescriptionReportEnhList[index].frequency ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).dailyDoses + ' : ',
|
||||
value: " " + prescriptionViewModel.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).duration + ' : ',
|
||||
value: " " + prescriptionViewModel.prescriptionReportList[index].days.toString() ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
CustomRow(
|
||||
label: '',
|
||||
value: prescriptionViewModel.prescriptionReportList[index].remarks ?? '',
|
||||
valueSize: 14,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,187 @@
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PrescriptionItemsInPatientPage extends StatelessWidget {
|
||||
final GetMedicationForInPatientModel prescriptions;
|
||||
final PatiantInformtion patient;
|
||||
final String patientType;
|
||||
final String arrivalType;
|
||||
final DateTime startOn;
|
||||
final DateTime stopOn;
|
||||
final int prescriptionIndex;
|
||||
|
||||
PrescriptionItemsInPatientPage(
|
||||
{Key key,
|
||||
this.prescriptions,
|
||||
this.patient,
|
||||
this.patientType,
|
||||
this.arrivalType,
|
||||
this.stopOn,
|
||||
this.startOn,
|
||||
this.prescriptionIndex});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) async {
|
||||
if (model.medicationForInPatient.length == 0) {
|
||||
await model.getMedicationForInPatient(patient);
|
||||
}
|
||||
},
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Colors.grey[100],
|
||||
baseViewModel: model,
|
||||
appBar: PatientProfileAppBar(patient),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 18, right: 18),
|
||||
child: AppText(
|
||||
prescriptions.pHRItemDescription,
|
||||
bold: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).direction + ' :',
|
||||
value: " " + prescriptions.directionDescription.toString() ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).route + ' :',
|
||||
value: " " + prescriptions.routeDescription ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).refill + ' :',
|
||||
value: " " + prescriptions.refillDescription ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).startDate + ' :',
|
||||
value: " " + AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic) ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).stopDate + ' :',
|
||||
value: " " + AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic) ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: 'UOM' + ' :',
|
||||
value: " " + prescriptions.uomDescription.toString() ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).dailyDoses,
|
||||
value: " " + prescriptions.dose.toString() ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).status,
|
||||
value: " " + prescriptions.statusDescription.toString() ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).processed,
|
||||
value: " " + prescriptions.doctorName.toString() ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
CustomRow(
|
||||
label: '',
|
||||
value: prescriptions.comments ?? '',
|
||||
isCopyable: false,
|
||||
isExpanded: false,
|
||||
valueSize: 13,
|
||||
labelSize: 13,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/preacription_items_widget.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PrescriptionItemsPage extends StatelessWidget {
|
||||
final Prescriptions prescriptions;
|
||||
final PatiantInformtion patient;
|
||||
final String arrivalType;
|
||||
|
||||
PrescriptionItemsPage(
|
||||
{Key key,
|
||||
this.prescriptions,
|
||||
this.patient,
|
||||
this.arrivalType});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) => model.getPrescriptionReport(
|
||||
prescriptions: prescriptions, patient: patient),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Colors.grey[100],
|
||||
baseViewModel: model,
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
clinic: prescriptions.clinicDescription,
|
||||
branch: prescriptions.name,
|
||||
isPrescriptions: true,
|
||||
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
|
||||
prescriptions.appointmentDate),
|
||||
doctorName: prescriptions.doctorName,
|
||||
profileUrl: prescriptions.doctorImageURL,
|
||||
isAppointmentHeader: true,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: model.prescriptionReportEnhList.length,
|
||||
itemBuilder: (context, index) => PrescriptionItemsWidget(
|
||||
frequency: model.prescriptionReportEnhList[index].frequency,
|
||||
itemDescription: model.prescriptionReportEnhList[index].itemDescription,
|
||||
days: model.prescriptionReportEnhList[index].days,
|
||||
route: model.prescriptionReportEnhList[index].route,
|
||||
dailyDoses: model.prescriptionReportEnhList[index].doseDailyQuantity,
|
||||
imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl,
|
||||
remarks: model.prescriptionReportEnhList[index].remarks,
|
||||
prescriptionViewModel: model,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,218 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../widgets/shared/errors/error_message.dart';
|
||||
|
||||
class PrescriptionsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
String patientType = routeArgs['patientType'];
|
||||
String arrivalType = routeArgs['arrivalType'];
|
||||
bool isInpatient = routeArgs['isInpatient'];
|
||||
bool isFromLiveCare = routeArgs['isFromLiveCare'];
|
||||
bool isSelectInpatient = routeArgs['isSelectInpatient'];
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) => patient.admissionNo == null
|
||||
? model.getPrescriptions(patient, patientType: patientType)
|
||||
: model.getMedicationForInPatient(patient),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Colors.grey[100],
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
isInpatient: isInpatient,
|
||||
),
|
||||
body: patient.admissionNo == null
|
||||
? FractionallySizedBox(
|
||||
widthFactor: 1.0,
|
||||
child: ListView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
if (model.prescriptionsList.isNotEmpty &&
|
||||
patient.patientStatusType != 43)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ServiceTitle(
|
||||
title: TranslationBase.of(context).orders,
|
||||
subTitle:
|
||||
TranslationBase.of(context).prescriptions,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (patient.patientStatusType != null &&
|
||||
patient.patientStatusType == 43)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ServiceTitle(
|
||||
title: TranslationBase.of(context).orders,
|
||||
subTitle:
|
||||
TranslationBase.of(context).prescriptions,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if ((patient.patientStatusType != null &&
|
||||
patient.patientStatusType == 43) ||
|
||||
(isFromLiveCare && patient.appointmentNo != null))
|
||||
AddNewOrder(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
SlideUpPageRoute(
|
||||
widget: BaseAddProcedureTabPage(
|
||||
patient: patient,
|
||||
prescriptionModel: model,
|
||||
procedureType: ProcedureType.PRESCRIPTION,
|
||||
),
|
||||
settingRoute: 'AddProcedureTabPage'),
|
||||
);
|
||||
},
|
||||
label: TranslationBase.of(context)
|
||||
.applyForNewPrescriptionsOrder,
|
||||
),
|
||||
...List.generate(
|
||||
model.prescriptionsList.length,
|
||||
(index) => InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: PrescriptionItemsPage(
|
||||
prescriptions:
|
||||
model.prescriptionsList[index],
|
||||
patient: patient,
|
||||
patientType: patientType,
|
||||
arrivalType: arrivalType,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: DoctorCard(
|
||||
doctorName:
|
||||
model.prescriptionsList[index].doctorName,
|
||||
profileUrl: model
|
||||
.prescriptionsList[index].doctorImageURL,
|
||||
branch: model.prescriptionsList[index].name,
|
||||
clinic: model.prescriptionsList[index]
|
||||
.clinicDescription,
|
||||
isPrescriptions: true,
|
||||
appointmentDate:
|
||||
AppDateUtils.getDateTimeFromServerFormat(
|
||||
model.prescriptionsList[index]
|
||||
.appointmentDate,
|
||||
),
|
||||
))),
|
||||
if (model.prescriptionsList.isEmpty &&
|
||||
patient.patientStatusType != 43)
|
||||
Center(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context)
|
||||
.noPrescriptionsFound,
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
: NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 1.0,
|
||||
child: ListView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
children: <Widget>[
|
||||
ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: model.medicationForInPatient.length,
|
||||
itemBuilder: (context, index) {
|
||||
//model.medicationForInPatient.length,
|
||||
return InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page:
|
||||
PrescriptionItemsInPatientPage(
|
||||
prescriptionIndex: index,
|
||||
prescriptions:
|
||||
model.medicationForInPatient[
|
||||
index],
|
||||
patient: patient,
|
||||
patientType: patientType,
|
||||
arrivalType: arrivalType,
|
||||
startOn: AppDateUtils
|
||||
.getDateTimeFromServerFormat(
|
||||
model
|
||||
.medicationForInPatient[
|
||||
index]
|
||||
.startDatetime,
|
||||
),
|
||||
stopOn: AppDateUtils
|
||||
.getDateTimeFromServerFormat(
|
||||
model
|
||||
.medicationForInPatient[
|
||||
index]
|
||||
.stopDatetime,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: InPatientDoctorCard(
|
||||
doctorName: model
|
||||
.medicationForInPatient[index]
|
||||
.pHRItemDescription,
|
||||
profileUrl: 'sss',
|
||||
branch: 'hamza',
|
||||
clinic: 'basheer',
|
||||
isPrescriptions: true,
|
||||
appointmentDate: AppDateUtils
|
||||
.getDateTimeFromServerFormat(
|
||||
model.medicationForInPatient[index]
|
||||
.prescriptionDatetime,
|
||||
),
|
||||
createdBy: model
|
||||
.medicationForInPatient[index]
|
||||
.doctorName
|
||||
.toString(),
|
||||
));
|
||||
}),
|
||||
if (model.medicationForInPatient.length == 0)
|
||||
Center(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context)
|
||||
.noPrescriptionsFound,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
||||
@ -1,991 +0,0 @@
|
||||
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
class UpdatePrescriptionForm extends StatefulWidget {
|
||||
final String drugName;
|
||||
final String doseStreangth;
|
||||
final int drugId;
|
||||
final String remarks;
|
||||
final PatiantInformtion patient;
|
||||
final String duration;
|
||||
final String route;
|
||||
final String dose;
|
||||
final String doseUnit;
|
||||
final String enteredRemarks;
|
||||
final String startDate;
|
||||
final String frequency;
|
||||
final String drugNameGeneric;
|
||||
final String uom;
|
||||
final int box;
|
||||
|
||||
final PrescriptionViewModel model;
|
||||
|
||||
UpdatePrescriptionForm(
|
||||
{this.drugName,
|
||||
this.doseStreangth,
|
||||
this.drugId,
|
||||
this.remarks,
|
||||
this.patient,
|
||||
this.duration,
|
||||
this.route,
|
||||
this.dose,
|
||||
this.startDate,
|
||||
this.doseUnit,
|
||||
this.enteredRemarks,
|
||||
this.frequency,
|
||||
this.model,
|
||||
this.drugNameGeneric,
|
||||
this.uom,
|
||||
this.box});
|
||||
|
||||
@override
|
||||
_UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState();
|
||||
}
|
||||
|
||||
class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
||||
TextEditingController strengthController = TextEditingController();
|
||||
TextEditingController remarksController = TextEditingController();
|
||||
int testNum = 0;
|
||||
int strengthChar;
|
||||
PatiantInformtion patient;
|
||||
/// TODO Elham* add type
|
||||
dynamic route;
|
||||
dynamic doseTime;
|
||||
dynamic frequencyUpdate;
|
||||
dynamic updatedDuration;
|
||||
dynamic units;
|
||||
GetMedicationResponseModel newSelectedMedication;
|
||||
GlobalKey key =
|
||||
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
||||
List<dynamic> indicationList;
|
||||
dynamic indication;
|
||||
DateTime selectedDate;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
strengthController.text = widget.doseStreangth;
|
||||
remarksController.text = widget.remarks;
|
||||
indicationList = List();
|
||||
/// TODO Elham* create model and try to have them form service and add translation
|
||||
|
||||
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
|
||||
dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"};
|
||||
dynamic indication3 = {"id": 547, "name": "Hypertrichosis"};
|
||||
dynamic indication4 = {"id": 548, "name": "Mild Dizziness"};
|
||||
dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"};
|
||||
dynamic indication6 = {
|
||||
"id": 550,
|
||||
"name": "Phenytoin Hypersensitivity Syndrome"
|
||||
};
|
||||
dynamic indication7 = {"id": 551, "name": "Asterixis"};
|
||||
dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"};
|
||||
dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"};
|
||||
dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"};
|
||||
|
||||
indicationList.add(indication1);
|
||||
indicationList.add(indication2);
|
||||
indicationList.add(indication3);
|
||||
indicationList.add(indication4);
|
||||
indicationList.add(indication5);
|
||||
indicationList.add(indication6);
|
||||
indicationList.add(indication7);
|
||||
indicationList.add(indication8);
|
||||
indicationList.add(indication9);
|
||||
indicationList.add(indication10);
|
||||
}
|
||||
/// TODO Elham* Add Translation
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
return StatefulBuilder(builder:
|
||||
(BuildContext context, StateSetter setState /*You can rename this!*/) {
|
||||
return BaseView<MedicineViewModel>(
|
||||
onModelReady: (model) async {
|
||||
/// TODO Elham* Move this to view model and remove unused data
|
||||
|
||||
await model.getMedicationList();
|
||||
await model.getMedicationStrength();
|
||||
await model.getMedicationDuration();
|
||||
await model.getMedicationRoute();
|
||||
await model.getMedicationFrequency();
|
||||
await model.getMedicationDoseTime();
|
||||
await model.getItem(itemID: widget.drugId);
|
||||
//await model.getMedicationIndications();
|
||||
route = model.getLookupByIdFilter(
|
||||
model.itemMedicineListRoute, widget.route);
|
||||
doseTime =
|
||||
model.getLookupById(model.medicationDoseTimeList, widget.dose);
|
||||
updatedDuration = model.getLookupById(
|
||||
model.medicationDurationList, widget.duration);
|
||||
units = model.getLookupByIdFilter(
|
||||
model.itemMedicineListUnit, widget.doseUnit);
|
||||
frequencyUpdate = model.getLookupById(
|
||||
model.medicationFrequencyList, widget.frequency);
|
||||
},
|
||||
builder:
|
||||
(BuildContext context, MedicineViewModel model, Widget child) =>
|
||||
NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
FocusScope.of(context).requestFocus(new FocusNode());
|
||||
},
|
||||
child: DraggableScrollableSheet(
|
||||
initialChildSize: 0.98,
|
||||
maxChildSize: 0.99,
|
||||
minChildSize: 0.6,
|
||||
builder:
|
||||
(BuildContext context, ScrollController scrollController) {
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 1.5,
|
||||
child: Form(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20.0, vertical: 12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
widget.drugName.toUpperCase(),
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.060,
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.4900,
|
||||
height: MediaQuery.of(context)
|
||||
.size
|
||||
.height *
|
||||
0.55,
|
||||
child: TextFields(
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(
|
||||
5),
|
||||
// WhitelistingTextInputFormatter
|
||||
// .digitsOnly
|
||||
],
|
||||
|
||||
hintText: widget.doseStreangth,
|
||||
fontSize: 15.0,
|
||||
controller: strengthController,
|
||||
keyboardType: TextInputType
|
||||
.numberWithOptions(
|
||||
decimal: true,
|
||||
),
|
||||
onChanged: (String value) {
|
||||
setState(() {
|
||||
strengthChar = value.length;
|
||||
});
|
||||
if (strengthChar >= 5) {
|
||||
DrAppToastMsg.showErrorToast(
|
||||
"Only 5 Digits allowed for strength");
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.0,
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.3700,
|
||||
child: InkWell(
|
||||
onTap:
|
||||
model.itemMedicineListUnit !=
|
||||
null
|
||||
? () {
|
||||
Helpers.hideKeyboard(
|
||||
context);
|
||||
ListSelectDialog
|
||||
dialog =
|
||||
ListSelectDialog(
|
||||
list: model
|
||||
.itemMedicineListUnit,
|
||||
attributeName:
|
||||
'description',
|
||||
attributeValueId:
|
||||
'parameterCode',
|
||||
okText:
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.ok,
|
||||
okFunction:
|
||||
(selectedValue) {
|
||||
setState(() {
|
||||
units =
|
||||
selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible:
|
||||
false,
|
||||
context: context,
|
||||
builder:
|
||||
(BuildContext
|
||||
context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
textFieldSelectorDecoration(
|
||||
'UNIT Type',
|
||||
units != null
|
||||
? units[
|
||||
'description']
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.070,
|
||||
child: InkWell(
|
||||
onTap: model.itemMedicineListRoute !=
|
||||
null
|
||||
? () {
|
||||
Helpers.hideKeyboard(context);
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model
|
||||
.itemMedicineListRoute,
|
||||
attributeName: 'description',
|
||||
attributeValueId:
|
||||
'parameterCode',
|
||||
okText: TranslationBase.of(
|
||||
context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
route = selectedValue;
|
||||
});
|
||||
if (route == null) {
|
||||
route = route['id'];
|
||||
}
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder:
|
||||
(BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
textFieldSelectorDecoration(
|
||||
'Route',
|
||||
route != null
|
||||
? route['description']
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.070,
|
||||
child: InkWell(
|
||||
onTap: model.medicationDoseTimeList !=
|
||||
null
|
||||
? () {
|
||||
Helpers.hideKeyboard(context);
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model
|
||||
.medicationDoseTimeList,
|
||||
attributeName: 'nameEn',
|
||||
attributeValueId: 'id',
|
||||
okText: TranslationBase.of(
|
||||
context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
doseTime = selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder:
|
||||
(BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
textFieldSelectorDecoration(
|
||||
TranslationBase.of(context)
|
||||
.doseTime,
|
||||
doseTime != null
|
||||
? doseTime['nameEn']
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.070,
|
||||
child: InkWell(
|
||||
onTap: model.medicationFrequencyList !=
|
||||
null
|
||||
? () {
|
||||
Helpers.hideKeyboard(context);
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model
|
||||
.medicationFrequencyList,
|
||||
attributeName: 'nameEn',
|
||||
attributeValueId: 'id',
|
||||
okText: TranslationBase.of(
|
||||
context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
frequencyUpdate =
|
||||
selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder:
|
||||
(BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
textFieldSelectorDecoration(
|
||||
TranslationBase.of(context)
|
||||
.frequency,
|
||||
frequencyUpdate != null
|
||||
? frequencyUpdate[
|
||||
'nameEn']
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.070,
|
||||
child: InkWell(
|
||||
onTap: model.medicationDurationList !=
|
||||
null
|
||||
? () {
|
||||
Helpers.hideKeyboard(context);
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model
|
||||
.medicationDurationList,
|
||||
attributeName: 'nameEn',
|
||||
attributeValueId: 'id',
|
||||
okText: TranslationBase.of(
|
||||
context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
updatedDuration =
|
||||
selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder:
|
||||
(BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
textFieldSelectorDecoration(
|
||||
TranslationBase.of(context)
|
||||
.duration,
|
||||
updatedDuration != null
|
||||
? updatedDuration[
|
||||
'nameEn']
|
||||
.toString()
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
height: model.patientAssessmentList
|
||||
.isNotEmpty
|
||||
? screenSize.height * 0.070
|
||||
: 0.0,
|
||||
width: model.patientAssessmentList
|
||||
.isNotEmpty
|
||||
? double.infinity
|
||||
: 0.0,
|
||||
child: model.patientAssessmentList
|
||||
.isNotEmpty
|
||||
? Row(
|
||||
children: [
|
||||
Container(
|
||||
width:
|
||||
MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.29,
|
||||
child: InkWell(
|
||||
onTap:
|
||||
indicationList != null
|
||||
? () {
|
||||
Helpers.hideKeyboard(
|
||||
context);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration: textFieldSelectorDecoration(
|
||||
model.patientAssessmentList
|
||||
.isNotEmpty
|
||||
? model
|
||||
.patientAssessmentList[
|
||||
0]
|
||||
.icdCode10ID
|
||||
.toString()
|
||||
: '',
|
||||
indication != null
|
||||
? indication[
|
||||
'name']
|
||||
: null,
|
||||
true),
|
||||
enabled: true,
|
||||
readOnly: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width:
|
||||
MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.61,
|
||||
child: InkWell(
|
||||
onTap:
|
||||
indicationList != null
|
||||
? () {
|
||||
Helpers.hideKeyboard(
|
||||
context);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
maxLines: 3,
|
||||
decoration: textFieldSelectorDecoration(
|
||||
model.patientAssessmentList
|
||||
.isNotEmpty
|
||||
? model
|
||||
.patientAssessmentList[
|
||||
0]
|
||||
.asciiDesc
|
||||
.toString()
|
||||
: '',
|
||||
indication != null
|
||||
? indication[
|
||||
'name']
|
||||
: null,
|
||||
true),
|
||||
enabled: true,
|
||||
readOnly: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: null),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: () =>
|
||||
selectDate(context, widget.model),
|
||||
child: TextField(
|
||||
decoration: Helpers
|
||||
.textFieldSelectorDecoration(
|
||||
AppDateUtils.getDateFormatted(
|
||||
DateTime.parse(
|
||||
widget.startDate)),
|
||||
selectedDate != null
|
||||
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
||||
: null,
|
||||
true,
|
||||
suffixIcon: Icon(
|
||||
Icons.calendar_today,
|
||||
color: Colors.black,
|
||||
)),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.allMedicationList != null
|
||||
? () {
|
||||
Helpers.hideKeyboard(context);
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model.allMedicationList,
|
||||
attributeName: 'nameEn',
|
||||
attributeValueId: 'id',
|
||||
okText: TranslationBase.of(
|
||||
context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
// duration = selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder:
|
||||
(BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
textFieldSelectorDecoration(
|
||||
"UOM",
|
||||
widget.uom != null
|
||||
? widget.uom
|
||||
: null,
|
||||
true),
|
||||
// enabled: false,
|
||||
readOnly: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.allMedicationList != null
|
||||
? () {
|
||||
Helpers.hideKeyboard(context);
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model.allMedicationList,
|
||||
attributeName: 'nameEn',
|
||||
attributeValueId: 'id',
|
||||
okText: TranslationBase.of(
|
||||
context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
// duration = selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder:
|
||||
(BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
textFieldSelectorDecoration(
|
||||
'Box Quantity',
|
||||
widget.box != null
|
||||
? "Box Quantity: " +
|
||||
widget.box.toString()
|
||||
: null,
|
||||
true),
|
||||
// enabled: false,
|
||||
readOnly: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
child: TextFields(
|
||||
controller: remarksController,
|
||||
maxLines: 7,
|
||||
minLines: 4,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.08,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(
|
||||
SizeConfig.widthMultiplier * 2),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: 'update prescription'
|
||||
.toUpperCase(),
|
||||
onPressed: () {
|
||||
|
||||
/// TODO Elham* Move this to function
|
||||
|
||||
if (double.parse(
|
||||
strengthController.text) >
|
||||
1000.0) {
|
||||
DrAppToastMsg.showErrorToast(
|
||||
"1000 is the MAX for the strength");
|
||||
return;
|
||||
}
|
||||
if (double.parse(
|
||||
strengthController
|
||||
.text) ==
|
||||
0.0) {
|
||||
DrAppToastMsg.showErrorToast(
|
||||
"strength can't be zero");
|
||||
return;
|
||||
}
|
||||
if (strengthController
|
||||
.text.length >
|
||||
4) {
|
||||
DrAppToastMsg.showErrorToast(
|
||||
"strength can't be more then 4 digits ");
|
||||
return;
|
||||
}
|
||||
// if(units==null&& updatedDuration==null&&frequencyUpdate==null&&)
|
||||
updatePrescription(
|
||||
newStartDate: selectedDate,
|
||||
newDoseStreangth:
|
||||
strengthController
|
||||
.text.isNotEmpty
|
||||
? strengthController
|
||||
.text
|
||||
: widget
|
||||
.doseStreangth,
|
||||
newUnit: units != null
|
||||
? units['parameterCode']
|
||||
.toString()
|
||||
: widget.doseUnit,
|
||||
doseUnit: widget.doseUnit,
|
||||
doseStreangth:
|
||||
widget.doseStreangth,
|
||||
duration: widget.duration,
|
||||
startDate: widget.startDate,
|
||||
doseId: widget.dose,
|
||||
frequencyId: widget.frequency,
|
||||
routeId: widget.route,
|
||||
patient: widget.patient,
|
||||
model: widget.model,
|
||||
newDuration:
|
||||
updatedDuration != null
|
||||
? updatedDuration['id']
|
||||
.toString()
|
||||
: widget.duration,
|
||||
drugId: widget.drugId,
|
||||
remarks: remarksController
|
||||
.text,
|
||||
route: route != null
|
||||
? route['parameterCode']
|
||||
.toString()
|
||||
: widget.route,
|
||||
frequency:
|
||||
frequencyUpdate != null
|
||||
? frequencyUpdate[
|
||||
'id']
|
||||
.toString()
|
||||
: widget.frequency,
|
||||
dose: doseTime != null
|
||||
? doseTime['id']
|
||||
.toString()
|
||||
: widget.dose,
|
||||
enteredRemarks:
|
||||
widget.enteredRemarks);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
selectDate(BuildContext context, PrescriptionViewModel model) async {
|
||||
Helpers.hideKeyboard(context);
|
||||
DateTime selectedDate;
|
||||
selectedDate = DateTime.now();
|
||||
final DateTime picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: selectedDate,
|
||||
firstDate: DateTime.now(),
|
||||
lastDate: DateTime(2040),
|
||||
initialEntryMode: DatePickerEntryMode.calendar,
|
||||
);
|
||||
if (picked != null && picked != selectedDate) {
|
||||
setState(() {
|
||||
this.selectedDate = picked;
|
||||
});
|
||||
}
|
||||
}
|
||||
// /// TODO Elham* Use it from the textfeild utils
|
||||
InputDecoration textFieldSelectorDecoration(
|
||||
String hintText, String selectedText, bool isDropDown,
|
||||
{Icon suffixIcon}) {
|
||||
return InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: selectedText != null ? selectedText : hintText,
|
||||
suffixIcon: isDropDown
|
||||
? suffixIcon != null
|
||||
? suffixIcon
|
||||
: Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: Colors.black,
|
||||
)
|
||||
: null,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// TODO Elham* Move this to view model and pass all data as model
|
||||
updatePrescription(
|
||||
{PrescriptionViewModel model,
|
||||
int drugId,
|
||||
String newDrugId,
|
||||
String frequencyId,
|
||||
String remarks,
|
||||
String dose,
|
||||
String doseId,
|
||||
String frequency,
|
||||
String route,
|
||||
String routeId,
|
||||
String startDate,
|
||||
DateTime newStartDate,
|
||||
String doseUnit,
|
||||
String doseStreangth,
|
||||
String newDoseStreangth,
|
||||
String duration,
|
||||
String newDuration,
|
||||
String newUnit,
|
||||
String enteredRemarks,
|
||||
PatiantInformtion patient}) async {
|
||||
//PrescriptionViewModel model = PrescriptionViewModel();
|
||||
PostPrescriptionReqModel updatePrescriptionReqModel =
|
||||
new PostPrescriptionReqModel();
|
||||
List<PrescriptionRequestModel> sss = List();
|
||||
|
||||
updatePrescriptionReqModel.appointmentNo = patient.appointmentNo;
|
||||
updatePrescriptionReqModel.clinicID = patient.clinicId;
|
||||
updatePrescriptionReqModel.episodeID = patient.episodeNo;
|
||||
updatePrescriptionReqModel.patientMRN = patient.patientMRN;
|
||||
|
||||
sss.add(PrescriptionRequestModel(
|
||||
covered: true,
|
||||
dose: newDoseStreangth.isNotEmpty
|
||||
? double.parse(newDoseStreangth)
|
||||
: double.parse(doseStreangth),
|
||||
//frequency.isNotEmpty ? int.parse(dose) : 1,
|
||||
itemId: drugId,
|
||||
doseUnitId:
|
||||
newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit),
|
||||
route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
|
||||
frequency: frequency.isNotEmpty
|
||||
? int.parse(frequency)
|
||||
: int.parse(frequencyId),
|
||||
remarks: remarks.isEmpty ? enteredRemarks : remarks,
|
||||
approvalRequired: true,
|
||||
icdcode10Id: "test2",
|
||||
doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId),
|
||||
duration: newDuration.isNotEmpty
|
||||
? int.parse(newDuration)
|
||||
: int.parse(duration),
|
||||
doseStartDate:
|
||||
newStartDate != null ? newStartDate.toIso8601String() : startDate));
|
||||
updatePrescriptionReqModel.prescriptionRequestModel = sss;
|
||||
//postProcedureReqModel.procedures = controlsProcedure;
|
||||
|
||||
await model.updatePrescription(
|
||||
updatePrescriptionReqModel, patient.patientMRN);
|
||||
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
Helpers.showErrorToast(model.error);
|
||||
} else if (model.state == ViewState.Idle) {
|
||||
DrAppToastMsg.showSuccesToast('Medication has been updated');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void updatePrescriptionForm(
|
||||
{context,
|
||||
String drugName,
|
||||
String drugNameGeneric,
|
||||
int drugId,
|
||||
String remarks,
|
||||
PrescriptionViewModel model,
|
||||
PatiantInformtion patient,
|
||||
String rouat,
|
||||
String frequency,
|
||||
String dose,
|
||||
String duration,
|
||||
String doseStreangth,
|
||||
String doseUnit,
|
||||
String enteredRemarks,
|
||||
String uom,
|
||||
int box,
|
||||
String startDate}) {
|
||||
|
||||
/// TODO Elham* remove unused code.
|
||||
|
||||
TextEditingController remarksController = TextEditingController();
|
||||
TextEditingController doseController = TextEditingController();
|
||||
TextEditingController frequencyController = TextEditingController();
|
||||
TextEditingController routeController = TextEditingController();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext context) {
|
||||
return UpdatePrescriptionForm(
|
||||
box: box,
|
||||
uom: uom,
|
||||
drugName: drugName,
|
||||
patient: patient,
|
||||
doseStreangth: doseStreangth,
|
||||
remarks: remarks,
|
||||
drugId: drugId,
|
||||
enteredRemarks: enteredRemarks,
|
||||
duration: duration,
|
||||
dose: dose,
|
||||
doseUnit: doseUnit,
|
||||
frequency: frequency,
|
||||
route: rouat,
|
||||
startDate: startDate,
|
||||
model: model,
|
||||
drugNameGeneric: drugNameGeneric,
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../config/config.dart';
|
||||
import '../config/size_config.dart';
|
||||
import '../core/viewModel/project_view_model.dart';
|
||||
import '../widgets/shared/app_texts_widget.dart';
|
||||
|
||||
class TabHelper {
|
||||
|
||||
static getBoxTabsBoxDecoration(
|
||||
{bool isFirst = false,
|
||||
bool isMiddle = false,
|
||||
bool isLast = false,
|
||||
bool isActive = false,
|
||||
double radius = 6.0,
|
||||
ProjectViewModel projectViewModel}) {
|
||||
return BoxDecoration(
|
||||
color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA),
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: projectViewModel.isArabic
|
||||
? Radius.circular(isActive
|
||||
? isLast || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0)
|
||||
: Radius.circular(isActive
|
||||
? isFirst || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0),
|
||||
topLeft: projectViewModel.isArabic
|
||||
? Radius.circular(isActive
|
||||
? isFirst || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0)
|
||||
: Radius.circular(isActive
|
||||
? isLast || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0),
|
||||
bottomRight: projectViewModel.isArabic
|
||||
? Radius.circular(isActive
|
||||
? isLast || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0)
|
||||
: Radius.circular(isActive
|
||||
? isFirst || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0),
|
||||
bottomLeft: projectViewModel.isArabic
|
||||
? Radius.circular(isActive
|
||||
? isFirst || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0)
|
||||
: Radius.circular(isActive
|
||||
? isLast || isMiddle
|
||||
? radius
|
||||
: 0
|
||||
: 0)),
|
||||
);
|
||||
}
|
||||
|
||||
static getBgTabColor() {
|
||||
return Color(0xFFEAEAEA);
|
||||
}
|
||||
|
||||
static getTabText({
|
||||
String title,
|
||||
bool isActive = false,
|
||||
}) {
|
||||
return AppText(
|
||||
title,
|
||||
fontSize: SizeConfig.textMultiplier * 1.8,
|
||||
color: isActive ? Colors.white : AppGlobal.appTextColor,
|
||||
letterSpacing: -0.48,
|
||||
fontWeight: FontWeight.w600,
|
||||
);
|
||||
}
|
||||
|
||||
static getTabHeight(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
return screenSize.height * 0.07;
|
||||
}
|
||||
|
||||
static getTabCounter({bool isActive: false, int counter}) {
|
||||
return Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? Colors.white : AppGlobal.appRedColor,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: FittedBox(
|
||||
child: AppText(
|
||||
"$counter",
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: !isActive ? Colors.white : AppGlobal.appRedColor,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,166 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patient_model.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class DynamicElements extends StatefulWidget {
|
||||
final PatientModel _patientSearchFormValues;
|
||||
final bool isFormSubmitted;
|
||||
|
||||
DynamicElements(this._patientSearchFormValues, this.isFormSubmitted);
|
||||
|
||||
@override
|
||||
_DynamicElementsState createState() => _DynamicElementsState();
|
||||
}
|
||||
|
||||
class _DynamicElementsState extends State<DynamicElements> {
|
||||
TextEditingController _toDateController = new TextEditingController();
|
||||
TextEditingController _fromDateController = new TextEditingController();
|
||||
|
||||
void _presentDatePicker(id) {
|
||||
showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2019),
|
||||
lastDate: DateTime.now(),
|
||||
).then((pickedDate) {
|
||||
if (pickedDate == null) {
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
print(id);
|
||||
var selectedDate = DateFormat.yMd().format(pickedDate);
|
||||
|
||||
if (id == '_selectedFromDate') {
|
||||
// _fromDateController.text = selectedDate;
|
||||
selectedDate = pickedDate.year.toString() +
|
||||
"-" +
|
||||
pickedDate.month.toString().padLeft(2, '0') +
|
||||
"-" +
|
||||
pickedDate.day.toString().padLeft(2, '0');
|
||||
|
||||
_fromDateController.text = selectedDate;
|
||||
} else {
|
||||
selectedDate = pickedDate.year.toString() +
|
||||
"-" +
|
||||
pickedDate.month.toString().padLeft(2, '0') +
|
||||
"-" +
|
||||
pickedDate.day.toString().padLeft(2, '0');
|
||||
|
||||
_toDateController.text = selectedDate;
|
||||
// _toDateController.text = selectedDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
InputDecoration textFieldSelectorDecoration(
|
||||
{String hintText,
|
||||
String selectedText,
|
||||
bool isDropDown,
|
||||
IconData icon}) {
|
||||
return InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: selectedText != null ? selectedText : hintText,
|
||||
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (ctx, constraints) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(10),
|
||||
child: AppTextFormField(
|
||||
borderColor: Colors.white,
|
||||
onTap: () => _presentDatePicker('_selectedFromDate'),
|
||||
hintText: TranslationBase.of(context).fromDate,
|
||||
controller: _fromDateController,
|
||||
inputFormatter: ONLY_DATE,
|
||||
onSaved: (value) {
|
||||
if (_fromDateController.text.toString().trim().isEmpty) {
|
||||
widget._patientSearchFormValues.From = "0";
|
||||
} else {
|
||||
widget._patientSearchFormValues.From =
|
||||
_fromDateController.text.replaceAll("/", "-");
|
||||
}
|
||||
},
|
||||
readOnly: true,
|
||||
)),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
if (widget._patientSearchFormValues.From == "0" &&
|
||||
widget.isFormSubmitted)
|
||||
CustomValidationError(),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0))),
|
||||
padding: EdgeInsets.all(10),
|
||||
child: AppTextFormField(
|
||||
readOnly: true,
|
||||
borderColor: Colors.white,
|
||||
hintText: TranslationBase.of(context).toDate,
|
||||
controller: _toDateController,
|
||||
onTap: () {
|
||||
_presentDatePicker('_selectedToDate');
|
||||
},
|
||||
inputFormatter: ONLY_DATE,
|
||||
onSaved: (value) {
|
||||
if (_toDateController.text.toString().trim().isEmpty) {
|
||||
widget._patientSearchFormValues.To = "0";
|
||||
} else {
|
||||
widget._patientSearchFormValues.To =
|
||||
_toDateController.text.replaceAll("/", "-");
|
||||
}
|
||||
},
|
||||
)),
|
||||
if (widget._patientSearchFormValues.To == "0" &&
|
||||
widget.isFormSubmitted)
|
||||
CustomValidationError(),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,237 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
class NumberTextInputFormatter extends TextInputFormatter {
|
||||
@override
|
||||
TextEditingValue formatEditUpdate(
|
||||
TextEditingValue oldValue, TextEditingValue newValue) {
|
||||
final int newTextLength = newValue.text.length;
|
||||
int selectionIndex = newValue.selection.end;
|
||||
int usedSubstringIndex = 0;
|
||||
final StringBuffer newText = StringBuffer();
|
||||
if (newTextLength >= 1) {
|
||||
newText.write('(');
|
||||
if (newValue.selection.end >= 1) selectionIndex++;
|
||||
}
|
||||
if (newTextLength >= 4) {
|
||||
newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') ');
|
||||
if (newValue.selection.end >= 3) selectionIndex += 2;
|
||||
}
|
||||
if (newTextLength >= 7) {
|
||||
newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-');
|
||||
if (newValue.selection.end >= 6) selectionIndex++;
|
||||
}
|
||||
if (newTextLength >= 11) {
|
||||
newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' ');
|
||||
if (newValue.selection.end >= 10) selectionIndex++;
|
||||
}
|
||||
// Dump the rest.
|
||||
if (newTextLength >= usedSubstringIndex)
|
||||
newText.write(newValue.text.substring(usedSubstringIndex));
|
||||
return TextEditingValue(
|
||||
text: newText.toString(),
|
||||
selection: TextSelection.collapsed(offset: selectionIndex),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final _mobileFormatter = NumberTextInputFormatter();
|
||||
|
||||
class NewTextFields extends StatefulWidget {
|
||||
NewTextFields(
|
||||
{Key key,
|
||||
this.type,
|
||||
this.hintText,
|
||||
this.suffixIcon,
|
||||
this.autoFocus,
|
||||
this.onChanged,
|
||||
this.initialValue,
|
||||
this.minLines,
|
||||
this.maxLines,
|
||||
this.inputFormatters,
|
||||
this.padding,
|
||||
this.focus = false,
|
||||
this.maxLengthEnforced = true,
|
||||
this.suffixIconColor,
|
||||
this.inputAction,
|
||||
this.onSubmit,
|
||||
this.keepPadding = true,
|
||||
this.textCapitalization = TextCapitalization.none,
|
||||
this.controller,
|
||||
this.keyboardType,
|
||||
this.validator,
|
||||
this.borderOnlyError = false,
|
||||
this.onSaved,
|
||||
this.onSuffixTap,
|
||||
this.readOnly: false,
|
||||
this.maxLength,
|
||||
this.prefixIcon,
|
||||
this.bare = false,
|
||||
this.onTap,
|
||||
this.fontSize = 15.0,
|
||||
this.fontWeight = FontWeight.w500,
|
||||
this.autoValidate = false,
|
||||
this.hintColor,
|
||||
this.isEnabled = true})
|
||||
: super(key: key);
|
||||
|
||||
final String hintText;
|
||||
|
||||
// final String initialValue;
|
||||
final String type;
|
||||
final bool autoFocus;
|
||||
final IconData suffixIcon;
|
||||
final Color suffixIconColor;
|
||||
final Icon prefixIcon;
|
||||
final VoidCallback onTap;
|
||||
final TextEditingController controller;
|
||||
final TextInputType keyboardType;
|
||||
final FormFieldValidator validator;
|
||||
final Function onSaved;
|
||||
final Function onSuffixTap;
|
||||
final Function onChanged;
|
||||
final Function onSubmit;
|
||||
final bool readOnly;
|
||||
final int maxLength;
|
||||
final int minLines;
|
||||
final int maxLines;
|
||||
final bool maxLengthEnforced;
|
||||
final bool bare;
|
||||
final bool isEnabled;
|
||||
final TextInputAction inputAction;
|
||||
final double fontSize;
|
||||
final FontWeight fontWeight;
|
||||
final bool keepPadding;
|
||||
final TextCapitalization textCapitalization;
|
||||
final List<TextInputFormatter> inputFormatters;
|
||||
final bool autoValidate;
|
||||
final EdgeInsets padding;
|
||||
final bool focus;
|
||||
final bool borderOnlyError;
|
||||
final Color hintColor;
|
||||
final String initialValue;
|
||||
|
||||
@override
|
||||
_NewTextFieldsState createState() => _NewTextFieldsState();
|
||||
}
|
||||
|
||||
class _NewTextFieldsState extends State<NewTextFields> {
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
bool focus = false;
|
||||
bool view = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_focusNode.addListener(() {
|
||||
setState(() {
|
||||
focus = _focusNode.hasFocus;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(NewTextFields oldWidget) {
|
||||
if (widget.focus) _focusNode.requestFocus();
|
||||
super.didUpdateWidget(oldWidget);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_focusNode.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
bool _determineReadOnly() {
|
||||
if (widget.readOnly != null && widget.readOnly) {
|
||||
_focusNode.unfocus();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: HexColor('#707070'), width: 0.30),
|
||||
color: Colors.white),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
child: TextFormField(
|
||||
enabled: widget.isEnabled,
|
||||
initialValue: widget.initialValue,
|
||||
keyboardAppearance: Theme.of(context).brightness,
|
||||
scrollPhysics: BouncingScrollPhysics(),
|
||||
// autovalidate: widget.autoValidate,
|
||||
textCapitalization: widget.textCapitalization,
|
||||
onFieldSubmitted: widget.inputAction == TextInputAction.next
|
||||
? (widget.onSubmit != null
|
||||
? widget.onSubmit
|
||||
: (val) {
|
||||
_focusNode.nextFocus();
|
||||
})
|
||||
: widget.onSubmit,
|
||||
textInputAction: widget.inputAction,
|
||||
minLines: widget.minLines ?? 1,
|
||||
maxLines: widget.maxLines ?? 1,
|
||||
maxLengthEnforced: widget.maxLengthEnforced,
|
||||
onChanged: widget.onChanged,
|
||||
focusNode: _focusNode,
|
||||
maxLength: widget.maxLength ?? null,
|
||||
controller: widget.controller,
|
||||
keyboardType: widget.keyboardType,
|
||||
readOnly: _determineReadOnly(),
|
||||
obscureText: widget.type == "password" && !view ? true : false,
|
||||
autofocus: widget.autoFocus ?? false,
|
||||
validator: widget.validator,
|
||||
onSaved: widget.onSaved,
|
||||
style: Theme.of(context).textTheme.bodyText1.copyWith(
|
||||
fontSize: widget.fontSize,
|
||||
fontWeight: widget.fontWeight,
|
||||
color: Color(0xFF575757),
|
||||
fontFamily: 'Poppins'),
|
||||
inputFormatters: widget.keyboardType == TextInputType.phone
|
||||
? <TextInputFormatter>[
|
||||
// WhitelistingTextInputFormatter.digitsOnly,
|
||||
_mobileFormatter,
|
||||
]
|
||||
: widget.inputFormatters,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.hintText,
|
||||
labelStyle: TextStyle(
|
||||
color: Color(0xFF2E303A),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).errorColor.withOpacity(0.5),
|
||||
width: 1.0),
|
||||
borderRadius: BorderRadius.circular(12.0)),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).errorColor.withOpacity(0.5),
|
||||
width: 1.0),
|
||||
borderRadius: BorderRadius.circular(8.0)),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.white, width: 1.0),
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.white, width: 1.0),
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.white, width: 1.0),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue