Merge branches 'development' and 'pesrcription-post' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into pesrcription-post
commit
eef5d57d2f
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 651 B |
@ -0,0 +1,7 @@
|
||||
<svg id="enter" xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42">
|
||||
<path id="Path_1146" data-name="Path 1146" d="M17.938,210.625H1.313a1.313,1.313,0,1,1,0-2.625H17.938a1.313,1.313,0,1,1,0,2.625Zm0,0" transform="translate(22.749 -190.938)"/>
|
||||
<path id="Path_1147" data-name="Path 1147" d="M123.984,143.736a1.313,1.313,0,0,1-.928-2.242l5.635-5.635-5.635-5.633a1.313,1.313,0,0,1,1.857-1.857l6.563,6.562a1.313,1.313,0,0,1,0,1.857l-6.562,6.562A1.31,1.31,0,0,1,123.984,143.736Zm0,0" transform="translate(-89.86 -117.486)"/>
|
||||
<path id="Path_1148" data-name="Path 1148" d="M312.668,42.076a3.5,3.5,0,0,0,3.5-3.5V7.076A3.522,3.522,0,0,0,313.8,3.753L303.284.248a3.537,3.537,0,0,0-4.616,3.329v31.5a3.524,3.524,0,0,0,2.368,3.321L311.553,41.9A3.662,3.662,0,0,0,312.668,42.076ZM302.168,2.7a1.03,1.03,0,0,1,.313.046l10.47,3.491a.9.9,0,0,1,.592.838v31.5a.922.922,0,0,1-1.188.83l-10.47-3.491a.905.905,0,0,1-.591-.838V3.576A.876.876,0,0,1,302.168,2.7Zm0,0" transform="translate(-298.668 -0.076)"/>
|
||||
<path id="Path_1149" data-name="Path 1149" d="M195.168,8.75a1.313,1.313,0,0,0,1.313-1.312V4.813A4.816,4.816,0,0,0,191.668,0H171.98a1.313,1.313,0,0,0,0,2.625h19.688a2.19,2.19,0,0,1,2.187,2.188V7.438A1.313,1.313,0,0,0,195.168,8.75Zm0,0" transform="translate(-168.48)"/>
|
||||
<path id="Path_1150" data-name="Path 1150" d="M171.98,350.082h7a4.816,4.816,0,0,0,4.812-4.813v-2.625a1.313,1.313,0,0,0-2.625,0v2.625a2.19,2.19,0,0,1-2.187,2.188h-7a1.313,1.313,0,0,0,0,2.625Zm0,0" transform="translate(-155.793 -313.332)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 987 B |
@ -0,0 +1,52 @@
|
||||
class GetRescheduleLeavesResponse {
|
||||
int clinicId;
|
||||
var coveringDoctorId;
|
||||
String date;
|
||||
String dateTimeFrom;
|
||||
String dateTimeTo;
|
||||
int doctorId;
|
||||
int reasonId;
|
||||
int requisitionNo;
|
||||
int requisitionType;
|
||||
int status;
|
||||
|
||||
GetRescheduleLeavesResponse(
|
||||
{this.clinicId,
|
||||
this.coveringDoctorId,
|
||||
this.date,
|
||||
this.dateTimeFrom,
|
||||
this.dateTimeTo,
|
||||
this.doctorId,
|
||||
this.reasonId,
|
||||
this.requisitionNo,
|
||||
this.requisitionType,
|
||||
this.status});
|
||||
|
||||
GetRescheduleLeavesResponse.fromJson(Map<String, dynamic> json) {
|
||||
clinicId = json['clinicId'];
|
||||
coveringDoctorId = json['coveringDoctorId'];
|
||||
date = json['date'];
|
||||
dateTimeFrom = json['dateTimeFrom'];
|
||||
dateTimeTo = json['dateTimeTo'];
|
||||
doctorId = json['doctorId'];
|
||||
reasonId = json['reasonId'];
|
||||
requisitionNo = json['requisitionNo'];
|
||||
requisitionType = json['requisitionType'];
|
||||
status = json['status'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['clinicId'] = this.clinicId;
|
||||
data['coveringDoctorId'] = this.coveringDoctorId;
|
||||
data['date'] = this.date;
|
||||
data['dateTimeFrom'] = this.dateTimeFrom;
|
||||
data['dateTimeTo'] = this.dateTimeTo;
|
||||
data['doctorId'] = this.doctorId;
|
||||
data['reasonId'] = this.reasonId;
|
||||
data['requisitionNo'] = this.requisitionNo;
|
||||
data['requisitionType'] = this.requisitionType;
|
||||
data['status'] = this.status;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
class UcafDetailScreen extends StatefulWidget {
|
||||
@override
|
||||
_UcafDetailScreenState createState() => _UcafDetailScreenState();
|
||||
}
|
||||
|
||||
class _UcafDetailScreenState extends State<UcafDetailScreen> {
|
||||
|
||||
int _activeTap = 1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return BaseView<UcafViewModel>(
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).ucaf,
|
||||
body: Container(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
PatientHeaderWidgetNoAvatar(patient),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
treatmentStepsBar(context, screenSize),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget treatmentStepsBar(BuildContext _context, Size screenSize) {
|
||||
List<String> __treatmentSteps = [
|
||||
TranslationBase.of(context).diagnosis.toUpperCase(),
|
||||
TranslationBase.of(context).medications.toUpperCase(),
|
||||
TranslationBase.of(context).procedures.toUpperCase(),
|
||||
];
|
||||
return Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration:
|
||||
Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: __treatmentSteps.map((item) {
|
||||
bool _isActive = __treatmentSteps[_activeTap] == item ? true : false;
|
||||
return Expanded(
|
||||
child: InkWell(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: Helpers.containerBorderDecoration(
|
||||
_isActive ? HexColor("#B8382B") : Colors.white,
|
||||
_isActive ? HexColor("#B8382B") : Colors.white),
|
||||
child: Center(
|
||||
child: Text(
|
||||
item,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: _isActive
|
||||
? Colors.white
|
||||
: Colors.black, //Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
onTap: () {
|
||||
print(__treatmentSteps.indexOf(item));
|
||||
setState(() {
|
||||
_activeTap = __treatmentSteps.indexOf(item);
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,292 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
|
||||
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
||||
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart';
|
||||
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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_text_form_field.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AddRescheduleLeavScreen extends StatelessWidget {
|
||||
ProjectViewModel projectsProvider;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectsProvider = Provider.of(context);
|
||||
return BaseView<SickLeaveViewModel>(
|
||||
onModelReady: (model) =>
|
||||
{model.getRescheduleLeave(), model.getCoveringDoctors()},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
|
||||
body: model.getReschduleLeave.length > 0
|
||||
? SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 15, right: 15, top: 20),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppTextFormField(
|
||||
hintText:
|
||||
TranslationBase.of(context).requestLeave,
|
||||
borderColor: Colors.white,
|
||||
prefix: IconButton(
|
||||
icon: Icon(
|
||||
Icons.add_circle,
|
||||
color: Colors.red,
|
||||
)),
|
||||
textInputType: TextInputType.text,
|
||||
onTap: () {
|
||||
openLeave(
|
||||
context,
|
||||
false,
|
||||
);
|
||||
},
|
||||
inputFormatter: ONLY_LETTERS,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: model.getReschduleLeave.map<Widget>(
|
||||
(GetRescheduleLeavesResponse item) {
|
||||
return CardWithBgWidgetNew(
|
||||
widget: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.only(left: 10, right: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Wrap(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.all(3),
|
||||
child: AppText(
|
||||
item.status == 1
|
||||
? TranslationBase
|
||||
.of(context)
|
||||
.approved
|
||||
: item.status == 2
|
||||
? TranslationBase.of(
|
||||
context)
|
||||
.pending
|
||||
: TranslationBase.of(
|
||||
context)
|
||||
.rejected,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
color: item.status == 1
|
||||
? Colors.green
|
||||
: item.status == 2
|
||||
? Colors
|
||||
.yellow[800]
|
||||
: Colors.red[800],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
child: AppText(
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.holiday +
|
||||
' ',
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
)),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
item.dateTimeFrom +
|
||||
' ' +
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.to +
|
||||
' ' +
|
||||
item.dateTimeTo,
|
||||
// overflow:
|
||||
// TextOverflow.ellipsis,
|
||||
))
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.coveringDoctor,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
),
|
||||
model.coveringDoctors
|
||||
.length >
|
||||
0
|
||||
? Row(children: [
|
||||
AppText(getDoctor(
|
||||
model
|
||||
.coveringDoctors,
|
||||
item.doctorId))
|
||||
])
|
||||
: SizedBox(),
|
||||
AppText(
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.reasons,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
),
|
||||
model.allReasons.length > 0
|
||||
? Row(children: [
|
||||
AppText(getReasons(
|
||||
model
|
||||
.allReasons,
|
||||
item.reasonId))
|
||||
])
|
||||
: SizedBox(),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
(item.status == 1)
|
||||
? Expanded(
|
||||
flex: 1,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
Icons.edit_outlined,
|
||||
size: 30,
|
||||
),
|
||||
// color: Colors.green, //Colors.black,
|
||||
onPressed: () => {
|
||||
openLeave(context, true,
|
||||
extendedData: item)
|
||||
},
|
||||
))
|
||||
: SizedBox(),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
),
|
||||
],
|
||||
));
|
||||
}).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: new Builder(builder: (context) {
|
||||
return Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(40),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: HexColor('#B8382C'), width: 4),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(100))),
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
Icons.add,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () {
|
||||
openLeave(
|
||||
context,
|
||||
false,
|
||||
);
|
||||
}),
|
||||
),
|
||||
Padding(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).noReScheduleLeave,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
padding: EdgeInsets.all(10),
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context).applyNow,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: HexColor('#B8382C'),
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}),
|
||||
));
|
||||
}
|
||||
|
||||
openLeave(BuildContext context, isExtend, {extendedData}) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return new Container(
|
||||
child: RescheduleLeaveScreen(
|
||||
isExtend,
|
||||
extendedData,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
getDoctor(model, doctorId) {
|
||||
var obj;
|
||||
obj = model.where((i) => i['doctorID'] == doctorId).toList();
|
||||
print(obj);
|
||||
|
||||
return obj.length > 0 ? obj[0]['doctorName'] : "";
|
||||
}
|
||||
|
||||
getReasons(model, reasonID) {
|
||||
var obj;
|
||||
obj = model.where((i) => i['id'] == reasonID).toList();
|
||||
print(obj);
|
||||
|
||||
return obj.length > 0
|
||||
? projectsProvider.isArabic == true
|
||||
? obj[0]['nameAr']
|
||||
: obj[0]['nameEn']
|
||||
: "";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,819 @@
|
||||
import 'package:date_time_picker/date_time_picker.dart';
|
||||
import 'package:doctor_app_flutter/config/config.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/viewModel/patient_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/text_validator.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
Helpers helpers = Helpers();
|
||||
|
||||
class RescheduleLeaveScreen extends StatefulWidget {
|
||||
final isUpdate;
|
||||
final updateData;
|
||||
RescheduleLeaveScreen(this.isUpdate, this.updateData);
|
||||
@override
|
||||
_RescheduleLeaveScreen createState() => _RescheduleLeaveScreen();
|
||||
}
|
||||
|
||||
class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
TextEditingController _toDateController = new TextEditingController();
|
||||
TextEditingController _toDateController2 = new TextEditingController();
|
||||
ProjectViewModel projectsProvider;
|
||||
String _selectedClinic;
|
||||
Map profile = {};
|
||||
var offTime = '2';
|
||||
var date;
|
||||
var doctorID;
|
||||
var reason;
|
||||
var fromDate;
|
||||
var toDate;
|
||||
var clinicID;
|
||||
TextEditingController _controller4;
|
||||
void _presentDatePicker(id) {
|
||||
showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime.now(),
|
||||
lastDate: DateTime(2050),
|
||||
).then((pickedDate) {
|
||||
if (pickedDate == null) {
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
final df = new DateFormat('yyyy-MM-dd');
|
||||
if (id == 'fromDate') {
|
||||
fromDate = pickedDate; //df.format();
|
||||
_toDateController.text = df.format(pickedDate);
|
||||
} else {
|
||||
toDate = pickedDate; //
|
||||
_toDateController2.text = df.format(pickedDate);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
getProfile();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectsProvider = Provider.of(context);
|
||||
return BaseView<PatientViewModel>(
|
||||
onModelReady: (model) => model.getClinicsList(),
|
||||
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
|
||||
onModelReady: (model2) => {
|
||||
model2.getOffTime(),
|
||||
model2.getReasons(18),
|
||||
model2.getCoveringDoctors()
|
||||
},
|
||||
builder: (_, model2, w) => AppScaffold(
|
||||
baseViewModel: model2,
|
||||
isShowAppBar: false,
|
||||
body: Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
width: double.infinity,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeConfig.widthMultiplier * 0.9,
|
||||
bottom: SizeConfig.widthMultiplier * 0.9,
|
||||
right: SizeConfig.widthMultiplier * 3,
|
||||
left: SizeConfig.widthMultiplier * 3),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
// add Expanded to have your dropdown button fill remaining space
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: new IgnorePointer(
|
||||
ignoring: true,
|
||||
child: DropdownButton(
|
||||
focusColor: Colors.grey,
|
||||
isExpanded: true,
|
||||
value: getClinicName(
|
||||
model) ??
|
||||
"",
|
||||
iconSize: 40,
|
||||
elevation: 16,
|
||||
selectedItemBuilder:
|
||||
(BuildContext
|
||||
context) {
|
||||
return model
|
||||
.getClinicNameList()
|
||||
.map((item) {
|
||||
return Row(
|
||||
mainAxisSize:
|
||||
MainAxisSize
|
||||
.max,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
item,
|
||||
fontSize: SizeConfig
|
||||
.textMultiplier *
|
||||
2.1,
|
||||
color:
|
||||
Colors.grey,
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
onChanged: (newValue) =>
|
||||
{},
|
||||
items: model
|
||||
.getClinicNameList()
|
||||
.map((item) {
|
||||
return DropdownMenuItem(
|
||||
value:
|
||||
item.toString(),
|
||||
child: Text(
|
||||
item,
|
||||
textAlign:
|
||||
TextAlign.end,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
))),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
new IgnorePointer(
|
||||
ignoring: true,
|
||||
child: AppTextFormField(
|
||||
readOnly: true,
|
||||
hintText: profile != null
|
||||
? profile['DoctorName']
|
||||
: "",
|
||||
borderColor: Colors.white,
|
||||
onSaved: (value) {},
|
||||
inputFormatter: ONLY_NUMBERS))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
width: double.infinity,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeConfig.widthMultiplier * 0.9,
|
||||
bottom: SizeConfig.widthMultiplier * 0.9,
|
||||
right: SizeConfig.widthMultiplier * 3,
|
||||
left: SizeConfig.widthMultiplier * 3),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
model2.allOffTime.length > 0
|
||||
? Expanded(
|
||||
// add Expanded to have your dropdown button fill remaining space
|
||||
child:
|
||||
DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
focusColor: Colors.grey,
|
||||
isExpanded: true,
|
||||
value: offTime == null
|
||||
? model2.allOffTime[0]
|
||||
['code']
|
||||
: offTime,
|
||||
iconSize: 40,
|
||||
elevation: 16,
|
||||
selectedItemBuilder:
|
||||
(BuildContext context) {
|
||||
return model2.allOffTime
|
||||
.map((item) {
|
||||
return Row(
|
||||
mainAxisSize:
|
||||
MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
item[
|
||||
'description'],
|
||||
fontSize: SizeConfig
|
||||
.textMultiplier *
|
||||
2.1,
|
||||
color:
|
||||
Colors.grey,
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
onChanged: (newValue) => {
|
||||
setState(() {
|
||||
offTime = newValue;
|
||||
}),
|
||||
if (offTime == '1')
|
||||
{model2.getReasons(18)}
|
||||
else if (offTime == '2')
|
||||
{model2.getReasons(19)}
|
||||
else if (offTime == '3' ||
|
||||
offTime == '5')
|
||||
{model2.getReasons(102)}
|
||||
},
|
||||
items: model2.allOffTime
|
||||
.map((item) {
|
||||
return DropdownMenuItem<
|
||||
String>(
|
||||
value: item['code']
|
||||
.toString(),
|
||||
child: Text(
|
||||
item['description'],
|
||||
textAlign:
|
||||
TextAlign.end,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
offTime == '1'
|
||||
? Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppTextFormField(
|
||||
hintText: TranslationBase.of(
|
||||
context)
|
||||
.fromDate,
|
||||
borderColor: Colors.white,
|
||||
prefix: IconButton(
|
||||
icon: Icon(Icons
|
||||
.calendar_today)),
|
||||
textInputType:
|
||||
TextInputType.number,
|
||||
controller: _toDateController,
|
||||
onTap: () {
|
||||
_presentDatePicker(
|
||||
'fromDate');
|
||||
},
|
||||
inputFormatter: ONLY_DATE,
|
||||
onChanged: (value) {
|
||||
fromDate = value;
|
||||
}),
|
||||
],
|
||||
)),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(
|
||||
Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color:
|
||||
HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
// new AppTextFormField(
|
||||
// readOnly: true,
|
||||
// hintText: "",
|
||||
// borderColor: Colors.white,
|
||||
// onSaved: (value) {},
|
||||
// inputFormatter: ONLY_NUMBERS),
|
||||
|
||||
DateTimePicker(
|
||||
type:
|
||||
DateTimePickerType.time,
|
||||
controller: _controller4,
|
||||
//initialValue: _initialValue,
|
||||
// icon: Icon(Icons.access_time),
|
||||
|
||||
//use24HourFormat: false,
|
||||
//locale: Locale('en', 'US'),
|
||||
onChanged: (val) => () {
|
||||
print(val);
|
||||
},
|
||||
validator: (val) {
|
||||
print(val);
|
||||
// setState(
|
||||
// () => _valueToValidate4 = val);
|
||||
return null;
|
||||
},
|
||||
onSaved: (val) => {},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(
|
||||
Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color:
|
||||
HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
DateTimePicker(
|
||||
type:
|
||||
DateTimePickerType.time,
|
||||
controller: _controller4,
|
||||
//initialValue: _initialValue,
|
||||
// icon: Icon(Icons.access_time),
|
||||
|
||||
//use24HourFormat: false,
|
||||
//locale: Locale('en', 'US'),
|
||||
onChanged: (val) => () {
|
||||
print(val);
|
||||
},
|
||||
validator: (val) {
|
||||
print(val);
|
||||
// setState(
|
||||
// () => _valueToValidate4 = val);
|
||||
return null;
|
||||
},
|
||||
onSaved: (val) =>
|
||||
{print(val)},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppTextFormField(
|
||||
hintText: TranslationBase.of(
|
||||
context)
|
||||
.fromDate,
|
||||
borderColor: Colors.white,
|
||||
prefix: IconButton(
|
||||
icon: Icon(Icons
|
||||
.calendar_today)),
|
||||
textInputType:
|
||||
TextInputType.number,
|
||||
controller: _toDateController,
|
||||
onTap: () {
|
||||
_presentDatePicker(
|
||||
'fromDate');
|
||||
},
|
||||
inputFormatter: ONLY_DATE,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
toDate = value;
|
||||
});
|
||||
}),
|
||||
],
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppTextFormField(
|
||||
hintText: TranslationBase
|
||||
.of(context)
|
||||
.fromDate,
|
||||
borderColor: Colors.white,
|
||||
prefix: IconButton(
|
||||
icon: Icon(
|
||||
Icons
|
||||
.calendar_today)),
|
||||
textInputType:
|
||||
TextInputType.number,
|
||||
controller:
|
||||
_toDateController2,
|
||||
onTap: () {
|
||||
_presentDatePicker(
|
||||
'toDate');
|
||||
},
|
||||
inputFormatter: ONLY_DATE,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
toDate = value;
|
||||
});
|
||||
}),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
width: double.infinity,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeConfig.widthMultiplier * 0.9,
|
||||
bottom: SizeConfig.widthMultiplier * 0.9,
|
||||
right: SizeConfig.widthMultiplier * 3,
|
||||
left: SizeConfig.widthMultiplier * 3),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
model2.allReasons.length > 0
|
||||
? Expanded(
|
||||
// add Expanded to have your dropdown button fill remaining space
|
||||
child:
|
||||
DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
focusColor: Colors.grey,
|
||||
isExpanded: true,
|
||||
value: reason == null
|
||||
? model2.allReasons[0]
|
||||
['id']
|
||||
.toString()
|
||||
: reason,
|
||||
iconSize: 40,
|
||||
elevation: 16,
|
||||
selectedItemBuilder:
|
||||
(BuildContext context) {
|
||||
return model2.allReasons
|
||||
.map((item) {
|
||||
return Row(
|
||||
mainAxisSize:
|
||||
MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
projectsProvider
|
||||
.isArabic
|
||||
? item[
|
||||
'nameAr']
|
||||
: item[
|
||||
'nameEn'],
|
||||
fontSize: SizeConfig
|
||||
.textMultiplier *
|
||||
2.1,
|
||||
color:
|
||||
Colors.grey,
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
onChanged: (newValue) => {
|
||||
setState(() {
|
||||
reason = newValue;
|
||||
})
|
||||
},
|
||||
items: model2.allReasons
|
||||
.map((item) {
|
||||
return DropdownMenuItem<
|
||||
String>(
|
||||
value: item['id']
|
||||
.toString(),
|
||||
child: Text(
|
||||
projectsProvider
|
||||
.isArabic
|
||||
? item['nameAr']
|
||||
: item['nameEn'],
|
||||
textAlign:
|
||||
TextAlign.end,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: HexColor("#CCCCCC"))),
|
||||
width: double.infinity,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeConfig.widthMultiplier * 0.9,
|
||||
bottom: SizeConfig.widthMultiplier * 0.9,
|
||||
right: SizeConfig.widthMultiplier * 3,
|
||||
left: SizeConfig.widthMultiplier * 3),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
model2.coveringDoctors.length > 0
|
||||
? Expanded(
|
||||
// add Expanded to have your dropdown button fill remaining space
|
||||
child:
|
||||
DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
focusColor: Colors.grey,
|
||||
isExpanded: true,
|
||||
value: doctorID == null
|
||||
? model2
|
||||
.coveringDoctors[0]
|
||||
['doctorID']
|
||||
.toString()
|
||||
: doctorID,
|
||||
iconSize: 40,
|
||||
elevation: 16,
|
||||
selectedItemBuilder:
|
||||
(BuildContext context) {
|
||||
return model2
|
||||
.coveringDoctors
|
||||
.map((item) {
|
||||
return Row(
|
||||
mainAxisSize:
|
||||
MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
projectsProvider
|
||||
.isArabic
|
||||
? item[
|
||||
'doctorNameN']
|
||||
: item[
|
||||
'doctorName'],
|
||||
fontSize: SizeConfig
|
||||
.textMultiplier *
|
||||
2.1,
|
||||
color:
|
||||
Colors.grey,
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
onChanged: (newValue) => {
|
||||
setState(() {
|
||||
doctorID = newValue;
|
||||
})
|
||||
},
|
||||
items: model2
|
||||
.coveringDoctors
|
||||
.map((item) {
|
||||
return DropdownMenuItem<
|
||||
String>(
|
||||
value: item['doctorID']
|
||||
.toString(),
|
||||
child: Text(
|
||||
projectsProvider
|
||||
.isArabic
|
||||
? item[
|
||||
'doctorNameN']
|
||||
: item[
|
||||
'doctorName'],
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.all(
|
||||
SizeConfig.widthMultiplier * 5),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: widget.isUpdate == true
|
||||
? TranslationBase.of(context).update
|
||||
: TranslationBase.of(context).add,
|
||||
onPressed: () {
|
||||
if (widget.isUpdate == true) {
|
||||
updateRecheduleLeave(model2);
|
||||
} else {
|
||||
addRecheduleLeave(model2);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Column(
|
||||
// children: [
|
||||
// Texts(TranslationBase.of(context)
|
||||
// .previousSickLeaveIssue +
|
||||
// ' ')
|
||||
// ],
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
|
||||
getProfile() async {
|
||||
Map p = await sharedPref.getObj(DOCTOR_PROFILE);
|
||||
setState(() {
|
||||
if (widget.updateData != null) {
|
||||
this.profile = p;
|
||||
this.clinicID = widget.updateData.clinicId;
|
||||
|
||||
_toDateController.text = widget.updateData.dateTimeFrom;
|
||||
_toDateController2.text = widget.updateData.dateTimeTo;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getClinicName(model) {
|
||||
var clinicID = this.profile['ClinicID'] ?? 1;
|
||||
var clinicInfo =
|
||||
model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
|
||||
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
|
||||
}
|
||||
|
||||
addRecheduleLeave(model) {
|
||||
final df = new DateFormat('yyyy-MM-ddThh:mm:ss');
|
||||
Map<String, dynamic> request = {
|
||||
"Requisition": {
|
||||
"requisitionNo": 0,
|
||||
"requisitionType": offTime,
|
||||
"clinicId": this.profile['ClinicID'],
|
||||
"doctorId": this.profile['ClinicID'],
|
||||
"dateTimeFrom": df.format(fromDate),
|
||||
"dateTimeTo": df.format(toDate),
|
||||
"date": df.format(DateTime.now()),
|
||||
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
|
||||
"coveringDoctorId":
|
||||
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
|
||||
"status": 2,
|
||||
"schedule": [
|
||||
{
|
||||
"weekDayId": 1,
|
||||
"shiftId": 1,
|
||||
"isOpen": true,
|
||||
"timeFrom": null,
|
||||
"timeTo": null,
|
||||
"timeFromstr": "",
|
||||
"timeTostr": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
model.addReschedule(request).then((response) {
|
||||
print(response);
|
||||
});
|
||||
}
|
||||
|
||||
updateRecheduleLeave(model) {
|
||||
final df = new DateFormat('yyyy-MM-ddThh:mm:ss');
|
||||
Map<String, dynamic> request = {
|
||||
"Requisition": {
|
||||
"requisitionNo": 0,
|
||||
"requisitionType": offTime,
|
||||
"clinicId": this.profile['ClinicID'],
|
||||
"doctorId": this.profile['ClinicID'],
|
||||
"dateTimeFrom": df.format(fromDate),
|
||||
"dateTimeTo": df.format(toDate),
|
||||
"date": df.format(DateTime.now()),
|
||||
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
|
||||
"coveringDoctorId":
|
||||
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
|
||||
"status": 2,
|
||||
"schedule": [
|
||||
{
|
||||
"weekDayId": 1,
|
||||
"shiftId": 1,
|
||||
"isOpen": true,
|
||||
"timeFrom": null,
|
||||
"timeTo": null,
|
||||
"timeFromstr": "",
|
||||
"timeTostr": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
model.updateReschedule(request).then((response) {
|
||||
print(response);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
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/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PatientHeaderWidgetNoAvatar extends StatelessWidget {
|
||||
final PatiantInformtion patient;
|
||||
|
||||
PatientHeaderWidgetNoAvatar(this.patient);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
patient.firstName + ' ' + patient.lastName,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.textMultiplier * 2.2,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
"VIP",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.textMultiplier * 2.2,
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
AppText(
|
||||
" ${patient.age}",
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: SizeConfig.textMultiplier * 2.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
AppText(
|
||||
"NEW VISIT",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.textMultiplier * 2.0,
|
||||
),
|
||||
AppText(
|
||||
"${patient.companyName}",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.textMultiplier * 2.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
Icons.info_outline,
|
||||
color: Colors.black,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: Color(0xffCCCCCC),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,133 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_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/my_selected_assement.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../soap_update/steps_widget.dart';
|
||||
|
||||
class AddSOAPIndex extends StatefulWidget {
|
||||
final bool isUpdate;
|
||||
|
||||
const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key);
|
||||
@override
|
||||
_AddSOAPIndexState createState() => _AddSOAPIndexState();
|
||||
}
|
||||
|
||||
class _AddSOAPIndexState extends State<AddSOAPIndex>
|
||||
with TickerProviderStateMixin {
|
||||
PageController _controller;
|
||||
int _currentIndex = 0;
|
||||
List<MySelectedAllergy> myAllergiesList= List();
|
||||
List<MasterKeyModel> myHistoryList = List();
|
||||
List<MySelectedExamination> mySelectedExamination = List();
|
||||
MySelectedAssessment mySelectedAssessment = new MySelectedAssessment();
|
||||
changePageViewIndex(pageIndex) {
|
||||
_controller.jumpToPage(pageIndex);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
_controller = new PageController();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
return BaseView<DoctorReplayViewModel>(
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).healthRecordInformation,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration:
|
||||
BoxDecoration(boxShadow: <BoxShadow>[], color: Colors.white),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
PatientPageHeaderWidget(patient),
|
||||
FractionallySizedBox(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.75,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left:
|
||||
MediaQuery.of(context).size.width * 0.05,
|
||||
right:
|
||||
MediaQuery.of(context).size.width * 0.05),
|
||||
child: StepsWidget(
|
||||
index: _currentIndex,
|
||||
changeCurrentTab: changePageViewIndex,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
SubjectivePage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
myAllergiesList: myAllergiesList,
|
||||
myHistoryList: myHistoryList,
|
||||
patientInfo: patient,
|
||||
),
|
||||
ObjectivePage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
mySelectedExamination:
|
||||
mySelectedExamination,
|
||||
patientInfo: patient,
|
||||
),
|
||||
AssessmentPage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
mySelectedAssessment:
|
||||
mySelectedAssessment,
|
||||
patientInfo: patient,
|
||||
),
|
||||
PlanPage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
patientInfo: patient,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,647 +0,0 @@
|
||||
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/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_assement.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_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/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AssessmentPage extends StatefulWidget {
|
||||
final Function changePageViewIndex;
|
||||
final MySelectedAssessment mySelectedAssessment;
|
||||
final PatiantInformtion patientInfo;
|
||||
|
||||
AssessmentPage(
|
||||
{Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo});
|
||||
|
||||
@override
|
||||
_AssessmentPageState createState() => _AssessmentPageState();
|
||||
}
|
||||
|
||||
class _AssessmentPageState extends State<AssessmentPage> {
|
||||
bool isAssessmentExpand = false;
|
||||
|
||||
List<dynamic> assessmentList;
|
||||
dynamic _referTo;
|
||||
|
||||
TextEditingController remarksController = TextEditingController();
|
||||
Helpers helpers = Helpers();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return BaseView<SOAPViewModel>(
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Texts('ASSESSMENT',
|
||||
variant:
|
||||
isAssessmentExpand ? "bodyText" : '',
|
||||
bold: isAssessmentExpand ? true : false,
|
||||
color: Colors.black),
|
||||
Icon(
|
||||
FontAwesomeIcons.asterisk,
|
||||
color: AppGlobal.appPrimaryColor,
|
||||
size: 12,
|
||||
)
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isAssessmentExpand = !isAssessmentExpand;
|
||||
});
|
||||
},
|
||||
child: Icon(isAssessmentExpand
|
||||
? EvaIcons.minus
|
||||
: EvaIcons.plus))
|
||||
],
|
||||
),
|
||||
bodyWidget: Column(children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 5, right: 5, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Add ASSESSMENT",
|
||||
fontSize: 13.5,
|
||||
onTapTextFields: () {
|
||||
openAssessmentDialog(context);
|
||||
},
|
||||
readOnly: true,
|
||||
// hintColor: Colors.black,
|
||||
suffixIcon: EvaIcons.plusCircleOutline,
|
||||
suffixIconColor: AppGlobal.appPrimaryColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
// controller: messageController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
if(widget.mySelectedAssessment != null &&
|
||||
widget.mySelectedAssessment
|
||||
.appointmentId !=
|
||||
null && widget.mySelectedAssessment
|
||||
.selectedDiagnosisType != null &&
|
||||
widget.mySelectedAssessment
|
||||
.selectedDiagnosisCondition != null)
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 5, right: 5, top: 15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"12".toUpperCase(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
"DEC".toUpperCase(),
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"Appointment #: ",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
widget.mySelectedAssessment
|
||||
.appointmentId
|
||||
.toString(),
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
widget.mySelectedAssessment
|
||||
.selectedDiagnosisCondition
|
||||
.nameEn,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"Type : ",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
widget.mySelectedAssessment
|
||||
.selectedDiagnosisType
|
||||
.nameEn,
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"Doc : ",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
"Anas Abdullah",
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
AppText(
|
||||
widget.mySelectedAssessment.remark,
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Row(
|
||||
|
||||
children: [
|
||||
AppText(
|
||||
"ICD: ".toUpperCase(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
"R07.1".toUpperCase(),
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
openAssessmentDialog(context);
|
||||
},
|
||||
child: Icon(EvaIcons
|
||||
.edit2Outline),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
isExpand: isAssessmentExpand,
|
||||
),
|
||||
DividerWithSpacesAround(
|
||||
height: 30,
|
||||
),
|
||||
AppButton(
|
||||
title: TranslationBase.of(context).next,
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
onPressed: () async {
|
||||
await submitAssessment(model);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
|
||||
submitAssessment(SOAPViewModel model) async {
|
||||
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
|
||||
widget.mySelectedAssessment.selectedDiagnosisType != null) {
|
||||
PostAssessmentRequestModel postAssessmentRequestModel =
|
||||
new PostAssessmentRequestModel(
|
||||
patientMRN: widget.patientInfo.patientMRN,
|
||||
episodeId: widget.patientInfo.episodeNo,
|
||||
appointmentNo: widget.patientInfo.appointmentNo,
|
||||
icdCodeDetails: [
|
||||
new IcdCodeDetails(
|
||||
remarks: widget.mySelectedAssessment.remark,
|
||||
complexDiagnosis: true,
|
||||
conditionId:
|
||||
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
|
||||
diagnosisTypeId:
|
||||
widget.mySelectedAssessment.selectedDiagnosisType.id,
|
||||
icdcode10Id: "1")
|
||||
]);
|
||||
|
||||
await model.postAssessment(postAssessmentRequestModel);
|
||||
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
helpers.showErrorToast(model.error);
|
||||
} else {
|
||||
widget.changePageViewIndex(3);
|
||||
}
|
||||
} else {
|
||||
helpers.showErrorToast('Please add required field correctly');
|
||||
}
|
||||
|
||||
widget.changePageViewIndex(3);
|
||||
}
|
||||
|
||||
openAssessmentDialog(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
backgroundColor: Colors.white,
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AddAssessmentDetails(
|
||||
mySelectedAssessment: widget.mySelectedAssessment,
|
||||
addSelectedAssessment: () {
|
||||
setState(() {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class AddAssessmentDetails extends StatefulWidget {
|
||||
final MySelectedAssessment mySelectedAssessment;
|
||||
final Function() addSelectedAssessment;
|
||||
|
||||
const AddAssessmentDetails(
|
||||
{Key key, this.mySelectedAssessment, this.addSelectedAssessment})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
|
||||
}
|
||||
|
||||
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
||||
// MasterKeyModel _selectedDiagnosisCondition;
|
||||
// MasterKeyModel _selectedDiagnosisType;
|
||||
TextEditingController remarkController = TextEditingController();
|
||||
TextEditingController appointmentIdController = TextEditingController(
|
||||
text: "234567");
|
||||
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
remarkController.text = widget.mySelectedAssessment.remark??"";
|
||||
final screenSize = MediaQuery
|
||||
.of(context)
|
||||
.size;
|
||||
InputDecoration textFieldSelectorDecoration(String hintText,
|
||||
String selectedText, bool isDropDown,{IconData icon}) {
|
||||
//TODO: make one Input InputDecoration for all
|
||||
return InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: selectedText != null ? selectedText : hintText,
|
||||
suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
);
|
||||
}
|
||||
return FractionallySizedBox(
|
||||
heightFactor: 0.75,
|
||||
child: BaseView<SOAPViewModel>(
|
||||
onModelReady: (model) async {
|
||||
if (model.listOfDiagnosisCondition.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.DiagnosisCondition);
|
||||
}
|
||||
if (model.listOfDiagnosisType.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.DiagnosisType);
|
||||
}
|
||||
// if (model.listOfICD10.length == 0) {
|
||||
// await model.getMasterLookup(MasterKeysService.ICD10);
|
||||
// }
|
||||
},
|
||||
builder: (_, model, w) =>
|
||||
AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
AppText(
|
||||
"Add Assessment Details".toUpperCase(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 0, right: 0, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Appointment Number",
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
readOnly: true,
|
||||
controller: appointmentIdController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.listOfICD10 != null
|
||||
? () {
|
||||
setState(() {
|
||||
widget.mySelectedAssessment.selectedICD = null;
|
||||
});
|
||||
}
|
||||
: null,
|
||||
child:widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField<MasterKeyModel>(
|
||||
decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
|
||||
itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item),
|
||||
key: key,
|
||||
suggestions: model.listOfICD10,
|
||||
itemBuilder: (context, suggestion) => new Padding(
|
||||
child:Texts( suggestion.description +" / "+ suggestion.code.toString()),
|
||||
padding: EdgeInsets.all(8.0)),
|
||||
itemSorter: (a, b) => 1,
|
||||
itemFilter: (suggestion, input) =>
|
||||
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase())
|
||||
||suggestion.code.toLowerCase().startsWith(input.toLowerCase())
|
||||
,
|
||||
): TextField(
|
||||
decoration: textFieldSelectorDecoration(
|
||||
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD",
|
||||
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.listOfDiagnosisCondition !=
|
||||
null
|
||||
? () {
|
||||
MasterKeyDailog dialog = MasterKeyDailog(
|
||||
list: model.listOfDiagnosisCondition,
|
||||
okText: TranslationBase
|
||||
.of(context)
|
||||
.ok,
|
||||
okFunction: (
|
||||
MasterKeyModel selectedValue) {
|
||||
setState(() {
|
||||
widget.mySelectedAssessment
|
||||
.selectedDiagnosisCondition =
|
||||
selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration: textFieldSelectorDecoration(
|
||||
"Condition",
|
||||
widget.mySelectedAssessment
|
||||
.selectedDiagnosisCondition != null
|
||||
? widget.mySelectedAssessment
|
||||
.selectedDiagnosisCondition
|
||||
.nameEn
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.listOfDiagnosisType != null
|
||||
? () {
|
||||
MasterKeyDailog dialog = MasterKeyDailog(
|
||||
list: model.listOfDiagnosisType,
|
||||
okText: TranslationBase
|
||||
.of(context)
|
||||
.ok,
|
||||
okFunction: (
|
||||
MasterKeyModel selectedValue) {
|
||||
setState(() {
|
||||
// _selectedDiagnosisType =
|
||||
// selectedValue;
|
||||
widget.mySelectedAssessment
|
||||
.selectedDiagnosisType =
|
||||
selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration: textFieldSelectorDecoration(
|
||||
"Type",
|
||||
widget.mySelectedAssessment
|
||||
.selectedDiagnosisType != null
|
||||
? widget.mySelectedAssessment
|
||||
.selectedDiagnosisType.nameEn
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 0, right: 0, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Remarks",
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
maxLines: 18,
|
||||
minLines: 5,
|
||||
controller: remarkController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppButton(
|
||||
title: "Add".toUpperCase(),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
widget.mySelectedAssessment.remark =
|
||||
remarkController.text;
|
||||
widget.mySelectedAssessment
|
||||
.appointmentId = int.parse(
|
||||
appointmentIdController.text);
|
||||
|
||||
widget.addSelectedAssessment();
|
||||
});
|
||||
},
|
||||
),
|
||||
])),
|
||||
),
|
||||
),
|
||||
))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,518 +0,0 @@
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_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/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
class ObjectivePage extends StatefulWidget {
|
||||
final Function changePageViewIndex;
|
||||
final List<MySelectedExamination> mySelectedExamination;
|
||||
final PatiantInformtion patientInfo;
|
||||
ObjectivePage(
|
||||
{Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo});
|
||||
|
||||
@override
|
||||
_ObjectivePageState createState() => _ObjectivePageState();
|
||||
}
|
||||
|
||||
class _ObjectivePageState extends State<ObjectivePage> {
|
||||
bool isSysExaminationExpand = false;
|
||||
TextEditingController remarksController = TextEditingController();
|
||||
|
||||
BoxDecoration containerBorderDecoration(
|
||||
Color containerColor, Color borderColor) {
|
||||
return BoxDecoration(
|
||||
color: containerColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
||||
border: Border.fromBorderSide(BorderSide(
|
||||
color: borderColor,
|
||||
width: 0.5,
|
||||
)),
|
||||
);
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return BaseView<SOAPViewModel>(
|
||||
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Texts('Physical/System Examination',
|
||||
variant:
|
||||
isSysExaminationExpand ? "bodyText" : '',
|
||||
bold: isSysExaminationExpand ? true : false,
|
||||
color: Colors.black),
|
||||
Icon(
|
||||
FontAwesomeIcons.asterisk,
|
||||
color: AppGlobal.appPrimaryColor,
|
||||
size: 12,
|
||||
)
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isSysExaminationExpand =
|
||||
!isSysExaminationExpand;
|
||||
});
|
||||
},
|
||||
child: Icon(isSysExaminationExpand
|
||||
? EvaIcons.minus
|
||||
: EvaIcons.plus))
|
||||
],
|
||||
),
|
||||
bodyWidget: Column(children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Add Examination",
|
||||
fontSize: 13.5,
|
||||
onTapTextFields: () {
|
||||
openExaminationList(context);
|
||||
},
|
||||
readOnly: true,
|
||||
// hintColor: Colors.black,
|
||||
suffixIcon: EvaIcons.plusCircleOutline,
|
||||
suffixIconColor: AppGlobal.appPrimaryColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
// controller: messageController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Column(
|
||||
children:
|
||||
widget.mySelectedExamination.map((examination) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 15, right: 15, top: 15),
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(
|
||||
examination
|
||||
.selectedExamination.nameEn
|
||||
.toUpperCase(),
|
||||
variant: "bodyText",
|
||||
bold: true,
|
||||
color: Colors.black)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height:
|
||||
screenSize.height *
|
||||
0.070,
|
||||
decoration:
|
||||
containerBorderDecoration(
|
||||
examination
|
||||
.isNormal
|
||||
? Color(
|
||||
0xFF515A5D)
|
||||
: Colors
|
||||
.white,
|
||||
Colors.grey),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(8.0),
|
||||
child: Text(
|
||||
"Normal",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
examination
|
||||
.isNormal
|
||||
? Colors.white
|
||||
: Colors
|
||||
.black,
|
||||
//Colors.black,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
examination.isAbnormal =
|
||||
!examination.isAbnormal;
|
||||
examination.isNormal =
|
||||
!examination.isNormal;
|
||||
});
|
||||
}),
|
||||
SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
InkWell(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height:
|
||||
screenSize.height *
|
||||
0.070,
|
||||
decoration:
|
||||
containerBorderDecoration(
|
||||
examination
|
||||
.isAbnormal
|
||||
? Color(
|
||||
0xFF515A5D)
|
||||
: Colors
|
||||
.white,
|
||||
Colors.black),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(8.0),
|
||||
child: Text(
|
||||
"Abnormal",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
examination
|
||||
.isAbnormal
|
||||
? Colors.white
|
||||
: Colors
|
||||
.black,
|
||||
//Colors.black,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
examination.isAbnormal =
|
||||
!examination.isAbnormal;
|
||||
examination.isNormal =
|
||||
!examination.isNormal;
|
||||
});
|
||||
}),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
|
||||
child: Icon(
|
||||
FontAwesomeIcons.trash,
|
||||
color: Colors.grey,
|
||||
size: 20,
|
||||
),
|
||||
onTap: () => removeExamination(
|
||||
examination.selectedExamination),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Remarks",
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
maxLines: 25,
|
||||
minLines: 13,
|
||||
controller: remarksController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
]));
|
||||
}).toList(),
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
isExpand: isSysExaminationExpand,
|
||||
),
|
||||
DividerWithSpacesAround(height: 30,),
|
||||
AppButton(
|
||||
title: TranslationBase.of(context).next,
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
onPressed: () async {
|
||||
await submitObjectivePage(model);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
|
||||
submitObjectivePage(SOAPViewModel model) async {
|
||||
// if(widget.mySelectedExamination.isNotEmpty){
|
||||
// PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
|
||||
// widget.mySelectedExamination.forEach((exam) {
|
||||
// if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
|
||||
// null)
|
||||
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
|
||||
// // TODO : change createdBy editedBy
|
||||
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(
|
||||
// ListHisProgNotePhysicalExaminationVM(
|
||||
// patientMRN: widget.patientInfo.patientMRN,
|
||||
// episodeId: widget.patientInfo.episodeNo,
|
||||
// appointmentNo: widget.patientInfo.appointmentNo,
|
||||
// remarks: exam.remark ?? '',
|
||||
// createdBy: 4709,
|
||||
// createdOn: DateTime.now().toIso8601String(),
|
||||
// editedBy: 4709,
|
||||
// editedOn: DateTime.now().toIso8601String(),
|
||||
// examId: exam.selectedExamination.id,
|
||||
// examType: exam.selectedExamination.typeId,
|
||||
// isAbnormal: exam.isAbnormal,
|
||||
// isNormal: exam.isNormal,
|
||||
// masterDescription: exam.selectedExamination,
|
||||
// notExamined: false
|
||||
//
|
||||
// ));
|
||||
// });
|
||||
//
|
||||
// await model.postPhysicalExam(postPhysicalExamRequestModel);
|
||||
//
|
||||
// if (model.state == ViewState.ErrorLocal) {
|
||||
// helpers.showErrorToast(model.error);
|
||||
// } else {
|
||||
// widget.changePageViewIndex(2);
|
||||
// }
|
||||
// } else {
|
||||
// helpers.showErrorToast('Please add required field correctly');
|
||||
// }
|
||||
|
||||
widget.changePageViewIndex(2);
|
||||
}
|
||||
|
||||
removeExamination(MasterKeyModel masterKey) {
|
||||
Iterable<MySelectedExamination> history = widget.mySelectedExamination
|
||||
.where(
|
||||
(element) =>
|
||||
masterKey.id == element.selectedExamination.id &&
|
||||
masterKey.typeId == element.selectedExamination.typeId);
|
||||
|
||||
if (history.length > 0)
|
||||
setState(() {
|
||||
widget.mySelectedExamination.remove(history.first);
|
||||
});
|
||||
}
|
||||
|
||||
openExaminationList(BuildContext context) {
|
||||
final screenSize = MediaQuery
|
||||
.of(context)
|
||||
.size;
|
||||
InputDecoration textFieldSelectorDecoration(String hintText,
|
||||
String selectedText, bool isDropDown) {
|
||||
return InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: selectedText != null ? selectedText : hintText,
|
||||
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
showModalBottomSheet(
|
||||
backgroundColor: Colors.white,
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AddExaminationDailog(
|
||||
mySelectedExamination: widget.mySelectedExamination,
|
||||
addSelectedExamination: () {
|
||||
setState(() {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return FractionallySizedBox(
|
||||
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(
|
||||
"Examinations",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
|
||||
NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: MasterKeyCheckboxSearchWidget(
|
||||
model: model,
|
||||
masterList: model.physicalExaminationList,
|
||||
removeHistory: (history){
|
||||
setState(() {
|
||||
widget.removeExamination(history);
|
||||
});
|
||||
},
|
||||
addHistory: (history){
|
||||
setState(() {
|
||||
MySelectedExamination mySelectedExamination = new MySelectedExamination(
|
||||
selectedExamination: history
|
||||
);
|
||||
widget
|
||||
.mySelectedExamination
|
||||
.add(
|
||||
mySelectedExamination);
|
||||
});
|
||||
},
|
||||
addSelectedHistories: (){
|
||||
widget.addSelectedExamination();
|
||||
},
|
||||
isServiceSelected: (master) =>isServiceSelected(master),
|
||||
),
|
||||
),
|
||||
|
||||
]),
|
||||
))),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
isServiceSelected(MasterKeyModel masterKey) {
|
||||
Iterable<MySelectedExamination> exam =
|
||||
widget
|
||||
.mySelectedExamination
|
||||
.where((element) =>
|
||||
masterKey.id == element.selectedExamination.id &&
|
||||
masterKey.typeId == element.selectedExamination.typeId);
|
||||
if (exam.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1,349 +0,0 @@
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_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/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
class PlanPage extends StatefulWidget {
|
||||
final Function changePageViewIndex;
|
||||
final PatiantInformtion patientInfo;
|
||||
|
||||
PlanPage({Key key, this.changePageViewIndex, this.patientInfo});
|
||||
|
||||
@override
|
||||
_PlanPageState createState() => _PlanPageState();
|
||||
}
|
||||
|
||||
class _PlanPageState extends State<PlanPage> {
|
||||
bool isProgressNoteExpand = false;
|
||||
|
||||
List<dynamic> progressNoteList;
|
||||
|
||||
TextEditingController progressNoteController =
|
||||
TextEditingController(text: null);
|
||||
|
||||
BoxDecoration containerBorderDecoration(
|
||||
Color containerColor, Color borderColor) {
|
||||
return BoxDecoration(
|
||||
color: containerColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
||||
border: Border.fromBorderSide(BorderSide(
|
||||
color: borderColor,
|
||||
width: 0.5,
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return BaseView<SOAPViewModel>(
|
||||
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Texts('Progress Note',
|
||||
variant:
|
||||
isProgressNoteExpand ? "bodyText" : '',
|
||||
bold: isProgressNoteExpand ? true : false,
|
||||
color: Colors.black),
|
||||
Icon(
|
||||
FontAwesomeIcons.asterisk,
|
||||
color: AppGlobal.appPrimaryColor,
|
||||
size: 12,
|
||||
)
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isProgressNoteExpand =
|
||||
!isProgressNoteExpand;
|
||||
});
|
||||
},
|
||||
child: Icon(isProgressNoteExpand
|
||||
? EvaIcons.minus
|
||||
: EvaIcons.plus))
|
||||
],
|
||||
),
|
||||
bodyWidget: Column(children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Add Progress Note",
|
||||
fontSize: 13.5,
|
||||
onTapTextFields: () {
|
||||
openProgressNote(context);
|
||||
},
|
||||
readOnly: true,
|
||||
// hintColor: Colors.black,
|
||||
suffixIcon: EvaIcons.plusCircleOutline,
|
||||
suffixIconColor: AppGlobal.appPrimaryColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
// controller: messageController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
if (progressNoteController.text.isNotEmpty)
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 5, right: 5, top: 15),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"12".toUpperCase(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
"DEC".toUpperCase(),
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width * 0.6,
|
||||
child: AppText(
|
||||
progressNoteController.text,
|
||||
fontSize: 10,
|
||||
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
), SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"Created By : ",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
"Anas Abdullah on 12 De",
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"Edited By : ",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
"Rahim on 13 Dec",
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
openProgressNote(context);
|
||||
},
|
||||
child: Icon(EvaIcons.edit2Outline),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
isExpand: isProgressNoteExpand,
|
||||
),
|
||||
DividerWithSpacesAround(height: 30,),
|
||||
AppButton(
|
||||
title: TranslationBase
|
||||
.of(context)
|
||||
.next,
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
onPressed: () {
|
||||
|
||||
submitPlan(model);
|
||||
// widget.changePageViewIndex(2);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),),);
|
||||
}
|
||||
|
||||
submitPlan(SOAPViewModel model) async {
|
||||
if (progressNoteController.text.isNotEmpty) {
|
||||
PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel(
|
||||
patientMRN: widget.patientInfo.patientMRN,
|
||||
episodeId: widget.patientInfo.episodeNo,
|
||||
appointmentNo: widget.patientInfo.appointmentNo,
|
||||
planNote: progressNoteController.text);
|
||||
|
||||
|
||||
await model.postProgressNote(postProgressNoteRequestModel);
|
||||
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
helpers.showErrorToast(model.error);
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
// Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
openProgressNote(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
backgroundColor: Colors.white,
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return FractionallySizedBox(
|
||||
heightFactor: 0.5,
|
||||
child: Container(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
AppText(
|
||||
"Add Progress Note",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Add progress note here",
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
maxLines: 16,
|
||||
minLines: 8,
|
||||
controller: progressNoteController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppButton(
|
||||
title: "Add".toUpperCase(),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
]),
|
||||
)),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,339 +0,0 @@
|
||||
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
||||
import 'package:doctor_app_flutter/core/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/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AddAllergiesWidget extends StatefulWidget {
|
||||
final List<MySelectedAllergy> myAllergiesList;
|
||||
|
||||
AddAllergiesWidget({Key key, this.myAllergiesList});
|
||||
|
||||
@override
|
||||
_AddAllergiesWidgetState createState() => _AddAllergiesWidgetState();
|
||||
}
|
||||
|
||||
class _AddAllergiesWidgetState extends State<AddAllergiesWidget> {
|
||||
|
||||
TextEditingController remarkController = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Add Allergies",
|
||||
fontSize: 13.5,
|
||||
onTapTextFields: () {
|
||||
openAllergiesList(context);
|
||||
},
|
||||
readOnly: true,
|
||||
suffixIcon: EvaIcons.plusCircleOutline,
|
||||
suffixIconColor: AppGlobal.appPrimaryColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||
child: Column(
|
||||
children: widget.myAllergiesList.map((selectedAllergy) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(),
|
||||
variant: "bodyText", bold: true, color: Colors.black),
|
||||
Texts(
|
||||
selectedAllergy.selectedAllergySeverity.nameEn
|
||||
.toUpperCase(),
|
||||
variant: "bodyText",
|
||||
bold: true,
|
||||
color: AppGlobal.appPrimaryColor),
|
||||
InkWell(
|
||||
child: Icon(
|
||||
FontAwesomeIcons.trash,
|
||||
color: Colors.grey,
|
||||
size: 20,
|
||||
),
|
||||
onTap: () => removeAllergy(selectedAllergy),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList()),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
removeAllergy(MySelectedAllergy mySelectedAllergy) {
|
||||
Iterable<MySelectedAllergy> allergy =
|
||||
widget.myAllergiesList.where((element) => mySelectedAllergy == element);
|
||||
|
||||
if (allergy.length > 0)
|
||||
setState(() {
|
||||
widget.myAllergiesList.remove(allergy.first);
|
||||
});
|
||||
}
|
||||
|
||||
openAllergiesList(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
backgroundColor: Colors.white,
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AddAllergies(
|
||||
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
|
||||
setState(() {
|
||||
widget.myAllergiesList.add(mySelectedAllergy);
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class AddAllergies extends StatefulWidget {
|
||||
final Function addAllergiesFun;
|
||||
|
||||
const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AddAllergiesState createState() => _AddAllergiesState();
|
||||
}
|
||||
|
||||
class _AddAllergiesState extends State<AddAllergies> {
|
||||
List<MasterKeyModel> allergiesList;
|
||||
List<MasterKeyModel> allergySeverityList;
|
||||
MasterKeyModel _selectedAllergySeverity;
|
||||
MasterKeyModel _selectedAllergy;
|
||||
TextEditingController remarkController = TextEditingController();
|
||||
|
||||
|
||||
InputDecoration textFieldSelectorDecoration(String hintText,
|
||||
String selectedText, bool isDropDown,{IconData icon}) {
|
||||
return InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: selectedText != null ? selectedText : hintText,
|
||||
suffixIcon: isDropDown ? Icon(icon?? Icons.arrow_drop_down) : null,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
);
|
||||
}
|
||||
bool _isShowSearch = false;
|
||||
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
final screenSize = MediaQuery
|
||||
.of(context)
|
||||
.size;
|
||||
return FractionallySizedBox(
|
||||
heightFactor: 0.7,
|
||||
child: BaseView<SOAPViewModel>(
|
||||
onModelReady: (model) async {
|
||||
if (model.allergiesList.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.Allergies);
|
||||
}
|
||||
if (model.allergySeverityList.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.AllergySeverity);
|
||||
}
|
||||
},
|
||||
builder: (_, model, w) =>
|
||||
AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
AppText(
|
||||
"Add Allergy",
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.allergiesList != null
|
||||
? () {
|
||||
setState(() {
|
||||
_selectedAllergy = null;
|
||||
});
|
||||
}
|
||||
: null,
|
||||
child: _selectedAllergy==null? AutoCompleteTextField<MasterKeyModel>(
|
||||
decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search),
|
||||
itemSubmitted: (item) => setState(() => _selectedAllergy = item),
|
||||
key: key,
|
||||
suggestions: model.allergiesList,
|
||||
itemBuilder: (context, suggestion) => new Padding(
|
||||
child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn),
|
||||
padding: EdgeInsets.all(8.0)),
|
||||
itemSorter: (a, b) => 1,
|
||||
itemFilter: (suggestion, input) =>
|
||||
suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()),
|
||||
):TextField(
|
||||
decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.allergySeverityList != null
|
||||
? () {
|
||||
MasterKeyDailog dialog = MasterKeyDailog(
|
||||
list: model.allergySeverityList,
|
||||
okText: TranslationBase
|
||||
.of(context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
_selectedAllergySeverity =
|
||||
selectedValue;
|
||||
// model.getDoctorBranch().then((value) {
|
||||
// _selectedBranch = value;
|
||||
// if (_referTo['id'] == 1) {
|
||||
// model.getClinics(
|
||||
// _selectedBranch['ID']);
|
||||
// }
|
||||
// });
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration: textFieldSelectorDecoration(
|
||||
"Select Severity",
|
||||
_selectedAllergySeverity != null
|
||||
? _selectedAllergySeverity.nameEn
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 0, right: 0, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Remarks",
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
maxLines: 25,
|
||||
minLines: 13,
|
||||
controller: remarkController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
), SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppButton(
|
||||
title: "Add".toUpperCase(),
|
||||
onPressed: () {
|
||||
MySelectedAllergy mySelectedAllergy = new MySelectedAllergy(
|
||||
remark: remarkController.text,
|
||||
selectedAllergy: _selectedAllergy,
|
||||
selectedAllergySeverity: _selectedAllergySeverity);
|
||||
widget.addAllergiesFun(mySelectedAllergy);
|
||||
},
|
||||
),
|
||||
]
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,360 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
import '../../../../shared/master_key_checkbox_search_widget.dart';
|
||||
|
||||
class AddHistoryWidget extends StatefulWidget {
|
||||
final List<MasterKeyModel> myHistoryList;
|
||||
|
||||
const AddHistoryWidget({Key key, this.myHistoryList}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AddHistoryWidgetState createState() => _AddHistoryWidgetState();
|
||||
}
|
||||
|
||||
class _AddHistoryWidgetState extends State<AddHistoryWidget>
|
||||
with TickerProviderStateMixin {
|
||||
PageController _controller;
|
||||
int _currentIndex = 0;
|
||||
|
||||
changePageViewIndex(pageIndex) {
|
||||
_controller.jumpToPage(pageIndex);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_controller = new PageController();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Add History",
|
||||
fontSize: 13.5,
|
||||
onTapTextFields: () {
|
||||
openHistoryList(context);
|
||||
},
|
||||
readOnly: true,
|
||||
// hintColor: Colors.black,
|
||||
suffixIcon: EvaIcons.plusCircleOutline,
|
||||
suffixIconColor: AppGlobal.appPrimaryColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
// controller: messageController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||
child: Column(
|
||||
children: widget.myHistoryList.map((myHistory) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(myHistory.nameEn,
|
||||
variant: "bodyText", bold: true, color: Colors.black),
|
||||
InkWell(
|
||||
child: Icon(
|
||||
FontAwesomeIcons.trash,
|
||||
color: Colors.grey,
|
||||
size: 20,
|
||||
),
|
||||
onTap: () => removeHistory(myHistory),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
removeHistory(MasterKeyModel masterKey) {
|
||||
Iterable<MasterKeyModel> history = widget.myHistoryList.where((element) =>
|
||||
masterKey.id == element.id && masterKey.typeId == element.typeId);
|
||||
|
||||
if (history.length > 0)
|
||||
setState(() {
|
||||
widget.myHistoryList.remove(history.first);
|
||||
});
|
||||
}
|
||||
|
||||
openHistoryList(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
backgroundColor: Colors.white,
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AddHistoryDialog(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
controller: _controller,
|
||||
myHistoryList: widget.myHistoryList,
|
||||
addSelectedHistories: () {
|
||||
setState(() {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},
|
||||
removeHistory: (masterKey) => removeHistory(masterKey),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class PriorityBar extends StatefulWidget {
|
||||
final Function onTap;
|
||||
|
||||
const PriorityBar({Key key, this.onTap}) : super(key: key);
|
||||
|
||||
@override
|
||||
_PriorityBarState createState() => _PriorityBarState();
|
||||
}
|
||||
|
||||
class _PriorityBarState extends State<PriorityBar> {
|
||||
int _activePriority = 0;
|
||||
|
||||
List<String> _priorities = [
|
||||
"Family",
|
||||
"Surgical/Sports",
|
||||
"Medical",
|
||||
];
|
||||
|
||||
BoxDecoration containerBorderDecoration(
|
||||
Color containerColor, Color borderColor) {
|
||||
return BoxDecoration(
|
||||
color: containerColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
||||
border: Border.fromBorderSide(BorderSide(
|
||||
color: borderColor,
|
||||
width: 2.0,
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration:
|
||||
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: _priorities.map((item) {
|
||||
bool _isActive = _priorities[_activePriority] == item ? true : false;
|
||||
return Expanded(
|
||||
child: InkWell(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: containerBorderDecoration(
|
||||
_isActive ? HexColor("#B8382B") : Colors.white,
|
||||
_isActive ? HexColor("#B8382B") : Colors.white),
|
||||
child: Center(
|
||||
child: Text(
|
||||
item,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: _isActive
|
||||
? Colors.white
|
||||
: Colors.black, //Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
onTap: () {
|
||||
widget.onTap(_priorities.indexOf(item));
|
||||
|
||||
setState(() {
|
||||
_activePriority = _priorities.indexOf(item);
|
||||
});
|
||||
}),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AddHistoryDialog extends StatefulWidget {
|
||||
final Function changePageViewIndex;
|
||||
final PageController controller;
|
||||
final List<MasterKeyModel> myHistoryList;
|
||||
final Function addSelectedHistories;
|
||||
final Function (MasterKeyModel) removeHistory;
|
||||
|
||||
const AddHistoryDialog(
|
||||
{Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AddHistoryDialogState createState() => _AddHistoryDialogState();
|
||||
}
|
||||
|
||||
class _AddHistoryDialogState extends State<AddHistoryDialog> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FractionallySizedBox(
|
||||
heightFactor: 0.7,
|
||||
child: BaseView<SOAPViewModel>(
|
||||
onModelReady: (model) async {
|
||||
if (model.historyFamilyList.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.HistoryFamily);
|
||||
}
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
// baseViewModel: model,
|
||||
isShowAppBar: false,
|
||||
body: Center(
|
||||
child: Container(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
PriorityBar(onTap: (activePriority) async {
|
||||
widget.changePageViewIndex(activePriority);
|
||||
if(activePriority ==1) {
|
||||
if (model.historySurgicalList.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.HistorySurgical);
|
||||
await model.getMasterLookup(MasterKeysService.HistorySports);
|
||||
}
|
||||
}
|
||||
if(activePriority ==2) {
|
||||
if (model.historyMedicalList.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.HistoryMedical);
|
||||
}
|
||||
}
|
||||
}),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: widget.controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
// currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
MasterKeyCheckboxSearchWidget(
|
||||
model: model,
|
||||
masterList: model.historyFamilyList,
|
||||
removeHistory: (history){
|
||||
setState(() {
|
||||
widget.removeHistory(history);
|
||||
});
|
||||
},
|
||||
addHistory: (history){
|
||||
setState(() {
|
||||
widget.myHistoryList.add(history);
|
||||
});
|
||||
},
|
||||
addSelectedHistories: (){
|
||||
widget.addSelectedHistories();
|
||||
},
|
||||
isServiceSelected: (master) =>isServiceSelected(master),
|
||||
),
|
||||
MasterKeyCheckboxSearchWidget(
|
||||
model: model,
|
||||
masterList: model.mergeHistorySurgicalWithHistorySportList,
|
||||
removeHistory: (history){
|
||||
setState(() {
|
||||
widget.removeHistory(history);
|
||||
});
|
||||
},
|
||||
addHistory: (history){
|
||||
setState(() {
|
||||
widget.myHistoryList.add(history);
|
||||
});
|
||||
},
|
||||
addSelectedHistories: (){
|
||||
widget.addSelectedHistories();
|
||||
},
|
||||
isServiceSelected: (master) =>isServiceSelected(master),
|
||||
),
|
||||
MasterKeyCheckboxSearchWidget(
|
||||
model: model,
|
||||
masterList: model.historyMedicalList,
|
||||
removeHistory: (history){
|
||||
setState(() {
|
||||
widget.removeHistory(history);
|
||||
});
|
||||
},
|
||||
addHistory: (history){
|
||||
setState(() {
|
||||
widget.myHistoryList.add(history);
|
||||
});
|
||||
},
|
||||
addSelectedHistories: (){
|
||||
widget.addSelectedHistories();
|
||||
},
|
||||
isServiceSelected: (master) =>isServiceSelected(master),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
bool isServiceSelected(MasterKeyModel masterKey) {
|
||||
Iterable<MasterKeyModel> history =
|
||||
widget.myHistoryList.where((element) => masterKey.id == element.id && masterKey.typeId == element.typeId);
|
||||
|
||||
if (history.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,107 +0,0 @@
|
||||
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
class AddMedication extends StatefulWidget {
|
||||
@override
|
||||
_AddMedicationState createState() => _AddMedicationState();
|
||||
}
|
||||
|
||||
class _AddMedicationState extends State<AddMedication> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Current Medications",
|
||||
fontSize: 13.5,
|
||||
onTapTextFields: () {
|
||||
openMedicationsList(context);
|
||||
},
|
||||
readOnly: true,
|
||||
// hintColor: Colors.black,
|
||||
suffixIcon: EvaIcons.plusCircleOutline,
|
||||
suffixIconColor: AppGlobal.appPrimaryColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
// controller: messageController,
|
||||
validator: (value) {
|
||||
if (value == null)
|
||||
return TranslationBase.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts('Abdomen Pain',
|
||||
variant: "bodyText",
|
||||
bold: true,
|
||||
color: Colors.black),
|
||||
Icon(
|
||||
FontAwesomeIcons.trash,
|
||||
color: Colors.grey,
|
||||
size: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts('Back Pain',
|
||||
variant: "bodyText",
|
||||
bold: true,
|
||||
color: Colors.black),
|
||||
Icon(
|
||||
FontAwesomeIcons.trash,
|
||||
color: Colors.grey,
|
||||
size: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
openMedicationsList(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
backgroundColor: Colors.white,
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return FractionallySizedBox(
|
||||
heightFactor: 0.7,
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts("dfdfd"),
|
||||
)),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,402 +0,0 @@
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/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/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/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
class SubjectivePage extends StatefulWidget {
|
||||
final Function changePageViewIndex;
|
||||
final List<MySelectedAllergy> myAllergiesList;
|
||||
final List<MasterKeyModel> myHistoryList;
|
||||
final PatiantInformtion patientInfo;
|
||||
|
||||
SubjectivePage(
|
||||
{Key key,
|
||||
this.changePageViewIndex,
|
||||
this.myAllergiesList,
|
||||
this.myHistoryList,
|
||||
this.patientInfo});
|
||||
|
||||
@override
|
||||
_SubjectivePageState createState() => _SubjectivePageState();
|
||||
}
|
||||
|
||||
class _SubjectivePageState extends State<SubjectivePage> {
|
||||
bool isChiefExpand = false;
|
||||
bool isHistoryExpand = false;
|
||||
bool isAllergiesExpand = false;
|
||||
TextEditingController illnessController = TextEditingController();
|
||||
TextEditingController complaintsController = TextEditingController();
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<SOAPViewModel>(
|
||||
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
baseViewModel: model,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Texts('CHIEF COMPLAINTS',
|
||||
variant: isChiefExpand ? "bodyText" : '',
|
||||
bold: isChiefExpand ? true : false,
|
||||
color: Colors.black),
|
||||
Icon(
|
||||
FontAwesomeIcons.asterisk,
|
||||
color: AppGlobal.appPrimaryColor,
|
||||
size: 12,
|
||||
)
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isChiefExpand = !isChiefExpand;
|
||||
});
|
||||
},
|
||||
child: Icon(
|
||||
isChiefExpand ? EvaIcons.minus : EvaIcons.plus))
|
||||
],
|
||||
),
|
||||
bodyWidget: Form(
|
||||
key: formKey,
|
||||
child: Column(children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "Add Chief Complaints",
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
maxLines: 25,
|
||||
minLines: 13,
|
||||
controller: complaintsController,
|
||||
validator: (value) {
|
||||
if (value == null || value == "")
|
||||
return TranslationBase.of(context)
|
||||
.emptyMessage;
|
||||
else if (value.length < 25)
|
||||
return TranslationBase.of(context)
|
||||
.chiefComplaintLength;
|
||||
//"";
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
child: TextFields(
|
||||
hintText: "History of Present Illness",
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
maxLines: 25,
|
||||
minLines: 13,
|
||||
controller: illnessController,
|
||||
validator: (value) {
|
||||
if (value == null || value =="")
|
||||
return TranslationBase
|
||||
.of(context)
|
||||
.emptyMessage;
|
||||
else
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
// TODO return it back when we need it.
|
||||
// AddMedication(),
|
||||
]),
|
||||
),
|
||||
isExpand: isChiefExpand,
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: Color(0xffCCCCCC),
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Texts('History'.toUpperCase(),
|
||||
variant: isHistoryExpand ? "bodyText" : '',
|
||||
bold: isHistoryExpand ? true : false,
|
||||
color: Colors.black),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isHistoryExpand = !isHistoryExpand;
|
||||
});
|
||||
},
|
||||
child: Icon(isHistoryExpand
|
||||
? EvaIcons.minus
|
||||
: EvaIcons.plus))
|
||||
],
|
||||
),
|
||||
bodyWidget: Column(
|
||||
children: [
|
||||
AddHistoryWidget(myHistoryList: widget.myHistoryList)
|
||||
],
|
||||
),
|
||||
isExpand: isHistoryExpand,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: Color(0xffCCCCCC),
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Texts('Allergies'.toUpperCase(),
|
||||
variant: isAllergiesExpand ? "bodyText" : '',
|
||||
bold: isAllergiesExpand ? true : false,
|
||||
color: Colors.black),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isAllergiesExpand = !isAllergiesExpand;
|
||||
});
|
||||
},
|
||||
child: Icon(isAllergiesExpand
|
||||
? EvaIcons.minus
|
||||
: EvaIcons.plus))
|
||||
],
|
||||
),
|
||||
bodyWidget: Column(
|
||||
children: [
|
||||
AddAllergiesWidget(
|
||||
myAllergiesList: widget.myAllergiesList,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
isExpand: isAllergiesExpand,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: Color(0xffCCCCCC),
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
AppButton(
|
||||
title: TranslationBase.of(context).next,
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
onPressed: () async {
|
||||
addSubjectiveInfo(
|
||||
model: model,
|
||||
myAllergiesList: widget.myAllergiesList,
|
||||
myHistoryList: widget.myHistoryList);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
addSubjectiveInfo(
|
||||
{SOAPViewModel model,
|
||||
List<MySelectedAllergy> myAllergiesList,
|
||||
List<MasterKeyModel> myHistoryList}) async {
|
||||
formKey.currentState.save();
|
||||
formKey.currentState.validate();
|
||||
|
||||
|
||||
// if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) {
|
||||
// await postChiefComplaint(model: model);
|
||||
// if (model.state == ViewState.ErrorLocal) {
|
||||
// helpers.showErrorToast(model.error);
|
||||
// } else {
|
||||
// if (myHistoryList.length != 0) {
|
||||
// await postHistories(model: model, myHistoryList: myHistoryList);
|
||||
// if (model.state == ViewState.ErrorLocal) {
|
||||
// helpers.showErrorToast(model.error);
|
||||
// } else {
|
||||
// if (myAllergiesList.length != 0) {
|
||||
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
||||
// if (model.state == ViewState.ErrorLocal) {
|
||||
// helpers.showErrorToast(model.error);
|
||||
// } else {
|
||||
// widget.changePageViewIndex(1);
|
||||
// }
|
||||
// } else {
|
||||
// widget.changePageViewIndex(1);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// } else {
|
||||
// if (myAllergiesList.length != 0) {
|
||||
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
||||
// if (model.state == ViewState.ErrorLocal) {
|
||||
// helpers.showErrorToast(model.error);
|
||||
// } else {
|
||||
// widget.changePageViewIndex(1);
|
||||
// }
|
||||
// } else {
|
||||
// widget.changePageViewIndex(1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// helpers.showErrorToast('Please add required field correctly');
|
||||
// }
|
||||
|
||||
widget.changePageViewIndex(1);
|
||||
|
||||
}
|
||||
|
||||
postAllergy(
|
||||
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
|
||||
PostAllergyRequestModel postAllergyRequestModel =
|
||||
new PostAllergyRequestModel();
|
||||
widget.myAllergiesList.forEach((allergy) {
|
||||
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
|
||||
null)
|
||||
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
|
||||
//TODO: make static value dynamic
|
||||
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: 4709,
|
||||
//
|
||||
createdOn: DateTime.now()
|
||||
.toIso8601String(), //"2020-08-14T20:37:22.780Z",
|
||||
editedBy: 4709,
|
||||
editedOn: DateTime.now()
|
||||
.toIso8601String(), //"2020-08-14T20:37:22.780Z",
|
||||
isChecked: false,
|
||||
isUpdatedByNurse: false));
|
||||
});
|
||||
await model.postAllergy(postAllergyRequestModel);
|
||||
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
helpers.showErrorToast(model.error);
|
||||
}
|
||||
}
|
||||
|
||||
postHistories(
|
||||
{List<MasterKeyModel> myHistoryList, SOAPViewModel model}) async {
|
||||
PostHistoriesRequestModel postHistoriesRequestModel =
|
||||
new PostHistoriesRequestModel();
|
||||
widget.myHistoryList.forEach((history) {
|
||||
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
|
||||
postHistoriesRequestModel.listMedicalHistoryVM = [];
|
||||
//TODO: make static value dynamic
|
||||
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
|
||||
patientMRN: widget.patientInfo.patientMRN,
|
||||
episodeId: widget.patientInfo.episodeNo,
|
||||
appointmentNo: widget.patientInfo.appointmentNo,
|
||||
remarks: "",
|
||||
historyId: history.id,
|
||||
historyType: history.typeId,
|
||||
isChecked: false,
|
||||
));
|
||||
});
|
||||
await model.postHistories(postHistoriesRequestModel);
|
||||
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
helpers.showErrorToast(model.error);
|
||||
}
|
||||
}
|
||||
|
||||
postChiefComplaint({SOAPViewModel model}) async {
|
||||
formKey.currentState.save();
|
||||
if (formKey.currentState.validate()) {
|
||||
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
|
||||
//TODO: make static value dynamic
|
||||
new PostChiefComplaintRequestModel(
|
||||
patientMRN: widget.patientInfo.patientMRN,
|
||||
episodeID: widget.patientInfo.episodeNo,
|
||||
appointmentNo: widget.patientInfo.appointmentNo,
|
||||
chiefComplaint: complaintsController.text,
|
||||
currentMedication: " currentMedication ",
|
||||
hopi: illnessController.text,
|
||||
isLactation: false,
|
||||
ispregnant: false,
|
||||
numberOfWeeks: 22);
|
||||
|
||||
await model.postChiefComplaint(postChiefComplaintRequestModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue