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

 Conflicts:
	lib/config/localized_values.dart
	lib/util/translations_delegate_base.dart
merge-requests/241/head
Elham Rababah 5 years ago
commit 7ce1d2dd55

@ -42,6 +42,8 @@ class BaseAppClient {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID;
if (body['DoctorID'] == "")
body['DoctorID'] = null;
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;

@ -519,14 +519,23 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "You make referral successfully",
'ar': "You make referral successfully"
},
'diagnoseType': {'en': "Diagnose Type", 'ar':"نوع التشخيص" },
'condition': {'en': "Condition", 'ar':"الحالة" },
'id': {'en': "ID", 'ar':"بطاقة هوية" },
'quantity': {'en': "Quantity", 'ar':"الكمية" },
'codeNo': {'en': "Code #", 'ar':"# الرمز" },
'covered': {'en': "Covered", 'ar':"مغطى" },
'approvalRequired': {'en': "Approval Required", 'ar':"الموافقة مطلوبة" },
'uncoveredByDoctor': {'en': "Uncovered By Doctor", 'ar':"غير مغطى من قبل الدكتور" },
'fromTime': {'en': "From Time", 'ar': "من وقت"},
'toTime': {'en': "To Time", 'ar': "الى وقت"},
'diagnoseType': {'en': "Diagnose Type", 'ar': "نوع التشخيص"},
'condition': {'en': "Condition", 'ar': "الحالة"},
'id': {'en': "ID", 'ar': "بطاقة هوية"},
'quantity': {'en': "Quantity", 'ar': "الكمية"},
'codeNo': {'en': "Code #", 'ar': "# الرمز"},
'covered': {'en': "Covered", 'ar': "مغطى"},
'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"},
'uncoveredByDoctor': {
'en': "Uncovered By Doctor",
'ar': "غير مغطى من قبل الدكتور"
},
'chiefComplaintEmptyMsg': {
'en': "There is no Chief Complaint",
'ar': "ليس هناك شكوى رئيس"
},
'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" },
'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" },
};

