Merge branch 'sultan' into 'development'

bug fixes

See merge request Cloud_Solution/doctor_app_flutter!375
merge-requests/376/merge
Mohammad Aljammal 4 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),
@ -126,10 +125,10 @@ class BaseAppClient {
postPatient(String endPoint, postPatient(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
@required PatiantInformtion patient, @required PatiantInformtion patient,
bool isExternal = false}) async { bool isExternal = false}) async {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;
try { try {
@ -138,65 +137,63 @@ class BaseAppClient {
'Accept': 'application/json' 'Accept': 'application/json'
}; };
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: SETUP_ID : SETUP_ID
: SETUP_ID; : SETUP_ID;
} }
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS; body['VersionID'] = VERSION_ID;
body['generalid'] = GENERAL_ID; body['Channel'] = CHANNEL;
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['LanguageID'] = languageID == 'ar' ? 1 : 2;
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA_PATIENT_REQ
: PATIENT_OUT_SA_PATIENT_REQ;
if (body.containsKey('isDentalAllowedBackend')) { body['IPAdress'] = IP_ADDRESS;
body['isDentalAllowedBackend'] = body['generalid'] = GENERAL_ID;
body.containsKey('isDentalAllowedBackend') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['isDentalAllowedBackend'] != null ? body['PatientOutSA'] != null
? body['isDentalAllowedBackend'] ? body['PatientOutSA']
: IS_DENTAL_ALLOWED_BACKEND : PATIENT_OUT_SA_PATIENT_REQ
: IS_DENTAL_ALLOWED_BACKEND; : PATIENT_OUT_SA_PATIENT_REQ;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2; if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
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;
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;
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: patient.patientId?? patient.patientMRN;
body['PatientOutSA'] = 0;//user['OutSA']; //TODO change it body['TokenID'] = token;
body['SessionID'] = SESSION_ID; //getSe body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: patient.patientId ?? patient.patientMRN;
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
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,35 +478,32 @@ 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 == '4'))
// ? DynamicElements(
// _patientSearchFormValues,
// isFormSubmitted)
// : SizedBox(
// height: 0,
// ),
SizedBox(
height: 10,
), ),
(!(_selectedType == '2' ||
_selectedType == '4'))
? DynamicElements(
_patientSearchFormValues,
isFormSubmitted)
: SizedBox(
height: 0,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),

@ -304,17 +304,24 @@ 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) {
DateTime now = DateTime.now(); try {
DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); DateTime now = DateTime.now();
String formattedDate = DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm");
DateFormat('yyyy-MM-dd ' + a.startTime).format(now); String formattedDate =
DateTime dateTimeA = dateFormat.parse(formattedDate); DateFormat('yyyy-MM-dd ' + a.startTime).format(now);
String formattedDateB = DateTime dateTimeA = dateFormat.parse(formattedDate);
DateFormat('yyyy-MM-dd ' + b.startTime).format(now); String formattedDateB =
DateTime dateTimeB = dateFormat.parse(formattedDateB); DateFormat('yyyy-MM-dd ' + b.startTime).format(now);
var adate = dateTimeA; //a.startTime; DateTime dateTimeB = dateFormat.parse(formattedDateB);
var bdate = dateTimeB; var adate = dateTimeA; //a.startTime;
return adate.compareTo(bdate); var bdate = dateTimeB;
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 {
PostEpisodeReqModel postEpisodeReqModel = if (patient.patientStatusType == 43) {
PostEpisodeReqModel( PostEpisodeReqModel postEpisodeReqModel =
appointmentNo: patient.appointmentNo, PostEpisodeReqModel(
patientMRN: patient.patientMRN); appointmentNo:
GifLoaderDialogUtils.showMyDialog(context); patient.appointmentNo,
await model.postEpisode(postEpisodeReqModel); patientMRN: patient.patientMRN);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.showMyDialog(context);
patient.episodeNo = model.episodeID; await model
Navigator.of(context).pushNamed( .postEpisode(postEpisodeReqModel);
CREATE_EPISODE, GifLoaderDialogUtils.hideDialog(context);
arguments: {'patient': patient}); patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(
CREATE_EPISODE,
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
.toString(), .convertDateFromServerFormat(
'yyyy-MM-dd'), patientInfo
fontSize: .appointmentDate
1.5 * SizeConfig.textMultiplier, .toString(),
fontWeight: FontWeight.bold, 'yyyy-MM-dd'),
), fontSize: 1.5 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
)
: SizedBox(),
), ),
SizedBox( SizedBox(
height: 0.5, height: 0.5,

Loading…
Cancel
Save