merge-requests/487/head
Sultan Khan 5 years ago
commit 148ea967fb

@ -112,9 +112,9 @@ class PrescriptionService extends LookupService {
}, body: _drugRequestModel.toJson()); }, body: _drugRequestModel.toJson());
} }
Future getMedicationList() async { Future getMedicationList({String drug}) async {
hasError = false; hasError = false;
_drugRequestModel.search = [""]; _drugRequestModel.search = ["$drug"];
await baseAppClient.post(SEARCH_DRUG, await baseAppClient.post(SEARCH_DRUG,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
allMedicationList = []; allMedicationList = [];

@ -15,7 +15,7 @@ class MedicineViewModel extends BaseViewModel {
PrescriptionService _prescriptionService = locator<PrescriptionService>(); PrescriptionService _prescriptionService = locator<PrescriptionService>();
get pharmacyItemsList => _medicineService.pharmacyItemsList; get pharmacyItemsList => _medicineService.pharmacyItemsList;
get searchText=>_medicineService.searchText; get searchText => _medicineService.searchText;
get pharmaciesList => _medicineService.pharmaciesList; get pharmaciesList => _medicineService.pharmaciesList;
get medicationStrengthList => _prescriptionService.medicationStrengthList; get medicationStrengthList => _prescriptionService.medicationStrengthList;
@ -34,7 +34,6 @@ class MedicineViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => List<GetAssessmentResModel> get patientAssessmentList =>
_prescriptionService.patientAssessmentList; _prescriptionService.patientAssessmentList;
List<GetMedicationResponseModel> get allMedicationList => List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList; _prescriptionService.allMedicationList;
List<dynamic> get itemMedicineList => _prescriptionService.itemMedicineList; List<dynamic> get itemMedicineList => _prescriptionService.itemMedicineList;
@ -55,6 +54,18 @@ class MedicineViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPrescription({int mrn}) async {
//hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _prescriptionService.getPrescription(mrn: mrn);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getMedicineItem(String itemName) async { Future getMedicineItem(String itemName) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _medicineService.getMedicineItem(itemName); await _medicineService.getMedicineItem(itemName);
@ -65,9 +76,9 @@ class MedicineViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMedicationList() async { Future getMedicationList({String drug}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getMedicationList(); await _prescriptionService.getMedicationList(drug: drug);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -95,9 +95,9 @@ class PrescriptionViewModel extends BaseViewModel {
} }
} }
Future getMedicationList() async { Future getMedicationList({String drug}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getMedicationList(); await _prescriptionService.getMedicationList(drug: drug);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -249,7 +249,7 @@ class PrescriptionViewModel extends BaseViewModel {
await _prescriptionsService.getPrescriptions(patient); await _prescriptionsService.getPrescriptions(patient);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
if(patientType=="7") if (patientType == "7")
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else else
setState(ViewState.Error); setState(ViewState.Error);

@ -115,164 +115,139 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(onModelReady: (model) async {
onModelReady: (model) async { // if (model.allMedicationList.length == 0)
// if (model.allMedicationList.length == 0) // await model.getMedicationList();
// await model.getMedicationList(); }, builder: (_, model, w) {
}, myController.text = model.searchText;
builder: (_, model, w) { return AppScaffold(
myController.text =model.searchText; // baseViewModel: model,
return AppScaffold( isShowAppBar: false,
// baseViewModel: model, appBarTitle: TranslationBase.of(context).searchMedicine,
isShowAppBar: false, body: SingleChildScrollView(
appBarTitle: TranslationBase.of(context).searchMedicine, child: FractionallySizedBox(
body: SingleChildScrollView( widthFactor: 0.97,
child: FractionallySizedBox( child: SingleChildScrollView(
widthFactor: 0.97, child: Container(
child: SingleChildScrollView( // height: SizeConfig.screenHeight,
child: Container( child: Column(
// height: SizeConfig.screenHeight, mainAxisAlignment: MainAxisAlignment.start,
child: Column( children: <Widget>[
mainAxisAlignment: MainAxisAlignment.start, SizedBox(
children: <Widget>[ height: SizeConfig.screenHeight * .16,
SizedBox( ),
height: SizeConfig.screenHeight * .16, FractionallySizedBox(
), widthFactor: 0.9,
FractionallySizedBox( child: Container(
widthFactor: 0.9, decoration: BoxDecoration(
child: Container( borderRadius: BorderRadius.all(Radius.circular(6.0)),
decoration: BoxDecoration( border: Border.all(
borderRadius: width: 1.0, color: HexColor("#CCCCCC"))),
BorderRadius.all(Radius.circular(6.0)), padding: EdgeInsets.all(10),
border: Border.all( child: AppTextFormField(
width: 1.0, color: HexColor("#CCCCCC"))), borderColor: Colors.white,
padding: EdgeInsets.all(10), hintText:
child: AppTextFormField( TranslationBase.of(context).searchMedicineNameHere,
borderColor: Colors.white, controller: myController,
hintText: TranslationBase.of(context) onSaved: (value) {},
.searchMedicineNameHere, onFieldSubmitted: (value) {
controller: myController, searchMedicine(context, model);
onSaved: (value) {}, },
onFieldSubmitted: (value) { inputFormatter: ONLY_LETTERS,
searchMedicine(context, model); ),
}, ),
inputFormatter: ONLY_LETTERS, ),
), FractionallySizedBox(
), widthFactor: 0.9,
), child: Container(
FractionallySizedBox( child: Wrap(
widthFactor: 0.9, alignment: WrapAlignment.center,
child: Container( children: <Widget>[
child: Wrap( // TODO change it secondary button and add loading
alignment: WrapAlignment.center, AppButton(
children: <Widget>[ title: TranslationBase.of(context).search,
// TODO change it secondary button and add loading onPressed: () async {
AppButton( await searchMedicine(context, model);
title: TranslationBase.of(context).search, },
onPressed: () async{
await searchMedicine(context, model);
},
),
],
),
),
),
Container(
margin: EdgeInsets.only(
left: SizeConfig.heightMultiplier * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase
.of(context)
.youCanFind +
(myController.text !=''?model.pharmacyItemsList.length
.toString():'0' )+
" " +
TranslationBase
.of(context)
.itemsInSearch,
fontWeight: FontWeight.bold,
),
],
), ),
],
),
),
),
Container(
margin:
EdgeInsets.only(left: SizeConfig.heightMultiplier * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).youCanFind +
(myController.text != ''
? model.pharmacyItemsList.length.toString()
: '0') +
" " +
TranslationBase.of(context).itemsInSearch,
fontWeight: FontWeight.bold,
), ),
SizedBox( ],
height:10, ),
), ),
if(myController.text !='') SizedBox(
Container( height: 10,
height: MediaQuery ),
.of(context) if (myController.text != '')
.size Container(
.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
child: ListView.builder( child: ListView.builder(
padding: const EdgeInsets.only(top:20), padding: const EdgeInsets.only(top: 20),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
// shrinkWrap: true, // shrinkWrap: true,
itemCount: itemCount: model.pharmacyItemsList == null
model.pharmacyItemsList == ? 0
null : model.pharmacyItemsList.length,
? 0 itemBuilder: (BuildContext context, int index) {
: model return InkWell(
.pharmacyItemsList.length, child: MedicineItemWidget(
itemBuilder: label: model.pharmacyItemsList[index]
(BuildContext context, int index) { ["ItemDescription"],
return InkWell( url: model.pharmacyItemsList[index]
child: MedicineItemWidget( ["ImageSRCUrl"],
label: model
.pharmacyItemsList[index]
["ItemDescription"],
url: model
.pharmacyItemsList[index]
["ImageSRCUrl"],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PharmaciesListScreen(
itemID: model
.pharmacyItemsList[
index]["ItemID"],
url: model
.pharmacyItemsList[
index]["ImageSRCUrl"]),
),
);
},
);
},
), ),
), onTap: () {
], Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PharmaciesListScreen(
itemID: model.pharmacyItemsList[index]
["ItemID"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"]),
),
);
},
);
},
),
), ),
)), ],
), ),
)),
), ),
);} ),
);
); });
} }
searchMedicine(context, MedicineViewModel model) async { searchMedicine(context, MedicineViewModel model) async {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
if (myController.text.isNullOrEmpty()) { if (myController.text.isNullOrEmpty()) {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
.of(context)
.typeMedicineName);
//"Type Medicine Name") //"Type Medicine Name")
return; return;
} }
if (myController.text.length < 3) { if (myController.text.length < 3) {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
.of(context)
.moreThan3Letter);
return; return;
} }

