Merge branches 'allergyies' and 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into allergyies

merge-requests/452/head
Elham Rababah 4 years ago
commit 1ac67a7bc1

@ -247,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

@ -824,6 +824,7 @@ const Map<String, Map<String, String>> localizedValues = {
"accepted": {"en": "Accepted", "ar": "وافقت"},
"cancelled": {"en": "Cancelled", "ar": "ألغيت"},
"unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"},
"searchHere": {"en": "Search here", "ar": "إبحث هنا"},
"replied": {"en": "Replied", "ar": " تم الرد"},
"typeHereToReply": {
"en": "Type here to reply",

@ -1,27 +1,41 @@
class InsuranceApprovalDetails {
class ApporvalDetails {
int approvalNo;
String procedureName;
//String procedureNameN;
String status;
String isInvoicedDesc;
InsuranceApprovalDetails({
this.procedureName,
this.status,
this.isInvoicedDesc,
});
ApporvalDetails(
{this.approvalNo, this.procedureName, this.status, this.isInvoicedDesc});
InsuranceApprovalDetails.fromJson(Map<String, dynamic> json) {
try {
isInvoicedDesc = json['IsInvoicedDesc'];
status = json['Status'];
procedureName = json['ProcedureName'];
} catch (e) {
print(e);
}
ApporvalDetails.fromJson(Map<String, dynamic> json) {
approvalNo = json['ApprovalNo'];
procedureName = json['ProcedureName'];
status = json['Status'];
isInvoicedDesc = json['IsInvoicedDesc'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ApprovalNo'] = this.approvalNo;
data['ProcedureName'] = this.procedureName;
data['Status'] = this.status;
data['IsInvoicedDesc'] = this.isInvoicedDesc;
return data;
}
}
class InsuranceApprovalModel {
InsuranceApprovalDetails approvalDetails;
List<ApporvalDetails> apporvalDetails;
double versionID;
int channel;
int languageID;
@ -75,11 +89,11 @@ class InsuranceApprovalModel {
//this.companyName,
this.expiryDate,
this.rceiptOn,
this.approvalDetails,
this.apporvalDetails,
this.appointmentNo,
this.doctorImage});
InsuranceApprovalDetails x = InsuranceApprovalDetails();
//InsuranceApprovalDetails x = InsuranceApprovalDetails();
InsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
try {
@ -108,8 +122,12 @@ class InsuranceApprovalModel {
doctorName = json['DoctorName'];
doctorImage = json['DoctorImageURL'];
clinicName = json['ClinicName'];
approvalDetails =
InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
if (json['ApporvalDetails'] != null) {
apporvalDetails = new List<ApporvalDetails>();
json['ApporvalDetails'].forEach((v) {
apporvalDetails.add(new ApporvalDetails.fromJson(v));
});
}
appointmentNo = json['AppointmentNo'];
} catch (e) {
print(e);
@ -143,3 +161,320 @@ class InsuranceApprovalModel {
return data;
}
}
// class InsuranceApprovalModel {
// String setupID;
// int projectID;
// int approvalNo;
// String approvalDate;
// int patientType;
// int patientID;
// int companyID;
// int subCategoryID;
// int doctorID;
// int clinicID;
// int approvalType;
// Null inpatientApprovalSubType;
// String validFrom;
// Null vaildDays;
// String validTo;
// Null isApprovalOnGross;
// Null isPackage;
// int requestedAmount;
// bool isDentalAllowedBackend;
// int patientTypeID;
//
// String companyApprovalNo;
//
// String submitOn;
// String receiptOn;
//
// int status;
// int eXuldAPPNO;
// String feedbackStatusOn;
// int authorizerID;
// String expiryDate;
// int appointmentNo;
// int admissionNo;
//
// int createdBy;
// String createdOn;
// int editedBy;
// String editedOn;
//
// String extendedOn;
//
// int noOrderAuthorizerID;
// bool isVerbalApproval;
//
// List<ApporvalDetails> apporvalDetails;
// String approvalStatusDescption;
// String clinicName;
//
// //Null companyName;
// String doctorImageURL;
// String doctorName;
//
// int doctorRate;
// String doctorTitle;
// int gender;
// String genderDescription;
// bool isActiveDoctorProfile;
// bool isExecludeDoctor;
// bool isInOutPatient;
// String isInOutPatientDescription;
// String isInOutPatientDescriptionN;
// bool isLiveCareAppointment;
// String projectName;
//
// String qR;
// List<String> speciality;
//
// int totaUnUsedCount;
// int unUsedCount;
//
// InsuranceApprovalModel(
// {this.setupID,
// this.projectID,
// this.approvalNo,
// this.approvalDate,
// this.patientType,
// this.patientID,
// this.companyID,
// this.subCategoryID,
// this.doctorID,
// this.clinicID,
// this.approvalType,
// this.inpatientApprovalSubType,
// this.validFrom,
// this.vaildDays,
// this.validTo,
// this.isApprovalOnGross,
// this.isPackage,
// this.requestedAmount,
// this.patientTypeID,
// this.companyApprovalNo,
// this.eXuldAPPNO,
// this.submitOn,
// this.receiptOn,
// this.status,
// this.feedbackStatusOn,
// this.authorizerID,
// this.expiryDate,
// this.appointmentNo,
// this.admissionNo,
// this.createdBy,
// this.createdOn,
// this.editedBy,
// this.editedOn,
// this.extendedOn,
// this.noOrderAuthorizerID,
// this.isVerbalApproval,
// this.apporvalDetails,
// this.approvalStatusDescption,
// this.clinicName,
// this.doctorImageURL,
// this.doctorName,
// this.doctorRate,
// this.doctorTitle,
// this.gender,
// this.genderDescription,
// this.isActiveDoctorProfile,
// this.isExecludeDoctor,
// this.isInOutPatient,
// this.isInOutPatientDescription,
// this.isInOutPatientDescriptionN,
// this.isLiveCareAppointment,
// this.projectName,
// this.qR,
// this.speciality,
// this.totaUnUsedCount,
// this.unUsedCount,
// this.isDentalAllowedBackend});
//
// InsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
// eXuldAPPNO = json['EXuldAPPNO'];
// setupID = json['SetupID'];
// projectID = json['ProjectID'];
// approvalNo = json['ApprovalNo'];
// approvalDate = json['ApprovalDate'];
// patientType = json['PatientType'];
// patientID = json['PatientID'];
// companyID = json['CompanyID'];
// subCategoryID = json['SubCategoryID'];
// doctorID = json['DoctorID'];
// clinicID = json['ClinicID'];
// approvalType = json['ApprovalType'];
// inpatientApprovalSubType = json['InpatientApprovalSubType'];
// validFrom = json['ValidFrom'];
// vaildDays = json['VaildDays'];
// validTo = json['ValidTo'];
// isApprovalOnGross = json['IsApprovalOnGross'];
// isPackage = json['IsPackage'];
// requestedAmount = json['RequestedAmount'];
//
// companyApprovalNo = json['CompanyApprovalNo'];
//
// submitOn = json['SubmitOn'];
// receiptOn = json['ReceiptOn'];
//
// status = json['Status'];
//
// feedbackStatusOn = json['FeedbackStatusOn'];
// authorizerID = json['AuthorizerID'];
// expiryDate = json['ExpiryDate'];
// appointmentNo = json['AppointmentNo'];
// admissionNo = json['AdmissionNo'];
//
// createdBy = json['CreatedBy'];
// createdOn = json['CreatedOn'];
// editedBy = json['EditedBy'];
// editedOn = json['EditedOn'];
//
// extendedOn = json['ExtendedOn'];
//
// noOrderAuthorizerID = json['NoOrderAuthorizerID'];
// isVerbalApproval = json['isVerbalApproval'];
//
// if (json['ApporvalDetails'] != null) {
// apporvalDetails = new List<ApporvalDetails>();
// json['ApporvalDetails'].forEach((v) {
// apporvalDetails.add(new ApporvalDetails.fromJson(v));
// });
// }
// approvalStatusDescption = json['ApprovalStatusDescption'];
// clinicName = json['ClinicName'];
//
// doctorImageURL = json['DoctorImageURL'];
// doctorName = json['DoctorName'];
//
// doctorRate = json['DoctorRate'];
// doctorTitle = json['DoctorTitle'];
// gender = json['Gender'];
// genderDescription = json['GenderDescription'];
// isActiveDoctorProfile = json['IsActiveDoctorProfile'];
// isExecludeDoctor = json['IsExecludeDoctor'];
// isInOutPatient = json['IsInOutPatient'];
// isInOutPatientDescription = json['IsInOutPatientDescription'];
// isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
// isLiveCareAppointment = json['IsLiveCareAppointment'];
// projectName = json['ProjectName'];
//
// qR = json['QR'];
// speciality = json['Speciality'].cast<String>();
//
// totaUnUsedCount = json['TotaUnUsedCount'];
// unUsedCount = json['UnUsedCount'];
// }
//
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> data = new Map<String, dynamic>();
// data['SetupID'] = this.setupID;
// data['ProjectID'] = this.projectID;
// data['ApprovalNo'] = this.approvalNo;
// data['ApprovalDate'] = this.approvalDate;
// data['PatientType'] = this.patientType;
// data['PatientID'] = this.patientID;
// data['CompanyID'] = this.companyID;
// data['SubCategoryID'] = this.subCategoryID;
// data['DoctorID'] = this.doctorID;
// data['ClinicID'] = this.clinicID;
// data['ApprovalType'] = this.approvalType;
// data['InpatientApprovalSubType'] = this.inpatientApprovalSubType;
// data['ValidFrom'] = this.validFrom;
// data['VaildDays'] = this.vaildDays;
// data['ValidTo'] = this.validTo;
// data['IsApprovalOnGross'] = this.isApprovalOnGross;
// data['IsPackage'] = this.isPackage;
// data['RequestedAmount'] = this.requestedAmount;
//
// data['CompanyApprovalNo'] = this.companyApprovalNo;
//
// data['SubmitOn'] = this.submitOn;
// data['ReceiptOn'] = this.receiptOn;
//
// data['Status'] = this.status;
//
// data['FeedbackStatusOn'] = this.feedbackStatusOn;
// data['AuthorizerID'] = this.authorizerID;
// data['ExpiryDate'] = this.expiryDate;
// data['AppointmentNo'] = this.appointmentNo;
// data['AdmissionNo'] = this.admissionNo;
//
// data['CreatedBy'] = this.createdBy;
// data['CreatedOn'] = this.createdOn;
// data['EditedBy'] = this.editedBy;
// data['EditedOn'] = this.editedOn;
// data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
//
// data['ExtendedOn'] = this.extendedOn;
//
// data['NoOrderAuthorizerID'] = this.noOrderAuthorizerID;
// data['isVerbalApproval'] = this.isVerbalApproval;
//
// if (this.apporvalDetails != null) {
// data['ApporvalDetails'] =
// this.apporvalDetails.map((v) => v.toJson()).toList();
// }
// data['ApprovalStatusDescption'] = this.approvalStatusDescption;
// data['ClinicName'] = this.clinicName;
//
// data['DoctorImageURL'] = this.doctorImageURL;
// data['DoctorName'] = this.doctorName;
// data['EXuldAPPNO'] = this.eXuldAPPNO;
// data['DoctorRate'] = this.doctorRate;
// data['DoctorTitle'] = this.doctorTitle;
// data['Gender'] = this.gender;
// data['GenderDescription'] = this.genderDescription;
// data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
// data['IsExecludeDoctor'] = this.isExecludeDoctor;
// data['IsInOutPatient'] = this.isInOutPatient;
// data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
// data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
// data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
// data['ProjectName'] = this.projectName;
//
// data['QR'] = this.qR;
// data['Speciality'] = this.speciality;
//
// data['TotaUnUsedCount'] = this.totaUnUsedCount;
// data['UnUsedCount'] = this.unUsedCount;
// return data;
// }
// }
//
// class ApporvalDetails {
// int approvalNo;
//
// String procedureName;
// //String procedureNameN;
// String status;
//
// String isInvoicedDesc;
//
// ApporvalDetails(
// {this.approvalNo, this.procedureName, this.status, this.isInvoicedDesc});
//
// ApporvalDetails.fromJson(Map<String, dynamic> json) {
// approvalNo = json['ApprovalNo'];
//
// procedureName = json['ProcedureName'];
//
// status = json['Status'];
//
// isInvoicedDesc = json['IsInvoicedDesc'];
// }
//
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> data = new Map<String, dynamic>();
//
// data['ApprovalNo'] = this.approvalNo;
//
// data['ProcedureName'] = this.procedureName;
//
// data['Status'] = this.status;
//
// data['IsInvoicedDesc'] = this.isInvoicedDesc;
// return data;
// }
// }

@ -136,8 +136,10 @@ class SickLeaveService extends BaseService {
onSuccess: (dynamic response, int statusCode) {
offTime = [];
response['MasterLookUpList']['entityList'].forEach((item) => {
if (item['code'] == '1' || item['code'] == '2')
{offTime.add(item)}
//if (item['code'] == '1' || item['code'] == '2')
// {
offTime.add(item)
//}//
});
},
onFailure: (String error, int statusCode) {

@ -801,7 +801,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.start,
children: <Widget>[
AppText(
model.dashboardItemsList[4]
model.dashboardItemsList[6]
.kPIName,
fontSize:
SizeConfig.textMultiplier *
@ -827,11 +827,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Axis.horizontal,
children: new List.generate(
model
.dashboardItemsList[4]
.dashboardItemsList[6]
.summaryoptions
.length, (int index) {
return getActivityButton(model
.dashboardItemsList[4]
.dashboardItemsList[6]
.summaryoptions[index]);
})))
],
@ -843,7 +843,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.start,
children: <Widget>[
AppText(
model.dashboardItemsList[6]
model.dashboardItemsList[4]
.kPIName,
fontSize:
SizeConfig.textMultiplier *
@ -869,11 +869,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Axis.horizontal,
children: new List.generate(
model
.dashboardItemsList[6]
.dashboardItemsList[4]
.summaryoptions
.length, (int index) {
return getActivityButton(model
.dashboardItemsList[6]
.dashboardItemsList[4]
.summaryoptions[index]);
})))
],
@ -1221,7 +1221,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Container(
height: 150,
margin: EdgeInsets.all(5),
width: ((SizeConfig.screenWidth * .55) / 5.3),
width: 40,
child: SizedBox(),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), color: Colors.red[50]),
@ -1233,14 +1233,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
margin: EdgeInsets.all(5),
padding: EdgeInsets.all(10),
height: max != 0 ? (150 * value.value) / max : 0,
width: ((SizeConfig.screenWidth * .55) / 5),
width: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.red[300]))),
Container(
height: 150,
margin: EdgeInsets.only(left: 10, top: 5),
padding: EdgeInsets.all(8),
margin: EdgeInsets.only(left: 5, top: 5),
padding: EdgeInsets.all(10),
child: RotatedBox(
quarterTurns: 1,
child: Center(

@ -1,8 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.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/patients/profile/patient-profile-header-new-design-app-bar.dart';
@ -14,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MedicalFileDetails extends StatefulWidget {
String age;
@ -69,6 +72,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: pp),
builder:
@ -184,7 +188,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
TranslationBase.of(context)
.episode +
": ",
fontWeight: FontWeight.w700,
//fontWeight: FontWeight.w700,
),
if (model.medicalFileList.length !=
0 &&
@ -216,7 +220,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
TranslationBase.of(context)
.visitDate +
": ",
fontWeight: FontWeight.w700,
//fontWeight: FontWeight.w700,
),
if (model.medicalFileList.length !=
0 &&
@ -230,15 +234,17 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.length !=
0)
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.appointmentDate
.toString(),
'${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(
model
.medicalFileList[0]
.entityList[0]
.timelines[
encounterNumber]
.date,
), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight: FontWeight.w700,
fontSize: 14,
),
SizedBox(width: 35.0),
// AppText(

@ -40,7 +40,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType.toString() ?? "0", patientType),
patient, patientType.toString() ?? "0", arrivalType),
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView(

@ -42,7 +42,8 @@ class _InsuranceApprovalScreenNewState
return BaseView<InsuranceViewModel>(
onModelReady: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo,projectId: patient.projectId)
appointmentNo: patient.appointmentNo,
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
@ -147,7 +148,8 @@ class _InsuranceApprovalScreenNewState
.toString(),
isPrescriptions: true,
approvalStatus: model.insuranceApproval[index]
.approvalDetails?.status??'',
.approvalStatusDescption ??
'',
),
),
),