@ -1,5 +1,58 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class UcafService extends BaseService {
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
VitalSignData patientVitalSigns;
Future getPatientChiefComplaint(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
body['DoctorID'] = "";
await baseAppClient.post (GET_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPatientVitalSign(PatiantInformtion patient) async {
patientVitalSigns = null;
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) {
if(response['VitalSignsList'] != null){
if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error.toString();
},
body: body,
);
}
}

@ -11,43 +11,8 @@ class VitalSignsService extends BaseService{
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
VitalSignData patientVitalSigns;
/*Future getPatientVitalSign(patient) async {
hasError = false;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignList = [];
response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignList.add(new VitalSignResModel.fromJson(v));
});
if (patientVitalSignList.length > 0) {
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
patientVitalSignOrderdSubListTemp = patientVitalSignList;
patientVitalSignOrderdSubListTemp
.sort((VitalSignResModel a, VitalSignResModel b) {
return b.vitalSignDate.microsecondsSinceEpoch -
a.vitalSignDate.microsecondsSinceEpoch;
});
patientVitalSignOrderdSubList.clear();
int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
} // Vit*/
Future getPatientVitalSign(PatiantInformtion patient) async {
patientVitalSigns = null;
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;

@ -11,6 +11,8 @@ class PrescriptionService extends BaseService {
List<PrescriptionModel> get prescriptionList => _prescriptionList;
List<SearchDrugModel> _drugsList = List();
List<SearchDrugModel> get drugsList => _drugsList;
List<dynamic> doctorsList = [];
List<dynamic> specialityList = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(
patientMRN: 3120877,
@ -26,7 +28,8 @@ class PrescriptionService extends BaseService {
PostPrescriptionReqModel _postPrescriptionReqModel =
PostPrescriptionReqModel();
Future getPrescription() async {
Future getPrescription({int mrn}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: 3120877);
hasError = false;
_prescriptionList.clear();
await baseAppClient.post(GET_PRESCRIPTION_LIST,
@ -41,10 +44,11 @@ class PrescriptionService extends BaseService {
Future getDrugs() async {
hasError = false;
_drugsList.clear();
await baseAppClient.post(SEARCH_DRUG,
onSuccess: (dynamic response, int statusCode) {
_drugsList.add(SearchDrugModel.fromJson(response['MedicationList']));
doctorsList = [];
doctorsList = response['MedicationList']['entityList'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -1,9 +1,30 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import '../../locator.dart';
class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>();
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns;
Future getUCAFData(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _ucafService.getPatientVitalSign(patient);
await _ucafService.getPatientChiefComplaint(patient);
if (_ucafService.hasError) {
error = _ucafService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -12,13 +12,13 @@ class PrescriptionViewModel extends BaseViewModel {
List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList;
List<SearchDrugModel> get drugsList => _prescriptionService.drugsList;
List<dynamic> get drugsList => _prescriptionService.doctorsList;
Future getPrescription() async {
Future getPrescription({int mrn}) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
await _prescriptionService.getPrescription(mrn: mrn);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
@ -27,7 +27,7 @@ class PrescriptionViewModel extends BaseViewModel {
}
Future postPrescription(
PostPrescriptionReqModel postProcedureReqModel) async {
PostPrescriptionReqModel postProcedureReqModel, int mrn) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -36,13 +36,13 @@ class PrescriptionViewModel extends BaseViewModel {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
await getPrescription();
await getPrescription(mrn: mrn);
setState(ViewState.Idle);
}
}
Future updatePrescription(
PostPrescriptionReqModel updatePrescriptionReqModel) async {
PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -51,7 +51,7 @@ class PrescriptionViewModel extends BaseViewModel {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
await getPrescription();
await getPrescription(mrn: mrn);
setState(ViewState.Idle);
}
}

@ -99,6 +99,7 @@ class SickLeaveViewModel extends BaseViewModel {
Future addReschedule(request) async {
setState(ViewState.Busy);
await _sickLeaveService.addReschedule(request);
notifyListeners();
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);

@ -124,10 +124,12 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
'Doctor : '.toUpperCase(),
fontWeight: FontWeight.w700,
),
AppText(
model.medicalFileList[0].entityList[0]
.timelines[index].doctorName,
fontWeight: FontWeight.w700,
Expanded(
child: AppText(
model.medicalFileList[0].entityList[0]
.timelines[index].doctorName,
fontWeight: FontWeight.w700,
),
),
],
),

@ -466,25 +466,17 @@ class _PatientsScreenState extends State<PatientsScreen> {
height:
10.0,
),
Padding(
padding: EdgeInsets.symmetric(
vertical:
5.5,
horizontal:
22.5),
child:
AppText(
AppText(
item.firstName +
" " +
item.lastName,
" " +
item.lastName,
fontSize:
2.0 * SizeConfig.textMultiplier,
2.0 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
FontWeight.bold,
backGroundcolor:
Colors.white,
Colors.white,
),
),
],
),
Row(

@ -14,6 +14,7 @@ import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart';
import '../../../QR_reader_screen.dart';
class UCAFInputScreen extends StatefulWidget {
@override
@ -55,312 +56,338 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>(
onModelReady: (model) => model.getUCAFData(patient),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).ucaf,
body: SingleChildScrollView(
child: Column(
children: [
PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
body: model.patientVitalSigns != null &&
model.patientChiefComplaintList != null &&
model.patientChiefComplaintList.length > 0
? SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CheckboxListTile(
title: AppText(
TranslationBase.of(context).inPatient,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _inPatient,
onChanged: (newValue) {
setState(() {
_inPatient = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context).emergencyCase,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _emergencyCase,
onChanged: (newValue) {
setState(() {
_emergencyCase = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
PatientHeaderWidgetNoAvatar(patient),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).durationOfIllness,
null,
false),
enabled: true,
controller: _durationOfIllnessController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"BP (H/L)",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"120/80",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).temperature}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"37.5(C), 98.6(F)",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).pulseBeats} :",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CheckboxListTile(
title: AppText(
TranslationBase.of(context).inPatient,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
AppText(
"80",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
value: _inPatient,
onChanged: (newValue) {
setState(() {
_inPatient = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context).emergencyCase,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
],
),
],
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).chiefComplaintsAndSymptoms,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 8,
),
AppText(
TranslationBase.of(context)
.patientFeelsPainInHisBackAndCough,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).additionalTextComplaints,
null,
false),
enabled: true,
controller: _additionalComplaintsController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).otherConditions,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
...List.generate(
conditionsData.length,
(index) => CheckboxListTile(
title: AppText(
conditionsData[index]['name'],
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
value: _emergencyCase,
onChanged: (newValue) {
setState(() {
_emergencyCase = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.durationOfIllness,
null,
false),
enabled: true,
controller: _durationOfIllnessController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"BP (H/L)",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
value: conditionsData[index]['isChecked'],
onChanged: (newValue) {
setState(() {
conditionsData[index]['isChecked'] = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
)),
SizedBox(
height: 8,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).other,
null,
false),
enabled: true,
controller: _otherController,
keyboardType: TextInputType.text,
)),
SizedBox(
height: 8,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).how,
null,
false),
enabled: true,
controller: _howController,
keyboardType: TextInputType.text,
)),
SizedBox(
height: 8,
),
Row(
children: [
Expanded(
child: Container(
Row(
children: [
AppText(
"${TranslationBase.of(context).temperature}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.temperatureCelcius}(C), ${model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32}(F)",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).pulseBeats} :",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.pulseBeatPerMinute}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context)
.chiefComplaintsAndSymptoms,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 8,
),
AppText(
TranslationBase.of(context)
.patientFeelsPainInHisBackAndCough,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.additionalTextComplaints,
helpers.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint),
false),
enabled: false,
controller: _additionalComplaintsController,
keyboardType: TextInputType.text,
/*minLines: 4,
maxLines: 6,*/
)),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).otherConditions,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
...List.generate(
conditionsData.length,
(index) => CheckboxListTile(
title: AppText(
conditionsData[index]['name'],
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: conditionsData[index]['isChecked'],
onChanged: (newValue) {
setState(() {
conditionsData[index]['isChecked'] =
newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
)),
SizedBox(
height: 8,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).when,
TranslationBase.of(context).other,
null,
false),
enabled: true,
controller: _whenController,
controller: _otherController,
keyboardType: TextInputType.text,
)),
),
SizedBox(
width: 4,
),
Expanded(
child: Container(
SizedBox(
height: 8,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).where,
TranslationBase.of(context).how,
null,
false),
enabled: true,
controller: _whereController,
controller: _howController,
keyboardType: TextInputType.text,
)),
),
],
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).specifyPossibleLineManagement,
null,
false),
enabled: true,
controller: _managementsLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context)
.significantSigns,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).backAbdomen,
null,
false),
enabled: true,
controller: _signsController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 16,
),
AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {'patient': patient});
},
SizedBox(
height: 8,
),
Row(
children: [
Expanded(
child: Container(
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).when,
null,
false),
enabled: true,
controller: _whenController,
keyboardType: TextInputType.text,
)),
),
SizedBox(
width: 4,
),
Expanded(
child: Container(
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).where,
null,
false),
enabled: true,
controller: _whereController,
keyboardType: TextInputType.text,
)),
),
],
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.specifyPossibleLineManagement,
null,
false),
enabled: true,
controller: _managementsLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).significantSigns,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).backAbdomen,
null,
false),
enabled: true,
controller: _signsController,
keyboardType: TextInputType.text,
)),
SizedBox(
height: 16,
),
AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: () {
Navigator.of(context).pushNamed(
PATIENT_UCAF_DETAIL,
arguments: {'patient': patient});
},
),
],
),
),
],
),
)
: Container(
child: Center(
child: AppText(
model.patientVitalSigns == null
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
),
),
],
),
),
),
);
}

@ -124,7 +124,10 @@ class _AdmissionRequestDetailScreenState
ListSelectDialog dialog =
ListSelectDialog(
list: model.speciality,
attributeName: model.selectedLanguage == 'ar' ? 'nameAr' :'nameEn' ,
attributeName:
model.selectedLanguage == 'ar'
? 'nameAr'
: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
@ -149,7 +152,12 @@ class _AdmissionRequestDetailScreenState
TranslationBase.of(context)
.speciality,
_selectedSpeciality != null
? model.selectedLanguage == 'ar' ? _selectedSpeciality['nameAr'] : _selectedSpeciality['nameEn']
? model.selectedLanguage ==
'ar'
? _selectedSpeciality[
'nameAr']
: _selectedSpeciality[
'nameEn']
: null,
true),
enabled: false,
@ -163,36 +171,42 @@ class _AdmissionRequestDetailScreenState
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.doctorsList != null &&
model.doctorsList.length > 0
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
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),
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.doctor,
_selectedDoctor != null
? _selectedDoctor[
'DoctorName']
: null,
true),
enabled: false,
),
),
@ -202,23 +216,22 @@ class _AdmissionRequestDetailScreenState
),
Container(
height: screenSize.height * 0.070,
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
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),
)),
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.referringDate,
null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Color(0xFFCCCCCC),
)),
enabled: false,
),
),
@ -228,17 +241,19 @@ class _AdmissionRequestDetailScreenState
),
Container(
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
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)),
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.referringDoctor,
null,
true,
dropDownColor: Color(0xFFCCCCCC)),
enabled: false,
// controller: _remarksController,
keyboardType: TextInputType.text,
@ -255,8 +270,10 @@ class _AdmissionRequestDetailScreenState
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient});
onPressed: () {
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_2,
arguments: {'patient': patient});
},
),
),

@ -139,13 +139,13 @@ class _AdmissionRequestSecondScreenState
_emergencyAdmission = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.patientPregnant,
TranslationBase.of(context).patientPregnant,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
@ -155,28 +155,32 @@ class _AdmissionRequestSecondScreenState
_patientPregnant = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).treatmentLine,
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.treatmentLine,
null,
false),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -199,14 +203,17 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
/* _selectedWard != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
/* _selectedWard != null
? _selectedWard['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -224,13 +231,15 @@ class _AdmissionRequestSecondScreenState
_preAnesthesiaReferred = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -253,14 +262,18 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).admissionType,
/* _admissionType != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.admissionType,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -271,7 +284,8 @@ class _AdmissionRequestSecondScreenState
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -294,14 +308,18 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).diagnosis,
/* _admissionType != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.diagnosis,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -311,23 +329,26 @@ class _AdmissionRequestSecondScreenState
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).preOperativeOrders,
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.preOperativeOrders,
null,
false),
enabled: true,
controller: _preOperativeOrdersController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
enabled: true,
controller: _preOperativeOrdersController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -350,14 +371,18 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).allergies,
/* _admissionType != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.allergies,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -374,8 +399,10 @@ class _AdmissionRequestSecondScreenState
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient});
onPressed: () {
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_3,
arguments: {'patient': patient});
},
),
),

File diff suppressed because it is too large Load Diff

@ -33,452 +33,535 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescription(),
builder: (BuildContext context, PrescriptionViewModel model,
Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescription,
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
if (model.prescriptionList.length > 0)
Row(
children: [
AppText(
TranslationBase.of(context).age2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
onModelReady: (model) => model.getPrescription(mrn: patient.patientMRN),
builder:
(BuildContext context, PrescriptionViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescription,
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
if (model.prescriptionList.length != 0)
SizedBox(
height: model.prescriptionList[0].rowcount == 0
? 200.0
: 10.0),
//model.prescriptionList == null
if (model.prescriptionList.length != 0)
model.prescriptionList[0].rowcount == 0
? Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
addPrescriptionForm(context, model);
//model.postPrescription();
},
child: CircleAvatar(
radius: 65,
backgroundColor: Color(0XFFB8382C),
child: CircleAvatar(
radius: 60,
backgroundColor: Colors.white,
child: Icon(
Icons.add,
SizedBox(
width: 20,
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
patient.firstName +
' ' +
patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
//if (model.prescriptionList.length > 0)
Row(
children: [
AppText(
TranslationBase.of(context).age2,
color: Colors.black,
size: 45.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 5.0,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
),
SizedBox(
height: 15.0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context)
.noPrescriptionListed,
color: Colors.black,
fontWeight: FontWeight.w900,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).addNow,
color: Color(0XFFB8382C),
fontWeight: FontWeight.w900,
),
],
),
],
)
: Padding(
padding: EdgeInsets.all(14.0),
child: NetworkBaseView(
baseViewModel: model,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
InkWell(
child: Container(
height: 50.0,
width: 450.0,
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey),
borderRadius:
BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
' Add more medication',
fontWeight: FontWeight.w100,
fontSize: 12.5,
),
Icon(
Icons.add,
color: Color(0XFFB8382C),
)
],
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
(model.prescriptionList.length != 0)
? SizedBox(
height:
model.prescriptionList[0].rowcount == 0
? 200.0
: 10.0)
: SizedBox(height: 200.0),
//model.prescriptionList == null
(model.prescriptionList.length != 0)
? model.prescriptionList[0].rowcount == 0
? Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
addPrescriptionForm(
context, model, patient);
//model.postPrescription();
},
child: CircleAvatar(
radius: 65,
backgroundColor:
Color(0XFFB8382C),
child: CircleAvatar(
radius: 60,
backgroundColor: Colors.white,
child: Icon(
Icons.add,
color: Colors.black,
size: 45.0,
),
),
),
),
onTap: () {
addPrescriptionForm(context, model);
//model.postPrescription();
},
),
SizedBox(
height: 15.0,
),
...List.generate(
model.prescriptionList[0].rowcount,
(index) => Container(
//height: 240,
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
// crossAxisAlignment:
// CrossAxisAlignment.start,
children: [
Container(
height:
MediaQuery.of(context)
.size
.height *
0.23,
width:
MediaQuery.of(context)
.size
.width *
0.09,
child: Column(
children: [
AppText(
'8\nDEC',
color: Colors.green,
)
],
),
SizedBox(
height: 15.0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context)
.noPrescriptionListed,
color: Colors.black,
fontWeight: FontWeight.w900,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context)
.addNow,
color: Color(0XFFB8382C),
fontWeight: FontWeight.w900,
),
],
),
],
)
: Padding(
padding: EdgeInsets.all(14.0),
child: NetworkBaseView(
baseViewModel: model,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
InkWell(
child: Container(
height: 50.0,
width: 450.0,
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey),
borderRadius:
BorderRadius.circular(
10.0),
),
child: Padding(
padding:
EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
' Add more medication',
fontWeight:
FontWeight.w100,
fontSize: 12.5,
),
Icon(
Icons.add,
color:
Color(0XFFB8382C),
)
],
),
Container(
height:
MediaQuery.of(context)
.size
.height *
0.282,
width:
MediaQuery.of(context)
.size
.width *
0.77,
child: Column(
),
),
onTap: () {
addPrescriptionForm(
context, model, patient);
//model.postPrescription();
},
),
SizedBox(
height: 15.0,
),
...List.generate(
model.prescriptionList[0]
.rowcount,
(index) => Container(
//height: 240,
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
// crossAxisAlignment:
// CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
'Start Date:',
fontWeight:
FontWeight
.w700,
fontSize: 14.0,
),
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.startDate,
fontSize:
12.0,
Container(
height: MediaQuery.of(
context)
.size
.height *
0.23,
width: MediaQuery.of(
context)
.size
.width *
0.09,
child: Column(
children: [
AppText(
'8\nDEC',
color: Colors
.green,
)
],
),
),
Container(
height: MediaQuery.of(
context)
.size
.height *
0.282,
width: MediaQuery.of(
context)
.size
.width *
0.77,
child: Column(
children: [
Row(
children: [
AppText(
'Start Date:',
fontWeight:
FontWeight
.w700,
fontSize:
14.0,
),
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.startDate,
fontSize:
12.0,
),
),
SizedBox(
width:
6.0,
),
AppText(
'Order Type:',
fontWeight:
FontWeight
.w700,
fontSize:
14.0,
),
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.orderTypeDescription,
fontSize:
13.0,
),
),
],
),
),
SizedBox(
width: 6.0,
),
AppText(
'Order Type:',
fontWeight:
FontWeight
.w700,
fontSize: 14.0,
),
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.orderTypeDescription,
fontSize:
13.0,
SizedBox(
height: 5.5,
),
),
],
),
SizedBox(
height: 5.5,
),
Row(
children: [
Container(
child: Expanded(
child:
AppText(
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
fontWeight:
FontWeight
.w700,
fontSize:
15.0,
),
Row(
children: [
Container(
child:
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.medicationName,
fontWeight:
FontWeight.w700,
fontSize:
15.0,
),
),
)
],
),
)
],
),
SizedBox(
height: 5.5,
),
Row(
children: [
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.doseDetail,
fontSize:
15.0,
SizedBox(
height: 5.5,
),
)
],
),
SizedBox(
height: 3.0,
),
Row(
children: [
AppText(
'Indication: ',
fontWeight:
FontWeight
.w700,
fontSize: 17.0,
),
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.indication,
fontSize:
15.0),
)
],
),
SizedBox(
height: 18.0,
),
Row(
children: [
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.doctorName,
fontWeight:
FontWeight
.w700,
Row(
children: [
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.doseDetail,
fontSize:
15.0,
),
)
],
),
)
],
),
Row(
children: [
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.remarks,
fontSize:
14.0,
SizedBox(
height: 3.0,
),
Row(
children: [
AppText(
'Indication: ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child: AppText(
model
.prescriptionList[0]
.entityList[index]
.indication,
fontSize: 15.0),
)
],
),
SizedBox(
height: 18.0,
),
Row(
children: [
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.doctorName,
fontWeight:
FontWeight.w700,
),
)
],
),
Row(
children: [
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.remarks,
fontSize:
14.0,
),
),
],
),
SizedBox(
height: 10.0,
),
),
],
),
SizedBox(
height: 10.0,
),
Divider(
height: 0,
thickness: 1.0,
color: Colors.grey,
Divider(
height: 0,
thickness:
1.0,
color: Colors
.grey,
),
// SizedBox(
// height: 40,
// ),
],
),
),
// SizedBox(
// height: 40,
// ),
],
),
),
Container(
height:
MediaQuery.of(context)
.size
.height *
0.05,
width:
MediaQuery.of(context)
.size
.width *
0.06,
child: Column(
children: [
InkWell(
child: Icon(
Icons.edit),
onTap: () {
updatePrescriptionForm(
context,
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
model
.prescriptionList[
0]
.entityList[
index]
.medicineCode,
model,
);
//model.postPrescription();
},
Container(
height: MediaQuery.of(
context)
.size
.height *
0.05,
width: MediaQuery.of(
context)
.size
.width *
0.06,
child: Column(
children: [
InkWell(
child: Icon(
Icons
.edit),
onTap: () {
updatePrescriptionForm(
context,
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
model
.prescriptionList[
0]
.entityList[
index]
.medicineCode,
model,
);
//model.postPrescription();
},
),
],
),
),
],
),
),
],
],
),
),
],
),
],
),
),
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
addPrescriptionForm(
context, model, patient);
//model.postPrescription();
},
child: CircleAvatar(
radius: 65,
backgroundColor: Color(0XFFB8382C),
child: CircleAvatar(
radius: 60,
backgroundColor: Colors.white,
child: Icon(
Icons.add,
color: Colors.black,
size: 45.0,
),
),
),
],
),
),
)
],
),
SizedBox(
height: 15.0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context)
.noPrescriptionListed,
color: Colors.black,
fontWeight: FontWeight.w900,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).addNow,
color: Color(0XFFB8382C),
fontWeight: FontWeight.w900,
),
],
),
],
)
],
),
),
),
),
),
)),
)),
);
}
selectDate(BuildContext context, PrescriptionViewModel model) async {
DateTime selectedDate;
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;
});
}
}
void updatePrescriptionForm(
context, String drugName, int drugId, PrescriptionViewModel model) {
TextEditingController remarksController = TextEditingController();
@ -637,7 +720,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
updatePrescriptionReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure;
await model.updatePrescription(updatePrescriptionReqModel);
await model.updatePrescription(
updatePrescriptionReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);

@ -509,7 +509,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
baseViewModel: widget.model,
child: SingleChildScrollView(
child: Container(
height: 790,
height: 810,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
@ -566,7 +566,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
maxLines: 5,
),
SizedBox(
height: 80.0,
height: 50.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),

@ -299,7 +299,7 @@ class AddRescheduleLeavScreen extends StatelessWidget {
getDoctor(model, doctorId) {
var obj;
obj = model.where((i) => i['doctorID'].toString() == doctorId).toList();
print(obj);
//print(obj);
return obj.length > 0 ? obj[0]['doctorName'] : "";
}
@ -307,7 +307,7 @@ class AddRescheduleLeavScreen extends StatelessWidget {
getReasons(model, reasonID) {
var obj;
obj = model.where((i) => i['id'] == reasonID).toList();
print(obj);
//print(obj);
return obj.length > 0
? projectsProvider.isArabic == true

@ -24,6 +24,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
Helpers helpers = Helpers();
@ -49,13 +50,40 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var fromDate;
var toDate;
var clinicID;
var fromTime;
var toTime;
TextEditingController _controller4;
void _presentDatePicker(id) {
var date = new DateTime.now();
var initialDate = id == 'fromDate'
? new DateTime(date.year, date.month, date.day + 15)
: new DateTime(fromDate.year, fromDate.month, fromDate.day);
var firstDate = id == 'fromDate'
? new DateTime(date.year, date.month, date.day + 15)
: new DateTime(fromDate.year, fromDate.month, fromDate.day);
showDatePicker(
context: context,
initialDate: new DateTime(date.year, date.month, date.day + 15),
firstDate: new DateTime(date.year, date.month, date.day + 15),
initialDate: initialDate,
firstDate: firstDate,
lastDate: DateTime(2050),
).then((pickedDate) {
if (pickedDate == null) {
return;
}
setState(() {
final df = new DateFormat('yyyy-MM-dd');
fromDate = pickedDate; //df.format();
_toDateController.text = df.format(pickedDate);
toDate = pickedDate;
});
});
}
void _presentCurrentDate(id) {
showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime.now(),
lastDate: DateTime(2050),
).then((pickedDate) {
if (pickedDate == null) {
@ -328,7 +356,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
TextInputType.number,
controller: _toDateController,
onTap: () {
_presentDatePicker(
_presentCurrentDate(
'fromDate');
},
inputFormatter: ONLY_DATE,
@ -355,14 +383,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// new AppTextFormField(
// readOnly: true,
// hintText: "",
// borderColor: Colors.white,
// onSaved: (value) {},
// inputFormatter: ONLY_NUMBERS),
DateTimePicker(
timeHintText:
TranslationBase.of(
context)
.fromTime,
type:
DateTimePickerType.time,
controller: _controller4,
@ -373,6 +398,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
//locale: Locale('en', 'US'),
onChanged: (val) => () {
print(val);
this.fromTime = val;
},
validator: (val) {
print(val);
@ -403,16 +429,15 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
CrossAxisAlignment.start,
children: [
DateTimePicker(
timeHintText:
TranslationBase.of(
context)
.toTime,
type:
DateTimePickerType.time,
controller: _controller4,
//initialValue: _initialValue,
// icon: Icon(Icons.access_time),
//use24HourFormat: false,
//locale: Locale('en', 'US'),
onChanged: (val) => () {
print(val);
this.toTime = val;
},
validator: (val) {
print(val);
@ -761,7 +786,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"clinicId": this.profile['ClinicID'],
"doctorId": this.profile['DoctorID'],
"dateTimeFrom": df.format(fromDate),
"dateTimeTo": df.format(toDate),
"dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate),
"date": df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId":
@ -772,8 +797,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"weekDayId": 1,
"shiftId": 1,
"isOpen": true,
"timeFrom": null,
"timeTo": null,
"timeFrom": fromTime,
"timeTo": toTime,
"timeFromstr": "",
"timeTostr": ""
}
@ -784,7 +809,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model.addReschedule(request).then((response) {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated);
Navigator.pop(context);
model.getRescheduleLeave();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(),
// MyReferredPatient(),
),
);
});
}
@ -797,7 +828,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"clinicId": this.profile['ClinicID'],
"doctorId": this.profile['DoctorID'],
"dateTimeFrom": df.format(fromDate),
"dateTimeTo": df.format(toDate),
"dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate),
"date": df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId":
@ -808,8 +839,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"weekDayId": 1,
"shiftId": 1,
"isOpen": true,
"timeFrom": null,
"timeTo": null,
"timeFrom": fromTime,
"timeTo": toTime,
"timeFromstr": "",
"timeTostr": ""
}

@ -289,6 +289,10 @@ class TranslationBase {
String get toDate => localizedValues['toDate'][locale.languageCode];
String get fromTime => localizedValues['fromTime'][locale.languageCode];
String get toTime => localizedValues['toTime'][locale.languageCode];
String get searchPatientImageCaptionTitle =>
localizedValues['searchPatientImageCaptionTitle'][locale.languageCode];
@ -550,6 +554,7 @@ class TranslationBase {
String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode];
String get addAssessment => localizedValues['addAssessment'][locale.languageCode];
String get assessment => localizedValues['assessment'][locale.languageCode];
String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -94,7 +94,7 @@ class PatientProfileWidget extends StatelessWidget {
color: Color(0xffCCCCCC),
),
Container(
height: 10 * SizeConfig.textMultiplier,
height: 11 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
@ -232,14 +232,16 @@ class PatientProfileWidget extends StatelessWidget {
SizeConfig.textMultiplier,
),
),
AppText(
patient.admissionDate != null
? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}"
: "",
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize:
1.6 * SizeConfig.textMultiplier,
Expanded(
child: AppText(
patient.admissionDate != null
? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}"
: "",
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize:
1.6 * SizeConfig.textMultiplier,
),
),
],
),
@ -374,13 +376,15 @@ class PatientProfileWidget extends StatelessWidget {
SizedBox(
width: 4,
),
AppText(
"${patient.nursingStationName}\n${patient.roomId}",
fontWeight:
FontWeight.normal,
fontSize: 1.4 *
SizeConfig
.textMultiplier,
Expanded(
child: AppText(
"${patient.nursingStationName}\n${patient.roomId}",
fontWeight:
FontWeight.normal,
fontSize: 1.4 *
SizeConfig
.textMultiplier,
),
),
],
),

@ -505,6 +505,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
hintSearchText: 'Search Examination',
buttonName: 'Add Examination',
masterList: model.physicalExaminationList,
removeHistory: (history){
setState(() {

@ -66,10 +66,13 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
...widget.list
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId].toString(),
groupValue: widget.selectedValue[widget.attributeValueId]
.toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(),
selected: item[widget.attributeValueId].toString() ==
widget.selectedValue[widget.attributeValueId]
.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;

@ -503,7 +503,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.4"
version: "1.3.0-nullsafety.3"
mime:
dependency: transitive
description:
@ -760,7 +760,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.2"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
@ -895,5 +895,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta"
dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save