Merge branch 'hack_login' into 'development'

Hack login

See merge request Cloud_Solution/doctor_app_flutter!202
merge-requests/204/merge
Mohammad Aljammal 4 years ago
commit 4b959a256c

@ -36,20 +36,21 @@ class BaseAppClient {
}) async {
String url = BASE_URL + endPoint;
try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;
}
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
}
body['TokenID'] = token ?? '';
//TODO change it edit By Jammal
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// String token = await sharedPref.getString(TOKEN);
// if (profile != null) {
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
// if (body['DoctorID'] == null)
body['DoctorID'] = 4709;//doctorProfile?.doctorID;
body['EditedBy'] = 4709;//doctorProfile?.doctorID;
//if (body['ProjectID'] == null) {
body['ProjectID'] = 15;//doctorProfile?.projectID;
// }
// if (body['ClinicID'] == null)
body['ClinicID'] = 1;//doctorProfile?.clinicID;
// }
body['TokenID'] = "@dm!n";//token ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
@ -63,9 +64,10 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA;
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaRefreshTokenID'] =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaRefreshTokenID'] ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
print("URL : $url");
print("Body : ${json.encode(body)}");

@ -130,7 +130,10 @@ const POST_CHIEF_COMPLAINT =
const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE =
'/Services/DoctorApplication.svc/REST/PostProgressNote';
'Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT =
'Services/DoctorApplication.svc/REST/PostAssessment';
const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetCategories';

@ -9,7 +9,8 @@ enum MasterKeysService {
AllergySeverity,
physiotherapyGoals,
DiagnosisCondition,
DiagnosisType
DiagnosisType,
ICD10
}
extension SelectedMasterKeysService on MasterKeysService {
@ -48,6 +49,9 @@ extension SelectedMasterKeysService on MasterKeysService {
case MasterKeysService.DiagnosisType:
return 35;
break;
case MasterKeysService.ICD10:
return 2500;
break;
}
}
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
@ -86,4 +87,16 @@ class SOAPService extends LookupService {
super.error = error;
}, body: postProgressNoteRequestModel.toJson());
}
Future postAssessment(
PostAssessmentRequestModel postAssessmentRequestModel) async {
hasError = false;
await baseAppClient.post(POST_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postAssessmentRequestModel.toJson());
}
}