@ -419,16 +419,26 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
], ],
) )
: Container( : Center(
child: Center( child: Column(
child: AppText( crossAxisAlignment: CrossAxisAlignment.center,
model.patientVitalSigns == null children: [
? TranslationBase.of(context).vitalSignEmptyMsg SizedBox(
: TranslationBase.of(context).chiefComplaintEmptyMsg, height: 100,
fontWeight: FontWeight.normal, ),
color: HexColor("#B8382B"), Image.asset('assets/images/no-data.png'),
fontSize: SizeConfig.textMultiplier * 2.5, Padding(
), padding: const EdgeInsets.all(8.0),
child: AppText(
model.patientVitalSigns == null
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
)
],
), ),
), ),
), ),

@ -10,19 +10,14 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart';
class MyReferralDetailScreen extends StatelessWidget { class MyReferralDetailScreen extends StatelessWidget {
PendingReferral pendingReferral; PendingReferral pendingReferral;
@ -37,7 +32,7 @@ class MyReferralDetailScreen extends StatelessWidget {
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getPatientDetails( onModelReady: (model) => model.getPatientDetails(
DateUtils.convertStringToDateFormat( DateUtils.convertStringToDateFormat(
DateTime.now()/*.subtract(Duration(days: 350))*/.toString(), DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(),
"yyyy-MM-dd"), "yyyy-MM-dd"),
DateUtils.convertStringToDateFormat( DateUtils.convertStringToDateFormat(
DateTime.now().toString(), "yyyy-MM-dd"), DateTime.now().toString(), "yyyy-MM-dd"),
@ -52,14 +47,13 @@ class MyReferralDetailScreen extends StatelessWidget {
? Column( ? Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only( padding:
left: 0, right: 5, bottom: 5, top: 5), EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 50),
child: Column( child: Column(
children: [ children: [
@ -73,24 +67,238 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)), (Helpers.capitalize(model
.patientArrivalList[0]
.patientDetails
.fullName)),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
model.patientArrivalList[0].patientDetails.gender == 1 model.patientArrivalList[0].patientDetails
.gender ==
1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
) )
: Icon( : Icon(
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
]), ]),
), ),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
pendingReferral.patientDetails.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "",
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
color: pendingReferral.referralStatus != null
? pendingReferral.referralStatus == 'Pending'
? Color(0xffc4aa54)
: pendingReferral.referralStatus == 'Accepted'
? Colors.green[700]
: Colors.red[700]
: Colors.grey[500],
),
AppText(
pendingReferral.referredOn.split(" ")[0],
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Color(0XFF28353E),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
"${pendingReferral.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
AppText(
pendingReferral.referredOn.split(" ")[1],
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).referredFrom,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
pendingReferral.isReferralDoctorSameBranch
? TranslationBase.of(context).sameBranch
: TranslationBase.of(context)
.otherBranch,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).remarks + " : ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
pendingReferral.remarksFromSource,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
],
),
),
Row(
children: [
AppText(
pendingReferral
.patientDetails.nationalityName != null ? pendingReferral
.patientDetails.nationalityName : "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier,
),
pendingReferral.nationalityFlagUrl != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
pendingReferral.nationalityFlagUrl,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: SizedBox()
],
)
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset('assets/images/patient/ic_ref_arrow_up.png',
height: 50,
width: 30,
),
),
Container(
margin: EdgeInsets.only(
left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: Container(
width: 40,
height: 40,
child: CircleAvatar(
radius: 25.0,
backgroundImage: NetworkImage(pendingReferral.doctorImageUrl),
backgroundColor: Colors.transparent,
),
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column(
children: [
AppText(
pendingReferral.referredByDoctorInfo,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
),
),
],
),
],
),
),
],
),
], ],
), ),
), ),
@ -101,22 +309,10 @@ class MyReferralDetailScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
/*ProfileWelcomeWidget(
AppText(
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider
.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
height: 100,
),*/
SizedBox( SizedBox(
height: 16, height: 16,
), ),
Padding( /*Padding(
padding: padding:
const EdgeInsets.symmetric(horizontal: 16.0), const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText( child: AppText(
@ -125,23 +321,33 @@ class MyReferralDetailScreen extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
), ),*/
PatientReferralItemWidget( /*PatientReferralItemWidget(
"${pendingReferral.patientID}",
patientName: pendingReferral.patientName,
referralStatus: pendingReferral.referralStatus, referralStatus: pendingReferral.referralStatus,
isReferredTo: false, patientName: pendingReferral.patientName,
patientGender:
pendingReferral.patientDetails.gender,
referredDate:
pendingReferral.referredOn.split(" ")[0],
referredTime:
pendingReferral.referredOn.split(" ")[1],
patientID: "${pendingReferral.patientID}",
isSameBranch: isSameBranch:
pendingReferral.isReferralDoctorSameBranch, pendingReferral.isReferralDoctorSameBranch,
isReferral: true,
remark: pendingReferral.remarksFromSource,
nationality: pendingReferral
.patientDetails.nationalityName,
nationalityFlag:
pendingReferral.nationalityFlagUrl,
doctorAvatar: pendingReferral.doctorImageUrl,
referralDoctorName: referralDoctorName:
pendingReferral.referredByDoctorInfo, pendingReferral.referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark: pendingReferral.remarksFromSource, ),*/
referredOn: pendingReferral.referredOn,
patientInfo: pendingReferral,
),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 16), padding:
const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox( child: SizedBox(
child: ProfileMedicalInfoWidgetSearch( child: ProfileMedicalInfoWidgetSearch(
patient: model.patientArrivalList[0], patient: model.patientArrivalList[0],
@ -174,7 +380,9 @@ class MyReferralDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgAccept);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
} }
@ -198,7 +406,9 @@ class MyReferralDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgReject);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
} }
@ -211,26 +421,27 @@ class MyReferralDetailScreen extends StatelessWidget {
], ],
) )
: Column( : Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(left: 12.0),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText("" ,
fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
), ),
), Expanded(
]), child: AppText(
), "",
Container( fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
),
]),
),
Container(
child: Center( child: Center(
child: AppText( child: AppText(
TranslationBase.of(context).patientNoDetailErrMsg, TranslationBase.of(context).patientNoDetailErrMsg,
@ -240,8 +451,8 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
), ),
], ],
), ),
), ),
); );
} }

@ -27,9 +27,21 @@ class MyReferralPatientScreen extends StatelessWidget {
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: model.pendingReferral == null || model.pendingReferral.length == 0 body: model.pendingReferral == null || model.pendingReferral.length == 0
? Center( ? Center(
child: AppText( child: Column(
TranslationBase.of(context).referralEmptyMsg, crossAxisAlignment: CrossAxisAlignment.center,
color: Theme.of(context).errorColor, children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
), ),
) )
: SingleChildScrollView( : SingleChildScrollView(
@ -51,23 +63,34 @@ class MyReferralPatientScreen extends StatelessWidget {
}); });
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
"${model.pendingReferral[index].patientID}",
patientInfo: model.pendingReferral[index],
patientName:
model.pendingReferral[index].patientName,
referralStatus: referralStatus:
model.pendingReferral[index].referralStatus, model.pendingReferral[index].referralStatus,
isReferredTo: false, patientName:
model.pendingReferral[index].patientName,
patientGender: model
.pendingReferral[index].patientDetails.gender,
referredDate: model
.pendingReferral[index].referredOn
.split(" ")[0],
referredTime: model
.pendingReferral[index].referredOn
.split(" ")[1],
patientID:
"${model.pendingReferral[index].patientID}",
isSameBranch: model.pendingReferral[index] isSameBranch: model.pendingReferral[index]
.isReferralDoctorSameBranch, .isReferralDoctorSameBranch,
isReferral: true,
remark:
model.pendingReferral[index].remarksFromSource,
nationality: model.pendingReferral[index]
.patientDetails.nationalityName,
nationalityFlag:
model.pendingReferral[index].nationalityFlagUrl,
doctorAvatar:
model.pendingReferral[index].doctorImageUrl,
referralDoctorName: model referralDoctorName: model
.pendingReferral[index].referredByDoctorInfo, .pendingReferral[index].referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark:
model.pendingReferral[index].remarksFromSource,
referredOn: model.pendingReferral[index].referredOn,
answerFromTarget:
model.pendingReferral[index].answerFromTarget,
infoIcon: InkWell( infoIcon: InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context)

@ -113,35 +113,58 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0 model.patientReferral.length == 0
? referralForm(model, screenSize) ? referralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
"${model.patientReferral[model.patientReferral.length - 1].patientID}", referralStatus: model
.patientReferral[
model.patientReferral.length - 1]
.referralStatus,
patientName: model patientName: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.patientName, .patientName,
referralStatus: patientGender: model
"${model.patientReferral[model.patientReferral.length - 1].referralStatus}",
isReferredTo: true,
isSameBranch: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.isReferralDoctorSameBranch, .patientDetails
referralDoctorName: model .gender,
referredDate: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.referredByDoctorInfo, .referredOn
clinicDescription: null, .split(" ")[0],
referredTime: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[1],
patientID:
"${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model
.patientReferral[
model.patientReferral.length - 1]
.isReferralDoctorSameBranch,
isReferral: true,
remark: model remark: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.remarksFromSource, .remarksFromSource,
referredOn: model nationality: model
.patientReferral[
model.patientReferral.length - 1]
.patientDetails
.nationalityName,
nationalityFlag: model
.patientReferral[
model.patientReferral.length - 1]
.nationalityFlagUrl,
doctorAvatar: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.referredOn, .doctorImageUrl,
answerFromTarget: model referralDoctorName: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.answerFromTarget, .referredByDoctorInfo,
clinicDescription: null,
), ),
], ],
), ),
@ -154,24 +177,28 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
color: HexColor("#359846"), color: HexColor("#359846"),
onPressed: () { onPressed: () {
setState(() { setState(() {
if(_referTo == null){ if (_referTo == null) {
branchError = TranslationBase.of(context).fieldRequired; branchError =
}else { TranslationBase.of(context).fieldRequired;
} else {
branchError = null; branchError = null;
} }
if(_selectedBranch == null){ if (_selectedBranch == null) {
hospitalError = TranslationBase.of(context).fieldRequired; hospitalError =
}else { TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null; hospitalError = null;
} }
if(_selectedClinic == null){ if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired; clinicError =
}else { TranslationBase.of(context).fieldRequired;
} else {
clinicError = null; clinicError = null;
} }
if(_selectedDoctor == null){ if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired; doctorError =
}else { TranslationBase.of(context).fieldRequired;
} else {
doctorError = null; doctorError = null;
} }
}); });
@ -336,7 +363,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.getClinicDoctors( .getClinicDoctors(
_selectedClinic['ClinicID'].toString(), _selectedBranch['facilityId']) _selectedClinic['ClinicID'].toString(),
_selectedBranch['facilityId'])
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog(context)); GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -391,13 +419,16 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
}, },
); );
} }
: (){ : () {
if(_selectedClinic == null){ if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast("You need to select a clinic first"); DrAppToastMsg.showErrorToast(
} else if(model.doctorsList == null || model.doctorsList.length == 0){ "You need to select a clinic first");
DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); } else if (model.doctorsList == null ||
} model.doctorsList.length == 0) {
}, DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
}
},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -414,7 +445,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
), ),
onClick: (){ onClick: () {
_selectDate(context, model); _selectDate(context, model);
}, },
), ),
@ -422,8 +453,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).dietTypeRemarks,
TranslationBase.of(context).dietTypeRemarks,
controller: _remarksController, controller: _remarksController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
minLines: 4, minLines: 4,

@ -20,23 +20,27 @@ class ReferredPatientScreen extends StatelessWidget {
body: model.listMyReferredPatientModel == null || body: model.listMyReferredPatientModel == null ||
model.listMyReferredPatientModel.length == 0 model.listMyReferredPatientModel.length == 0
? Center( ? 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( child: AppText(
TranslationBase.of(context).referralEmptyMsg, TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor, color: Theme.of(context).errorColor,
), ),
) )
],
),
)
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
/*Container(
height: 75,
child: AppText(
"This is where upper view for avatar.. etc placed",
fontWeight: FontWeight.normal,
fontSize: 16,
),
),*/
const Divider( const Divider(
color: Color(0xffCCCCCC), color: Color(0xffCCCCCC),
height: 1, height: 1,
@ -46,7 +50,8 @@ class ReferredPatientScreen extends StatelessWidget {
), ),
...List.generate( ...List.generate(
model.listMyReferredPatientModel.length, model.listMyReferredPatientModel.length,
(index) => PatientReferralItemWidget( (index) =>
Container() /*PatientReferralItemWidget(
"${model.getReferredPatientItem(index).patientId}", "${model.getReferredPatientItem(index).patientId}",
patientName: patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
@ -71,7 +76,8 @@ class ReferredPatientScreen extends StatelessWidget {
null null
? DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy") ? DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy")
: null, : null,
), )*/
,
), ),
], ],
), ),

@ -1,5 +1,6 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
@ -15,11 +16,14 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -49,7 +53,8 @@ postProcedure(
DateTime doseTime, DateTime doseTime,
String doseUnit, String doseUnit,
String icdCode, String icdCode,
PatiantInformtion patient,String patientType}) async { PatiantInformtion patient,
String patientType}) async {
PostPrescriptionReqModel postProcedureReqModel = PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel(); new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List(); List<PrescriptionRequestModel> sss = List();
@ -103,6 +108,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TextEditingController frequencyController = TextEditingController(); TextEditingController frequencyController = TextEditingController();
TextEditingController indicationController = TextEditingController(); TextEditingController indicationController = TextEditingController();
TextEditingController instructionController = TextEditingController(); TextEditingController instructionController = TextEditingController();
bool visbiltyPrescriptionForm = false;
bool visbiltySearch = true;
final myController = TextEditingController();
DateTime selectedDate; DateTime selectedDate;
dynamic selectedDrug; dynamic selectedDrug;
int strengthChar; int strengthChar;
@ -198,9 +208,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
appointmentNo: widget.patient.appointmentNo); appointmentNo: widget.patient.appointmentNo);
await model.getMedicationList(); await model.getMedicationList();
await model.getMedicationStrength(); await model.getMedicationStrength();
await model.getPrescription(mrn: widget.patient.patientMRN);
await model.getMedicationDuration(); await model.getMedicationDuration();
await model.getMedicationRoute(); //await model.getMedicationRoute();
await model.getMedicationFrequency(); //await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
//await model.getMedicationIndications(); //await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
@ -231,14 +242,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0), horizontal: 12.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, //crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Column( Column(
children: [ children: [
SizedBox(height: 15,), SizedBox(
height: 15,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
'New Prescription Order', 'New Prescription Order',
@ -267,125 +281,233 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column( child: Column(
//mainAxisAlignment: MainAxisAlignment.end, //mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Container( // Container(
height: MediaQuery.of(context).size.height * // height: MediaQuery.of(context).size.height *
0.070, // 0.070,
color: Colors.white, // color: Colors.white,
child: InkWell( // child: InkWell(
onTap: model.allMedicationList != null // onTap: model.allMedicationList != null
? () { // ? () {
Helpers.hideKeyboard(context); // Helpers.hideKeyboard(context);
setState(() { // setState(() {
_selectedMedication = null; // _selectedMedication = null;
model.getItem( // model.getItem(
itemID: _selectedMedication // itemID: _selectedMedication
.itemId); // .itemId);
}); // });
} // }
: null, // : null,
child: _selectedMedication == null // child: _selectedMedication == null
? AutoCompleteTextField< // ? AutoCompleteTextField<
GetMedicationResponseModel>( // GetMedicationResponseModel>(
onFocusChanged: (__) { // onFocusChanged: (__) {
if (_selectedMedication != // if (_selectedMedication !=
null) { // null) {
model.getItem( // model.getItem(
itemID: // itemID:
_selectedMedication // _selectedMedication
.itemId); // .itemId);
uom = _selectedMedication.uom; // uom = _selectedMedication.uom;
} else { // } else {
null; // null;
} // }
if (_selectedMedication != // if (_selectedMedication !=
null && // null &&
duration != null && // duration != null &&
frequency != null && // frequency != null &&
strengthController.text != // strengthController.text !=
null) { // null) {
model.getBoxQuantity( // model.getBoxQuantity(
freq: frequency[ // freq: frequency[
'parameterCode'], // 'parameterCode'],
duration: duration['id'], // duration: duration['id'],
itemCode: // itemCode:
_selectedMedication // _selectedMedication
.itemId, // .itemId,
strength: double.parse( // strength: double.parse(
strengthController // strengthController
.text)); // .text));
box = model.boxQuintity; // box = model.boxQuintity;
//
// return;
// }
// },
// decoration:
// textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// _selectedMedication != null
// ? _selectedMedication
// .genericName
// : null,
// true,
// ),
// itemSubmitted: (item) => setState(
// () => _selectedMedication =
// item),
// key: key,
// suggestions:
// model.allMedicationList,
// itemBuilder: (context,
// suggestion) =>
// new Padding(
// child: Texts(suggestion
// .description +
// '/' +
// suggestion
// .genericName),
// padding:
// EdgeInsets.all(15.0)),
// itemSorter: (a, b) => 1,
// suggestionsAmount: 7,
// itemFilter: (suggestion, input) =>
// suggestion.genericName.toLowerCase().startsWith(
// input.toLowerCase()) ||
// suggestion.description
// .toLowerCase()
// .startsWith(input
// .toLowerCase()) ||
// suggestion.keywords
// .toLowerCase()
// .startsWith(
// input.toLowerCase()),
// )
// : TextField(
// onEditingComplete: () {
// model.getItem(
// itemID: _selectedMedication
// .itemId);
// },
// decoration: textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// _selectedMedication != null
// ? _selectedMedication
// .description +
// ('${_selectedMedication.genericName}')
// : null,
// false,
// suffixIcon:
// Icon(Icons.search)),
// enabled: false,
// ),
// ),
// ),
FractionallySizedBox(
widthFactor: 0.9,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
onTap: () {
visbiltyPrescriptionForm = false;
visbiltySearch = true;
},
borderColor: Colors.white,
hintText: TranslationBase.of(context)
.searchMedicineNameHere,
controller: myController,
onSaved: (value) {},
onFieldSubmitted: (value) {
searchMedicine(context, model);
},
inputFormatter: ONLY_LETTERS,
),
),
),
SizedBox(
height: 15.0,
),
Visibility(
visible: visbiltySearch,
child: Container(
child: Column(
children: [
FractionallySizedBox(
widthFactor: 0.8,
child: Container(
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
// TODO change it secondary button and add loading
AppButton(
title: TranslationBase.of(
context)
.search,
onPressed: () async {
await searchMedicine(
context, model);
},
),
],
),
),
),
if (myController.text != '')
Container(
height: MediaQuery.of(context)
.size
.height *
0.5,
child: ListView.builder(
padding: const EdgeInsets.only(
top: 20),
return; scrollDirection: Axis.vertical,
} // shrinkWrap: true,
}, itemCount:
decoration: model.allMedicationList ==
textFieldSelectorDecoration( null
TranslationBase.of(context) ? 0
.searchMedicineNameHere, : model
_selectedMedication != null .allMedicationList
? _selectedMedication .length,
.genericName itemBuilder:
: null, (BuildContext context,
true, int index) {
return InkWell(
child: MedicineItemWidget(
label: model
.allMedicationList[
index]
.description
// url: model
// .pharmacyItemsList[
// index]["ImageSRCUrl"],
),
onTap: () {
model.getItem(
itemID: model
.allMedicationList[
index]
.itemId);
visbiltyPrescriptionForm =
true;
visbiltySearch = false;
_selectedMedication =
model.allMedicationList[
index];
uom = _selectedMedication
.uom;
},
);
},
), ),
itemSubmitted: (item) => setState(
() => _selectedMedication =
item),
key: key,
suggestions:
model.allMedicationList,
itemBuilder: (context,
suggestion) =>
new Padding(
child: Texts(suggestion
.description +
'/' +
suggestion
.genericName),
padding:
EdgeInsets.all(15.0)),
itemSorter: (a, b) => 1,
suggestionsAmount: 7,
itemFilter: (suggestion, input) =>
suggestion.genericName.toLowerCase().startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(input
.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(
input.toLowerCase()),
)
: TextField(
onEditingComplete: () {
model.getItem(
itemID: _selectedMedication
.itemId);
},
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication
.description +
('${_selectedMedication.genericName}')
: null,
false,
suffixIcon:
Icon(Icons.search)),
enabled: false,
), ),
],
),
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds, height: spaceBetweenTextFileds,
), ),
Visibility( Visibility(
visible: _selectedMedication == null visible: visbiltyPrescriptionForm,
? false
: true,
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
@ -1142,66 +1264,75 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
if (formKey.currentState if (formKey.currentState
.validate()) { .validate()) {
Navigator.pop(context); Navigator.pop(context);
openDrugToDrug(model); //openDrugToDrug(model);
{ {
/*// var x = model // var x = model
// .patientAssessmentList // .patientAssessmentList
// .map((value) => // .map((value) =>
// value.icdCode10ID) // value.icdCode10ID)
// .toList() // .toList()
// .join(','); // .join(',');
postProcedure( postProcedure(
icdCode: model icdCode: model
.patientAssessmentList .patientAssessmentList
.isNotEmpty .isNotEmpty
? model ? model
.patientAssessmentList[ .patientAssessmentList[
0] 0]
.icdCode10ID .icdCode10ID
.isEmpty .isEmpty
? "test" ? "test"
: model : model
.patientAssessmentList[ .patientAssessmentList[
0] 0]
.icdCode10ID .icdCode10ID
.toString() .toString()
: "TEST", : "test",
// icdCode: model // icdCode: model
// .patientAssessmentList // .patientAssessmentList
// .map((value) => value // .map((value) => value
// .icdCode10ID // .icdCode10ID
// .trim()) // .trim())
// .toList() // .toList()
// .join(' '), // .join(' '),
dose: strengthController.text, dose:
doseUnit: strengthController
units['parameterCode'] .text,
.toString(), doseUnit: units[
patient: widget.patient, 'parameterCode']
doseTimeIn: .toString(),
doseTime['id'].toString(), patient:
model: widget.model, widget.patient,
duration: doseTimeIn:
duration['id'].toString(), doseTime['id']
frequency: .toString(),
frequency['parameterCode'] model: widget.model,
.toString(), duration:
route: route['parameterCode'] duration['id']
.toString(), .toString(),
drugId: _selectedMedication frequency: frequency[
.itemId 'parameterCode']
.toString(), .toString(),
strength: route: route[
strengthController.text, 'parameterCode']
indication: .toString(),
indicationController.text, drugId:
instruction: _selectedMedication
instructionController .itemId
.text, .toString(),
doseTime: selectedDate, strength:
); strengthController
*/ .text,
indication:
indicationController
.text,
instruction:
instructionController
.text,
doseTime:
selectedDate,
);
} }
} }
@ -1389,4 +1520,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} }
return prescriptionDetails; return prescriptionDetails;
} }
searchMedicine(context, MedicineViewModel model) async {
FocusScope.of(context).unfocus();
// if (myController.text.isEmpty()) {
// helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
// //"Type Medicine Name")
// return;
// }
if (myController.text.length < 3) {
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
return;
}
//GifLoaderDialogUtils.showMyDialog(context);
await model.getMedicationList(drug: myController.text);
//GifLoaderDialogUtils.hideDialog(context);
}
} }

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
@ -141,239 +142,237 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(), onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView( AppScaffold(
baseViewModel: model, isShowAppBar: false,
child: DraggableScrollableSheet( body: NetworkBaseView(
minChildSize: 0.90, baseViewModel: model,
initialChildSize: 0.95, child: DraggableScrollableSheet(
maxChildSize: 1.0, minChildSize: 0.90,
builder: (BuildContext context, ScrollController scrollController) { initialChildSize: 0.95,
return SingleChildScrollView( maxChildSize: 1.0,
child: Container( builder:
height: MediaQuery.of(context).size.height * 1.20, (BuildContext context, ScrollController scrollController) {
child: Padding( return SingleChildScrollView(
padding: EdgeInsets.all(12.0), child: Container(
child: Column( height: MediaQuery.of(context).size.height * 1.20,
crossAxisAlignment: CrossAxisAlignment.start, child: Padding(
children: [ padding: EdgeInsets.all(12.0),
Column( child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
children: [ Row(
InkWell( children: [
child: Icon( AppText(
Icons.close, 'Please Select Category',
size: 24.0, fontWeight: FontWeight.w700,
), fontSize: 20,
onTap: () { ),
Navigator.pop(context); SizedBox(
}, width: MediaQuery.of(context).size.width * 0.29,
), ),
], InkWell(
), child: Icon(
Row( Icons.close,
children: [ size: 24.0,
AppText(
'Please Select Category',
fontWeight: FontWeight.w700,
fontSize: 20,
), ),
], onTap: () {
), Navigator.pop(context);
], },
), ),
SizedBox( ],
height: 10.0,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.categoryList != null &&
model.categoryList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.categoryList,
attributeName: 'categoryName',
attributeValueId: 'categoryId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
selectedCategory = selectedValue;
model.getProcedureCategory(
categoryName: selectedCategory[
'categoryName'],
categoryID: selectedCategory[
'categoryId'] <=
9
? "0" +
selectedCategory[
'categoryId']
.toString()
: selectedCategory[
'categoryId']
.toString());
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
),
), ),
), SizedBox(
if (widget.model.categoriesList.length != 0) height: 10.0,
NetworkBaseView( ),
baseViewModel: model, Container(
child: selectedCategory != null height: screenSize.height * 0.070,
? selectedCategory['categoryId'] == 02 || child: InkWell(
selectedCategory['categoryId'] == 03 onTap: model.categoryList != null &&
? EntityListCheckboxSearchWidget( model.categoryList.length > 0
model: widget.model, ? () {
masterList: widget.model ListSelectDialog dialog =
.categoriesList[0].entityList, ListSelectDialog(
removeHistory: (item) { list: model.categoryList,
setState(() { attributeName: 'categoryName',
entityList.remove(item); attributeValueId: 'categoryId',
}); okText: TranslationBase.of(context).ok,
}, okFunction: (selectedValue) {
addHistory: (history) { setState(() {
setState(() { selectedCategory = selectedValue;
entityList.add(history); model.getProcedureCategory(
}); categoryName: selectedCategory[
}, 'categoryName'],
addSelectedHistories: () { categoryID: selectedCategory[
//TODO build your fun herr 'categoryId'] <=
// widget.addSelectedHistories(); 9
}, ? "0" +
isEntityListSelected: (master) => selectedCategory[
isEntityListSelected(master), 'categoryId']
) .toString()
: ProcedureListWidget( : selectedCategory[
model: widget.model, 'categoryId']
masterList: widget.model .toString());
.categoriesList[0].entityList, });
removeHistory: (item) { },
setState(() { );
entityList.remove(item); showDialog(
}); barrierDismissible: false,
}, context: context,
addHistory: (history) { builder: (BuildContext context) {
setState(() { return dialog;
entityList.add(history); },
}); );
}, //model.getProcedureCategory();
addSelectedHistories: () { }
//TODO build your fun herr : null,
// widget.addSelectedHistories(); child: TextField(
}, decoration: textFieldSelectorDecoration(
isEntityListSelected: (master) => TranslationBase.of(context)
isEntityListSelected(master), .procedureCategorise,
) selectedCategory != null
: null), ? selectedCategory['categoryName']
SizedBox( : null,
height: 15.0, true,
), suffixIcon: Icon(
Column( Icons.search,
mainAxisAlignment: MainAxisAlignment.spaceBetween, color: Colors.black,
children: [ )),
// Container( enabled: false,
// child: Row(
// children: [
// AppText(
// TranslationBase.of(context).orderType),
// Radio(
// activeColor: Color(0xFFB9382C),
// value: 1,
// groupValue: selectedType,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text('routine'),
// Radio(
// activeColor: Color(0xFFB9382C),
// groupValue: selectedType,
// value: 0,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text(TranslationBase.of(context).urgent),
// ],
// ),
// ),
// SizedBox(
// height: 15.0,
// ),
// TextFields(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 3,
// maxLines: 5,
// ),
SizedBox(
height: 100.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
), ),
), ),
], ),
) if (widget.model.categoriesList.length != 0)
], NetworkBaseView(
baseViewModel: model,
child: selectedCategory != null
? selectedCategory['categoryId'] == 02 ||
selectedCategory['categoryId'] == 03
? EntityListCheckboxSearchWidget(
model: widget.model,
masterList: widget.model
.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)
: ProcedureListWidget(
model: widget.model,
masterList: widget.model
.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)
: null),
SizedBox(
height: 15.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Container(
// child: Row(
// children: [
// AppText(
// TranslationBase.of(context).orderType),
// Radio(
// activeColor: Color(0xFFB9382C),
// value: 1,
// groupValue: selectedType,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text('routine'),
// Radio(
// activeColor: Color(0xFFB9382C),
// groupValue: selectedType,
// value: 0,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text(TranslationBase.of(context).urgent),
// ],
// ),
// ),
// SizedBox(
// height: 15.0,
// ),
// TextFields(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 3,
// maxLines: 5,
// ),
SizedBox(
height: 100.0,
),
],
)
],
),
), ),
), ),
), );
); }),
}), ),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
), ),
); );
} }

@ -209,39 +209,6 @@ class _AddSelectedLabOrderState extends State<AddSelectedLabOrder> {
isEntityListSelected: (master) => isEntityListSelected: (master) =>
isEntityListSelected(master), isEntityListSelected(master),
)), )),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title:
"Add Lab Order", //TranslationBase.of(context)
fontWeight: FontWeight.w700,
//.addSelectedProcedures,
color: Color(0xff359846),
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
], ],
), ),
), ),
@ -249,6 +216,37 @@ class _AddSelectedLabOrderState extends State<AddSelectedLabOrder> {
); );
}), }),
), ),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: "Add Lab Order", //TranslationBase.of(context)
fontWeight: FontWeight.w700,
//.addSelectedProcedures,
color: Color(0xff359846),
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
), ),
); );
} }

@ -169,7 +169,6 @@ class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20, fontSize: 20,
), ),
InkWell( InkWell(
child: Icon( child: Icon(
Icons.close, Icons.close,
@ -208,37 +207,6 @@ class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
isEntityListSelected: (master) => isEntityListSelected: (master) =>
isEntityListSelected(master), isEntityListSelected(master),
)), )),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'Add Radiology Order',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
)
], ],
), ),
), ),
@ -246,6 +214,36 @@ class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
); );
}), }),
), ),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'Add Radiology Order',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
), ),
); );
} }

@ -25,7 +25,8 @@ class ProcedureScreen extends StatelessWidget {
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(mrn: patient.patientId,patientType: patientType), onModelReady: (model) =>
model.getProcedure(mrn: patient.patientId, patientType: patientType),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -41,27 +42,28 @@ class ProcedureScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if(model.procedureList.length==0 && patient.patientStatusType != 43) if (model.procedureList.length == 0 &&
patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
'Order Test or', 'Order Test or',
style: "caption2", style: "caption2",
color: Colors.black, color: Colors.black,
fontSize: 13, fontSize: 13,
), ),
Texts( Texts(
'Procedure', 'Procedure',
bold: true, bold: true,
fontSize: 22, fontSize: 22,
), ),
], ],
),
), ),
), if (patient.patientStatusType == 43)
if( patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -81,10 +83,19 @@ class ProcedureScreen extends StatelessWidget {
], ],
), ),
), ),
if (patientType != null && patientType == '7' && patient.patientStatusType == 43) if (patientType != null &&
patientType == '7' &&
patient.patientStatusType == 43)
InkWell( InkWell(
onTap: () { onTap: () {
addSelectedProcedure(context, model, patient); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddSelectedProcedure(
patient: patient,
model: model,
)),
);
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
@ -143,41 +154,43 @@ class ProcedureScreen extends StatelessWidget {
patient: patient, patient: patient,
remarks: model remarks: model
.procedureList[0].entityList[index].remarks, .procedureList[0].entityList[index].remarks,
orderType: model.procedureList[0] orderType: model
.entityList[index].orderType .procedureList[0].entityList[index].orderType
.toString(), .toString(),
orderNo: model orderNo: model
.procedureList[0].entityList[index].orderNo, .procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0] procedureName: model.procedureList[0]
.entityList[index].procedureName, .entityList[index].procedureName,
categoreId: model.procedureList[0] categoreId: model
.entityList[index].categoryID .procedureList[0].entityList[index].categoryID
.toString(), .toString(),
procedureId: model.procedureList[0] procedureId: model.procedureList[0]
.entityList[index].procedureId, .entityList[index].procedureId,
limetNo: model.procedureList[0] limetNo: model.procedureList[0].entityList[index]
.entityList[index].lineItemNo); .lineItemNo);
// } else // } else
// helpers.showErrorToast( // helpers.showErrorToast(
// 'You Cant Update This Procedure'); // 'You Cant Update This Procedure');
}, },
), ),
), ),
if (model.procedureList.length!=0 && patient.patientStatusType != 43) if (model.procedureList.length != 0 &&
Center( patient.patientStatusType != 43)
child: Column( Center(
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.center,
SizedBox(height: 100,), children: [
Image.asset('assets/images/no-data.png'), SizedBox(
Padding( height: 100,
padding: const EdgeInsets.all(8.0), ),
child: Texts('No Procedure Found'), Image.asset('assets/images/no-data.png'),
) Padding(
padding: const EdgeInsets.all(8.0),
], child: Texts('No Procedure Found'),
), )
) ],
),
)
], ],
), ),
), ),