@ -37,7 +37,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
return BaseView<InsuranceViewModel>(
onModelReady: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo,projectId: patient.projectId)
appointmentNo: patient.appointmentNo,
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
@ -93,12 +94,25 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row(
children: [
Texts(
model.insuranceApproval[indexInsurance].approvalDetails!=null?
model.insuranceApproval[indexInsurance].approvalDetails.status ??"":"",
color:
model.insuranceApproval[indexInsurance].approvalDetails!=null?
"${model.insuranceApproval[indexInsurance].approvalDetails.status}"
== "Approved" ? Color(0xff359846) : Color(0xffD02127): Color(0xffD02127),
model.insuranceApproval[indexInsurance]
.approvalStatusDescption !=
null
? model
.insuranceApproval[
indexInsurance]
.approvalStatusDescption ??
""
: "",
color: model
.insuranceApproval[
indexInsurance]
.approvalStatusDescption !=
null
? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" ==
"Approved"
? Color(0xff359846)
: Color(0xffD02127)
: Color(0xffD02127),
),
],
),
@ -208,7 +222,6 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Texts('Sample')
],
),
Row(
children: [
Texts(
@ -293,59 +306,84 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context)
.size
.height *
0.15, //130.0,
width: MediaQuery.of(context)
.size
.width *
0.33,
child: Texts(model
.insuranceApproval[
indexInsurance]
?.approvalDetails
?.procedureName??""),
),
Container(
height: MediaQuery.of(context)
.size
.height *
0.15,
width: MediaQuery.of(context)
.size
.width *
0.33,
child: Texts(model
.insuranceApproval[
indexInsurance]
?.approvalDetails
?.status??""),
),
Container(
height: MediaQuery.of(context)
.size
.height *
0.15,
width: MediaQuery.of(context)
.size
.width *
0.21,
child: Texts(model
.insuranceApproval[
indexInsurance]
?.approvalDetails
?.isInvoicedDesc??""),
),
],
),
child: ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: model
.insuranceApproval[indexInsurance]
.apporvalDetails
.length,
itemBuilder: (BuildContext context,
int index) {
return Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
height:
MediaQuery.of(context)
.size
.height *
0.15, //130.0,
width:
MediaQuery.of(context)
.size
.width *
0.33,
child: Texts(model
.insuranceApproval[
indexInsurance]
?.apporvalDetails[
index]
?.procedureName ??
""),
),
Container(
height:
MediaQuery.of(context)
.size
.height *
0.15,
width:
MediaQuery.of(context)
.size
.width *
0.33,
child: Texts(model
.insuranceApproval[
indexInsurance]
?.apporvalDetails[
index]
?.status ??
""),
),
Container(
height:
MediaQuery.of(context)
.size
.height *
0.15,
width:
MediaQuery.of(context)
.size
.width *
0.21,
child: Texts(model
.insuranceApproval[
indexInsurance]
?.apporvalDetails[
index]
?.isInvoicedDesc ??
""),
),
],
),
);
}),
),
Divider(
color: Colors.black45,

@ -226,11 +226,11 @@ class _PatientsScreenState extends State<PatientsScreen> {
Widget build(BuildContext context) {
authProvider = Provider.of(context);
_locations = [
TranslationBase.of(context).all,
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
];
//TranslationBase.of(context).all,
projectsProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -449,18 +449,18 @@ class _PatientsScreenState extends State<PatientsScreen> {
},
)),
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context)
.size
.height *
0.03),
child: _locationBar(context)
// child: SERVICES_PATIANT2[
// int.parse(patientType)] ==
// "List_MyOutPatient"
// ? _locationBar(context)
// : Container(),
),
padding: EdgeInsets.only(
top: MediaQuery.of(context)
.size
.height *
0.03),
// child: _locationBar(context)
child: SERVICES_PATIANT2[
int.parse(patientType)] ==
"patientArrivalList"
? _locationBar(context)
: Container(),
),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceEvenly,

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_head
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -80,27 +81,27 @@ class RadiologyDetailsPage extends StatelessWidget {
SizedBox(
height: 100,
),
],
),
),
],
),
),
bottomSheet: model.radImageURL.isNotEmpty ?Container(
width: double.maxFinite,
height: 100,
child: Container(
margin: EdgeInsets.only(left: 35,right: 35,top: 12,bottom: 12),
child: Button(
color: Colors.red,
onTap: () {
launch(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
),
),
):null,
bottomSheet: model.radImageURL.isNotEmpty
? Container(
width: double.maxFinite,
child: Container(
margin:
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: AppButton(
onPressed: () {
launch(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
),
),
)
: null,
),
);
}

@ -17,6 +17,7 @@ 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/borderedButton.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widg
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/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
@ -74,11 +75,8 @@ class MyReferralPatientScreen extends StatelessWidget {
'referral': model.pendingReferral[index]
});
},
child: Icon(
Icons.info_outline,
color: Colors.black,
size: 30,
),
child: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
),
),

