Merge branches 'development' and 'headers_refactor' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into headers_refactor

merge-requests/737/head
Elham Rababah 5 years ago
commit 132565c298

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -158,11 +158,19 @@ class MyReferralPatientModel {
referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
referralStatus = json["ReferralStatus"] is String ?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0: json["ReferralStatus"];
referralStatus = json["ReferralStatus"] is String
? json['ReferralStatus'] == "Accepted"
? 46
: json['ReferralStatus'] == "Pending"
? 1
: 0
: json["ReferralStatus"];
try {
referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']);
} catch (e){
} catch (e) {
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
} finally {
referralDate = DateTime.now();
}
referringDoctorRemarks = json['ReferringDoctorRemarks'];
@ -258,6 +266,6 @@ class MyReferralPatientModel {
}
get patientName {
return this.firstName+" "+this.lastName;
return this.firstName + " " + this.lastName;
}
}

@ -25,12 +25,24 @@ class PatientMedicalReportViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
bool hasOnHold(){
bool hasHold = false;
medicalReportList.forEach((element) {
if(element.status == 1){
hasHold = true;
}
});
return hasHold;
}
Future getMedicalReportTemplate() async {
setState(ViewState.Busy);
setState(ViewState.BusyLocal);
await _service.getMedicalReportTemplate();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}

@ -166,8 +166,9 @@ class MyReferredPatientModel {
referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
createdOn = json['CreatedOn'];
referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus'];
referralDate = json['ReferralDate'];
referralDate = json['ReferralDate'] ?? createdOn;
referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];
@ -179,7 +180,6 @@ class MyReferredPatientModel {
appointmentDate = json['AppointmentDate'];
appointmentType = json['AppointmentType'];
patientMRN = json['PatientMRN'];
createdOn = json['CreatedOn'];
clinicID = json['ClinicID'];
nationalityID = json['NationalityID'];
age = json['Age'];

@ -6,6 +6,7 @@ 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/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -40,7 +41,9 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
? TranslationBase.of(context).medicalReportAdd
: TranslationBase.of(context).medicalReportVerify,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Column(
body: model.state == ViewState.BusyLocal
? AppLoaderWidget()
: Column(
children: [
Expanded(
child: Container(
@ -53,13 +56,19 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model.medicalReportTemplate.length > 0)
// if (model.medicalReportTemplate.length > 0)
HtmlRichEditor(
initialText: model
.medicalReportTemplate[0]
.templateTextHtml,
initialText: (medicalReport != null
? medicalReport.reportDataHtml
: model.medicalReportTemplate
.length > 0 ? model
.medicalReportTemplate[0] : ""),
hint: "Write the medical report ",
height:
MediaQuery.of(context).size.height *
MediaQuery
.of(context)
.size
.height *
0.75,
),
],

@ -7,6 +7,7 @@ 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/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
@ -17,7 +18,6 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
@ -75,6 +75,10 @@ class MedicalReportPage extends StatelessWidget {
),
AddNewOrder(
onTap: () {
if (model.hasOnHold()) {
Helpers.showErrorToast(
"Please Verified the on hold report to be able to add new one");
} else {
Navigator.of(context)
.pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: {
'patient': patient,
@ -82,6 +86,7 @@ class MedicalReportPage extends StatelessWidget {
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD
});
}
},
label: TranslationBase.of(context).createNewMedicalReport,
),
@ -92,7 +97,7 @@ class MedicalReportPage extends StatelessWidget {
onTap: () {
if (model.medicalReportList[index].status == 1) {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_DETAIL,
PATIENT_MEDICAL_REPORT_INSERT,
arguments: {
'patient': patient,
'patientType': patientType,
@ -101,7 +106,7 @@ class MedicalReportPage extends StatelessWidget {
});
} else {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_INSERT,
PATIENT_MEDICAL_REPORT_DETAIL,
arguments: {
'patient': patient,
'patientType': patientType,
@ -116,7 +121,7 @@ class MedicalReportPage extends StatelessWidget {
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.medicalReportList[index].status == 1
? Colors.red[700]
? Color(0xFFCC9B14)
: Colors.green[700],
widget: Column(
children: [
@ -134,7 +139,7 @@ class MedicalReportPage extends StatelessWidget {
color: model.medicalReportList[index]
.status ==
1
? Colors.red[700]
? Color(0xFFCC9B14)
: Colors.green[700],
fontSize: 1.4 * SizeConfig.textMultiplier,
bold: true,
@ -226,8 +231,8 @@ class MedicalReportPage extends StatelessWidget {
Icon(
model.medicalReportList[index].status ==
1
? EvaIcons.eye
: DoctorApp.edit_1,
? DoctorApp.edit_1
:EvaIcons.eye ,
),
],
),

@ -51,8 +51,8 @@ class _AddReplayOnReferralPatientState
void initState() {
requestPermissions();
super.initState();
replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks?? "";
replayOnReferralController.text =
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
}
@override
@ -60,10 +60,11 @@ class _AddReplayOnReferralPatientState
return AppScaffold(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Column(
body: Column(
children: [
Column(
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(title: 'Reply'),
@ -83,14 +84,15 @@ class _AddReplayOnReferralPatientState
maxLines: 35,
minLines: 25,
hasBorder: true,
validationError:
replayOnReferralController.text.isEmpty &&
validationError: replayOnReferralController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
),
Positioned(
top: 0, //MediaQuery.of(context).size.height * 0,
top: 0,
//MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
@ -111,16 +113,17 @@ class _AddReplayOnReferralPatientState
),
],
),
),
),
Container(
height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
// height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
// margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
replayOnReferralController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
child: Expanded(
margin: EdgeInsets.all(16),
child: AppButton(
title: TranslationBase.of(context).clearText,
onPressed: () {
@ -128,14 +131,27 @@ class _AddReplayOnReferralPatientState
replayOnReferralController.text = '';
});
},
)),
),
),
Container(
margin: EdgeInsets.all(5),
margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
child: Row(
children: [
Expanded(
child: AppButton(
onPressed: () {
Navigator.of(context).pop();
},
title: TranslationBase.of(context).reject,
fontColor: Colors.white,
color: Colors.red[600],
),
),
SizedBox(
width: 4,
),
Expanded(
child: AppButton(
title: 'Submit Reply',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
setState(() {
isSubmitted = true;
@ -166,18 +182,68 @@ class _AddReplayOnReferralPatientState
);
}
} else {
Helpers.showErrorToast("You can't add empty reply");
Helpers.showErrorToast(
"You can't add empty reply");
setState(() {
isSubmitted = false;
});
}
})),
},
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: Colors.green[600],
),
),
],
),
),
// Container(
// margin: EdgeInsets.all(5),
// child: AppButton(
// title: 'Submit Reply',
// color: Color(0xff359846),
// fontWeight: FontWeight.w700,
// onPressed: () async {
// setState(() {
// isSubmitted = true;
// });
// if (replayOnReferralController.text.isNotEmpty) {
// GifLoaderDialogUtils.showMyDialog(context);
// await widget.patientReferralViewModel.replay(
// replayOnReferralController.text.trim(),
// widget.myReferralInPatientModel);
// if (widget.patientReferralViewModel.state ==
// ViewState.ErrorLocal) {
// Helpers.showErrorToast(
// widget.patientReferralViewModel.error);
// } else {
// GifLoaderDialogUtils.hideDialog(context);
// DrAppToastMsg.showSuccesToast(
// "Your Reply Added Successfully");
// Navigator.of(context).pop();
// Navigator.of(context).pop();
//
// Navigator.push(
// context,
// FadePage(
// page: ReplySummeryOnReferralPatient(
// widget.myReferralInPatientModel,
// replayOnReferralController.text.trim()),
// ),
// );
// }
// } else {
// Helpers.showErrorToast("You can't add empty reply");
// setState(() {
// isSubmitted = false;
// });
// }
// })),
],
),
),
],
),
);
}

@ -27,7 +27,6 @@ class MyReferralInPatientScreen extends StatelessWidget {
appBarTitle: TranslationBase.of(context).referPatient,
body: Column(
children: [
Container(
margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget(
@ -62,12 +61,12 @@ class MyReferralInPatientScreen extends StatelessWidget {
],
),
)
: SingleChildScrollView(
: Expanded(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
model.myReferralPatients.length,
(index) => InkWell(
@ -106,6 +105,7 @@ class MyReferralInPatientScreen extends StatelessWidget {
),
),
),
),
],
),
),

@ -154,7 +154,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? Color(0xffc4aa54)
: referredPatient.referralStatus == 46
: referredPatient.referralStatus == 46 || referredPatient.referralStatus == 2
? Colors.green[700]
: Colors.red[700],
),
@ -548,10 +548,11 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
),
),
if (referredPatient.referralStatus == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: referredPatient.referredDoctorRemarks.isEmpty ? TranslationBase.of(context).replay : TranslationBase.of(context).edit,
title: TranslationBase.of(context).replay,
color: Colors.red[700],
fontColor: Colors.white,
fontWeight: FontWeight.w700,
@ -565,7 +566,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient,
isEdited: referredPatient.referredDoctorRemarks.isNotEmpty,
isEdited: referredPatient
.referredDoctorRemarks.isNotEmpty,
),
),
);

@ -58,7 +58,7 @@ class PatientReferralItemWidget extends StatelessWidget {
child: CardWithBgWidget(
bgColor: referralStatusCode == 1
? Color(0xffc4aa54)
: referralStatusCode == 46
: referralStatusCode == 46 || referralStatusCode == 2
? Colors.green[700]
: Colors.red[700],
hasBorder: false,
@ -78,7 +78,7 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.w700,
color: referralStatusCode == 1
? Color(0xffc4aa54)
: referralStatusCode == 46
: referralStatusCode == 46 || referralStatusCode == 2
? Colors.green[700]
: Colors.red[700],
),

Loading…
Cancel
Save