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,14 +29,18 @@ 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) =>
AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
@ -63,15 +67,22 @@ class PatientSickLeaveScreen extends StatelessWidget {
), ),
if (!projectsProvider.isArabic) if (!projectsProvider.isArabic)
AppText( AppText(
TranslationBase.of(context).patient, TranslationBase
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4), .of(context)
.patient,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * (SizeConfig
.isWidthLarge ? 3 : 4),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.72, letterSpacing: -0.72,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), ),
AppText( AppText(
TranslationBase.of(context).sickLeave, TranslationBase
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6), .of(context)
.sickLeave,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 6 : 6),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: -1.44, letterSpacing: -1.44,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
@ -80,7 +91,9 @@ class PatientSickLeaveScreen extends StatelessWidget {
), ),
), ),
AddNewOrder( AddNewOrder(
label: TranslationBase.of(context).noSickLeaveApplied, label: TranslationBase
.of(context)
.noSickLeaveApplied,
onTap: () async { onTap: () async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Add Sick Leave Screen" eventCategory: "Add Sick Leave Screen"
@ -101,7 +114,8 @@ class PatientSickLeaveScreen extends StatelessWidget {
shrinkWrap: true, shrinkWrap: true,
itemCount: model.getAllSIckLeavePatient.length, itemCount: model.getAllSIckLeavePatient.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
SickLeavePatientModel item = model.getAllSIckLeavePatient[index]; SickLeavePatientModel item = model
.getAllSIckLeavePatient[index];
return Column( return Column(
children: [ children: [
CardWithBgWidget( CardWithBgWidget(
@ -117,16 +131,22 @@ class PatientSickLeaveScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
if (item.doctorName != null) if (item.doctorName != null)
Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Row(crossAxisAlignment: CrossAxisAlignment
.start,
mainAxisAlignment: MainAxisAlignment
.start,
children: [
Expanded( Expanded(
// width: MediaQuery.of(context).size.width*0.51, // width: MediaQuery.of(context).size.width*0.51,
child: AppText( child: AppText(
Utils.capitalize(item.doctorName ?? ""), Utils.capitalize(
item.doctorName ?? ""),
fontSize: 18, fontSize: 18,
color: Color(0xff2e303a), color: Color(0xff2e303a),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow
.ellipsis,
), ),
), ),
]), ]),
@ -136,12 +156,16 @@ class PatientSickLeaveScreen extends StatelessWidget {
Row( Row(
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(50.0), borderRadius: BorderRadius.circular(
50.0),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", imageUrl: item.doctorImageURL ??
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
height: 30, height: 30,
width: 30, width: 30,
errorWidget: (context, url, error) => AppText( errorWidget: (context, url,
error) =>
AppText(
'No Image', 'No Image',
fontSize: 10, fontSize: 10,
), ),
@ -154,36 +178,80 @@ class PatientSickLeaveScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of(context).daysSickleave, label: TranslationBase
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, .of(context)
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, .daysSickleave,
labelSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.3,
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value: value:
(item.sickLeaveDays.toString() != null && item.sickLeaveDays.toString() != "null") ? item.sickLeaveDays.toString() : item.noOfDays.toString(), (item.sickLeaveDays
.toString() != null &&
item.sickLeaveDays
.toString() != "null")
? item.sickLeaveDays
.toString()
: item.noOfDays
.toString(),
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).startDate + ' ' ?? "", label: TranslationBase
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, .of(context)
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, .startDate + ' ' ?? "",
value: AppDateUtils.getDayMonthYearDateFormatted( labelSize: SizeConfig
item.startDate.contains("/Date(") ? AppDateUtils.convertStringToDate(item.startDate) : DateTime.parse(item.startDate), .getTextMultiplierBasedOnWidth() *
3.3,
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value: AppDateUtils
.getDayMonthYearDateFormatted(
item.startDate.contains(
"/Date(")
? AppDateUtils
.convertStringToDate(
item.startDate)
: DateTime.parse(
item.startDate),
), ),
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).endDate + ' ' ?? "", label: TranslationBase
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, .of(context)
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, .endDate + ' ' ?? "",
value: AppDateUtils.getDayMonthYearDateFormatted( labelSize: SizeConfig
item.startDate.contains("/Date(") .getTextMultiplierBasedOnWidth() *
? AppDateUtils.convertStringToDate(item.endDate ?? "").add( 3.3,
Duration(days: item.noOfDays ?? item.sickLeaveDays), valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value: AppDateUtils
.getDayMonthYearDateFormatted(
item.startDate.contains(
"/Date(")
? AppDateUtils
.convertStringToDate(
item.endDate ?? "").add(
Duration(
days: item.noOfDays ??
item
.sickLeaveDays),
) )
: DateTime.parse(item.startDate ?? "").add( : DateTime.parse(
Duration(days: item.noOfDays ?? ""), item.startDate ?? "")
.add(
Duration(
days: item.noOfDays ??
""),
), ),
), ),
), ),
], ],
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment
.start,
), ),
), ),
], ],
@ -200,7 +268,9 @@ class PatientSickLeaveScreen extends StatelessWidget {
) )
: patient.patientStatusType != 43 : patient.patientStatusType != 43
? ErrorMessage( ? ErrorMessage(
error: TranslationBase.of(context).noSickLeave, error: TranslationBase
.of(context)
.noSickLeave,
) )
: SizedBox(), : SizedBox(),
SizedBox( SizedBox(
@ -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