Merge branch 'episode_fixes_dev_merge' into 'development'

Episode fixes dev merge

See merge request Cloud_Solution/doctor_app_flutter!788
merge-requests/789/head
Mohammad Aljammal 5 years ago
commit 8b7d61ba03

@ -281,7 +281,6 @@ var SERVICES_PATIANT_HEADER_AR = [
"المريض الواصل" "المريض الواصل"
]; ];
const PRIMARY_COLOR = 0xff515B5D; const PRIMARY_COLOR = 0xff515B5D;
const TRANSACTION_NO = 0; const TRANSACTION_NO = 0;

@ -282,7 +282,7 @@ const Map<String, Map<String, String>> localizedValues = {
'indication': {'en': 'Indication', 'ar': 'دواعي الاستخدام'}, 'indication': {'en': 'Indication', 'ar': 'دواعي الاستخدام'},
'duration': {'en': 'Duration', 'ar': 'المدة الزمنية'}, 'duration': {'en': 'Duration', 'ar': 'المدة الزمنية'},
'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'},
'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, 'addMedication': {'en': 'Add Medication', 'ar': 'اضف الدواء'},
'route': {'en': 'Route', 'ar': 'المسار'}, 'route': {'en': 'Route', 'ar': 'المسار'},
'reschedule-leave': {'en': 'Reschedule and leaves', 'ar': 'إعادة الجدولة والأوراق'}, 'reschedule-leave': {'en': 'Reschedule and leaves', 'ar': 'إعادة الجدولة والأوراق'},
'no-reschedule-leave': {'en': 'No Reschedule and leaves', 'ar': 'لا إعادة جدولة ويغادر'}, 'no-reschedule-leave': {'en': 'No Reschedule and leaves', 'ar': 'لا إعادة جدولة ويغادر'},
@ -704,4 +704,9 @@ const Map<String, Map<String, String>> localizedValues = {
"edit": {"en": "Edit", "ar": "تعديل"}, "edit": {"en": "Edit", "ar": "تعديل"},
"summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"}, "summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"},
"finish": {"en": "Finish", "ar": "انهاء"}, "finish": {"en": "Finish", "ar": "انهاء"},
"severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"},
"inProgress": {"en": "inProgress", "ar": "تحت المعالجه"},
"Completed": {"en": "Completed", "ar": "مكتمل"},
"Locked": {"en": "Locked", "ar": "مقفل"},
}; };

@ -17,15 +17,31 @@ class SizeConfig {
static bool isPortrait = true; static bool isPortrait = true;
static bool isMobilePortrait = false; static bool isMobilePortrait = false;
static bool isMobile = false; static bool isMobile = false;
static bool isHeightShort = false;
static bool isHeightVeryShort = false;
static bool isHeightMiddle = false;
static bool isHeightLarge = false;
static bool isWidthLarge = false;
void init(BoxConstraints constraints, Orientation orientation) { void init(BoxConstraints constraints, Orientation orientation) {
realScreenHeight = constraints.maxHeight; realScreenHeight = constraints.maxHeight;
realScreenWidth = constraints.maxWidth; realScreenWidth = constraints.maxWidth;
if (constraints.maxWidth <= MAX_SMALL_SCREEN) { if (constraints.maxWidth <= MAX_SMALL_SCREEN) {
isMobile = true; isMobile = true;
} }
if (constraints.maxHeight < 600) {
isHeightVeryShort = true;
} else if (constraints.maxHeight < 800) {
isHeightShort = true;
} else if (constraints.maxHeight < 1000) {
isHeightMiddle = true;
} else {
isHeightLarge = true;
}
if (constraints.maxWidth > 600) {
isWidthLarge = true;
}
if (orientation == Orientation.portrait) { if (orientation == Orientation.portrait) {
isPortrait = true; isPortrait = true;
if (realScreenWidth < 450) { if (realScreenWidth < 450) {
@ -59,5 +75,32 @@ class SizeConfig {
print('widthMultiplier $widthMultiplier'); print('widthMultiplier $widthMultiplier');
print('isPortrait $isPortrait'); print('isPortrait $isPortrait');
print('isMobilePortrait $isMobilePortrait'); print('isMobilePortrait $isMobilePortrait');
} }
static getTextMultiplierBasedOnWidth({double width}) {
// TODO handel LandScape case
if (width != null) {
return width / 100;
}
return widthMultiplier;
}
static getWidthMultiplier({double width}) {
// TODO handel LandScape case
if (width != null) {
return width / 100;
}
return widthMultiplier;
}
static getHeightMultiplier({double height}) {
// TODO handel LandScape case
if (height != null) {
return height / 100;
}
return heightMultiplier;
}
} }

@ -26,6 +26,12 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode
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';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -85,6 +91,13 @@ class SOAPViewModel extends BaseViewModel {
_SOAPService.patientAssessmentList; _SOAPService.patientAssessmentList;
int get episodeID => _SOAPService.episodeID; int get episodeID => _SOAPService.episodeID;
bool isAddProgress = true;
bool isAddExamInProgress = true;
String progressNoteText ="";
String complaintsControllerError = '';
String medicationControllerError = '';
String illnessControllerError = '';
get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationStrengthList => _SOAPService.medicationStrengthListWithModel;
get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel;
get medicationRouteList => _SOAPService.medicationRouteListWithModel; get medicationRouteList => _SOAPService.medicationRouteListWithModel;
@ -92,6 +105,43 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList; _prescriptionService.allMedicationList;
SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack)
{
this.subjectiveCallBack = callBack;
}
nextOnSubjectPage(model){
subjectiveCallBack.nextFunction(model);
}
ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack)
{
this.objectiveCallBack = callBack;
}
nextOnObjectivePage(model){
objectiveCallBack.nextFunction(model);
}
AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack)
{
this.assessmentCallBack = callBack;
}
nextOnAssessmentPage(model){
assessmentCallBack.nextFunction(model);
}
PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack)
{
this.planCallBack = callBack;
}
nextOnPlanPage(model){
planCallBack.nextFunction(model);
}
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getAllergies(getAllergiesRequestModel); await _SOAPService.getAllergies(getAllergiesRequestModel);
@ -311,8 +361,21 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientPhysicalExam( Future getPatientPhysicalExam(PatiantInformtion patientInfo,
GetPhysicalExamReqModel getPhysicalExamReqModel) async { ) async {
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo == null?"0":patientInfo.episodeNo.toString(),
appointmentNo: patientInfo.appointmentNo == null ?0:int.parse(
patientInfo.appointmentNo.toString(),
),
);
if(patientInfo.admissionNo !=null &&patientInfo.admissionNo.isNotEmpty)
getPhysicalExamReqModel.admissionNo =int.parse(patientInfo.admissionNo);
else
getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -466,4 +529,15 @@ class SOAPViewModel extends BaseViewModel {
break; break;
} }
} }
int getFirstIndexForOldExamination(List<MySelectedExamination> mySelectedExamination){
Iterable<MySelectedExamination> examList = mySelectedExamination.where(
(element) => !element.isLocal);
if (examList.length > 0) {
return mySelectedExamination.indexOf(examList.first);
} else
return -1;
}
} }

@ -294,8 +294,7 @@ class AuthenticationViewModel extends BaseViewModel {
clinicID: clinicInfo.clinicID, clinicID: clinicInfo.clinicID,
license: true, license: true,
projectID: clinicInfo.projectID, projectID: clinicInfo.projectID,
tokenID: '', languageID: 2);///TODO change the lan
languageID: 2);//TODO change the lan
await _authService.getDoctorProfileBasedOnClinic(docInfo); await _authService.getDoctorProfileBasedOnClinic(docInfo);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;

@ -109,7 +109,7 @@ void setupLocator() {
locator.registerFactory(() => PatientViewModel()); locator.registerFactory(() => PatientViewModel());
locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => DashboardViewModel());
locator.registerFactory(() => SickLeaveViewModel()); locator.registerFactory(() => SickLeaveViewModel());
locator.registerFactory(() => SOAPViewModel()); locator.registerLazySingleton(() => SOAPViewModel());
locator.registerFactory(() => PatientReferralViewModel()); locator.registerFactory(() => PatientReferralViewModel());
locator.registerFactory(() => PrescriptionViewModel()); locator.registerFactory(() => PrescriptionViewModel());
locator.registerFactory(() => ProcedureViewModel()); locator.registerFactory(() => ProcedureViewModel());

@ -4,9 +4,10 @@ class GetChiefComplaintReqModel {
int episodeId; int episodeId;
int episodeID; int episodeID;
dynamic doctorID; dynamic doctorID;
int admissionNo;
GetChiefComplaintReqModel( GetChiefComplaintReqModel(
{this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo});
GetChiefComplaintReqModel.fromJson(Map<String, dynamic> json) { GetChiefComplaintReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
@ -14,16 +15,27 @@ class GetChiefComplaintReqModel {
episodeId = json['EpisodeId']; episodeId = json['EpisodeId'];
episodeID = json['EpisodeID']; episodeID = json['EpisodeID'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
admissionNo = json['admissionNo'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo; if (this.appointmentNo != null) {
data['EpisodeId'] = this.episodeId; data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID; }
data['DoctorID'] = this.doctorID; if (this.episodeId != null) {
data['EpisodeId'] = this.episodeId;
}
if (episodeID != null) {
data['EpisodeID'] = this.episodeID;
}
if (doctorID != null) {
data['DoctorID'] = this.doctorID;
}
if (this.admissionNo != null) {
data['AdmissionNo'] = this.admissionNo;
}
return data; return data;
} }

@ -1,6 +1,7 @@
class GetPhysicalExamReqModel { class GetPhysicalExamReqModel {
int patientMRN; int patientMRN;
int appointmentNo; int appointmentNo;
int admissionNo;
String episodeID; String episodeID;
String from; String from;
String to; String to;
@ -10,6 +11,7 @@ class GetPhysicalExamReqModel {
GetPhysicalExamReqModel({ GetPhysicalExamReqModel({
this.patientMRN, this.patientMRN,
this.appointmentNo, this.appointmentNo,
this.admissionNo,
this.episodeID, this.episodeID,
this.from, this.from,
this.to, this.to,
@ -31,11 +33,13 @@ class GetPhysicalExamReqModel {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['AdmissionNo'] = this.admissionNo;
data['EpisodeID'] = this.episodeID; data['EpisodeID'] = this.episodeID;
data['From'] = this.from; data['From'] = this.from;
data['To'] = this.to; data['To'] = this.to;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy; data['EditedBy'] = this.editedBy;
return data; return data;
} }
} }

@ -1,54 +0,0 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedAllergy {
MasterKeyModel selectedAllergySeverity;
MasterKeyModel selectedAllergy;
String remark;
bool isChecked;
bool isExpanded;
bool isLocal;
int createdBy;
bool hasValidationError;
MySelectedAllergy(
{this.selectedAllergySeverity,
this.selectedAllergy,
this.remark,
this.isChecked,
this.isExpanded = true,
this.isLocal = true,
this.createdBy,
this.hasValidationError = false});
MySelectedAllergy.fromJson(Map<String, dynamic> json) {
selectedAllergySeverity = json['selectedAllergySeverity'] != null
? new MasterKeyModel.fromJson(json['selectedAllergySeverity'])
: null;
selectedAllergy = json['selectedAllergy'] != null
? new MasterKeyModel.fromJson(json['selectedAllergy'])
: null;
remark = json['remark'];
isChecked = json['isChecked'];
isExpanded = json['isExpanded'];
isLocal = json['isLocal'];
createdBy = json['createdBy'];
hasValidationError = json['hasValidationError'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedAllergySeverity != null) {
data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson();
}
if (this.selectedAllergy != null) {
data['selectedAllergy'] = this.selectedAllergy.toJson();
}
data['remark'] = this.remark;
data['isChecked'] = this.isChecked;
data['isExpanded'] = this.isExpanded;
data['createdBy'] = this.createdBy;
data['isLocal'] = this.isLocal;
data['hasValidationError'] = this.hasValidationError;
return data;
}
}

@ -1,65 +0,0 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedAssessment {
MasterKeyModel selectedICD;
MasterKeyModel selectedDiagnosisCondition;
MasterKeyModel selectedDiagnosisType;
String remark;
int appointmentId;
int createdBy;
String createdOn;
int doctorID;
String doctorName;
String icdCode10ID;
MySelectedAssessment(
{this.selectedICD,
this.selectedDiagnosisCondition,
this.selectedDiagnosisType,
this.remark, this.appointmentId, this.createdBy,
this.createdOn,
this.doctorID,
this.doctorName,
this.icdCode10ID});
MySelectedAssessment.fromJson(Map<String, dynamic> json) {
selectedICD = json['selectedICD'] != null
? new MasterKeyModel.fromJson(json['selectedICD'])
: null;
selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null
? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition'])
: null;
selectedDiagnosisType = json['selectedDiagnosisType'] != null
? new MasterKeyModel.fromJson(json['selectedDiagnosisType'])
: null;
remark = json['remark'];
appointmentId = json['appointmentId'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
doctorID = json['doctorID'];
doctorName = json['doctorName'];
icdCode10ID = json['icdCode10ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedICD != null) {
data['selectedICD'] = this.selectedICD.toJson();
}
if (this.selectedDiagnosisCondition != null) {
data['selectedICD'] = this.selectedDiagnosisCondition.toJson();
}
if (this.selectedDiagnosisType != null) {
data['selectedICD'] = this.selectedDiagnosisType.toJson();
}
data['remark'] = this.remark;
data['appointmentId'] = this.appointmentId;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['doctorID'] = this.doctorID;
data['doctorName'] = this.doctorName;
data['icdCode10ID'] = this.icdCode10ID;
return data;
}
}

@ -1,61 +0,0 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination {
MasterKeyModel selectedExamination;
String remark;
bool isNormal;
bool isAbnormal;
bool notExamined;
bool isNew;
bool isLocal;
int createdBy;
String createdOn;
String editedOn;
MySelectedExamination({
this.selectedExamination,
this.remark,
this.isNormal = false,
this.isAbnormal = false,
this.notExamined = true,
this.isNew = true,
this.isLocal = true,
this.createdBy,
this.createdOn,
this.editedOn,
});
MySelectedExamination.fromJson(Map<String, dynamic> json) {
selectedExamination = json['selectedExamination'] != null
? new MasterKeyModel.fromJson(json['selectedExamination'])
: null;
remark = json['remark'];
isNormal = json['isNormal'];
isAbnormal = json['isAbnormal'];
notExamined = json['notExamined'];
isNew = json['isNew'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedOn = json['editedOn'];
isLocal = json['isLocal'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedExamination != null) {
data['selectedExamination'] = this.selectedExamination.toJson();
}
data['remark'] = this.remark;
data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal;
data['notExamined'] = this.notExamined;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['editedOn'] = this.editedOn;
data['isLocal'] = this.isLocal;
return data;
}
}

@ -1,33 +0,0 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedHistory {
MasterKeyModel selectedHistory;
String remark;
bool isChecked;
bool isLocal;
MySelectedHistory(
{ this.selectedHistory, this.remark, this.isChecked, this.isLocal = true});
MySelectedHistory.fromJson(Map<String, dynamic> json) {
selectedHistory = json['selectedHistory'] != null
? new MasterKeyModel.fromJson(json['selectedHistory'])
: null;
remark = json['remark'];
remark = json['isChecked'];
isLocal = json['isLocal'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedHistory != null) {
data['selectedHistory'] = this.selectedHistory.toJson();
}
data['remark'] = this.remark;
data['isChecked'] = this.remark;
data['isLocal'] = this.isLocal;
return data;
}
}

@ -2,6 +2,7 @@ class PostChiefComplaintRequestModel {
int appointmentNo; int appointmentNo;
int episodeID; int episodeID;
int patientMRN; int patientMRN;
int admissionNo;
String chiefComplaint; String chiefComplaint;
String hopi; String hopi;
String currentMedication; String currentMedication;
@ -11,7 +12,6 @@ class PostChiefComplaintRequestModel {
dynamic doctorID; dynamic doctorID;
dynamic editedBy; dynamic editedBy;
PostChiefComplaintRequestModel( PostChiefComplaintRequestModel(
{this.appointmentNo, {this.appointmentNo,
this.episodeID, this.episodeID,
@ -23,7 +23,8 @@ class PostChiefComplaintRequestModel {
this.isLactation, this.isLactation,
this.doctorID, this.doctorID,
this.editedBy, this.editedBy,
this.numberOfWeeks}); this.numberOfWeeks,
this.admissionNo});
PostChiefComplaintRequestModel.fromJson(Map<String, dynamic> json) { PostChiefComplaintRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
@ -37,12 +38,18 @@ class PostChiefComplaintRequestModel {
numberOfWeeks = json['numberOfWeeks']; numberOfWeeks = json['numberOfWeeks'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
editedBy = json['EditedBy']; editedBy = json['EditedBy'];
admissionNo = json['AdmissionNo'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo; if (appointmentNo != null) {
data['EpisodeID'] = this.episodeID; data['AppointmentNo'] = this.appointmentNo;
}
if (episodeID != null) {
data['EpisodeID'] = this.episodeID;
}
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['chiefComplaint'] = this.chiefComplaint; data['chiefComplaint'] = this.chiefComplaint;
data['Hopi'] = this.hopi; data['Hopi'] = this.hopi;
@ -51,7 +58,12 @@ class PostChiefComplaintRequestModel {
data['isLactation'] = this.isLactation; data['isLactation'] = this.isLactation;
data['numberOfWeeks'] = this.numberOfWeeks; data['numberOfWeeks'] = this.numberOfWeeks;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy; if (editedBy != null) {
data['EditedBy'] = this.editedBy;
}
if (admissionNo != null) {
data['AdmissionNo'] = this.admissionNo;
}
return data; return data;
} }

@ -1,12 +1,13 @@
class PostPhysicalExamRequestModel { class PostPhysicalExamRequestModel {
List<ListHisProgNotePhysicalExaminationVM> listHisProgNotePhysicalExaminationVM; List<ListHisProgNotePhysicalExaminationVM>
listHisProgNotePhysicalExaminationVM;
PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM});
PostPhysicalExamRequestModel.fromJson(Map<String, dynamic> json) { PostPhysicalExamRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listHisProgNotePhysicalExaminationVM'] != null) { if (json['listHisProgNotePhysicalExaminationVM'] != null) {
listHisProgNotePhysicalExaminationVM = new List<ListHisProgNotePhysicalExaminationVM>(); listHisProgNotePhysicalExaminationVM =
new List<ListHisProgNotePhysicalExaminationVM>();
json['listHisProgNotePhysicalExaminationVM'].forEach((v) { json['listHisProgNotePhysicalExaminationVM'].forEach((v) {
listHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM
.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v));
@ -17,98 +18,105 @@ class PostPhysicalExamRequestModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listHisProgNotePhysicalExaminationVM != null) { if (this.listHisProgNotePhysicalExaminationVM != null) {
data['listHisProgNotePhysicalExaminationVM'] = data['listHisProgNotePhysicalExaminationVM'] = this
this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList(); .listHisProgNotePhysicalExaminationVM
.map((v) => v.toJson())
.toList();
} }
return data; return data;
} }
} }
class ListHisProgNotePhysicalExaminationVM { class ListHisProgNotePhysicalExaminationVM {
int episodeId; int episodeId;
int appointmentNo; int appointmentNo;
int examType; int admissionNo;
int examId; int examType;
int patientMRN; int examId;
bool isNormal; int patientMRN;
bool isAbnormal; bool isNormal;
bool notExamined; bool isAbnormal;
String examName; bool notExamined;
String examinationTypeName; String examName;
int examinationType; String examinationTypeName;
String remarks; int examinationType;
bool isNew; String remarks;
int createdBy; bool isNew;
String createdOn; int createdBy;
String createdByName; String createdOn;
int editedBy; String createdByName;
String editedOn; int editedBy;
String editedByName; String editedOn;
String editedByName;
ListHisProgNotePhysicalExaminationVM( ListHisProgNotePhysicalExaminationVM(
{this.episodeId, {this.episodeId,
this.appointmentNo, this.appointmentNo,
this.examType, this.admissionNo,
this.examId, this.examType,
this.patientMRN, this.examId,
this.isNormal, this.patientMRN,
this.isAbnormal, this.isNormal,
this.notExamined, this.isAbnormal,
this.examName, this.notExamined,
this.examinationTypeName, this.examName,
this.examinationType, this.examinationTypeName,
this.remarks, this.examinationType,
this.isNew, this.remarks,
this.createdBy, this.isNew,
this.createdOn, this.createdBy,
this.createdByName, this.createdOn,
this.editedBy, this.createdByName,
this.editedOn, this.editedBy,
this.editedByName}); this.editedOn,
this.editedByName});
ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) { ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) {
episodeId = json['episodeId']; episodeId = json['episodeId'];
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
examType = json['examType']; admissionNo = json['AdmissionNo'];
examId = json['examId'];
patientMRN = json['patientMRN'];
isNormal = json['isNormal'];
isAbnormal = json['isAbnormal'];
notExamined = json['notExamined'];
examName = json['examName'];
examinationTypeName = json['examinationTypeName'];
examinationType = json['examinationType'];
remarks = json['remarks'];
isNew = json['isNew'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
createdByName = json['createdByName'];
editedBy = json['editedBy'];
editedOn = json['editedOn'];
editedByName = json['editedByName'];
}
Map<String, dynamic> toJson() { examType = json['examType'];
final Map<String, dynamic> data = new Map<String, dynamic>(); examId = json['examId'];
data['episodeId'] = this.episodeId; patientMRN = json['patientMRN'];
data['appointmentNo'] = this.appointmentNo; isNormal = json['isNormal'];
data['examType'] = this.examType; isAbnormal = json['isAbnormal'];
data['examId'] = this.examId; notExamined = json['notExamined'];
data['patientMRN'] = this.patientMRN; examName = json['examName'];
data['isNormal'] = this.isNormal; examinationTypeName = json['examinationTypeName'];
data['isAbnormal'] = this.isAbnormal; examinationType = json['examinationType'];
data['notExamined'] = this.notExamined; remarks = json['remarks'];
data['examName'] = this.examName; isNew = json['isNew'];
data['examinationTypeName'] = this.examinationTypeName; createdBy = json['createdBy'];
data['examinationType'] = this.examinationType; createdOn = json['createdOn'];
data['remarks'] = this.remarks; createdByName = json['createdByName'];
data['isNew'] = this.isNew; editedBy = json['editedBy'];
data['createdBy'] = this.createdBy; editedOn = json['editedOn'];
data['createdOn'] = this.createdOn; editedByName = json['editedByName'];
data['createdByName'] = this.createdByName;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['editedByName'] = this.editedByName;
return data;
}
} }
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo;
data['admissionNo'] = this.admissionNo;
data['examType'] = this.examType;
data['examId'] = this.examId;
data['patientMRN'] = this.patientMRN;
data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal;
data['notExamined'] = this.notExamined;
data['examName'] = this.examName;
data['examinationTypeName'] = this.examinationTypeName;
data['examinationType'] = this.examinationType;
data['remarks'] = this.remarks;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['createdByName'] = this.createdByName;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['editedByName'] = this.editedByName;
return data;
}
}

@ -0,0 +1,23 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedAllergy {
MasterKeyModel selectedAllergySeverity;
MasterKeyModel selectedAllergy;
String remark;
bool isChecked;
bool isExpanded;
bool isLocal;
int createdBy;
bool hasValidationError;
MySelectedAllergy(
{this.selectedAllergySeverity,
this.selectedAllergy,
this.remark,
this.isChecked,
this.isExpanded = true,
this.isLocal = true,
this.createdBy,
this.hasValidationError = false});
}

@ -0,0 +1,24 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedAssessment {
MasterKeyModel selectedICD;
MasterKeyModel selectedDiagnosisCondition;
MasterKeyModel selectedDiagnosisType;
String remark;
int appointmentId;
int createdBy;
String createdOn;
int doctorID;
String doctorName;
String icdCode10ID;
MySelectedAssessment(
{this.selectedICD,
this.selectedDiagnosisCondition,
this.selectedDiagnosisType,
this.remark, this.appointmentId, this.createdBy,
this.createdOn,
this.doctorID,
this.doctorName,
this.icdCode10ID});
}

@ -0,0 +1,27 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination {
MasterKeyModel selectedExamination;
String remark;
bool isNormal;
bool isAbnormal;
bool notExamined;
bool isNew;
bool isLocal;
int createdBy;
String createdOn;
String editedOn;
MySelectedExamination({
this.selectedExamination,
this.remark,
this.isNormal = false,
this.isAbnormal = false,
this.notExamined = true,
this.isNew = true,
this.isLocal = true,
this.createdBy,
this.createdOn,
this.editedOn,
});
}

@ -0,0 +1,11 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedHistory {
MasterKeyModel selectedHistory;
String remark;
bool isChecked;
bool isLocal;
MySelectedHistory(
{this.selectedHistory, this.remark, this.isChecked, this.isLocal = true});
}

@ -79,95 +79,93 @@ class PatiantInformtion {
int vcId; int vcId;
String voipToken; String voipToken;
PatiantInformtion({this.patientDetails, PatiantInformtion(
this.projectId, {this.patientDetails,
this.clinicId, this.projectId,
this.doctorId, this.clinicId,
this.patientId, this.doctorId,
this.doctorName, this.patientId,
this.doctorNameN, this.doctorName,
this.firstName, this.doctorNameN,
this.middleName, this.firstName,
this.lastName, this.middleName,
this.firstNameN, this.lastName,
this.middleNameN, this.firstNameN,
this.lastNameN, this.middleNameN,
this.gender, this.lastNameN,
this.dateofBirth, this.gender,
this.nationalityId, this.dateofBirth,
this.mobileNumber, this.nationalityId,
this.emailAddress, this.mobileNumber,
this.patientIdentificationNo, this.emailAddress,
this.patientType, this.patientIdentificationNo,
this.admissionNo, this.patientType,
this.admissionDate, this.admissionNo,
this.createdOn, this.admissionDate,
this.roomId, this.createdOn,
this.bedId, this.roomId,
this.nursingStationId, this.bedId,
this.description, this.nursingStationId,
this.clinicDescription, this.description,
this.clinicDescriptionN, this.clinicDescription,
this.nationalityName, this.clinicDescriptionN,
this.nationalityNameN, this.nationalityName,
this.age, this.nationalityNameN,
this.genderDescription, this.age,
this.nursingStationName, this.genderDescription,
this.appointmentDate, this.nursingStationName,
this.startTime, this.appointmentDate,
this.appointmentNo, this.startTime,
this.arrivalTime, this.appointmentNo,
this.arrivalTimeD, this.arrivalTime,
this.callStatus, this.arrivalTimeD,
this.callStatusDisc, this.callStatus,
this.callTypeID, this.callStatusDisc,
this.clientRequestID, this.callTypeID,
this.clinicName, this.clientRequestID,
this.consoltationEnd, this.clinicName,
this.consultationNotes, this.consoltationEnd,
this.appointmentType, this.consultationNotes,
this.appointmentTypeId, this.appointmentType,
this.arrivedOn, this.appointmentTypeId,
this.clinicGroupId, this.arrivedOn,
this.companyName, this.clinicGroupId,
this.dischargeStatus, this.companyName,
this.doctorDetails, this.dischargeStatus,
this.endTime, this.doctorDetails,
this.episodeNo, this.endTime,
this.fallRiskScore, this.episodeNo,
this.genderInt, this.fallRiskScore,
this.isSigned, this.genderInt,
this.medicationOrders, this.isSigned,
this.nationality, this.medicationOrders,
this.patientMRN, this.nationality,
this.visitType, this.patientMRN,
this.fullName, this.visitType,
this.fullNameN, this.fullName,
this.nationalityFlagURL, this.fullNameN,
this.patientStatusType, this.nationalityFlagURL,
this.patientStatus, this.patientStatusType,
this.visitTypeId, this.patientStatus,
this.startTimes, this.visitTypeId,
this.dischargeDate, this.startTimes,
this.status, this.dischargeDate,
this.vcId, this.status,
this.voipToken, this.vcId,
this.admissionDateWithDateTimeForm, this.voipToken,
this.admissionDateWithDateTimeForm,
this.appointmentDateWithDateTimeForm}); this.appointmentDateWithDateTimeForm});
PatiantInformtion.fromJson(Map<String, dynamic> json) { PatiantInformtion.fromJson(Map<String, dynamic> json) {
{ {
patientDetails = json['patientDetails'] != null patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null;
? new PatiantInformtion.fromJson(json['patientDetails'])
: null;
projectId = json["ProjectID"] ?? json["projectID"]; projectId = json["ProjectID"] ?? json["projectID"];
clinicId = json["ClinicID"] ?? json["clinicID"]; clinicId = json["ClinicID"] ?? json["clinicID"];
doctorId = json["DoctorID"] ?? json["doctorID"]; doctorId = json["DoctorID"] ?? json["doctorID"];
patientId = json["PatientID"] != null patientId = json["PatientID"] != null
? json["PatientID"] is String ? json["PatientID"] is String
? int.parse(json["PatientID"]) ? int.parse(json["PatientID"])
: json["PatientID"] : json["PatientID"]
: json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN']; : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'];
doctorName = json["DoctorName"] ?? json["doctorName"]; doctorName = json["DoctorName"] ?? json["doctorName"];
doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"]; doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"];
@ -179,18 +177,16 @@ class PatiantInformtion {
lastNameN = json["LastNameN"] ?? json["lastNameN"]; lastNameN = json["LastNameN"] ?? json["lastNameN"];
gender = json["Gender"] != null gender = json["Gender"] != null
? json["Gender"] is String ? json["Gender"] is String
? int.parse(json["Gender"]) ? int.parse(json["Gender"])
: json["Gender"] : json["Gender"]
: json["gender"]; : json["gender"];
fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"];
fullNameN = fullNameN = json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"];
json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"];
dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'];
nationalityId = json["NationalityID"] ?? json["nationalityID"]; nationalityId = json["NationalityID"] ?? json["nationalityID"];
mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"];
emailAddress = json["EmailAddress"] ?? json["emailAddress"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"];
patientIdentificationNo = patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"];
json["PatientIdentificationNo"] ?? json["patientIdentificationNo"];
//TODO make 7 dynamic when the backend retrun it in patient arrival //TODO make 7 dynamic when the backend retrun it in patient arrival
patientType = json["PatientType"] ?? json["patientType"] ?? 1; patientType = json["PatientType"] ?? json["patientType"] ?? 1;
admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; admissionNo = json["AdmissionNo"] ?? json["admissionNo"];
@ -200,16 +196,10 @@ class PatiantInformtion {
bedId = json["BedID"] ?? json["bedID"]; bedId = json["BedID"] ?? json["bedID"];
nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"];
description = json["Description"] ?? json["description"]; description = json["Description"] ?? json["description"];
clinicDescription = clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"];
json["ClinicDescription"] ?? json["clinicDescription"]; clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"];
clinicDescriptionN = nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'];
json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'];
nationalityName = json["NationalityName"] ??
json["nationalityName"] ??
json['NationalityName'];
nationalityNameN = json["NationalityNameN"] ??
json["nationalityNameN"] ??
json['NationalityNameN'];
age = json["Age"] ?? json["age"]; age = json["Age"] ?? json["age"];
genderDescription = json["GenderDescription"]; genderDescription = json["GenderDescription"];
nursingStationName = json["NursingStationName"]; nursingStationName = json["NursingStationName"];
@ -217,8 +207,7 @@ class PatiantInformtion {
startTime = json["startTime"] ?? json['StartTime']; startTime = json["startTime"] ?? json['StartTime'];
appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo'];
appointmentType = json['appointmentType']; appointmentType = json['appointmentType'];
appointmentTypeId = appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid'];
json['appointmentTypeId'] ?? json['appointmentTypeid'];
arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'];
clinicGroupId = json['clinicGroupId']; clinicGroupId = json['clinicGroupId'];
companyName = json['companyName']; companyName = json['companyName'];
@ -234,16 +223,15 @@ class PatiantInformtion {
json['PatientMRN'] ?? json['PatientMRN'] ??
(json["PatientID"] != null (json["PatientID"] != null
? int?.parse(json["PatientID"].toString()) ? int?.parse(json["PatientID"].toString())
: json["patientID"] != null ? int?.parse( : json["patientID"] != null
json["patientID"].toString()) : json["patientId"] != null ? int ? int?.parse(json["patientID"].toString())
?.parse(json["patientId"].toString()) : ''); : json["patientId"] != null
? int?.parse(json["patientId"].toString())
: '');
visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; visitType = json['visitType'] ?? json['visitType'] ?? json['visitType'];
nationalityFlagURL = nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL'];
json['NationalityFlagURL'] ?? json['NationalityFlagURL']; patientStatusType = json['patientStatusType'] ?? json['PatientStatusType'];
patientStatusType = visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'];
json['patientStatusType'] ?? json['PatientStatusType'];
visitTypeId =
json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'];
startTimes = json['StartTime'] ?? json['StartTime']; startTimes = json['StartTime'] ?? json['StartTime'];
dischargeDate = json['DischargeDate']; dischargeDate = json['DischargeDate'];
status = json['Status']; status = json['Status'];
@ -262,16 +250,15 @@ class PatiantInformtion {
voipToken = json['VoipToken']; voipToken = json['VoipToken'];
admissionDateWithDateTimeForm = json["AdmissionDate"] != null admissionDateWithDateTimeForm = json["AdmissionDate"] != null
? AppDateUtils.convertStringToDate(json["AdmissionDate"]) ? AppDateUtils.convertStringToDate(json["AdmissionDate"])
: json["admissionDate"] != null ? AppDateUtils.convertStringToDate( : json["admissionDate"] != null
json["admissionDate"]) : null; ? AppDateUtils.convertStringToDate(json["admissionDate"])
: null;
appointmentDateWithDateTimeForm = appointmentDateWithDateTimeForm =
json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate( json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null;
json["AppointmentDate"]) : null;
} }
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -315,9 +302,9 @@ class PatiantInformtion {
data["Gender"] = this.gender; data["Gender"] = this.gender;
data["gender"] = this.gender; data["gender"] = this.gender;
data['Age'] = this.age; data['Age'] = this.age;
data['AppointmentDate'] = this.appointmentDate.isNotEmpty?this.appointmentDate:null; data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['ArrivalTime'] = this.arrivalTime; data['ArrivalTime'] = this.arrivalTime;
data['ArrivalTimeD'] = this.arrivalTimeD; data['ArrivalTimeD'] = this.arrivalTimeD;

@ -71,321 +71,323 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
height: SizeConfig.realScreenHeight * .95, height: SizeConfig.realScreenHeight * .95,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column( child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
SizedBox( children: <Widget>[
height: 80, SizedBox(
), height: 80,
if(authenticationViewModel.isFromLogin) ),
InkWell( if(authenticationViewModel.isFromLogin)
onTap: (){ InkWell(
authenticationViewModel.setUnverified(false,isFromLogin: false); onTap: (){
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); authenticationViewModel.setUnverified(false,isFromLogin: false);
}, authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) },
child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),)
),
Container(
child: Column(
children: <Widget>[
SizedBox(
height: 20,
),
authenticationViewModel.user != null && isMoreOption == false
? Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).welcomeBack,
fontSize:12,
fontWeight: FontWeight.w700,
color: Color(0xFF2B353E),
),
AppText(
Helpers.capitalize(authenticationViewModel.user.doctorName),
fontSize: 24,
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).accountInfo ,
fontSize: 16,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
),
SizedBox(
height: 20,
),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'),
width: 0.1),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
children: [
Text(
TranslationBase.of(context)
.lastLoginAt,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,),
),
Row(
children: [
AppText(
TranslationBase
.of(context)
.verifyWith,
fontSize: 14,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
AppText(
authenticationViewModel.getType(
authenticationViewModel.user
.logInTypeID,
context),
fontSize: 14,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
],
)
],
crossAxisAlignment: CrossAxisAlignment.start,),
Column(children: [
AppText(
authenticationViewModel.user.editedOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
authenticationViewModel.user
.editedOn))
: authenticationViewModel.user.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(authenticationViewModel.user
.createdOn))
: '--',
textAlign:
TextAlign.right,
fontSize: 13,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
),
AppText(
authenticationViewModel.user.editedOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(
authenticationViewModel.user
.editedOn))
: authenticationViewModel.user.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(authenticationViewModel.user
.createdOn))
: '--',
textAlign:
TextAlign.right,
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
)
],
crossAxisAlignment: CrossAxisAlignment.start,
) ),
], Container(
),
), child: Column(
SizedBox( children: <Widget>[
height: 20, SizedBox(
), height: 20,
Row( ),
children: [ authenticationViewModel.user != null && isMoreOption == false
AppText( ? Column(
"Please Verify",
fontSize: 16,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
],
)
],
)
: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
this.onlySMSBox == false
? Container( AppText(
margin: EdgeInsets.only(bottom: 20, top: 30), TranslationBase.of(context).welcomeBack,
child: AppText( fontSize:12,
TranslationBase.of(context) fontWeight: FontWeight.w700,
.verifyLoginWith, color: Color(0xFF2B353E),
fontSize: 18, ),
color: Color(0xFF2E303A), AppText(
Helpers.capitalize(authenticationViewModel.user.doctorName),
fontSize: 24,
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
), ),
) SizedBox(
: AppText( height: 20,
TranslationBase.of(context) ),
.verifyFingerprint2, AppText(
fontSize: TranslationBase.of(context).accountInfo ,
SizeConfig.textMultiplier * 2.5, fontSize: 16,
textAlign: TextAlign.start, color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
),
SizedBox(
height: 20,
),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'),
width: 0.1),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
children: [
Text(
TranslationBase.of(context)
.lastLoginAt,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,),
),
Row(
children: [
AppText(
TranslationBase
.of(context)
.verifyWith,
fontSize: 14,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
AppText(
authenticationViewModel.getType(
authenticationViewModel.user
.logInTypeID,
context),
fontSize: 14,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
],
)
],
crossAxisAlignment: CrossAxisAlignment.start,),
Column(children: [
AppText(
authenticationViewModel.user.editedOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
authenticationViewModel.user
.editedOn))
: authenticationViewModel.user.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(authenticationViewModel.user
.createdOn))
: '--',
textAlign:
TextAlign.right,
fontSize: 13,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
),
AppText(
authenticationViewModel.user.editedOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(
authenticationViewModel.user
.editedOn))
: authenticationViewModel.user.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(authenticationViewModel.user
.createdOn))
: '--',
textAlign:
TextAlign.right,
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
)
],
crossAxisAlignment: CrossAxisAlignment.start,
)
],
),
),
SizedBox(
height: 20,
), ),
]),
authenticationViewModel.user != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row( Row(
children: [
AppText(
"Please Verify",
fontSize: 16,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
],
)
],
)
: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
this.onlySMSBox == false
? Container(
margin: EdgeInsets.only(bottom: 20, top: 30),
child: AppText(
TranslationBase.of(context)
.verifyLoginWith,
fontSize: 18,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
),
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize:
SizeConfig.textMultiplier * 2.5,
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () =>
{
// TODO check this logic it seem it will create bug to us
authenticateUser(
AuthMethodTypes
.Fingerprint, true)
},
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService
.getMethodsTypeService(
authenticationViewModel.user
.logInTypeID),
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType:
AuthMethodTypes.MoreOptions,
onShowMore: () {
setState(() {
isMoreOption = true;
});
},
))
]),
])
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: InkWell( child: VerificationMethodsList(
onTap: () => authenticationViewModel:authenticationViewModel,
{ authMethodType:
// TODO check this logic it seem it will create bug to us AuthMethodTypes.Fingerprint,
authenticateUser( authenticateUser:
AuthMethodTypes (AuthMethodTypes
.Fingerprint, true) authMethodType,
}, isActive) =>
child: VerificationMethodsList( authenticateUser(
authenticationViewModel:authenticationViewModel, authMethodType,
authMethodType: SelectedAuthMethodTypesService isActive),
.getMethodsTypeService( )),
authenticationViewModel.user
.logInTypeID),
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
),
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:authenticationViewModel,
authMethodType: authMethodType:
AuthMethodTypes.MoreOptions, AuthMethodTypes.FaceID,
onShowMore: () { authenticateUser:
setState(() { (AuthMethodTypes
isMoreOption = true; authMethodType,
}); isActive) =>
}, authenticateUser(
authMethodType,
isActive),
)) ))
]), ],
]) )
: Column( : SizedBox(),
mainAxisAlignment: MainAxisAlignment.start, Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment:
children: <Widget>[ MainAxisAlignment.center,
onlySMSBox == false children: <Widget>[
? Row( Expanded(
mainAxisAlignment: child: VerificationMethodsList(
MainAxisAlignment.center, authenticationViewModel:authenticationViewModel,
children: <Widget>[ authMethodType: AuthMethodTypes
Expanded( .SMS,
child: VerificationMethodsList( authenticateUser:
authenticationViewModel:authenticationViewModel, (
authMethodType: AuthMethodTypes authMethodType,
AuthMethodTypes.Fingerprint, isActive) =>
authenticateUser: authenticateUser(
(AuthMethodTypes authMethodType, isActive),
authMethodType, )),
isActive) => Expanded(
authenticateUser( child: VerificationMethodsList(
authMethodType, authenticationViewModel:authenticationViewModel,
isActive), authMethodType:
)), AuthMethodTypes.WhatsApp,
Expanded( authenticateUser:
child: VerificationMethodsList( (
authenticationViewModel:authenticationViewModel, AuthMethodTypes authMethodType,
authMethodType: isActive) =>
AuthMethodTypes.FaceID, authenticateUser(
authenticateUser: authMethodType, isActive),
(AuthMethodTypes ))
authMethodType, ],
isActive) => ),
authenticateUser( ]),
authMethodType,
isActive),
))
],
)
: SizedBox(),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType: AuthMethodTypes
.SMS,
authenticateUser:
(
AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType:
AuthMethodTypes.WhatsApp,
authenticateUser:
(
AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
))
],
),
]),
// ) // )
], ],
),
), ),
), ],
], ),
), ),
), ),
), ),

@ -198,7 +198,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
), ),
], ],
), ),
if (isFromLiveCare if (isInpatient?true:isFromLiveCare
? patient.episodeNo != null ? patient.episodeNo != null
: patient.patientStatusType != null && patient.patientStatusType == 43) : patient.patientStatusType != null && patient.patientStatusType == 43)
BaseView<SOAPViewModel>( BaseView<SOAPViewModel>(
@ -253,7 +253,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
AppButton( AppButton(
title: title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare color: isFromLiveCare || isInpatient
? Colors.red.shade700 ? Colors.red.shade700
: patient.patientStatusType == 43 : patient.patientStatusType == 43
? Colors.red.shade700 ? Colors.red.shade700
@ -277,7 +277,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if ((isFromLiveCare && if ((isFromLiveCare &&
patient.appointmentNo != null && patient.appointmentNo != null &&
patient.appointmentNo != 0) || patient.appointmentNo != 0) ||
patient.patientStatusType == 43) { patient.patientStatusType == 43 ||isInpatient ) {
Navigator.of(context) Navigator.of(context)
.pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); .pushNamed(UPDATE_EPISODE, arguments: {'patient': patient});
} }

@ -1,16 +1,18 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_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/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/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.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/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -152,6 +154,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
// height: 55.0, // height: 55.0,
height: Helpers.getTextFieldHeight(),
hintText: hintText:
TranslationBase.of(context).appointmentNumber, TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
@ -223,7 +227,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
) )
: AppTextFieldCustom( : AppTextFieldCustom(
onClick: model.listOfICD10 != null height: Helpers.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment
@ -234,7 +239,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
: null, : null,
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.nameOrICD, .nameOrICD,
maxLines: 2, maxLines: 1,
minLines: 1, minLines: 1,
controller: icdNameController, controller: icdNameController,
enabled: true, enabled: true,
@ -246,10 +251,38 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
)), )),
)), )),
), ),
if(widget.mySelectedAssessment
.selectedICD != null)
Column(
children: [
SizedBox(
height: 3,
),
Container(
width: MediaQuery
.of(context)
.size
.width * 0.7,
child: AppText(
widget.mySelectedAssessment
.selectedICD.description +
(' (${widget.mySelectedAssessment
.selectedICD.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
],
),
SizedBox( SizedBox(
height: 7, height: 7,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
onClick: model.listOfDiagnosisCondition != null onClick: model.listOfDiagnosisCondition != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
@ -287,7 +320,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
} }
: null, : null,
hintText: TranslationBase.of(context).condition, hintText: TranslationBase.of(context).condition,
maxLines: 2, maxLines: 1,
minLines: 1, minLines: 1,
controller: conditionController, controller: conditionController,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
@ -304,6 +337,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
onClick: model.listOfDiagnosisType != null onClick: model.listOfDiagnosisType != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
@ -333,7 +368,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
} }
: null, : null,
hintText: TranslationBase.of(context).dType, hintText: TranslationBase.of(context).dType,
maxLines: 2, maxLines: 1,
minLines: 1, minLines: 1,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
@ -364,7 +399,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
SizedBox( SizedBox(
height: 10, height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10),
), ),
])), ])),
), ),
@ -372,63 +408,34 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
bottomSheet: model.state == ViewState.Busy?Container(height: 0,):Container( bottomSheet: model.state == ViewState.Busy?Container(height: 0,):
decoration: BoxDecoration(
color: Colors.white, BottomSheetDialogButton(
borderRadius: BorderRadius.all( label: (widget.isUpdate
Radius.circular(0.0), ? 'Update Assessment Details'
), : 'Add Assessment Details'),
border: Border.all(color: HexColor('#707070'), width: 0), onTap: () async {
), setState(() {
height: MediaQuery.of(context).size.height * 0.1, isFormSubmitted = true;
width: double.infinity, });
child: Column( widget.mySelectedAssessment.remark =
children: [ remarkController.text;
SizedBox( widget.mySelectedAssessment.appointmentId =
height: 10, int.parse(appointmentIdController.text);
), if (widget.mySelectedAssessment
Container( .selectedDiagnosisCondition !=
child: FractionallySizedBox( null &&
widthFactor: .80, widget.mySelectedAssessment
child: Center( .selectedDiagnosisType !=
child: AppButton( null &&
fontWeight: FontWeight.w700, widget.mySelectedAssessment.selectedICD != null) {
color: Colors.green, await submitAssessment(
title: (widget.isUpdate isUpdate: widget.isUpdate,
? 'Update Assessment Details' model: model,
: 'Add Assessment Details'), mySelectedAssessment:
loading: model.state == ViewState.BusyLocal, widget.mySelectedAssessment);
onPressed: () async { }
setState(() { },
isFormSubmitted = true;
});
widget.mySelectedAssessment.remark =
remarkController.text;
widget.mySelectedAssessment.appointmentId =
int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment
.selectedDiagnosisCondition !=
null &&
widget.mySelectedAssessment
.selectedDiagnosisType !=
null &&
widget.mySelectedAssessment.selectedICD != null) {
await submitAssessment(
isUpdate: widget.isUpdate,
model: model,
mySelectedAssessment:
widget.mySelectedAssessment);
}
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
), ),
), ),
), ),

@ -0,0 +1,3 @@
abstract class AssessmentCallBack{
nextFunction(model);
}

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_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/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';
@ -5,9 +6,11 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.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/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -22,39 +25,46 @@ import '../shared_soap_widgets/SOAP_open_items.dart';
import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/SOAP_step_header.dart';
import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart';
import 'add_assessment_details.dart'; import 'add_assessment_details.dart';
import 'assessment_call_back.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class UpdateAssessmentPage extends StatefulWidget { class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
UpdateAssessmentPage( UpdateAssessmentPage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.currentIndex}); this.changeLoadingState,
this.currentIndex});
@override @override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
} }
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> { class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
implements AssessmentCallBack {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List(); List<MySelectedAssessment> mySelectedAssessmentList = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.setAssessmentCallBack(this);
mySelectedAssessmentList.clear(); mySelectedAssessmentList.clear();
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: '', doctorID: '',
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
if (model.patientAssessmentList.isNotEmpty) { if (model.patientAssessmentList.isNotEmpty) {
if (model.listOfDiagnosisCondition.length == 0) { if (model.listOfDiagnosisCondition.length == 0) {
@ -83,11 +93,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
diagnosisType != null && diagnosisType != null &&
diagnosisCondition != null) { diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment = MySelectedAssessment temMySelectedAssessment =
MySelectedAssessment( SoapUtils.generateMySelectedAssessment(
appointmentId: element.appointmentNo, appointmentNo: element.appointmentNo,
remark: element.remarks, remark: element.remarks,
selectedDiagnosisType: diagnosisType, diagnosisType: diagnosisType,
selectedDiagnosisCondition: diagnosisCondition, diagnosisCondition: diagnosisCondition,
selectedICD: selectedICD, selectedICD: selectedICD,
doctorID: element.doctorID, doctorID: element.doctorID,
doctorName: element.doctorName, doctorName: element.doctorName,
@ -104,27 +114,24 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme backgroundColor: Theme.of(context).scaffoldBackgroundColor,
.of(context)
.scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
color: Theme
.of(context)
.scaffoldBackgroundColor,
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).assessment headerTitle: TranslationBase.of(context).assessment,
,
onTap: () { onTap: () {
setState(() { setState(() {
isAssessmentExpand = !isAssessmentExpand; isAssessmentExpand = !isAssessmentExpand;
@ -136,49 +143,53 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
Column( Column(
children: [ children: [
SOAPOpenItems(
SOAPOpenItems(label: "${TranslationBase.of(context).addAssessment}",onTap: () { label:
openAssessmentDialog(context, "${TranslationBase.of(context).addAssessment}",
isUpdate: false, model: model); onTap: () {
},), openAssessmentDialog(context,
isUpdate: false, model: model);
},
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Column( Column(
children: mySelectedAssessmentList children:
.map((assessment) { mySelectedAssessmentList.map((assessment) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5, right: 5, top: 15), left: 5, right: 5, top: 15, bottom: 15),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 12, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600,
letterSpacing: -0.4),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: "ICD : ".toUpperCase(), text: "ICD : ".toUpperCase(),
), ),
new TextSpan( new TextSpan(
text: assessment text: assessment
.selectedICD.code .selectedICD.code
.trim() .trim()
.toUpperCase() ?? .toUpperCase() ??
"", ""),
),
], ],
), ),
), ),
@ -190,11 +201,14 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 16, fontSize: SizeConfig
color: Color(0xFF2E303A), .getTextMultiplierBasedOnWidth() *
fontFamily: 'Poppins', 5,
fontWeight: color: Color(0xFF2E303A),
FontWeight.w600), fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: assessment text: assessment
@ -208,27 +222,35 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 12, fontSize: SizeConfig
color: Color(0xFF2E303A), .getTextMultiplierBasedOnWidth() *
fontFamily: 'Poppins', 3.5,
fontWeight: FontWeight.w600), color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.appointmentNo, .appointmentNo,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
new TextSpan( new TextSpan(
text: assessment text: assessment.appointmentId
.appointmentId.toString() .toString() ??
??
"", "",
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
), ),
@ -238,7 +260,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 12, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
@ -249,6 +273,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.condition + .condition +
" : ", " : ",
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
@ -262,7 +287,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisCondition .selectedDiagnosisCondition
.nameEn, .nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
), ),
@ -272,7 +300,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 12, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
@ -283,6 +313,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.dType + .dType +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
@ -296,7 +327,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisType .selectedDiagnosisType
.nameEn, .nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
), ),
@ -307,7 +341,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 12, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight:
@ -316,9 +352,13 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.doc + .doctor +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
@ -327,7 +367,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
assessment.doctorName ?? assessment.doctorName ??
'', '',
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
), ),
@ -337,42 +380,32 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
SizedBox( SizedBox(
height: 6, height: 6,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 6, height: 6,
), ),
AppText( AppText(
(assessment.remark != null && (assessment.remark != null &&
assessment.remark != assessment.remark !=
'') '')
? TranslationBase.of( ? TranslationBase.of(
context) context)
.remarks + .remarks +
" : " " : "
: '', : '',
fontSize: SizeConfig
fontSize: 12, .getTextMultiplierBasedOnWidth() *
color: Color(0xFF2E303A), 3,
fontFamily: 'Poppins', color: Color(0xFF2E303A),
fontWeight: fontFamily: 'Poppins',
FontWeight.w600 fontWeight: FontWeight.w600),
), RemarkText(
Container( remark: assessment.remark ?? "",
width: MediaQuery.of(context)
.size
.width *
0.38,
child: AppText(
assessment.remark ?? "",
fontSize: 11,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
), ),
], ],
), ),
@ -380,36 +413,42 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.end, CrossAxisAlignment.end,
children: [ children: [
Row( Row(
children: [ children: [
Column( Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
assessment.createdOn != null assessment.createdOn != null
? AppDateUtils ? AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.parse( DateTime.parse(
assessment assessment
.createdOn)) .createdOn))
: AppDateUtils : AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight fontWeight: FontWeight.w600,
.w600, fontSize: SizeConfig
fontSize: 14, .getTextMultiplierBasedOnWidth() *
), AppText( 3.6,
),
AppText(
assessment.createdOn != null assessment.createdOn != null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
assessment assessment
.createdOn)) .createdOn))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight fontWeight: FontWeight.w600,
.w600, color: Color(0xFF575757),
fontSize: 14, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
), ),
], ],
), ),
@ -417,8 +456,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context) height: MediaQuery.of(context)
.size .size
.height * .height *
0.05, 0.05,
), ),
InkWell( InkWell(
@ -429,7 +468,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
model: model); model: model);
}, },
child: Icon( child: Icon(
DoctorApp.edit, size: 18,), DoctorApp.edit,
size: 18,
),
) )
], ],
), ),
@ -441,7 +482,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
], ],
) )
]), ]),
isExpanded: isAssessmentExpand, isExpanded: isAssessmentExpand,
), ),
SizedBox( SizedBox(
height: 130, height: 130,
@ -452,77 +493,6 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
), ),
), ),
bottomSheet:Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(
color: HexColor('#707070'),
width: 0),
),
height: 80,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(child:
FractionallySizedBox(
widthFactor: .80,
child: Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase
.of(context)
.previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.changePageViewIndex(1);
},
)
,
),
SizedBox(width: 5,),
Expanded(
child: AppButton(
title: TranslationBase
.of(context)
.next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
if (mySelectedAssessmentList.isEmpty) {
Helpers.showErrorToast(
TranslationBase
.of(context)
.assessmentErrorMsg);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(3);
}
},
),
),
],
),
),
),),
SizedBox(
height: 5,
),
],
),)
), ),
); );
} }
@ -530,8 +500,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
openAssessmentDialog(BuildContext context, openAssessmentDialog(BuildContext context,
{MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) {
if (assessment == null) { if (assessment == null) {
assessment = MySelectedAssessment( assessment = SoapUtils.generateMySelectedAssessment(
remark: '', appointmentId: widget.patientInfo.appointmentNo); remark: '', appointmentNo: widget.patientInfo.appointmentNo);
} }
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -546,11 +516,20 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async { bool isUpdate) async {
setState(() { setState(() {
if(!isUpdate) if (!isUpdate)
mySelectedAssessmentList.add(mySelectedAssessment); mySelectedAssessmentList.add(mySelectedAssessment);
}); });
}); });
}); });
} }
}
@override
nextFunction(model) {
if (mySelectedAssessmentList.isEmpty) {
Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(3);
}
}
}

