|
|
@ -33,452 +33,535 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
return BaseView<PrescriptionViewModel>(
|
|
|
|
return BaseView<PrescriptionViewModel>(
|
|
|
|
onModelReady: (model) => model.getPrescription(),
|
|
|
|
onModelReady: (model) => model.getPrescription(mrn: patient.patientMRN),
|
|
|
|
builder: (BuildContext context, PrescriptionViewModel model,
|
|
|
|
builder:
|
|
|
|
Widget child) =>
|
|
|
|
(BuildContext context, PrescriptionViewModel model, Widget child) =>
|
|
|
|
AppScaffold(
|
|
|
|
AppScaffold(
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
appBarTitle: TranslationBase.of(context).prescription,
|
|
|
|
appBarTitle: TranslationBase.of(context).prescription,
|
|
|
|
body: NetworkBaseView(
|
|
|
|
body: NetworkBaseView(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AvatarWidget(
|
|
|
|
AvatarWidget(
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
patient.genderDescription == "Male"
|
|
|
|
patient.genderDescription == "Male"
|
|
|
|
? DoctorApp.male
|
|
|
|
? DoctorApp.male
|
|
|
|
: DoctorApp.female_icon,
|
|
|
|
: DoctorApp.female_icon,
|
|
|
|
size: 70,
|
|
|
|
size: 70,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 20,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
patient.firstName + ' ' + patient.lastName,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (model.prescriptionList.length > 0)
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
TranslationBase.of(context).age2,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 5.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
patient.age.toString(),
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
"ALLERGIC TO: FOOD, ASPIRIN",
|
|
|
|
|
|
|
|
color: Color(0xFFB9382C),
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
SizedBox(
|
|
|
|
)
|
|
|
|
width: 20,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
),
|
|
|
|
crossAxisAlignment:
|
|
|
|
Divider(
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
height: 1.0,
|
|
|
|
children: [
|
|
|
|
thickness: 1.0,
|
|
|
|
AppText(
|
|
|
|
color: Colors.grey,
|
|
|
|
patient.firstName +
|
|
|
|
),
|
|
|
|
' ' +
|
|
|
|
if (model.prescriptionList.length != 0)
|
|
|
|
patient.lastName,
|
|
|
|
SizedBox(
|
|
|
|
color: Colors.black,
|
|
|
|
height: model.prescriptionList[0].rowcount == 0
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
? 200.0
|
|
|
|
),
|
|
|
|
: 10.0),
|
|
|
|
//if (model.prescriptionList.length > 0)
|
|
|
|
//model.prescriptionList == null
|
|
|
|
Row(
|
|
|
|
if (model.prescriptionList.length != 0)
|
|
|
|
children: [
|
|
|
|
model.prescriptionList[0].rowcount == 0
|
|
|
|
AppText(
|
|
|
|
? Column(
|
|
|
|
TranslationBase.of(context).age2,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.stretch,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
addPrescriptionForm(context, model);
|
|
|
|
|
|
|
|
//model.postPrescription();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
|
|
|
radius: 65,
|
|
|
|
|
|
|
|
backgroundColor: Color(0XFFB8382C),
|
|
|
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
|
|
|
radius: 60,
|
|
|
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
|
|
|
child: Icon(
|
|
|
|
|
|
|
|
Icons.add,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
size: 45.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 5.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
patient.age.toString(),
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AppText(
|
|
|
|
SizedBox(
|
|
|
|
"ALLERGIC TO: FOOD, ASPIRIN",
|
|
|
|
height: 15.0,
|
|
|
|
color: Color(0xFFB9382C),
|
|
|
|
),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
Row(
|
|
|
|
),
|
|
|
|
mainAxisAlignment:
|
|
|
|
],
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
)
|
|
|
|
children: [
|
|
|
|
],
|
|
|
|
AppText(
|
|
|
|
),
|
|
|
|
TranslationBase.of(context)
|
|
|
|
),
|
|
|
|
.noPrescriptionListed,
|
|
|
|
Divider(
|
|
|
|
color: Colors.black,
|
|
|
|
height: 1.0,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
thickness: 1.0,
|
|
|
|
),
|
|
|
|
color: Colors.grey,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(model.prescriptionList.length != 0)
|
|
|
|
Row(
|
|
|
|
? SizedBox(
|
|
|
|
mainAxisAlignment:
|
|
|
|
height:
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
model.prescriptionList[0].rowcount == 0
|
|
|
|
children: [
|
|
|
|
? 200.0
|
|
|
|
AppText(
|
|
|
|
: 10.0)
|
|
|
|
TranslationBase.of(context).addNow,
|
|
|
|
: SizedBox(height: 200.0),
|
|
|
|
color: Color(0XFFB8382C),
|
|
|
|
//model.prescriptionList == null
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
(model.prescriptionList.length != 0)
|
|
|
|
),
|
|
|
|
? model.prescriptionList[0].rowcount == 0
|
|
|
|
],
|
|
|
|
? Column(
|
|
|
|
),
|
|
|
|
mainAxisAlignment:
|
|
|
|
],
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
)
|
|
|
|
crossAxisAlignment:
|
|
|
|
: Padding(
|
|
|
|
CrossAxisAlignment.stretch,
|
|
|
|
padding: EdgeInsets.all(14.0),
|
|
|
|
children: [
|
|
|
|
child: NetworkBaseView(
|
|
|
|
InkWell(
|
|
|
|
baseViewModel: model,
|
|
|
|
onTap: () {
|
|
|
|
child: Column(
|
|
|
|
addPrescriptionForm(
|
|
|
|
mainAxisAlignment:
|
|
|
|
context, model, patient);
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
//model.postPrescription();
|
|
|
|
children: [
|
|
|
|
},
|
|
|
|
InkWell(
|
|
|
|
child: CircleAvatar(
|
|
|
|
child: Container(
|
|
|
|
radius: 65,
|
|
|
|
height: 50.0,
|
|
|
|
backgroundColor:
|
|
|
|
width: 450.0,
|
|
|
|
Color(0XFFB8382C),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
child: CircleAvatar(
|
|
|
|
border: Border.all(
|
|
|
|
radius: 60,
|
|
|
|
color: Colors.grey),
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
borderRadius:
|
|
|
|
child: Icon(
|
|
|
|
BorderRadius.circular(10.0),
|
|
|
|
Icons.add,
|
|
|
|
),
|
|
|
|
color: Colors.black,
|
|
|
|
child: Padding(
|
|
|
|
size: 45.0,
|
|
|
|
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: () {
|
|
|
|
SizedBox(
|
|
|
|
addPrescriptionForm(context, model);
|
|
|
|
height: 15.0,
|
|
|
|
//model.postPrescription();
|
|
|
|
),
|
|
|
|
},
|
|
|
|
Row(
|
|
|
|
),
|
|
|
|
mainAxisAlignment:
|
|
|
|
SizedBox(
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
height: 15.0,
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
AppText(
|
|
|
|
...List.generate(
|
|
|
|
TranslationBase.of(context)
|
|
|
|
model.prescriptionList[0].rowcount,
|
|
|
|
.noPrescriptionListed,
|
|
|
|
(index) => Container(
|
|
|
|
color: Colors.black,
|
|
|
|
//height: 240,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
child: Column(
|
|
|
|
),
|
|
|
|
children: [
|
|
|
|
],
|
|
|
|
Row(
|
|
|
|
),
|
|
|
|
mainAxisAlignment:
|
|
|
|
Row(
|
|
|
|
MainAxisAlignment
|
|
|
|
mainAxisAlignment:
|
|
|
|
.spaceBetween,
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
// crossAxisAlignment:
|
|
|
|
children: [
|
|
|
|
// CrossAxisAlignment.start,
|
|
|
|
AppText(
|
|
|
|
children: [
|
|
|
|
TranslationBase.of(context)
|
|
|
|
Container(
|
|
|
|
.addNow,
|
|
|
|
height:
|
|
|
|
color: Color(0XFFB8382C),
|
|
|
|
MediaQuery.of(context)
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
.size
|
|
|
|
),
|
|
|
|
.height *
|
|
|
|
],
|
|
|
|
0.23,
|
|
|
|
),
|
|
|
|
width:
|
|
|
|
],
|
|
|
|
MediaQuery.of(context)
|
|
|
|
)
|
|
|
|
.size
|
|
|
|
: Padding(
|
|
|
|
.width *
|
|
|
|
padding: EdgeInsets.all(14.0),
|
|
|
|
0.09,
|
|
|
|
child: NetworkBaseView(
|
|
|
|
child: Column(
|
|
|
|
baseViewModel: model,
|
|
|
|
children: [
|
|
|
|
child: Column(
|
|
|
|
AppText(
|
|
|
|
mainAxisAlignment:
|
|
|
|
'8\nDEC',
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
color: Colors.green,
|
|
|
|
children: [
|
|
|
|
)
|
|
|
|
InkWell(
|
|
|
|
],
|
|
|
|
child: Container(
|
|
|
|
),
|
|
|
|
height: 50.0,
|
|
|
|
|
|
|
|
width: 450.0,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
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),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
),
|
|
|
|
height:
|
|
|
|
),
|
|
|
|
MediaQuery.of(context)
|
|
|
|
onTap: () {
|
|
|
|
.size
|
|
|
|
addPrescriptionForm(
|
|
|
|
.height *
|
|
|
|
context, model, patient);
|
|
|
|
0.282,
|
|
|
|
//model.postPrescription();
|
|
|
|
width:
|
|
|
|
},
|
|
|
|
MediaQuery.of(context)
|
|
|
|
),
|
|
|
|
.size
|
|
|
|
SizedBox(
|
|
|
|
.width *
|
|
|
|
height: 15.0,
|
|
|
|
0.77,
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
...List.generate(
|
|
|
|
|
|
|
|
model.prescriptionList[0]
|
|
|
|
|
|
|
|
.rowcount,
|
|
|
|
|
|
|
|
(index) => Container(
|
|
|
|
|
|
|
|
//height: 240,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
|
|
|
// crossAxisAlignment:
|
|
|
|
|
|
|
|
// CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Container(
|
|
|
|
children: [
|
|
|
|
height: MediaQuery.of(
|
|
|
|
AppText(
|
|
|
|
context)
|
|
|
|
'Start Date:',
|
|
|
|
.size
|
|
|
|
fontWeight:
|
|
|
|
.height *
|
|
|
|
FontWeight
|
|
|
|
0.23,
|
|
|
|
.w700,
|
|
|
|
width: MediaQuery.of(
|
|
|
|
fontSize: 14.0,
|
|
|
|
context)
|
|
|
|
),
|
|
|
|
.size
|
|
|
|
Expanded(
|
|
|
|
.width *
|
|
|
|
child: AppText(
|
|
|
|
0.09,
|
|
|
|
model
|
|
|
|
child: Column(
|
|
|
|
.prescriptionList[
|
|
|
|
children: [
|
|
|
|
0]
|
|
|
|
AppText(
|
|
|
|
.entityList[
|
|
|
|
'8\nDEC',
|
|
|
|
index]
|
|
|
|
color: Colors
|
|
|
|
.startDate,
|
|
|
|
.green,
|
|
|
|
fontSize:
|
|
|
|
)
|
|
|
|
12.0,
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: MediaQuery.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
|
|
|
|
0.282,
|
|
|
|
|
|
|
|
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(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[0]
|
|
|
|
|
|
|
|
.entityList[index]
|
|
|
|
|
|
|
|
.startDate,
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
12.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
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(
|
|
|
|
SizedBox(
|
|
|
|
height: 5.5,
|
|
|
|
width: 6.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
'Order Type:',
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w700,
|
|
|
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: AppText(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.entityList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.orderTypeDescription,
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
13.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
],
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
SizedBox(
|
|
|
|
child:
|
|
|
|
height: 5.5,
|
|
|
|
Expanded(
|
|
|
|
),
|
|
|
|
child:
|
|
|
|
Row(
|
|
|
|
AppText(
|
|
|
|
children: [
|
|
|
|
model
|
|
|
|
Container(
|
|
|
|
.prescriptionList[0]
|
|
|
|
child: Expanded(
|
|
|
|
.entityList[index]
|
|
|
|
child:
|
|
|
|
.medicationName,
|
|
|
|
AppText(
|
|
|
|
fontWeight:
|
|
|
|
model
|
|
|
|
FontWeight.w700,
|
|
|
|
.prescriptionList[
|
|
|
|
fontSize:
|
|
|
|
0]
|
|
|
|
15.0,
|
|
|
|
.entityList[
|
|
|
|
),
|
|
|
|
index]
|
|
|
|
),
|
|
|
|
.medicationName,
|
|
|
|
)
|
|
|
|
fontWeight:
|
|
|
|
],
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w700,
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
15.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
SizedBox(
|
|
|
|
],
|
|
|
|
height: 5.5,
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 5.5,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: AppText(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.entityList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.doseDetail,
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
15.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
Row(
|
|
|
|
],
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
SizedBox(
|
|
|
|
child:
|
|
|
|
height: 3.0,
|
|
|
|
AppText(
|
|
|
|
),
|
|
|
|
model
|
|
|
|
Row(
|
|
|
|
.prescriptionList[0]
|
|
|
|
children: [
|
|
|
|
.entityList[index]
|
|
|
|
AppText(
|
|
|
|
.doseDetail,
|
|
|
|
'Indication: ',
|
|
|
|
fontSize:
|
|
|
|
fontWeight:
|
|
|
|
15.0,
|
|
|
|
FontWeight
|
|
|
|
),
|
|
|
|
.w700,
|
|
|
|
)
|
|
|
|
fontSize: 17.0,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: AppText(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.entityList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.indication,
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
15.0),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 18.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: AppText(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.entityList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.doctorName,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w700,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
SizedBox(
|
|
|
|
],
|
|
|
|
height: 3.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
AppText(
|
|
|
|
child: AppText(
|
|
|
|
'Indication: ',
|
|
|
|
model
|
|
|
|
fontWeight:
|
|
|
|
.prescriptionList[
|
|
|
|
FontWeight
|
|
|
|
0]
|
|
|
|
.w700,
|
|
|
|
.entityList[
|
|
|
|
fontSize:
|
|
|
|
index]
|
|
|
|
17.0,
|
|
|
|
.remarks,
|
|
|
|
),
|
|
|
|
fontSize:
|
|
|
|
Expanded(
|
|
|
|
14.0,
|
|
|
|
child: AppText(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[0]
|
|
|
|
|
|
|
|
.entityList[index]
|
|
|
|
|
|
|
|
.indication,
|
|
|
|
|
|
|
|
fontSize: 15.0),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 18.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[0]
|
|
|
|
|
|
|
|
.entityList[index]
|
|
|
|
|
|
|
|
.doctorName,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w700,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionList[0]
|
|
|
|
|
|
|
|
.entityList[index]
|
|
|
|
|
|
|
|
.remarks,
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
14.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 10.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Divider(
|
|
|
|
Divider(
|
|
|
|
height: 0,
|
|
|
|
height: 0,
|
|
|
|
thickness: 1.0,
|
|
|
|
thickness:
|
|
|
|
color: Colors.grey,
|
|
|
|
1.0,
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.grey,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// SizedBox(
|
|
|
|
|
|
|
|
// height: 40,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// SizedBox(
|
|
|
|
Container(
|
|
|
|
// height: 40,
|
|
|
|
height: MediaQuery.of(
|
|
|
|
// ),
|
|
|
|
context)
|
|
|
|
],
|
|
|
|
.size
|
|
|
|
),
|
|
|
|
.height *
|
|
|
|
),
|
|
|
|
0.05,
|
|
|
|
Container(
|
|
|
|
width: MediaQuery.of(
|
|
|
|
height:
|
|
|
|
context)
|
|
|
|
MediaQuery.of(context)
|
|
|
|
.size
|
|
|
|
.size
|
|
|
|
.width *
|
|
|
|
.height *
|
|
|
|
0.06,
|
|
|
|
0.05,
|
|
|
|
child: Column(
|
|
|
|
width:
|
|
|
|
children: [
|
|
|
|
MediaQuery.of(context)
|
|
|
|
InkWell(
|
|
|
|
.size
|
|
|
|
child: Icon(
|
|
|
|
.width *
|
|
|
|
Icons
|
|
|
|
0.06,
|
|
|
|
.edit),
|
|
|
|
child: Column(
|
|
|
|
onTap: () {
|
|
|
|
children: [
|
|
|
|
updatePrescriptionForm(
|
|
|
|
InkWell(
|
|
|
|
context,
|
|
|
|
child: Icon(
|
|
|
|
model
|
|
|
|
Icons.edit),
|
|
|
|
.prescriptionList[
|
|
|
|
onTap: () {
|
|
|
|
0]
|
|
|
|
updatePrescriptionForm(
|
|
|
|
.entityList[
|
|
|
|
context,
|
|
|
|
index]
|
|
|
|
model
|
|
|
|
.medicationName,
|
|
|
|
.prescriptionList[
|
|
|
|
model
|
|
|
|
0]
|
|
|
|
.prescriptionList[
|
|
|
|
.entityList[
|
|
|
|
0]
|
|
|
|
index]
|
|
|
|
.entityList[
|
|
|
|
.medicationName,
|
|
|
|
index]
|
|
|
|
model
|
|
|
|
.medicineCode,
|
|
|
|
.prescriptionList[
|
|
|
|
model,
|
|
|
|
0]
|
|
|
|
);
|
|
|
|
.entityList[
|
|
|
|
//model.postPrescription();
|
|
|
|
index]
|
|
|
|
},
|
|
|
|
.medicineCode,
|
|
|
|
),
|
|
|
|
model,
|
|
|
|
],
|
|
|
|
);
|
|
|
|
),
|
|
|
|
//model.postPrescription();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Column(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.stretch,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
addPrescriptionForm(
|
|
|
|
|
|
|
|
context, model, patient);
|
|
|
|
|
|
|
|
//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;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void updatePrescriptionForm(
|
|
|
|
void updatePrescriptionForm(
|
|
|
|
context, String drugName, int drugId, PrescriptionViewModel model) {
|
|
|
|
context, String drugName, int drugId, PrescriptionViewModel model) {
|
|
|
|
TextEditingController remarksController = TextEditingController();
|
|
|
|
TextEditingController remarksController = TextEditingController();
|
|
|
@ -637,7 +720,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
updatePrescriptionReqModel.prescriptionRequestModel = sss;
|
|
|
|
updatePrescriptionReqModel.prescriptionRequestModel = sss;
|
|
|
|
//postProcedureReqModel.procedures = controlsProcedure;
|
|
|
|
//postProcedureReqModel.procedures = controlsProcedure;
|
|
|
|
|
|
|
|
|
|
|
|
await model.updatePrescription(updatePrescriptionReqModel);
|
|
|
|
await model.updatePrescription(
|
|
|
|
|
|
|
|
updatePrescriptionReqModel, patient.patientMRN);
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|