Merge branch 'text-form-field' into 'development'

lab-result-fixes

See merge request Cloud_Solution/doctor_app_flutter!696
prescription_form_update
Mohammad Aljammal 5 years ago
commit 65ed8f1842

@ -995,7 +995,7 @@ const Map<String, Map<String, String>> localizedValues = {
"historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ والاكتشاف المادي"}, "historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ والاكتشاف المادي"},
"laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المعامل والبيانات الفيزيائية"}, "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المعامل والبيانات الفيزيائية"},
"impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"},
"onHold": {"en": "'On Hold'", "ar": "قيد الانتظار"}, "onHold": {"en": "On Hold", "ar": "قيد الانتظار"},
"verified": {"en": "Verified", "ar": "Verified"}, "verified": {"en": "Verified", "ar": "تم التحقق"},
"endCall": {"en": "End Call", "ar": "انهاء"}, "endCall": {"en": "End Call", "ar": "انهاء"},
}; };

@ -14,6 +14,7 @@ class PatientMedicalReportService extends BaseService {
await getDoctorProfile(); await getDoctorProfile();
body['AdmissionNo'] = patient.admissionNo; body['AdmissionNo'] = patient.admissionNo;
body['SetupID'] = doctorProfile.setupID; body['SetupID'] = doctorProfile.setupID;
body['ProjectID'] = doctorProfile.projectID;
await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -128,6 +128,11 @@ class LabsViewModel extends BaseViewModel {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle);
}
}
void setLabResultDependOnFilterName(){
_labsService.labResultList.forEach((element) { _labsService.labResultList.forEach((element) {
List<LabResultList> patientLabOrdersClinic = labResultLists List<LabResultList> patientLabOrdersClinic = labResultLists
.where( .where(
@ -143,8 +148,6 @@ class LabsViewModel extends BaseViewModel {
.add(LabResultList(filterName: element.testCode, lab: element)); .add(LabResultList(filterName: element.testCode, lab: element));
} }
}); });
setState(ViewState.Idle);
}
} }
getPatientLabOrdersResults( getPatientLabOrdersResults(

@ -1,307 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
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/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class AdmissionRequestDetailScreen extends StatefulWidget {
@override
_AdmissionRequestDetailScreenState createState() =>
_AdmissionRequestDetailScreenState();
}
class _AdmissionRequestDetailScreenState
extends State<AdmissionRequestDetailScreen> {
DateTime selectedDate;
dynamic _selectedSpeciality;
dynamic _selectedDoctor;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<AdmissionRequestViewModel>(
onModelReady: (model) => model.getSpecialityList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null
? Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientPageHeaderWidget(patient),
Container(
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).patientDetails,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
"Pre Admission Number :01",
null,
false),
enabled: false,
// controller: _remarksController,
keyboardType: TextInputType.text,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).date,
selectedDate != null
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context)
.specialityAndDoctorDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.speciality,
attributeName:
projectViewModel.isArabic
? 'nameAr'
: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedSpeciality =
selectedValue;
});
});
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.speciality,
_selectedSpeciality != null
? projectViewModel.isArabic
? _selectedSpeciality[
'nameAr']
: _selectedSpeciality[
'nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText:
TranslationBase.of(context)
.doctorSearch,
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.doctor,
_selectedDoctor != null
? _selectedDoctor[
'DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
decoration: Helpers.containerBorderDecoration(
Color(0xFFEEEEEE), Color(0xFFCCCCCC),
borderWidth: 0.0),
child: InkWell(
onTap: () => null,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.referringDate,
null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Color(0xFFCCCCCC),
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.referringDoctor,
null,
true,
dropDownColor: Color(0xFFCCCCCC)),
enabled: false,
// controller: _remarksController,
keyboardType: TextInputType.text,
)),
],
),
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: () {
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_2,
arguments: {'patient': patient});
},
),
),
],
)
: Container(),
),
);
}
_selectDate(BuildContext context, AdmissionRequestViewModel model) async {
selectedDate = DateTime.now();
final DateTime picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime.now().add(Duration(hours: 2)),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != selectedDate) {
setState(() {
selectedDate = picked;
});
}
}
}