@ -32,7 +32,8 @@ class PrescriptionsPage extends StatelessWidget {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType),
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType ?? '0', arrivalType),
body: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
@ -60,7 +61,9 @@ class PrescriptionsPage extends StatelessWidget {
],
),
),
if (patientType != null && patientType == '7' && patient.patientStatusType == 43)
if (patientType != null &&
patientType == '7' &&
patient.patientStatusType == 43)
InkWell(
onTap: () {
addPrescriptionForm(

@ -10,8 +10,16 @@ import 'package:provider/provider.dart';
class ProcedureCard extends StatelessWidget {
final Function onTap;
final EntityList entityList;
final String categoryName;
final int categoryID;
const ProcedureCard({Key key, this.onTap, this.entityList}) : super(key: key);
const ProcedureCard(
{Key key,
this.onTap,
this.entityList,
this.categoryID,
this.categoryName})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -37,9 +45,8 @@ class ProcedureCard extends StatelessWidget {
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),
),
color: entityList.orderType == 1
? Colors.red[500]
: Colors.black,
color:
entityList.orderType == 1 ? Colors.red[500] : Colors.black,
),
),
Expanded(
@ -105,12 +112,43 @@ class ProcedureCard extends StatelessWidget {
children: [
Texts(
TranslationBase.of(context).orderNo,
color: Colors.grey,
//color: Colors.grey,
fontSize: 12,
color: Colors.grey,
),
Texts(
entityList.orderNo.toString(),
fontSize: 12,
bold: true,
),
],
),
Row(
children: [
Texts(
TranslationBase.of(context).doctorName + ": ",
//color: Colors.grey,
fontSize: 12,
color: Colors.grey,
),
Texts(
entityList.doctorName.toString(),
fontSize: 12,
bold: true,
),
],
),
Row(
children: [
Texts(
TranslationBase.of(context).clinic + ": ",
//color: Colors.grey,
fontSize: 12,
color: Colors.grey,
),
Texts(
entityList.clinicDescription.toString(),
bold: true,
fontSize: 12,
),
],
@ -119,10 +157,12 @@ class ProcedureCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
entityList.remarks ?? '',
entityList.remarks.toString() ?? '',
fontSize: 12,
),
Icon(Icons.edit)
if (entityList.categoryID == 2 ||
entityList.categoryID == 4)
Icon(Icons.edit)
],
)
],

@ -29,7 +29,8 @@ class ProcedureScreen extends StatelessWidget {
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType),
appBar: PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType),
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
@ -110,36 +111,38 @@ class ProcedureScreen extends StatelessWidget {
...List.generate(
model.procedureList[0].rowcount,
(index) => ProcedureCard(
categoryID:
model.procedureList[0].entityList[index].categoryID,
entityList: model.procedureList[0].entityList[index],
onTap: () {
if (model.procedureList[0].entityList[index]
.categoryID ==
2 ||
model.procedureList[0].entityList[index]
.categoryID ==
4) {
updateProcedureForm(context,
model: model,
patient: patient,
remarks: model
.procedureList[0].entityList[index].remarks,
orderType: model.procedureList[0]
.entityList[index].orderType
.toString(),
orderNo: model
.procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0]
.entityList[index].procedureName,
categoreId: model.procedureList[0]
.entityList[index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList[index].procedureId,
limetNo: model.procedureList[0]
.entityList[index].lineItemNo);
} else
helpers.showErrorToast(
'You Cant Update This Procedure');
// if (model.procedureList[0].entityList[index]
// .categoryID ==
// 2 ||
// model.procedureList[0].entityList[index]
// .categoryID ==
// 4) {
updateProcedureForm(context,
model: model,
patient: patient,
remarks: model
.procedureList[0].entityList[index].remarks,
orderType: model
.procedureList[0].entityList[index].orderType
.toString(),
orderNo: model
.procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0]
.entityList[index].procedureName,
categoreId: model
.procedureList[0].entityList[index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList[index].procedureId,
limetNo: model.procedureList[0].entityList[index]
.lineItemNo);
// } else
// helpers.showErrorToast(
// 'You Cant Update This Procedure');
},
),
),

@ -104,13 +104,19 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
offTime = widget.updateData != null
? widget.updateData.requisitionType.toString()
: offTime;
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => {
model2.getOffTime(),
model2.getReasons(18),
model2.getReasons(offTime == '1'
? 18
: offTime == '2'
? 19
: 102),
model2.getCoveringDoctors()
},
builder: (_, model2, w) => GestureDetector(

@ -35,69 +35,72 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column(children: [
PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: 24,
fontWeight: FontWeight.bold,
),
],
)),
Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
patient.patientStatusType == 43
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: 24,
fontWeight: FontWeight.bold,
),
],
)),
Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
)),
Padding(
child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
)),
Padding(
child: AppText(
TranslationBase.of(context).noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
],
)),
],
),
],
)),
],
)
: SizedBox(),
model.getAllSIckLeave.length > 0
? Column(
children: model.getAllSIckLeave

@ -1205,8 +1205,8 @@ class TranslationBase {
String get unReplied => localizedValues['unReplied'][locale.languageCode];
String get replied => localizedValues['replied'][locale.languageCode];
String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode];
String get searchHere => localizedValues['searchHere'][locale.languageCode];
String get remove => localizedValues['remove'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -463,36 +463,41 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 30,
height: 30,
margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 10 /*10:85*/,
right: projectViewModel.isArabic ? 10 : 10 /*85:10*/,
left:
projectViewModel.isArabic ? 10 : 10 /*10:85*/,
right:
projectViewModel.isArabic ? 10 : 10 /*85:10*/,
top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom:
BorderSide(color: Colors.grey[400], width: 2.5),
left:
BorderSide(color: Colors.grey[400], width: 2.5),
bottom: BorderSide(
color: Colors.grey[400], width: 2.5),
left: BorderSide(
color: Colors.grey[400], width: 2.5),
)),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(left: 10, top: 25, right : 10, bottom: 0),
margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column(
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
TextSpan(
text: TranslationBase.of(context)
.referralDoctor +
.referralDoctor +
" : ",
style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')),
fontSize: 14,
fontFamily: 'Poppins')),
TextSpan(
text: referralDoctorName,
style: TextStyle(
@ -511,8 +516,7 @@ class PatientReferralItemWidget extends StatelessWidget {
Container(
width: double.infinity,
alignment: Alignment.centerRight,
child: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black))
child: infoIcon ?? Container())
],
),
// onTap: onTap,

@ -10,13 +10,14 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget{
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
with PreferredSizeWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType);
PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType);
@override
Widget build(BuildContext context) {
@ -28,14 +29,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
}
return Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,),
left: 0,
right: 5,
bottom: 5,
),
decoration: BoxDecoration(
color: Colors.white,
),
height: 200,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10, bottom: 10),
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
children: [
@ -49,12 +52,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
),
Expanded(
child: AppText(
patient.firstName != null ?
(Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier *2.2,
patient.firstName != null
? (Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
@ -62,13 +65,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
),
gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
DoctorApp.female_1,
color: Colors.pink,
),
]),
),
Row(children: [
@ -79,129 +82,97 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[
int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patient.patientStatusType ==
43
patient.patientStatusType == 43
? AppText(
TranslationBase.of(
context)
.arrivedP,
color: Colors.green,
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
)
TranslationBase.of(context).arrivedP,
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(
context)
.notArrived,
color:
Colors.red[800],
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
),
arrivalType == '1'
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
arrivalType == '1'|| patient.arrivedOn == null
? AppText(
patient.startTime !=
null
? patient
.startTime
: '',
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
patient.startTime != null
? patient.startTime
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: AppText(
patient.arrivedOn!=null? DateUtils.convertStringToDateFormat(
patient.arrivedOn,
'MM-dd-yyyy HH:mm'):'',
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
],
))
patient.arrivedOn != null
? DateUtils.convertStringToDateFormat(
patient.arrivedOn,
'MM-dd-yyyy HH:mm')
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[
int.parse(patientType)] ==
if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.appointmentDate +
TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
25),
color: HexColor(
"#20A169"),
),
child: AppText(
patient.startTime,
color: Colors.white,
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight:
FontWeight.bold,
),
)
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
patient.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
convertDateFormat2(
patient.appointmentDate.toString() ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
@ -214,34 +185,23 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig
.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(
context)
.fileNumber,
text: TranslationBase.of(context).fileNumber,
style: TextStyle(
fontSize: 12,
fontFamily:
'Poppins')),
fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: patient.patientId
.toString(),
text: patient.patientId.toString(),
style: TextStyle(
fontWeight:
FontWeight.w700,
fontFamily:
'Poppins',
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 14)),
],
),
@ -249,32 +209,23 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality,
patient.nationalityName ?? patient.nationality,
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationality != null
? ClipRRect(
borderRadius:
BorderRadius
.circular(
20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: SizedBox()
],
)
@ -284,26 +235,19 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.age +
" : ",
style: TextStyle(
fontSize: 14)),
text: TranslationBase.of(context).age + " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text:
"${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
"${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 14)),
fontWeight: FontWeight.w700, fontSize: 14)),
],
),
),
@ -330,10 +274,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
@ -357,7 +301,5 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
}
@override
Size get preferredSize => Size(double.maxFinite,200);
Size get preferredSize => Size(double.maxFinite, 200);
}

@ -14,9 +14,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
PatientProfileHeaderNewDesign(
this.patient, this.patientType, this.arrivalType);
this.patient, this.patientType, this.arrivalType, {this.height = 0.0});
@override
Widget build(BuildContext context) {
@ -36,7 +37,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.white,
),
height: 200,
height: height == 0 ? 200 : height,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
@ -116,7 +117,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
fontFamily: 'Poppins',
fontSize: 12,
),
arrivalType == '1'
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime != null
? patient.startTime

@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
'Poppins',
fontSize: 12,
),
arrivalType == '1'
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime !=
null

@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
'Poppins',
fontSize: 12,
),
arrivalType == '1'
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime !=
null

@ -43,34 +43,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
children: [
/*if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
isDisable: patient.episodeNo != 0 ? true : false,
nameLine1: TranslationBase.of(context).createNew,
nameLine2: TranslationBase.of(context).episode,
route: CREATE_EPISODE,
onTap: () async {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: patient.appointmentNo,
patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(CREATE_EPISODE,
arguments: {'patient': patient});
},
isLoading: model.state == ViewState.BusyLocal,
icon: 'create-episod.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
isDisable: patient.episodeNo == 0 ? true : false,
nameLine1: TranslationBase.of(context).update,
nameLine2: TranslationBase.of(context).episode,
route: UPDATE_EPISODE,
icon: 'modilfy-episode.png'),*/
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
@ -89,60 +61,38 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
if (selectedPatientType != 0 &&
selectedPatientType != 5 &&
selectedPatientType != 7)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
// (int.parse(patientType) == 7 || int.parse(patientType) == 6)
// ? PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PRESCRIPTION,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2: TranslationBase.of(context).prescription,
// icon: 'patient/order_prescription.png')
// : PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PRESCRIPTION_HISTORY,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2: TranslationBase.of(context).prescription,
// icon: 'patient/order_prescription.png'),
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
key: key,
patient: patient,
@ -168,10 +118,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
@ -189,6 +139,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'),
@ -198,29 +149,32 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
route: REFER_PATIENT_TO_DOCTOR,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
route: PATIENT_ADMISSION_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
if (patientType == "1")
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
],
),
);

@ -39,19 +39,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
@ -66,19 +68,19 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// route: PATIENT_ADMISSION_REQUEST,
// nameLine1: TranslationBase.of(context).admission,
// nameLine2: TranslationBase.of(context).request,
// icon: 'heartbeat.png'),
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
(int.parse(patientType) == 7 || int.parse(patientType) == 6)
? PatientProfileButton(
key: key,
@ -103,19 +105,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
@ -125,15 +118,23 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// route: PATIENT_ADMISSION_REQUEST,
// nameLine1: TranslationBase.of(context).admission,
// nameLine2: TranslationBase.of(context).request,
// icon: 'heartbeat.png'),
if (patientType == "1")
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
],
),
);

@ -0,0 +1,92 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ExaminationIitemCard extends StatelessWidget {
final MySelectedExamination examination;
final Function removeExamination;
ExaminationIitemCard(this.examination, this.removeExamination);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
color: Colors.white,
padding: EdgeInsets.all(8),
margin: EdgeInsets.only(bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Container(
child: AppText(
projectViewModel.isArabic
? examination.selectedExamination.nameAr != null &&
examination.selectedExamination.nameAr != ""
? examination.selectedExamination.nameAr
: examination.selectedExamination.nameEn
: examination.selectedExamination.nameEn,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.8,
),
)),
Row(
children: [
AppText(
TranslationBase.of(context).remove,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Colors.red.shade800,
fontSize: SizeConfig.textMultiplier * 1.8,
),
InkWell(
onTap: removeExamination,
child: Icon(
Icons.clear,
size: 20,
color: Colors.red.shade800,
),
)
],
),
],
),
AppText(
!examination.isNormal
? examination.isAbnormal
? TranslationBase.of(context).abnormal
: TranslationBase.of(context).notExamined
: TranslationBase.of(context).normal,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: !examination.isNormal
? examination.isAbnormal
? Colors.red.shade800
: Colors.grey.shade800
: Colors.green.shade800,
fontSize: SizeConfig.textMultiplier * 1.8,
),
SizedBox(
height: 4,
),
AppText(
examination.remark,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
color: Colors.grey.shade500,
fontSize: SizeConfig.textMultiplier * 1.8,
),
],
),
);
}
}

