Merge branch 'development' into textfield-validation

merge-requests/479/head
mosazaid 5 years ago
commit 0666940d56

@ -58,6 +58,7 @@ class InsuranceApprovalModel {
String approvalStatusDescption; String approvalStatusDescption;
int unUsedCount; int unUsedCount;
String doctorImage; String doctorImage;
String projectName;
//String companyName; //String companyName;
String expiryDate; String expiryDate;
@ -91,7 +92,8 @@ class InsuranceApprovalModel {
this.rceiptOn, this.rceiptOn,
this.apporvalDetails, this.apporvalDetails,
this.appointmentNo, this.appointmentNo,
this.doctorImage}); this.doctorImage,
this.projectName});
//InsuranceApprovalDetails x = InsuranceApprovalDetails(); //InsuranceApprovalDetails x = InsuranceApprovalDetails();
@ -115,6 +117,7 @@ class InsuranceApprovalModel {
deviceTypeID = json['DeviceTypeID']; deviceTypeID = json['DeviceTypeID'];
patientID = json['PatientID']; patientID = json['PatientID'];
tokenID = json['TokenID']; tokenID = json['TokenID'];
projectName = json['ProjectName'];
patientTypeID = json['PatientTypeID']; patientTypeID = json['PatientTypeID'];
patientType = json['PatientType']; patientType = json['PatientType'];
eXuldAPPNO = json['EXuldAPPNO']; eXuldAPPNO = json['EXuldAPPNO'];
@ -148,6 +151,7 @@ class InsuranceApprovalModel {
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['TokenID'] = this.tokenID; data['TokenID'] = this.tokenID;
data['DoctorImageURL'] = this.doctorImage; data['DoctorImageURL'] = this.doctorImage;
data['ProjectName'] = this.projectName;
data['PatientTypeID'] = this.patientTypeID; data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;

@ -23,8 +23,8 @@ class InsuranceViewModel extends BaseViewModel{
else else
await _insuranceCardService.getInsuranceApproval(patient); await _insuranceCardService.getInsuranceApproval(patient);
if (_insuranceCardService.hasError) { if (_insuranceCardService.hasError) {
error = _insuranceCardService.error; error = "No Insurance Approval Found";
setState(ViewState.ErrorLocal); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -244,12 +244,15 @@ class PrescriptionViewModel extends BaseViewModel {
} }
} }
getPrescriptions(PatiantInformtion patient) async { getPrescriptions(PatiantInformtion patient, {String patientType}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptions(patient); await _prescriptionsService.getPrescriptions(patient);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); if(patientType=="7")
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else { } else {
_filterList(); _filterList();
await _getPrescriptionsOrders(); await _getPrescriptionsOrders();

@ -55,14 +55,17 @@ class ProcedureViewModel extends BaseViewModel {
? _patientLabOrdersListClinic ? _patientLabOrdersListClinic
: _patientLabOrdersListHospital; : _patientLabOrdersListHospital;
Future getProcedure({int mrn}) async { Future getProcedure({int mrn,String patientType}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn); await _procedureService.getProcedure(mrn: mrn);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.Error); if(patientType=="7")
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -136,12 +139,15 @@ class ProcedureViewModel extends BaseViewModel {
//await getProcedure(mrn: mrn); //await getProcedure(mrn: mrn);
} }
void getPatientRadOrders(PatiantInformtion patient) async { void getPatientRadOrders(PatiantInformtion patient,{String patientType}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient); await _radiologyService.getPatientRadOrders(patient);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); if(patientType=="7")
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else { } else {
_radiologyService.finalRadiologyList.forEach((element) { _radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic = List<FinalRadiologyList> finalRadiologyListClinic =
@ -220,12 +226,15 @@ class ProcedureViewModel extends BaseViewModel {
return labResultLists; return labResultLists;
} }
void getLabs(PatiantInformtion patient) async { void getLabs(PatiantInformtion patient,{bool isArrived}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersList(patient); await _labsService.getPatientLabOrdersList(patient);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
if(isArrived)
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else { } else {
_labsService.patientLabOrdersList.forEach((element) { _labsService.patientLabOrdersList.forEach((element) {
List<PatientLabOrdersList> patientLabOrdersClinic = List<PatientLabOrdersList> patientLabOrdersClinic =

@ -2355,6 +2355,34 @@
"search": [ "search": [
"verify-sms" "verify-sms"
] ]
},
{
"uid": "efc8c6ed2dab146bc55ca80fdd9bc511",
"css": "124",
"code": 59555,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M315.2 3.2L315.2 3.2A45.2 45.2 0 0 1 322.4 3.2S326 3.2 328.4 3.2H328.4A42.4 42.4 0 0 1 336 3.2H336A26.4 26.4 0 0 1 342 3.2H342A37.6 37.6 0 0 1 346.8 6.8 40 40 0 0 1 353.6 11.6L353.6 11.6 600.8 278.8A40 40 0 0 1 604.4 335.2 40 40 0 0 1 547.6 335.2L370 142.8V920H1250A40 40 0 0 1 1250 1000H330A40 40 0 0 1 290 960V129.2L66.4 329.2A40 40 0 0 1 10 325.6 40 40 0 0 1 0 299.2 40 40 0 0 1 13.2 269.2L304.8 10.4A36.4 36.4 0 0 1 310 7.2 40 40 0 0 1 315.2 3.2Z",
"width": 1290
},
"search": [
"124"
]
},
{
"uid": "2251120e332d8914aca7fb2d3fbe00f2",
"css": "123",
"code": 59556,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M773 755.3S773 755.3 773 755.3A38.8 38.8 0 0 0 773 749.5 21.7 21.7 0 0 0 773 745.1V745.1A55.8 55.8 0 0 0 773 739.2H773A25.7 25.7 0 0 0 773 734.6V734.6S770.9 732.1 769.9 730.5A31 31 0 0 0 766.2 725.3H766.2L558.1 529.6A31 31 0 0 0 514.1 531.5 31 31 0 0 0 516 575.2L665.1 713.2H62V31A31 31 0 0 0 0 31V744.2A31 31 0 0 0 31 775.2H675.3L520.3 948.5A31 31 0 1 0 566.8 989.5L766.2 764.7S766.2 762.2 768.4 760.9A33.5 33.5 0 0 0 773 755.3Z",
"width": 775
},
"search": [
"123"
]
} }
] ]
} }

@ -79,7 +79,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
PatientID: 0, PatientID: 0,
From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(), .toString(),
To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') To: DateUtils.convertDateToFormat(
DateTime.now().add(Duration(days: 6, hours: 0)), 'yyyy-MM-dd')
.toString(), .toString(),
LanguageID: 2, LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z", stamp: "2020-03-02T13:56:39.170Z",
@ -1020,12 +1021,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
hasBorder: false, hasBorder: false,
onTap: () { onTap: () {
// Navigator.push( Navigator.push(
// context, context,
// MaterialPageRoute( MaterialPageRoute(
// builder: (context) => builder: (context) =>
// SearchMedicinePatientScreen(), SearchMedicinePatientScreen(),
// )); ));
}, },
) )
], ],

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
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/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
@ -26,6 +27,11 @@ class MedicalFileDetails extends StatefulWidget {
int encounterNumber; int encounterNumber;
int pp; int pp;
PatiantInformtion patient; PatiantInformtion patient;
String clinicName;
String episode;
String doctorName;
String vistDate;
String doctorImage;
MedicalFileDetails( MedicalFileDetails(
{this.age, {this.age,
@ -34,7 +40,12 @@ class MedicalFileDetails extends StatefulWidget {
this.gender, this.gender,
this.encounterNumber, this.encounterNumber,
this.pp, this.pp,
this.patient}); this.patient,
this.doctorName,
this.vistDate,
this.clinicName,
this.episode,
this.doctorImage});
@override @override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState( _MedicalFileDetailsState createState() => _MedicalFileDetailsState(
@ -45,6 +56,11 @@ class MedicalFileDetails extends StatefulWidget {
encounterNumber: encounterNumber, encounterNumber: encounterNumber,
pp: pp, pp: pp,
patient: patient, patient: patient,
clinicName: clinicName,
doctorName: doctorName,
episode: episode,
vistDate: vistDate,
doctorImage: doctorImage,
); );
} }
@ -56,6 +72,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
String gender; String gender;
int pp; int pp;
PatiantInformtion patient; PatiantInformtion patient;
String clinicName;
String episode;
String doctorName;
String vistDate;
String doctorImage;
_MedicalFileDetailsState( _MedicalFileDetailsState(
{this.age, {this.age,
@ -64,7 +85,12 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
this.gender, this.gender,
this.encounterNumber, this.encounterNumber,
this.pp, this.pp,
this.patient}); this.patient,
this.doctorName,
this.vistDate,
this.clinicName,
this.episode,
this.doctorImage});
bool isPhysicalExam = true; bool isPhysicalExam = true;
bool isProcedureExpand = true; bool isProcedureExpand = true;
bool isHistoryExpand = true; bool isHistoryExpand = true;
@ -78,8 +104,21 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
builder: builder:
(BuildContext context, MedicalFileViewModel model, Widget child) => (BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold( AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient, patient.patientType.toString(), patient.arrivedOn), patient: patient,
patientType: patient.patientType.toString() ?? "0",
arrivalType: patient.arrivedOn.toString() ?? 0,
doctorName: doctorName,
profileUrl: doctorImage,
clinic: clinicName,
isPrescriptions: true,
isMedicalFile: true,
episode: episode,
vistDate:
'${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(
vistDate,
), isArabic: projectViewModel.isArabic)}',
),
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView( body: NetworkBaseView(
@ -105,160 +144,160 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
Container( // Container(
width: double.infinity, // width: double.infinity,
margin: EdgeInsets.only( // margin: EdgeInsets.only(
top: 10, left: 10, right: 10), // top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0), // padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Colors.white, // color: Colors.white,
borderRadius: BorderRadius.all( // borderRadius: BorderRadius.all(
Radius.circular(10.0), // Radius.circular(10.0),
), // ),
border: Border.all( // border: Border.all(
color: Colors.grey[200], width: 0.5), // color: Colors.grey[200], width: 0.5),
), // ),
child: Column( // child: Column(
children: [ // children: [
Row( // Row(
children: [ // children: [
if (model.medicalFileList.length != // if (model.medicalFileList.length !=
0 && // 0 &&
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[ // .timelines[
encounterNumber] // encounterNumber]
.timeLineEvents[0] // .timeLineEvents[0]
.consulations // .consulations
.length != // .length !=
0) // 0)
Expanded( // Expanded(
child: AppText( // child: AppText(
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[ // .timelines[
encounterNumber] // encounterNumber]
.timeLineEvents[0] // .timeLineEvents[0]
.consulations[0] // .consulations[0]
.doctorName // .doctorName
.toUpperCase(), // .toUpperCase(),
fontWeight: FontWeight.w700, // fontWeight: FontWeight.w700,
), // ),
), // ),
], // ],
), // ),
if (model.medicalFileList.length != 0) // if (model.medicalFileList.length != 0)
Row( // Row(
children: [ // children: [
AppText( // AppText(
TranslationBase.of(context) // TranslationBase.of(context)
.clinic + // .clinic +
": ", // ": ",
), // ),
if (model.medicalFileList // if (model.medicalFileList
.length != // .length !=
0 && // 0 &&
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[ // .timelines[
encounterNumber] // encounterNumber]
.timeLineEvents[0] // .timeLineEvents[0]
.consulations // .consulations
.length != // .length !=
0) // 0)
AppText( // AppText(
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[ // .timelines[
encounterNumber] // encounterNumber]
.timeLineEvents[0] // .timeLineEvents[0]
.consulations[0] // .consulations[0]
.clinicName, // .clinicName,
fontWeight: FontWeight.w700, // fontWeight: FontWeight.w700,
), // ),
], // ],
), // ),
Row( // Row(
children: [ // children: [
AppText( // AppText(
TranslationBase.of(context) // TranslationBase.of(context)
.episode + // .episode +
": ", // ": ",
//fontWeight: FontWeight.w700, // //fontWeight: FontWeight.w700,
), // ),
if (model.medicalFileList.length != // if (model.medicalFileList.length !=
0 && // 0 &&
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[ // .timelines[
encounterNumber] // encounterNumber]
.timeLineEvents[0] // .timeLineEvents[0]
.consulations // .consulations
.length != // .length !=
0) // 0)
AppText( // AppText(
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[encounterNumber] // .timelines[encounterNumber]
.timeLineEvents[0] // .timeLineEvents[0]
.consulations[0] // .consulations[0]
.episodeID // .episodeID
.toString(), // .toString(),
fontWeight: FontWeight.w700, // fontWeight: FontWeight.w700,
), // ),
], // ],
), // ),
Row( // Row(
children: [ // children: [
AppText( // AppText(
TranslationBase.of(context) // TranslationBase.of(context)
.visitDate + // .visitDate +
": ", // ": ",
//fontWeight: FontWeight.w700, // //fontWeight: FontWeight.w700,
), // ),
if (model.medicalFileList.length != // if (model.medicalFileList.length !=
0 && // 0 &&
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[ // .timelines[
encounterNumber] // encounterNumber]
.timeLineEvents[0] // .timeLineEvents[0]
.consulations // .consulations
.length != // .length !=
0) // 0)
AppText( // AppText(
'${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat( // '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(
model // model
.medicalFileList[0] // .medicalFileList[0]
.entityList[0] // .entityList[0]
.timelines[ // .timelines[
encounterNumber] // encounterNumber]
.date, // .date,
), isArabic: projectViewModel.isArabic)}', // ), isArabic: projectViewModel.isArabic)}',
color: Colors.black, // color: Colors.black,
fontWeight: FontWeight.w700, // fontWeight: FontWeight.w700,
fontSize: 14, // fontSize: 14,
), // ),
SizedBox(width: 35.0), // SizedBox(width: 35.0),
// AppText( // // AppText(
// 'Appt Date : ', // // 'Appt Date : ',
// fontWeight: FontWeight.w700, // // fontWeight: FontWeight.w700,
// ), // // ),
// AppText( // // AppText(
// '23/12/2020', // // '23/12/2020',
// ), // // ),
], // ],
), // ),
], // ],
), // ),
), // ),
SizedBox(height: 25.0), SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 &&

@ -110,6 +110,36 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
encounterNumber: index, encounterNumber: index,
pp: patient.patientId, pp: patient.patientId,
patient: patient, patient: patient,
doctorName: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
clinicName: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.clinicName,
doctorImage: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorImage,
episode: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations[0]
.episodeID
.toString(),
vistDate: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.date
.toString()
.toString(),
)), )),
); );
}, },

@ -54,628 +54,89 @@ class _InsuranceApprovalScreenNewState
appBarTitle: TranslationBase.of(context).approvals, appBarTitle: TranslationBase.of(context).approvals,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004, left: SizeConfig.screenWidth * 0.004,
right: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04, top: SizeConfig.screenWidth * 0.04,
), ),
child: model.insuranceApproval.length != 0 child: model.insuranceApproval.length != 0
? Column( ? Column(
children: <Widget>[ children: <Widget>[
// Container( Padding(
// width: double.infinity, padding: const EdgeInsets.all(8.0),
// height: SizeConfig.screenHeight * 0.09, child: Column(
// color: Color(0xffEEEEEE), children: [
// child: Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
// children: <Widget>[ AppText(
// Texts( 'Insurance',
// TranslationBase.of(context).totalApproval, fontSize: 15.0,
// color: Color(0xff60688B), fontWeight: FontWeight.w600,
// fontSize: 19.0, fontFamily: 'Poppins',
// fontWeight: FontWeight.w600, ),
// ), ],
// if (model.insuranceApproval.length > 0) ),
// Container( Row(
// width: 60, children: [
// height: 40, AppText(
// decoration: BoxDecoration( 'Approvals',
// color: Theme.of(context).primaryColor, fontSize: 30.0,
// borderRadius: BorderRadius.circular(19.0)), fontWeight: FontWeight.w700,
// child: Center( ),
// child: Texts( ],
// model.insuranceApproval[0].unUsedCount ),
// .toString(), ],
// color: Colors.white,
// fontSize: 17.0,
// ),
// ))
// ],
// )),
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
'Insurance',
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
'Approvals',
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
), ),
),
...List.generate( ...List.generate(
model.insuranceApproval.length, model.insuranceApproval.length,
(index) => Container( (index) => Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
InsuranceApprovalsDetails( InsuranceApprovalsDetails(
patient: patient, patient: patient,
indexInsurance: index, indexInsurance: index,
)), )),
); );
}, },
child: DoctorCardInsurance( child: DoctorCardInsurance(
patientOut: model.insuranceApproval[index] patientOut: model
.patientDescription, .insuranceApproval[index].patientDescription,
profileUrl: profileUrl:
model.insuranceApproval[index].doctorImage, model.insuranceApproval[index].doctorImage,
clinic: clinic: model.insuranceApproval[index].clinicName,
model.insuranceApproval[index].clinicName, doctorName:
doctorName: model.insuranceApproval[index].doctorName,
model.insuranceApproval[index].doctorName, branch: model.insuranceApproval[index].approvalNo
branch: model .toString(),
.insuranceApproval[index].approvalNo isPrescriptions: true,
.toString(), approvalStatus: model.insuranceApproval[index]
isPrescriptions: true, .approvalStatusDescption ??
approvalStatus: model.insuranceApproval[index] '',
.approvalStatusDescption ?? branch2:
'', model.insuranceApproval[index].projectName,
),
), ),
), ),
// (index) => Container(
// width: double.maxFinite,
// height: MediaQuery.of(context).size.height * .20,
// margin: EdgeInsets.all(10),
// padding:
// EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(15),
// color: Colors.white,
// ),
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Container(
// height: MediaQuery.of(context).size.height * .20,
// width: 5,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(10),
// bottomLeft: Radius.circular(10),
// ),
// color: model.insuranceApproval[index]
// .approvalStatusDescption !=
// "Approved"
// ? Colors.red[500]
// : Colors.green,
// ),
// ),
// Expanded(
// child: Container(
// padding: EdgeInsets.only(
// left: projectViewModel.isArabic ? 0 : 15,
// right: projectViewModel.isArabic ? 15 : 0),
// child: InkWell(
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Row(
// // mainAxisAlignment:
// // MainAxisAlignment.spaceBetween,
// children: [
// Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Texts(
// model.insuranceApproval[index]
// .approvalDetails.status,
// color: model
// .insuranceApproval[
// index]
// .approvalStatusDescption ==
// "Approved"
// ? Colors.green
// : Colors.red[800],
// fontWeight: FontWeight.w600,
// ),
// SizedBox(
// height: 5,
// ),
// AppText(model
// .insuranceApproval[index]
// .doctorName),
// Container(
// child: LargeAvatar(
// url: model
// .insuranceApproval[index]
// .doctorImage,
// ),
// width: 55,
// height: 55,
// ),
// ],
// ),
// Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Row(
// children: <Widget>[
// Texts(
// 'Clinic: ',
// color: Colors.grey[500],
// ),
// Texts(
// model
// .insuranceApproval[
// index]
// .clinicName,
// ),
// ],
// ),
// Row(
// children: <Widget>[
// Texts(
// 'Approval No',
// color: Colors.grey[500],
// ),
// Texts(
// model
// .insuranceApproval[
// index]
// .approvalNo
// .toString(),
// ),
// ],
// ),
// ],
// ),
// SizedBox(
// width: 5,
// ),
// ],
// ),
// Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Row(
// children: <Widget>[
// Texts(
// 'Clinic: ',
// color: Colors.grey[500],
// ),
// Texts(
// model
// .insuranceApproval[
// index]
// .clinicName,
// ),
// ],
// ),
// Row(
// children: <Widget>[
// Texts(
// 'Approval No',
// color: Colors.grey[500],
// ),
// Texts(
// model
// .insuranceApproval[
// index]
// .approvalNo
// .toString(),
// ),
// ],
// ),
// ],
// ),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.end,
// children: [
// Icon(Icons.remove_red_eye_outlined)
// ],
// )
// ],
// ),
// ),
// ),
// ),
// ],
// ),
// ),
// ),
// ),
// RoundedContainer(
// backgroundColor: Colors.white,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// ExpansionTile(
// title: Container(
// //height: 120.0,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// model.insuranceApproval[index]
// .patientDescription ==
// "In Patient"
// ? Container(
// decoration: BoxDecoration(
// color:
// Theme.of(context).primaryColor,
// borderRadius:
// BorderRadius.circular(16.0)),
// width: 115.0,
// padding: EdgeInsets.only(left: 11.5),
// child: Center(
// child: Texts(
// TranslationBase.of(context)
// .inPatient,
// color: Colors.white,
// ),
// ),
// )
// : Container(
// decoration: BoxDecoration(
// color: Color(0xff505A5D),
// borderRadius:
// BorderRadius.circular(16.0)),
// width: 115.0,
// padding: EdgeInsets.only(left: 11.5),
// child: Center(
// child: Texts(
// TranslationBase.of(context)
// .outpatient,
// color: Colors.white,
// ),
// ),
// ),
// Padding(
// padding: EdgeInsets.symmetric(vertical: 10.0),
// child: Texts(
// model.insuranceApproval[index].clinicName,
// fontSize: 20.0,
// color: Color(0xff60686B),
// fontWeight: FontWeight.w600,
// ),
// ),
// Texts(
// model.insuranceApproval[index].doctorName,
// fontSize: 17.0,
// ),
// ],
// ),
// ),
// children: <Widget>[
// Padding(
// padding: EdgeInsets.symmetric(
// vertical: 12.0, horizontal: 12.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Row(
// children: [
// Texts(
// TranslationBase.of(context).approvalNo,
// fontSize: 18.0,
// ),
// Texts(
// model
// .insuranceApproval[index].approvalNo
// .toString(),
// fontSize: 18.0,
// fontWeight: FontWeight.w600,
// ),
// ],
// ),
// Divider(
// color: Colors.black,
// height: 25.0,
// thickness: 1.0,
// ),
// Row(
// children: [
// Texts(
// TranslationBase.of(context)
// .procedureStatus,
// fontSize: 17.5,
// ),
// SizedBox(
// width: 12,
// ),
// Expanded(
// child: Texts(
// model.insuranceApproval[index]
// .approvalStatusDescption,
// fontWeight: FontWeight.w600,
// fontSize: 17.5,
// ),
// ),
// ],
// ),
// Divider(
// color: Colors.black,
// height: 25.0,
// thickness: 1.0,
// ),
// Row(
// children: [
// Texts(
// TranslationBase.of(context).unusedCount,
// fontSize: 17.5,
// ),
// Texts(
// model.insuranceApproval[index]
// .unUsedCount
// .toString(),
// fontSize: 17.5,
// fontWeight: FontWeight.w600,
// ),
// ],
// ),
// Divider(
// color: Colors.black,
// height: 25.0,
// thickness: 1.0,
// ),
// // Text(
// // 'Company Name: ' +
// // model.insuranceApproval[index]
// // .companyName ==
// // null
// // ? '000'
// // : model
// // .insuranceApproval[index].companyName,
// // style: TextStyle(
// // fontSize: 17.5,
// // fontWeight: FontWeight.w600),
// // ),
// Texts(
// TranslationBase.of(context).companyName,
// fontWeight: FontWeight.w600,
// fontSize: 17.5,
// ),
//
// Divider(
// color: Colors.black,
// height: 25.0,
// thickness: 1.0,
// ),
// Row(
// children: [
// Texts(
// TranslationBase.of(context).receiptOn,
// fontSize: 17.5,
// fontWeight: FontWeight.w600,
// ),
// Texts(
// DateUtils.getDateTimeFromServerFormat(
// model.insuranceApproval[index]
// .rceiptOn)
// .toString(),
// fontSize: 17.5,
// fontWeight: FontWeight.w600,
// ),
// ],
// ),
// Divider(
// color: Colors.black,
// height: 25.0,
// thickness: 1.0,
// ),
// Row(
// children: [
// Texts(
// TranslationBase.of(context).expiryDate,
// fontSize: 17.5,
// fontWeight: FontWeight.w600,
// ),
// Texts(
// DateUtils.getDateTimeFromServerFormat(
// model.insuranceApproval[index]
// .expiryDate)
// .toString(),
// fontSize: 17.5,
// fontWeight: FontWeight.w600,
// ),
// ],
// ),
// Divider(
// color: Colors.black,
// height: 55.0,
// thickness: 1.2,
// ),
// IntrinsicHeight(
// child: Row(
// crossAxisAlignment:
// CrossAxisAlignment.center,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: Column(
// children: <Widget>[
// Text(TranslationBase.of(context)
// .procedureName),
// Padding(
// padding: EdgeInsets.only(
// top: SizeConfig
// .heightMultiplier *
// 3.0),
// child: Text(
// model.insuranceApproval[index]
// .approvalDetails ==
// null
// ? ''
// : model
// .insuranceApproval[
// index]
// .approvalDetails
// .procedureName,
// style: TextStyle(
// fontWeight:
// FontWeight.w600,
// fontSize: 15.5),
// ),
// ),
// ],
// ),
// ),
// VerticalDivider(
// width: 10.0,
// thickness: 1.2,
// color: Colors.black,
// ),
// Expanded(
// flex: 1,
// child: Column(
// children: <Widget>[
// Text(TranslationBase.of(context)
// .procedureStatus),
// Padding(
// padding: EdgeInsets.only(
// top: SizeConfig
// .heightMultiplier *
// 3.0),
// child: Text(
// model.insuranceApproval[index]
// .approvalDetails ==
// null
// ? ''
// : model
// .insuranceApproval[
// index]
// .approvalDetails
// .status,
// style: TextStyle(
// fontSize: 17.5,
// fontWeight:
// FontWeight.w600),
// ),
// ),
// ],
// ),
// ),
// VerticalDivider(
// width: 2.3,
// thickness: 1.2,
// color: Colors.black,
// ),
// Expanded(
// flex: 1,
// child: Column(
// children: <Widget>[
// Text(TranslationBase.of(context)
// .usageStatus),
// Padding(
// padding: EdgeInsets.only(
// top: SizeConfig
// .heightMultiplier *
// 3.0),
// child: Text(
// model.insuranceApproval[index]
// .approvalDetails ==
// null
// ? ''
// : model
// .insuranceApproval[
// index]
// .approvalDetails
// .isInvoicedDesc,
// style: TextStyle(
// fontWeight:
// FontWeight.w600,
// fontSize: 17.5),
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// Divider(
// color: Colors.black,
// height: 25.0,
// thickness: 1.0,
// ),
// ],
// ),
// ),
// ],
// ),
// ],
// ),
// ),
), ),
], ),
) ],
: Column( )
children: [ : Column(
Container( children: [
height: 200, Container(
width: double.infinity, height: 200,
child: Center( width: double.infinity,
child: Text("No Insurance Approvals Found"))) child: Center(
], child: Text("No Insurance Approvals Found")))
)), ],
),
),
), ),
), ),
); );
} }
convertDateFormat(String Date) {
const start = "/Date(";
const end = "+0300)";
final startIndex = Date.indexOf(start);
final endIndex = Date.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(Date.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"-" +
date.month.toString().padLeft(2, '0') +
"-" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
} }

@ -176,11 +176,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
patiantAppointment = patiantAppointment =
convertDateFormat(responseModelList[i].appointmentDate); convertDateFormat(responseModelList[i].appointmentDate);
} }
if (patiantAppointment != null) {
String dateAppointment = checkDate(patiantAppointment);
String dateAppointment = checkDate(patiantAppointment); if (dateAppointment.contains(str) || str == 'All') {
filterDate.add(responseModelList[i]);
if (dateAppointment.contains(str) || str == 'All') { }
filterDate.add(responseModelList[i]);
} }
} catch (e) { } catch (e) {
print(e); print(e);

@ -32,9 +32,10 @@ class LabsHomePage extends StatelessWidget {
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
print(arrivalType); print(arrivalType);
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getLabs(patient), onModelReady: (model) => model.getLabs(patient,isArrived: (patientType != null && patientType == '7' && patient.patientStatusType == 43)),
builder: (context, ProcedureViewModel model, widget) => AppScaffold( builder: (context, ProcedureViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.grey[100],
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', patientType), patient, patient.patientType.toString() ?? '0', patientType),
@ -48,6 +49,7 @@ class LabsHomePage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -67,9 +69,27 @@ class LabsHomePage extends StatelessWidget {
], ],
), ),
), ),
if (patientType != null && if(patient.patientStatusType == 43)
patientType == '7' && Padding(
patient.patientStatusType == 43) padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Lab',
style: "caption2",
color: Colors.black,
fontSize: 13,
),
Texts(
'Result',
bold: true,
fontSize: 22,
),
],
),
),
if (patientType != null && patientType == '7' && patient.patientStatusType == 43)
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -156,7 +176,22 @@ class LabsHomePage extends StatelessWidget {
); );
}).toList(), }).toList(),
), ),
) ),
if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('No Lab Result Found'),
)
],
),
)
], ],
), ),
), ),

@ -29,9 +29,10 @@ class RadiologyHomePage extends StatelessWidget {
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient), onModelReady: (model) => model.getPatientRadOrders(patient,patientType: patientType),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100],
// appBarTitle: TranslationBase.of(context).radiology, // appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', arrivalType), patient, patient.patientType.toString() ?? '0', arrivalType),
@ -44,7 +45,8 @@ class RadiologyHomePage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( if(model.radiologyList.isNotEmpty && patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -63,6 +65,26 @@ class RadiologyHomePage extends StatelessWidget {
], ],
), ),
), ),
if(patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Radiology',
style: "caption2",
color: Colors.black,
fontSize: 13,
),
Texts(
'Result',
bold: true,
fontSize: 22,
),
],
),
),
if (patientType != null && if (patientType != null &&
patientType == '7' && patientType == '7' &&
patient.patientStatusType == 43) patient.patientStatusType == 43)
@ -142,6 +164,21 @@ class RadiologyHomePage extends StatelessWidget {
appointmentDate: model.radiologyList[index].orderDate, appointmentDate: model.radiologyList[index].orderDate,
), ),
)), )),
if(model.radiologyList.isEmpty && patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('No Radiology Found'),
)
],
),
)
], ],
), ),
), ),

@ -49,7 +49,7 @@ postProcedure(
DateTime doseTime, DateTime doseTime,
String doseUnit, String doseUnit,
String icdCode, String icdCode,
PatiantInformtion patient}) async { PatiantInformtion patient,String patientType}) async {
PostPrescriptionReqModel postProcedureReqModel = PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel(); new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List(); List<PrescriptionRequestModel> sss = List();
@ -236,8 +236,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: [ children: [
Column( Column(
children: [ children: [
SizedBox(height: 15,),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText(
'New Prescription Order',
fontWeight: FontWeight.w700,
fontSize: 20,
),
InkWell( InkWell(
child: Icon( child: Icon(
Icons.close, Icons.close,
@ -246,16 +253,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}, },
), )
],
),
Row(
children: [
AppText(
'New Prescription Order',
fontWeight: FontWeight.w700,
fontSize: 20,
),
], ],
), ),
], ],

@ -28,10 +28,11 @@ class PrescriptionsPage extends StatelessWidget {
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescriptions(patient), onModelReady: (model) => model.getPrescriptions(patient,patientType:patientType),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType ?? '0', arrivalType), patient, patientType ?? '0', arrivalType),
body: FractionallySizedBox( body: FractionallySizedBox(
@ -42,7 +43,8 @@ class PrescriptionsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( if(model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -61,6 +63,26 @@ class PrescriptionsPage extends StatelessWidget {
], ],
), ),
), ),
if(patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Order',
style: "caption2",
color: Colors.black,
fontSize: 13,
),
Texts(
'Prescriptions',
bold: true,
fontSize: 22,
),
],
),
),
if (patientType != null && if (patientType != null &&
patientType == '7' && patientType == '7' &&
patient.patientStatusType == 43) patient.patientStatusType == 43)
@ -138,7 +160,22 @@ class PrescriptionsPage extends StatelessWidget {
DateUtils.getDateTimeFromServerFormat( DateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index].appointmentDate, model.prescriptionsList[index].appointmentDate,
), ),
))) ))),
if(model.prescriptionsList.isEmpty && patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('No Lab Result Found'),
)
],
),
)
], ],
), ),
), ),

