create mapper for the selected items

episode_fixes
Elham Rababh 3 years ago
parent 659e7f5886
commit d0d6874159

@ -704,4 +704,5 @@ const Map<String, Map<String, String>> localizedValues = {
"edit": {"en": "Edit", "ar": "تعديل"},
"summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"},
"finish": {"en": "Finish", "ar": "انهاء"},
"severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"},
};

@ -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;
}
}

@ -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});
}

@ -6,8 +6,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/models/SOAP/PatchAssessmentReqModel.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/selected_items/my_selected_assement.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/screens/base/base_view.dart';

@ -5,9 +5,10 @@ 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/models/SOAP/GetAssessmentReqModel.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/screens/base/base_view.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/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -28,12 +29,14 @@ class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
final Function changeLoadingState;
final int currentIndex;
final int currentIndex;
UpdateAssessmentPage(
{Key key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState, this.currentIndex});
this.changeLoadingState,
this.currentIndex});
@override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
@ -42,6 +45,7 @@ class UpdateAssessmentPage extends StatefulWidget {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List();
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -54,7 +58,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()));
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientAssessment(getAssessmentReqModel);
if (model.patientAssessmentList.isNotEmpty) {
if (model.listOfDiagnosisCondition.length == 0) {
@ -83,11 +88,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
diagnosisType != null &&
diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment =
MySelectedAssessment(
appointmentId: element.appointmentNo,
SoapUtils.generateMySelectedAssessment(
appointmentNo: element.appointmentNo,
remark: element.remarks,
selectedDiagnosisType: diagnosisType,
selectedDiagnosisCondition: diagnosisCondition,
diagnosisType: diagnosisType,
diagnosisCondition: diagnosisCondition,
selectedICD: selectedICD,
doctorID: element.doctorID,
doctorName: element.doctorName,
@ -103,207 +108,173 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
backgroundColor: Theme
.of(context)
.scaffoldBackgroundColor,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
color: Theme
.of(context)
.scaffoldBackgroundColor,
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex),
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).assessment
,
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
SOAPOpenItems(label: "${TranslationBase.of(context).addAssessment}",onTap: () {
openAssessmentDialog(context,
isUpdate: false, model: model);
},),
SizedBox(
height: 20,
),
Column(
children: mySelectedAssessmentList
.map((assessment) {
return Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: "ICD : ".toUpperCase(),
),
new TextSpan(
text: assessment
.selectedICD.code
.trim()
.toUpperCase() ??
"",
),
],
),
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.50,
child: RichText(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).assessment,
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
SOAPOpenItems(
label:
"${TranslationBase.of(context).addAssessment}",
onTap: () {
openAssessmentDialog(context,
isUpdate: false, model: model);
},
),
SizedBox(
height: 20,
),
Column(
children:
mySelectedAssessmentList.map((assessment) {
return Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 16,
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text:
"ICD : ".toUpperCase(),
),
new TextSpan(
text: assessment
.selectedICD.description
.toString(),
.selectedICD.code
.trim()
.toUpperCase() ??
"",
),
],
),
),
),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.appointmentNo,
Container(
width: MediaQuery.of(context)
.size
.width *
0.50,
child: RichText(
text: new TextSpan(
style: new TextStyle(
color: Color(0xFF575757),
),
),
new TextSpan(
text: assessment
.appointmentId.toString()
??
"",
style: new TextStyle(
fontSize: 14,
color: Color(0xFF2B353E),
),
fontSize: 16,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: assessment
.selectedICD
.description
.toString(),
),
],
),
],
),
),
),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.condition +
" : ",
style: new TextStyle(
color: Color(0xFF575757),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.appointmentNo,
style: new TextStyle(
color: Color(0xFF575757),
),
),
),
new TextSpan(
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisCondition
.nameAr
: assessment
.selectedDiagnosisCondition
.nameEn,
style: new TextStyle(
fontSize: 14,
color: Color(0xFF2B353E),
new TextSpan(
text: assessment
.appointmentId
.toString() ??
"",
style: new TextStyle(
fontSize: 14,
color: Color(0xFF2B353E),
),
),
),
],
],
),
),
),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.dType +
' : ',
style: new TextStyle(
color: Color(0xFF575757),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.condition +
" : ",
style: new TextStyle(
color: Color(0xFF575757),
),
),
),
new TextSpan(
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisType
.nameAr
: assessment
.selectedDiagnosisType
.nameEn,
style: new TextStyle(
fontSize: 14,
color: Color(0xFF2B353E),
new TextSpan(
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisCondition
.nameAr
: assessment
.selectedDiagnosisCondition
.nameEn,
style: new TextStyle(
fontSize: 14,
color: Color(0xFF2B353E),
),
),
),
],
],
),
),
),
if (assessment.doctorName != null)
RichText(
text: new TextSpan(
style: new TextStyle(
@ -316,16 +287,21 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
new TextSpan(
text: TranslationBase.of(
context)
.doc +
.dType +
' : ',
style: new TextStyle(
color: Color(0xFF575757),
),
),
new TextSpan(
text:
assessment.doctorName ??
'',
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisType
.nameAr
: assessment
.selectedDiagnosisType
.nameEn,
style: new TextStyle(
fontSize: 14,
color: Color(0xFF2B353E),
@ -334,204 +310,236 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
],
),
),
SizedBox(
height: 6,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
AppText(
(assessment.remark != null &&
assessment.remark !=
'')
? TranslationBase.of(
context)
.remarks +
" : "
: '',
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.38,
child: AppText(
assessment.remark ?? "",
fontSize: 11,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
if (assessment.doctorName != null)
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.doc +
' : ',
style: new TextStyle(
color:
Color(0xFF575757),
),
),
new TextSpan(
text: assessment
.doctorName ??
'',
style: new TextStyle(
fontSize: 14,
color:
Color(0xFF2B353E),
),
),
],
),
),
],
),
],
),
Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Row(
children: [
Column(
children: [
AppText(
assessment.createdOn != null
? AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.parse(
assessment
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight
.w600,
fontSize: 14,
), AppText(
assessment.createdOn != null
? AppDateUtils.getHour(
DateTime.parse(
assessment
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight
.w600,
fontSize: 14,
SizedBox(
height: 6,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
AppText(
(assessment.remark !=
null &&
assessment.remark !=
'')
? TranslationBase.of(
context)
.remarks +
" : "
: '',
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
Container(
width: MediaQuery.of(context)
.size
.width *
0.38,
child: AppText(
assessment.remark ?? "",
fontSize: 11,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
],
),
],
),
],
),
Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Row(
children: [
Column(
children: [
AppText(
assessment.createdOn !=
null
? AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.parse(
assessment
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime
.now()),
fontWeight:
FontWeight.w600,
fontSize: 14,
),
AppText(
assessment.createdOn !=
null
? AppDateUtils.getHour(
DateTime.parse(
assessment
.createdOn))
: AppDateUtils
.getHour(DateTime
.now()),
fontWeight:
FontWeight.w600,
fontSize: 14,
),
],
),
],
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
0.05,
),
InkWell(
onTap: () {
openAssessmentDialog(context,
isUpdate: true,
assessment: assessment,
model: model);
},
child: Icon(
DoctorApp.edit,
size: 18,
),
],
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
0.05,
),
InkWell(
onTap: () {
openAssessmentDialog(context,
isUpdate: true,
assessment: assessment,
model: model);
},
child: Icon(
DoctorApp.edit, size: 18,),
)
],
),
],
),
);
}).toList(),
)
],
)
]),
isExpanded: isAssessmentExpand,
),
SizedBox(
height: 130,
),
],
)
],
),
],
),
);
}).toList(),
)
],
)
]),
isExpanded: isAssessmentExpand,
),
SizedBox(
height: 130,
),
],
),
),
),
),
),
),
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,
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
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);
}
},
),
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,
),
],
),)
),
SizedBox(
height: 5,
),
],
),
)),
);
}
openAssessmentDialog(BuildContext context,
{MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) {
if (assessment == null) {
assessment = MySelectedAssessment(
remark: '', appointmentId: widget.patientInfo.appointmentNo);
assessment = SoapUtils.generateMySelectedAssessment(
remark: '', appointmentNo: widget.patientInfo.appointmentNo);
}
showModalBottomSheet(
backgroundColor: Colors.white,
@ -546,11 +554,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async {
setState(() {
if(!isUpdate)
mySelectedAssessmentList.add(mySelectedAssessment);
if (!isUpdate)
mySelectedAssessmentList.add(mySelectedAssessment);
});
});
});
}
}

@ -2,7 +2,7 @@ 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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_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/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';

@ -2,7 +2,7 @@
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/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/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';

@ -1,6 +1,6 @@
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/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/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';

@ -1,5 +1,5 @@
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/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';

@ -4,11 +4,12 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.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/doctor/doctor_profile_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/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -80,8 +81,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster,
MySelectedExamination tempEam =
SoapUtils.generateMySelectedExamination(
examination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,

@ -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, remark, isLocal}) {
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: isChecked,
remark: remark,
isLocal: isLocal);
return mySelectedHistory;
}
static MySelectedAllergy generateMySelectedAllergy(
{allergy,
allergySeverity,
isChecked,
remark,
isLocal,
int createdBy,
bool isExpanded}) {
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,
remark,
isLocal,
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,7 +3,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_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/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';

@ -1,7 +1,7 @@
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/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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
@ -12,6 +12,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../soap_utils.dart';
class AddAllergiesItem extends StatefulWidget {
final SOAPViewModel model;
final Function(MasterKeyModel) removeAllergy;
@ -139,14 +141,14 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
}
: null,
isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity,
hintText: TranslationBase.of(context).selectSeverity + "*",
enabled: false,
maxLines: 2,
minLines: 2,
validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context).severityValidationError
: null,
controller: severityController,
),
@ -184,9 +186,9 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
widget.removeAllergy(widget.item);
} else {
MySelectedAllergy mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy: widget.item,
selectedAllergySeverity: _selectedAllergySeverity,
SoapUtils.generateMySelectedAllergy(
allergy: widget.item,
allergySeverity: _selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_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/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';

@ -1,5 +1,5 @@
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/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';

@ -2,8 +2,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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_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/patients/profile/soap_update/soap_utils.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/buttons/app_buttons_widget.dart';
@ -215,10 +216,10 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
if (myhistory.isEmpty) {
setState(() {
MySelectedHistory mySelectedHistory = MySelectedHistory(
remark: history.remarks ?? "",
selectedHistory: history,
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(remark: history.remarks ?? "",
history: history,
isChecked: true);
widget.myHistoryList.add(mySelectedHistory);
});
} else {

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

@ -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:flutter/material.dart';

@ -6,14 +6,15 @@ 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/GetHistoryReqModel.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/my_selected_history.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.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_chief_complaint_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/patient/patiant_info_model.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -55,8 +56,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
String medicationControllerError = '';
String illnessControllerError = '';
final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList=List();
List<MySelectedHistory> myHistoryList=List();
List<MySelectedAllergy> myAllergiesList = List();
List<MySelectedHistory> myHistoryList = List();
getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true);
@ -84,51 +85,67 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}
model.patientHistoryList.forEach((element) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
if (element.historyType ==
MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId,
);
if (history != null) {
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);
}
}
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
if (element.historyType ==
MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId,
);
if (history != null) {
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);
}
}
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
if (element.historyType ==
MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports,
id: element.historyId,
);
if (history != null) {
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);
}
}
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
if (element.historyType ==
MasterKeysService.HistorySurgical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId,
);
if (history != null) {
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);
}
}
@ -145,16 +162,23 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP);
if (model.patientAllergiesList.isNotEmpty) {
if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies);
if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity);
if (model.allergiesList.isEmpty)
await model.getMasterLookup(MasterKeysService.Allergies);
if (model.allergySeverityList.isEmpty)
await model.getMasterLookup(MasterKeysService.AllergySeverity);
model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity;
if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel(
id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
id: 0,
typeId: MasterKeysService.AllergySeverity.getMasterKeyService(),
nameAr: '',
nameEn: '');
} else {
selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
@ -162,14 +186,17 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
);
}
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: selectedAllergy,
isChecked: element.isChecked,
createdBy: element.createdBy,
remark: element.remarks,
isLocal : false,
selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
MySelectedAllergy mySelectedAllergy =
SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy,
isChecked: element.isChecked,
createdBy: element.createdBy,
remark: element.remarks,
isLocal: false,
allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null)
myAllergiesList.add(mySelectedAllergy);
});
}
}
@ -181,20 +208,25 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
myAllergiesList.clear();
myHistoryList.clear();
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN,
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo,
doctorID: '');
GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN,
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo,
doctorID: '');
await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true;
complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint);
complaintsController.text = Helpers.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text = !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
? model.patientChiefComplaintList[0].currentMedication + '\n \n'
: model.patientChiefComplaintList[0].currentMedication;
medicationController.text =
!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
? model.patientChiefComplaintList[0].currentMedication +
'\n \n'
: model.patientChiefComplaintList[0].currentMedication;
}
await getHistory(model);
@ -214,7 +246,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex),
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).chiefComplaints,
onTap: () {
@ -245,7 +279,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
});
},
child: Column(
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
children: [
UpdateHistoryWidget(myHistoryList: myHistoryList)
],
),
isExpanded: isHistoryExpand,
),
@ -306,7 +342,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
// loading: model.state == ViewState.BusyLocal,
onPressed: () async {
addSubjectiveInfo(
model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
model: model,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList);
},
),
),
@ -323,9 +361,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}
addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
if(FocusScope.of(context).hasFocus)
FocusScope.of(context).unfocus();
{SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MySelectedHistory> myHistoryList}) async {
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
widget.changeLoadingState(true);
formKey.currentState.save();
formKey.currentState.validate();
@ -360,7 +399,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
if (complaintsController.text.isEmpty) {
complaintsControllerError = TranslationBase.of(context).emptyMessage;
} else if (complaintsController.text.length < 25) {
complaintsControllerError = TranslationBase.of(context).chiefComplaintLength;
complaintsControllerError =
TranslationBase.of(context).chiefComplaintLength;
}
if (illnessController.text.isEmpty) {
@ -373,33 +413,38 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
});
widget.changeLoadingState(false);
Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
Helpers.showErrorToast(
TranslationBase.of(context).chiefComplaintErrorMsg);
}
}
postAllergy({List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
postAllergy(
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null)
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
});
if (model.patientAllergiesList.isEmpty) {
await model.postAllergy(postAllergyRequestModel);
@ -423,10 +468,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}
}
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
postHistories(
{List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
@ -452,17 +500,18 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
postChiefComplaint({SOAPViewModel model}) async {
formKey.currentState.save();
if (formKey.currentState.validate()) {
PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
chiefComplaint: complaintsController.text,
currentMedication: medicationController.text,
hopi: illnessController.text,
isLactation: false,
ispregnant: false,
doctorID: '',
numberOfWeeks: 0);
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
new PostChiefComplaintRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
chiefComplaint: complaintsController.text,
currentMedication: medicationController.text,
hopi: illnessController.text,
isLactation: false,
ispregnant: false,
doctorID: '',
numberOfWeeks: 0);
if (model.patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
await model.postChiefComplaint(postChiefComplaintRequestModel);

@ -1,9 +1,8 @@
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/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.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';
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/patients/profile/soap_update/subjective/update_subjective_page.dart';

@ -1366,6 +1366,7 @@ class TranslationBase {
String get addPrescription => localizedValues['addPrescription'][locale.languageCode];
String get edit => localizedValues['edit'][locale.languageCode];
String get summeryReply => localizedValues['summeryReply'][locale.languageCode];
String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save