@ -0,0 +1,506 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.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/borderedButton.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
// Author Mosa Abuzaid
class AddExaminationPage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
AddExaminationPage(
{this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination});
@override
_AddExaminationPageState createState() => _AddExaminationPageState();
}
class _AddExaminationPageState extends State<AddExaminationPage> {
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
backgroundColor: Color.fromRGBO(248, 248, 248, 1),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding:
EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16),
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: AppText(
"${TranslationBase.of(context).addExamination}",
fontSize: SizeConfig.textMultiplier * 3.3,
color: Colors.black,
fontWeight: FontWeight.w700,
),
),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Icon(
Icons.clear,
size: 40,
),
)
],
),
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.all(16.0),
padding: EdgeInsets.all(0.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column(
children: [
ExaminationsListSearchWidget(
masterList: model.physicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
removeHistory: (history) {
setState(() {
widget.removeExamination(history);
});
},
addHistory: (selectedExamination) {
setState(() {
widget.mySelectedExamination
.add(selectedExamination);
});
},
),
],
),
),
],
),
),
),
Container(
padding: EdgeInsets.all(16),
color: Colors.white,
child: BorderedButton(
"${TranslationBase.of(context).addExamination}",
backgroundColor: HexColor("#359846"),
textColor: Colors.white,
vPadding: 12,
radius: 12,
fontWeight: FontWeight.w600,
fontSize: SizeConfig.textMultiplier * 2.5,
fontFamily: 'Poppins',
handler: () {
widget.addSelectedExamination();
},
),
)
],
),
),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return true;
}
return false;
}
}
class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MasterKeyModel) removeHistory;
final Function(MySelectedExamination) addHistory;
final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList;
ExaminationsListSearchWidget(
{this.removeHistory,
this.addHistory,
this.isServiceSelected,
this.masterList});
@override
_ExaminationsListSearchWidgetState createState() =>
_ExaminationsListSearchWidgetState();
}
class _ExaminationsListSearchWidgetState
extends State<ExaminationsListSearchWidget> {
int expandedIndex = -1;
List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController();
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
AppTextFieldCustom(
height: MediaQuery.of(context).size.height * 0.080,
hintText: TranslationBase.of(context).searchExamination,
isDropDown: true,
hasBorder: false,
controller: filteredSearchController,
onChanged: (value) {
filterSearchResults(value);
},
suffixIcon: Icon(
Icons.search,
color: Colors.black,
),
),
DividerWithSpacesAround(
height: 2,
),
...items.mapIndexed((index, item) {
return AddExaminationWidget(
item: item,
addHistory: widget.addHistory,
removeHistory: widget.removeHistory,
isServiceSelected: widget.isServiceSelected,
isExpand: index == expandedIndex,
expandClick: () {
setState(() {
if (expandedIndex == index) {
expandedIndex = -1;
} else {
expandedIndex = index;
}
});
},
);
}).toList(),
],
);
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((item) {
if (item.nameAr.toLowerCase().contains(query.toLowerCase()) ||
item.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}
class AddExaminationWidget extends StatefulWidget {
MasterKeyModel item;
final Function(MasterKeyModel) removeHistory;
final Function(MySelectedExamination) addHistory;
final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand;
final Function expandClick;
AddExaminationWidget({
this.item,
this.removeHistory,
this.addHistory,
this.isServiceSelected,
this.isExpand,
this.expandClick,
});
@override
_AddExaminationWidgetState createState() => _AddExaminationWidgetState();
}
class _AddExaminationWidgetState extends State<AddExaminationWidget> {
int status = 3;
TextEditingController remarksController = TextEditingController();
MySelectedExamination examination = MySelectedExamination();
@override
void initState() {
examination.selectedExamination = widget.item;
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: CheckboxListTile(
title: AppText(
projectViewModel.isArabic
? widget.item.nameAr != null && widget.item.nameAr != ""
? widget.item.nameAr
: widget.item.nameEn
: widget.item.nameEn,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
),
value: widget.isServiceSelected(widget.item),
activeColor: HexColor("#D02127"),
onChanged: (newValue) {
setState(() {
if (widget.isServiceSelected(widget.item)) {
widget.removeHistory(widget.item);
widget.expandClick();
} else {
examination.isNormal = status == 1;
examination.isAbnormal = status == 2;
examination.notExamined = status == 3;
examination.remark = remarksController.text;
widget.addHistory(examination);
widget.expandClick();
}
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 8),
child: InkWell(
onTap: widget.expandClick,
child: Icon(widget.isExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)),
),
],
),
bodyWidget: Container(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 8),
child: AppText(
TranslationBase.of(context).status,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
),
Row(
children: [
Expanded(
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
status = 1;
});
examination.isNormal = true;
examination.isAbnormal = false;
examination.notExamined = false;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 1
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
),
AppText(
TranslationBase.of(context).normal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
],
)),
Expanded(
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
status = 2;
});
examination.isNormal = false;
examination.isAbnormal = true;
examination.notExamined = false;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 2
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
),
AppText(
TranslationBase.of(context).abnormal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
],
)),
Expanded(
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
status = 3;
});
examination.isNormal = false;
examination.isAbnormal = false;
examination.notExamined = true;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 3
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
),
Expanded(
child: AppText(
TranslationBase.of(context).notExamined,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
),
],
)),
],
),
Container(
margin: EdgeInsets.only(top: 8),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
minLines: 2,
maxLines: 4,
inputType: TextInputType.multiline,
onChanged: (value){
examination.remark = value;
},
),
),
],
),
),
isExpand: widget.isExpand,
),
);
}
}
extension FicListExtension<T> on List<T> {
/// Maps each element of the list.
/// The [map] function gets both the original [item] and its [index].
Iterable<E> mapIndexed<E>(E Function(int index, T item) map) sync* {
for (var index = 0; index < length; index++) {
yield map(index, this[index]);
}
}
}