@ -148,27 +148,27 @@ class ProcedureCard extends StatelessWidget {
color: Colors.grey, color: Colors.grey,
), ),
Texts( Texts(
entityList.clinicDescription??"", entityList.clinicDescription ?? "",
bold: true, bold: true,
fontSize: 12, fontSize: 12,
), ),
], ],
), ),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
Texts( // Texts(
entityList.remarks.toString() ?? '', // entityList.remarks.toString() ?? '',
fontSize: 12, // fontSize: 12,
), // ),
if (entityList.categoryID == 2 || // if (entityList.categoryID == 2 ||
entityList.categoryID == 4) // entityList.categoryID == 4)
InkWell( // InkWell(
child: Icon(DoctorApp.edit), // child: Icon(DoctorApp.edit),
onTap: onTap, // onTap: onTap,
) // )
], // ],
) // )
], ],
), ),
//onTap: onTap, //onTap: onTap,

@ -155,7 +155,7 @@ class _AddSelectedLabOrderState extends State<AddSelectedLabOrder> {
(BuildContext context, ScrollController scrollController) { (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 1.0, height: MediaQuery.of(context).size.height * .90,
child: Padding( child: Padding(
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
child: Column( child: Column(
@ -209,85 +209,39 @@ class _AddSelectedLabOrderState extends State<AddSelectedLabOrder> {
isEntityListSelected: (master) => isEntityListSelected: (master) =>
isEntityListSelected(master), isEntityListSelected(master),
)), )),
SizedBox( Container(
height: 15.0, margin: EdgeInsets.all(
), SizeConfig.widthMultiplier * 5),
Column( child: Wrap(
mainAxisAlignment: MainAxisAlignment.spaceBetween, alignment: WrapAlignment.center,
children: [ children: <Widget>[
// Container( AppButton(
// child: Row( title:
// children: [ "Add Lab Order", //TranslationBase.of(context)
// AppText( fontWeight: FontWeight.w700,
// TranslationBase.of(context).orderType), //.addSelectedProcedures,
// Radio( color: Color(0xff359846),
// activeColor: Color(0xFFB9382C), onPressed: () {
// value: 1, //print(entityList.toString());
// groupValue: selectedType, onPressed:
// onChanged: (value) { if (entityList.isEmpty == true) {
// setSelectedType(value); DrAppToastMsg.showErrorToast(
// }, "Fill the mandatory procedure details");
// ), return;
// Text('routine'), }
// Radio(
// activeColor: Color(0xFFB9382C),
// groupValue: selectedType,
// value: 0,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text(TranslationBase.of(context).urgent),
// ],
// ),
// ),
// SizedBox(
// height: 15.0,
// ),
// TextFields(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 3,
// maxLines: 5,
// ),
SizedBox(
height: 100.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title:
"Add Lab Order", //TranslationBase.of(context)
fontWeight: FontWeight.w700,
//.addSelectedProcedures,
color: Color(0xff359846),
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context); Navigator.pop(context);
postProcedure( postProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
model: widget.model, model: widget.model,
remarks: remarksController.text); remarks: remarksController.text);
}, },
),
],
), ),
), ],
], ),
) ),
], ],
), ),
), ),

@ -162,15 +162,14 @@ class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
'New Radiology Order', 'New Radiology Order',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20, fontSize: 20,
), ),
SizedBox(
width: MediaQuery.of(context).size.width * 0.48,
),
InkWell( InkWell(
child: Icon( child: Icon(
Icons.close, Icons.close,
@ -209,82 +208,36 @@ class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
isEntityListSelected: (master) => isEntityListSelected: (master) =>
isEntityListSelected(master), isEntityListSelected(master),
)), )),
SizedBox( Container(
height: 15.0, margin: EdgeInsets.all(
), SizeConfig.widthMultiplier * 5),
Column( child: Wrap(
mainAxisAlignment: MainAxisAlignment.spaceBetween, alignment: WrapAlignment.center,
children: [ children: <Widget>[
// Container( AppButton(
// child: Row( title: 'Add Radiology Order',
// children: [ color: Color(0xff359846),
// AppText( fontWeight: FontWeight.w700,
// TranslationBase.of(context).orderType), onPressed: () {
// Radio( //print(entityList.toString());
// activeColor: Color(0xFFB9382C), onPressed:
// value: 1, if (entityList.isEmpty == true) {
// groupValue: selectedType, DrAppToastMsg.showErrorToast(
// onChanged: (value) { "Fill the mandatory procedure details");
// setSelectedType(value); return;
// }, }
// ),
// Text('routine'),
// Radio(
// activeColor: Color(0xFFB9382C),
// groupValue: selectedType,
// value: 0,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text(TranslationBase.of(context).urgent),
// ],
// ),
// ),
// SizedBox(
// height: 15.0,
// ),
// TextFields(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 3,
// maxLines: 5,
// ),
SizedBox(
height: 100.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'Add Radiology Order',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context); Navigator.pop(context);
postProcedure( postProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
model: widget.model, model: widget.model,
remarks: remarksController.text); remarks: remarksController.text);
}, },
),
],
), ),
), ],
], ),
) )
], ],
), ),

@ -69,7 +69,7 @@ class _EntityListCheckboxSearchWidgetState
NetworkBaseView( NetworkBaseView(
baseViewModel: widget.model, baseViewModel: widget.model,
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.55, height: MediaQuery.of(context).size.height * 0.65,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),

@ -25,10 +25,11 @@ class ProcedureScreen extends StatelessWidget {
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(mrn: patient.patientId), onModelReady: (model) => model.getProcedure(mrn: patient.patientId,patientType: patientType),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model, baseViewModel: model,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType), patient, arrivalType ?? '0', patientType),
@ -40,7 +41,8 @@ class ProcedureScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( if(model.procedureList.length==0 && patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -59,6 +61,26 @@ class ProcedureScreen extends StatelessWidget {
], ],
), ),
), ),
if( patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Order Test or',
style: "caption2",
color: Colors.black,
fontSize: 13,
),
Texts(
'Procedure',
bold: true,
fontSize: 22,
),
],
),
),
if (patientType != null && patientType == '7' && patient.patientStatusType == 43) if (patientType != null && patientType == '7' && patient.patientStatusType == 43)
InkWell( InkWell(
onTap: () { onTap: () {
@ -141,6 +163,21 @@ class ProcedureScreen extends StatelessWidget {
}, },
), ),
), ),
if (model.procedureList.length!=0 && patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('No Procedure Found'),
)
],
),
)
], ],
), ),
), ),

@ -10,7 +10,10 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
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_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
@ -29,12 +32,17 @@ class AddSickLeavScreen extends StatelessWidget {
onModelReady: (model) => model.getSickLeave(patient.patientMRN), onModelReady: (model) => model.getSickLeave(patient.patientMRN),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).sickleave, backgroundColor: Colors.grey[100],
appBar: PatientProfileHeaderNewDesignAppBar(
patient,
routeArgs['patientType'] ?? "0",
routeArgs['arrivalType'] ?? "0",
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(children: [ child: Column(children: [
PatientProfileHeaderNewDesign( // PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']), // patient, routeArgs['patientType'], routeArgs['arrivalType']),
patient.patientStatusType == 43 patient.patientStatusType == 43
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -191,33 +199,33 @@ class AddSickLeavScreen extends StatelessWidget {
AppText( AppText(
item.remarks ?? "", item.remarks ?? "",
), ),
(item.status == 1 || // (item.status == 1 ||
item.status == 2) // item.status == 2)
? IconButton( // ? IconButton(
icon: Image.asset( // icon: Image.asset(
'assets/images/edit.png'), // 'assets/images/edit.png'),
//
// color: Colors.green, //Colors.black, // // color: Colors.green, //Colors.black,
onPressed: () => { // onPressed: () => {
if (item.status == // if (item.status ==
1) // 1)
{ // {
DrAppToastMsg.showErrorToast( // DrAppToastMsg.showErrorToast(
TranslationBase.of( // TranslationBase.of(
context) // context)
.sickleaveonhold) // .sickleaveonhold)
} // }
else // else
{ // {
openSickLeave( // openSickLeave(
context, // context,
true, // true,
extendedData: // extendedData:
item) // item)
} // }
}, // },
) // )
: SizedBox() // : SizedBox()
]), ]),
], ],
), ),
@ -234,90 +242,22 @@ class AddSickLeavScreen extends StatelessWidget {
}).toList(), }).toList(),
) )
: patient.patientStatusType != 43 : patient.patientStatusType != 43
? Container( ? Center(
height: 200, child: Column(
width: SizeConfig.screenWidth, crossAxisAlignment: CrossAxisAlignment.center,
color: Colors.white, children: [
child: Column( SizedBox(height: 100,),
mainAxisAlignment: MainAxisAlignment.center, Image.asset('assets/images/no-data.png'),
children: [ Padding(
AppText( padding: const EdgeInsets.all(8.0),
TranslationBase.of(context).noSickLeave, child: Texts('No Sick Leave Found'),
color: Colors.red, )
)
]), ],
) ),
)
: SizedBox() : SizedBox()
// : new Builder(builder: (context) {
// return 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: 20, bottom: 20),
// padding: EdgeInsets.all(20),
// decoration: BoxDecoration(
// 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),
// ),
// ],
// )),
// SizedBox(
// height: SizeConfig.screenHeight * .6,
// )
// ],
// );
// }),
])))); ]))));
} }

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
@ -30,13 +31,17 @@ class ShowSickLeaveScreen extends StatelessWidget {
model.getSickLeave(patient.patientMRN ?? patient.patientId), model.getSickLeave(patient.patientMRN ?? patient.patientId),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).sickleave, appBar: PatientProfileHeaderNewDesignAppBar(
patient,
routeArgs['patientType'] ?? "0",
routeArgs['arrivalType'] ?? "0",
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
PatientProfileHeaderNewDesign( // PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']), // patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column( Column(
children: model.getAllSIckLeave children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) { .map<Widget>((GetAllSickLeaveResponse item) {

@ -150,6 +150,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
// }, // },
textInputType:TextInputType.number,
inputFormatter: ONLY_NUMBERS) inputFormatter: ONLY_NUMBERS)
]), ]),
), ),