@ -1,9 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_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_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.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/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -16,7 +18,7 @@ import 'examinations_list_search_widget.dart';
class AddExaminationPage extends StatefulWidget { class AddExaminationPage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination; final Function (List<MySelectedExamination>)addSelectedExamination;
final Function(MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
AddExaminationPage( AddExaminationPage(
@ -29,6 +31,14 @@ class AddExaminationPage extends StatefulWidget {
} }
class _AddExaminationPageState extends State<AddExaminationPage> { class _AddExaminationPageState extends State<AddExaminationPage> {
List<MySelectedExamination> mySelectedExaminationLocal;
@override
initState() {
super.initState();
mySelectedExaminationLocal = [...widget.mySelectedExamination];
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
@ -71,14 +81,15 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
masterList: model.physicalExaminationList, masterList: model.physicalExaminationList,
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
removeExamination: (history) { removeExamination: (selectedExamination) {
setState(() { setState(() {
widget.removeExamination(history); mySelectedExaminationLocal.remove(selectedExamination);
}); });
}, },
addHistory: (selectedExamination) { addExamination: (selectedExamination) {
widget.mySelectedExamination
.add(selectedExamination); mySelectedExaminationLocal
.insert(0, selectedExamination);
// setState(() {}); // setState(() {});
}, },
), ),
@ -91,48 +102,21 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
), ),
], ],
), ),
bottomSheet: Container( bottomSheet: model.state != ViewState.Idle
decoration: BoxDecoration( ? Container(
color: Colors.white, height: 0,
borderRadius: BorderRadius.all( )
Radius.circular(0.0), : BottomSheetDialogButton(
), label: "${TranslationBase.of(context).addExamination}",
border: Border.all(color: HexColor('#707070'), width: 0), onTap: () {
), widget.addSelectedExamination(mySelectedExaminationLocal);
height: MediaQuery.of(context).size.height * 0.1, },
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
), ),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
"${TranslationBase.of(context).addExamination}",
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedExamination();
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
),
)); ));
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where( Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where(
(element) => (element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination.typeId);

@ -2,7 +2,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
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/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_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
@ -14,7 +14,7 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class AddExaminationWidget extends StatefulWidget { class AddExaminationWidget extends StatefulWidget {
MasterKeyModel item; MasterKeyModel item;
final Function(MasterKeyModel) removeExamination; final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination; final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand; bool isExpand;
@ -36,7 +36,7 @@ class AddExaminationWidget extends StatefulWidget {
} }
class _AddExaminationWidgetState extends State<AddExaminationWidget> { class _AddExaminationWidgetState extends State<AddExaminationWidget> {
int status = 3; int status = 1;
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
MySelectedExamination examination = MySelectedExamination(); MySelectedExamination examination = MySelectedExamination();
@ -65,38 +65,32 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( InkWell(
child: CheckboxListTile( onTap: (){
title: AppText( onExamTap();
projectViewModel.isArabic },
? widget.item.nameAr != null && widget.item.nameAr != "" child: Row(
? widget.item.nameAr children: [
: widget.item.nameEn Checkbox(
: widget.item.nameEn, value:widget.isServiceSelected(widget.item),
fontWeight: FontWeight.normal, activeColor: Colors.red[800],
fontFamily: 'Poppins', onChanged: (bool newValue) {
fontSize: SizeConfig.textMultiplier * 2.0, onExamTap();
), }),
value: widget.isServiceSelected(widget.item), Container(
activeColor: HexColor("#D02127"), child: AppText(
onChanged: (newValue) { projectViewModel.isArabic
setState(() { ? widget.item.nameAr != null && widget.item.nameAr != ""
if (widget.isServiceSelected(widget.item)) { ? widget.item.nameAr
if (examination.isLocal) : widget.item.nameEn
widget.removeExamination(widget.item); : widget.item.nameEn,
widget.expandClick();
} else { color: Color(0xFF575757),
examination.isNormal = status == 1; fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isWidthLarge?3:3.8),
examination.isAbnormal = status == 2; letterSpacing: -0.56,
examination.notExamined = status == 3; ),
examination.remark = remarksController.text; ),
widget.addExamination(examination); ],
widget.expandClick();
}
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
), ),
), ),
Container( Container(
@ -271,6 +265,23 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
); );
} }
onExamTap(){
setState(() {
if (widget.isServiceSelected(widget.item)) {
if (examination.isLocal)
widget.removeExamination(examination);
widget.expandClick();
} else {
examination.isNormal = status == 1;
examination.isAbnormal = status == 2;
examination.notExamined = status == 3;
examination.remark = remarksController.text;
widget.addExamination(examination);
widget.expandClick();
}
});
}
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { MySelectedExamination getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where( Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) => (element) =>

@ -1,9 +1,13 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
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/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ExaminationItemCard extends StatelessWidget { class ExaminationItemCard extends StatelessWidget {
@ -42,32 +46,38 @@ class ExaminationItemCard extends StatelessWidget {
)), )),
], ],
), ),
AppText( Row(
!examination.isNormal mainAxisAlignment: MainAxisAlignment.spaceBetween,
? examination.isAbnormal children: [
? TranslationBase.of(context).abnormal AppText(
: TranslationBase.of(context).notExamined !examination.isNormal
: TranslationBase.of(context).normal, ? examination.isAbnormal
fontWeight: FontWeight.bold, ? TranslationBase.of(context).abnormal
fontFamily: 'Poppins', : TranslationBase.of(context).notExamined
color: !examination.isNormal : TranslationBase.of(context).normal,
? examination.isAbnormal fontWeight: FontWeight.bold,
? Colors.red.shade800 fontFamily: 'Poppins',
: Colors.grey.shade800 color: !examination.isNormal
: Colors.green.shade800, ? examination.isAbnormal
fontSize: SizeConfig.textMultiplier * 1.8, ? Colors.red.shade800
: Colors.grey.shade800
: Colors.green.shade800,
fontSize: SizeConfig.textMultiplier * 1.8,
),
if (!examination.notExamined)
RemoveButton(
label: examination.isLocal
? TranslationBase.of(context).remove
: TranslationBase.of(context).notExamined,
onTap: removeExamination,
),
],
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
if(examination.remark.isNotEmpty) if (examination.remark.isNotEmpty)
AppText( RemarkText(remark: examination.remark),
examination.remark,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.8,
),
], ],
), ),
); );

@ -1,5 +1,6 @@
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_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/util/helpers.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@ -8,15 +9,15 @@ import 'package:flutter/material.dart';
import 'add_examination_widget.dart'; import 'add_examination_widget.dart';
class ExaminationsListSearchWidget extends StatefulWidget { class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MasterKeyModel) removeExamination; final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addHistory; final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList; final List<MasterKeyModel> masterList;
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
ExaminationsListSearchWidget( ExaminationsListSearchWidget(
{this.removeExamination, {this.removeExamination,
this.addHistory, this.addExamination,
this.isServiceSelected, this.isServiceSelected,
this.masterList, this.mySelectedExamination}); this.masterList, this.mySelectedExamination});
@ -42,10 +43,11 @@ class _ExaminationsListSearchWidgetState
return Column( return Column(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
height: MediaQuery.of(context).size.height * 0.080, height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).searchExamination, hintText: TranslationBase.of(context).searchExamination,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);
@ -62,7 +64,7 @@ class _ExaminationsListSearchWidgetState
...items.mapIndexed((index, item) { ...items.mapIndexed((index, item) {
return AddExaminationWidget( return AddExaminationWidget(
item: item, item: item,
addExamination: widget.addHistory, addExamination: widget.addExamination,
removeExamination: widget.removeExamination, removeExamination: widget.removeExamination,
mySelectedExamination: widget.mySelectedExamination, mySelectedExamination: widget.mySelectedExamination,
isServiceSelected: widget.isServiceSelected, isServiceSelected: widget.isServiceSelected,

@ -0,0 +1,3 @@
abstract class ObjectiveCallBack{
nextFunction(model);
}

@ -1,14 +1,16 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_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/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/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.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_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.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';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -23,6 +25,7 @@ import '../shared_soap_widgets/SOAP_step_header.dart';
import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart';
import 'add_examination_page.dart'; import 'add_examination_page.dart';
import 'examination_item_card.dart'; import 'examination_item_card.dart';
import 'objective_call_back.dart';
class UpdateObjectivePage extends StatefulWidget { class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
@ -41,7 +44,8 @@ class UpdateObjectivePage extends StatefulWidget {
_UpdateObjectivePageState createState() => _UpdateObjectivePageState(); _UpdateObjectivePageState createState() => _UpdateObjectivePageState();
} }
class _UpdateObjectivePageState extends State<UpdateObjectivePage> { class _UpdateObjectivePageState extends State<UpdateObjectivePage>
implements ObjectiveCallBack {
bool isSysExaminationExpand = false; bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List(); List<MySelectedExamination> mySelectedExamination = List();
@ -62,15 +66,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.setObjectiveCallBack(this);
mySelectedExamination.clear(); mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel = model.isAddExamInProgress = true;
GetPhysicalExamReqModel( await model.getPatientPhysicalExam(widget.patientInfo);
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) { if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
@ -80,8 +79,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
masterKeys: MasterKeysService.PhysicalExamination, masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId, id: element.examId,
); );
MySelectedExamination tempEam = MySelectedExamination( MySelectedExamination tempEam =
selectedExamination: examMaster, SoapUtils.generateMySelectedExamination(
examination: examMaster,
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
createdBy: element.createdBy, createdBy: element.createdBy,
@ -95,174 +95,201 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
mySelectedExamination.add(tempEam); mySelectedExamination.add(tempEam);
}); });
} }
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( physics: ScrollPhysics(),
child: FractionallySizedBox( child: Center(
widthFactor: 0.9, child: FractionallySizedBox(
child: Column( widthFactor: 0.9,
mainAxisAlignment: MainAxisAlignment.start, child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.start,
SOAPStepHeader( crossAxisAlignment: CrossAxisAlignment.start,
currentIndex: widget.currentIndex, children: [
changePageViewIndex: widget.changePageViewIndex), SOAPStepHeader(
ExpandableSOAPWidget( currentIndex: widget.currentIndex,
headerTitle: changePageViewIndex: widget.changePageViewIndex,
TranslationBase.of(context).physicalSystemExamination, patientInfo: widget.patientInfo,
onTap: () { ),
setState(() { ExpandableSOAPWidget(
isSysExaminationExpand = !isSysExaminationExpand; headerTitle:
}); TranslationBase.of(context).physicalSystemExamination,
}, onTap: () {
child: Column( setState(() {
children: [ isSysExaminationExpand = !isSysExaminationExpand;
SOAPOpenItems( });
label: },
"${TranslationBase.of(context).addExamination}", child: Column(
onTap: () { children: [
openExaminationList(context); SOAPOpenItems(
}, label:
), "${TranslationBase.of(context).addExamination}",
Column( onTap: () {
children: mySelectedExamination.map((examination) { openExaminationList(context);
return ExaminationItemCard(examination, () { },
removeExamination( ),
examination.selectedExamination); if (mySelectedExamination.isNotEmpty &&
}); mySelectedExamination.first.isLocal)
}).toList(), Row(
) children: [
], AppText(
), "New",
isExpanded: isSysExaminationExpand, fontWeight: FontWeight.w600,
), fontFamily: 'Poppins',
SizedBox( color: Color(0xFFCC9B14),
height: MediaQuery.of(context).size.height * 0.12, ),
) ],
],
),
),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: 80,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 5,
), ),
Expanded( Column(
child: AppButton( children: mySelectedExamination
title: TranslationBase.of(context).next, .sublist(
fontWeight: FontWeight.w600, 0,
color: Colors.red[700], model.getFirstIndexForOldExamination(
disabled: model.state == ViewState.BusyLocal, mySelectedExamination) ==
onPressed: () async { -1
await submitUpdateObjectivePage(model); ? 0
}, : model.getFirstIndexForOldExamination(
), mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
});
}).toList(),
),
if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination(
mySelectedExamination) >
-1)
Row(
children: [
AppText(
"Verified",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.green,
),
],
), ),
], Column(
), children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
});
}).toList(),
)
],
), ),
isExpanded: isSysExaminationExpand,
), ),
), SizedBox(
SizedBox( height: SizeConfig.heightMultiplier *
height: 5, (SizeConfig.isHeightVeryShort ? 14 : 12),
), )
], ],
),
), ),
)), ),
),
),
); );
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
widget.changeLoadingState(true); if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null &&
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); widget.patientInfo.admissionNo.isNotEmpty) {
Navigator.of(context).pop();
}else{
widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel(); new PostPhysicalExamRequestModel();
mySelectedExamination.forEach((exam) { mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null) null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[]; [];
ListHisProgNotePhysicalExaminationVM
listHisProgNotePhysicalExaminationVM =
ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo == null?0: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo == null?0:widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew,
);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo);
} else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0;
}
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(listHisProgNotePhysicalExaminationVM);
});
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM if (model.patientPhysicalExamList.isEmpty) {
.add(ListHisProgNotePhysicalExaminationVM( await model.postPhysicalExam(postPhysicalExamRequestModel);
patientMRN: widget.patientInfo.patientMRN, } else {
episodeId: widget.patientInfo.episodeNo, await model.patchPhysicalExam(postPhysicalExamRequestModel);
appointmentNo: widget.patientInfo.appointmentNo, }
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
});
if (model.patientPhysicalExamList.isEmpty) { if (model.state == ViewState.ErrorLocal) {
await model.postPhysicalExam(postPhysicalExamRequestModel); widget.changeLoadingState(false);
} else { Helpers.showErrorToast(model.error);
await model.patchPhysicalExam(postPhysicalExamRequestModel); if(widget.patientInfo.admissionNo != null &&
} widget.patientInfo.admissionNo.isNotEmpty) {
// Navigator.of(context).pop();
model.isAddExamInProgress = false;
}
} else {
if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
// Navigator.of(context).pop();
widget.changeLoadingState(false);
model.isAddExamInProgress = false;
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
if (model.state == ViewState.ErrorLocal) { }
widget.changeLoadingState(false);
Helpers.showErrorToast(model.error);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
} }
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
} }
@ -274,10 +301,17 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) if (history.length > 0) {
setState(() { setState(() {
mySelectedExamination.remove(history.first); if (history.first.isLocal) {
mySelectedExamination.remove(history.first);
} else {
history.first.notExamined = true;
history.first.isNormal = false;
history.first.isAbnormal = false;
}
}); });
}
} }
openExaminationList(BuildContext context) { openExaminationList(BuildContext context) {
@ -286,69 +320,48 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
FadePage( FadePage(
page: AddExaminationPage( page: AddExaminationPage(
mySelectedExamination: mySelectedExamination, mySelectedExamination: mySelectedExamination,
addSelectedExamination: () { addSelectedExamination:
(List<MySelectedExamination> mySelectedExaminationLocal) {
setState(() { setState(() {
Navigator.of(context).pop(); {
mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
mySelectedExamination.insert(0,element);
}
});
/// remove items.
List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
removedList.add(element);
}
});
removedList.forEach((element) {
removeExamination(element.selectedExamination);
});
Navigator.of(context).pop();
}
}); });
}, },
removeExamination: (masterKey) => removeExamination(masterKey)), removeExamination: (masterKey) => removeExamination(masterKey)),
), ),
); );
} }
}
class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key);
@override
_AddExaminationDailogState createState() => _AddExaminationDailogState();
}
class _AddExaminationDailogState extends State<AddExaminationDailog> {
@override @override
Widget build(BuildContext context) { nextFunction(model) async {
return FractionallySizedBox( await submitUpdateObjectivePage(model);
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
]),
))),
)),
);
} }
} }

@ -0,0 +1,3 @@
abstract class PlanCallBack{
nextFunction(model);
}

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.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/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
@ -8,6 +10,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -25,6 +28,8 @@ class UpdatePlanPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final Function changeLoadingState; final Function changeLoadingState;
final Function changeStateFun;
final SOAPViewModel sOAPViewModel;
final int currentIndex; final int currentIndex;
@ -33,13 +38,16 @@ class UpdatePlanPage extends StatefulWidget {
this.changePageViewIndex, this.changePageViewIndex,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.currentIndex}); this.currentIndex,
this.sOAPViewModel,
this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
} }
class _UpdatePlanPageState extends State<UpdatePlanPage> { class _UpdatePlanPageState extends State<UpdatePlanPage>
implements PlanCallBack {
bool isAddProgress = true; bool isAddProgress = true;
bool isProgressExpanded = true; bool isProgressExpanded = true;
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel patientProgressNote =
@ -71,317 +79,280 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
} }
} }
getPatientProgressNote(SOAPViewModel model,
getPatientProgressNote(model, {bool isAddProgress = false}) async { {bool isAddProgress = false}) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel( GetGetProgressNoteReqModel(
appointmentNo: appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) { ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn; widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn; widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName; widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo; widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = isAddProgress; isAddProgress = isAddProgress;
}); widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
});
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = widget.sOAPViewModel.setPlanCallBack(this);
GetGetProgressNoteReqModel( GetGetProgressNoteReqModel getGetProgressNoteReqModel =
appointmentNo: GetGetProgressNoteReqModel(
int.parse(widget.patientInfo.appointmentNo.toString()), appointmentNo:
patientMRN: widget.patientInfo.patientMRN, int.parse(widget.patientInfo.appointmentNo.toString()),
episodeID: widget.patientInfo.episodeNo.toString(), patientMRN: widget.patientInfo.patientMRN,
editedBy: '', episodeID: widget.patientInfo.episodeNo.toString(),
doctorID: ''); editedBy: '',
await model.getPatientProgressNote(getGetProgressNoteReqModel); doctorID: '');
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn; widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn; widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName; widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo; widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
}); widget.sOAPViewModel.isAddProgress = false;
} });
widget.changeLoadingState(false); }
}, widget.changeLoadingState(false);
builder: (_, model, w) => AppScaffold( },
backgroundColor: Theme.of(context).scaffoldBackgroundColor, builder: (_, model, w) => AppScaffold(
isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( isShowAppBar: false,
physics: ScrollPhysics(), body: SingleChildScrollView(
child: Center( physics: ScrollPhysics(),
child: FractionallySizedBox( child: Center(
widthFactor: 0.90, child: FractionallySizedBox(
child: Column( widthFactor: 0.90,
children: [ child: Column(
SOAPStepHeader( children: [
currentIndex: widget.currentIndex, SOAPStepHeader(
changePageViewIndex: widget.changePageViewIndex), currentIndex: widget.currentIndex,
SizedBox( changePageViewIndex: widget.changePageViewIndex,
height: 10, patientInfo: widget.patientInfo,
), ),
ExpandableSOAPWidget( SizedBox(
headerTitle: TranslationBase.of(context).progressNote, height: 10,
onTap: () { ),
setState(() { ExpandableSOAPWidget(
isProgressExpanded = !isProgressExpanded; headerTitle: TranslationBase.of(context).progressNote,
}); onTap: () {
}, setState(() {
child: Column( isProgressExpanded = !isProgressExpanded;
mainAxisAlignment: MainAxisAlignment.start, });
children: [ },
Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
if (isAddProgress) Column(
Container( crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only( children: [
left: 10, right: 10, top: 15), if (isAddProgress)
child: AppTextFieldCustom( Container(
hintText: TranslationBase.of(context) margin: EdgeInsets.only(
.progressNote, left: 10, right: 10, top: 15),
controller: progressNoteController, child: AppTextFieldCustom(
minLines: 2, hintText: TranslationBase.of(context)
maxLines: 4, .progressNote,
inputType: TextInputType.multiline, controller: progressNoteController,
onChanged: (value) { minLines: 2,
setState(() { maxLines: 4,
patientProgressNote.planNote = value; inputType: TextInputType.multiline,
}); onChanged: (value) {
}, setState(() {
), patientProgressNote.planNote =
), value;
SizedBox( model.progressNoteText = value;
height: 9, widget.changeStateFun();
), });
if (patientProgressNote.planNote != null && },
!isAddProgress) ),
Container( ),
margin: EdgeInsets.only( SizedBox(
left: 5, height: 9,
right: 5,
), ),
child: Column( if (patientProgressNote.planNote != null &&
crossAxisAlignment: !isAddProgress)
CrossAxisAlignment.start, Container(
children: [ margin: EdgeInsets.only(
Row( left: 5,
mainAxisAlignment: right: 5,
MainAxisAlignment.spaceBetween, ),
child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( Row(
'Appointment No: ', children: [
fontSize: 12, AppText(
'Appointment No: ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757),
),
AppText(
patientProgressNote
.appointmentNo !=
null
? patientProgressNote
.appointmentNo
.toString()
: '',
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
],
), ),
AppText( AppText(
patientProgressNote patientProgressNote.createdOn !=
.appointmentNo !=
null null
? patientProgressNote ? AppDateUtils
.appointmentNo .getDayMonthYearDateFormatted(
.toString() DateTime.parse(
: '', patientProgressNote
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: SizeConfig
), .getTextMultiplierBasedOnWidth() *
3.6,
)
], ],
), ),
AppText( Row(
patientProgressNote.createdOn != mainAxisAlignment:
null MainAxisAlignment.end,
? AppDateUtils crossAxisAlignment:
.getDayMonthYearDateFormatted( CrossAxisAlignment.start,
children: [
// Row(
// children: [
// AppText(
// 'Condition: ',
// fontSize: 12,
// ),
// AppText(
// patientProgressNote.mName ??
// '',
// fontWeight: FontWeight.w600),
// ],
// ),
AppText(
patientProgressNote.createdOn !=
null
? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn))
: AppDateUtils : AppDateUtils.getHour(
.getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, color: Color(0xFF575757),
) fontSize: SizeConfig
], .getTextMultiplierBasedOnWidth() *
), 3.6,
Row( )
mainAxisAlignment: ],
MainAxisAlignment.end, ),
crossAxisAlignment: SizedBox(
CrossAxisAlignment.start, height: 8,
children: [ ),
// Row( Row(
// children: [ mainAxisAlignment:
// AppText( MainAxisAlignment.start,
// 'Condition: ', children: [
// fontSize: 12, Expanded(
// ), child: AppText(
// AppText( progressNoteController.text,
// patientProgressNote.mName ?? fontSize: 10,
// '', ),
// fontWeight: FontWeight.w600), ),
// ], InkWell(
// ), onTap: () {
AppText( setState(() {
patientProgressNote.createdOn != isAddProgress = true;
null widget.sOAPViewModel
? AppDateUtils.getHour( .isAddProgress = true;
DateTime.parse( });
patientProgressNote },
.createdOn)) child: Icon(
: AppDateUtils.getHour( DoctorApp.edit,
DateTime.now()), size: 18,
fontWeight: FontWeight.w600, ))
fontSize: 14, ],
)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
progressNoteController.text,
fontSize: 10,
),
), ),
InkWell(
onTap: () {
setState(() {
isAddProgress = true;
});
},
child: Icon(
DoctorApp.edit,
size: 18,
))
], ],
), ),
], )
), ],
) ),
], ],
), ),
], isExpanded: isProgressExpanded,
), ),
isExpanded: isProgressExpanded, SizedBox(
), height: SizeConfig.heightMultiplier *
], (SizeConfig.isHeightVeryShort ? 20 : 10),
), ),
), ],
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: 80,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.changePageViewIndex(2);
},
),
),
SizedBox(
width: 5,
),
Expanded(
child: AppButton(
title: isAddProgress
? TranslationBase.of(context).next
: TranslationBase.of(context).finish,
fontWeight: FontWeight.w600,
color: Colors.red[700],
disabled: progressNoteController.text.isEmpty,
onPressed: () async {
if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) {
submitPlan(model);
} else {
Navigator.of(context).pop();
}
} else {
Helpers.showErrorToast(
TranslationBase.of(context)
.progressNoteErrorMsg);
}
},
),
),
],
),
), ),
), ),
), ),
SizedBox( ),
height: 5, ));
),
],
),
)),
);
} }
submitPlan(SOAPViewModel model) async { submitPlan(SOAPViewModel model) async {
@ -396,45 +367,48 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
doctorID: '', doctorID: '',
editedBy: ''); editedBy: '');
if (model.patientProgressNoteList.isEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await model.postProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel
.postProgressNote(postProgressNoteRequestModel);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await model.patchProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel
.patchProgressNote(postProgressNoteRequestModel);
} }
if (model.state == ViewState.ErrorLocal) { if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(widget.sOAPViewModel.error);
} else { } else {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel( GetGetProgressNoteReqModel(
appointmentNo: appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel
if (model.patientProgressNoteList.isNotEmpty) { .getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn; widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn; widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName; widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo; widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
}); });
} }
} }
@ -443,4 +417,17 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} }
} }
@override
nextFunction(model) {
if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) {
submitPlan(model);
} else {
Navigator.of(context).pop();
}
} else {
Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
}
}
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,20 +36,24 @@ class SOAPOpenItems extends StatelessWidget {
children: [ children: [
AppText( AppText(
"$label", "$label",
fontSize:15, fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4.5,
color: Colors.black, fontWeight: FontWeight.w700,
fontWeight: FontWeight.w600, color: Color(0xFF2E303A),
letterSpacing:-0.44 ,
), ),
AppText( AppText(
"${TranslationBase.of(context).searchHere}", "${TranslationBase.of(context).searchHere}",
fontSize:13, fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*3.5,
color: Colors.grey.shade700, fontWeight: FontWeight.w500,
color: Color(0xFF575757),
letterSpacing:-0.56 ,
), ),
], ],
)), )),
Icon( Icon(
Icons.add_box_rounded, Icons.add_box_rounded,
size: 25, size: 28,
color: Color(0xFF2E303A),
) )
], ],
), ),

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -6,11 +8,12 @@ import 'package:flutter/material.dart';
class SOAPStepHeader extends StatelessWidget { class SOAPStepHeader extends StatelessWidget {
const SOAPStepHeader({ const SOAPStepHeader({
Key key, Key key,
this.currentIndex, this.changePageViewIndex, this.currentIndex, this.changePageViewIndex, this.patientInfo,
}) : super(key: key); }) : super(key: key);
final int currentIndex; final int currentIndex;
final Function changePageViewIndex; final Function changePageViewIndex;
final PatiantInformtion patientInfo;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -18,25 +21,32 @@ class SOAPStepHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 15,), SizedBox(height: SizeConfig.isHeightVeryShort?30: 15,),
AppText( AppText(
TranslationBase.of(context).createNew, TranslationBase.of(context).createNew,
fontSize: 14, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
letterSpacing:-0.72,
color: Color(0xFF2E303A),
), ),
AppText(TranslationBase.of(context).episode, AppText(TranslationBase.of(context).episode,
fontSize: 26, fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 8),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing:-1.44,
color: Color(0xFF2E303A),
), ),
Container( Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
child: StepsWidget( child: StepsWidget(
index: currentIndex, index: currentIndex,
changeCurrentTab: changePageViewIndex, changeCurrentTab: changePageViewIndex,
patientInfo: patientInfo,
), ),
), ),
SizedBox( SizedBox(
height: 30, height:SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 1 : 2),
), ),
], ],
); );

@ -0,0 +1,52 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class BottomSheetDialogButton extends StatelessWidget {
final Function onTap;
final String label;
double headerHeight = SizeConfig.heightMultiplier * 12;
BottomSheetDialogButton({Key key, this.onTap, this.label}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#EFEFEF'), width: 1),
),
height: headerHeight,
width: double.infinity,
child: Column(
children: [
Container(
margin: EdgeInsets.only(
top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2)),
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
title: label,
padding: 10,
color: Color(0xFF359846),
onPressed: onTap,
),
),
),
),
SizedBox(
height: 5,
),
],
),
);
}
}

@ -1,63 +1,67 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
const BottomSheetTitle({ BottomSheetTitle({
Key key, this.title, Key key, this.title,
}) : super(key: key); }) : super(key: key);
final String title; final String title;
double headerHeight = SizeConfig.heightMultiplier*15;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.only( // padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5), // left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: 115, height: headerHeight,
child: Container( child: Center(
padding: EdgeInsets.only( child: Container(
left: 10, right: 10), padding: EdgeInsets.only(
margin: EdgeInsets.only(top: 60), left: 10, right: 10),
child: Column( margin: EdgeInsets.only(top: headerHeight *0.5),
children: [ child: Column(
Row( children: [
mainAxisAlignment: Row(
MainAxisAlignment.spaceBetween, mainAxisAlignment:
children: [ MainAxisAlignment.spaceBetween,
RichText( children: [
text: TextSpan( RichText(
style: TextStyle( text: TextSpan(
fontSize:20, style: TextStyle(
color: Colors.black), fontSize:20,
children: <TextSpan>[ color: Colors.black),
new TextSpan( children: <TextSpan>[
new TextSpan(
text: title, text: title,
style: TextStyle( style: TextStyle(
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 22)), fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)),
], ],
),
), ),
), InkWell(
InkWell( onTap: () {
onTap: () { Navigator.pop(context);
Navigator.pop(context); },
}, child: Icon(DoctorApp.close_1,
child: Icon(DoctorApp.close_1, size:SizeConfig.getTextMultiplierBasedOnWidth()*5,
size:20, color: Color(0xFF2B353E)))
color: Color(0xFF2B353E))) ],
], ),
), ],
], ),
), ),
), ),
); );
} }
@override @override
Size get preferredSize => Size(double.maxFinite,115); Size get preferredSize => Size(double.maxFinite,headerHeight);
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
@ -19,7 +20,7 @@ class ExpandableSOAPWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 10), padding: EdgeInsets.symmetric(vertical: SizeConfig.isHeightVeryShort ?10:20, horizontal: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -41,12 +42,14 @@ class ExpandableSOAPWidget extends StatelessWidget {
children: [ children: [
AppText(headerTitle, AppText(headerTitle,
variant: isExpanded ? "bodyText" : '', variant: isExpanded ? "bodyText" : '',
fontSize: 15, fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5),
color: Colors.black), letterSpacing:-0.64,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),),
if(isRequired) if(isRequired)
Icon( Icon(
FontAwesomeIcons.asterisk, FontAwesomeIcons.asterisk,
size: 12, size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5,
) )
], ],
), ),

@ -0,0 +1,24 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class RemarkText extends StatelessWidget {
final String remark;
const RemarkText({
Key key, this.remark,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width * 0.55,
child: AppText(
remark ?? '',
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
);
}
}

@ -0,0 +1,39 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
class RemoveButton extends StatelessWidget {
final Function onTap;
final String label;
const RemoveButton({Key key, this.onTap, this.label}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
child: Row(
children: [
Container(
child: AppText(
label??TranslationBase.of(context).remove,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
fontWeight: FontWeight.w700,
color: HexColor("#D02127"),
letterSpacing:-0.48,
),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#D02127"),
size: SizeConfig.getTextMultiplierBasedOnWidth() *4,
),
],
),
onTap: onTap,
);
}
}

@ -0,0 +1,22 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class StepDetailsWidget extends StatelessWidget {
final String stepLabel;
final double marginLeft;
const StepDetailsWidget({
Key key, this.stepLabel, this.marginLeft = 0,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AppText(
stepLabel,
fontWeight: FontWeight.bold,
marginLeft: marginLeft,
fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12,
);
}
}

@ -0,0 +1,52 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class StatusLabel extends StatelessWidget {
const StatusLabel({
Key key,
this.stepId,
this.selectedStepId,
}) : super(key: key);
final int stepId;
final int selectedStepId;
@override
Widget build(BuildContext context) {
return Container(
width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration(
color: stepId == selectedStepId
? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
child: Center(
child: AppText(
stepId == selectedStepId
? TranslationBase.of(context).inProgress
: stepId < selectedStepId
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7,
color: stepId == selectedStepId
? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
),
),
);
}
}

@ -0,0 +1,511 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'Step_details_widget.dart';
class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
final double height;
final PatiantInformtion patientInfo;
StepsWidget(
{Key key,
this.index,
this.changeCurrentTab,
this.height = 0.0,
this.patientInfo});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
double circleHeight = (SizeConfig.isHeightVeryShort
? 30
: SizeConfig.isHeightShort
? 38
: 38);
double circleTop = (SizeConfig.isHeightVeryShort
? 12
: SizeConfig.isHeightShort
? 10
: 10);
double containerHeight =
SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 16 : 15);
return !projectViewModel.isArabic
? Stack(
children: [
Container(
height: height == 0 ? containerHeight : height,
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent,
),
Positioned(
top: 30,
child: Center(
child: Container(
width: MediaQuery.of(context).size.width *
(patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty
? 0.9
: 0.85),
child: Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
),
),
),
Positioned(
top: circleTop,
left: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 5),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepDetailsWidget(
stepLabel: "Subjective",
),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
],
),
],
),
),
),
Positioned(
top: circleTop,
left: patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty
? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.71,
child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepDetailsWidget(
stepLabel: "Objective",
),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
],
),
],
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
Positioned(
top: circleTop,
left: MediaQuery.of(context).size.width * 0.47,
child: InkWell(
onTap: () {
if (index >= 3) changeCurrentTab(2);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepDetailsWidget(
stepLabel: "Assessment",
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
],
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
Positioned(
top: circleTop,
right: 0,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
StepDetailsWidget(
stepLabel: "Plan",
marginLeft: 30,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
],
),
),
),
],
)
: Stack(
children: [
Container(
height: height == 0 ? 100 : height,
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent,
),
Positioned(
top: 30,
child: Center(
child: Container(
width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.9:0.85),
child: Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
),
),
),
Positioned(
top: circleTop,
right: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 3),
Column(
children: [
StepDetailsWidget(
stepLabel: "شخصي",
),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
],
),
],
),
),
),
Positioned(
top: circleTop,
right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.25:0.71),
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 5),
Column(
children: [
StepDetailsWidget(
stepLabel: "هدف",
),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
],
),
],
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
Positioned(
top: circleTop,
right: MediaQuery.of(context).size.width * 0.50,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Padding(
padding: const EdgeInsets.only(right: 2),
child: Column(
children: [
StepDetailsWidget(
stepLabel: "تقدير",
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
),
],
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
Positioned(
top: circleTop,
left: 0,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: circleHeight,
height: circleHeight,
decoration: BoxDecoration(
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Container(
margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: Column(
children: [
StepDetailsWidget(
stepLabel: "خطة",
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
),
],
),
),
),
],
);
}
}

@ -1,554 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
final double height;
StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return !projectViewModel.isArabic
? Stack(
children: [
Container(
height: height == 0 ? 100 : height,
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent,
),
Positioned(
top: 30
,
child: Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width * 0.9,
child: Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
),
),),
Positioned(
top: 10,
left: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 5),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
"Subjective",
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
],
),
],
),
),
),
Positioned(
top: 10,
left: MediaQuery
.of(context)
.size
.width * 0.25,
child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
"Objective",
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
],
),
],
),
),
),
Positioned(
top: 10,
left: MediaQuery
.of(context)
.size
.width * 0.50,
child: InkWell(
onTap: () {
if (index >= 3) changeCurrentTab(2);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
"Assessment",
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
],
),
),
),
Positioned(
top: 10,
right: 0,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
"Plan",
fontWeight: FontWeight.bold,
fontSize: 12,
textAlign: TextAlign.end,
marginLeft: 25,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
],
),
),
),
],
)
: Stack(
children: [
Container(
height: height == 0 ? 100 : height,
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent,
),
Positioned(
top: 30
,
child: Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width * 0.9,
child: Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
),
),),
Positioned(
top: 10,
right: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 3),
Column(
children: [
AppText(
"شخصي",
fontWeight: FontWeight.bold,
fontSize: 16,
),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
],
),
],
),
),
),
Positioned(
top: 10,
right: MediaQuery
.of(context)
.size
.width * 0.28,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(height: 5),
Column(
children: [
AppText(
"هدف",
fontWeight: FontWeight.bold,
fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
],
),
],
),
),
),
Positioned(
top: 10,
right: MediaQuery
.of(context)
.size
.width * 0.52,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Padding(
padding: const EdgeInsets.only(right: 2),
child: Column(
children: [
AppText(
"تقدير",
fontWeight: FontWeight.bold,
fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
),
],
),
),
),
Positioned(
top: 10,
left: 0,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Container(
margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: Column(
children: [
AppText(
"خطة",
fontWeight: FontWeight.bold,
fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
),
],
),
),
),
],
);
}
}
class StatusLabel extends StatelessWidget {
const StatusLabel({
Key key,
this.stepId,
this.selectedStepId,
}) : super(key: key);
final int stepId;
final int selectedStepId;
@override
Widget build(BuildContext context) {
return Container(
width: 65,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration(
color: stepId == selectedStepId
? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
child: Center(
child: AppText(
stepId == selectedStepId
? "inProgress"
: stepId < selectedStepId
? "Completed"
: "Locked",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 10,
color: stepId == selectedStepId
? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
),
),
);
}
}

@ -0,0 +1,88 @@
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart';
class SoapUtils {
static MySelectedHistory generateMySelectedHistory(
{history, isChecked = false, remark, isLocal = true}) {
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: isChecked,
remark: remark,
isLocal: isLocal);
return mySelectedHistory;
}
static MySelectedAllergy generateMySelectedAllergy(
{allergy,
allergySeverity,
isChecked = false,
remark,
isLocal = true,
int createdBy,
bool isExpanded = false}) {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: allergy,
selectedAllergySeverity: allergySeverity,
isChecked: isChecked,
remark: remark,
isLocal: isLocal,
createdBy: createdBy,
isExpanded: isExpanded);
return mySelectedAllergy;
}
static MySelectedExamination generateMySelectedExamination(
{examination,
allergySeverity,
isChecked = false,
remark,
isLocal = true,
isNormal,
createdBy,
createdOn,
editedOn,
notExamined,
isNew,
isAbnormal}) {
MySelectedExamination mySelectedExamination = MySelectedExamination(
selectedExamination: examination,
remark: remark,
isNormal: isNormal,
createdBy: createdBy,
createdOn: createdOn,
editedOn: editedOn,
notExamined: notExamined,
isNew: isNew,
isLocal: isLocal,
isAbnormal: isAbnormal,
);
return mySelectedExamination;
}
static MySelectedAssessment generateMySelectedAssessment(
{appointmentNo,
remark,
diagnosisType,
diagnosisCondition,
selectedICD,
doctorID,
doctorName,
createdBy,
createdOn,
icdCode10ID}) {
MySelectedAssessment mySelectedAssessment = MySelectedAssessment(
appointmentId: appointmentNo,
remark: remark,
selectedDiagnosisType: diagnosisType,
selectedDiagnosisCondition: diagnosisCondition,
selectedICD: selectedICD,
doctorID: doctorID,
doctorName: doctorName,
createdBy: createdBy,
createdOn: createdOn,
icdCode10ID: icdCode10ID);
return mySelectedAssessment;
}
}

