Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into fix_refere_desgin

merge-requests/979/head
RoaaGhali98 4 years ago
commit 505c3f470f

@ -28,14 +28,14 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
// signingConfigs {
// release {
// storeFile file('C:\\Users\\admin\\Downloads\\DQKey.jks')
// storePassword 'HmGsa123'
// keyAlias 'key'
// keyPassword 'HmGsa123'
// }
// }
signingConfigs {
release {
storeFile file('/Users/nextwo/Desktop/Elham/keys/doctor app key')
storePassword 'Hmgdoctor1234'
keyAlias 'hmgdoctor'
keyPassword 'Hmgdoctor1234'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@ -59,7 +59,8 @@ android {
buildTypes {
release {
// TODO: Add your own signing config for the release build.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
debug {
// Signing with the debug keys for now, so `flutter run --release` works.

@ -672,8 +672,8 @@ const Map<String, Map<String, String>> localizedValues = {
"editedBy": {"en": "Edited By :", "ar": "عدلت من : "},
"currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"},
"noItem": {
"en": "No items exists in this list",
"ar": "لا توجد عناصر في هذه القائمة"
"en": "sorry, there is no items exists in this list",
"ar": "آسف ، لا توجد عناصر موجودة في هذه القائمة"
},
"postUcafSuccessMsg": {
"en": "UCAF request send successfully",

@ -71,7 +71,7 @@ class _DoctorReplyScreenState extends State<DoctorReplyScreen>
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
color: TabHelper.getBgTabColor(),
color: TabUtils.getBgTabColor(),
child: TabBar(
isScrollable: false,
controller: _tabController,
@ -135,8 +135,8 @@ Widget tabWidget(
return Center(
child: Container(
height: TabHelper.getTabHeight(context),
decoration: TabHelper.getBoxTabsBoxDecoration(
height: TabUtils.getTabHeight(context),
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: isActive,
isFirst: isFirst,
isMiddle: isMiddle,
@ -145,9 +145,9 @@ Widget tabWidget(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TabHelper.getTabText(title: title, isActive: isActive),
TabUtils.getTabText(title: title, isActive: isActive),
if (counter != -1)
TabHelper.getTabCounter(isActive: isActive, counter: counter)
TabUtils.getTabCounter(isActive: isActive, counter: counter)
],
),
),

@ -123,7 +123,7 @@ class _InPatientScreenState extends State<InPatientScreen>
color: Colors.white),
child: Container(
margin: EdgeInsets.only(top: 9),
color: TabHelper.getBgTabColor(),
color: TabUtils.getBgTabColor(),
child: TabBar(
isScrollable: false,
controller: _tabController,
@ -214,8 +214,8 @@ class _InPatientScreenState extends State<InPatientScreen>
return Center(
child: Container(
height: TabHelper.getTabHeight(context),
decoration: TabHelper.getBoxTabsBoxDecoration(
height: TabUtils.getTabHeight(context),
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: isActive,
isFirst: isFirst,
isMiddle: isMiddle,
@ -224,9 +224,9 @@ class _InPatientScreenState extends State<InPatientScreen>
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TabHelper.getTabText(title: title, isActive: isActive),
TabUtils.getTabText(title: title, isActive: isActive),
if (counter != -1)
TabHelper.getTabCounter(isActive: isActive, counter: counter)
TabUtils.getTabCounter(isActive: isActive, counter: counter)
],
),
),

@ -101,8 +101,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
children: [
Container(
// color: Colors.red,
height: TabHelper.getTabHeight(context),
color: TabHelper.getBgTabColor(),
height: TabUtils.getTabHeight(context),
color: TabUtils.getBgTabColor(),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
@ -137,7 +137,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TabHelper.getBoxTabsBoxDecoration(
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: _isActive,
isFirst: _times.indexOf(item) == 0,
isLast:
@ -149,12 +149,12 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TabHelper.getTabText(
TabUtils.getTabText(
title: item, isActive: _isActive),
_isActive &&
_activeLocation != 0 &&
model.state == ViewState.Idle
? TabHelper.getTabCounter(
? TabUtils.getTabCounter(
isActive: _isActive,
counter: model.filterData.length)
: Container(),

@ -1,574 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart';
class UcafDetailScreen extends StatefulWidget {
final PatiantInformtion patient;
final UcafViewModel model;
final Function changeLoadingState;
UcafDetailScreen(this.patient, this.model, {this.changeLoadingState});
@override
_UcafDetailScreenState createState() =>
_UcafDetailScreenState(this.patient, this.model);
}
class _UcafDetailScreenState extends State<UcafDetailScreen> {
final PatiantInformtion patient;
final UcafViewModel model;
UcafViewModel ucafModel;
int _activeTap = 0;
_UcafDetailScreenState(this.patient, this.model);
@override
void initState() {
model.saveUCAFOnTap = () async {
widget.changeLoadingState(true);
await ucafModel.postUCAF(patient);
widget.changeLoadingState(false);
if (ucafModel.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).postUcafSuccessMsg);
Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE;
});
} else {
DrAppToastMsg.showErrorToast(ucafModel.error);
}
};
super.initState();
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>(
onModelReady: (model) async {
ucafModel = model;
model.resetDataInFirst(firstPage: false);
await model.getLanguage();
await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
children: [
Expanded(
child: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column(
children: [
treatmentStepsBar(
context, model, screenSize, patient),
SizedBox(
height: 16,
),
...getSelectedTreatmentStepItem(
context, model),
],
),
),
],
),
),
),
),
],
),
));
}
Widget treatmentStepsBar(BuildContext _context, UcafViewModel model,
Size screenSize, PatiantInformtion patient) {
List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis.toUpperCase(),
TranslationBase.of(context).medications.toUpperCase(),
TranslationBase.of(context).procedures.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration: Utils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: __treatmentSteps.map((item) {
bool _isActive = __treatmentSteps[_activeTap] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: Utils.containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () async {
print(__treatmentSteps.indexOf(item));
if (__treatmentSteps.indexOf(item) == 0) {
widget.changeLoadingState(true);
await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
} else if (__treatmentSteps.indexOf(item) == 1) {
widget.changeLoadingState(true);
await model.getPrescription(patient);
widget.changeLoadingState(false);
}
if (__treatmentSteps.indexOf(item) == 2) {
widget.changeLoadingState(true);
await model.getOrderProcedures(patient);
widget.changeLoadingState(false);
}
setState(() {
_activeTap = __treatmentSteps.indexOf(item);
});
},
),
);
}).toList(),
),
);
}
List<Widget> getSelectedTreatmentStepItem(
BuildContext _context, UcafViewModel model) {
switch (_activeTap) {
case 0:
if (model.patientAssessmentList != null) {
return [
ListView.builder(
itemCount: model.patientAssessmentList.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return DiagnosisWidget(
model, model.patientAssessmentList[index]);
})
];
} else {
return [
Container(),
];
}
break;
case 1:
return [
ListView.builder(
itemCount: model.prescriptionList != null
? model.prescriptionList.entityList.length
: 0,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return MedicationWidget(
model, model.prescriptionList.entityList[index]);
})
];
break;
case 2:
if (model.orderProcedures != null) {
return [
ListView.builder(
itemCount: model.orderProcedures.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return ProceduresWidget(model, model.orderProcedures[index]);
})
];
} else {
return [
Container(),
];
}
break;
default:
return [
Container(),
];
}
}
}
class DiagnosisWidget extends StatelessWidget {
final UcafViewModel model;
final GetAssessmentResModel diagnosis;
DiagnosisWidget(this.model, this.diagnosis);
@override
Widget build(BuildContext context) {
MasterKeyModel diagnosisType = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisType,
id: diagnosis.diagnosisTypeID);
MasterKeyModel diagnosisCondition = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisCondition,
id: diagnosis.conditionID);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).diagnoseType}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
diagnosisType != null
? model.selectedLanguage == 'ar'
? diagnosisType.nameAr
: diagnosisType.nameEn
: "-",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
diagnosis.asciiDesc,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).condition}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).icd}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${diagnosis.icdCode10ID}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
],
);
}
}
class MedicationWidget extends StatelessWidget {
final UcafViewModel model;
final PrescriptionEntityModel prescription;
MedicationWidget(this.model, this.prescription);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).id}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${prescription.medicineCode}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
width: 16,
),
AppText(
"${TranslationBase.of(context).price}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${prescription.medicationPrice}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
width: 16,
),
AppText(
"${TranslationBase.of(context).quantity}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${prescription.quantity}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).durDays}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${prescription.doseDurationDays}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
"${prescription.medicationName}",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
"${prescription.doseDetail}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
],
);
}
}
class ProceduresWidget extends StatelessWidget {
final UcafViewModel model;
final OrderProcedure procedure;
ProceduresWidget(this.model, this.procedure);
@override
Widget build(BuildContext context) {
return Column(
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).codeNo}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
procedure.achiCode,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
AppText(
"${TranslationBase.of(context).quantity}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${procedure.lineItemNo}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
procedure.procedureName,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).covered}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${procedure.isCovered}",
fontWeight: FontWeight.normal,
color: procedure.isCovered ? AppGlobal.appGreenColor : Colors.red,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
width: 16,
),
AppText(
"${TranslationBase.of(context).approvalRequired}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${procedure.isApprovalRequired}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).uncoveredByDoctor}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${procedure.isUncoveredByDoctor}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
],
);
}
}

@ -1,393 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../../../widgets/shared/errors/error_message.dart';
class UCAFInputScreen extends StatefulWidget {
final PatiantInformtion patient;
final Function changeLoadingState;
UCAFInputScreen(this.patient, {this.changeLoadingState});
@override
_UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient);
}
class _UCAFInputScreenState extends State<UCAFInputScreen> {
final PatiantInformtion patient;
_UCAFInputScreenState(this.patient);
bool _inPatient = false;
bool _emergencyCase = false;
final _durationOfIllnessController = TextEditingController();
final _additionalComplaintsController = TextEditingController();
final _otherController = TextEditingController();
final _howController = TextEditingController();
final _whenController = TextEditingController();
final _whereController = TextEditingController();
final _managementsLineController = TextEditingController();
final _signsController = TextEditingController();
///TODO Elham* fix this
List<Map> conditionsData = [
{"name": "CHRONIC", "isChecked": false},
{"name": "RTA", "isChecked": false},
{"name": "PSYCHIATRIC", "isChecked": false},
{"name": "WORK RELATED", "isChecked": false},
{"name": "VACCINATION", "isChecked": false},
{"name": "CONGENITAL", "isChecked": false},
{"name": "INFERTILITY", "isChecked": false},
{"name": "CHECK-UP", "isChecked": false},
{"name": "PREGNANCY/INDICATE MP", "isChecked": false},
{"name": "CLEANING", "isChecked": false},
{"name": "ORTHO DONTICS", "isChecked": false},
{"name": "SPORTS RELATED", "isChecked": false},
{"name": "REGULAR DENTAL TREATMENT", "isChecked": false},
{"name": "IS TRAUMA TREATMENT SPECIFY ETA", "isChecked": false},
];
@override
Widget build(BuildContext context) {
return BaseView<UcafViewModel>(
onModelReady: (model) async {
model.resetDataInFirst();
await model.getUCAFData(patient);
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: model.patientVitalSignsHistory != null &&
model.patientVitalSignsHistory.length > 0 &&
model.patientChiefComplaintList != null &&
model.patientChiefComplaintList.length > 0
? Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.symmetric(
vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/*CheckboxListTile(
title: AppText(
TranslationBase.of(context).inPatient,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
),
value: _inPatient,
onChanged: (newValue) {
setState(() {
_inPatient = newValue;
});
},
activeColor: HexColor("#D02127"),
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context).emergencyCase,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
),
value: _emergencyCase,
onChanged: (newValue) {
setState(() {
_emergencyCase = newValue;
});
},
activeColor: HexColor("#D02127"),
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.durationOfIllness,
dropDownText: "3",
inputType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
),
SizedBox(
height: 16,
),*/
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(
DoctorApp.warning,
size: 20,
color: Color(0xFFCC9B14),
),
SizedBox(
width: 8,
),
AppText(
"BP (H/L)",
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
SizedBox(
width: 8,
),
AppText(
"${model.bloodPressure}",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
],
),
SizedBox(
width: 6,
),
Expanded(
child: Row(
children: [
AppText(
"${TranslationBase.of(context).temperature}",
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
SizedBox(
width: 4,
),
Expanded(
child: AppText(
"${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
),
],
),
),
],
),
SizedBox(
height: 2,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).pulseBeats}:",
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
SizedBox(
width: 4,
),
AppText(
"${model.hartRat}",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
],
),
],
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context)
.chiefComplaintsAndSymptoms,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
/* SizedBox(
height: 4,
),
AppText(
TranslationBase.of(context)
.patientFeelsPainInHisBackAndCough,
fontFamily: 'Poppins',
fontWeight: FontWeight.normal,
color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.8,
),*/
SizedBox(
height: 8,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).instruction,
dropDownText: Utils.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint),
controller: _additionalComplaintsController,
inputType: TextInputType.multiline,
enabled: false,
minLines: 1,
maxLines: 20,
),
/*SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).otherConditions,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
color: Color(0xFF2E303A),
),
...List.generate(
conditionsData.length,
(index) => CheckboxListTile(
title: AppText(
conditionsData[index]['name'],
fontWeight: FontWeight.normal,
fontSize:
SizeConfig.textMultiplier * 2.1,
fontFamily: 'Poppins',
),
value: conditionsData[index]
['isChecked'],
onChanged: (newValue) {
setState(() {
conditionsData[index]
['isChecked'] = newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
)),*/
SizedBox(
height: 8,
),
/* AppTextFieldCustom(
hintText: TranslationBase.of(context).other,
dropDownText: TranslationBase.of(context).none,
enabled: false,
),
SizedBox(
height: 8,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).how,
dropDownText: TranslationBase.of(context).none,
enabled: false,
),
SizedBox(
height: 8,
),
Row(
children: [
Expanded(
child: AppTextFieldCustom(
hintText:
TranslationBase.of(context).when,
dropDownText: TranslationBase.of(context).none,
enabled: false,
),
),
SizedBox(
width: 4,
),
Expanded(
child: AppTextFieldCustom(
hintText:
TranslationBase.of(context).where,
dropDownText: TranslationBase.of(context).none,
enabled: false,
),
),
],
),
SizedBox(
height: 8,
),
AppTextFieldCustom(
height: screenSize.height * 0.1,
hintText: TranslationBase.of(context)
.specifyPossibleLineManagement,
dropDownText: TranslationBase.of(context).none,
enabled: false,
minLines: 4,
maxLines: 6,
),
SizedBox(
height: 26,
),
AppText(
TranslationBase.of(context).significantSigns,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
),
SizedBox(
height: 8,
),
AppTextFieldCustom(
height: screenSize.height * 0.1,
hintText:
TranslationBase.of(context).backAbdomen,
dropDownText: "BackLNeck",
enabled: false,
),*/
],
),
),
],
),
),
),
],
)
: model.patientChiefComplaintList != null ||
model.patientVitalSignsHistory != null
? Center(
child: ErrorMessage(
error: model.patientVitalSignsHistory == null ||
model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg))
: Container(),
),
);
}
}