@ -102,14 +102,18 @@ class PatientCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row(children: [ Row(children: [
AppText( Container(
(Helpers.capitalize(patientInfo.firstName) + width: 170,
" " + child: AppText(
Helpers.capitalize(patientInfo.lastName)), (Helpers.capitalize(patientInfo.firstName) +
fontSize: SizeConfig.textMultiplier * 2, " " +
fontWeight: FontWeight.bold, Helpers.capitalize(patientInfo.lastName)),
backGroundcolor: Colors.white, fontSize: 16,
fontFamily: 'Poppins', fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
),
), ),
patientInfo.gender == 1 patientInfo.gender == 1
? Icon( ? Icon(
@ -143,7 +147,10 @@ class PatientCard extends StatelessWidget {
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context,
Object exception, Object exception,
StackTrace stackTrace) { StackTrace stackTrace) {
return Text('No Image'); return AppText(
'No Image',
fontSize: 10,
);
}, },
)) ))
: SizedBox() : SizedBox()

@ -15,8 +15,8 @@ import 'package:provider/provider.dart';
import 'large_avatar.dart'; import 'large_avatar.dart';
class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with PreferredSizeWidget { class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
with PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
@ -27,6 +27,9 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
final String invoiceNO; final String invoiceNO;
final String orderNo; final String orderNo;
final bool isPrescriptions; final bool isPrescriptions;
final bool isMedicalFile;
final String episode;
final String vistDate;
final String clinic; final String clinic;
PatientProfileHeaderWhitAppointmentAppBar( PatientProfileHeaderWhitAppointmentAppBar(
@ -38,7 +41,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
this.appointmentDate, this.appointmentDate,
this.profileUrl, this.profileUrl,
this.invoiceNO, this.invoiceNO,
this.orderNo, this.isPrescriptions = false, this.clinic}); this.orderNo,
this.isPrescriptions = false,
this.clinic,
this.isMedicalFile = false,
this.episode,
this.vistDate});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -51,8 +59,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
} }
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
@ -73,12 +80,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
), ),
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null ? patient.firstName != null
(Helpers.capitalize(patient.firstName) + ? (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(patient.lastName))
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier *2.2, fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -86,13 +93,13 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
), ),
gender == 1 gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
) )
: Icon( : Icon(
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
]), ]),
), ),
Row(children: [ Row(children: [
@ -114,119 +121,84 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
SERVICES_PATIANT2[ SERVICES_PATIANT2[int.parse(patientType)] ==
int.parse(patientType)] == "patientArrivalList"
"patientArrivalList"
? Container( ? Container(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment children: [
.spaceBetween, patient.patientStatusType == 43
children: [ ? AppText(
patient.patientStatusType == TranslationBase.of(context).arrivedP,
43 color: Colors.green,
? AppText( fontWeight: FontWeight.bold,
TranslationBase.of( fontFamily: 'Poppins',
context) fontSize: 12,
.arrivedP, )
color: Colors.green, : AppText(
fontWeight: TranslationBase.of(context).notArrived,
FontWeight.bold, color: Colors.red[800],
fontFamily: fontWeight: FontWeight.bold,
'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
) ),
: AppText( arrivalType == '1' || patient.arrivedOn == null
TranslationBase.of( ? AppText(
context) patient.startTime != null
.notArrived, ? patient.startTime
color: : '',
Colors.red[800], fontFamily: 'Poppins',
fontWeight: fontWeight: FontWeight.w600,
FontWeight.bold, )
fontFamily: : AppText(
'Poppins', DateUtils.convertStringToDateFormat(
fontSize: 12, patient.arrivedOn,
), 'MM-dd-yyyy HH:mm'),
arrivalType == '1' || patient.arrivedOn == null fontFamily: 'Poppins',
? AppText( fontWeight: FontWeight.w600,
patient.startTime != )
null ],
? patient ))
.startTime
: '',
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
: AppText(
DateUtils.convertStringToDateFormat(
patient
.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
],
))
: SizedBox(), : SizedBox(),
if (SERVICES_PATIANT2[ if (SERVICES_PATIANT2[int.parse(patientType)] ==
int.parse(patientType)] ==
"List_MyOutPatient") "List_MyOutPatient")
Container( Container(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).appointmentDate +
.appointmentDate +
" : ", " : ",
fontSize: 14, fontSize: 14,
), ),
patient.startTime != null patient.startTime != null
? Container( ? Container(
height: 15, height: 15,
width: 60, width: 60,
decoration: decoration: BoxDecoration(
BoxDecoration( borderRadius: BorderRadius.circular(25),
borderRadius: color: HexColor("#20A169"),
BorderRadius ),
.circular( child: AppText(
25), patient.startTime,
color: HexColor( color: Colors.white,
"#20A169"), fontSize: 1.5 * SizeConfig.textMultiplier,
), textAlign: TextAlign.center,
child: AppText( fontWeight: FontWeight.bold,
patient.startTime, ),
color: Colors.white, )
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight:
FontWeight.bold,
),
)
: SizedBox(), : SizedBox(),
SizedBox( SizedBox(
width: 3.5, width: 3.5,
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate.toString()?? ''), convertDateFormat2(
fontSize: 1.5 * patient.appointmentDate.toString() ?? ''),
SizeConfig fontSize: 1.5 * SizeConfig.textMultiplier,
.textMultiplier, fontWeight: FontWeight.bold,
fontWeight:
FontWeight.bold,
), ),
), ),
SizedBox( SizedBox(
@ -239,34 +211,23 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
), ),
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: 1.6 * fontSize: 1.6 * SizeConfig.textMultiplier,
SizeConfig
.textMultiplier,
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: text: TranslationBase.of(context).fileNumber,
TranslationBase.of(
context)
.fileNumber,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12, fontFamily: 'Poppins')),
fontFamily:
'Poppins')),
new TextSpan( new TextSpan(
text: patient.patientId text: patient.patientId.toString(),
.toString(),
style: TextStyle( style: TextStyle(
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700, fontFamily: 'Poppins',
fontFamily:
'Poppins',
fontSize: 14)), fontSize: 14)),
], ],
), ),
@ -274,32 +235,23 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationalityName ?? patient.nationality,
patient.nationality,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
patient.nationality != null patient.nationality != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius child: Image.network(
.circular( patient.nationalityFlagURL,
20.0), height: 25,
child: Image.network( width: 30,
patient.nationalityFlagURL, errorBuilder: (BuildContext context,
height: 25, Object exception,
width: 30, StackTrace stackTrace) {
errorBuilder: return Text('No Image');
(BuildContext },
context, ))
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox() : SizedBox()
], ],
) )
@ -309,26 +261,19 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 1.6 * fontSize: 1.6 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(context).age + " : ",
context) style: TextStyle(fontSize: 14)),
.age +
" : ",
style: TextStyle(
fontSize: 14)),
new TextSpan( new TextSpan(
text: 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( style: TextStyle(
fontWeight: fontWeight: FontWeight.w700, fontSize: 14)),
FontWeight.w700,
fontSize: 14)),
], ],
), ),
), ),
@ -343,14 +288,16 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
Container( Container(
width: 30, width: 30,
height: 30, height: 30,
margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: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), left: BorderSide(color: Colors.grey[400], width: 2.5),
) )),
),
), ),
Expanded( Expanded(
child: Container( child: Container(
@ -380,79 +327,81 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
), ),
if (orderNo != null ) if (orderNo != null && !isPrescriptions)
Row( Row(
children: <Widget>[ children: <Widget>[
Texts( Texts('Order No: ',
'Order No: ', color: Colors.grey[800],
color: Colors.grey[800], fontSize: 12),
fontSize: 12 Texts(orderNo ?? '', fontSize: 12)
),
Texts(
orderNo ?? '',fontSize: 12
)
], ],
), ),
if (invoiceNO != null ) if (invoiceNO != null && !isPrescriptions)
Row( Row(
children: <Widget>[ children: <Widget>[
Texts( Texts('Invoice: ',
'Invoice: ', color: Colors.grey[800],
color: Colors.grey[800], fontSize: 12),
fontSize: 12 Texts(invoiceNO, fontSize: 12)
),
Texts(
invoiceNO,
fontSize: 12
)
], ],
), ),
if( branch!=null) if (branch != null)
Row( Row(
children: [ children: [
Texts( Texts('Branch: ',
'Branch: ', color: Colors.grey[800],
color: Colors.grey[800], fontSize: 12),
fontSize: 12 Texts(branch ?? '', fontSize: 12)
),
Texts(
branch?? '',
fontSize: 12
)
], ],
), ),
if(clinic!=null) if (isPrescriptions)
if (clinic != null)
Row(
children: [
Texts('Clinic: ',
color: Colors.grey[800],
fontSize: 12),
Texts(clinic ?? '', fontSize: 12)
],
),
if (isMedicalFile && episode != null)
Row( Row(
children: [ children: [
Texts( Texts('Episode: ',
'Clinic: ', color: Colors.grey[800],
color: Colors.grey[800], fontSize: 12),
fontSize: 12 Texts(episode ?? '', fontSize: 12)
), ],
Texts( ),
clinic?? '', if (isMedicalFile && vistDate != null)
fontSize: 12 Row(
) children: [
Texts('Visit Date: ',
color: Colors.grey[800],
fontSize: 12),
Texts(vistDate ?? '', fontSize: 12)
], ],
), ),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Texts( child: Texts(
!isPrescriptions? 'Result Date: ': 'Prescriptions Date ', !isPrescriptions
? 'Result Date: '
: 'Prescriptions Date ',
color: Colors.grey[800], color: Colors.grey[800],
fontSize: 12, fontSize: 12,
), ),
), ),
Texts( Texts(
'${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',fontSize: 14, '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
fontSize: 14,
) )
], ],
) )
]), ]),
), ),
), ),
], ],
), ),
), ),
@ -466,7 +415,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
} }
convertDateFormat2(String str) { convertDateFormat2(String str) {
String newDate =""; String newDate = "";
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -477,10 +426,10 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex))); int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() + newDate = date.year.toString() +
"/" + "/" +
date.month.toString().padLeft(2, '0') + date.month.toString().padLeft(2, '0') +
"/" + "/" +
date.day.toString().padLeft(2, '0'); date.day.toString().padLeft(2, '0');
} }
return newDate.toString(); return newDate.toString();
@ -504,5 +453,5 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
} }
@override @override
Size get preferredSize => Size(double.maxFinite,290); Size get preferredSize => Size(double.maxFinite, 290);
} }

