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.template,
this.remarks,
this.type});
this.type ='1'});
EntityList.fromJson(Map<String, dynamic> json) {
allowedClinic = json['allowedClinic'];

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

@ -1,4 +1,5 @@
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_medical_file/sick_leave/sickleave_service.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 getAllSIckLeavePatient => [
get getAllSIckLeavePatient => removeDuplicates([
..._sickLeaveService.getAllSickLeavePatient,
..._sickLeaveService.getAllSickLeaveDoctor
];
]);
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.BusyLocal);
@ -183,4 +184,15 @@ class SickLeaveViewModel extends BaseViewModel {
} else
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) {
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'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>(
onModelReady: (model) async {
await model.getSickLeaveForPatient(patient);
},
builder: (_, model, w) => AppScaffold(
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
@ -63,15 +67,22 @@ class PatientSickLeaveScreen extends StatelessWidget {
),
if (!projectsProvider.isArabic)
AppText(
TranslationBase.of(context).patient,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4),
TranslationBase
.of(context)
.patient,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * (SizeConfig
.isWidthLarge ? 3 : 4),
fontWeight: FontWeight.w700,
letterSpacing: -0.72,
color: Color(0xFF2E303A),
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6),
TranslationBase
.of(context)
.sickLeave,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 6 : 6),
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
color: Color(0xFF2E303A),
@ -80,7 +91,9 @@ class PatientSickLeaveScreen extends StatelessWidget {
),
),
AddNewOrder(
label: TranslationBase.of(context).noSickLeaveApplied,
label: TranslationBase
.of(context)
.noSickLeaveApplied,
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Sick Leave Screen"
@ -101,7 +114,8 @@ class PatientSickLeaveScreen extends StatelessWidget {
shrinkWrap: true,
itemCount: model.getAllSIckLeavePatient.length,
itemBuilder: (BuildContext ctxt, int index) {
SickLeavePatientModel item = model.getAllSIckLeavePatient[index];
SickLeavePatientModel item = model
.getAllSIckLeavePatient[index];
return Column(
children: [
CardWithBgWidget(
@ -117,16 +131,22 @@ class PatientSickLeaveScreen extends StatelessWidget {
child: Column(
children: [
if (item.doctorName != null)
Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [
Row(crossAxisAlignment: CrossAxisAlignment
.start,
mainAxisAlignment: MainAxisAlignment
.start,
children: [
Expanded(
// width: MediaQuery.of(context).size.width*0.51,
child: AppText(
Utils.capitalize(item.doctorName ?? ""),
Utils.capitalize(
item.doctorName ?? ""),
fontSize: 18,
color: Color(0xff2e303a),
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
textOverflow: TextOverflow
.ellipsis,
),
),
]),
@ -136,12 +156,16 @@ class PatientSickLeaveScreen extends StatelessWidget {
Row(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(50.0),
borderRadius: BorderRadius.circular(
50.0),
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,
width: 30,
errorWidget: (context, url, error) => AppText(
errorWidget: (context, url,
error) =>
AppText(
'No Image',
fontSize: 10,
),
@ -154,36 +178,80 @@ class PatientSickLeaveScreen extends StatelessWidget {
child: Column(
children: [
CustomRow(
label: TranslationBase.of(context).daysSickleave,
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3,
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
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(),
(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),
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 + ' ' ?? "",
labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3,
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
value: AppDateUtils.getDayMonthYearDateFormatted(
item.startDate.contains("/Date(")
? AppDateUtils.convertStringToDate(item.endDate ?? "").add(
Duration(days: item.noOfDays ?? item.sickLeaveDays),
label: TranslationBase
.of(context)
.endDate + ' ' ?? "",
labelSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.3,
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(
Duration(days: item.noOfDays ?? ""),
: DateTime.parse(
item.startDate ?? "")
.add(
Duration(
days: item.noOfDays ??
""),
),
),
),
],
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment
.start,
),
),
],
@ -200,7 +268,9 @@ class PatientSickLeaveScreen extends StatelessWidget {
)
: patient.patientStatusType != 43
? ErrorMessage(
error: TranslationBase.of(context).noSickLeave,
error: TranslationBase
.of(context)
.noSickLeave,
)
: SizedBox(),
SizedBox(
@ -226,3 +296,4 @@ class PatientSickLeaveScreen extends StatelessWidget {
);
}
}

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

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

Loading…
Cancel
Save