Conflicts:
	lib/util/translations_delegate_base.dart
merge-requests/279/head
Mohammad Aljammal 5 years ago
commit 6253e2c9a3

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

@ -681,4 +681,11 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "Patient Name", 'en': "Patient Name",
'ar': "اسم المريص" 'ar': "اسم المريص"
}, },
'icd': {'en': "ICD", 'ar': "التصنيف الدولي للأمراض"},
'days': {'en': "Days", 'ar': "أيام"},
'months': {'en': "Months", 'ar': "أشهر"},
'years': {'en': "Years", 'ar': "سنين"},
'hr': {'en': "HR", 'ar': "س"},
'min': {'en': "Min", 'ar': "د"}
// 'icd': {'en': "ICD", 'ar': " "}
}; };

@ -32,13 +32,14 @@ class PatientReferralService extends LookupService {
"Channel": 9, "Channel": 9,
"TokenID": "", "TokenID": "",
"SessionID": "i1UJwCTSqt", "SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true "IsLoginForDoctorApp": true,
// "MemberID": memberID
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(url, onSuccess: (response, statusCode) async { await baseAppClient.post(url, onSuccess: (response, statusCode) async {
if (response['MessageStatus'] == 1) { if (response['MessageStatus'] == 1) {
projectsList = response['ListProject']; projectsList = response['ProjectInfo'];
} else { } else {
// handel error // handel error
projectsList = ListProject; projectsList = ListProject;

@ -43,7 +43,7 @@ class VitalSignsService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo; // body['EpisodeID'] = patient.episodeNo;
body['PatientTypeID'] = 1; body['PatientTypeID'] = 1;
body['PatientType'] = 1; body['PatientType'] = 1;
body['DeviceTypeID'] = 1; body['DeviceTypeID'] = 1;

@ -94,8 +94,8 @@ class PatientReferralViewModel extends BaseViewModel {
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) { if (doctorProfile != null) {
dynamic _selectedBranch = { dynamic _selectedBranch = {
"ID": doctorProfile.projectID, "facilityId": doctorProfile.projectID,
"Desciption": doctorProfile.projectName "facilityName": doctorProfile.projectName
}; };
return _selectedBranch; return _selectedBranch;
} }

@ -616,7 +616,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
.white, .white,
), ),
AppText( AppText(
" ${DateUtils.getAgeByBirthday(item.dateofBirth)}", " ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}",
fontSize: 1.8 * fontSize: 1.8 *
SizeConfig SizeConfig

@ -284,7 +284,24 @@ class DiagnosisWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"${diagnosis.icdCode10ID} ${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", "${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, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),

@ -144,24 +144,31 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
], ],
), ),
Row( SizedBox(
children: [ width: 4,
AppText( ),
"${TranslationBase.of(context).temperature}", Expanded(
fontSize: SizeConfig.textMultiplier * 1.8, child: Row(
color: Colors.black, children: [
fontWeight: FontWeight.w700, AppText(
), "${TranslationBase.of(context).temperature}",
SizedBox( fontSize: SizeConfig.textMultiplier * 1.8,
width: 8, color: Colors.black,
), fontWeight: FontWeight.w700,
AppText( ),
"${model.patientVitalSigns.temperatureCelcius}(C), ${model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32}(F)", SizedBox(
fontSize: SizeConfig.textMultiplier * 2, width: 8,
color: Colors.grey.shade800, ),
fontWeight: FontWeight.normal, Expanded(
), child: AppText(
], "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
),
],
),
), ),
], ],
), ),

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -74,14 +75,14 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
if (model.state == ViewState.BusyLocal) /*if (model.state == ViewState.BusyLocal)
Container( Container(
color: Colors.white, color: Colors.white,
width: 50, width: 50,
height: 50, height: 50,
child: AppLoaderWidget( child: AppLoaderWidget(
containerColor: Colors.white, containerColor: Colors.white,
)), )),*/
Column( Column(
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
@ -95,17 +96,16 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0 model.patientReferral.length == 0
? ReferralForm(model, screenSize) ? ReferralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
patientName: model.patientReferral[0].patientName, patientName: model.patientReferral[0].patientName,
referralStatus: "${model.patientReferral[0].referralStatus}", referralStatus:
isReferredTo: true, "${model.patientReferral[0].referralStatus}",
isSameBranch: model.patientReferral[0] isReferredTo: true,
.isReferralDoctorSameBranch, isSameBranch: model
referralDoctorName: .patientReferral[0].isReferralDoctorSameBranch,
model.patientReferral[0].referredByDoctorInfo, referralDoctorName:
clinicDescription: null, model.patientReferral[0].referredByDoctorInfo,
remark: clinicDescription: null,
model.patientReferral[0].remarksFromSource remark: model.patientReferral[0].remarksFromSource),
),
], ],
), ),
if (model.patientReferral.length == 0) if (model.patientReferral.length == 0)
@ -124,7 +124,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
.makeReferral( .makeReferral(
patient, patient,
appointmentDate.toIso8601String(), appointmentDate.toIso8601String(),
_selectedBranch['ID'], _selectedBranch['facilityId'],
_selectedClinic['ClinicID'], _selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'], _selectedDoctor['DoctorID'],
_remarksController.text) _remarksController.text)
@ -180,7 +180,12 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.getDoctorBranch().then((value) { model.getDoctorBranch().then((value) {
_selectedBranch = value; _selectedBranch = value;
if (_referTo['id'] == 1) { if (_referTo['id'] == 1) {
model.getClinics(_selectedBranch['ID']); GifLoaderDialogUtils.showMyDialog(context);
model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
} }
}); });
}); });
@ -217,15 +222,19 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList, list: model.branchesList,
attributeName: 'Desciption', attributeName: 'facilityName',
attributeValueId: 'ID', attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedBranch = selectedValue; _selectedBranch = selectedValue;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
model.getClinics(_selectedBranch['ID']); GifLoaderDialogUtils.showMyDialog(context);
model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
}); });
}, },
); );
@ -242,7 +251,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).branch, TranslationBase.of(context).branch,
_selectedBranch != null _selectedBranch != null
? _selectedBranch['Desciption'] ? _selectedBranch['facilityName']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -268,8 +277,12 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
setState(() { setState(() {
_selectedDoctor = null; _selectedDoctor = null;
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
model.getClinicDoctors( GifLoaderDialogUtils.showMyDialog(context);
_selectedClinic['ClinicID'].toString()); model
.getClinicDoctors(
_selectedClinic['ClinicID'].toString())
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
}); });
}, },
); );

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -9,13 +10,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class VitalSignDetailsScreen extends StatelessWidget { class VitalSignDetailsScreen extends StatelessWidget {
int appointmentNo; int appointmentNo;
int projectID; int projectID;
bool isNotOneAppointment; bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true});
VitalSignDetailsScreen(
{this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -23,10 +26,11 @@ class VitalSignDetailsScreen extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String from = routeArgs['from']; String from = routeArgs['from'];
String to = routeArgs['to']; String to = routeArgs['to'];
String imageBasePath = 'assets/images/'; String imageBasePath = 'assets/images/';
return BaseView<VitalSignsViewModel>( return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to), onModelReady: (model) =>
model.getPatientVitalSignHistory(patient, from, to),
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: mode, baseViewModel: mode,
@ -38,16 +42,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () =>isNotOneAppointment? Navigator.push( onTap: () => isNotOneAppointment
context, ? Navigator.push(
FadePage( context,
page: VitalSignItemDetailsScreen( FadePage(
pageKey: vitalSignDetails.Height, page: VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).height, pageKey: vitalSignDetails.Height,
vitalList: mode.patientVitalSignsHistory, pageTitle:
), TranslationBase.of(context).height,
), vitalList: mode.patientVitalSignsHistory,
):null, ),
),
)
: null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).height, des: TranslationBase.of(context).height,
@ -58,16 +65,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
context, ? Navigator.push(
FadePage( context,
page: VitalSignItemDetailsScreen( FadePage(
pageKey: vitalSignDetails.Weight, page: VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).weight, pageKey: vitalSignDetails.Weight,
vitalList: mode.patientVitalSignsHistory, pageTitle:
), TranslationBase.of(context).weight,
), vitalList: mode.patientVitalSignsHistory,
):null, ),
),
)
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).weight, des: TranslationBase.of(context).weight,
imagePath: "${imageBasePath}vital_weight.png", imagePath: "${imageBasePath}vital_weight.png",
@ -80,17 +90,20 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
context, ? Navigator.push(
FadePage( context,
page: VitalSignItemDetailsScreen( FadePage(
pageKey: vitalSignDetails.BodyMeasurements, page: VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context) pageKey:
.bodyMeasurements, vitalSignDetails.BodyMeasurements,
vitalList: mode.patientVitalSignsHistory, pageTitle: TranslationBase.of(context)
), .bodyMeasurements,
), vitalList: mode.patientVitalSignsHistory,
): null, ),
),
)
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).body, des: TranslationBase.of(context).body,
imagePath: "${imageBasePath}vital_body_mass.png", imagePath: "${imageBasePath}vital_body_mass.png",
@ -99,21 +112,24 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
context, ? Navigator.push(
FadePage( context,
page: VitalSignItemDetailsScreen( FadePage(
pageKey: vitalSignDetails.Temperature, page: VitalSignItemDetailsScreen(
pageTitle: pageKey: vitalSignDetails.Temperature,
TranslationBase.of(context).temperature, pageTitle: TranslationBase.of(context)
vitalList: mode.patientVitalSignsHistory, .temperature,
), vitalList: mode.patientVitalSignsHistory,
), ),
):null, ),
)
: null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).temperature, des: TranslationBase.of(context).temperature,
imagePath: "${imageBasePath}vital_temperature.png", imagePath:
"${imageBasePath}vital_temperature.png",
lastVal: mode.temperatureCelcius, lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context).tempC, unit: TranslationBase.of(context).tempC,
), ),
@ -124,16 +140,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
context, ? Navigator.push(
FadePage( context,
page: VitalSignItemDetailsScreen( FadePage(
pageKey: vitalSignDetails.heart, page: VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).heart, pageKey: vitalSignDetails.heart,
vitalList: mode.patientVitalSignsHistory, pageTitle:
), TranslationBase.of(context).heart,
), vitalList: mode.patientVitalSignsHistory,
):null, ),
),
)
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).heart, des: TranslationBase.of(context).heart,
imagePath: "${imageBasePath}vital_heart_rate.png", imagePath: "${imageBasePath}vital_heart_rate.png",
@ -142,17 +161,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
context, ? Navigator.push(
FadePage( context,
page: VitalSignItemDetailsScreen( FadePage(
pageKey: vitalSignDetails.Respiration, page: VitalSignItemDetailsScreen(
pageTitle: pageKey: vitalSignDetails.Respiration,
TranslationBase.of(context).respirationRate, pageTitle: TranslationBase.of(context)
vitalList: mode.patientVitalSignsHistory, .respirationRate,
), vitalList: mode.patientVitalSignsHistory,
), ),
):null, ),
)
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).respirationRate, des: TranslationBase.of(context).respirationRate,
imagePath: "${imageBasePath}vital_respiration.png", imagePath: "${imageBasePath}vital_respiration.png",
@ -166,19 +187,23 @@ class VitalSignDetailsScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
context, ? Navigator.push(
FadePage( context,
page: VitalSignItemDetailsScreen( FadePage(
pageKey: vitalSignDetails.BloodPressure, page: VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).bloodPressure, pageKey: vitalSignDetails.BloodPressure,
vitalList: mode.patientVitalSignsHistory, pageTitle: TranslationBase.of(context)
), .bloodPressure,
), vitalList: mode.patientVitalSignsHistory,
):null, ),
),
)
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).bloodPressure, des: TranslationBase.of(context).bloodPressure,
imagePath: "${imageBasePath}vital_blood-pressure.png", imagePath:
"${imageBasePath}vital_blood-pressure.png",
lastVal: mode.bloodPressure, lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias, unit: TranslationBase.of(context).sysDias,
), ),
@ -189,7 +214,12 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
) )
: Center( : Center(
child: AppText('No Data'), child: AppText(
TranslationBase.of(context).vitalSignEmptyMsg,
fontWeight: FontWeight.normal,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
), ),
), ),
); );

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DateUtils { class DateUtils {
@ -32,7 +34,7 @@ class DateUtils {
return date; return date;
} }
static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate) { static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate, BuildContext context) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
// now = now.add(Duration(days: 400, minutes: 0)); // now = now.add(Duration(days: 400, minutes: 0));
var difference = firstDate.difference(now); var difference = firstDate.difference(now);
@ -49,12 +51,10 @@ class DateUtils {
final monthAgo = new DateTime(now.year, now.month - 1, firstDate.day); final monthAgo = new DateTime(now.year, now.month - 1, firstDate.day);
days = now.difference(monthAgo).inDays + 1; days = now.difference(monthAgo).inDays + 1;
} }
return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}";
return "$days Days, $months Months, $years Years";
} }
static String differenceBetweenDateAndCurrent(DateTime firstDate) { static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
// DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0)); // DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0));
var difference = now.difference(firstDate); var difference = now.difference(firstDate);
@ -67,10 +67,10 @@ class DateUtils {
double hoursInOneDay = difference.inHours / difference.inDays; double hoursInOneDay = difference.inHours / difference.inDays;
return "$days Days, $hours HR, $minutes Min"; return "$days ${TranslationBase.of(context).days}, $hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}";
} }
static String differenceBetweenServerDateAndCurrent(String str) { static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -81,7 +81,7 @@ class DateUtils {
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex))); int.parse(str.substring(startIndex + start.length, endIndex)));
return differenceBetweenDateAndCurrent(date); return differenceBetweenDateAndCurrent(date, context);
} }
/// get month by /// get month by
@ -217,7 +217,7 @@ class DateUtils {
} }
} }
static String getAgeByBirthday(dynamic birthday){ static String getAgeByBirthday(dynamic birthday, BuildContext context){
// https://leechy.dev/calculate-dates-diff-in-dart // https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday);
final now = DateTime.now(); final now = DateTime.now();
@ -232,7 +232,7 @@ class DateUtils {
final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day);
days = now.difference(monthAgo).inDays + 1; days = now.difference(monthAgo).inDays + 1;
} }
return "$years Yr $months Mnth $days Day"; return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}";
} }
} }