@ -0,0 +1,229 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/widgets/diagnosis_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/widgets/medication_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/widgets/pocedures_widget.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/tab_utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class UcafDetailScreen extends StatefulWidget {
final PatiantInformtion patient;
final UcafViewModel model;
final Function changeLoadingState;
UcafDetailScreen(this.patient, this.model, {this.changeLoadingState});
@override
_UcafDetailScreenState createState() =>
_UcafDetailScreenState(this.patient, this.model);
}
class _UcafDetailScreenState extends State<UcafDetailScreen> {
final PatiantInformtion patient;
final UcafViewModel model;
UcafViewModel ucafModel;
int _activeTap = 0;
_UcafDetailScreenState(this.patient, this.model);
@override
void initState() {
model.saveUCAFOnTap = () async {
widget.changeLoadingState(true);
await ucafModel.postUCAF(patient);
widget.changeLoadingState(false);
if (ucafModel.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).postUcafSuccessMsg);
Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE;
});
} else {
DrAppToastMsg.showErrorToast(ucafModel.error);
}
};
super.initState();
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>(
onModelReady: (model) async {
ucafModel = model;
model.resetDataInFirst(firstPage: false);
await model.getLanguage();
await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
children: [
Expanded(
child: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
treatmentStepsBar(
context, model, screenSize, patient),
Container(
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column(
children: [
SizedBox(
height: 16,
),
...getSelectedTreatmentStepItem(
context, model),
],
),
),
],
),
),
),
),
],
),
));
}
Widget treatmentStepsBar(BuildContext _context, UcafViewModel model,
Size screenSize, PatiantInformtion patient) {
ProjectViewModel projectViewModel= Provider.of(context);
List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis,
TranslationBase.of(context).medications,
TranslationBase.of(context).procedures,
];
return Container(
height: TabUtils.getTabHeight(context),
decoration: TabUtils.getBoxTabsBoxDecoration(projectViewModel: projectViewModel),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: __treatmentSteps.map((item) {
bool _isActive = __treatmentSteps[_activeTap] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TabUtils.getBoxTabsBoxDecoration(projectViewModel: projectViewModel, isActive:_isActive, isFirst:__treatmentSteps.indexOf(item) == 0, isLast: __treatmentSteps.indexOf(item) == 2, isMiddle: __treatmentSteps.indexOf(item) == 1 ),
child: Center(
child: TabUtils.getTabText(title: item, isActive: _isActive)
)),
),
onTap: () async {
print(__treatmentSteps.indexOf(item));
if (__treatmentSteps.indexOf(item) == 0) {
widget.changeLoadingState(true);
await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
} else if (__treatmentSteps.indexOf(item) == 1) {
widget.changeLoadingState(true);
await model.getPrescription(patient);
widget.changeLoadingState(false);
}
if (__treatmentSteps.indexOf(item) == 2) {
widget.changeLoadingState(true);
await model.getOrderProcedures(patient);
widget.changeLoadingState(false);
}
setState(() {
_activeTap = __treatmentSteps.indexOf(item);
});
},
),
);
}).toList(),
),
);
}
List<Widget> getSelectedTreatmentStepItem(
BuildContext _context, UcafViewModel model) {
switch (_activeTap) {
case 0:
if (model.patientAssessmentList != null) {
return [
ListView.builder(
itemCount: model.patientAssessmentList.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return DiagnosisWidget(
model, model.patientAssessmentList[index]);
})
];
} else {
return [
ErrorMessage(error: TranslationBase.of(context).noItem),
];
}
break;
case 1:
if (model.prescriptionList != null && model.prescriptionList.entityList != null && model.prescriptionList.entityList.isNotEmpty) {
return [
ListView.builder(
itemCount: model.prescriptionList != null
? model.prescriptionList.entityList.length
: 0,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return MedicationWidget(
model, model.prescriptionList.entityList[index]);
})
];} else {
return [
ErrorMessage(error: TranslationBase.of(context).noItem),
];
}
break;
case 2:
if (model.orderProcedures != null && model.orderProcedures.isNotEmpty) {
return [
ListView.builder(
itemCount: model.orderProcedures.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return ProceduresWidget(model, model.orderProcedures[index]);
})
];
} else {
return [
ErrorMessage(error: TranslationBase.of(context).noItem),
];
}
break;
default:
return [
Container(),
];
}
}
}

