drug list

merge-requests/234/head
hussam al-habibeh 4 years ago
parent 76cc4d11f8
commit f997561bb8

@ -11,6 +11,8 @@ class PrescriptionService extends BaseService {
List<PrescriptionModel> get prescriptionList => _prescriptionList;
List<SearchDrugModel> _drugsList = List();
List<SearchDrugModel> get drugsList => _drugsList;
List<dynamic> doctorsList = [];
List<dynamic> specialityList = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(
patientMRN: 3120877,
@ -26,7 +28,8 @@ class PrescriptionService extends BaseService {
PostPrescriptionReqModel _postPrescriptionReqModel =
PostPrescriptionReqModel();
Future getPrescription() async {
Future getPrescription({int mrn}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: 3120877);
hasError = false;
_prescriptionList.clear();
await baseAppClient.post(GET_PRESCRIPTION_LIST,
@ -41,10 +44,11 @@ class PrescriptionService extends BaseService {
Future getDrugs() async {
hasError = false;
_drugsList.clear();
await baseAppClient.post(SEARCH_DRUG,
onSuccess: (dynamic response, int statusCode) {
_drugsList.add(SearchDrugModel.fromJson(response['MedicationList']));
doctorsList = [];
doctorsList = response['MedicationList']['entityList'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -12,13 +12,13 @@ class PrescriptionViewModel extends BaseViewModel {
List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList;
List<SearchDrugModel> get drugsList => _prescriptionService.drugsList;
List<dynamic> get drugsList => _prescriptionService.doctorsList;
Future getPrescription() async {
Future getPrescription({int mrn}) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
await _prescriptionService.getPrescription(mrn: mrn);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
@ -27,7 +27,7 @@ class PrescriptionViewModel extends BaseViewModel {
}
Future postPrescription(
PostPrescriptionReqModel postProcedureReqModel) async {
PostPrescriptionReqModel postProcedureReqModel, int mrn) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -36,13 +36,13 @@ class PrescriptionViewModel extends BaseViewModel {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
await getPrescription();
await getPrescription(mrn: mrn);
setState(ViewState.Idle);
}
}
Future updatePrescription(
PostPrescriptionReqModel updatePrescriptionReqModel) async {
PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -51,7 +51,7 @@ class PrescriptionViewModel extends BaseViewModel {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
await getPrescription();
await getPrescription(mrn: mrn);
setState(ViewState.Idle);
}
}

@ -124,7 +124,10 @@ class _AdmissionRequestDetailScreenState
ListSelectDialog dialog =
ListSelectDialog(
list: model.speciality,
attributeName: model.selectedLanguage == 'ar' ? 'nameAr' :'nameEn' ,
attributeName:
model.selectedLanguage == 'ar'
? 'nameAr'
: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
@ -149,7 +152,12 @@ class _AdmissionRequestDetailScreenState
TranslationBase.of(context)
.speciality,
_selectedSpeciality != null
? model.selectedLanguage == 'ar' ? _selectedSpeciality['nameAr'] : _selectedSpeciality['nameEn']
? model.selectedLanguage ==
'ar'
? _selectedSpeciality[
'nameAr']
: _selectedSpeciality[
'nameEn']
: null,
true),
enabled: false,
@ -163,36 +171,42 @@ class _AdmissionRequestDetailScreenState
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.doctorsList != null &&
model.doctorsList.length > 0
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.doctor,
_selectedDoctor != null
? _selectedDoctor[
'DoctorName']
: null,
true),
enabled: false,
),
),
@ -202,23 +216,22 @@ class _AdmissionRequestDetailScreenState
),
Container(
height: screenSize.height * 0.070,
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
decoration: Helpers.containerBorderDecoration(
Color(0xFFEEEEEE), Color(0xFFCCCCCC),
borderWidth: 0.0),
child: InkWell(
onTap: () => null,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).referringDate,
null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Color(0xFFCCCCCC),
)),
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.referringDate,
null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Color(0xFFCCCCCC),
)),
enabled: false,
),
),
@ -228,17 +241,19 @@ class _AdmissionRequestDetailScreenState
),
Container(
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).referringDoctor,
null,
true, dropDownColor: Color(0xFFCCCCCC)),
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.referringDoctor,
null,
true,
dropDownColor: Color(0xFFCCCCCC)),
enabled: false,
// controller: _remarksController,
keyboardType: TextInputType.text,
@ -255,8 +270,10 @@ class _AdmissionRequestDetailScreenState
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient});
onPressed: () {
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_2,
arguments: {'patient': patient});
},
),
),

@ -139,13 +139,13 @@ class _AdmissionRequestSecondScreenState
_emergencyAdmission = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.patientPregnant,
TranslationBase.of(context).patientPregnant,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
@ -155,28 +155,32 @@ class _AdmissionRequestSecondScreenState
_patientPregnant = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).treatmentLine,
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.treatmentLine,
null,
false),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -199,14 +203,17 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
/* _selectedWard != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
/* _selectedWard != null
? _selectedWard['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -224,13 +231,15 @@ class _AdmissionRequestSecondScreenState
_preAnesthesiaReferred = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -253,14 +262,18 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).admissionType,
/* _admissionType != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.admissionType,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -271,7 +284,8 @@ class _AdmissionRequestSecondScreenState
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -294,14 +308,18 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).diagnosis,
/* _admissionType != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.diagnosis,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -311,23 +329,26 @@ class _AdmissionRequestSecondScreenState
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).preOperativeOrders,
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.preOperativeOrders,
null,
false),
enabled: true,
controller: _preOperativeOrdersController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
enabled: true,
controller: _preOperativeOrdersController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
onTap:
/*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
@ -350,14 +371,18 @@ class _AdmissionRequestSecondScreenState
},
);
}
:*/ null,
:*/
null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).allergies,
/* _admissionType != null
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.allergies,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
:*/
null,
true),
enabled: false,
),
),
@ -374,8 +399,10 @@ class _AdmissionRequestSecondScreenState
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient});
onPressed: () {
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_3,
arguments: {'patient': patient});
},
),
),

File diff suppressed because it is too large Load Diff

@ -33,452 +33,535 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
@override
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(),
builder: (BuildContext context, PrescriptionViewModel model,
Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescription,
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
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,
),
],
onModelReady: (model) => model.getPrescription(mrn: patient.patientMRN),
builder:
(BuildContext context, PrescriptionViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescription,
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
if (model.prescriptionList.length != 0)
SizedBox(
height: model.prescriptionList[0].rowcount == 0
? 200.0
: 10.0),
//model.prescriptionList == null
if (model.prescriptionList.length != 0)
model.prescriptionList[0].rowcount == 0
? Column(
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,
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,
size: 45.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 5.0,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
),
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(
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),
)
],
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
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.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,
),
),
),
),
onTap: () {
addPrescriptionForm(context, model);
//model.postPrescription();
},
),
SizedBox(
height: 15.0,
),
...List.generate(
model.prescriptionList[0].rowcount,
(index) => Container(
//height: 240,
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
// crossAxisAlignment:
// CrossAxisAlignment.start,
children: [
Container(
height:
MediaQuery.of(context)
.size
.height *
0.23,
width:
MediaQuery.of(context)
.size
.width *
0.09,
child: Column(
children: [
AppText(
'8\nDEC',
color: Colors.green,
)
],
),
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(
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)
.size
.height *
0.282,
width:
MediaQuery.of(context)
.size
.width *
0.77,
child: Column(
),
),
onTap: () {
addPrescriptionForm(
context, model, patient);
//model.postPrescription();
},
),
SizedBox(
height: 15.0,
),
...List.generate(
model.prescriptionList[0]
.rowcount,
(index) => Container(
//height: 240,
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
// crossAxisAlignment:
// CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
'Start Date:',
fontWeight:
FontWeight
.w700,
fontSize: 14.0,
),
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.startDate,
fontSize:
12.0,
Container(
height: MediaQuery.of(
context)
.size
.height *
0.23,
width: MediaQuery.of(
context)
.size
.width *
0.09,
child: Column(
children: [
AppText(
'8\nDEC',
color: Colors
.green,
)
],
),
),
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(
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,
),
),
],
),
SizedBox(
height: 5.5,
),
Row(
children: [
Container(
child: Expanded(
child:
AppText(
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
fontWeight:
FontWeight
.w700,
fontSize:
15.0,
),
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: 5.5,
),
)
],
),
SizedBox(
height: 3.0,
),
Row(
children: [
AppText(
'Indication: ',
fontWeight:
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,
Row(
children: [
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.doseDetail,
fontSize:
15.0,
),
)
],
),
)
],
),
Row(
children: [
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.remarks,
fontSize:
14.0,
SizedBox(
height: 3.0,
),
Row(
children: [
AppText(
'Indication: ',
fontWeight:
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,
),
)
],
),
Row(
children: [
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.remarks,
fontSize:
14.0,
),
),
],
),
SizedBox(
height: 10.0,
),
),
],
),
SizedBox(
height: 10.0,
),
Divider(
height: 0,
thickness: 1.0,
color: Colors.grey,
Divider(
height: 0,
thickness:
1.0,
color: Colors
.grey,
),
// SizedBox(
// height: 40,
// ),
],
),
),
// SizedBox(
// height: 40,
// ),
],
),
),
Container(
height:
MediaQuery.of(context)
.size
.height *
0.05,
width:
MediaQuery.of(context)
.size
.width *
0.06,
child: Column(
children: [
InkWell(
child: Icon(
Icons.edit),
onTap: () {
updatePrescriptionForm(
context,
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
model
.prescriptionList[
0]
.entityList[
index]
.medicineCode,
model,
);
//model.postPrescription();
},
Container(
height: MediaQuery.of(
context)
.size
.height *
0.05,
width: MediaQuery.of(
context)
.size
.width *
0.06,
child: Column(
children: [
InkWell(
child: Icon(
Icons
.edit),
onTap: () {
updatePrescriptionForm(
context,
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
model
.prescriptionList[
0]
.entityList[
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(
context, String drugName, int drugId, PrescriptionViewModel model) {
TextEditingController remarksController = TextEditingController();
@ -637,7 +720,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
updatePrescriptionReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure;
await model.updatePrescription(updatePrescriptionReqModel);
await model.updatePrescription(
updatePrescriptionReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);

@ -509,7 +509,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
baseViewModel: widget.model,
child: SingleChildScrollView(
child: Container(
height: 790,
height: 810,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
@ -566,7 +566,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
maxLines: 5,
),
SizedBox(
height: 80.0,
height: 50.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),

@ -66,10 +66,13 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
...widget.list
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId].toString(),
groupValue: widget.selectedValue[widget.attributeValueId]
.toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(),
selected: item[widget.attributeValueId].toString() ==
widget.selectedValue[widget.attributeValueId]
.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;

Loading…
Cancel
Save