Merge branch 'all_special_lab_result' into 'development'

fix in-patient prescription

See merge request Cloud_Solution/doctor_app_flutter!857
merge-requests/858/merge
Mohammad Aljammal 5 years ago
commit 4e52155342

@ -44,7 +44,8 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getAllSpecialLabResult(patientId: patient.patientMRN), onModelReady: (model) =>
model.getAllSpecialLabResult(patientId: patient.patientMRN),
builder: (context, LabsViewModel model, widget) => AppScaffold( builder: (context, LabsViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
@ -69,7 +70,9 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).special + " " + TranslationBase.of(context).lab, TranslationBase.of(context).special +
" " +
TranslationBase.of(context).lab,
style: "caption2", style: "caption2",
color: Colors.black, color: Colors.black,
fontSize: 13, fontSize: 13,
@ -105,26 +108,44 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
width: 20, width: 20,
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
color: model.allSpecialLabList[index].isLiveCareAppointment color: model.allSpecialLabList[index]
.isLiveCareAppointment
? Colors.red[900] ? Colors.red[900]
: !model.allSpecialLabList[index].isInOutPatient : !model.allSpecialLabList[index]
.isInOutPatient
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), topLeft: projectViewModel.isArabic
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), ? Radius.circular(0)
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), : Radius.circular(8),
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), bottomLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0)),
), ),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.allSpecialLabList[index].isLiveCareAppointment model.allSpecialLabList[index]
? TranslationBase.of(context).liveCare.toUpperCase() .isLiveCareAppointment
: !model.allSpecialLabList[index].isInOutPatient ? TranslationBase.of(context)
? TranslationBase.of(context).inPatientLabel.toUpperCase() .liveCare
: TranslationBase.of(context).outpatient.toUpperCase(), .toUpperCase()
: !model.allSpecialLabList[index]
.isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -136,17 +157,24 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
context, context,
FadePage( FadePage(
page: SpecialLabResultDetailsPage( page: SpecialLabResultDetailsPage(
resultData: model.allSpecialLabList[index].resultDataHTML, resultData: model.allSpecialLabList[index]
.resultDataHTML,
patient: patient, patient: patient,
), ),
), ),
), ),
doctorName: model.allSpecialLabList[index].doctorName, doctorName:
invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', model.allSpecialLabList[index].doctorName,
profileUrl: model.allSpecialLabList[index].doctorImageURL, invoiceNO:
branch: model.allSpecialLabList[index].projectName, ' ${model.allSpecialLabList[index].invoiceNo}',
clinic: model.allSpecialLabList[index].clinicDescription, profileUrl: model
appointmentDate: model.allSpecialLabList[index].orderDate, .allSpecialLabList[index].doctorImageURL,
branch:
model.allSpecialLabList[index].projectName,
clinic: model
.allSpecialLabList[index].clinicDescription,
appointmentDate:
model.allSpecialLabList[index].orderDate,
orderNo: model.allSpecialLabList[index].orderNo, orderNo: model.allSpecialLabList[index].orderNo,
isShowTime: false, isShowTime: false,
), ),
@ -155,7 +183,8 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
), ),
); );
}), }),
if (model.allSpecialLabList.isEmpty && patient.patientStatusType != 43) if (model.allSpecialLabList.isEmpty &&
patient.patientStatusType != 43)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