@ -33,6 +33,7 @@ class LookupService extends BaseService {
// List<MasterKeyModel> listOfPhysiotherapyGoals = [];
List<MasterKeyModel> listOfDiagnosisType = [];
List<MasterKeyModel> listOfDiagnosisCondition = [];
List<MasterKeyModel> listOfICD10 = [];
Future getMasterLookup(MasterKeysService masterKeys) async {
hasError = false;
@ -120,6 +121,13 @@ class LookupService extends BaseService {
.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.ICD10:
listOfICD10.clear();
entryList.forEach((v) {
listOfICD10
.add(MasterKeyModel.fromJson(v));
});
break;
}
}
}

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
@ -34,6 +35,7 @@ class SOAPViewModel extends BaseViewModel {
List<MasterKeyModel> get physicalExaminationList => _SOAPService.physicalExaminationList;
List<MasterKeyModel> get listOfDiagnosisType => _SOAPService.listOfDiagnosisType;
List<MasterKeyModel> get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition;
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
@ -107,5 +109,15 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAssessment(postAssessmentRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -101,7 +101,7 @@ class ProjectViewModel with ChangeNotifier {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: {});
}, body: Map());
return Future.value(localRes);
} catch (error) {
@ -111,18 +111,18 @@ class ProjectViewModel with ChangeNotifier {
}
void getProfile() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID,
clinicID: doctorProfile.clinicID,
license: true,
projectID: doctorProfile.projectID,
tokenID: '',
languageID: 2);
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
// ProfileReqModel docInfo = new ProfileReqModel(
// doctorID: doctorProfile.doctorID,
// clinicID: doctorProfile.clinicID,
// license: true,
// projectID: doctorProfile.projectID,
// tokenID: '',
// languageID: 2);
Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false)
.getDocProfiles(docInfo.toJson())
.getDocProfiles(ProfileReqModel().toJson())
.then((res) async {
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
}).catchError((err) {

@ -1,18 +1,18 @@
class MasterKeyModel {
String alias;
String aliasN;
int code;
Null description;
Null detail1;
Null detail2;
Null detail3;
Null detail4;
Null detail5;
dynamic code;
dynamic description;
dynamic detail1;
dynamic detail2;
dynamic detail3;
dynamic detail4;
dynamic detail5;
int groupID;
int id;
String nameAr;
String nameEn;
Null remarks;
dynamic remarks;
int typeId;
String valueList;

@ -0,0 +1,69 @@
class PostAssessmentRequestModel {
int patientMRN;
int appointmentNo;
int episodeId;
List<IcdCodeDetails> icdCodeDetails;
PostAssessmentRequestModel(
{this.patientMRN,
this.appointmentNo,
this.episodeId,
this.icdCodeDetails});
PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId'];
if (json['icdCodeDetails'] != null) {
icdCodeDetails = new List<IcdCodeDetails>();
json['icdCodeDetails'].forEach((v) {
icdCodeDetails.add(new IcdCodeDetails.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId;
if (this.icdCodeDetails != null) {
data['icdCodeDetails'] =
this.icdCodeDetails.map((v) => v.toJson()).toList();
}
return data;
}
}
class IcdCodeDetails {
String icdcode10Id;
int conditionId;
int diagnosisTypeId;
bool complexDiagnosis;
String remarks;
IcdCodeDetails(
{this.icdcode10Id,
this.conditionId,
this.diagnosisTypeId,
this.complexDiagnosis,
this.remarks});
IcdCodeDetails.fromJson(Map<String, dynamic> json) {
icdcode10Id = json['icdcode10Id'];
conditionId = json['conditionId'];
diagnosisTypeId = json['diagnosisTypeId'];
complexDiagnosis = json['complexDiagnosis'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['icdcode10Id'] = this.icdcode10Id;
data['conditionId'] = this.conditionId;
data['diagnosisTypeId'] = this.diagnosisTypeId;
data['complexDiagnosis'] = this.complexDiagnosis;
data['remarks'] = this.remarks;
return data;
}
}

@ -22,7 +22,7 @@ class RootPage extends StatelessWidget {
);
break;
case APP_STATUS.UNAUTHENTICATED:
return Loginsreen();
return LandingPage();
break;
case APP_STATUS.AUTHENTICATED:
return LandingPage();

@ -81,6 +81,7 @@ const String PATIENT_INSURANCE_APPROVALS =
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String CREATE_EPISODE = 'patients/create-episode';
const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data';
const String UPDATE_EPISODE = 'patients/create-episode';
const String BODY_MEASUREMENTS = 'patients/body-measurements';
const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
@ -91,6 +92,7 @@ const String ORDER_PROCEDURE = 'procedure/procedure';
// const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox';
const String PATIENT_SICKLEAVE = 'patients/patient_sickleave';
const String ADD_SICKLEAVE = 'add-sickleave';
//todo: change the routing way.
var routes = {
ROOT: (_) => RootPage(),
HOME: (_) => LandingPage(),
@ -125,6 +127,7 @@ var routes = {
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(),
CREATE_EPISODE: (_) => AddSOAPIndex(),
UPDATE_EPISODE: (_) => AddSOAPIndex(isUpdate: true,),
BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(),
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
// VIDEO_CALL: (_) => VideoCallPage(patientData: null),

@ -115,68 +115,69 @@ class _DashboardScreenState extends State<DashboardScreen> {
SizedBox(
height: 4,
),
InkWell(
onTap: () async {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider
.doctorClinicsList);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: AppText(
authProvider.selectedClinicName !=
null
? authProvider
.selectedClinicName
: authProvider.doctorProfile
.clinicDescription,
fontSize:
SizeConfig.textMultiplier *
1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
InkWell(
child: Container(
margin: EdgeInsets.only(
left: 5,
top: projectsProvider
.isArabic
? 0
: 5,
right: 10,
bottom: projectsProvider
.isArabic
? 15
: 7),
child: Icon(
DoctorApp.sync_icon,
color: Colors.white,
size: SizeConfig
.textMultiplier *
1.8,
)),
),
],
),
]),
),
//TODO change it edit By Jammal
// InkWell(
// onTap: () async {
// showCupertinoPicker(
// decKey: '',
// context: context,
// actionList: projectsProvider
// .doctorClinicsList);
// },
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Container(
// child: AppText(
// authProvider.selectedClinicName !=
// null
// ? authProvider
// .selectedClinicName
// : authProvider.doctorProfile
// .clinicDescription,
// fontSize:
// SizeConfig.textMultiplier *
// 1.7,
// color: Colors.white,
// textAlign: TextAlign.center,
// ),
// alignment: projectsProvider.isArabic
// ? Alignment.topRight
// : Alignment.topLeft,
// ),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// InkWell(
// child: Container(
// margin: EdgeInsets.only(
// left: 5,
// top: projectsProvider
// .isArabic
// ? 0
// : 5,
// right: 10,
// bottom: projectsProvider
// .isArabic
// ? 15
// : 7),
// child: Icon(
// DoctorApp.sync_icon,
// color: Colors.white,
// size: SizeConfig
// .textMultiplier *
// 1.8,
// )),
// ),
// ],
// ),
// ]),
// ),
],
),
]),

@ -23,6 +23,9 @@ import '../patient_profile_widget.dart';
import 'steps_widget.dart';
class AddSOAPIndex extends StatefulWidget {
final bool isUpdate;
const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key);
@override
_AddSOAPIndexState createState() => _AddSOAPIndexState();
}

@ -1,8 +1,11 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
@ -236,7 +239,7 @@ class _AssessmentPageState extends State<AssessmentPage> {
height: 6,
),
AppText(
"Some short remark about the allergy",
widget.mySelectedAssessment.remark,
fontSize: 10,
color: Colors.grey,
),
@ -268,7 +271,9 @@ class _AssessmentPageState extends State<AssessmentPage> {
Column(
children: [
InkWell(
onTap: () {},
onTap: () {
openAssessmentDialog(context);
},
child: Icon(EvaIcons
.edit2Outline),
)
@ -283,24 +288,55 @@ class _AssessmentPageState extends State<AssessmentPage> {
isExpand: isAssessmentExpand,
),
DividerWithSpacesAround(
height: 30,
),
AppButton(
title: TranslationBase
.of(context)
.next,
onPressed: () {
widget.changePageViewIndex(3);
},
),
SizedBox(
height: 30,
),
],
height: 30,
),
),
AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitAssessment(model);
},
),
SizedBox(
height: 30,
),
],
),
)));
),
),
)));
}
submitAssessment(SOAPViewModel model) async {
// if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
// widget.mySelectedAssessment.selectedDiagnosisType != null) {
// PostAssessmentRequestModel postAssessmentRequestModel =
// new PostAssessmentRequestModel(
// patientMRN: 3120690,
// episodeId: 200012117,
// appointmentNo: 2016054573,
// icdCodeDetails: [
// new IcdCodeDetails(
// remarks: widget.mySelectedAssessment.remark,
// complexDiagnosis: true,
// conditionId:
// widget.mySelectedAssessment.selectedDiagnosisCondition.id,
// diagnosisTypeId:
// widget.mySelectedAssessment.selectedDiagnosisType.id,
// icdcode10Id: "1")
// ]);
//
// await model.postAssessment(postAssessmentRequestModel);
//
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(3);
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
widget.changePageViewIndex(3);
}
openAssessmentDialog(BuildContext context) {
@ -334,14 +370,15 @@ class AddAssessmentDetails extends StatefulWidget {
}
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyModel _selectedDiagnosisCondition;
MasterKeyModel _selectedDiagnosisType;
// MasterKeyModel _selectedDiagnosisCondition;
// MasterKeyModel _selectedDiagnosisType;
TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController(
text: "234567");
@override
Widget build(BuildContext context) {
remarkController.text = widget.mySelectedAssessment.remark??"";
final screenSize = MediaQuery
.of(context)
.size;
@ -379,6 +416,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
if (model.listOfDiagnosisType.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisType);
}
if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10);
}
},
builder: (_, model, w) =>
AppScaffold(
@ -428,45 +468,48 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisCondition !=
null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase
.of(context)
.ok,
okFunction: (
MasterKeyModel selectedValue) {
setState(() {
_selectedDiagnosisCondition =
selectedValue;
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Condition",
_selectedDiagnosisCondition != null
? _selectedDiagnosisCondition
.nameEn
: null,
true),
enabled: false,
),
),
onTap: model.listOfICD10 != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
isICD: true,
list: model.listOfICD10,
selectedValue: widget
.mySelectedAssessment
.selectedICD,
okText: TranslationBase
.of(context)
.ok,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedICD =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Name / ICD",
widget.mySelectedAssessment
.selectedICD !=
null
? widget.mySelectedAssessment
.selectedICD.nameEn
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
@ -485,7 +528,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
okFunction: (
MasterKeyModel selectedValue) {
setState(() {
_selectedDiagnosisCondition =
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
});
},
@ -502,8 +546,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: TextField(
decoration: textFieldSelectorDecoration(
"Condition",
_selectedDiagnosisCondition != null
? _selectedDiagnosisCondition
widget.mySelectedAssessment
.selectedDiagnosisCondition != null
? widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn
: null,
true),
@ -527,11 +573,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
okFunction: (
MasterKeyModel selectedValue) {
setState(() {
_selectedDiagnosisType =
selectedValue;
// _selectedDiagnosisType =
// selectedValue;
widget.mySelectedAssessment
.selectedDiagnosisType =
_selectedDiagnosisType;
selectedValue;
});
},
);
@ -547,8 +593,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: TextField(
decoration: textFieldSelectorDecoration(
"Type",
_selectedDiagnosisType != null
? _selectedDiagnosisType.nameEn
widget.mySelectedAssessment
.selectedDiagnosisType != null
? widget.mySelectedAssessment
.selectedDiagnosisType.nameEn
: null,
true),
enabled: false,

@ -320,43 +320,47 @@ class _ObjectivePageState extends State<ObjectivePage> {
}
submitObjectivePage(SOAPViewModel model) async {
if(widget.mySelectedExamination.isNotEmpty){
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
// if(widget.mySelectedExamination.isNotEmpty){
// PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
// widget.mySelectedExamination.forEach((exam) {
// if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
// null)
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
//
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(
// ListHisProgNotePhysicalExaminationVM(
// patientMRN: 3120690,
// episodeId: 200012117,
// appointmentNo: 2016054573,
// remarks: exam.remark ?? '',
// createdBy: 1485,
// createdOn: DateTime.now().toIso8601String(),
// editedBy: 1485,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination.id,
// examType: exam.selectedExamination.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
// notExamined: false
//
// ));
// });
//
// await model.postPhysicalExam(postPhysicalExamRequestModel);
//
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(2);
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(
ListHisProgNotePhysicalExaminationVM(
patientMRN: 3120690,
episodeId: 200012117,
appointmentNo: 2016054573,
remarks: exam.remark ?? '',
createdBy: 1485,
createdOn: DateTime.now().toIso8601String(),
editedBy: 1485,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
masterDescription: exam.selectedExamination,
notExamined: false
));
});
await model.postPhysicalExam(postPhysicalExamRequestModel);
widget.changePageViewIndex(2);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
}
}
// TODO move it back to else stat when it work.
widget.changePageViewIndex(2);
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -70,10 +71,11 @@ class StepsWidget extends StatelessWidget {
SizedBox(
height: index == 0 ? 5 : 10,
),
Texts('SUBJECTIVE',
variant: "bodyText",
bold: true,
color: Colors.black),
AppText(
"SUBJECTIVE",
fontWeight: FontWeight.bold,
fontSize: 14,
),
],
),
),
@ -82,7 +84,7 @@ class StepsWidget extends StatelessWidget {
top: index == 1 ? 15 : 30,
left: MediaQuery.of(context).size.width * 0.28,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -119,10 +121,11 @@ class StepsWidget extends StatelessWidget {
SizedBox(
height: index == 1 ? 5 : 10,
),
Texts('OBJECTIVE',
variant: "bodyText",
bold: true,
color: Colors.black),
AppText(
"OBJECTIVE",
fontWeight: FontWeight.bold,
fontSize: 14,
),
],
),
),
@ -131,7 +134,10 @@ class StepsWidget extends StatelessWidget {
top: index == 2 ? 15 : 30,
left: MediaQuery.of(context).size.width * 0.52,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(3) : null,
onTap: () {
if(index >= 3)
changeCurrentTab(2);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -168,10 +174,11 @@ class StepsWidget extends StatelessWidget {
SizedBox(
height: index == 2 ? 5 : 10,
),
Texts('ASSESSMENT',
variant: "bodyText",
bold: true,
color: Colors.black),
AppText(
"ASSESSMENT",
fontWeight: FontWeight.bold,
fontSize: 14,
),
],
),
),
@ -212,15 +219,20 @@ class StepsWidget extends StatelessWidget {
? Colors.white
: Colors.grey,
),
),
)
),
SizedBox(
height: index == 3 ? 5 : 10,
),
Texts('PLAN',
variant: "bodyText",
bold: true,
color: Colors.black),
Container(
margin: EdgeInsets.only(left: index == 3? 15:0),
child: AppText(
"PLAN",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 14,
),
),
],
),
),
@ -274,18 +286,19 @@ class StepsWidget extends StatelessWidget {
color: index == 0
? Colors.black
: index > 0
? Colors.white
: Colors.grey,
? Colors.white
: Colors.grey,
),
),
),
SizedBox(
height: index == 0 ? 5 : 10,
),
Texts('SUBJECTIVE',
variant: "bodyText",
bold: true,
color: Colors.black),
AppText(
"SUBJECTIVE",
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
),
@ -331,10 +344,11 @@ class StepsWidget extends StatelessWidget {
SizedBox(
height: index == 1 ? 5 : 10,
),
Texts('OBJECTIVE',
variant: "bodyText",
bold: true,
color: Colors.black),
AppText(
"OBJECTIVE",
fontWeight: FontWeight.bold,
fontSize: 14,
),
],
),
),
@ -343,7 +357,7 @@ class StepsWidget extends StatelessWidget {
top: index == 2 ? 15 : 30,
right: MediaQuery.of(context).size.width * 0.52,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(3) : null,
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -383,10 +397,11 @@ class StepsWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(right: 2),
child: Texts('ASSESSMENT',
variant: "bodyText",
bold: true,
color: Colors.black),
child: AppText(
"ASSESSMENT",
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
],
),
@ -433,10 +448,14 @@ class StepsWidget extends StatelessWidget {
SizedBox(
height: index == 3 ? 5 : 10,
),
Texts('PLAN',
variant: "bodyText",
bold: true,
color: Colors.black),
Container(
margin: EdgeInsets.only(right:index == 3? 15:0),
child: AppText(
"PLAN",
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
],
),
),

@ -168,11 +168,6 @@ class _SubjectivePageState extends State<SubjectivePage> {
variant: isHistoryExpand ? "bodyText" : '',
bold: isHistoryExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
@ -214,11 +209,6 @@ class _SubjectivePageState extends State<SubjectivePage> {
variant: isAllergiesExpand ? "bodyText" : '',
bold: isAllergiesExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
@ -277,13 +267,48 @@ class _SubjectivePageState extends State<SubjectivePage> {
{SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MasterKeyModel> myHistoryList}) async {
await postChiefComplaint(model: model);
if (myHistoryList.length != 0)
await postHistories(model: model, myHistoryList: myHistoryList);
if (myAllergiesList.length != 0)
await postAllergy(myAllergiesList: myAllergiesList, model: model);
formKey.currentState.save();
formKey.currentState.validate();
widget.changePageViewIndex(1);
// if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) {
// await postChiefComplaint(model: model);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// if (myHistoryList.length != 0) {
// await postHistories(model: model, myHistoryList: myHistoryList);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// if (myAllergiesList.length != 0) {
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(1);
// }
// }
//
// }
// } else {
// if (myAllergiesList.length != 0) {
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(1);
// }
// } else {
// widget.changePageViewIndex(1);
// }
// }
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
}
postAllergy(
@ -362,9 +387,6 @@ class _SubjectivePageState extends State<SubjectivePage> {
await model.postChiefComplaint(postChiefComplaintRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}
}
}

@ -43,7 +43,8 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
'Dr. ${authProvider.doctorProfile.doctorName}',
//TODO change it edit By Jammal
'Dr. ',//${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white,
@ -71,7 +72,9 @@ final double height;
height: 50,
width: 60,
child: Image.network(
authProvider.doctorProfile.doctorImageURL,
//TODO change it edit By Jammal
'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg'
// authProvider.doctorProfile.doctorImageURL,
// fit: BoxFit.fill,
),
),

@ -18,6 +18,7 @@ import 'PatientProfileButton.dart';
*@desc: Profile Medical Info Widget
*/
class ProfileMedicalInfoWidget extends StatelessWidget {
ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key);
PatiantInformtion patient;
@override
@ -35,6 +36,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine2: "Episode",
route: CREATE_EPISODE,
icon: 'heartbeat.png'),
PatientProfileButton(
key: key,
patient: patient,
nameLine1: "Update",
nameLine2: "Episode",
route: CREATE_EPISODE,
icon: 'heartbeat.png'),
PatientProfileButton(
key: key,
patient: patient,

@ -2,16 +2,20 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class MasterKeyDailog extends StatefulWidget {
final List<MasterKeyModel> list;
final okText;
final Function(MasterKeyModel) okFunction;
MasterKeyModel selectedValue;
final bool isICD;
MasterKeyDailog(
{@required this.list,
@required this.okText,
@required this.okFunction});
@required this.okFunction,
this.selectedValue,
this.isICD = false});
@override
_MasterKeyDailogState createState() => _MasterKeyDailogState();
@ -62,17 +66,23 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
children: [
...widget.list
.map((item) => RadioListTile(
title: Text(item.nameEn.toString()),
groupValue: widget.selectedValue.id.toString(),
value: item.id.toString(),
activeColor: Colors.blue.shade700,
selected: item.id.toString() == widget.selectedValue.id.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
title: Text(
'${item.nameEn}' + (widget.isICD ? '/${item.code}' : '')),
groupValue: widget.isICD
? widget.selectedValue.code.toString()
: widget.selectedValue.id.toString(),
value: widget.isICD ? widget.selectedValue.code.toString() : item
.id.toString(),
activeColor: Colors.blue.shade700,
selected: widget.isICD ? item.code.toString() ==
widget.selectedValue.code.toString() : item.id.toString() ==
widget.selectedValue.id.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList()
],
),

Loading…
Cancel
Save