@ -3,8 +3,9 @@ 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/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_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.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/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -44,32 +45,6 @@ class _AddAllergiesState extends State<AddAllergies> {
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 10,
color: Theme.of(context).hintColor,
fontWeight: FontWeight.w700),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FractionallySizedBox( return FractionallySizedBox(
@ -120,7 +95,6 @@ class _AddAllergiesState extends State<AddAllergies> {
addAllergyLocally(mySelectedAllergy); addAllergyLocally(mySelectedAllergy);
}, },
addSelectedAllergy: () { addSelectedAllergy: () {
setState(() { setState(() {
widget widget
.addAllergiesFun(myAllergiesListLocal); .addAllergiesFun(myAllergiesListLocal);
@ -142,47 +116,17 @@ class _AddAllergiesState extends State<AddAllergies> {
]), ]),
), ),
), ),
bottomSheet: model.state == ViewState.Busy bottomSheet: model.state != ViewState.Idle
? Container( ? Container(
height: 0, height: 0,
) )
: Container( : BottomSheetDialogButton(
decoration: BoxDecoration( label: TranslationBase.of(context).addAllergies,
color: Colors.white, onTap: () {
borderRadius: BorderRadius.all( setState(() {
Radius.circular(0.0), widget.addAllergiesFun(myAllergiesListLocal);
), });
border: Border.all(color: HexColor('#707070'), width: 0), },
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).addAllergies,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
});
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
), ),
), ),
), ),
@ -244,3 +188,4 @@ class _AddAllergiesState extends State<AddAllergies> {
} }
} }
} }

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.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/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_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_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/helpers.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
@ -12,6 +14,8 @@ 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';
import '../../soap_utils.dart';
class AddAllergiesItem extends StatefulWidget { class AddAllergiesItem extends StatefulWidget {
final SOAPViewModel model; final SOAPViewModel model;
final Function(MasterKeyModel) removeAllergy; final Function(MasterKeyModel) removeAllergy;
@ -71,41 +75,40 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
onTapItem(); onTapItem();
}), }),
InkWell( InkWell(
onTap:onTapItem, onTap: onTapItem,
child: Padding( child: Container(
padding: child: AppText(
const EdgeInsets.symmetric(horizontal: 10, vertical: 0), projectViewModel.isArabic
child: Container( ? widget.item.nameAr != ""
child: AppText( ? widget.item.nameAr
projectViewModel.isArabic : widget.item.nameEn
? widget.item.nameAr != "" : widget.item.nameEn,
? widget.item.nameAr color: Color(0xFF575757),
: widget.item.nameEn fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3:3.8),
: widget.item.nameEn, letterSpacing: -0.56,
color: Color(0xFF575757),
fontSize: 16,
fontWeight: FontWeight.w600,
),
width: MediaQuery.of(context).size.width * 0.55,
), ),
width: MediaQuery.of(context).size.width * 0.55,
), ),
), ),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
if (mySelectedAllergy != null) { if (mySelectedAllergy != null) {
setState(() { setState(() {
mySelectedAllergy.isExpanded = mySelectedAllergy.isExpanded =
mySelectedAllergy.isExpanded ? false : true; mySelectedAllergy.isExpanded ? false : true;
}); });
} }
}, },
child: Icon((mySelectedAllergy != null child: Icon(
? mySelectedAllergy.isExpanded (mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false)
: false)
? EvaIcons.arrowIosUpwardOutline ? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline)) : EvaIcons.arrowIosDownwardOutline,
color: Color(0xFF575757),
size: 20,
),
)
], ],
), ),
bodyWidget: Center( bodyWidget: Center(
@ -139,14 +142,15 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
} }
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity, hintText: TranslationBase.of(context).selectSeverity + "*",
enabled: false, enabled: false,
maxLines: 2, maxLines: 1,
minLines: 2, minLines: 1,
height: Helpers.getTextFieldHeight(),
validationError: mySelectedAllergy != null && validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError mySelectedAllergy.hasValidationError
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).severityValidationError
: null, : null,
controller: severityController, controller: severityController,
), ),
@ -159,11 +163,10 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
maxLines: 25, maxLines: 25,
minLines: 3, minLines: 3,
hasBorder: true, hasBorder: true,
onChanged: (value){ onChanged: (value) {
mySelectedAllergy.remark = value; mySelectedAllergy.remark = value;
}, },
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -178,18 +181,18 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
); );
} }
onTapItem(){ onTapItem() {
setState(() { setState(() {
if (widget.isServiceSelected(widget.item)) { if (widget.isServiceSelected(widget.item)) {
widget.removeAllergy(widget.item); widget.removeAllergy(widget.item);
} else { } else {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy mySelectedAllergy =
new MySelectedAllergy( SoapUtils.generateMySelectedAllergy(
selectedAllergy: widget.item, allergy: widget.item,
selectedAllergySeverity: _selectedAllergySeverity, allergySeverity: _selectedAllergySeverity,
remark: null, remark: null,
isChecked: true, isChecked: true,
isExpanded: true); isExpanded: true);
widget.addAllergy(mySelectedAllergy); widget.addAllergy(mySelectedAllergy);
} }
}); });

@ -1,6 +1,7 @@
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_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/helpers.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@ -43,7 +44,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
class _MasterKeyCheckboxSearchAllergiesWidgetState class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> { extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List(); List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController();
@override @override
void initState() { void initState() {
@ -58,7 +59,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.70, height: Helpers.getTextFieldHeight(),
child: Center( child: Center(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -67,13 +68,11 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
child: Column( child: Column(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
// height:
// MediaQuery.of(context).size.height * 0.070,
hintText: hintText:
TranslationBase.of(context).selectAllergy, TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
// controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);
}, },

@ -1,12 +1,13 @@
import 'package:doctor_app_flutter/config/size_config.dart';
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/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../shared_soap_widgets/SOAP_open_items.dart'; import '../../shared_soap_widgets/SOAP_open_items.dart';
@ -14,7 +15,7 @@ import 'add_allergies.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class UpdateAllergiesWidget extends StatefulWidget { class UpdateAllergiesWidget extends StatefulWidget {
List<MySelectedAllergy> myAllergiesList; List<MySelectedAllergy> myAllergiesList;
UpdateAllergiesWidget({Key key, this.myAllergiesList}); UpdateAllergiesWidget({Key key, this.myAllergiesList});
@ -27,28 +28,28 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
changeAllState() { changeAllState() {
setState(() { setState(() {});
});
} }
return Column( return Column(
children: [ children: [
SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { SOAPOpenItems(
openAllergiesList(context, changeAllState, removeAllergy); label: "${TranslationBase.of(context).addAllergies}",
},), onTap: () {
openAllergiesList(context, changeAllState, removeAllergy);
},
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Container( Container(
margin: margin: EdgeInsets.only(left: 15, right: 15, top: 15),
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column( child: Column(
children: widget.myAllergiesList.map((selectedAllergy) { children: widget.myAllergiesList.map((selectedAllergy) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -61,53 +62,41 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr ? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn : selectedAllergy.selectedAllergy.nameEn
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
bold: true, bold: true,
color: Color(0xFF2B353E)), color: Color(0xFF2B353E),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
// fontHeight:0.18 ,
),
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity ? selectedAllergy
.nameAr .selectedAllergySeverity.nameAr
: selectedAllergy.selectedAllergySeverity : selectedAllergy
.nameEn .selectedAllergySeverity.nameEn
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
color: Color(0xFFCC9B14)), color: Color(0xFFCC9B14),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
], ],
), ),
width: MediaQuery width: MediaQuery.of(context).size.width * 0.5,
.of(context)
.size
.width * 0.5,
), ),
if (selectedAllergy.isChecked) if (selectedAllergy.isChecked)
InkWell( RemoveButton(
child: Row(
children: [Container(
child: AppText(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 20,
),
],
),
onTap: () => removeAllergy(selectedAllergy), onTap: () => removeAllergy(selectedAllergy),
) )
], ],
@ -116,14 +105,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Row( child: Row(
children: [ children: [
Container( RemarkText(remark: selectedAllergy.remark,),
width: MediaQuery.of(context).size.width * 0.55,
child: AppText(
selectedAllergy.remark ?? '',
fontSize: 10,
color: Colors.grey,
),
),
], ],
), ),
), ),
@ -143,15 +125,17 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
removeAllergy(MySelectedAllergy mySelectedAllergy) { removeAllergy(MySelectedAllergy mySelectedAllergy) {
List<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
// ignore: missing_return // ignore: missing_return
widget.myAllergiesList.where((element) => widget.myAllergiesList
mySelectedAllergy.selectedAllergySeverity.id == .where((element) =>
element.selectedAllergySeverity.id && mySelectedAllergy.selectedAllergySeverity.id ==
mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id element.selectedAllergySeverity.id &&
).toList(); mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if(allergy.first.isLocal) { if (allergy.first.isLocal) {
setState(() { setState(() {
widget.myAllergiesList.remove(allergy.first); widget.myAllergiesList.remove(allergy.first);
}); });
@ -162,7 +146,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
} }
} }
openAllergiesList(BuildContext context, Function changeParentState, removeAllergy) { openAllergiesList(
BuildContext context, Function changeParentState, removeAllergy) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
@ -170,7 +155,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
context: context, context: context,
builder: (context) { builder: (context) {
return AddAllergies( return AddAllergies(
myAllergiesList: widget.myAllergiesList, myAllergiesList: widget.myAllergiesList,
addAllergiesFun: (List<MySelectedAllergy> mySelectedAllergy) { addAllergiesFun: (List<MySelectedAllergy> mySelectedAllergy) {
bool isAllDataFilled = true; bool isAllDataFilled = true;
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
@ -181,19 +166,28 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
}); });
if (isAllDataFilled) { if (isAllDataFilled) {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id, if ((widget.myAllergiesList.singleWhere(
orElse: () => null)) == null) { (it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
}); });
/// remove items. /// remove items.
List<MySelectedAllergy> removedList= []; List<MySelectedAllergy> removedList = [];
widget.myAllergiesList.forEach((element) { widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id, if ((mySelectedAllergy.singleWhere(
orElse: () => null)) == null) { (it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
null) {
removedList.add(element); removedList.add(element);
}}); }
});
removedList.forEach((element) { removedList.forEach((element) {
removeAllergy(element); removeAllergy(element);
@ -201,18 +195,12 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
changeParentState(); changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Helpers.showErrorToast(TranslationBase Helpers.showErrorToast(
.of(context) TranslationBase.of(context).requiredMsg);
.requiredMsg);
} }
}); });
}); });
} }
} }