@ -50,7 +50,8 @@ class PrescriptionsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43) if (model.prescriptionsList.isNotEmpty &&
patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -70,7 +71,8 @@ class PrescriptionsPage extends StatelessWidget {
], ],
), ),
), ),
if (patient.patientStatusType != null && patient.patientStatusType == 43) if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -90,7 +92,8 @@ class PrescriptionsPage extends StatelessWidget {
], ],
), ),
), ),
if ((patient.patientStatusType != null && patient.patientStatusType == 43) || if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
@ -105,7 +108,8 @@ class PrescriptionsPage extends StatelessWidget {
settingRoute: 'AddProcedureTabPage'), settingRoute: 'AddProcedureTabPage'),
); );
}, },
label: TranslationBase.of(context).applyForNewPrescriptionsOrder, label: TranslationBase.of(context)
.applyForNewPrescriptionsOrder,
), ),
...List.generate( ...List.generate(
model.prescriptionsList.length, model.prescriptionsList.length,
@ -114,7 +118,8 @@ class PrescriptionsPage extends StatelessWidget {
context, context,
FadePage( FadePage(
page: PrescriptionItemsPage( page: PrescriptionItemsPage(
prescriptions: model.prescriptionsList[index], prescriptions:
model.prescriptionsList[index],
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -122,16 +127,22 @@ class PrescriptionsPage extends StatelessWidget {
), ),
), ),
child: DoctorCard( child: DoctorCard(
doctorName: model.prescriptionsList[index].doctorName, doctorName:
profileUrl: model.prescriptionsList[index].doctorImageURL, model.prescriptionsList[index].doctorName,
profileUrl: model
.prescriptionsList[index].doctorImageURL,
branch: model.prescriptionsList[index].name, branch: model.prescriptionsList[index].name,
clinic: model.prescriptionsList[index].clinicDescription, clinic: model.prescriptionsList[index]
.clinicDescription,
isPrescriptions: true, isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat( appointmentDate:
model.prescriptionsList[index].appointmentDate, AppDateUtils.getDateTimeFromServerFormat(
model.prescriptionsList[index]
.appointmentDate,
), ),
))), ))),
if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) if (model.prescriptionsList.isEmpty &&
patient.patientStatusType != 43)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -142,7 +153,8 @@ class PrescriptionsPage extends StatelessWidget {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noPrescriptionsFound), child: AppText(TranslationBase.of(context)
.noPrescriptionsFound),
) )
], ],
), ),
@ -163,6 +175,7 @@ class PrescriptionsPage extends StatelessWidget {
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicationForInPatient.length, itemCount: model.medicationForInPatient.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -171,31 +184,49 @@ class PrescriptionsPage extends StatelessWidget {
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: PrescriptionItemsInPatientPage( page:
PrescriptionItemsInPatientPage(
prescriptionIndex: index, prescriptionIndex: index,
prescriptions: model.medicationForInPatient[index], prescriptions:
model.medicationForInPatient[
index],
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
startOn: AppDateUtils.getDateTimeFromServerFormat( startOn: AppDateUtils
model.medicationForInPatient[index].startDatetime, .getDateTimeFromServerFormat(
model
.medicationForInPatient[
index]
.startDatetime,
), ),
stopOn: AppDateUtils.getDateTimeFromServerFormat( stopOn: AppDateUtils
model.medicationForInPatient[index].stopDatetime, .getDateTimeFromServerFormat(
model
.medicationForInPatient[
index]
.stopDatetime,
), ),
), ),
), ),
), ),
child: InPatientDoctorCard( child: InPatientDoctorCard(
doctorName: model.medicationForInPatient[index].pHRItemDescription, doctorName: model
.medicationForInPatient[index]
.pHRItemDescription,
profileUrl: 'sss', profileUrl: 'sss',
branch: 'hamza', branch: 'hamza',
clinic: 'basheer', clinic: 'basheer',
isPrescriptions: true, isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat( appointmentDate: AppDateUtils
model.medicationForInPatient[index].prescriptionDatetime, .getDateTimeFromServerFormat(
model.medicationForInPatient[index]
.prescriptionDatetime,
), ),
createdBy: model.medicationForInPatient[index].doctorName.toString(), createdBy: model
.medicationForInPatient[index]
.doctorName
.toString(),
)); ));
}), }),
if (model.medicationForInPatient.length == 0) if (model.medicationForInPatient.length == 0)
@ -209,7 +240,8 @@ class PrescriptionsPage extends StatelessWidget {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noPrescriptionsFound), child: AppText(TranslationBase.of(context)
.noPrescriptionsFound),
) )
], ],
), ),

Loading…
Cancel
Save