samll fixes for labels and msges

merge-requests/273/head
mosazaid 5 years ago
parent f5e2ce1f24
commit ac9fd8c936

@ -49,7 +49,7 @@ const Map<String, Map<String, String>> localizedValues = {
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'referPatient': {'en': 'Refer Patient', 'ar': 'إحالة مريض'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'},
'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'},
@ -666,4 +666,12 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "You have to add chief complaint fields correctly .", 'en': "You have to add chief complaint fields correctly .",
'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح"
}, },
'referralStatus': {
'en': "Referral Status : ",
'ar': "حالة الإحالة :"
},
'referralRemark': {
'en': "Referral Remark : ",
'ar': "ملاحظة الإحالة :"
},
}; };

@ -131,7 +131,7 @@ class PatientReferralViewModel extends BaseViewModel {
await _referralPatientService.responseReferral(pendingReferral, isAccepted); await _referralPatientService.responseReferral(pendingReferral, isAccepted);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -6,6 +6,7 @@ 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 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -13,7 +14,9 @@ class VitalSignsViewModel extends BaseViewModel {
VitalSignsService _vitalSignService = locator<VitalSignsService>(); VitalSignsService _vitalSignService = locator<VitalSignsService>();
VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns;
List<VitalSignHistory> get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory;
List<VitalSignHistory> get patientVitalSignsHistory =>
_vitalSignService.patientVitalSignsHistory;
String heightCm = "0"; String heightCm = "0";
String weightKg = "0"; String weightKg = "0";
@ -34,8 +37,16 @@ class VitalSignsViewModel extends BaseViewModel {
} }
} }
Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to) async { Future getPatientVitalSignHistory(
PatiantInformtion patient, String from, String to) async {
setState(ViewState.Busy); setState(ViewState.Busy);
if (from == null || from == "0") {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null || to == "0") {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
if (_vitalSignService.hasError) { if (_vitalSignService.hasError) {
error = _vitalSignService.error; error = _vitalSignService.error;
@ -48,9 +59,7 @@ class VitalSignsViewModel extends BaseViewModel {
if (weightKg == "0" || weightKg == null || weightKg == 'null') { if (weightKg == "0" || weightKg == null || weightKg == 'null') {
weightKg = element.weightKg.toString(); weightKg = element.weightKg.toString();
} }
if (bodyMax == "0" || if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') {
bodyMax == null ||
bodyMax == 'null') {
bodyMax = element.bodyMassIndex.toString(); bodyMax = element.bodyMassIndex.toString();
} }
if (temperatureCelcius == "0" || if (temperatureCelcius == "0" ||
@ -84,24 +93,24 @@ class VitalSignsViewModel extends BaseViewModel {
return "Normal"; return "Normal";
} else if (bodyMassIndex <= 30) { } else if (bodyMassIndex <= 30) {
return "Overweight"; return "Overweight";
} else { // > 30.0 } else {
// > 30.0
return "Obese"; return "Obese";
} }
} }
String getTempratureMethod(int temperatureCelciusMethod){ String getTempratureMethod(int temperatureCelciusMethod) {
// temperatureCelciusMethod ( vital sign response field )- master 2005 // temperatureCelciusMethod ( vital sign response field )- master 2005
if(temperatureCelciusMethod == 1){ if (temperatureCelciusMethod == 1) {
return "Oral"; return "Oral";
} else if(temperatureCelciusMethod == 2){ } else if (temperatureCelciusMethod == 2) {
return "Axilla"; return "Axilla";
} else if(temperatureCelciusMethod == 3){ } else if (temperatureCelciusMethod == 3) {
return "Rectal"; return "Rectal";
} else if(temperatureCelciusMethod == 4){ } else if (temperatureCelciusMethod == 4) {
return "Tympanic"; return "Tympanic";
} else if(temperatureCelciusMethod == 5){ } else if (temperatureCelciusMethod == 5) {
return "Temporal"; return "Temporal";
} }
} }
} }

@ -1,9 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
@ -144,8 +146,11 @@ class MyReferralDetailScreen extends StatelessWidget {
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: () { handler: () async {
model.responseReferral(pendingReferral, true); await model.responseReferral(pendingReferral, true);
if(model.state == ViewState.ErrorLocal){
DrAppToastMsg.showErrorToast(model.error);
}
}, },
), ),
), ),
@ -160,8 +165,11 @@ class MyReferralDetailScreen extends StatelessWidget {
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: () { handler: () async {
model.responseReferral(pendingReferral, false); await model.responseReferral(pendingReferral, true);
if(model.state == ViewState.ErrorLocal){
DrAppToastMsg.showErrorToast(model.error);
}
}, },
), ),
), ),

@ -1036,6 +1036,10 @@ class TranslationBase {
String get chiefComplaintErrorMsg => String get chiefComplaintErrorMsg =>
localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; localizedValues['chiefComplaintErrorMsg'][locale.languageCode];
String get referralStatus =>
localizedValues['referralStatus'][locale.languageCode];
String get referralRemark =>
localizedValues['referralRemark'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -37,25 +37,36 @@ class PatientReferralItemWidget extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Center( Center(
child: AppText( child: AppText(
"${patientName}", patientName != null ? "${patientName}" : "",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
), ),
if (referralStatus != null) if (referralStatus != null)
Container( Row(
color: Color(0xFF4BA821), children: [
padding: EdgeInsets.all(4), AppText(
child: AppText( TranslationBase.of(context).referralStatus,
referralStatus color: Colors.grey,
/*referralStatus == "46" fontWeight: FontWeight.bold,
? TranslationBase.of(context).approved fontSize: 12,
: TranslationBase.of(context).rejected*/, ),
color: Colors.white, Container(
fontWeight: FontWeight.bold, color: Color(0xFF4BA821),
fontSize: 12, padding: EdgeInsets.all(4),
), child: AppText(
referralStatus
/*referralStatus == "46"
? TranslationBase.of(context).approved
: TranslationBase.of(context).rejected*/
,
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -83,11 +94,26 @@ class PatientReferralItemWidget extends StatelessWidget {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
AppText( Row(
"${TranslationBase.of(context).dr} $referralDoctorName", crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.black, children: [
fontWeight: FontWeight.bold, AppText(
fontSize: 12, "${TranslationBase.of(context).referralDoctor} : ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
Expanded(
child: AppText(
referralDoctorName != null
? "${TranslationBase.of(context).dr} $referralDoctorName"
: "",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -112,11 +138,21 @@ class PatientReferralItemWidget extends StatelessWidget {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
AppText( Row(
remark, children: [
color: Colors.grey, AppText(
fontWeight: FontWeight.normal, TranslationBase.of(context).referralRemark,
fontSize: 12, color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
remark,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
],
), ),
SizedBox( SizedBox(
height: 16, height: 16,

Loading…
Cancel
Save