@ -66,7 +66,7 @@ class _PriorityBarState extends State<PriorityBar> {
? _prioritiesAr[index] ? _prioritiesAr[index]
: item, : item,
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 14,
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

@ -0,0 +1,203 @@
import 'package:autocomplete_textfield/autocomplete_textfield.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_allergy.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../bottom_sheet_title.dart';
class AddAllergies extends StatefulWidget {
final Function addAllergiesFun;
final List<MySelectedAllergy> myAllergiesList;
const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList})
: super(key: key);
@override
_AddAllergiesState createState() => _AddAllergiesState();
}
class _AddAllergiesState extends State<AddAllergies> {
List<MasterKeyModel> allergiesList;
List<MasterKeyModel> allergySeverityList;
MasterKeyModel _selectedAllergySeverity;
MasterKeyModel _selectedAllergy;
TextEditingController remarkController = TextEditingController();
TextEditingController severityController = TextEditingController();
TextEditingController allergyController = TextEditingController();
List<MySelectedAllergy> myAllergiesListLocal;
@override
initState() {
super.initState();
myAllergiesListLocal = [...widget.myAllergiesList];
}
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 10,
color: Theme.of(context).hintColor,
fontWeight: FontWeight.w700),
);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery.of(context).size;
return FractionallySizedBox(
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.allergiesList.length == 0) {
await model.getMasterLookup(MasterKeysService.Allergies);
}
if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(
title: TranslationBase.of(context).addAllergies,
),
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
AddAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () => widget
.addAllergiesFun(myAllergiesListLocal),
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
),
),
),
),
]),
),
)),
),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where(
(element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return true;
}
return false;
}
removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal
.removeWhere((element) => element.selectedAllergy.id == masterKey.id);
}
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where(
(element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return allergy.first;
}
return null;
}
AddAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (mySelectedAllergy.selectedAllergy == null) {
helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy);
// Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
// Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
}
});
}
}
}

@ -20,6 +20,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'add_allergies.dart';
class UpdateAllergiesWidget extends StatefulWidget { class UpdateAllergiesWidget extends StatefulWidget {
List<MySelectedAllergy> myAllergiesList; List<MySelectedAllergy> myAllergiesList;
@ -244,7 +246,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
}); });
changeParentState(); // changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase
@ -257,250 +259,6 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
} }
class AddAllergies extends StatefulWidget {
final Function addAllergiesFun;
final List<MySelectedAllergy> myAllergiesList;
const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key);
@override
_AddAllergiesState createState() => _AddAllergiesState();
}
class _AddAllergiesState extends State<AddAllergies> {
List<MasterKeyModel> allergiesList;
List<MasterKeyModel> allergySeverityList;
MasterKeyModel _selectedAllergySeverity;
MasterKeyModel _selectedAllergy;
TextEditingController remarkController = TextEditingController();
TextEditingController severityController = TextEditingController();
TextEditingController allergyController = TextEditingController();
List<MySelectedAllergy> myAllergiesListLocal;
@override
initState(){
super.initState();
myAllergiesListLocal = [...widget.myAllergiesList];
}
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 10,
color: Theme
.of(context)
.hintColor,
fontWeight: FontWeight.w700
),
);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery
.of(context)
.size;
return FractionallySizedBox(
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.allergiesList.length == 0) {
await model.getMasterLookup(MasterKeysService.Allergies);
}
if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity);
}
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
height: 115,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10),
margin: EdgeInsets.only(top: 40),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize:20,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).
addAllergies,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 20)),
],
),
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(FontAwesomeIcons.times,
size: 30,
color: Color(0xFF2B353E)))
],
),
],
),
),
),
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy: (MySelectedAllergy mySelectedAllergy){
AddAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: ()=>
widget.addAllergiesFun(myAllergiesListLocal)
,
isServiceSelected: (master) =>isServiceSelected(master),
getServiceSelectedAllergy: (master)=>getSelectedAllergy(master),
),
),
),
),
),
),
]
),
),
)
),
),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return true;
}
return false;
}
removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal.removeWhere((element) =>
element.selectedAllergy.id == masterKey.id);
}
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return allergy.first;
}
return null;
}
AddAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (
mySelectedAllergy.selectedAllergy == null) {
helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy);
// Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy =
mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
// Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
}
});
}}
}

@ -0,0 +1,61 @@
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class BottomSheetTitle extends StatelessWidget {
const BottomSheetTitle({
Key key, this.title,
}) : super(key: key);
final String title;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
height: 115,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10),
margin: EdgeInsets.only(top: 60),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize:20,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: title,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 20)),
],
),
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(DoctorApp.close_1,
size:20,
color: Color(0xFF2B353E)))
],
),
],
),
),
);
}
}

@ -0,0 +1,193 @@
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/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.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_scaffold_widget.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:flutter/material.dart';
import '../PriorityBar.dart';
import '../bottom_sheet_title.dart';
class AddHistoryDialog extends StatefulWidget {
final Function changePageViewIndex;
final PageController controller;
final List<MySelectedHistory> myHistoryList;
final Function addSelectedHistories;
final Function (MasterKeyModel) removeHistory;
const AddHistoryDialog(
{Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory})
: super(key: key);
@override
_AddHistoryDialogState createState() => _AddHistoryDialogState();
}
class _AddHistoryDialogState extends State<AddHistoryDialog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.historyFamilyList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryFamily);
}
if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
if (model.historyMedicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: Column(
children: [
BottomSheetTitle(title:TranslationBase.of(context).addHistory),
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: widget.controller,
onPageChanged: (index) {
setState(() {
// currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyFamilyList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyMedicalList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
],
),
),
),
],
)),
),
),
));
}
createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList.where((element) =>
history.id ==
element.selectedHistory.id &&
history.typeId ==
element.selectedHistory.typeId
).toList();
if (myhistory.isEmpty) {
setState(() {
MySelectedHistory mySelectedHistory = MySelectedHistory(
remark: history.remarks ?? "",
selectedHistory: history,
isChecked: true);
widget.myHistoryList.add(mySelectedHistory);
});
} else {
myhistory.first.isChecked = true;
}
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedHistory> history =
widget
.myHistoryList
.where((element) =>
masterKey.id == element.selectedHistory.id &&
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
if (history.length > 0) {
return true;
}
return false;
}
}

@ -0,0 +1,223 @@
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_history.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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';
import '../PriorityBar.dart';
import '../bottom_sheet_title.dart';
import 'add_history_dialog.dart';
class UpdateHistoryWidget extends StatefulWidget {
final List<MySelectedHistory> myHistoryList;
const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key);
@override
_UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState();
}
class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 0;
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
}
@override
void initState() {
_controller = new PageController();
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
InkWell(
onTap: () {
openHistoryList(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).addHistory}",
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,
)
],
),
),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myHistoryList.map((myHistory) {
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Texts(
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
fontSize: 15,
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: Colors.black),
width: MediaQuery
.of(context)
.size
.width * 0.5,
),
if (myHistory.isChecked)
InkWell(
child: Row(
children: [
Container(
child: Texts(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: HexColor("#B8382C"),),
// width: MediaQuery.of(context).size.width * 0.3,
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 17,
),
],
),
onTap: () => removeHistory(myHistory.selectedHistory),
)
],
),
SizedBox(
height: 20,
),
],
);
}).toList(),
),
)
],
);
}
removeHistory(MasterKeyModel historyKey) {
List<MySelectedHistory> history =
// ignore: missing_return
widget.myHistoryList.where((element) =>
historyKey.id ==
element.selectedHistory.id &&
historyKey.typeId ==
element.selectedHistory.typeId
).toList();
if (history.length > 0)
setState(() {
history[0].isChecked = false;
});
}
openHistoryList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isDismissible: false,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 1,
child: AddHistoryDialog(
changePageViewIndex: changePageViewIndex,
controller: _controller,
myHistoryList: widget.myHistoryList,
addSelectedHistories: () {
setState(() {
Navigator.of(context).pop();
});
},
removeHistory: (masterKey) => removeHistory(masterKey),
),
);
});
}
}

@ -0,0 +1,472 @@
// ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.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/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/app-textfield-custom.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/dialogs/master_key_dailog.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../custom_validation_error.dart';
import '../bottom_sheet_title.dart';
class AddMedication extends StatefulWidget {
final Function addMedicationFun;
TextEditingController medicationController;
AddMedication({Key key, this.addMedicationFun, this.medicationController})
: super(key: key);
@override
_AddMedicationState createState() => _AddMedicationState();
}
class _AddMedicationState extends State<AddMedication> {
MasterKeyModel _selectedMedicationDose;
MasterKeyModel _selectedMedicationStrength;
MasterKeyModel _selectedMedicationRoute;
MasterKeyModel _selectedMedicationFrequency;
MasterKeyModel _selectedAllergy;
TextEditingController doseController = TextEditingController();
TextEditingController strengthController = TextEditingController();
TextEditingController routeController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
GetMedicationResponseModel _selectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
filled: true,
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 10,
color: Theme
.of(context)
.hintColor,
fontWeight: FontWeight.w700
),
);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery
.of(context)
.size;
return FractionallySizedBox(
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.medicationStrengthList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationStrength,);
}
if (model.medicationFrequencyList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationFrequency);
}
if (model.medicationDoseTimeList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationDoseTime);
}
if (model.medicationRouteList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationRoute);
}
if (model.allMedicationList.length == 0)
await model.getMedicationList();
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(
title: TranslationBase.of(context).addMedication,
),
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allMedicationList != null
? () {
setState(() {
_selectedMedication = null;
});
}
: null,
child: _selectedMedication == null
? AutoCompleteTextField<
GetMedicationResponseModel>(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication
.genericName
: null,
true,
icon: EvaIcons.search),
itemSubmitted: (item) => setState(
() =>
_selectedMedication = item),
key: key,
suggestions:
model.allMedicationList,
itemBuilder: (context,
suggestion) =>
new Padding(
child: Texts(suggestion
.description +
'/' +
suggestion.genericName),
padding:
EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.genericName
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(
input.toLowerCase()),
)
: AppTextFieldCustom(
hintText: _selectedMedication != null
? _selectedMedication
.description +
(' (${_selectedMedication.genericName} )')
: TranslationBase.of(context)
.searchMedicineNameHere,
minLines: 2,
maxLines: 2,
enabled: false,
),
),
),
if (isFormSubmitted &&
_selectedMedication == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
onClick: model.medicationDoseTimeList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationDoseTimeList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose =
selectedValue;
doseController
.text = projectViewModel
.isArabic
? _selectedMedicationDose
.nameAr
: _selectedMedicationDose
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).doseTime,
//TODO add translation
maxLines: 2,
minLines: 2,
isDropDown: true,
controller: doseController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationDose == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
isDropDown: true,
onClick: model.medicationStrengthList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationStrengthList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength =
selectedValue;
strengthController
.text = projectViewModel
.isArabic
? _selectedMedicationStrength
.nameAr
: _selectedMedicationStrength
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).strength,
// hintColor: Colors.black,
// fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 2,
controller: strengthController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationStrength == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
isDropDown: true,
onClick: model.medicationRouteList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationRouteList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationRoute =
selectedValue;
routeController
.text = projectViewModel
.isArabic
? _selectedMedicationRoute
.nameAr
: _selectedMedicationRoute
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).route,
maxLines: 2,
minLines: 2,
controller: routeController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationRoute == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
onClick: model.medicationFrequencyList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationFrequencyList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationFrequency =
selectedValue;
frequencyController
.text = projectViewModel
.isArabic
? _selectedMedicationFrequency
.nameAr
: _selectedMedicationFrequency
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).frequency,
//TODO add translation
enabled: false,
// hintColor: Colors.black,
maxLines: 2,
minLines: 2,
isDropDown: true,
controller: frequencyController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationFrequency == null)
CustomValidationError(),
SizedBox(
height: 30,
),
],
)),
),
),
]),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).addMedication.toUpperCase(),
color: Color(0xFF359846),
onPressed: () {
setState(() {
isFormSubmitted = true;
});
if (_selectedMedication != null &&
_selectedMedicationDose != null &&
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text = widget
.medicationController.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop();
}
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
),
),
),
);
}
}

