fix Prescriptions Service and design issues

merge-update-with-lab-changes
Mohammad Aljammal 5 years ago committed by Mohammad Aljammal
parent 62b923b25e
commit 2f77592bac

@ -1192,4 +1192,8 @@ const Map localizedValues = {
"en": "Dr. ", "en": "Dr. ",
"ar": "الدكتور." "ar": "الدكتور."
}, },
"sendSuc":{
"en":"A copy has been sent to the email",
"ar":"تم إرسال نسخة إلى البريد الإلكتروني"
},
}; };

@ -82,7 +82,7 @@ class RequestPrescriptionReport {
data['EpisodeID'] = this.episodeID; data['EpisodeID'] = this.episodeID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
// data['DischargeNo'] = this.dischargeNo; data['DischargeNo'] = this.dischargeNo;
return data; return data;
} }
} }

@ -72,6 +72,7 @@ class PrescriptionsService extends BaseService {
prescriptionReportEnhList.clear(); prescriptionReportEnhList.clear();
if(prescriptions.isInOutPatient){ if(prescriptions.isInOutPatient){
response['ListPRM'].forEach((prescriptions) { response['ListPRM'].forEach((prescriptions) {
prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions));
}); });
}else{ }else{

@ -119,6 +119,7 @@ class PrescriptionsViewModel extends BaseViewModel {
int patientID, int patientID,
String clinicName, String clinicName,
String doctorName, String doctorName,
String mes,
int projectID}) async { int projectID}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _prescriptionsService.sendPrescriptionEmail( await _prescriptionsService.sendPrescriptionEmail(
@ -128,7 +129,7 @@ class PrescriptionsViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
} else { } else {
AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); AppToast.showSuccessToast(message: mes);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -80,7 +80,7 @@ class RadiologyViewModel extends BaseViewModel {
} }
sendRadReportEmail( sendRadReportEmail(
{FinalRadiology finalRadiology}) async { {FinalRadiology finalRadiology,String mes}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _radiologyService.sendRadReportEmail( await _radiologyService.sendRadReportEmail(
finalRadiology: finalRadiology finalRadiology: finalRadiology
@ -89,7 +89,7 @@ class RadiologyViewModel extends BaseViewModel {
error = _radiologyService.error; error = _radiologyService.error;
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
} else { } else {
AppToast.showSuccessToast(message: 'A copy has been sent to the email'); AppToast.showSuccessToast(message: mes);
} }
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -63,6 +63,7 @@ class PrescriptionItemsPage extends StatelessWidget {
height: 70, height: 70,
), ),
), ),
SizedBox(width: 10,),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@ -121,6 +122,7 @@ class PrescriptionItemsPage extends StatelessWidget {
height: 70, height: 70,
), ),
), ),
SizedBox(width: 10,),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@ -133,6 +135,11 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
), ),
), ),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
], ],
), ),
), ),
@ -157,6 +164,7 @@ class PrescriptionItemsPage extends StatelessWidget {
patientID: prescriptions.patientID, patientID: prescriptions.patientID,
clinicName: prescriptions.companyName, clinicName: prescriptions.companyName,
doctorName: prescriptions.doctorName, doctorName: prescriptions.doctorName,
mes: TranslationBase.of(context).sendSuc,
projectID: prescriptions.projectID), projectID: prescriptions.projectID),
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
), ),

@ -60,6 +60,7 @@ class RadiologyDetailsPage extends StatelessWidget {
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Button( child: Button(
onTap: () => model.sendRadReportEmail( onTap: () => model.sendRadReportEmail(
mes: TranslationBase.of(context).sendSuc,
finalRadiology: finalRadiology), finalRadiology: finalRadiology),
label: TranslationBase.of(context).sendCopyRad, label: TranslationBase.of(context).sendCopyRad,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,

@ -146,7 +146,7 @@ class PharmaciesList extends StatelessWidget {
child: InkWell( child: InkWell(
child: Icon( child: Icon(
Icons.phone, Icons.phone,
color: Colors.red, color: Theme.of(context).primaryColor,
), ),
onTap: () => launch("tel://" + onTap: () => launch("tel://" +
model.pharmacyList[index].phoneNumber), model.pharmacyList[index].phoneNumber),
@ -157,7 +157,7 @@ class PharmaciesList extends StatelessWidget {
child: InkWell( child: InkWell(
child: Icon( child: Icon(
Icons.local_pharmacy, Icons.local_pharmacy,
color: Colors.red, color: Theme.of(context).primaryColor,
), ),
onTap: () { onTap: () {
MapsLauncher.launchCoordinates( MapsLauncher.launchCoordinates(

@ -949,6 +949,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get notActive => localizedValues['not-active'][locale.languageCode]; String get notActive => localizedValues['not-active'][locale.languageCode];
String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode];
String get dr => localizedValues['Dr'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode];
String get sendSuc => localizedValues['sendSuc'][locale.languageCode];
} }

@ -50,6 +50,7 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
), ),
), ),
), ),
SizedBox(width: 10,),
Expanded( Expanded(
child: Center( child: Center(
child: Padding( child: Padding(

Loading…
Cancel
Save