@ -453,20 +453,6 @@ class _AdmissionRequestThirdScreenState
); );
} }
Future _selectDate(BuildContext context, DateTime dateTime,
Function(DateTime picked) updateDate) async {
final DateTime picked = await showDatePicker(
context: context,
initialDate: dateTime,
firstDate: DateTime.now(),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != dateTime) {
updateDate(picked);
}
}
void openListDialogField(String attributeName, String attributeValueId, void openListDialogField(String attributeName, String attributeValueId,
List<dynamic> list, Function(dynamic selectedValue) okFunction) { List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(

@ -61,18 +61,17 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
...List.generate( LaboratoryResultWidget(
model.patientLabSpecialResult.length,
(index) => LaboratoryResultWidget(
onTap: () async {}, onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo, billNo: widget.patientLabOrders.invoiceNo,
details: model details: model
.patientLabSpecialResult[index].resultDataHTML, .patientLabSpecialResult.length > 0 ? model
.patientLabSpecialResult[0].resultDataHTML : null,
orderNo: widget.patientLabOrders.orderNo, orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders, patientLabOrder: widget.patientLabOrders,
patient: widget.patient, patient: widget.patient,
isInpatient: widget.patientType == "1", isInpatient: widget.patientType == "1",
)), ),
], ],
), ),
), ),

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; 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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/LabResultWidget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/LabResultWidget.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
@ -45,7 +46,8 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
// onModelReady: (model) => model.getPatientLabResult( onModelReady: (model) => model.setLabResultDependOnFilterName(),
// model.getPatientLabResult(
// patientLabOrder: widget.patientLabOrder, // patientLabOrder: widget.patientLabOrder,
// patient: widget.patient, // patient: widget.patient,
// isInpatient: widget.isInpatient), // isInpatient: widget.isInpatient),
@ -130,8 +132,11 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
model.labResultLists.length, model.labResultLists.length,
(index) => LabResultWidget( (index) => LabResultWidget(
patientLabOrder: widget.patientLabOrder, patientLabOrder: widget.patientLabOrder,
filterName: model.labResultLists[index].filterName, filterName: model
patientLabResultList: model.labResultLists[index].patientLabResultList, .labResultLists[index].filterName,
patientLabResultList: model
.labResultLists[index]
.patientLabResultList,
patient: widget.patient, patient: widget.patient,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
), ),
@ -143,8 +148,10 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
], ],
), ),
), ),
SizedBox(height: 15,), SizedBox(
if(widget.details!=null && widget.details.isNotEmpty) height: 15,
),
if (widget.details != null && widget.details.isNotEmpty)
Column( Column(
children: [ children: [
InkWell( InkWell(
@ -202,17 +209,24 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
duration: Duration(milliseconds: 7000), duration: Duration(milliseconds: 7000),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
child: Html( child: !Helpers.isTextHtml(widget.details)
data: widget.details ?? TranslationBase.of(context).noDataAvailable, ? AppText(
)), widget.details ??
TranslationBase.of(context)
.noDataAvailable,
)
: Html(
data: widget.details ??
TranslationBase.of(context)
.noDataAvailable,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
], ],
), ),
], ],
), ),
], ],

@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.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';
@ -94,7 +93,7 @@ class MedicalReportPage extends StatelessWidget {
model.medicalReportList.length, model.medicalReportList.length,
(index) => CardWithBgWidget( (index) => CardWithBgWidget(
hasBorder: false, hasBorder: false,
bgColor: model.medicalReportList[index].status == 0 bgColor: model.medicalReportList[index].status == 1
? Colors.red[700] ? Colors.red[700]
: Colors.green[700], : Colors.green[700],
widget: Column( widget: Column(
@ -106,10 +105,12 @@ class MedicalReportPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
model.medicalReportList[index].status == 0 model.medicalReportList[index].status == 1
? TranslationBase.of(context).onHold ? TranslationBase.of(context).onHold
: TranslationBase.of(context).verified, : TranslationBase.of(context).verified,
color: Colors.red, color: model.medicalReportList[index].status == 1
? Colors.red[700]
: Colors.green[700],
), ),
AppText( AppText(
"Jammal" ?? "", "Jammal" ?? "",
@ -123,13 +124,17 @@ class MedicalReportPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic)}', '${AppDateUtils.convertDateFromServerFormat(
model.medicalReportList[index].editedOn,
"dd/MM/yyyy")}',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
'${AppDateUtils.getHour(DateTime.now())}', '${AppDateUtils.convertDateFromServerFormat(
model.medicalReportList[index].editedOn,
"hh:mm a")}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.grey[700], color: Colors.grey[700],
fontSize: 14, fontSize: 14,
@ -154,7 +159,7 @@ class MedicalReportPage extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
if (model.medicalReportList[index].status == if (model.medicalReportList[index].status ==
0) { 1) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_INSERT, PATIENT_MEDICAL_REPORT_INSERT,
arguments: { arguments: {
@ -178,7 +183,7 @@ class MedicalReportPage extends StatelessWidget {
} }
}, },
child: Icon( child: Icon(
model.medicalReportList[index].status == 0 model.medicalReportList[index].status == 1
? EvaIcons.eye ? EvaIcons.eye
: DoctorApp.edit_1, : DoctorApp.edit_1,
), ),

@ -50,7 +50,7 @@ class Helpers {
color: Colors.green[600], color: Colors.green[600],
), ),
AppButton( AppButton(
onPressed: (){ onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
title: TranslationBase.of(context).cancel, title: TranslationBase.of(context).cancel,
@ -265,4 +265,9 @@ class Helpers {
return str; return str;
} }
} }
static bool isTextHtml(String text) {
var htmlRegex = RegExp("<(“[^”]*”|'[^]*|[^'”>])*>");
return htmlRegex.hasMatch(text);
}
} }

Loading…
Cancel
Save