@ -0,0 +1,118 @@
import 'package:autocomplete_textfield/autocomplete_textfield.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/model/get_medication_response_model.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_allergy.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-textfield-custom.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/dialogs/master_key_dailog.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';
import '../../custom_validation_error.dart';
import '../bottom_sheet_title.dart';
import 'add_medication.dart';
class UpdateMedicationWidget extends StatefulWidget {
final TextEditingController medicationController;
UpdateMedicationWidget({
Key key,
this.medicationController,
});
@override
_UpdateMedicationWidgetState createState() => _UpdateMedicationWidgetState();
}
class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
InkWell(
onTap: () {
openMedicationList(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).addMedication}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
),
SizedBox(
height: 20,
)
],
);
}
openMedicationList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
isDismissible: false,
context: context,
builder: (context) {
return AddMedication(
addMedicationFun: (MySelectedAllergy mySelectedAllergy) {},
medicationController: widget.medicationController,
);
});
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/medication/update_medication_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

@ -1,444 +0,0 @@
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_history.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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';
import 'PriorityBar.dart';
class UpdateHistoryWidget extends StatefulWidget {
final List<MySelectedHistory> myHistoryList;
const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key);
@override
_UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState();
}
class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 0;
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
}
@override
void initState() {
_controller = new PageController();
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
InkWell(
onTap: () {
openHistoryList(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).addHistory}",
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,
)
],
),
),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myHistoryList.map((myHistory) {
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Texts(
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
fontSize: 15,
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: Colors.black),
width: MediaQuery
.of(context)
.size
.width * 0.5,
),
if (myHistory.isChecked)
InkWell(
child: Row(
children: [
Container(
child: Texts(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: HexColor("#B8382C"),),
// width: MediaQuery.of(context).size.width * 0.3,
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 17,
),
],
),
onTap: () => removeHistory(myHistory.selectedHistory),
)
],
),
SizedBox(
height: 20,
),
],
);
}).toList(),
),
)
],
);
}
removeHistory(MasterKeyModel historyKey) {
List<MySelectedHistory> history =
// ignore: missing_return
widget.myHistoryList.where((element) =>
historyKey.id ==
element.selectedHistory.id &&
historyKey.typeId ==
element.selectedHistory.typeId
).toList();
if (history.length > 0)
setState(() {
history[0].isChecked = false;
});
}
openHistoryList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isDismissible: false,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 1,
child: AddHistoryDialog(
changePageViewIndex: changePageViewIndex,
controller: _controller,
myHistoryList: widget.myHistoryList,
addSelectedHistories: () {
setState(() {
Navigator.of(context).pop();
});
},
removeHistory: (masterKey) => removeHistory(masterKey),
),
);
});
}
}
class AddHistoryDialog extends StatefulWidget {
final Function changePageViewIndex;
final PageController controller;
final List<MySelectedHistory> myHistoryList;
final Function addSelectedHistories;
final Function (MasterKeyModel) removeHistory;
const AddHistoryDialog(
{Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory})
: super(key: key);
@override
_AddHistoryDialogState createState() => _AddHistoryDialogState();
}
class _AddHistoryDialogState extends State<AddHistoryDialog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.historyFamilyList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryFamily);
}
if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
if (model.historyMedicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: Column(
children: [
Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
height: 115,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10),
margin: EdgeInsets.only(top: 40),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize:20,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).addHistory,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 20)),
],
),
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(FontAwesomeIcons.times,
size: 30,
color: Color(0xFF2B353E)))
],
),
],
),
),
),
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: widget.controller,
onPageChanged: (index) {
setState(() {
// currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyFamilyList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyMedicalList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
],
),
),
),
],
)),
),
),
));
}
createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList.where((element) =>
history.id ==
element.selectedHistory.id &&
history.typeId ==
element.selectedHistory.typeId
).toList();
if (myhistory.isEmpty) {
setState(() {
MySelectedHistory mySelectedHistory = MySelectedHistory(
remark: history.remarks ?? "",
selectedHistory: history,
isChecked: true);
widget.myHistoryList.add(mySelectedHistory);
});
} else {
myhistory.first.isChecked = true;
}
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedHistory> history =
widget
.myHistoryList
.where((element) =>
masterKey.id == element.selectedHistory.id &&
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
if (history.length > 0) {
return true;
}
return false;
}
}

@ -1,607 +0,0 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.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_allergy.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-textfield-custom.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/dialogs/master_key_dailog.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';
import '../custom_validation_error.dart';
class UpdateMedicationWidget extends StatefulWidget {
final TextEditingController medicationController;
UpdateMedicationWidget({
Key key,
this.medicationController,
});
@override
_UpdateMedicationWidgetState createState() => _UpdateMedicationWidgetState();
}
class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
InkWell(
onTap: () {
openMedicationList(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).addMedication}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
),
SizedBox(
height: 20,
)
],
);
}
openMedicationList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
isDismissible: false,
context: context,
builder: (context) {
return AddMedication(
addMedicationFun: (MySelectedAllergy mySelectedAllergy) {},
medicationController: widget.medicationController,
);
});
}
}
// ignore: must_be_immutable
class AddMedication extends StatefulWidget {
final Function addMedicationFun;
TextEditingController medicationController;
AddMedication({Key key, this.addMedicationFun, this.medicationController})
: super(key: key);
@override
_AddMedicationState createState() => _AddMedicationState();
}
class _AddMedicationState extends State<AddMedication> {
MasterKeyModel _selectedMedicationDose;
MasterKeyModel _selectedMedicationStrength;
MasterKeyModel _selectedMedicationRoute;
MasterKeyModel _selectedMedicationFrequency;
MasterKeyModel _selectedAllergy;
TextEditingController doseController = TextEditingController();
TextEditingController strengthController = TextEditingController();
TextEditingController routeController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
GetMedicationResponseModel _selectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
filled: true,
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 10,
color: Theme
.of(context)
.hintColor,
fontWeight: FontWeight.w700
),
);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery
.of(context)
.size;
return FractionallySizedBox(
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.medicationStrengthList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationStrength,);
}
if (model.medicationFrequencyList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationFrequency);
}
if (model.medicationDoseTimeList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationDoseTime);
}
if (model.medicationRouteList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationRoute);
}
if (model.allMedicationList.length == 0)
await model.getMedicationList();
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding:
EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
height: 115,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10),
margin: EdgeInsets.only(top: 40),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 20, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.addMedication,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 20)),
],
),
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(FontAwesomeIcons.times,
size: 30, color: Color(0xFF2B353E)))
],
),
],
),
),
),
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allMedicationList != null
? () {
setState(() {
_selectedMedication = null;
});
}
: null,
child: _selectedMedication == null
? AutoCompleteTextField<
GetMedicationResponseModel>(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication
.genericName
: null,
true,
icon: EvaIcons.search),
itemSubmitted: (item) => setState(
() =>
_selectedMedication = item),
key: key,
suggestions:
model.allMedicationList,
itemBuilder: (context,
suggestion) =>
new Padding(
child: Texts(suggestion
.description +
'/' +
suggestion.genericName),
padding:
EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.genericName
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(
input.toLowerCase()),
)
: AppTextFieldCustom(
hintText: _selectedMedication != null
? _selectedMedication
.description +
(' (${_selectedMedication.genericName} )')
: TranslationBase.of(context)
.searchMedicineNameHere,
minLines: 2,
maxLines: 2,
enabled: false,
),
),
),
if (isFormSubmitted &&
_selectedMedication == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
onClick: model.medicationDoseTimeList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationDoseTimeList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose =
selectedValue;
doseController
.text = projectViewModel
.isArabic
? _selectedMedicationDose
.nameAr
: _selectedMedicationDose
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).doseTime,
//TODO add translation
maxLines: 2,
minLines: 2,
isDropDown: true,
controller: doseController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationDose == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
isDropDown: true,
onClick: model.medicationStrengthList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationStrengthList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength =
selectedValue;
strengthController
.text = projectViewModel
.isArabic
? _selectedMedicationStrength
.nameAr
: _selectedMedicationStrength
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).strength,
// hintColor: Colors.black,
// fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 2,
controller: strengthController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationStrength == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
isDropDown: true,
onClick: model.medicationRouteList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationRouteList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationRoute =
selectedValue;
routeController
.text = projectViewModel
.isArabic
? _selectedMedicationRoute
.nameAr
: _selectedMedicationRoute
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).route,
maxLines: 2,
minLines: 2,
controller: routeController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationRoute == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
onClick: model.medicationFrequencyList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationFrequencyList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationFrequency =
selectedValue;
frequencyController
.text = projectViewModel
.isArabic
? _selectedMedicationFrequency
.nameAr
: _selectedMedicationFrequency
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).frequency,
//TODO add translation
enabled: false,
// hintColor: Colors.black,
maxLines: 2,
minLines: 2,
isDropDown: true,
controller: frequencyController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationFrequency == null)
CustomValidationError(),
SizedBox(
height: 30,
),
],
)),
),
),
]),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).addMedication.toUpperCase(),
color: Color(0xFF359846),
onPressed: () {
setState(() {
isFormSubmitted = true;
});
if (_selectedMedication != null &&
_selectedMedicationDose != null &&
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text = widget
.medicationController.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop();
}
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
),
),
),
);
}
}

@ -18,8 +18,8 @@ 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/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/history/update_history_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';

@ -19,6 +19,7 @@ class DoctorCardInsurance extends StatelessWidget {
final String clinic; final String clinic;
final String approvalStatus; final String approvalStatus;
final String patientOut; final String patientOut;
final String branch2;
DoctorCardInsurance( DoctorCardInsurance(
{this.doctorName, {this.doctorName,
@ -31,7 +32,8 @@ class DoctorCardInsurance extends StatelessWidget {
this.isPrescriptions = false, this.isPrescriptions = false,
this.clinic, this.clinic,
this.approvalStatus, this.approvalStatus,
this.patientOut}); this.patientOut,
this.branch2});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -108,7 +110,7 @@ class DoctorCardInsurance extends StatelessWidget {
], ],
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
child: LargeAvatar( child: LargeAvatar(
@ -161,23 +163,38 @@ class DoctorCardInsurance extends StatelessWidget {
child: Texts( child: Texts(
clinic, clinic,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15.0,
), ),
) )
], ],
), ),
if (branch != null) if (branch2 != null)
Row( Row(
children: <Widget>[ children: <Widget>[
Texts( Texts(
'Approval No: ', 'Branch:',
//color: Colors.grey[500], //color: Colors.grey[500],
), ),
Texts( Texts(
branch, branch2,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15.0,
) )
], ],
) ),
Row(
children: <Widget>[
Texts(
'Approval No: ',
//color: Colors.grey[500],
),
Texts(
branch,
fontWeight: FontWeight.w700,
fontSize: 15.0,
)
],
),
]), ]),
), ),
), ),