@ -1013,21 +1013,30 @@ class TranslationBase {
String get createdBy => localizedValues['createdBy'][locale.languageCode]; String get createdBy => localizedValues['createdBy'][locale.languageCode];
String get editedBy => localizedValues['editedBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode];
String get currentMedications => String get currentMedications =>
localizedValues['currentMedications'][locale.languageCode]; localizedValues['currentMedications'][locale.languageCode];
String get noItem => localizedValues['noItem'][locale.languageCode]; String get noItem => localizedValues['noItem'][locale.languageCode];
String get postUcafSuccessMsg => String get postUcafSuccessMsg =>
localizedValues['postUcafSuccessMsg'][locale.languageCode]; localizedValues['postUcafSuccessMsg'][locale.languageCode];
String get vitalSignDetailEmpty => String get vitalSignDetailEmpty =>
localizedValues['vitalSignDetailEmpty'][locale.languageCode]; localizedValues['vitalSignDetailEmpty'][locale.languageCode];
String get onlyOfftimeHoliday => String get onlyOfftimeHoliday =>
localizedValues['onlyOfftimeHoliday'][locale.languageCode]; localizedValues['onlyOfftimeHoliday'][locale.languageCode];
String get active => localizedValues['active'][locale.languageCode]; String get active => localizedValues['active'][locale.languageCode];
String get hold => localizedValues['hold'][locale.languageCode]; String get hold => localizedValues['hold'][locale.languageCode];
String get loading => localizedValues['loading'][locale.languageCode]; String get loading => localizedValues['loading'][locale.languageCode];
String get assessmentErrorMsg => String get assessmentErrorMsg =>
localizedValues['assessmentErrorMsg'][locale.languageCode]; localizedValues['assessmentErrorMsg'][locale.languageCode];
String get examinationErrorMsg => String get examinationErrorMsg =>
localizedValues['examinationErrorMsg'][locale.languageCode]; localizedValues['examinationErrorMsg'][locale.languageCode];
@ -1038,11 +1047,20 @@ class TranslationBase {
localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; localizedValues['chiefComplaintErrorMsg'][locale.languageCode];
String get ICDName => String get ICDName =>
localizedValues['ICDName'][locale.languageCode]; localizedValues['ICDName'][locale.languageCode];
String get referralStatus => String get referralStatus =>
localizedValues['referralStatus'][locale.languageCode]; localizedValues['referralStatus'][locale.languageCode];
String get referralRemark => String get referralRemark =>
localizedValues['referralRemark'][locale.languageCode]; localizedValues['referralRemark'][locale.languageCode];
String get icd => localizedValues['icd'][locale.languageCode];
String get days => localizedValues['days'][locale.languageCode];
String get hr => localizedValues['hr'][locale.languageCode];
String get min => localizedValues['min'][locale.languageCode];
String get months => localizedValues['months'][locale.languageCode];
String get years => localizedValues['years'][locale.languageCode];
String get patientName => String get patientName =>
localizedValues['patient-name'][locale.languageCode]; localizedValues['patient-name'][locale.languageCode];
} }

@ -340,14 +340,15 @@ class _LoginFormState extends State<LoginForm> {
projectIdController.text = projectsList[0]['facilityName']; projectIdController.text = projectsList[0]['facilityName'];
}); });
} else { } else {
print(res);
// handel error // handel error
setState(() { // setState(() {
projectsList = ListProject; // projectsList = ListProject;
}); // });
} }
}).catchError((err) { }).catchError((err) {
setState(() { setState(() {
projectsList = ListProject; print(err);
}); });
print(err); print(err);
}); });
@ -386,6 +387,6 @@ class _LoginFormState extends State<LoginForm> {
getProjectsList(value); getProjectsList(value);
} }
} }
_isInit = false; //_isInit = false;
} }
} }

@ -117,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget {
height: 4, height: 4,
), ),
AppText( AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}", "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
), ),
@ -297,7 +297,7 @@ class PatientProfileWidget extends StatelessWidget {
patient.createdOn != null patient.createdOn != null
? DateUtils ? DateUtils
.differenceBetweenServerDateAndCurrent( .differenceBetweenServerDateAndCurrent(
patient.createdOn) patient.createdOn, context)
: "", : "",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,

@ -47,8 +47,8 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
Widget continueButton = FlatButton( Widget continueButton = FlatButton(
child: Text(this.widget.okText), child: Text(this.widget.okText),
onPressed: () { onPressed: () {
this.widget.okFunction(widget.selectedValue);
Navigator.of(context).pop(); Navigator.of(context).pop();
this.widget.okFunction(widget.selectedValue);
}); });
// set up the AlertDialog // set up the AlertDialog
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(

Loading…
Cancel
Save