@ -0,0 +1,217 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.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/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../../../widgets/shared/errors/error_message.dart';
class UCAFInputScreen extends StatefulWidget {
final PatiantInformtion patient;
final Function changeLoadingState;
UCAFInputScreen(this.patient, {this.changeLoadingState});
@override
_UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient);
}
class _UCAFInputScreenState extends State<UCAFInputScreen> {
final PatiantInformtion patient;
_UCAFInputScreenState(this.patient);
bool _inPatient = false;
bool _emergencyCase = false;
final _durationOfIllnessController = TextEditingController();
final _additionalComplaintsController = TextEditingController();
final _otherController = TextEditingController();
final _howController = TextEditingController();
final _whenController = TextEditingController();
final _whereController = TextEditingController();
final _managementsLineController = TextEditingController();
final _signsController = TextEditingController();
///TODO Elham* fix this
List<Map> conditionsData = [
{"name": "CHRONIC", "isChecked": false},
{"name": "RTA", "isChecked": false},
{"name": "PSYCHIATRIC", "isChecked": false},
{"name": "WORK RELATED", "isChecked": false},
{"name": "VACCINATION", "isChecked": false},
{"name": "CONGENITAL", "isChecked": false},
{"name": "INFERTILITY", "isChecked": false},
{"name": "CHECK-UP", "isChecked": false},
{"name": "PREGNANCY/INDICATE MP", "isChecked": false},
{"name": "CLEANING", "isChecked": false},
{"name": "ORTHO DONTICS", "isChecked": false},
{"name": "SPORTS RELATED", "isChecked": false},
{"name": "REGULAR DENTAL TREATMENT", "isChecked": false},
{"name": "IS TRAUMA TREATMENT SPECIFY ETA", "isChecked": false},
];
@override
Widget build(BuildContext context) {
return BaseView<UcafViewModel>(
onModelReady: (model) async {
model.resetDataInFirst();
await model.getUCAFData(patient);
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: model.patientVitalSignsHistory != null &&
model.patientVitalSignsHistory.length > 0 &&
model.patientChiefComplaintList != null &&
model.patientChiefComplaintList.length > 0
? Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Center(
child: FractionallySizedBox(
widthFactor: .9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
DoctorApp.warning,
size: 20,
color: Color(0xFFCC9B14),
),
SizedBox(
width: 10,
),
AppText(
"BP (H/L)",
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
SizedBox(
width: 8,
),
AppText(
"${model.bloodPressure}",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).temperature}",
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
SizedBox(
width: 4,
),
Expanded(
child: AppText(
"${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
),
],
),
SizedBox(
height: 10,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).pulseBeats}:",
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
SizedBox(
width: 4,
),
AppText(
"${model.hartRat}",
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
],
),
SizedBox(
height: 20,
),
AppText(
Utils.convertToTitleCase(TranslationBase.of(context)
.chiefComplaintsAndSymptoms),
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).instruction,
dropDownText: Utils.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint + '\n'),
controller: _additionalComplaintsController,
inputType: TextInputType.multiline,
enabled: false,
minLines: 1,
maxLines: 20,
),
SizedBox(
height: 8,
),
],
),
),
),
),
),
],
)
: model.patientChiefComplaintList != null ||
model.patientVitalSignsHistory != null
? Center(
child: ErrorMessage(
error: model.patientVitalSignsHistory == null ||
model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg))
: Container(),
),
);
}
}

@ -1,19 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page_stepper_widget.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.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:flutter/material.dart';
import '../../../../routes.dart';
import 'UCAF-detail-screen.dart';
import 'UCAF-input-screen.dart';
import 'ucaf_detail_screen.dart';
import 'ucaf_input_screen.dart';
class UCAFPagerScreen extends StatefulWidget {
const UCAFPagerScreen({Key key}) : super(key: key);
@ -75,26 +74,10 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).ucaf}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
ServiceTitle(
title: "${TranslationBase.of(context).patient}",
subTitle: "${TranslationBase.of(context).ucaf}",
),
PageStepperWidget(
stepsCount: 2,
@ -133,17 +116,19 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
),
),
),
_isLoading
? Container(
height: 0,
)
: ucafButtons(model),
],
),
));
bottomSheet: _isLoading
? Container(
height: 0,
)
: UcafButtons(model),),);
}
Widget ucafButtons(UcafViewModel model) {
/// TODO Elham* Move to real widget
Widget UcafButtons(UcafViewModel model) {
switch (_currentIndex) {
case 0:
return Container(
@ -153,11 +138,6 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
color: Color(0xFFD02127),
onPressed: () {
changePageViewIndex(1);
// Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {
// 'patient': patient,
// 'patientType': patientType,
// 'arrivalType': arrivalType
// });
},
),
);

@ -0,0 +1,84 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/material.dart';
class DiagnosisWidget extends StatelessWidget {
final UcafViewModel model;
final GetAssessmentResModel diagnosis;
DiagnosisWidget(this.model, this.diagnosis);
@override
Widget build(BuildContext context) {
MasterKeyModel diagnosisType = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisType,
id: diagnosis.diagnosisTypeID);
MasterKeyModel diagnosisCondition = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisCondition,
id: diagnosis.conditionID);
return Column(
children: [
CardWithBgWidget(
bgColor: Colors.transparent,
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
label: "${TranslationBase.of(context).diagnoseType}: ",
value: diagnosisType != null
? model.selectedLanguage == 'ar'
? diagnosisType.nameAr
: diagnosisType.nameEn
: "-",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
height: 4,
),
CustomRow(
label: "",
value: diagnosis.asciiDesc,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
isExpanded: true,
),
SizedBox(
height: 4,
),
CustomRow(
label: "${TranslationBase.of(context).condition}: ",
value: "${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
height: 4,
),
CustomRow(
label: "${TranslationBase.of(context).icd}:",
value: "${diagnosis.icdCode10ID}",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
height: 16,
),
],
),
),
],
);
}
}