@ -0,0 +1,493 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'examination-item-card.dart';
import 'objective-add-examination-page.dart';
class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo;
UpdateObjectivePage(
{Key key,
this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo,
this.changeLoadingState});
@override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
}
class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
bool isSysExaminationExpand = false;
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,
notExamined: element.notExamined,
isNew: element.isNew,
isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam);
});
}
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
// baseViewModel: model,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
color: Color.fromRGBO(248, 248, 248, 1),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.95,
child: Container(
margin: EdgeInsets.all(8.0),
padding: EdgeInsets.all(12.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).physicalSystemExamination}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 2.0,
fontWeight: isSysExaminationExpand
? FontWeight.w700
: FontWeight.normal,
),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: Icon(isSysExaminationExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down))
],
),
bodyWidget: Column(
children: [
InkWell(
onTap: () {
openExaminationList(context);
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 8, horizontal: 8.0),
margin:
EdgeInsets.symmetric(vertical: 8),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(8),
),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).addExamination}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
AppText(
"${TranslationBase.of(context).searchHere}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
),
/* ...List.generate(
widget.mySelectedExamination.length,
(index) => Container(
child: ExaminationIitemCard(
widget.mySelectedExamination[
index], () {
removeExamination(widget
.mySelectedExamination[
index]
.selectedExamination);
}),
)),*/
Column(
children: widget.mySelectedExamination
.map((examination) {
return ExaminationIitemCard(
examination, () {
removeExamination(examination
.selectedExamination);
});
}).toList(),
)
],
),
isExpand: isSysExaminationExpand,
),
],
),
),
),
),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
color: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0
? HexColor("#D02127")
: HexColor("#A5A5A5"),
fontColor: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"),
disabled: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0
? false
: true,
fontWeight: FontWeight.bold,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
),
),
],
),
),
],
)));
}
submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
});
if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
} else {
// widget.changeLoadingState(true);
//
// widget.changePageViewIndex(2);
helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
}
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where((element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0)
setState(() {
widget.mySelectedExamination.remove(history.first);
});
}
openExaminationList(BuildContext context) {
Navigator.push(
context,
FadePage(
page: AddExaminationPage(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey)),
),
);
/*showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),
);
});*/
}
}
class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key);
@override
_AddExaminationDailogState createState() => _AddExaminationDailogState();
}
class _AddExaminationDailogState extends State<AddExaminationDailog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
/*MasterKeyCheckboxSearchWidget(
model: model,
hintSearchText:
TranslationBase.of(context).searchExamination,
buttonName:
TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList,
removeHistory: (history) {
setState(() {
widget.removeExamination(history);
});
},
addHistory: (history) {
setState(() {
MySelectedExamination mySelectedExamination =
new MySelectedExamination(
selectedExamination: history);
widget.mySelectedExamination
.add(mySelectedExamination);
});
},
addSelectedHistories: () {
widget.addSelectedExamination();
},
isServiceSelected: (master) =>
isServiceSelected(master),
),*/
]),
))),
)),
);
}
}

@ -9,8 +9,9 @@ import 'package:provider/provider.dart';
class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
final double height;
StepsWidget({Key key, this.index, this.changeCurrentTab});
StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0});
// TODO : Add translation to name
@override
@ -20,7 +21,7 @@ class StepsWidget extends StatelessWidget {
? Stack(
children: [
Container(
height: 150,
height: height == 0 ? 150 : height,
width: MediaQuery.of(context).size.width,
color: Colors.transparent,
child: Center(
@ -46,24 +47,24 @@ class StepsWidget extends StatelessWidget {
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height:5
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 5),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
@ -72,8 +73,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(selectedStepId: index, stepId: 0,),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
],
),
],
@ -82,10 +85,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
left: MediaQuery
.of(context)
.size
.width * 0.28,
left: MediaQuery.of(context).size.width * 0.28,
child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column(
@ -98,23 +98,25 @@ class StepsWidget extends StatelessWidget {
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height:5,
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -124,9 +126,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(selectedStepId: index, stepId: 1,),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
],
),
],
@ -135,14 +138,10 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
left: MediaQuery
.of(context)
.size
.width * 0.52,
left: MediaQuery.of(context).size.width * 0.52,
child: InkWell(
onTap: () {
if (index >= 3)
changeCurrentTab(2);
if (index >= 3) changeCurrentTab(2);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -154,23 +153,25 @@ class StepsWidget extends StatelessWidget {
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height:5,
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -180,7 +181,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(selectedStepId: index, stepId: 2,),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
],
@ -202,38 +206,43 @@ class StepsWidget extends StatelessWidget {
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height:5,
height: 5,
),
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
"Plan",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
),
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
"Plan",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 12,
),
StatusLabel(selectedStepId: index, stepId: 3,),
],
),
),
],
),
),
@ -243,11 +252,8 @@ class StepsWidget extends StatelessWidget {
: Stack(
children: [
Container(
height: 150,
width: MediaQuery
.of(context)
.size
.width,
height: height == 0 ? 150 : height,
width: MediaQuery.of(context).size.width,
color: Colors.transparent,
child: Center(
child: Divider(
@ -272,24 +278,24 @@ class StepsWidget extends StatelessWidget {
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height:5
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 5),
AppText(
"شخصي",
fontWeight: FontWeight.bold,
@ -301,10 +307,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
right: MediaQuery
.of(context)
.size
.width * 0.28,
right: MediaQuery.of(context).size.width * 0.28,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column(
@ -317,28 +320,28 @@ class StepsWidget extends StatelessWidget {
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height:5
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 5),
AppText(
"هدف",
fontWeight: FontWeight.bold,
fontSize:14,
fontSize: 14,
),
],
),
@ -346,10 +349,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
right: MediaQuery
.of(context)
.size
.width * 0.52,
right: MediaQuery.of(context).size.width * 0.52,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column(
@ -362,32 +362,33 @@ class StepsWidget extends StatelessWidget {
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height:5,
height: 5,
),
Padding(
padding: const EdgeInsets.only(right: 2),
child: AppText(
"تقدير",
fontWeight: FontWeight.bold,
fontSize:14,
),
"تقدير",
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
],
),
@ -408,44 +409,48 @@ class StepsWidget extends StatelessWidget {
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height:5,
height: 5,
),
Container(
margin: EdgeInsets.only(right:index == 3? 15:0),
child: AppText(
Container(
margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: AppText(
"خطة",
fontWeight: FontWeight.bold,
fontSize:14,
),
),
fontSize: 14,
),
),
],
),
),
),
],
);
);
}
}
class StatusLabel extends StatelessWidget {
const StatusLabel({
Key key, this.stepId, this.selectedStepId,
Key key,
this.stepId,
this.selectedStepId,
}) : super(key: key);
final int stepId;
@ -457,24 +462,30 @@ class StatusLabel extends StatelessWidget {
width: 65,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration(
color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId <
selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC),
color: stepId == selectedStepId
? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
border: Border.all(
color: HexColor('#707070'),
width: 0.30),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
child: AppText(
stepId == selectedStepId ? "inProgress" : stepId < selectedStepId
? "Completed"
: " Locked ",
stepId == selectedStepId
? "inProgress"
: stepId < selectedStepId
? "Completed"
: " Locked ",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 10,
color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId <
selectedStepId ? Color(0xFF359846) : Color(0xFF969696),
color: stepId == selectedStepId
? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
),
);
}

