bug fixes and updates

development-3.3_voipCall
Sultan khan 3 years ago
parent 0d65197b2f
commit 5e63db7ea6

@ -58,7 +58,7 @@ class EntityList {
this.subGroup, this.subGroup,
this.template, this.template,
this.remarks, this.remarks,
this.type}); this.type ='1'});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
allowedClinic = json['allowedClinic']; allowedClinic = json['allowedClinic'];

@ -9,6 +9,7 @@ class SickLeavePatientModel {
dynamic requestDate; dynamic requestDate;
dynamic sickLeaveDays; dynamic sickLeaveDays;
dynamic appointmentNo; dynamic appointmentNo;
dynamic appointmentNO;
dynamic admissionNo; dynamic admissionNo;
dynamic actualDoctorRate; dynamic actualDoctorRate;
dynamic appointmentDate; dynamic appointmentDate;
@ -98,7 +99,7 @@ class SickLeavePatientModel {
requestNo = json['RequestNo']; requestNo = json['RequestNo'];
requestDate = json['RequestDate']; requestDate = json['RequestDate'];
sickLeaveDays = json['SickLeaveDays']; sickLeaveDays = json['SickLeaveDays'];
appointmentNo = json['AppointmentNo']; appointmentNo = (json['AppointmentNo'] ==null ? json['appointmentNo'] : json['AppointmentNo']);
admissionNo = json['AdmissionNo']; admissionNo = json['AdmissionNo'];
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
@ -30,10 +31,10 @@ class SickLeaveViewModel extends BaseViewModel {
get postSechedule => _sickLeaveService.postReschedule; get postSechedule => _sickLeaveService.postReschedule;
get getAllSIckLeavePatient => [ get getAllSIckLeavePatient => removeDuplicates([
..._sickLeaveService.getAllSickLeavePatient, ..._sickLeaveService.getAllSickLeavePatient,
..._sickLeaveService.getAllSickLeaveDoctor ..._sickLeaveService.getAllSickLeaveDoctor
]; ]);
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -183,4 +184,15 @@ class SickLeaveViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
List<SickLeavePatientModel> removeDuplicates(List<SickLeavePatientModel> items) {
List<SickLeavePatientModel>uniqueItems = [];
var uniqueIDs = items
.map((e) => e.appointmentNo)
.toSet();
uniqueIDs.forEach((e) {
uniqueItems.add(items.firstWhere((i) => i.appointmentNo == e));
});
return uniqueItems;
}
} }

@ -29,185 +29,255 @@ class PatientSickLeaveScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute
.of(context)
.settings
.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getSickLeaveForPatient(patient); await model.getSickLeaveForPatient(patient);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) =>
baseViewModel: model, AppScaffold(
isShowAppBar: true, baseViewModel: model,
backgroundColor: Colors.grey[100], isShowAppBar: true,
appBar: PatientProfileAppBar( backgroundColor: Colors.grey[100],
patient, appBar: PatientProfileAppBar(
isInpatient: isInpatient, patient,
), isInpatient: isInpatient,
body: Column(children: [ ),
patient.patientStatusType == 43 body: Column(children: [
? Column( patient.patientStatusType == 43
crossAxisAlignment: CrossAxisAlignment.start, ? Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: EdgeInsets.all(10), Padding(
child: Column( padding: EdgeInsets.all(10),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: SizeConfig.isHeightVeryShort SizedBox(
? 30 height: SizeConfig.isHeightVeryShort
: SizeConfig.isHeightShort ? 30
? 35 : SizeConfig.isHeightShort
: 10, ? 35
), : 10,
if (!projectsProvider.isArabic) ),
AppText( if (!projectsProvider.isArabic)
TranslationBase.of(context).patient,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4),
fontWeight: FontWeight.w700,
letterSpacing: -0.72,
color: Color(0xFF2E303A),
),
AppText( AppText(
TranslationBase.of(context).sickLeave, TranslationBase
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6), .of(context)
fontWeight: FontWeight.bold, .patient,
letterSpacing: -1.44, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * (SizeConfig
.isWidthLarge ? 3 : 4),
fontWeight: FontWeight.w700,
letterSpacing: -0.72,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), ),
], AppText(
), TranslationBase
.of(context)
.sickLeave,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 6 : 6),
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
color: Color(0xFF2E303A),
),
],
), ),
AddNewOrder( ),
label: TranslationBase.of(context).noSickLeaveApplied, AddNewOrder(
onTap: () async { label: TranslationBase
await locator<AnalyticsService>().logEvent( .of(context)
eventCategory: "Add Sick Leave Screen" .noSickLeaveApplied,
"Leave Screen", onTap: () async {
eventAction: "apply For Sick Leave", await locator<AnalyticsService>().logEvent(
); eventCategory: "Add Sick Leave Screen"
openSickLeave(context, model); "Leave Screen",
}), eventAction: "apply For Sick Leave",
], );
) openSickLeave(context, model);
: SizedBox(), }),
model.getAllSIckLeavePatient.length > 0 ],
? Expanded( )
child: FractionallySizedBox( : SizedBox(),
widthFactor: 0.95, model.getAllSIckLeavePatient.length > 0
child: ListView.builder( ? Expanded(
scrollDirection: Axis.vertical, child: FractionallySizedBox(
shrinkWrap: true, widthFactor: 0.95,
itemCount: model.getAllSIckLeavePatient.length, child: ListView.builder(
itemBuilder: (BuildContext ctxt, int index) { scrollDirection: Axis.vertical,
SickLeavePatientModel item = model.getAllSIckLeavePatient[index]; shrinkWrap: true,
return Column( itemCount: model.getAllSIckLeavePatient.length,
children: [ itemBuilder: (BuildContext ctxt, int index) {
CardWithBgWidget( SickLeavePatientModel item = model
padding: 0, .getAllSIckLeavePatient[index];
marginLeft: 10, return Column(
marginSymmetric: 10, children: [
hasBorder: false, CardWithBgWidget(
bgColor: Colors.black, padding: 0,
widget: Container( marginLeft: 10,
color: Colors.white, marginSymmetric: 10,
padding: EdgeInsets.all(20), hasBorder: false,
child: InkWell( bgColor: Colors.black,
child: Column( widget: Container(
children: [ color: Colors.white,
if (item.doctorName != null) padding: EdgeInsets.all(20),
Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ child: InkWell(
Expanded( child: Column(
// width: MediaQuery.of(context).size.width*0.51, children: [
child: AppText( if (item.doctorName != null)
Utils.capitalize(item.doctorName ?? ""), Row(crossAxisAlignment: CrossAxisAlignment
fontSize: 18, .start,
color: Color(0xff2e303a), mainAxisAlignment: MainAxisAlignment
fontWeight: FontWeight.w700, .start,
fontFamily: 'Poppins', children: [
textOverflow: TextOverflow.ellipsis, Expanded(
), // width: MediaQuery.of(context).size.width*0.51,
), child: AppText(
]), Utils.capitalize(
SizedBox( item.doctorName ?? ""),
height: 10, fontSize: 18,
), color: Color(0xff2e303a),
Row( fontWeight: FontWeight.w700,
children: [ fontFamily: 'Poppins',
ClipRRect( textOverflow: TextOverflow
borderRadius: BorderRadius.circular(50.0), .ellipsis,
child: CachedNetworkImage(
imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
height: 30,
width: 30,
errorWidget: (context, url, error) => AppText(
'No Image',
fontSize: 10,
), ),
), ),
), ]),
SizedBox( SizedBox(
width: 10, height: 10,
), ),
Expanded( Row(
child: Column( children: [
children: [ ClipRRect(
CustomRow( borderRadius: BorderRadius.circular(
label: TranslationBase.of(context).daysSickleave, 50.0),
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, child: CachedNetworkImage(
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, imageUrl: item.doctorImageURL ??
value: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
(item.sickLeaveDays.toString() != null && item.sickLeaveDays.toString() != "null") ? item.sickLeaveDays.toString() : item.noOfDays.toString(), height: 30,
width: 30,
errorWidget: (context, url,
error) =>
AppText(
'No Image',
fontSize: 10,
), ),
CustomRow( ),
label: TranslationBase.of(context).startDate + ' ' ?? "", ),
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, SizedBox(
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, width: 10,
value: AppDateUtils.getDayMonthYearDateFormatted( ),
item.startDate.contains("/Date(") ? AppDateUtils.convertStringToDate(item.startDate) : DateTime.parse(item.startDate), Expanded(
), child: Column(
children: [
CustomRow(
label: TranslationBase
.of(context)
.daysSickleave,
labelSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.3,
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value:
(item.sickLeaveDays
.toString() != null &&
item.sickLeaveDays
.toString() != "null")
? item.sickLeaveDays
.toString()
: item.noOfDays
.toString(),
),
CustomRow(
label: TranslationBase
.of(context)
.startDate + ' ' ?? "",
labelSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.3,
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value: AppDateUtils
.getDayMonthYearDateFormatted(
item.startDate.contains(
"/Date(")
? AppDateUtils
.convertStringToDate(
item.startDate)
: DateTime.parse(
item.startDate),
), ),
CustomRow( ),
label: TranslationBase.of(context).endDate + ' ' ?? "", CustomRow(
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, label: TranslationBase
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, .of(context)
value: AppDateUtils.getDayMonthYearDateFormatted( .endDate + ' ' ?? "",
item.startDate.contains("/Date(") labelSize: SizeConfig
? AppDateUtils.convertStringToDate(item.endDate ?? "").add( .getTextMultiplierBasedOnWidth() *
Duration(days: item.noOfDays ?? item.sickLeaveDays), 3.3,
) valueSize: SizeConfig
: DateTime.parse(item.startDate ?? "").add( .getTextMultiplierBasedOnWidth() *
Duration(days: item.noOfDays ?? ""), 4,
), value: AppDateUtils
.getDayMonthYearDateFormatted(
item.startDate.contains(
"/Date(")
? AppDateUtils
.convertStringToDate(
item.endDate ?? "").add(
Duration(
days: item.noOfDays ??
item
.sickLeaveDays),
)
: DateTime.parse(
item.startDate ?? "")
.add(
Duration(
days: item.noOfDays ??
""),
), ),
), ),
], ),
crossAxisAlignment: CrossAxisAlignment.start, ],
), crossAxisAlignment: CrossAxisAlignment
.start,
), ),
], ),
), ],
], ),
), ],
), ),
), ),
), ),
], ),
); ],
}), );
), }),
) ),
: patient.patientStatusType != 43 )
: patient.patientStatusType != 43
? ErrorMessage( ? ErrorMessage(
error: TranslationBase.of(context).noSickLeave, error: TranslationBase
) .of(context)
.noSickLeave,
)
: SizedBox(), : SizedBox(),
SizedBox( SizedBox(
height: 100, height: 100,
) )
]), ]),
), ),
); );
} }
@ -226,3 +296,4 @@ class PatientSickLeaveScreen extends StatelessWidget {
); );
} }
} }

@ -31,7 +31,7 @@ class AddProcedurePage extends StatefulWidget {
} }
class _AddProcedurePageState extends State<AddProcedurePage> { class _AddProcedurePageState extends State<AddProcedurePage> {
int selectedType; String selectedType;
ProcedureViewModel model; ProcedureViewModel model;
PatiantInformtion patient; PatiantInformtion patient;
ProcedureType procedureType; ProcedureType procedureType;
@ -46,7 +46,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
dynamic selectedCategory; dynamic selectedCategory;
setSelectedType(int val) { setSelectedType(String val) {
setState(() { setState(() {
selectedType = val; selectedType = val;
}); });

@ -37,11 +37,11 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
class _EntityListCheckboxSearchWidgetState class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> { extends State<EntityListCheckboxSearchWidget> {
int selectedType = 0; String selectedType = '0';
int typeUrgent; int typeUrgent;
int typeRegular; int typeRegular;
setSelectedType(int val) { setSelectedType(String val) {
setState(() { setState(() {
selectedType = val; selectedType = val;
}); });
@ -158,8 +158,8 @@ class _EntityListCheckboxSearchWidgetState
Radio( Radio(
activeColor: activeColor:
Color(0xFFD02127), Color(0xFFD02127),
value: 0, value: '0',
groupValue: selectedType, groupValue: historyInfo.type,
onChanged: (value) { onChanged: (value) {
historyInfo.type = historyInfo.type =
setSelectedType(value) setSelectedType(value)
@ -177,8 +177,8 @@ class _EntityListCheckboxSearchWidgetState
Radio( Radio(
activeColor: activeColor:
Color(0xFFD02127), Color(0xFFD02127),
groupValue: selectedType, groupValue: historyInfo.type,
value: 1, value: '1',
onChanged: (value) { onChanged: (value) {
historyInfo.type = historyInfo.type =
setSelectedType(value) setSelectedType(value)

Loading…
Cancel
Save