Merge branch 'medical-profile-services' into 'development'

medical report fixes and vital sign

See merge request Cloud_Solution/doctor_app_flutter!706
merge-requests/707/head
Mohammad Aljammal 5 years ago
commit cbf7ccebe8

@ -6,10 +6,19 @@ class MedicalReportModel {
String invoiceNo; String invoiceNo;
int status; int status;
String verifiedOn; String verifiedOn;
int verifiedBy; String verifiedBy;
String editedOn; String editedOn;
int editedBy; int editedBy;
int lineItemNo; int lineItemNo;
String createdOn;
int templateID;
int doctorID;
int doctorGender;
String doctorGenderDescription;
String doctorGenderDescriptionN;
String doctorImageURL;
String doctorName;
String doctorNameN;
String reportDataHtml; String reportDataHtml;
MedicalReportModel( MedicalReportModel(
@ -24,6 +33,15 @@ class MedicalReportModel {
this.editedOn, this.editedOn,
this.editedBy, this.editedBy,
this.lineItemNo, this.lineItemNo,
this.createdOn,
this.templateID,
this.doctorID,
this.doctorGender,
this.doctorGenderDescription,
this.doctorGenderDescriptionN,
this.doctorImageURL,
this.doctorName,
this.doctorNameN,
this.reportDataHtml}); this.reportDataHtml});
MedicalReportModel.fromJson(Map<String, dynamic> json) { MedicalReportModel.fromJson(Map<String, dynamic> json) {
@ -38,6 +56,15 @@ class MedicalReportModel {
editedOn = json['EditedOn']; editedOn = json['EditedOn'];
editedBy = json['EditedBy']; editedBy = json['EditedBy'];
lineItemNo = json['LineItemNo']; lineItemNo = json['LineItemNo'];
createdOn = json['CreatedOn'];
templateID = json['TemplateID'];
doctorID = json['DoctorID'];
doctorGender = json['DoctorGender'];
doctorGenderDescription = json['DoctorGenderDescription'];
doctorGenderDescriptionN = json['DoctorGenderDescriptionN'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
reportDataHtml = json['ReportDataHtml']; reportDataHtml = json['ReportDataHtml'];
} }
@ -54,6 +81,15 @@ class MedicalReportModel {
data['EditedOn'] = this.editedOn; data['EditedOn'] = this.editedOn;
data['EditedBy'] = this.editedBy; data['EditedBy'] = this.editedBy;
data['LineItemNo'] = this.lineItemNo; data['LineItemNo'] = this.lineItemNo;
data['CreatedOn'] = this.createdOn;
data['TemplateID'] = this.templateID;
data['DoctorID'] = this.doctorID;
data['DoctorGender'] = this.doctorGender;
data['DoctorGenderDescription'] = this.doctorGenderDescription;
data['DoctorGenderDescriptionN'] = this.doctorGenderDescriptionN;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ReportDataHtml'] = this.reportDataHtml; data['ReportDataHtml'] = this.reportDataHtml;
return data; return data;
} }

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart';
@ -23,10 +24,11 @@ class MedicalReportDetailPage extends StatelessWidget {
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
MedicalReportModel medicalReport = routeArgs['medicalReport']; MedicalReportModel medicalReport = routeArgs['medicalReport'];
return BaseView<BaseViewModel>( return BaseView<PatientMedicalReportViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient,
patientType, patientType,
@ -57,7 +59,7 @@ class MedicalReportDetailPage extends StatelessWidget {
], ],
), ),
), ),
Container( medicalReport.reportDataHtml != null ? Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
@ -73,8 +75,10 @@ class MedicalReportDetailPage extends StatelessWidget {
), ),
), ),
child: Html( child: Html(
data: medicalReport.reportDataHtml data: medicalReport.reportDataHtml ?? ""
), ),
) : Container(
), ),
], ],
), ),

