fix in-patient prescription

all_special_lab_result
hussam al-habibeh 4 years ago
parent 7436cdb5be
commit 2f65546ff6

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

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

Loading…
Cancel
Save