@ -1,730 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo;
UpdateObjectivePage(
{Key key,
this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo,
this.changeLoadingState});
@override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
}
class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
bool isSysExaminationExpand = false;
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,
notExamined: element.notExamined,
isNew: element.isNew,
isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam);
});
}
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
// baseViewModel: model,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
color: Color.fromRGBO(248, 248, 248, 1),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.95,
child: Container(
margin: EdgeInsets.all(8.0),
padding: EdgeInsets.all(12.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).physicalSystemExamination}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal,
),
/*Texts(
TranslationBase.of(context)
.physicalSystemExamination,
variant: isSysExaminationExpand
? "bodyText"
: '',
bold: isSysExaminationExpand
? true
: false,
color: Colors.black),*/
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: Icon(isSysExaminationExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
child: TextFields(
hintText: TranslationBase.of(context)
.physicalSystemExamination,
fontSize: 13.5,
onTapTextFields: () {
openExaminationList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon:
EvaIcons.plusCircleOutline,
suffixIconColor:
AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Column(
children: widget.mySelectedExamination
.map((examination) {
TextEditingController
remarksController =
TextEditingController(
text: examination.remark);
return Container(
margin: EdgeInsets.only(
left: 15, right: 15, top: 15),
child: Column(children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Texts(
(examination
.selectedExamination
.nameEn)
.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Row(
children: [
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.isNormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.grey),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
TranslationBase.of(
context)
.normal,
style:
TextStyle(
fontSize:
12,
color: examination.isNormal
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
true;
examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.isAbnormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.black),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
TranslationBase.of(
context)
.abnormal,
style:
TextStyle(
fontSize:
12,
color: examination.isAbnormal
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isNormal =
false;
examination
.isAbnormal =
true;
examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.notExamined
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.black),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
"Not Examined",
style:
TextStyle(
fontSize:
12,
color: examination.notExamined
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
false;
examination
.notExamined =
true;
});
}),
],
),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeExamination(
examination
.selectedExamination),
)
],
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarksController
.text !=
''
? true
: false,
showLabelText: true,
hintText:
TranslationBase.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 4,
controller:
remarksController,
onChanged: (val) {
examination.remark = val;
},
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
)
],
)
]),
isExpand: isSysExaminationExpand,
),
],
),
),
),
),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
color: HexColor("#A5A5A5"),
fontColor: HexColor("#5A5A5A"),
fontWeight: FontWeight.bold,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
),
),
],
),
),
],
)));
}
submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
});
if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
} else {
// widget.changeLoadingState(true);
//
// widget.changePageViewIndex(2);
helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
}
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where((element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0)
setState(() {
widget.mySelectedExamination.remove(history.first);
});
}
openExaminationList(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown) {
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(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),
);
});
}
}
class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key);
@override
_AddExaminationDailogState createState() => _AddExaminationDailogState();
}
class _AddExaminationDailogState extends State<AddExaminationDailog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
MasterKeyCheckboxSearchWidget(
model: model,
hintSearchText:
TranslationBase.of(context).searchExamination,
buttonName:
TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList,
removeHistory: (history) {
setState(() {
widget.removeExamination(history);
});
},
addHistory: (history) {
setState(() {
MySelectedExamination mySelectedExamination =
new MySelectedExamination(
selectedExamination: history);
widget.mySelectedExamination
.add(mySelectedExamination);
});
},
addSelectedHistories: () {
widget.addSelectedExamination();
},
isServiceSelected: (master) =>
isServiceSelected(master),
),
]),
))),
)),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return true;
}
return false;
}
}

@ -9,13 +9,13 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../patient-profile-header-new-design.dart';
import 'objective/update_objective_page.dart';
class UpdateSoapIndex extends StatefulWidget {
final bool isUpdate;
@ -35,7 +35,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
List<MySelectedExamination> mySelectedExamination = List();
List<MySelectedAssessment> mySelectedAssessment = List();
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel();
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) {
if (pageIndex != _currentIndex) changeLoadingState(true);
_controller.jumpToPage(pageIndex);
@ -67,96 +69,76 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
isLoading: _isLoading,
isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
boxShadow: <BoxShadow>[],
color: Theme.of(context).scaffoldBackgroundColor),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
// PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(patient, '7', '7'),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
// TODO mousa removed the singleChildScrollView
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
boxShadow: <BoxShadow>[],
color: Theme.of(context).scaffoldBackgroundColor),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
// PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
Container(
color: Theme.of(context).scaffoldBackgroundColor,
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
height: MediaQuery.of(context).size.height * 0.21,
),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.75,
child: Column(
children: [
Container(
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width *
0.05,
right: MediaQuery.of(context).size.width *
0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
changeLoadingState: changeLoadingState
),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
mySelectedExamination:
mySelectedExamination,
patientInfo: patient,
changeLoadingState: changeLoadingState
),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList:
mySelectedAssessment,
patientInfo: patient,
changeLoadingState: changeLoadingState
),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState
)
],
),
),
],
),
),
),
)
],
),
),
Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.50,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
mySelectedExamination: mySelectedExamination,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList: mySelectedAssessment,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState)
],
),
)
],
),
],
),
),
],
),
),
);

@ -9,6 +9,7 @@ class AppTextFieldCustom extends StatefulWidget {
final String hintText;
final TextEditingController controller;
final bool isDropDown;
final bool hasBorder;
final String dropDownText;
final Icon suffixIcon;
final Color dropDownColor;
@ -17,12 +18,14 @@ class AppTextFieldCustom extends StatefulWidget {
final int minLines;
final int maxLines;
final List<TextInputFormatter> inputFormatters;
final Function(String) onChanged;
AppTextFieldCustom({
this.height = 0,
this.onClick,
this.hintText,
this.controller,
this.hasBorder = true,
this.isDropDown = false,
this.dropDownText,
this.suffixIcon,
@ -32,6 +35,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.minLines = 1,
this.maxLines = 1,
this.inputFormatters,
this.onChanged,
});
@override
@ -43,8 +47,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Widget build(BuildContext context) {
return Container(
height: widget.height != 0 ? widget.height : null,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF)),
decoration: widget.hasBorder
? containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF))
: null,
padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0),
child: InkWell(
onTap: widget.onClick ?? null,
@ -80,7 +85,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
enabled: widget.enabled,
minLines: widget.minLines,
maxLines: widget.maxLines,
inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [],
inputFormatters: widget.inputFormatters != null
? widget.inputFormatters
: [],
onChanged: (value) {
if (widget.onChanged != null){
widget.onChanged(value);
setState(() {
});
}
},
)
: AppText(
widget.dropDownText,

@ -56,7 +56,9 @@ class DoctorCardInsurance extends StatelessWidget {
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),
),
color: approvalStatus == "Approved" ? Color(0xff359846) : Color(0xffD02127),
color: approvalStatus == "Approved"
? Color(0xff359846)
: Color(0xffD02127),
),
),
Expanded(
@ -99,9 +101,9 @@ class DoctorCardInsurance extends StatelessWidget {
children: [
Expanded(
child: Texts(
doctorName,
bold: true,
)),
doctorName,
bold: true,
)),
],
),
Row(

@ -104,14 +104,14 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
widget.isServiceSelected(historyInfo),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
// setState(() {
// if (widget
// .isServiceSelected(historyInfo)) {
// widget.removeHistory(historyInfo);
// } else {
// widget.addHistory(historyInfo);
// }
// });
setState(() {
if (widget
.isServiceSelected(historyInfo)) {
widget.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
}),
Expanded(
child: Padding(

Loading…
Cancel
Save