Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into patients-new-design

merge-requests/377/head
mosazaid 4 years ago
commit 7117540a24

@ -10,7 +10,6 @@ import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
import 'dart:io' show Platform;
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers();
//ProjectProvider projectsProvider = new ProjectProvider();
@ -86,7 +85,7 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
String asd= json.encode(body);
if (await Helpers.checkConnection()) {
final response = await http.post(url,
body: json.encode(body),
@ -126,10 +125,10 @@ class BaseAppClient {
postPatient(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
@required PatiantInformtion patient,
bool isExternal = false}) async {
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
@required PatiantInformtion patient,
bool isExternal = false}) async {
String url = BASE_URL + endPoint;
try {
@ -138,65 +137,63 @@ class BaseAppClient {
'Accept': 'application/json'
};
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA_PATIENT_REQ
: PATIENT_OUT_SA_PATIENT_REQ;
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 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['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA_PATIENT_REQ
: 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'] != null
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: patient.patientType!= null
? patient.patientType
: PATIENT_TYPE
: PATIENT_TYPE;
: patient.patientType != null
? patient.patientType
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: patient.patientType!= null
? patient.patientType
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: patient.patientId?? patient.patientMRN;
: patient.patientType != null
? patient.patientType
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
body['PatientOutSA'] = 0;//user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe
body['TokenID'] = token;
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("Body : ${json.encode(body)}");

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

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

@ -304,17 +304,24 @@ class _PatientsScreenState extends State<PatientsScreen> {
//if (val2 == 7) {
responseModelList.sort((a, b) {
if (b.startTime != null && b.startTime != null) {
DateTime now = DateTime.now();
DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm");
String formattedDate =
DateFormat('yyyy-MM-dd ' + a.startTime).format(now);
DateTime dateTimeA = dateFormat.parse(formattedDate);
String formattedDateB =
DateFormat('yyyy-MM-dd ' + b.startTime).format(now);
DateTime dateTimeB = dateFormat.parse(formattedDateB);
var adate = dateTimeA; //a.startTime;
var bdate = dateTimeB;
return adate.compareTo(bdate);
try {
DateTime now = DateTime.now();
DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm");
String formattedDate =
DateFormat('yyyy-MM-dd ' + a.startTime).format(now);
DateTime dateTimeA = dateFormat.parse(formattedDate);
String formattedDateB =
DateFormat('yyyy-MM-dd ' + b.startTime).format(now);
DateTime dateTimeB = dateFormat.parse(formattedDateB);
var adate = dateTimeA; //a.startTime;
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 {
var adate = convertDateFormat(a.appointmentDate);
var bdate = convertDateFormat(b.appointmentDate);
@ -549,8 +556,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
.getFrom,
"to":
patient.getTo,
"isSearch": isSearch,
"arrivalType" :arrivalType,
"isSearch":
isSearch,
"arrivalType":
arrivalType,
});
},
);

@ -407,7 +407,9 @@ class PatientProfileScreen extends StatelessWidget {
if (patient.episodeNo == 0)
BorderedButton(
"${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,
vPadding: 8,
radius: 30,
@ -421,17 +423,21 @@ class PatientProfileScreen extends StatelessWidget {
height: 30,
),
handler: () async {
PostEpisodeReqModel postEpisodeReqModel =
PostEpisodeReqModel(
appointmentNo: patient.appointmentNo,
patientMRN: patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(context);
await model.postEpisode(postEpisodeReqModel);
GifLoaderDialogUtils.hideDialog(context);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(
CREATE_EPISODE,
arguments: {'patient': patient});
if (patient.patientStatusType == 43) {
PostEpisodeReqModel postEpisodeReqModel =
PostEpisodeReqModel(
appointmentNo:
patient.appointmentNo,
patientMRN: patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(context);
await model
.postEpisode(postEpisodeReqModel);
GifLoaderDialogUtils.hideDialog(context);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(
CREATE_EPISODE,
arguments: {'patient': patient});
}
},
),
if (patient.episodeNo != 0)

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

@ -79,7 +79,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
PatientProfileButton(
key: key,
patient: patient,
route: LAB_ORDERS,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
@ -104,7 +104,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_ADMISSION_REQUEST,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
@ -123,6 +123,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
PatientProfileButton(
key: key,
patient: patient,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
@ -159,7 +166,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
PatientProfileButton(
key: key,
patient: patient,
route: RADIOLOGY,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
@ -167,7 +174,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_INSURANCE_APPROVALS,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),

@ -45,7 +45,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
PatientProfileButton(
key: key,
patient: patient,
route: LAB_ORDERS,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
@ -69,14 +69,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
? PatientProfileButton(
key: key,
patient: patient,
route: ORDER_PRESCRIPTION,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png')
: PatientProfileButton(
key: key,
patient: patient,
route: ORDER_PRESCRIPTION_HISTORY,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),

Loading…
Cancel
Save