Merge branch 'sultan' into 'development'

bug fixes

See merge request Cloud_Solution/doctor_app_flutter!375
merge-requests/376/merge
Mohammad Aljammal 5 years ago
commit 906a3e8546

@ -10,7 +10,6 @@ import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'dart:io' show Platform; import 'dart:io' show Platform;
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
//ProjectProvider projectsProvider = new ProjectProvider(); //ProjectProvider projectsProvider = new ProjectProvider();
@ -86,7 +85,7 @@ class BaseAppClient {
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
String asd= json.encode(body);
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await http.post(url, final response = await http.post(url,
body: json.encode(body), body: json.encode(body),
@ -170,13 +169,12 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] != null
? body['PatientType'] ? body['PatientType']
: patient.patientType!= null : patient.patientType != null
? patient.patientType ? patient.patientType
: PATIENT_TYPE : PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
@ -184,7 +182,7 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: patient.patientType!= null : patient.patientType != null
? patient.patientType ? patient.patientType
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
@ -192,12 +190,11 @@ class BaseAppClient {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null
? body['PatientID'] ? body['PatientID']
: patient.patientId?? patient.patientMRN; : patient.patientId ?? patient.patientMRN;
body['PatientOutSA'] = 0;//user['OutSA']; //TODO change it body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");

@ -843,7 +843,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
model.dashboardItemsList[5] model.dashboardItemsList[6]
.kPIName, .kPIName,
fontSize: fontSize:
SizeConfig.textMultiplier * SizeConfig.textMultiplier *
@ -869,11 +869,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Axis.horizontal, Axis.horizontal,
children: new List.generate( children: new List.generate(
model model
.dashboardItemsList[5] .dashboardItemsList[6]
.summaryoptions .summaryoptions
.length, (int index) { .length, (int index) {
return getActivityButton(model return getActivityButton(model
.dashboardItemsList[5] .dashboardItemsList[6]
.summaryoptions[index]); .summaryoptions[index]);
}))) })))
], ],

@ -478,34 +478,31 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
// Container( Container(
// decoration: BoxDecoration( decoration: BoxDecoration(
// borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
// Radius.circular(6.0)), Radius.circular(6.0)),
// border: Border.all( border: Border.all(
// width: 1.0, width: 1.0,
// color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
// padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
// child: AppTextFormField( child: AppTextFormField(
// labelText: TranslationBase.of(context) labelText: TranslationBase.of(context)
// .patientFile, .patientFile,
// borderColor: Colors.white, borderColor: Colors.white,
// textInputType: TextInputType.number, textInputType: TextInputType.number,
// focusNode: _nodeText3, focusNode: _nodeText3,
// inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
// onSaved: (value) {}, onSaved: (value) {},
// ), ),
// ), ),
// (!(_selectedType == '2' || (!(_selectedType == '2' ||
// _selectedType == '4')) _selectedType == '4'))
// ? DynamicElements( ? DynamicElements(
// _patientSearchFormValues, _patientSearchFormValues,
// isFormSubmitted) isFormSubmitted)
// : SizedBox( : SizedBox(
// height: 0, height: 0,
// ),
SizedBox(
height: 10,
), ),
SizedBox( SizedBox(
height: 10, height: 10,

@ -304,6 +304,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
//if (val2 == 7) { //if (val2 == 7) {
responseModelList.sort((a, b) { responseModelList.sort((a, b) {
if (b.startTime != null && b.startTime != null) { if (b.startTime != null && b.startTime != null) {
try {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm");
String formattedDate = String formattedDate =
@ -315,6 +316,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
var adate = dateTimeA; //a.startTime; var adate = dateTimeA; //a.startTime;
var bdate = dateTimeB; var bdate = dateTimeB;
return adate.compareTo(bdate); return adate.compareTo(bdate);
} on Exception catch (_) {
print('never reached');
var adate = a.startTime; //a.startTime;
var bdate = b.startTime;
return adate.compareTo(bdate);
}
} else { } else {
var adate = convertDateFormat(a.appointmentDate); var adate = convertDateFormat(a.appointmentDate);
var bdate = convertDateFormat(b.appointmentDate); var bdate = convertDateFormat(b.appointmentDate);
@ -549,8 +556,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
.getFrom, .getFrom,
"to": "to":
patient.getTo, patient.getTo,
"isSearch": isSearch, "isSearch":
"arrivalType" :arrivalType, isSearch,
"arrivalType":
arrivalType,
}); });
}, },
); );

@ -405,7 +405,9 @@ class PatientProfileScreen extends StatelessWidget {
if (patient.episodeNo == 0) if (patient.episodeNo == 0)
BorderedButton( BorderedButton(
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
backgroundColor: Colors.red.shade700, backgroundColor: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
textColor: Colors.white, textColor: Colors.white,
vPadding: 8, vPadding: 8,
radius: 30, radius: 30,
@ -419,17 +421,21 @@ class PatientProfileScreen extends StatelessWidget {
height: 30, height: 30,
), ),
handler: () async { handler: () async {
if (patient.patientStatusType == 43) {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel postEpisodeReqModel =
PostEpisodeReqModel( PostEpisodeReqModel(
appointmentNo: patient.appointmentNo, appointmentNo:
patient.appointmentNo,
patientMRN: patient.patientMRN); patientMRN: patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.postEpisode(postEpisodeReqModel); await model
.postEpisode(postEpisodeReqModel);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
patient.episodeNo = model.episodeID; patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
CREATE_EPISODE, CREATE_EPISODE,
arguments: {'patient': patient}); arguments: {'patient': patient});
}
}, },
), ),
if (patient.episodeNo != 0) if (patient.episodeNo != 0)

@ -122,8 +122,9 @@ class PatientCard extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
patientInfo.nationalityName ?? patientInfo.nationalityName != null
patientInfo.nationality, ? patientInfo.nationalityName
: patientInfo.nationality,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
@ -253,15 +254,19 @@ class PatientCard extends StatelessWidget {
width: 3.5, width: 3.5,
), ),
Container( Container(
child: AppText( child: patientInfo.appointmentDate != null
DateUtils.convertDateFromServerFormat( ? AppText(
patientInfo.appointmentDate DateUtils
.convertDateFromServerFormat(
patientInfo
.appointmentDate
.toString(), .toString(),
'yyyy-MM-dd'), 'yyyy-MM-dd'),
fontSize: fontSize: 1.5 *
1.5 * SizeConfig.textMultiplier, SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), )
: SizedBox(),
), ),
SizedBox( SizedBox(
height: 0.5, height: 0.5,

Loading…
Cancel
Save