@ -0,0 +1,88 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/material.dart';
class MedicationWidget extends StatelessWidget {
final UcafViewModel model;
final PrescriptionEntityModel prescription;
MedicationWidget(this.model, this.prescription);
@override
Widget build(BuildContext context) {
return CardWithBgWidget(
bgColor: Colors.transparent,
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
CustomRow(
label: "${TranslationBase.of(context).id}: ",
value: "${prescription.medicineCode}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
width: 16,
),
CustomRow(
label: "${TranslationBase.of(context).price}: ",
value: "${prescription.medicationPrice}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
width: 16,
),
CustomRow(
label: "${TranslationBase.of(context).quantity}: ",
value: "${prescription.quantity}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
],
),
SizedBox(
height: 4,
),
CustomRow(
label: "${TranslationBase.of(context).durDays}: ",
value: "${prescription.doseDurationDays}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
height: 4,
),
CustomRow(
label: " ",
value: Utils.convertToTitleCase("${prescription.medicationName}"),
isExpanded: true,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
height: 4,
),
CustomRow(
label: " ",
value: Utils.convertToTitleCase("${prescription.doseDetail}"),
isExpanded: true,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
],
));
}
}

@ -0,0 +1,98 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/material.dart';
class ProceduresWidget extends StatelessWidget {
final UcafViewModel model;
final OrderProcedure procedure;
ProceduresWidget(this.model, this.procedure);
@override
Widget build(BuildContext context) {
return CardWithBgWidget(
bgColor: Colors.transparent,
widget: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomRow(
label: "${TranslationBase.of(context).codeNo}: ",
value: "${procedure.achiCode}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(width: 10,),
CustomRow(
label: "${TranslationBase.of(context).quantity}: ",
value: "${procedure.lineItemNo}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
],
),
SizedBox(
height: 4,
),
CustomRow(
label: "",
value: "${procedure.procedureName}",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomRow(
label: "${TranslationBase.of(context).covered}: ",
value: "${procedure.isCovered}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueColor: procedure.isCovered
? AppGlobal.appGreenColor
: AppGlobal.appRedColor,
),
CustomRow(
label: "${TranslationBase.of(context).approvalRequired}: ",
value: "${procedure.isApprovalRequired}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
),
],
),
SizedBox(
height: 4,
),
CustomRow(
label: "${TranslationBase.of(context).uncoveredByDoctor}: ",
value: "${procedure.isUncoveredByDoctor}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueColor: procedure.isCovered
? AppGlobal.appGreenColor
: AppGlobal.appRedColor,
),
SizedBox(
height: 16,
)
],
));
}
}