@ -7,11 +7,13 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.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_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'app-textfield-custom.dart';
import 'app_texts_widget.dart'; import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart'; import 'dialogs/master_key_dailog.dart';
import 'expandable-widget-header-body.dart'; import 'expandable-widget-header-body.dart';
@ -62,132 +64,130 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
child: Column( child: Expanded(
children: [ child: Column(
Expanded( children: [
child: Container( Expanded(
height: MediaQuery.of(context).size.height * 0.62, child: Container(
child: Center( height: MediaQuery.of(context).size.height * 0.70,
child: Container( child: Center(
decoration: BoxDecoration( child: Container(
borderRadius: BorderRadius.circular(12), decoration: BoxDecoration(
color: Colors.white), borderRadius: BorderRadius.circular(12),
child: Column( color: Colors.white),
children: [ child: Column(
TextFields( children: [
hintText: widget.hintSearchText ?? TextFields(
TranslationBase.of(context).selectAllergy, hintText: widget.hintSearchText ??
borderWidth: 0.0, TranslationBase.of(context).selectAllergy,
padding: EdgeInsets.all(20), borderWidth: 0.0,
borderRadius: 0, padding: EdgeInsets.all(20),
suffixIcon: EvaIcons.search, borderRadius: 0,
onChanged: (value) { suffixIcon: EvaIcons.search,
filterSearchResults(value); onChanged: (value) {
}, filterSearchResults(value);
), },
SizedBox( ),
height: 10, SizedBox(
), height: 10,
Expanded( ),
child: FractionallySizedBox( Expanded(
widthFactor: 0.9, child: FractionallySizedBox(
child: Container( widthFactor: 0.9,
height: MediaQuery.of(context).size.height * 0.60, child: Container(
child: ListView.builder( height: MediaQuery.of(context).size.height * 0.60,
itemCount: items.length, child: ListView.builder(
itemBuilder: (context, index) { itemCount: items.length,
bool isSelected = itemBuilder: (context, index) {
widget.isServiceSelected(items[index]); bool isSelected =
MySelectedAllergy mySelectedAllergy; widget.isServiceSelected(items[index]);
if (isSelected) { MySelectedAllergy mySelectedAllergy;
mySelectedAllergy = if (isSelected) {
widget.getServiceSelectedAllergy( mySelectedAllergy =
items[index]); widget.getServiceSelectedAllergy(
} items[index]);
TextEditingController remarkController = }
TextEditingController( TextEditingController remarkController =
text: isSelected TextEditingController(
? mySelectedAllergy.remark text: isSelected
: null); ? mySelectedAllergy.remark
TextEditingController severityController = : null);
TextEditingController( TextEditingController severityController =
text: isSelected TextEditingController(
? mySelectedAllergy text: isSelected
.selectedAllergySeverity != ? mySelectedAllergy
null .selectedAllergySeverity !=
? projectViewModel.isArabic null
? mySelectedAllergy ? projectViewModel.isArabic
.selectedAllergySeverity ? mySelectedAllergy
.nameAr .selectedAllergySeverity
: mySelectedAllergy .nameAr
.selectedAllergySeverity : mySelectedAllergy
.nameEn .selectedAllergySeverity
: null .nameEn
: null); : null
return HeaderBodyExpandableNotifier( : null);
headerWidget: Row( return HeaderBodyExpandableNotifier(
mainAxisAlignment: headerWidget: Row(
MainAxisAlignment.spaceBetween, mainAxisAlignment:
children: [ MainAxisAlignment.spaceBetween,
Row( children: [
children: [ Row(
Checkbox( children: [
value: Checkbox(
widget.isServiceSelected( value:
items[index]), widget.isServiceSelected(
activeColor: Colors.red[800], items[index]),
onChanged: (bool newValue) { activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (widget
.isServiceSelected(
items[index])) {
widget.removeAllergy(
items[index]);
} else {
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);
widget.addAllergy(
mySelectedAllergy);
}
});
}),
InkWell(
onTap: () {
setState(() { setState(() {
if (widget if (widget
.isServiceSelected( .isServiceSelected(
items[index])) { items[index])) {
widget.removeAllergy( widget.removeAllergy(
items[index]); items[index]);
} else { } else {
// TODO add Allergy // TODO add Allergy
MySelectedAllergy MySelectedAllergy
mySelectedAllergy = mySelectedAllergy =
new MySelectedAllergy( new MySelectedAllergy(
selectedAllergy: selectedAllergy:
items[index], items[index],
selectedAllergySeverity: selectedAllergySeverity:
_selectedAllergySeverity, _selectedAllergySeverity,
remark: null, remark: null,
isChecked: true, isChecked: true,
isExpanded: true); isExpanded: true);
widget.addAllergy( widget.addAllergy(
mySelectedAllergy); mySelectedAllergy);
} }
}); });
}), },
InkWell(
onTap: () {
setState(() {
if (widget
.isServiceSelected(
items[index])) {
widget.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets padding: const EdgeInsets
.symmetric( .symmetric(
@ -214,396 +214,163 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
), ),
), ),
), ),
), ],
], ),
), InkWell(
InkWell( onTap: () {
onTap: () { if (mySelectedAllergy != null) {
if (mySelectedAllergy != null) { setState(() {
setState(() { mySelectedAllergy
mySelectedAllergy .isExpanded =
.isExpanded = mySelectedAllergy
mySelectedAllergy .isExpanded
.isExpanded ? false
? false : true;
: true; });
}); }
}
},
child: Icon((mySelectedAllergy !=
null
? mySelectedAllergy
.isExpanded
: false)
? EvaIcons
.arrowIosUpwardOutline
: EvaIcons
.arrowIosDownwardOutline))
],
),
bodyWidget: Column(
children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
}, },
); child: Icon((mySelectedAllergy !=
} null
: null, ? mySelectedAllergy
hasLabelText: .isExpanded
mySelectedAllergy != null && : false)
mySelectedAllergy ? EvaIcons
.selectedAllergySeverity != .arrowIosUpwardOutline
null : EvaIcons
? true .arrowIosDownwardOutline))
: false, ],
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
), ),
Container( bodyWidget: Column(
margin: EdgeInsets.only( children: [
left: 0, right: 0, top: 15), AppTextFieldCustom(
child: TextFields( onClick: widget.model
hasLabelText: .allergySeverityList !=
remarkController.text != null
'' ? () {
? true MasterKeyDailog dialog =
: false, MasterKeyDailog(
showLabelText: true, list: widget.model
hintText: TranslationBase .allergySeverityList,
.of( okText:
context) TranslationBase.of(
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
};
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context) context)
.emptyMessage; .ok,
else okFunction:
return null; (selectedValue) {
}), setState(() {
), mySelectedAllergy
SizedBox( .selectedAllergySeverity =
height: 10, selectedValue;
), });
],), },
isExpand: mySelectedAllergy != null );
? mySelectedAllergy.isExpanded showDialog(
: false, barrierDismissible:
); false,
context: context,
builder: (BuildContext
context) {
return dialog;
Column( },
children: [ );
InkWell(
onTap: () {
setState(() {
if (widget.isServiceSelected(
items[index])) {
widget
.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true);
widget.addAllergy(
mySelectedAllergy);
} }
}); : null,
}, isDropDown: true,
child: Column( hintText:
children: [ TranslationBase
Row( .of(context)
children: [ .selectSeverity,
Checkbox( enabled: false,
value: widget maxLines: 2,
.isServiceSelected( minLines: 2,
items[index]), controller: severityController,),
activeColor: SizedBox(
Colors.red[800], height: 5,
onChanged: (bool newValue) { ),
// setState(() { if(isSubmitted && mySelectedAllergy !=null &&
// if (widget mySelectedAllergy
// .isServiceSelected(items[index])) { .selectedAllergySeverity == null)
// widget.removeHistory(items[index]); Row(
// } else {
// widget.addHistory(items[index]);
// }
// });
}),
Expanded(
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: AppText(
projectViewModel.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index].nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
),
),
],
),
if(widget
.isServiceSelected(
items[index]))
Column(children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
hasLabelText:
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [ children: [
CustomValidationError(), CustomValidationError(),
], ],
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: NewTextFields(
hasLabelText: hintText: TranslationBase
remarkController.text != .of(
'' context)
? true .remarks,
: false, fontSize: 13.5,
showLabelText: true, // hintColor: Colors.black,
hintText: TranslationBase fontWeight: FontWeight.w600,
.of( maxLines: 25,
context) minLines: 3,
.remarks, initialValue: isSelected
fontSize: 13.5, ? mySelectedAllergy
// hintColor: Colors.black, .remark : '',
fontWeight: FontWeight.w600, // controller: remarkControlle
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) { onChanged: (value) {
if (isSelected) { if (isSelected) {
mySelectedAllergy mySelectedAllergy
.remark = value; .remark = value;
}; }
}, },
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase return TranslationBase
.of( .of(
context) context)
.emptyMessage; .emptyMessage;
else else
return null; return null;
}), }),
),
SizedBox(
height: 10,
),
],)
],
), ),
), SizedBox(
// DividerWithSpacesAround(), height: 10,
], ),
); ],),
}, isExpand: mySelectedAllergy != null
? mySelectedAllergy.isExpanded
: false,
);
},
),
), ),
), ),
), ),
), ],
], )
) )),
)), ),
), ),
), SizedBox(
SizedBox( height: 10,
height: 10,
),
if (widget.model.state == ViewState.Idle)
AppButton(
title: "Add Selected Allergy",
padding: 10,
color: Color(0xFF359846),
onPressed: () {
setState(() {
isSubmitted = true;
});
widget.addSelectedAllergy();
},
), ),
], if (widget.model.state == ViewState.Idle)
AppButton(
title: "Add Selected Allergy",
padding: 10,
color: Color(0xFF359846),
onPressed: () {
setState(() {
isSubmitted = true;
});
widget.addSelectedAllergy();
},
),
],
),
), ),
); );
} }

@ -34,10 +34,14 @@ class NetworkBaseView extends StatelessWidget {
case ViewState.Error: case ViewState.Error:
return Center( return Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: 100,), SizedBox(height: 100,),
Image.asset('assets/images/no-data.png',height: 250), Image.asset('assets/images/no-data.png'),
Texts(baseViewModel.error??'') Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(baseViewModel.error??''),
)
], ],
), ),

Loading…
Cancel
Save