@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.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:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -84,113 +85,142 @@ class MedicalReportPage extends StatelessWidget {
}, },
label: TranslationBase.of(context).createNewMedicalReport, label: TranslationBase.of(context).createNewMedicalReport,
), ),
// if (model.state == ViewState.ErrorLocal)
// Container(
// child: ErrorMessage(error: model.error),
// ),
if (model.state != ViewState.ErrorLocal) if (model.state != ViewState.ErrorLocal)
...List.generate( ...List.generate(
model.medicalReportList.length, model.medicalReportList.length,
(index) => CardWithBgWidget( (index) => Container(
hasBorder: false, margin: EdgeInsets.symmetric(horizontal: 8),
bgColor: model.medicalReportList[index].status == 1 child: CardWithBgWidget(
? Colors.red[700] hasBorder: false,
: Colors.green[700], bgColor: model.medicalReportList[index].status == 1
widget: Column( ? Colors.red[700]
children: [ : Colors.green[700],
Row( widget: Column(
children: [ children: [
Expanded( Row(
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
children: [ child: Column(
AppText( crossAxisAlignment: CrossAxisAlignment.start,
model.medicalReportList[index].status == 1 children: [
? TranslationBase.of(context).onHold AppText(
: TranslationBase.of(context).verified, model.medicalReportList[index].status == 1
color: model.medicalReportList[index].status == 1 ? TranslationBase.of(context).onHold
? Colors.red[700] : TranslationBase.of(context).verified,
: Colors.green[700], color:
), model.medicalReportList[index].status ==
AppText( 1
"Jammal" ?? "", ? Colors.red[700]
fontSize: 15, : Colors.green[700],
bold: true, fontSize: 1.4 * SizeConfig.textMultiplier,
), bold: true,
], ),
)), AppText(
Expanded( projectViewModel.isArabic
child: Column( ? model.medicalReportList[index]
.doctorNameN
: model.medicalReportList[index]
.doctorName,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
],
)),
Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
'${AppDateUtils.convertDateFromServerFormat( '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}',
model.medicalReportList[index].editedOn, color: Color(0xFF2E303A),
"dd/MM/yyyy")}',
color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 1.6 * SizeConfig.textMultiplier,
), ),
AppText( AppText(
'${AppDateUtils.convertDateFromServerFormat( '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}',
model.medicalReportList[index].editedOn, color: Color(0xFF2E303A),
"hh:mm a")}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.grey[700], fontSize: 1.5 * SizeConfig.textMultiplier,
fontSize: 14,
), ),
], ],
), ),
), ],
], ),
), Row(
Row( crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Container(
Container( margin: EdgeInsets.only(
child: LargeAvatar( left: 0, top: 4, right: 8, bottom: 0),
name: "Jammal", child: LargeAvatar(
url: null, name: projectViewModel.isArabic
? model
.medicalReportList[index].doctorNameN
: model
.medicalReportList[index].doctorName,
url: model
.medicalReportList[index].doctorImageURL,
),
width: 50,
height: 50,
), ),
width: 55, Expanded(
height: 55, child: Container(
), height: 50,
Expanded(child: AppText("")), child: AppText(
InkWell( TranslationBase.of(context).showDetail,
onTap: () { fontSize: 1.4 * SizeConfig.textMultiplier,
if (model.medicalReportList[index].status == ),
1) { ),
Navigator.of(context).pushNamed( // child: Html(
PATIENT_MEDICAL_REPORT_INSERT, // data: model.medicalReportList[index]
arguments: { // .reportDataHtml ??
'patient': patient, // ""),
'patientType': patientType,
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD,
'medicalReport':
model.medicalReportList[index]
});
} else {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_DETAIL,
arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'medicalReport':
model.medicalReportList[index]
});
}
},
child: Icon(
model.medicalReportList[index].status == 1
? EvaIcons.eye
: DoctorApp.edit_1,
), ),
) Container(
], child: InkWell(
), onTap: () {
], if (model.medicalReportList[index].status ==
1) {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_DETAIL,
arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'medicalReport':
model.medicalReportList[index]
});
} else {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_INSERT,
arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD,
'medicalReport':
model.medicalReportList[index]
});
}
},
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(
model.medicalReportList[index].status ==
1
? EvaIcons.eye
: DoctorApp.edit_1,
),
],
),
),
)
],
),
],
),
), ),
), ),
), ),

@ -57,7 +57,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient.patientDetails?.firstName??''}'s", "${patient.firstName ?? patient.patientDetails != null ? patient.patientDetails.firstName : patient.fullName}'s",
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),

@ -202,7 +202,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient.patientDetails.firstName}'s", "${patient.firstName ?? patient.patientDetails != null ? patient.patientDetails.firstName : patient.fullName}'s",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

Loading…
Cancel
Save