@ -58,8 +58,8 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
child: Center(
child: Container(
height: TabHelper.getTabHeight(context),
color: TabHelper.getBgTabColor(),
height: TabUtils.getTabHeight(context),
color: TabUtils.getBgTabColor(),
child: Center(
child: TabBar(
isScrollable: false,
@ -73,36 +73,36 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
decoration: TabHelper.getBoxTabsBoxDecoration(
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: index == 0,
isFirst: true,
projectViewModel: projectsProvider),
child: Center(
child: TabHelper.getTabText(
child: TabUtils.getTabText(
title: TranslationBase.of(context)
.myReferredPatient,
isActive: index == 0)),
),
Center(
child: Container(
decoration: TabHelper.getBoxTabsBoxDecoration(
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: index == 1,
isMiddle: true,
projectViewModel: projectsProvider),
child: Center(
child: TabHelper.getTabText(
child: TabUtils.getTabText(
title: TranslationBase.of(context).referral,
isActive: index == 1)),
),
),
Center(
child: Container(
decoration: TabHelper.getBoxTabsBoxDecoration(
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: index == 2,
isLast: true,
projectViewModel: projectsProvider),
child: Center(
child: TabHelper.getTabText(
child: TabUtils.getTabText(
title: TranslationBase.of(context).discharged,
isActive: index == 2),
),

@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page_stepper_widget.dart';
import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/register_patient/VerifyMethodPage.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';

@ -163,8 +163,8 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
return Center(
child: Container(
height: TabHelper.getTabHeight(context),
decoration: TabHelper.getBoxTabsBoxDecoration(
height: TabUtils.getTabHeight(context),
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: isActive,
isFirst: isFirst,
isMiddle: isMiddle,
@ -174,9 +174,9 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
mainAxisAlignment: MainAxisAlignment.center,
children: [
TabHelper.getTabText(title: title, isActive: isActive),
TabUtils.getTabText(title: title, isActive: isActive),
if (counter != -1)
TabHelper.getTabCounter(isActive: isActive, counter: counter)
TabUtils.getTabCounter(isActive: isActive, counter: counter)
],
),
),

@ -5,7 +5,7 @@ import '../config/size_config.dart';
import '../core/viewModel/project_view_model.dart';
import '../widgets/shared/app_texts_widget.dart';
class TabHelper {
class TabUtils {
static getBoxTabsBoxDecoration(
{bool isFirst = false,
@ -14,6 +14,7 @@ class TabHelper {
bool isActive = false,
double radius = 6.0,
ProjectViewModel projectViewModel}) {
return BoxDecoration(
color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA),
shape: BoxShape.rectangle,

@ -13,6 +13,8 @@ class CustomRow extends StatelessWidget {
this.width,
this.isCopyable = true,
this.isExpanded = true,
this.labelColor,
this.valueColor,
}) : super(key: key);
final String label;
@ -22,6 +24,8 @@ class CustomRow extends StatelessWidget {
final double width;
final bool isCopyable;
final bool isExpanded;
final Color labelColor;
final Color valueColor;
@override
Widget build(BuildContext context) {
@ -32,7 +36,7 @@ class CustomRow extends StatelessWidget {
label,
fontSize:
labelSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.7,
color: Color(0xFF575757),
color: labelColor ?? Color(0xFF575757),
fontWeight: FontWeight.w600,
letterSpacing: -0.4,
),
@ -45,7 +49,7 @@ class CustomRow extends StatelessWidget {
value,
fontSize:
valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
color: Color(0xFF2B353E),
color: valueColor ?? Color(0xFF2B353E),
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
isCopyable: isCopyable,

@ -770,13 +770,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
meta:
dependency: transitive
description:
@ -1180,7 +1173,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.3"
timing:
dependency: transitive
description:

Loading…
Cancel
Save