@ -2,8 +2,10 @@ 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/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_history.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.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/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -58,8 +60,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar:
title: TranslationBase.of(context).addHistory), BottomSheetTitle(title: TranslationBase.of(context).addHistory),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(
@ -161,46 +163,15 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
], ],
)), )),
), ),
bottomSheet: model.state == ViewState.Busy bottomSheet: model.state != ViewState.Idle
? Container( ? Container(
height: 0, height: 0,
) )
: Container( : BottomSheetDialogButton(
decoration: BoxDecoration( label: TranslationBase.of(context).addSelectedHistories,
color: Colors.white, onTap: () {
borderRadius: BorderRadius.all( widget.addSelectedHistories();
Radius.circular(0.0), },
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context)
.addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
), ),
), ),
)); ));
@ -215,10 +186,12 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
if (myhistory.isEmpty) { if (myhistory.isEmpty) {
setState(() { setState(() {
MySelectedHistory mySelectedHistory = MySelectedHistory( MySelectedHistory mySelectedHistory =
remark: history.remarks ?? "", SoapUtils.generateMySelectedHistory(
selectedHistory: history, remark: history.remarks ?? "",
isChecked: true); history: history,
isChecked: true);
widget.myHistoryList.add(mySelectedHistory); widget.myHistoryList.add(mySelectedHistory);
}); });
} else { } else {

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -67,8 +68,7 @@ class _PriorityBarState extends State<PriorityBar> {
: item, : item,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart';
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/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_history.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -40,17 +42,17 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Column( return Column(
children: [ children: [
SOAPOpenItems(
SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () { label: "${TranslationBase.of(context).addHistory}",
openHistoryList(context); onTap: () {
openHistoryList(context);
},), },
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Container( Container(
margin: margin: EdgeInsets.only(left: 15, right: 15, top: 15),
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column( child: Column(
children: widget.myHistoryList.map((myHistory) { children: widget.myHistoryList.map((myHistory) {
return Column( return Column(
@ -60,42 +62,21 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
children: [ children: [
Container( Container(
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
? myHistory.selectedHistory.nameAr ? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn, : myHistory.selectedHistory.nameEn,
fontSize: 15, textDecoration: myHistory.isChecked
textDecoration: myHistory.isChecked ? null
? null : TextDecoration.lineThrough,
: TextDecoration.lineThrough, color: Color(0xFF2B353E),
color: Colors.black), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
width: MediaQuery fontWeight: FontWeight.w700,
.of(context) letterSpacing: -0.48,
.size ),
.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
if (myHistory.isChecked) if (myHistory.isChecked)
InkWell( RemoveButton(
child: Row(
children: [
Container(
child: AppText(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 17,
),
],
),
onTap: () => removeHistory(myHistory.selectedHistory), onTap: () => removeHistory(myHistory.selectedHistory),
) )
], ],
@ -114,17 +95,15 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
removeHistory(MasterKeyModel historyKey) { removeHistory(MasterKeyModel historyKey) {
List<MySelectedHistory> history = List<MySelectedHistory> history =
// ignore: missing_return // ignore: missing_return
widget.myHistoryList.where((element) => widget.myHistoryList
historyKey.id == .where((element) =>
element.selectedHistory.id && historyKey.id == element.selectedHistory.id &&
historyKey.typeId == historyKey.typeId == element.selectedHistory.typeId)
element.selectedHistory.typeId .toList();
).toList();
if (history.length > 0) { if (history.length > 0) {
if(history.first.isLocal) { if (history.first.isLocal) {
setState(() { setState(() {
widget.myHistoryList.remove(history.first); widget.myHistoryList.remove(history.first);
}); });
@ -133,9 +112,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
history[0].isChecked = false; history[0].isChecked = false;
}); });
} }
} }
} }
openHistoryList(BuildContext context) { openHistoryList(BuildContext context) {
@ -162,6 +139,3 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
}); });
} }
} }

@ -1,5 +1,6 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_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/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
@ -7,6 +8,8 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
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/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_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/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/util/helpers.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -46,397 +49,448 @@ class _AddMedicationState extends State<AddMedication> {
GetMedicationResponseModel _selectedMedication; GetMedicationResponseModel _selectedMedication;
GlobalKey key = GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery.of(context).size;
return FractionallySizedBox( return FractionallySizedBox(
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.medicationStrengthList.length == 0) { if (model.medicationStrengthList.length == 0) {
await model.getMasterLookup( await model.getMasterLookup(
MasterKeysService.MedicationStrength, MasterKeysService.MedicationStrength,
); );
} }
if (model.medicationFrequencyList.length == 0) { if (model.medicationFrequencyList.length == 0) {
await model.getMasterLookup(MasterKeysService.MedicationFrequency); await model.getMasterLookup(
} MasterKeysService.MedicationFrequency);
if (model.medicationDoseTimeList.length == 0) { }
await model.getMasterLookup(MasterKeysService.MedicationDoseTime); if (model.medicationDoseTimeList.length == 0) {
} await model.getMasterLookup(MasterKeysService.MedicationDoseTime);
if (model.medicationRouteList.length == 0) { }
await model.getMasterLookup(MasterKeysService.MedicationRoute); if (model.medicationRouteList.length == 0) {
} await model.getMasterLookup(MasterKeysService.MedicationRoute);
if (model.allMedicationList.length == 0) }
await model.getMedicationList(); if (model.allMedicationList.length == 0)
}, await model.getMedicationList();
builder: (_, model, w) => AppScaffold( },
baseViewModel: model, builder: (_, model, w) =>
isShowAppBar: true, AppScaffold(
appBar: BottomSheetTitle( baseViewModel: model,
title: TranslationBase.of(context).addMedication, isShowAppBar: true,
), appBar: BottomSheetTitle(
body: Center( title: TranslationBase
child: Container( .of(context)
child: Column( .addMedication,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ body: Center(
SizedBox( child: Container(
height: 10, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: 16, SizedBox(
), height: 10,
Expanded( ),
child: Center( Expanded(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 16, height: SizeConfig.heightMultiplier * (
), SizeConfig.isHeightVeryShort ?2:SizeConfig.isHeightShort?
SizedBox( 2:2),
height: 16, ),
), Container(
Container( // height: screenSize.height * 0.070,
// height: screenSize.height * 0.070, child: InkWell(
child: InkWell( onTap: model.allMedicationList != null
onTap: model.allMedicationList != null ? () {
? () { setState(() {
setState(() { _selectedMedication = null;
_selectedMedication = null; });
}); }
} : null,
: null, child: _selectedMedication == null
child: _selectedMedication == null ? CustomAutoCompleteTextField(
? CustomAutoCompleteTextField( isShowError: isFormSubmitted &&
isShowError: isFormSubmitted && _selectedMedication == null,
_selectedMedication == null, child: AutoCompleteTextField<
child: AutoCompleteTextField< GetMedicationResponseModel>(
GetMedicationResponseModel>( decoration: TextFieldsUtils
decoration: TextFieldsUtils .textFieldSelectorDecoration(
.textFieldSelectorDecoration( TranslationBase
TranslationBase.of( .of(
context) context)
.searchMedicineNameHere, .searchMedicineNameHere,
null, null,
true, true,
suffixIcon: Icons.search), suffixIcon:
itemSubmitted: (item) => setState( Icons.search),
() => _selectedMedication = itemSubmitted: (item) =>
item), setState(() =>
key: key, _selectedMedication =
suggestions: item),
model.allMedicationList, key: key,
itemBuilder: (context, suggestions:
suggestion) => model.allMedicationList,
new Padding( itemBuilder: (context,
child: AppText(suggestion suggestion) =>
.description + new Padding(
'/' + child: AppText(suggestion
suggestion .description +
.genericName), '/' +
padding: suggestion
EdgeInsets.all(8.0)), .genericName),
itemSorter: (a, b) => 1, padding:
itemFilter: (suggestion, input) => EdgeInsets.all(
suggestion.genericName.toLowerCase().startsWith( 8.0)),
input.toLowerCase()) || itemSorter: (a, b) => 1,
suggestion.description itemFilter: (suggestion,
.toLowerCase() input) =>
.startsWith(input suggestion.genericName.toLowerCase()
.toLowerCase()) || .startsWith(input.toLowerCase()) ||
suggestion.keywords suggestion.description
.toLowerCase() .toLowerCase()
.startsWith( .startsWith(input
input.toLowerCase()), .toLowerCase()) ||
), suggestion.keywords
) .toLowerCase()
: AppTextFieldCustom( .startsWith(input
hintText: _selectedMedication != .toLowerCase()),
null
? _selectedMedication
.description +
(' (${_selectedMedication.genericName} )')
: TranslationBase.of(context)
.searchMedicineNameHere,
minLines: 2,
maxLines: 2,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
enabled: false,
),
),
), ),
SizedBox( )
height: 5, : AppTextFieldCustom(
), height: Helpers.getTextFieldHeight(),
AppTextFieldCustom( hintText: _selectedMedication !=
enabled: false, null
onClick: model.medicationDoseTimeList != null ? _selectedMedication
? () { .description +
MasterKeyDailog dialog = (' (${_selectedMedication.genericName} )')
MasterKeyDailog( : TranslationBase
list: model.medicationDoseTimeList, .of(
okText: context)
TranslationBase.of(context).ok, .searchMedicineNameHere,
selectedValue: _selectedMedicationDose, minLines: 1,
okFunction: (selectedValue) { maxLines: 1,
setState(() { isTextFieldHasSuffix: true,
_selectedMedicationDose = suffixIcon: IconButton(
selectedValue; icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
enabled: false,
),
),
),
doseController if(_selectedMedication != null)
.text = projectViewModel Column(
.isArabic children: [
? _selectedMedicationDose SizedBox(
.nameAr height: 3,
: _selectedMedicationDose ),
.nameEn; Container(
}); width: MediaQuery
}, .of(context)
); .size
showDialog( .width * 0.7,
barrierDismissible: false, child: AppText(
context: context, _selectedMedication.description +
builder: (BuildContext context) { (' (${_selectedMedication.genericName} )'),
return dialog; color: Color(0xFF575757),
}, fontSize: 10,
); fontWeight: FontWeight.w700,
} letterSpacing: -0.4,
: null,
hintText:
TranslationBase.of(context).doseTime,
maxLines: 2,
minLines: 2,
isTextFieldHasSuffix: true,
controller: doseController,
validationError: isFormSubmitted &&
_selectedMedicationDose == null
? TranslationBase.of(context).emptyMessage
: null,
),
SizedBox(
height: 5,
), ),
AppTextFieldCustom( ),
enabled: false, ],
isTextFieldHasSuffix: true, ),
onClick: model.medicationStrengthList != null SizedBox(
? () { height: 5,
MasterKeyDailog dialog = ),
MasterKeyDailog( AppTextFieldCustom(
list: model.medicationStrengthList, height: Helpers.getTextFieldHeight(),
okText: enabled: false,
TranslationBase.of(context).ok, onClick: model.medicationDoseTimeList !=
selectedValue: _selectedMedicationStrength, null
okFunction: (selectedValue) { ? () {
setState(() { MasterKeyDailog dialog =
_selectedMedicationStrength = MasterKeyDailog(
selectedValue; list: model
.medicationDoseTimeList,
okText:
TranslationBase
.of(context)
.ok,
selectedValue:
_selectedMedicationDose,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose =
selectedValue;
strengthController doseController
.text = projectViewModel .text = projectViewModel
.isArabic .isArabic
? _selectedMedicationStrength ? _selectedMedicationDose
.nameAr .nameAr
: _selectedMedicationStrength : _selectedMedicationDose
.nameEn; .nameEn;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
return dialog; (BuildContext context) {
}, return dialog;
); },
} );
: null, }
hintText: : null,
TranslationBase.of(context).strength, hintText:
maxLines: 2, TranslationBase
minLines: 2, .of(context)
controller: strengthController, .doseTime,
validationError: isFormSubmitted && maxLines: 1,
_selectedMedicationStrength == null minLines: 1,
? TranslationBase.of(context).emptyMessage isTextFieldHasSuffix: true,
: null, controller: doseController,
), validationError: isFormSubmitted &&
SizedBox( _selectedMedicationDose == null
height: 5, ? TranslationBase
), .of(context)
SizedBox( .emptyMessage
height: 5, : null,
), ),
AppTextFieldCustom( SizedBox(
enabled: false, height: 5,
isTextFieldHasSuffix: true, ),
onClick: model.medicationRouteList != null AppTextFieldCustom(
? () { height: Helpers.getTextFieldHeight(),
MasterKeyDailog dialog = enabled: false,
MasterKeyDailog( isTextFieldHasSuffix: true,
list: model.medicationRouteList, onClick: model.medicationStrengthList !=
selectedValue: _selectedMedicationRoute, null
okText: ? () {
TranslationBase.of(context).ok, MasterKeyDailog dialog =
okFunction: (selectedValue) { MasterKeyDailog(
setState(() { list: model
_selectedMedicationRoute = .medicationStrengthList,
selectedValue; okText:
TranslationBase
.of(context)
.ok,
selectedValue:
_selectedMedicationStrength,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength =
selectedValue;
routeController strengthController
.text = projectViewModel .text = projectViewModel
.isArabic .isArabic
? _selectedMedicationRoute ? _selectedMedicationStrength
.nameAr .nameAr
: _selectedMedicationRoute : _selectedMedicationStrength
.nameEn; .nameEn;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
return dialog; (BuildContext context) {
}, return dialog;
); },
} );
: null, }
hintText: TranslationBase.of(context).route, : null,
maxLines: 2, hintText:
minLines: 2, TranslationBase
controller: routeController, .of(context)
validationError: isFormSubmitted && .strength,
_selectedMedicationRoute == null maxLines: 1,
? TranslationBase.of(context).emptyMessage minLines: 1,
: null, controller: strengthController,
), validationError: isFormSubmitted &&
SizedBox( _selectedMedicationStrength ==
height: 5, null
), ? TranslationBase
SizedBox( .of(context)
height: 5, .emptyMessage
), : null,
AppTextFieldCustom( ),
onClick: model.medicationFrequencyList != null SizedBox(
? () { height: 5,
MasterKeyDailog dialog = ),
MasterKeyDailog( SizedBox(
list: model.medicationFrequencyList, height: 5,
okText: ),
TranslationBase.of(context).ok, AppTextFieldCustom(
selectedValue: _selectedMedicationFrequency, height: Helpers.getTextFieldHeight(),
okFunction: (selectedValue) { enabled: false,
setState(() { isTextFieldHasSuffix: true,
_selectedMedicationFrequency = onClick: model.medicationRouteList != null
selectedValue; ? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationRouteList,
selectedValue:
_selectedMedicationRoute,
okText:
TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationRoute =
selectedValue;
frequencyController routeController
.text = projectViewModel .text = projectViewModel
.isArabic .isArabic
? _selectedMedicationFrequency ? _selectedMedicationRoute
.nameAr .nameAr
: _selectedMedicationFrequency : _selectedMedicationRoute
.nameEn; .nameEn;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
return dialog; (BuildContext context) {
}, return dialog;
); },
} );
: null,
hintText:
TranslationBase.of(context).frequency,
enabled: false,
maxLines: 2,
minLines: 2,
isTextFieldHasSuffix: true,
controller: frequencyController,
validationError: isFormSubmitted &&
_selectedMedicationFrequency == null
? TranslationBase.of(context).emptyMessage
: null,
),
SizedBox(
height: 5,
),
SizedBox(
height: 30,
),
],
)),
),
),
]),
),
),
bottomSheet:model.state == ViewState.Busy?Container(height: 0,): Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context)
.addMedication
.toUpperCase(),
color: Color(0xFF359846),
onPressed: () {
setState(() {
isFormSubmitted = true;
});
if (_selectedMedication != null &&
_selectedMedicationDose != null &&
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text = widget
.medicationController.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop();
} }
}, : null,
hintText:
TranslationBase
.of(context)
.route,
maxLines: 1,
minLines: 1,
controller: routeController,
validationError: isFormSubmitted &&
_selectedMedicationRoute == null
? TranslationBase
.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 5,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
onClick: model.medicationFrequencyList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model
.medicationFrequencyList,
okText:
TranslationBase
.of(context)
.ok,
selectedValue:
_selectedMedicationFrequency,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationFrequency =
selectedValue;
frequencyController
.text = projectViewModel
.isArabic
? _selectedMedicationFrequency
.nameAr
: _selectedMedicationFrequency
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase
.of(context)
.frequency,
enabled: false,
maxLines: 1,
minLines: 1,
isTextFieldHasSuffix: true,
controller: frequencyController,
validationError: isFormSubmitted &&
_selectedMedicationFrequency ==
null
? TranslationBase
.of(context)
.emptyMessage
: null,
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 20 : SizeConfig
.isHeightShort ? 15 : 10),
),
],
), ),
), )),
), ),
), ]),
SizedBox( ),
height: 5, ),
), bottomSheet: model.state != ViewState.Idle
], ? Container(
), height: 0,
), )
), : BottomSheetDialogButton(
), label:
TranslationBase.of(context).addMedication,
onTap: () {
setState(() {
isFormSubmitted = true;
});
if (_selectedMedication != null &&
_selectedMedicationDose != null &&
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text = widget
.medicationController.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop();
}
},
)
)
,
)
,
); );
} }
} }

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.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';

@ -0,0 +1,3 @@
abstract class SubjectiveCallBack{
Function nextFunction(model);
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_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/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';
@ -6,14 +7,16 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.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_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.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_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/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -34,32 +37,30 @@ class UpdateSubjectivePage extends StatefulWidget {
final int currentIndex; final int currentIndex;
UpdateSubjectivePage( UpdateSubjectivePage(
{Key key, {Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
@override @override
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
} }
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> { class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements SubjectiveCallBack {
bool isChiefExpand = false; bool isChiefExpand = false;
bool isHistoryExpand = false; bool isHistoryExpand = false;
bool isAllergiesExpand = false; bool isAllergiesExpand = false;
TextEditingController illnessController = TextEditingController(); TextEditingController illnessController = TextEditingController();
TextEditingController complaintsController = TextEditingController(); TextEditingController complaintsController = TextEditingController();
TextEditingController medicationController = TextEditingController(); TextEditingController medicationController = TextEditingController();
String complaintsControllerError = '';
String medicationControllerError = '';
String illnessControllerError = '';
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList=List(); List<MySelectedAllergy> myAllergiesList = List();
List<MySelectedHistory> myHistoryList=List(); List<MySelectedHistory> myHistoryList = List();
getHistory(SOAPViewModel model) async { getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true); widget.changeLoadingState(true);
model.complaintsControllerError = '';
model.medicationControllerError = '';
model.illnessControllerError = '';
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
@ -91,8 +92,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
@ -103,8 +104,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
@ -115,8 +116,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
@ -127,8 +128,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
@ -162,13 +163,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
} }
MySelectedAllergy mySelectedAllergy = MySelectedAllergy( MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy(
selectedAllergy: selectedAllergy, allergy: selectedAllergy,
isChecked: element.isChecked, isChecked: element.isChecked,
createdBy: element.createdBy, createdBy: element.createdBy,
remark: element.remarks, remark: element.remarks,
isLocal : false, isLocal: false,
selectedAllergySeverity: selectedAllergySeverity); allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
}); });
} }
@ -180,10 +182,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
onModelReady: (model) async { onModelReady: (model) async {
myAllergiesList.clear(); myAllergiesList.clear();
myHistoryList.clear(); myHistoryList.clear();
model.setSubjectiveCallBack(this);
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null,
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), appointmentNo: widget.patientInfo.appointmentNo != null
? int.parse(widget.patientInfo.appointmentNo.toString())
: null,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo,
doctorID: ''); doctorID: '');
@ -196,9 +201,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
? model.patientChiefComplaintList[0].currentMedication + '\n \n' ? model.patientChiefComplaintList[0].currentMedication + '\n \n'
: model.patientChiefComplaintList[0].currentMedication; : model.patientChiefComplaintList[0].currentMedication;
} }
if (widget.patientInfo.admissionNo == null) {
await getHistory(model);
await getHistory(model); await getAllergies(model);
await getAllergies(model); }
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
@ -214,7 +221,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).chiefComplaints, headerTitle: TranslationBase.of(context).chiefComplaints,
onTap: () { onTap: () {
@ -227,112 +238,77 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
complaintsController: complaintsController, complaintsController: complaintsController,
illnessController: illnessController, illnessController: illnessController,
medicationController: medicationController, medicationController: medicationController,
complaintsControllerError: complaintsControllerError, complaintsControllerError:
illnessControllerError: illnessControllerError, model.complaintsControllerError,
medicationControllerError: medicationControllerError, illnessControllerError: model.illnessControllerError,
medicationControllerError:
model.medicationControllerError,
), ),
isExpanded: isChiefExpand, isExpanded: isChiefExpand,
), ),
SizedBox( SizedBox(
height: 30, height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
ExpandableSOAPWidget( if (widget.patientInfo.admissionNo == null)
headerTitle: TranslationBase.of(context).histories, ExpandableSOAPWidget(
isRequired: false, headerTitle: TranslationBase.of(context).histories,
onTap: () { isRequired: false,
setState(() { onTap: () {
isHistoryExpand = !isHistoryExpand; setState(() {
}); isHistoryExpand = !isHistoryExpand;
}, });
child: Column( },
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], child: Column(
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
),
isExpanded: isHistoryExpand,
), ),
isExpanded: isHistoryExpand,
),
SizedBox( SizedBox(
height: 30, height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
ExpandableSOAPWidget( if (widget.patientInfo.admissionNo == null)
headerTitle: TranslationBase.of(context).allergiesSoap, ExpandableSOAPWidget(
isRequired: false, headerTitle: TranslationBase.of(context).allergiesSoap,
onTap: () { isRequired: false,
setState(() { onTap: () {
isAllergiesExpand = !isAllergiesExpand; setState(() {
}); isAllergiesExpand = !isAllergiesExpand;
}, });
child: Column( },
children: [ child: Column(
UpdateAllergiesWidget( children: [
myAllergiesList: myAllergiesList, UpdateAllergiesWidget(
), myAllergiesList: myAllergiesList,
SizedBox( ),
height: 30, SizedBox(
), height: 30,
], ),
],
),
isExpanded: isAllergiesExpand,
), ),
isExpanded: isAllergiesExpand,
),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.16, height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10),
), ),
], ],
), ),
), ),
), ),
), ),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: 80,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
// loading: model.state == ViewState.BusyLocal,
onPressed: () async {
addSubjectiveInfo(
model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
),
), ),
); );
} }
addSubjectiveInfo( addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async { {SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
if(FocusScope.of(context).hasFocus) if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
FocusScope.of(context).unfocus();
widget.changeLoadingState(true); widget.changeLoadingState(true);
formKey.currentState.save(); formKey.currentState.save();
formKey.currentState.validate(); formKey.currentState.validate();
complaintsControllerError = ''; model.complaintsControllerError = '';
medicationControllerError = ''; model.medicationControllerError = '';
illnessControllerError = ''; model.illnessControllerError = '';
if (complaintsController.text.isNotEmpty && if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty && illnessController.text.isNotEmpty &&
complaintsController.text.length > 25) { complaintsController.text.length > 25) {
@ -358,48 +334,57 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
} else { } else {
setState(() { setState(() {
if (complaintsController.text.isEmpty) { if (complaintsController.text.isEmpty) {
complaintsControllerError = TranslationBase.of(context).emptyMessage; model.complaintsControllerError =
TranslationBase.of(context).emptyMessage;
} else if (complaintsController.text.length < 25) { } else if (complaintsController.text.length < 25) {
complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; model.complaintsControllerError =
TranslationBase.of(context).chiefComplaintLength;
} }
if (illnessController.text.isEmpty) { if (illnessController.text.isEmpty) {
illnessControllerError = TranslationBase.of(context).emptyMessage; model.illnessControllerError =
TranslationBase.of(context).emptyMessage;
} }
if (medicationController.text.isEmpty) { if (medicationController.text.isEmpty) {
medicationControllerError = TranslationBase.of(context).emptyMessage; model.medicationControllerError =
TranslationBase.of(context).emptyMessage;
} }
}); });
widget.changeLoadingState(false); widget.changeLoadingState(false);
Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); Helpers.showErrorToast(
TranslationBase.of(context).chiefComplaintErrorMsg);
} }
} }
postAllergy({List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async { postAllergy(
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); {List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
myAllergiesList.forEach((allergy) { myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
allergyDiseaseId: allergy.selectedAllergy.id, ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseType: allergy.selectedAllergy.typeId, allergyDiseaseId: allergy.selectedAllergy.id,
patientMRN: widget.patientInfo.patientMRN, allergyDiseaseType: allergy.selectedAllergy.typeId,
episodeId: widget.patientInfo.episodeNo, patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo, episodeId: widget.patientInfo.episodeNo,
severity: allergy.selectedAllergySeverity.id, appointmentNo: widget.patientInfo.appointmentNo,
remarks: allergy.remark, severity: allergy.selectedAllergySeverity.id,
createdBy: allergy.createdBy ?? doctorProfile.doctorID, remarks: allergy.remark,
createdOn: DateTime.now().toIso8601String(), createdBy: allergy.createdBy ?? doctorProfile.doctorID,
editedBy: doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(),
editedOn: DateTime.now().toIso8601String(), editedBy: doctorProfile.doctorID,
isChecked: allergy.isChecked, editedOn: DateTime.now().toIso8601String(),
isUpdatedByNurse: false)); isChecked: allergy.isChecked,
isUpdatedByNurse: false));
}); });
if (model.patientAllergiesList.isEmpty) { if (model.patientAllergiesList.isEmpty) {
await model.postAllergy(postAllergyRequestModel); await model.postAllergy(postAllergyRequestModel);
@ -423,10 +408,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
} }
} }
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async { postHistories(
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); {List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) { myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
@ -453,9 +441,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
formKey.currentState.save(); formKey.currentState.save();
if (formKey.currentState.validate()) { if (formKey.currentState.validate()) {
PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel(
admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null,
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo ?? 0,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo ?? 0,
chiefComplaint: complaintsController.text, chiefComplaint: complaintsController.text,
currentMedication: medicationController.text, currentMedication: medicationController.text,
hopi: illnessController.text, hopi: illnessController.text,
@ -467,8 +456,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
postChiefComplaintRequestModel.editedBy = ''; postChiefComplaintRequestModel.editedBy = '';
await model.postChiefComplaint(postChiefComplaintRequestModel); await model.postChiefComplaint(postChiefComplaintRequestModel);
} else { } else {
postChiefComplaintRequestModel.editedBy = '';
await model.patchChiefComplaint(postChiefComplaintRequestModel); await model.patchChiefComplaint(postChiefComplaintRequestModel);
} }
} }
} }
@override
Function nextFunction(model) {
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
}
} }