@ -11,33 +11,38 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String referralStatus;
final String patientName; final String patientName;
final int patientGender;
final String referredDate;
final String referredTime;
final String patientID; final String patientID;
final String referralStatus;
final isReferredTo;
final isSameBranch; final isSameBranch;
final bool isReferral;
final String remark;
final String nationality;
final String nationalityFlag;
final String doctorAvatar;
final String referralDoctorName; final String referralDoctorName;
final String clinicDescription; final String clinicDescription;
final String remark;
final String referredOn;
final String answerFromTarget;
final Widget infoIcon; final Widget infoIcon;
final PendingReferral patientInfo;
PatientReferralItemWidget( PatientReferralItemWidget(
this.patientID, { {this.referralStatus,
this.patientName, this.patientName,
this.referralStatus, this.patientGender,
this.isReferredTo = false, this.referredDate,
this.isSameBranch, this.referredTime,
this.referralDoctorName, this.patientID,
this.clinicDescription, this.isSameBranch,
this.remark, this.isReferral,
this.referredOn, this.remark,
this.answerFromTarget, this.nationality,
this.infoIcon, this.nationalityFlag,
this.patientInfo, this.doctorAvatar,
}); this.referralDoctorName,
this.clinicDescription,
this.infoIcon});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -47,224 +52,6 @@ class PatientReferralItemWidget extends StatelessWidget {
margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
child: Column( child: Column(
children: [ children: [
// TODO should be removed by mousa
// Row(
// children: [
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// if (referralStatus != null)
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referralStatus,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Container(
// color: Color(0xFF4BA821),
// padding: EdgeInsets.all(4),
// child: AppText(
// referralStatus
// /*referralStatus == "46"
// ? TranslationBase.of(context).approved
// : TranslationBase.of(context).rejected*/
// ,
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// isReferredTo
// ? "${TranslationBase.of(context).referTo}: "
// : "${TranslationBase.of(context).referredFrom}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// isSameBranch
// ? TranslationBase.of(context).sameBranch
// : TranslationBase.of(context).otherBranch,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// AppText(
// "${TranslationBase.of(context).referralDoctor} : ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Expanded(
// child: AppText(
// referralDoctorName != null
// ? "${TranslationBase.of(context).dr} $referralDoctorName"
// : "-",
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// if (clinicDescription != null)
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).clinic}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// clinicDescription,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).patientID}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// patientID ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).patientName}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// patientName ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// AppText(
// TranslationBase.of(context).referralRemark,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Expanded(
// child: AppText(
// remark,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referredOn,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// referredOn ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// if (answerFromTarget != null)
// SizedBox(
// height: 8,
// ),
// if (answerFromTarget != null)
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referralResponse,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// answerFromTarget != "" ? answerFromTarget : '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 16,
// ),
// ],
// ),
// ),
// if (infoIcon != null) infoIcon,
// ],
// ),
// const Divider(
// color: Color(0xffCCCCCC),
// height: 1,
// thickness: 1,
// indent: 0,
// endIndent: 0,
// ),
// SizedBox(
// height: 8,
// ),
Container( Container(
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: referralStatus != null bgColor: referralStatus != null
@ -296,7 +83,7 @@ class PatientReferralItemWidget extends StatelessWidget {
: Colors.grey[500], : Colors.grey[500],
), ),
AppText( AppText(
referredOn, referredDate,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
@ -309,7 +96,7 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
patientInfo.patientName, patientName,
fontSize: SizeConfig.textMultiplier * 2.2, fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
@ -320,7 +107,7 @@ class PatientReferralItemWidget extends StatelessWidget {
SizedBox( SizedBox(
width: 4, width: 4,
), ),
/*patient.gender*/ 1 == 1 patientGender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -333,7 +120,7 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 4, width: 4,
), ),
AppText( AppText(
referredOn, referredTime,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -359,7 +146,7 @@ class PatientReferralItemWidget extends StatelessWidget {
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
patientInfo.patientID.toString(), patientID,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -395,36 +182,25 @@ class PatientReferralItemWidget extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
/*patient.nationalityName ?? nationality != null ? nationality : "",
patient.nationality*/
"Saudi",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier, fontSize: 1.4 * SizeConfig.textMultiplier,
), ),
/* patient.nationality != null nationalityFlag != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius child: Image.network(
.circular( nationalityFlag,
20.0), height: 25,
child: Image.network( width: 30,
patient errorBuilder: (BuildContext context,
.nationalityFlagURL, Object exception,
height: 25, StackTrace stackTrace) {
width: 30, return Text('No Image');
errorBuilder: },
(BuildContext ))
context, : SizedBox()
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))*/
/*:*/ SizedBox()
], ],
) )
], ],
@ -442,7 +218,7 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
patientInfo.remarksFromSource, remark,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -457,7 +233,9 @@ class PatientReferralItemWidget extends StatelessWidget {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 0), margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
infoIcon != null ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', isReferral
? 'assets/images/patient/ic_ref_arrow_up.png'
: 'assets/images/patient/ic_ref_arrow_left.png',
height: 50, height: 50,
width: 30, width: 30,
), ),
@ -469,9 +247,10 @@ class PatientReferralItemWidget extends StatelessWidget {
child: Container( child: Container(
width: 40, width: 40,
height: 40, height: 40,
child: Image.asset( child: CircleAvatar(
'assets/images/female_avatar.png', radius: 25.0,
fit: BoxFit.cover, backgroundImage: NetworkImage(doctorAvatar),
backgroundColor: Colors.transparent,
), ),
), ),
), ),
@ -482,29 +261,13 @@ class PatientReferralItemWidget extends StatelessWidget {
left: 10, top: 25, right: 10, bottom: 0), left: 10, top: 25, right: 10, bottom: 0),
child: Column( child: Column(
children: [ children: [
RichText( AppText(
text: TextSpan( referralDoctorName,
style: TextStyle( fontFamily: 'Poppins',
fontSize: fontWeight: FontWeight.w700,
2.0 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.black), color: Color(0XFF2E303A),
children: <TextSpan>[ ),
TextSpan(
text: TranslationBase.of(context)
.referralDoctor +
" : ",
style: TextStyle(
fontSize: 14,
fontFamily: 'Poppins')),
TextSpan(
text: referralDoctorName,
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
],
),
)
], ],
), ),
), ),

@ -210,11 +210,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationality??'', patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
patient.nationality != null patient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(

@ -211,11 +211,12 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
AppText( AppText(
patient.nationalityName ?? patient.nationalityName ??
patient.nationality ?? patient.nationality ??
patient.nationalityId ??
'', '',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
patient.nationality != null patient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(

@ -100,6 +100,15 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'), icon: 'patient/order_prescription.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
icon: 'patient/Order_Procedures.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -125,16 +134,6 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
// nameLine1: TranslationBase.of(context).admission, // nameLine1: TranslationBase.of(context).admission,
// nameLine2: TranslationBase.of(context).request, // nameLine2: TranslationBase.of(context).request,
// icon: 'heartbeat.png'), // icon: 'heartbeat.png'),
if (patientType == "1")
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
], ],
), ),
); );

Loading…
Cancel
Save