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

@ -130,7 +130,10 @@ const POST_CHIEF_COMPLAINT =
const POST_PHYSICAL_EXAM = const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam'; 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE = 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 = const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetCategories'; 'Services/DoctorApplication.svc/REST/GetCategories';

@ -9,7 +9,8 @@ enum MasterKeysService {
AllergySeverity, AllergySeverity,
physiotherapyGoals, physiotherapyGoals,
DiagnosisCondition, DiagnosisCondition,
DiagnosisType DiagnosisType,
ICD10
} }
extension SelectedMasterKeysService on MasterKeysService { extension SelectedMasterKeysService on MasterKeysService {
@ -48,6 +49,9 @@ extension SelectedMasterKeysService on MasterKeysService {
case MasterKeysService.DiagnosisType: case MasterKeysService.DiagnosisType:
return 35; return 35;
break; 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/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_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_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_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_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_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; super.error = error;
}, body: postProgressNoteRequestModel.toJson()); }, 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> listOfPhysiotherapyGoals = [];
List<MasterKeyModel> listOfDiagnosisType = []; List<MasterKeyModel> listOfDiagnosisType = [];
List<MasterKeyModel> listOfDiagnosisCondition = []; List<MasterKeyModel> listOfDiagnosisCondition = [];
List<MasterKeyModel> listOfICD10 = [];
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys) async {
hasError = false; hasError = false;
@ -120,6 +121,13 @@ class LookupService extends BaseService {
.add(MasterKeyModel.fromJson(v)); .add(MasterKeyModel.fromJson(v));
}); });
break; 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/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_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_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_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_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_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 physicalExaminationList => _SOAPService.physicalExaminationList;
List<MasterKeyModel> get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; List<MasterKeyModel> get listOfDiagnosisType => _SOAPService.listOfDiagnosisType;
List<MasterKeyModel> get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; List<MasterKeyModel> get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition;
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
@ -107,5 +109,15 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); 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; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: {}); }, body: Map());
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
@ -111,18 +111,18 @@ class ProjectViewModel with ChangeNotifier {
} }
void getProfile() async { void getProfile() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
ProfileReqModel docInfo = new ProfileReqModel( // ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID, // doctorID: doctorProfile.doctorID,
clinicID: doctorProfile.clinicID, // clinicID: doctorProfile.clinicID,
license: true, // license: true,
projectID: doctorProfile.projectID, // projectID: doctorProfile.projectID,
tokenID: '', // tokenID: '',
languageID: 2); // languageID: 2);
Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false) Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false)
.getDocProfiles(docInfo.toJson()) .getDocProfiles(ProfileReqModel().toJson())
.then((res) async { .then((res) async {
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
}).catchError((err) { }).catchError((err) {

@ -1,18 +1,18 @@
class MasterKeyModel { class MasterKeyModel {
String alias; String alias;
String aliasN; String aliasN;
int code; dynamic code;
Null description; dynamic description;
Null detail1; dynamic detail1;
Null detail2; dynamic detail2;
Null detail3; dynamic detail3;
Null detail4; dynamic detail4;
Null detail5; dynamic detail5;
int groupID; int groupID;
int id; int id;
String nameAr; String nameAr;
String nameEn; String nameEn;
Null remarks; dynamic remarks;
int typeId; int typeId;
String valueList; 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; break;
case APP_STATUS.UNAUTHENTICATED: case APP_STATUS.UNAUTHENTICATED:
return Loginsreen(); return LandingPage();
break; break;
case APP_STATUS.AUTHENTICATED: case APP_STATUS.AUTHENTICATED:
return LandingPage(); return LandingPage();

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

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

@ -23,6 +23,9 @@ import '../patient_profile_widget.dart';
import 'steps_widget.dart'; import 'steps_widget.dart';
class AddSOAPIndex extends StatefulWidget { class AddSOAPIndex extends StatefulWidget {
final bool isUpdate;
const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key);
@override @override
_AddSOAPIndexState createState() => _AddSOAPIndexState(); _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/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_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/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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
@ -236,7 +239,7 @@ class _AssessmentPageState extends State<AssessmentPage> {
height: 6, height: 6,
), ),
AppText( AppText(
"Some short remark about the allergy", widget.mySelectedAssessment.remark,
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
), ),
@ -268,7 +271,9 @@ class _AssessmentPageState extends State<AssessmentPage> {
Column( Column(
children: [ children: [
InkWell( InkWell(
onTap: () {}, onTap: () {
openAssessmentDialog(context);
},
child: Icon(EvaIcons child: Icon(EvaIcons
.edit2Outline), .edit2Outline),
) )
@ -283,24 +288,55 @@ class _AssessmentPageState extends State<AssessmentPage> {
isExpand: isAssessmentExpand, isExpand: isAssessmentExpand,
), ),
DividerWithSpacesAround( DividerWithSpacesAround(
height: 30, height: 30,
),
AppButton(
title: TranslationBase
.of(context)
.next,
onPressed: () {
widget.changePageViewIndex(3);
},
),
SizedBox(
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) { openAssessmentDialog(BuildContext context) {
@ -334,14 +370,15 @@ class AddAssessmentDetails extends StatefulWidget {
} }
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> { class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyModel _selectedDiagnosisCondition; // MasterKeyModel _selectedDiagnosisCondition;
MasterKeyModel _selectedDiagnosisType; // MasterKeyModel _selectedDiagnosisType;
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController( TextEditingController appointmentIdController = TextEditingController(
text: "234567"); text: "234567");
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
remarkController.text = widget.mySelectedAssessment.remark??"";
final screenSize = MediaQuery final screenSize = MediaQuery
.of(context) .of(context)
.size; .size;
@ -379,6 +416,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
if (model.listOfDiagnosisType.length == 0) { if (model.listOfDiagnosisType.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisType); await model.getMasterLookup(MasterKeysService.DiagnosisType);
} }
if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10);
}
}, },
builder: (_, model, w) => builder: (_, model, w) =>
AppScaffold( AppScaffold(
@ -428,45 +468,48 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.listOfDiagnosisCondition != onTap: model.listOfICD10 != null
null ? () {
? () { MasterKeyDailog dialog = MasterKeyDailog(
MasterKeyDailog dialog = MasterKeyDailog( isICD: true,
list: model.listOfDiagnosisCondition, list: model.listOfICD10,
okText: TranslationBase selectedValue: widget
.of(context) .mySelectedAssessment
.ok, .selectedICD,
okFunction: ( okText: TranslationBase
MasterKeyModel selectedValue) { .of(context)
setState(() { .ok,
_selectedDiagnosisCondition = okFunction:
selectedValue; (MasterKeyModel selectedValue) {
widget.mySelectedAssessment setState(() {
.selectedDiagnosisCondition = widget.mySelectedAssessment
selectedValue; .selectedICD =
}); selectedValue;
}, });
); },
showDialog( );
barrierDismissible: false, showDialog(
context: context, barrierDismissible: false,
builder: (BuildContext context) { context: context,
return dialog; builder: (BuildContext context) {
}, return dialog;
); },
} );
: null, }
child: TextField( : null,
decoration: textFieldSelectorDecoration( child: TextField(
"Condition", decoration: textFieldSelectorDecoration(
_selectedDiagnosisCondition != null "Name / ICD",
? _selectedDiagnosisCondition widget.mySelectedAssessment
.nameEn .selectedICD !=
: null, null
true), ? widget.mySelectedAssessment
enabled: false, .selectedICD.nameEn
), : null,
), true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -485,7 +528,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
okFunction: ( okFunction: (
MasterKeyModel selectedValue) { MasterKeyModel selectedValue) {
setState(() { setState(() {
_selectedDiagnosisCondition = widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue; selectedValue;
}); });
}, },
@ -502,8 +546,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
"Condition", "Condition",
_selectedDiagnosisCondition != null widget.mySelectedAssessment
? _selectedDiagnosisCondition .selectedDiagnosisCondition != null
? widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn .nameEn
: null, : null,
true), true),
@ -527,11 +573,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
okFunction: ( okFunction: (
MasterKeyModel selectedValue) { MasterKeyModel selectedValue) {
setState(() { setState(() {
_selectedDiagnosisType = // _selectedDiagnosisType =
selectedValue; // selectedValue;
widget.mySelectedAssessment widget.mySelectedAssessment
.selectedDiagnosisType = .selectedDiagnosisType =
_selectedDiagnosisType; selectedValue;
}); });
}, },
); );
@ -547,8 +593,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
"Type", "Type",
_selectedDiagnosisType != null widget.mySelectedAssessment
? _selectedDiagnosisType.nameEn .selectedDiagnosisType != null
? widget.mySelectedAssessment
.selectedDiagnosisType.nameEn
: null, : null,
true), true),
enabled: false, enabled: false,

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

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

@ -43,7 +43,8 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Dr. ${authProvider.doctorProfile.doctorName}', //TODO change it edit By Jammal
'Dr. ',//${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white, color: Colors.white,
@ -71,7 +72,9 @@ final double height;
height: 50, height: 50,
width: 60, width: 60,
child: Image.network( 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, // fit: BoxFit.fill,
), ),
), ),

@ -18,6 +18,7 @@ import 'PatientProfileButton.dart';
*@desc: Profile Medical Info Widget *@desc: Profile Medical Info Widget
*/ */
class ProfileMedicalInfoWidget extends StatelessWidget { class ProfileMedicalInfoWidget extends StatelessWidget {
ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key);
PatiantInformtion patient; PatiantInformtion patient;
@override @override
@ -35,6 +36,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine2: "Episode", nameLine2: "Episode",
route: CREATE_EPISODE, route: CREATE_EPISODE,
icon: 'heartbeat.png'), icon: 'heartbeat.png'),
PatientProfileButton(
key: key,
patient: patient,
nameLine1: "Update",
nameLine2: "Episode",
route: CREATE_EPISODE,
icon: 'heartbeat.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, 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:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// ignore: must_be_immutable
class MasterKeyDailog extends StatefulWidget { class MasterKeyDailog extends StatefulWidget {
final List<MasterKeyModel> list; final List<MasterKeyModel> list;
final okText; final okText;
final Function(MasterKeyModel) okFunction; final Function(MasterKeyModel) okFunction;
MasterKeyModel selectedValue; MasterKeyModel selectedValue;
final bool isICD;
MasterKeyDailog( MasterKeyDailog(
{@required this.list, {@required this.list,
@required this.okText, @required this.okText,
@required this.okFunction}); @required this.okFunction,
this.selectedValue,
this.isICD = false});
@override @override
_MasterKeyDailogState createState() => _MasterKeyDailogState(); _MasterKeyDailogState createState() => _MasterKeyDailogState();
@ -62,17 +66,23 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
children: [ children: [
...widget.list ...widget.list
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: Text(item.nameEn.toString()), title: Text(
groupValue: widget.selectedValue.id.toString(), '${item.nameEn}' + (widget.isICD ? '/${item.code}' : '')),
value: item.id.toString(), groupValue: widget.isICD
activeColor: Colors.blue.shade700, ? widget.selectedValue.code.toString()
selected: item.id.toString() == widget.selectedValue.id.toString(), : widget.selectedValue.id.toString(),
onChanged: (val) { value: widget.isICD ? widget.selectedValue.code.toString() : item
setState(() { .id.toString(),
widget.selectedValue = item; 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() .toList()
], ],
), ),

Loading…
Cancel
Save