@ -1,16 +1,21 @@
import 'package:doctor_app_flutter/config/size_config.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/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'assessment/update_assessment_page.dart'; import 'assessment/update_assessment_page.dart';
import 'objective/update_objective_page.dart'; import 'objective/update_objective_page.dart';
@ -32,10 +37,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
List<MySelectedAllergy> myAllergiesList = List(); List<MySelectedAllergy> myAllergiesList = List();
List<MySelectedHistory> myHistoryList = List(); List<MySelectedHistory> myHistoryList = List();
changePageViewIndex(pageIndex, {isChangeState = true}) {
changePageViewIndex(pageIndex,{isChangeState = true}) { if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
if (pageIndex != _currentIndex && isChangeState)
changeLoadingState(true);
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
setState(() { setState(() {
_currentIndex = pageIndex; _currentIndex = pageIndex;
@ -57,15 +60,21 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
}); });
} }
void changeStateFun(){
setState(() {
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
return AppScaffold( return BaseView<SOAPViewModel>(
isLoading: _isLoading, builder: (_,model,w)=>AppScaffold(
isShowAppBar: false, isLoading: _isLoading,
body: SingleChildScrollView( isShowAppBar: true,
child: SingleChildScrollView( appBar: PatientProfileAppBar(patient),
body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -77,13 +86,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
PatientProfileAppBar(patient),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
Container( Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.73, height: MediaQuery.of(context).size.height * 0.73,
@ -116,6 +118,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
patientInfo: patient, patientInfo: patient,
sOAPViewModel: model,
changeStateFun: changeStateFun,
changeLoadingState: changeLoadingState) changeLoadingState: changeLoadingState)
], ],
), ),
@ -126,7 +130,186 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
], ],
), ),
), ),
bottomSheet:_isLoading?Container(height: 0,): Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 12 : 10),
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: getBottomSheet(model, patient)
),
),
SizedBox(
height: 5,
),
],
),
),
), ),
); );
} }
Widget getBottomSheet(SOAPViewModel model, PatiantInformtion patient) {
switch (_currentIndex) {
case 0:
{
return Center(
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
color: Colors.red[700],
onPressed: () async {
model.nextOnSubjectPage(model);
},
),
);
}
break;
case 1:
{
return Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () {
changePageViewIndex(0);
},
),
),
SizedBox(
width: 5,
),
Expanded(
child: AppButton(
title: patient.admissionNo != null &&
patient.admissionNo.isNotEmpty && !model.isAddExamInProgress?TranslationBase.of(context).finish: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
await model.nextOnObjectivePage(model);
},
),
),
],
),
);
}
break;
case 2:
{
return Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
changePageViewIndex(1);
},
),
),
SizedBox(
width: 5,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
model.nextOnAssessmentPage(model);
},
),
),
],
),
);
}
break;
case 3:
{
return Center(
child: Row(
children: [
Expanded(
child: AppButton(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
changePageViewIndex(2);
},
),
),
SizedBox(
width: 5,
),
Expanded(
child: AppButton(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
title: model.isAddProgress
? TranslationBase.of(context).next
: TranslationBase.of(context).finish,
fontWeight: FontWeight.w600,
color: Colors.red[700],
disabled: model.progressNoteText.isEmpty,
onPressed: () async {
model.nextOnPlanPage(model);
},
),
),
],
),
);
}
break;
}
}
} }

@ -277,4 +277,7 @@ class Helpers {
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
return "$twoDigitMinutes:$twoDigitSeconds"; return "$twoDigitMinutes:$twoDigitSeconds";
} }
static double getTextFieldHeight(){
return SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?10:SizeConfig.isHeightShort?8:6);
}
} }

@ -1233,6 +1233,9 @@ class TranslationBase {
localizedValues['typeHereToReply'][locale.languageCode]; localizedValues['typeHereToReply'][locale.languageCode];
String get searchHere => localizedValues['searchHere'][locale.languageCode]; String get searchHere => localizedValues['searchHere'][locale.languageCode];
String get remove => localizedValues['remove'][locale.languageCode]; String get remove => localizedValues['remove'][locale.languageCode];
String get inProgress => localizedValues['inProgress'][locale.languageCode];
String get completed => localizedValues['Completed'][locale.languageCode];
String get locked => localizedValues['Locked'][locale.languageCode];
String get step => localizedValues['step'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode];
String get fieldRequired => String get fieldRequired =>
@ -1366,6 +1369,7 @@ class TranslationBase {
String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; String get addPrescription => localizedValues['addPrescription'][locale.languageCode];
String get edit => localizedValues['edit'][locale.languageCode]; String get edit => localizedValues['edit'][locale.languageCode];
String get summeryReply => localizedValues['summeryReply'][locale.languageCode]; String get summeryReply => localizedValues['summeryReply'][locale.languageCode];
String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -75,21 +75,17 @@ class PatientProfileAppBar extends StatelessWidget
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border( bottom: BorderSide(color:Color(0xFFEFEFEF)))
), ),
// height: height == 0
// ? isInpatient
// ? 215
// : isAppointmentHeader
// ? 325
// : 200
// : height,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort?30: 50),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
@ -138,10 +134,10 @@ class PatientProfileAppBar extends StatelessWidget
), ),
Row(children: [ Row(children: [
Padding( Padding(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0),
child: Container( child: Container(
width: 60, width: SizeConfig.getTextMultiplierBasedOnWidth()*20,
height: 60, height: SizeConfig.getTextMultiplierBasedOnWidth()*20,
child: Image.asset( child: Image.asset(
gender == 1 gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
@ -170,14 +166,14 @@ class PatientProfileAppBar extends StatelessWidget
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
), ),
patient.startTime != null patient.startTime != null
? AppText( ? AppText(
@ -185,7 +181,7 @@ class PatientProfileAppBar extends StatelessWidget
? patient.startTime ? patient.startTime
: '', : '',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A)) color: Color(0xFF2E303A))
: SizedBox() : SizedBox()
], ],
@ -207,7 +203,7 @@ class PatientProfileAppBar extends StatelessWidget
.fileNumber, .fileNumber,
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -218,7 +214,7 @@ class PatientProfileAppBar extends StatelessWidget
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, color: Color(0xFF2E303A),)), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),)),
], ],
), ),
), ),
@ -227,7 +223,7 @@ class PatientProfileAppBar extends StatelessWidget
AppText( AppText(
patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
), ),
patient.nationalityFlagURL != null patient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
@ -260,7 +256,7 @@ class PatientProfileAppBar extends StatelessWidget
text: TranslationBase text: TranslationBase
.of(context) .of(context)
.age + " : ", .age + " : ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), style: TextStyle(fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),)),
new TextSpan( new TextSpan(
text: text:
"${AppDateUtils.getAgeByBirthday( "${AppDateUtils.getAgeByBirthday(
@ -271,7 +267,7 @@ class PatientProfileAppBar extends StatelessWidget
isServerFormat: !isFromLiveCare)}", isServerFormat: !isFromLiveCare)}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A),)), color: Color(0xFF2E303A),)),
], ],
), ),
@ -285,7 +281,7 @@ class PatientProfileAppBar extends StatelessWidget
AppText( AppText(
TranslationBase.of(context).appointmentDate + TranslationBase.of(context).appointmentDate +
" : ", " : ",
fontSize: 10, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -300,7 +296,7 @@ class PatientProfileAppBar extends StatelessWidget
patient.appointmentDate)) patient.appointmentDate))
, ,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), ),
SizedBox( SizedBox(
@ -319,7 +315,7 @@ class PatientProfileAppBar extends StatelessWidget
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: "Result Date: ", text: "Result Date: ",
style: TextStyle( fontSize: 10, style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins',)), fontFamily: 'Poppins',)),
@ -341,7 +337,7 @@ class PatientProfileAppBar extends StatelessWidget
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
@ -363,7 +359,7 @@ class PatientProfileAppBar extends StatelessWidget
.toString())))}", .toString())))}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A),)), color: Color(0xFF2E303A),)),
]))), ]))),
if (patient.admissionDate != null) if (patient.admissionDate != null)
@ -371,7 +367,7 @@ class PatientProfileAppBar extends StatelessWidget
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757) fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757)
), ),
if(isDischargedPatient && if(isDischargedPatient &&
patient.dischargeDate != null) patient.dischargeDate != null)
@ -384,7 +380,7 @@ class PatientProfileAppBar extends StatelessWidget
patient.admissionDate)) patient.admissionDate))
.inDays + 1}", .inDays + 1}",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
) )
else else
@ -396,7 +392,7 @@ class PatientProfileAppBar extends StatelessWidget
patient.admissionDate)) patient.admissionDate))
.inDays + 1}", .inDays + 1}",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A),), color: Color(0xFF2E303A),),
], ],
), ),
@ -457,7 +453,7 @@ class PatientProfileAppBar extends StatelessWidget
.dr}$doctorName', .dr}$doctorName',
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
), ),
if (orderNo != null && if (orderNo != null &&
!isPrescriptions) !isPrescriptions)
@ -465,7 +461,7 @@ class PatientProfileAppBar extends StatelessWidget
children: <Widget>[ children: <Widget>[
AppText('Order No: ', AppText('Order No: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(orderNo ?? '', AppText(orderNo ?? '',
fontSize: 12) fontSize: 12)
], ],
@ -475,7 +471,7 @@ class PatientProfileAppBar extends StatelessWidget
Row( Row(
children: <Widget>[ children: <Widget>[
AppText('Invoice: ', AppText('Invoice: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(invoiceNO ?? "", AppText(invoiceNO ?? "",
fontSize: 12) fontSize: 12)
], ],
@ -484,7 +480,7 @@ class PatientProfileAppBar extends StatelessWidget
Row( Row(
children: [ children: [
AppText('Branch: ', AppText('Branch: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(branch ?? '', AppText(branch ?? '',
fontSize: 12) fontSize: 12)
], ],
@ -494,7 +490,7 @@ class PatientProfileAppBar extends StatelessWidget
Row( Row(
children: [ children: [
AppText('Clinic: ', AppText('Clinic: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(clinic ?? '', AppText(clinic ?? '',
fontSize: 12) fontSize: 12)
], ],
@ -504,7 +500,7 @@ class PatientProfileAppBar extends StatelessWidget
Row( Row(
children: [ children: [
AppText('Episode: ', AppText('Episode: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(episode ?? '', AppText(episode ?? '',
fontSize: 12) fontSize: 12)
], ],
@ -514,7 +510,7 @@ class PatientProfileAppBar extends StatelessWidget
Row( Row(
children: [ children: [
AppText('Visit Date: ', AppText('Visit Date: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(visitDate ?? '', AppText(visitDate ?? '',
fontSize: 12) fontSize: 12)
], ],
@ -527,7 +523,7 @@ class PatientProfileAppBar extends StatelessWidget
!isPrescriptions !isPrescriptions
? 'Result Date:' ? 'Result Date:'
: 'Prescriptions Date ', : 'Prescriptions Date ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),
), ),
AppText( AppText(
'${AppDateUtils '${AppDateUtils
@ -535,7 +531,7 @@ class PatientProfileAppBar extends StatelessWidget
appointmentDate, appointmentDate,
isArabic: projectViewModel isArabic: projectViewModel
.isArabic)}', .isArabic)}',
fontSize: 12, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
) )
], ],
) )
@ -556,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget
@override @override
Size get preferredSize => Size get preferredSize =>
Size(double.maxFinite, height == 0 Size(double.maxFinite, height == 0
? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : 170 ? isInpatient ? (isFromLabResult?200:190) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?137:SizeConfig.isHeightShort?190: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge?25:20)
: height); : height);
} }

@ -18,6 +18,7 @@ class AppText extends StatefulWidget {
final double marginRight; final double marginRight;
final double marginBottom; final double marginBottom;
final double marginLeft; final double marginLeft;
final double letterSpacing;
final TextAlign textAlign; final TextAlign textAlign;
final bool bold; final bool bold;
final bool regular; final bool regular;
@ -55,7 +56,7 @@ class AppText extends StatefulWidget {
this.allowExpand = true, this.allowExpand = true,
this.visibility = true, this.visibility = true,
this.textOverflow, this.textOverflow,
this.textDecoration, this.textDecoration, this.letterSpacing,
}); });
@override @override
@ -132,7 +133,7 @@ class _AppTextState extends State<AppText> {
widget.color != null ? widget.color : Colors.black, widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: letterSpacing:
widget.variant == "overline" ? 1.5 : null, widget.letterSpacing??(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,

@ -22,6 +22,7 @@ class AppButton extends StatefulWidget {
final double radius; final double radius;
final double vPadding; final double vPadding;
final double hPadding; final double hPadding;
final double height;
AppButton({ AppButton({
@required this.onPressed, @required this.onPressed,
@ -40,6 +41,7 @@ class AppButton extends StatefulWidget {
this.radius = 8.0, this.radius = 8.0,
this.hasBorder = false, this.hasBorder = false,
this.borderColor, this.borderColor,
this.height,
}); });
_AppButtonState createState() => _AppButtonState(); _AppButtonState createState() => _AppButtonState();
@ -50,6 +52,7 @@ class _AppButtonState extends State<AppButton> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
// height: MediaQuery.of(context).size.height * 0.075, // height: MediaQuery.of(context).size.height * 0.075,
height: widget.height,
child: IgnorePointer( child: IgnorePointer(
ignoring: widget.loading ||widget.disabled, ignoring: widget.loading ||widget.disabled,
child: RawMaterialButton( child: RawMaterialButton(

@ -1,9 +1,12 @@
import 'package:doctor_app_flutter/config/size_config.dart';
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/models/SOAP/master_key_model.dart'; 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';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../app_texts_widget.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class MasterKeyDailog extends StatefulWidget { class MasterKeyDailog extends StatefulWidget {
final List<MasterKeyModel> list; final List<MasterKeyModel> list;
@ -33,18 +36,18 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return showAlertDialog(context, projectViewModel); return showAlertDialog(context, projectViewModel);
} }
showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) {
// set up the buttons // set up the buttons
Widget cancelButton = FlatButton( Widget cancelButton = FlatButton(
child: Text(TranslationBase.of(context).cancel), child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
Widget continueButton = FlatButton( Widget continueButton = FlatButton(
child: Text(this.widget.okText), child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),),
onPressed: () { onPressed: () {
this.widget.okFunction(widget.selectedValue); this.widget.okFunction(widget.selectedValue);
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -69,23 +72,29 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
children: [ children: [
...widget.list ...widget.list
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: Text( title: AppText(
'${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' +
groupValue: widget.isICD (widget.isICD ? '/${item.code}' : ''),
? widget.selectedValue.code.toString()
: widget.selectedValue.id.toString(), ),
value: widget.isICD ? widget.selectedValue.code.toString() : item groupValue: widget.isICD
.id.toString(), ? widget.selectedValue.code.toString()
activeColor: Colors.blue.shade700, : widget.selectedValue.id.toString(),
selected: widget.isICD ? item.code.toString() == value: widget.isICD
widget.selectedValue.code.toString() : item.id.toString() == ? widget.selectedValue.code.toString()
widget.selectedValue.id.toString(), : item.id.toString(),
onChanged: (val) { activeColor: Colors.blue.shade700,
setState(() { selected: widget.isICD
widget.selectedValue = item; ? item.code.toString() ==
}); widget.selectedValue.code.toString()
}, : item.id.toString() ==
)) widget.selectedValue.id.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList() .toList()
], ],
), ),

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.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/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_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/util/helpers.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -40,6 +42,8 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget {
class _MasterKeyCheckboxSearchWidgetState class _MasterKeyCheckboxSearchWidgetState
extends State<MasterKeyCheckboxSearchWidget> { extends State<MasterKeyCheckboxSearchWidget> {
List<MasterKeyModel> items = List(); List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController();
@override @override
void initState() { void initState() {
@ -73,11 +77,11 @@ class _MasterKeyCheckboxSearchWidgetState
child: ListView( child: ListView(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
height: MediaQuery.of(context).size.height * 0.070, height: Helpers.getTextFieldHeight(),//MediaQuery.of(context).size.height * 0.070,
hintText: TranslationBase.of(context).searchHistory, hintText: TranslationBase.of(context).searchHistory,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
// controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);
}, },
@ -123,19 +127,16 @@ class _MasterKeyCheckboxSearchWidgetState
}); });
}), }),
Expanded( Expanded(
child: Padding( child: AppText(
padding: const EdgeInsets.symmetric( projectViewModel.isArabic
horizontal: 10, vertical: 0), ? historyInfo.nameAr != ""
child: AppText( ? historyInfo.nameAr
projectViewModel.isArabic : historyInfo.nameEn
? historyInfo.nameAr != "" : historyInfo.nameEn,
? historyInfo.nameAr
: historyInfo.nameEn color: Color(0xFF575757),
: historyInfo.nameEn, fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isWidthLarge?3:3.8),
color: Color(0xFF575757), letterSpacing: -0.56,
fontSize: 16,
fontWeight: FontWeight.w600,
),
), ),
), ),
], ],

@ -122,7 +122,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.hintText, widget.hintText,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false fontSize: widget.isPrscription == false
? SizeConfig.textMultiplier * 1.3 ? SizeConfig.getHeightMultiplier() * (SizeConfig.isWidthLarge?1.1: 1.3)
: 0, : 0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -158,7 +158,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? widget.inputFormatters ? widget.inputFormatters
: [], : [],
onChanged: (value) { onChanged: (value) {
// setState(() {}); setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
widget.onChanged(value); widget.onChanged(value);
} }

@ -657,7 +657,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -949,7 +949,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1147,5 +1147,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save