remove unused code
parent
4cdc654348
commit
23feb2c354
File diff suppressed because it is too large
Load Diff
@ -1,591 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
|
||||
import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.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:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NewPrescriptionScreen extends StatefulWidget {
|
||||
@override
|
||||
_NewPrescriptionScreenState createState() => _NewPrescriptionScreenState();
|
||||
}
|
||||
|
||||
class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
||||
PersistentBottomSheetController _controller;
|
||||
TextEditingController strengthController = TextEditingController();
|
||||
int testNum = 0;
|
||||
int strengthChar;
|
||||
PatiantInformtion patient;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
patient = routeArgs['patient'];
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) => model.getPrescription(mrn: patient.patientId),
|
||||
builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).prescription,
|
||||
body: NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
PatientPageHeaderWidget(patient),
|
||||
Divider(
|
||||
height: 1.0,
|
||||
thickness: 1.0,
|
||||
color: Colors.grey,
|
||||
),
|
||||
(model.prescriptionList.length != 0)
|
||||
? SizedBox(height: model.prescriptionList[0].rowcount == 0 ? 200.0 : 10.0)
|
||||
: SizedBox(height: 200.0),
|
||||
//model.prescriptionList == null
|
||||
(model.prescriptionList.length != 0)
|
||||
? model.prescriptionList[0].rowcount == 0
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
addPrescriptionForm(context, model, patient, model.prescriptionList);
|
||||
//model.postPrescription();
|
||||
},
|
||||
child: CircleAvatar(
|
||||
radius: 65,
|
||||
backgroundColor: Color(0XFFB8382C),
|
||||
child: CircleAvatar(
|
||||
radius: 60,
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: Colors.black,
|
||||
size: 45.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15.0,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).noPrescriptionListed,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).addNow,
|
||||
color: Color(0XFFB8382C),
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(14.0),
|
||||
child: NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 50.0,
|
||||
width: 450.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: Colors.grey),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
AppText(
|
||||
' Add more medication',
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 12.5,
|
||||
),
|
||||
Icon(
|
||||
Icons.add,
|
||||
color: Color(0XFFB8382C),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
addPrescriptionForm(context, model, patient, model.prescriptionList);
|
||||
//model.postPrescription();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
...List.generate(
|
||||
model.prescriptionList[0].rowcount,
|
||||
(index) => Container(
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.022,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: MediaQuery.of(context).size.height * 0.21,
|
||||
width: MediaQuery.of(context).size.width * 0.1,
|
||||
child: Column(
|
||||
children: [
|
||||
AppText(
|
||||
(DateTime.parse(model.prescriptionList[0].entityList[index]
|
||||
.createdOn) !=
|
||||
null
|
||||
? (DateTime.parse(model.prescriptionList[0]
|
||||
.entityList[index].createdOn)
|
||||
.year)
|
||||
.toString()
|
||||
: DateTime.now().year)
|
||||
.toString(),
|
||||
color: Colors.green,
|
||||
fontSize: 13.5,
|
||||
),
|
||||
AppText(
|
||||
AppDateUtils.getMonth(model.prescriptionList[0]
|
||||
.entityList[index].createdOn !=
|
||||
null
|
||||
? (DateTime.parse(model.prescriptionList[0]
|
||||
.entityList[index].createdOn)
|
||||
.month)
|
||||
: DateTime.now().month)
|
||||
.toUpperCase(),
|
||||
color: Colors.green,
|
||||
),
|
||||
AppText(
|
||||
DateTime.parse(
|
||||
model.prescriptionList[0].entityList[index].createdOn)
|
||||
.day
|
||||
.toString(),
|
||||
color: Colors.green,
|
||||
),
|
||||
AppText(
|
||||
AppDateUtils.getTimeFormated(DateTime.parse(model
|
||||
.prescriptionList[0].entityList[index].createdOn))
|
||||
.toString(),
|
||||
color: Colors.green,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
// height: MediaQuery.of(
|
||||
// context)
|
||||
// .size
|
||||
// .height *
|
||||
// 0.3499,
|
||||
width: MediaQuery.of(context).size.width * 0.77,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'Start Date:',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 14.0,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
AppDateUtils.getDateFormatted(DateTime.parse(model
|
||||
.prescriptionList[0].entityList[index].startDate)),
|
||||
fontSize: 13.5,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 6.0,
|
||||
),
|
||||
AppText(
|
||||
'Order Type:',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 14.0,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model.prescriptionList[0].entityList[index]
|
||||
.orderTypeDescription,
|
||||
fontSize: 13.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
child: Expanded(
|
||||
child: AppText(
|
||||
model.prescriptionList[0].entityList[index]
|
||||
.medicationName,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 15.0,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model.prescriptionList[0].entityList[index].doseDetail,
|
||||
fontSize: 15.0,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'Indication: ',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 17.0,
|
||||
),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
strutStyle: StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index]
|
||||
.indication),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'UOM: ',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 17.0,
|
||||
),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
strutStyle: StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
text: model
|
||||
.prescriptionList[0].entityList[index].uom),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'BOX Quantity: ',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 17.0,
|
||||
),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
strutStyle: StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index]
|
||||
.quantity
|
||||
.toString() ==
|
||||
null
|
||||
? ""
|
||||
: model.prescriptionList[0].entityList[index]
|
||||
.quantity
|
||||
.toString()),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'pharmacy Intervention ',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 17.0,
|
||||
),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
strutStyle: StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index]
|
||||
.pharmacyInervention ==
|
||||
null
|
||||
? ""
|
||||
: model.prescriptionList[0].entityList[index]
|
||||
.pharmacyInervention
|
||||
.toString()),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 5.0),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'pharmacist Remarks : ',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 15.0,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model.prescriptionList[0].entityList[index]
|
||||
.pharmacistRemarks ==
|
||||
null
|
||||
? ""
|
||||
: model.prescriptionList[0].entityList[index]
|
||||
.pharmacistRemarks,
|
||||
fontSize: 15.0),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).doctorName + ": ",
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model.prescriptionList[0].entityList[index].doctorName,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'Doctor Remarks : ',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 13.0,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
// height: MediaQuery.of(context).size.height *
|
||||
// 0.038,
|
||||
child: RichText(
|
||||
// maxLines:
|
||||
// 2,
|
||||
// overflow:
|
||||
// TextOverflow.ellipsis,
|
||||
strutStyle: StrutStyle(fontSize: 10.0),
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index]
|
||||
.remarks !=
|
||||
null
|
||||
? model.prescriptionList[0].entityList[index]
|
||||
.remarks
|
||||
: "",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
|
||||
// SizedBox(
|
||||
// height: 40,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: MediaQuery.of(context).size.height * 0.16,
|
||||
width: MediaQuery.of(context).size.width * 0.06,
|
||||
child: Column(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Icon(Icons.edit),
|
||||
onTap: () {
|
||||
updatePrescriptionForm(
|
||||
box: model
|
||||
.prescriptionList[0].entityList[index].quantity,
|
||||
uom: model.prescriptionList[0].entityList[index].uom,
|
||||
drugNameGeneric: model.prescriptionList[0]
|
||||
.entityList[index].medicationName,
|
||||
doseUnit: model.prescriptionList[0].entityList[index]
|
||||
.doseDailyUnitID
|
||||
.toString(),
|
||||
doseStreangth: model.prescriptionList[0]
|
||||
.entityList[index].doseDailyQuantity
|
||||
.toString(),
|
||||
duration: model.prescriptionList[0].entityList[index]
|
||||
.doseDurationDays
|
||||
.toString(),
|
||||
startDate: model
|
||||
.prescriptionList[0].entityList[index].startDate
|
||||
.toString(),
|
||||
dose: model.prescriptionList[0].entityList[index].doseTimingID
|
||||
.toString(),
|
||||
frequency: model
|
||||
.prescriptionList[0].entityList[index].frequencyID
|
||||
.toString(),
|
||||
rouat: model.prescriptionList[0].entityList[index].routeID
|
||||
.toString(),
|
||||
patient: patient,
|
||||
drugId: model.prescriptionList[0].entityList[index].medicineCode,
|
||||
drugName: model.prescriptionList[0].entityList[index].medicationName,
|
||||
remarks: model.prescriptionList[0].entityList[index].remarks,
|
||||
model: model,
|
||||
enteredRemarks: model.prescriptionList[0].entityList[index].remarks,
|
||||
context: context);
|
||||
//model.postPrescription();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 0,
|
||||
thickness: 1.0,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
addPrescriptionForm(context, model, patient, model.prescriptionList);
|
||||
//model.postPrescription();
|
||||
},
|
||||
child: CircleAvatar(
|
||||
radius: 65,
|
||||
backgroundColor: Color(0XFFB8382C),
|
||||
child: CircleAvatar(
|
||||
radius: 60,
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: Colors.black,
|
||||
size: 45.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15.0,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).noPrescriptionListed,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).addNow,
|
||||
color: Color(0XFFB8382C),
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
selectDate(BuildContext context, PrescriptionViewModel model) async {
|
||||
DateTime selectedDate;
|
||||
selectedDate = DateTime.now();
|
||||
final DateTime picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: selectedDate,
|
||||
firstDate: DateTime.now().add(Duration(hours: 2)),
|
||||
lastDate: DateTime(2040),
|
||||
initialEntryMode: DatePickerEntryMode.calendar,
|
||||
);
|
||||
if (picked != null && picked != selectedDate) {
|
||||
setState(() {
|
||||
selectedDate = picked;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,516 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/prescription_view_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/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.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:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NewPrescriptionHistoryScreen extends StatefulWidget {
|
||||
@override
|
||||
_NewPrescriptionHistoryScreenState createState() =>
|
||||
_NewPrescriptionHistoryScreenState();
|
||||
}
|
||||
|
||||
class _NewPrescriptionHistoryScreenState
|
||||
extends State<NewPrescriptionHistoryScreen> {
|
||||
PersistentBottomSheetController _controller;
|
||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
TextEditingController strengthController = TextEditingController();
|
||||
int testNum = 0;
|
||||
int strengthChar;
|
||||
PatiantInformtion patient;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
patient = routeArgs['patient'];
|
||||
return BaseView<PrescriptionViewModel>(
|
||||
onModelReady: (model) => model.getPrescription(mrn: patient.patientId),
|
||||
builder:
|
||||
(BuildContext context, PrescriptionViewModel model, Widget child) =>
|
||||
AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).prescription,
|
||||
body: NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
PatientPageHeaderWidget(patient),
|
||||
Divider(
|
||||
height: 1.0,
|
||||
thickness: 1.0,
|
||||
color: Colors.grey,
|
||||
),
|
||||
(model.prescriptionList.length != 0)
|
||||
? SizedBox(
|
||||
height:
|
||||
model.prescriptionList[0].rowcount == 0
|
||||
? 200.0
|
||||
: 10.0)
|
||||
: SizedBox(height: 200.0),
|
||||
//model.prescriptionList == null
|
||||
(model.prescriptionList.length != 0)
|
||||
? model.prescriptionList[0].rowcount == 0
|
||||
? Container(
|
||||
child: AppText(
|
||||
'Sorry , Theres no prescriptions for this patient',
|
||||
color: Color(0xFFB9382C),
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(14.0),
|
||||
child: NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
...List.generate(
|
||||
model.prescriptionList[0]
|
||||
.rowcount,
|
||||
(index) => Container(
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: MediaQuery.of(
|
||||
context)
|
||||
.size
|
||||
.height *
|
||||
0.022,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: MediaQuery.of(
|
||||
context)
|
||||
.size
|
||||
.height *
|
||||
0.21,
|
||||
width: MediaQuery.of(
|
||||
context)
|
||||
.size
|
||||
.width *
|
||||
0.1,
|
||||
child: Column(
|
||||
children: [
|
||||
AppText(
|
||||
(DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) !=
|
||||
null
|
||||
? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year)
|
||||
.toString()
|
||||
: DateTime.now()
|
||||
.year)
|
||||
.toString(),
|
||||
color: Colors
|
||||
.green,
|
||||
fontSize:
|
||||
13.5,
|
||||
),
|
||||
AppText(
|
||||
AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
|
||||
null
|
||||
? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn)
|
||||
.month)
|
||||
: DateTime.now()
|
||||
.month)
|
||||
.toUpperCase(),
|
||||
color: Colors
|
||||
.green,
|
||||
),
|
||||
AppText(
|
||||
DateTime.parse(model
|
||||
.prescriptionList[
|
||||
0]
|
||||
.entityList[
|
||||
index]
|
||||
.createdOn)
|
||||
.day
|
||||
.toString(),
|
||||
color: Colors
|
||||
.green,
|
||||
),
|
||||
AppText(
|
||||
AppDateUtils.getTimeFormated(DateTime.parse(model
|
||||
.prescriptionList[
|
||||
0]
|
||||
.entityList[
|
||||
index]
|
||||
.createdOn))
|
||||
.toString(),
|
||||
color: Colors
|
||||
.green,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
// height: MediaQuery.of(
|
||||
// context)
|
||||
// .size
|
||||
// .height *
|
||||
// 0.3499,
|
||||
width: MediaQuery.of(
|
||||
context)
|
||||
.size
|
||||
.width *
|
||||
0.77,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'Start Date:',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
14.0,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
AppText(
|
||||
AppDateUtils.getDateFormatted(DateTime.parse(model
|
||||
.prescriptionList[0]
|
||||
.entityList[index]
|
||||
.startDate)),
|
||||
fontSize:
|
||||
13.5,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
6.0,
|
||||
),
|
||||
AppText(
|
||||
'Order Type:',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
14.0,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
AppText(
|
||||
model
|
||||
.prescriptionList[0]
|
||||
.entityList[index]
|
||||
.orderTypeDescription,
|
||||
fontSize:
|
||||
13.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
child:
|
||||
Expanded(
|
||||
child:
|
||||
AppText(
|
||||
model
|
||||
.prescriptionList[0]
|
||||
.entityList[index]
|
||||
.medicationName,
|
||||
fontWeight:
|
||||
FontWeight.w700,
|
||||
fontSize:
|
||||
15.0,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
AppText(
|
||||
model
|
||||
.prescriptionList[0]
|
||||
.entityList[index]
|
||||
.doseDetail,
|
||||
fontSize:
|
||||
15.0,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'Indication: ',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
17.0,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
RichText(
|
||||
maxLines:
|
||||
3,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
strutStyle:
|
||||
StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style:
|
||||
TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index].indication),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'UOM: ',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
17.0,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
RichText(
|
||||
maxLines:
|
||||
3,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
strutStyle:
|
||||
StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style:
|
||||
TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index].uom),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'BOX Quantity: ',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
17.0,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
RichText(
|
||||
maxLines:
|
||||
3,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
strutStyle:
|
||||
StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style:
|
||||
TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'pharmacy Intervention ',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
17.0,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
RichText(
|
||||
maxLines:
|
||||
3,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
strutStyle:
|
||||
StrutStyle(fontSize: 12.0),
|
||||
text: TextSpan(
|
||||
style:
|
||||
TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
5.0),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'pharmacist Remarks : ',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
15.0,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
// commening below code because there is an error coming in the model please fix it before pushing it
|
||||
model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks,
|
||||
fontSize: 15.0),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.doctorName +
|
||||
": ",
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w600,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
AppText(
|
||||
model
|
||||
.prescriptionList[0]
|
||||
.entityList[index]
|
||||
.doctorName,
|
||||
fontWeight:
|
||||
FontWeight.w700,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
'Doctor Remarks : ',
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700,
|
||||
fontSize:
|
||||
13.0,
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
Container(
|
||||
// height: MediaQuery.of(context).size.height *
|
||||
// 0.038,
|
||||
child:
|
||||
RichText(
|
||||
// maxLines:
|
||||
// 2,
|
||||
// overflow:
|
||||
// TextOverflow.ellipsis,
|
||||
strutStyle:
|
||||
StrutStyle(fontSize: 10.0),
|
||||
text:
|
||||
TextSpan(
|
||||
style:
|
||||
TextStyle(color: Colors.black),
|
||||
text: model.prescriptionList[0].entityList[index].remarks != null
|
||||
? model.prescriptionList[0].entityList[index].remarks
|
||||
: "",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
|
||||
// SizedBox(
|
||||
// height: 40,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
height: 0,
|
||||
thickness: 1.0,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
child: AppText(
|
||||
'Sorry , theres no prescriptions listed for this patient',
|
||||
color: Color(0xFFB9382C),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
selectDate(BuildContext context, PrescriptionViewModel model) async {
|
||||
DateTime selectedDate;
|
||||
selectedDate = DateTime.now();
|
||||
final DateTime picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: selectedDate,
|
||||
firstDate: DateTime.now().add(Duration(hours: 2)),
|
||||
lastDate: DateTime(2040),
|
||||
initialEntryMode: DatePickerEntryMode.calendar,
|
||||
);
|
||||
if (picked != null && picked != selectedDate) {
|
||||
setState(() {
|
||||
selectedDate = picked;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,114 +0,0 @@
|
||||
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/icons_app/doctor_app_icons.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_screen.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PatientPageHeaderWidget extends StatelessWidget {
|
||||
|
||||
final PatiantInformtion patient;
|
||||
PatientPageHeaderWidget(this.patient);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
|
||||
return BaseView<SOAPViewModel>(
|
||||
onModelReady: (model) async {
|
||||
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
|
||||
patientMRN: patient.patientMRN??patient.patientId,
|
||||
doctorID: '',
|
||||
editedBy: '');
|
||||
await model.getPatientAllergy(generalGetReqForSOAP);
|
||||
if (model.allergiesList.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.Allergies);
|
||||
}
|
||||
if (model.allergySeverityList.length == 0) {
|
||||
await model.getMasterLookup(MasterKeysService.AllergySeverity);
|
||||
}
|
||||
|
||||
},
|
||||
builder: (_, model, w) => Container(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
AvatarWidget(
|
||||
Icon(
|
||||
patient.genderDescription == "Male"
|
||||
? DoctorApp.male
|
||||
: DoctorApp.female_icon,
|
||||
size: 70,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AppText(
|
||||
patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).age ,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
AppText(
|
||||
patient.age.toString(),
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
],
|
||||
),
|
||||
model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText(
|
||||
TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic),
|
||||
color: Color(0xFFB9382C),
|
||||
fontWeight: FontWeight.bold,
|
||||
) : AppText(''),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: Color(0xffCCCCCC),
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue