fix prescription

merge-requests/845/head
hussam al-habibeh 4 years ago
parent 7be6ef6ed6
commit fe5456db2a

@ -32,193 +32,190 @@ class PrescriptionsPage extends StatelessWidget {
onModelReady: (model) => patient.admissionNo == null onModelReady: (model) => patient.admissionNo == null
? model.getPrescriptions(patient, patientType: patientType) ? model.getPrescriptions(patient, patientType: patientType)
: model.getMedicationForInPatient(patient), : model.getMedicationForInPatient(patient),
builder: (_, model, w) => NetworkBaseView( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
child: AppScaffold( isShowAppBar: true,
baseViewModel: model, backgroundColor: Colors.grey[100],
isShowAppBar: true, appBar: PatientProfileAppBar(
backgroundColor: Colors.grey[100], patient,
appBar: PatientProfileAppBar( isInpatient: isInpatient,
patient, ),
isInpatient: isInpatient, body: patient.admissionNo == null
), ? FractionallySizedBox(
body: patient.admissionNo == null widthFactor: 1.0,
? FractionallySizedBox( child: ListView(
widthFactor: 1.0, physics: BouncingScrollPhysics(),
child: ListView( children: <Widget>[
physics: BouncingScrollPhysics(), SizedBox(
children: <Widget>[ height: 12,
SizedBox( ),
height: 12, if (model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43)
), Padding(
if (model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43) padding: const EdgeInsets.all(8.0),
Padding( child: Column(
padding: const EdgeInsets.all(8.0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, AppText(
children: [ TranslationBase.of(context).orders,
AppText( style: "caption2",
TranslationBase.of(context).orders, color: Colors.black,
style: "caption2", fontSize: 13,
color: Colors.black, ),
fontSize: 13, AppText(
), TranslationBase.of(context).prescriptions,
AppText( bold: true,
TranslationBase.of(context).prescriptions, fontSize: 22,
bold: true, ),
fontSize: 22, ],
),
),
if (patient.patientStatusType != null && patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).orders,
style: "caption2",
color: Colors.black,
fontSize: 13,
),
AppText(
TranslationBase.of(context).prescriptions,
bold: true,
fontSize: 22,
),
],
),
),
if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
prescriptionModel: model,
procedureType: ProcedureType.PRESCRIPTION,
),
settings: RouteSettings(name: 'AddProcedureTabPage')),
);
},
label: TranslationBase.of(context).applyForNewPrescriptionsOrder,
),
...List.generate(
model.prescriptionsList.length,
(index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: model.prescriptionsList[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
),
), ),
], ),
child: DoctorCard(
doctorName: model.prescriptionsList[index].doctorName,
profileUrl: model.prescriptionsList[index].doctorImageURL,
branch: model.prescriptionsList[index].name,
clinic: model.prescriptionsList[index].clinicDescription,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index].appointmentDate,
), ),
))),
if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
), ),
if (patient.patientStatusType != null && patient.patientStatusType == 43) Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: AppText(TranslationBase.of(context).noPrescriptionsFound),
crossAxisAlignment: CrossAxisAlignment.start, )
children: [ ],
AppText( ),
TranslationBase.of(context).orders, )
style: "caption2", ],
color: Colors.black, ),
fontSize: 13, )
), : NetworkBaseView(
AppText( baseViewModel: model,
TranslationBase.of(context).prescriptions, child: FractionallySizedBox(
bold: true, widthFactor: 1.0,
fontSize: 22, child: ListView(
), physics: BouncingScrollPhysics(),
], children: <Widget>[
), // SizedBox(
), // height: 12,
if ((patient.patientStatusType != null && patient.patientStatusType == 43) || // ),
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( ListView.builder(
onTap: () { scrollDirection: Axis.vertical,
Navigator.push( shrinkWrap: true,
context, itemCount: model.medicationForInPatient.length,
MaterialPageRoute( itemBuilder: (context, index) {
builder: (context) => BaseAddProcedureTabPage( //model.medicationForInPatient.length,
patient: patient, return InkWell(
prescriptionModel: model, onTap: () => Navigator.push(
procedureType: ProcedureType.PRESCRIPTION, context,
FadePage(
page: PrescriptionItemsInPatientPage(
prescriptionIndex: index,
prescriptions: model.medicationForInPatient[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
startOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].startDatetime,
), ),
settings: RouteSettings(name: 'AddProcedureTabPage')), stopOn: AppDateUtils.getDateTimeFromServerFormat(
); model.medicationForInPatient[index].stopDatetime,
},
label: TranslationBase.of(context).applyForNewPrescriptionsOrder,
),
...List.generate(
model.prescriptionsList.length,
(index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: model.prescriptionsList[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
), ),
), ),
), ),
child: DoctorCard(
doctorName: model.prescriptionsList[index].doctorName,
profileUrl: model.prescriptionsList[index].doctorImageURL,
branch: model.prescriptionsList[index].name,
clinic: model.prescriptionsList[index].clinicDescription,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index].appointmentDate,
), ),
))), child: InPatientDoctorCard(
if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) doctorName: model.medicationForInPatient[index].pHRItemDescription,
Center( profileUrl: 'sss',
child: Column( branch: 'hamza',
crossAxisAlignment: CrossAxisAlignment.center, clinic: 'basheer',
children: [ isPrescriptions: true,
SizedBox( appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
height: 100, model.medicationForInPatient[index].prescriptionDatetime,
), ),
Image.asset('assets/images/no-data.png'), createdBy: model.medicationForInPatient[index].doctorName.toString(),
Padding( ));
padding: const EdgeInsets.all(8.0), }),
child: AppText(TranslationBase.of(context).noPrescriptionsFound), if (model.medicationForInPatient.length == 0)
) Center(
], child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
), ),
) Image.asset('assets/images/no-data.png'),
], Padding(
), padding: const EdgeInsets.all(8.0),
) child: AppText(TranslationBase.of(context).noPrescriptionsFound),
: NetworkBaseView(
baseViewModel: model,
child: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
physics: BouncingScrollPhysics(),
children: <Widget>[
// SizedBox(
// height: 12,
// ),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicationForInPatient.length,
itemBuilder: (context, index) {
//model.medicationForInPatient.length,
return InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsInPatientPage(
prescriptionIndex: index,
prescriptions: model.medicationForInPatient[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
startOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].startDatetime,
),
stopOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].stopDatetime,
),
),
),
),
child: InPatientDoctorCard(
doctorName: model.medicationForInPatient[index].pHRItemDescription,
profileUrl: 'sss',
branch: 'hamza',
clinic: 'basheer',
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].prescriptionDatetime,
),
createdBy: model.medicationForInPatient[index].doctorName.toString(),
));
}),
if (model.medicationForInPatient.length == 0)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noPrescriptionsFound),
)
],
),
) )
], ],
), ),
), )
)), ],
)); ),
),
)));
} }
} }

@ -26,7 +26,8 @@ class ProcedureCard extends StatelessWidget {
this.categoryID, this.categoryID,
this.categoryName, this.categoryName,
this.patient, this.patient,
this.doctorID, this.isInpatient = false, this.doctorID,
this.isInpatient = false,
}) : super(key: key); }) : super(key: key);
@override @override
@ -47,22 +48,20 @@ class ProcedureCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Container(
height: MediaQuery.of(context).size.height * .20, height: MediaQuery.of(context).size.height * .212,
width: 5, width: 5,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
), ),
color: color: entityList.orderType == 0 ? Colors.black : Colors.red[500],
entityList.orderType == 0 ? Colors.black : Colors.red[500],
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: projectViewModel.isArabic ? 0 : 15, left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0),
right: projectViewModel.isArabic ? 15 : 0),
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -75,12 +74,8 @@ class ProcedureCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
entityList.orderType == 0 entityList.orderType == 0 ? 'Routine' : 'Urgent',
? 'Routine' color: entityList.orderType == 0 ? Colors.black : Colors.red[800],
: 'Urgent',
color: entityList.orderType == 0
? Colors.black
: Colors.red[800],
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
SizedBox( SizedBox(
@ -144,8 +139,7 @@ class ProcedureCard extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0), padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: Container( child: Container(
width: 40, width: 40,
@ -156,9 +150,7 @@ class ProcedureCard extends StatelessWidget {
'assets/images/male_avatar.png', 'assets/images/male_avatar.png',
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
))), ))),
@ -166,8 +158,7 @@ class ProcedureCard extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0),
left: 10, top: 25, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -203,7 +194,9 @@ class ProcedureCard extends StatelessWidget {
fontSize: 12, fontSize: 12,
), ),
), ),
if ((entityList.categoryID == 2 || entityList.categoryID == 4) && doctorID == entityList.doctorID && !isInpatient) if ((entityList.categoryID == 2 || entityList.categoryID == 4) &&
doctorID == entityList.doctorID &&
!isInpatient)
InkWell( InkWell(
child: Icon(DoctorApp.edit), child: Icon(DoctorApp.edit),
onTap: onTap, onTap: onTap,

@ -53,14 +53,13 @@ class DoctorCardInsurance extends StatelessWidget {
children: [ children: [
Container( Container(
height: 160, height: 160,
width: 5, width: 4.5,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
), ),
color: approvalStatus == "Approved" || color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة"
approvalStatus == "تمت الموافقة"
? Color(0xff359846) ? Color(0xff359846)
: Color(0xffD02127), : Color(0xffD02127),
), ),
@ -68,8 +67,7 @@ class DoctorCardInsurance extends StatelessWidget {
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: projectViewModel.isArabic ? 0 : 15, left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0),
right: projectViewModel.isArabic ? 15 : 0),
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap,
child: Column( child: Column(
@ -80,8 +78,7 @@ class DoctorCardInsurance extends StatelessWidget {
children: [ children: [
AppText( AppText(
"$approvalStatus", "$approvalStatus",
color: approvalStatus == "Approved" || color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة"
approvalStatus == "تمت الموافقة"
? Color(0xff359846) ? Color(0xff359846)
: Color(0xffD02127), : Color(0xffD02127),
), ),
@ -92,7 +89,7 @@ class DoctorCardInsurance extends StatelessWidget {
), ),
color: Color(0xff2E303A)), color: Color(0xff2E303A)),
child: Padding( child: Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(12.0),
child: AppText( child: AppText(
'$patientOut'.replaceAll(" ", ""), '$patientOut'.replaceAll(" ", ""),
color: Colors.white, color: Colors.white,
@ -126,90 +123,83 @@ class DoctorCardInsurance extends StatelessWidget {
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, if (orderNo != null && !isPrescriptions)
children: <Widget>[ Row(
if (orderNo != null && !isPrescriptions) children: <Widget>[
Row( AppText(
children: <Widget>[ 'order No:',
AppText( color: Colors.grey[500],
'order No:',
color: Colors.grey[500],
),
AppText(
orderNo ?? '',
)
],
),
if (invoiceNO != null && !isPrescriptions)
Row(
children: <Widget>[
AppText(
'Invoice:',
color: Colors.grey[500],
),
AppText(
invoiceNO,
)
],
), ),
if (isPrescriptions) AppText(
Row( orderNo ?? '',
children: <Widget>[ )
AppText( ],
TranslationBase.of(context).clinic + ),
": ", if (invoiceNO != null && !isPrescriptions)
color: Colors.grey[500], Row(
fontSize: 14, children: <Widget>[
//fontWeight: FontWeight.w600, AppText(
//color: Colors.grey[500], 'Invoice:',
), color: Colors.grey[500],
Expanded(
child: AppText(
clinic,
//fontWeight: FontWeight.w700,
fontSize: 14.0,
),
)
],
), ),
if (branch2 != null) AppText(
Row( invoiceNO,
children: <Widget>[ )
AppText( ],
TranslationBase.of(context).branch + ),
": ", if (isPrescriptions)
fontSize: 14, Row(
color: Colors.grey[500], children: <Widget>[
), AppText(
AppText( TranslationBase.of(context).clinic + ": ",
branch2, color: Colors.grey[500],
fontSize: 14.0, fontSize: 14,
) //fontWeight: FontWeight.w600,
], //color: Colors.grey[500],
), ),
Row( Expanded(
children: <Widget>[ child: AppText(
AppText( clinic,
TranslationBase.of(context) //fontWeight: FontWeight.w700,
.approvalNo +
": ",
fontSize: 14,
color: Colors.grey[500],
//color: Colors.grey[500],
),
AppText(
branch,
fontSize: 14.0, fontSize: 14.0,
) ),
], )
],
),
if (branch2 != null)
Row(
children: <Widget>[
AppText(
TranslationBase.of(context).branch + ": ",
fontSize: 14,
color: Colors.grey[500],
),
AppText(
branch2,
fontSize: 14.0,
)
],
),
Row(
children: <Widget>[
AppText(
TranslationBase.of(context).approvalNo + ": ",
fontSize: 14,
color: Colors.grey[500],
//color: Colors.grey[500],
), ),
]), AppText(
branch,
fontSize: 14.0,
)
],
),
]),
), ),
), ),
Padding( Padding(
padding: padding: const EdgeInsets.symmetric(horizontal: 15.0),
const EdgeInsets.symmetric(horizontal: 15.0),
child: Icon( child: Icon(
EvaIcons.eye, EvaIcons.eye,
), ),

@ -141,6 +141,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.1.0" version: "7.1.0"
cached_network_image:
dependency: "direct main"
description:
name: cached_network_image
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
@ -433,6 +440,20 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_blurhash:
dependency: transitive
description:
name: flutter_blurhash
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
flutter_cache_manager:
dependency: transitive
description:
name: flutter_cache_manager
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
flutter_device_type: flutter_device_type:
dependency: "direct main" dependency: "direct main"
description: description:
@ -595,6 +616,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.4" version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.19"
imei_plugin: imei_plugin:
dependency: "direct main" dependency: "direct main"
description: description:
@ -693,6 +721,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
octo_image:
dependency: transitive
description:
name: octo_image
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
open_iconic_flutter: open_iconic_flutter:
dependency: transitive dependency: transitive
description: description:
@ -728,6 +763,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.4"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.28"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@ -735,6 +777,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1+2" version: "0.0.1+2"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+8"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -854,6 +903,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.5" version: "2.1.5"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.25.0"
scratch_space: scratch_space:
dependency: transitive dependency: transitive
description: description:
@ -950,6 +1006,20 @@ packages:
relative: true relative: true
source: path source: path
version: "0.0.0" version: "0.0.0"
sqflite:
dependency: transitive
description:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2+4"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3+3"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -985,6 +1055,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.1"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0+2"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -1154,5 +1231,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta" dart: ">=2.10.2 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.2 <2.0.0"

Loading…
Cancel
Save