Merge branch 'hussam_flutter_2' into 'flutter_2_developemt'

Hussam flutter 2

See merge request Cloud_Solution/doctor_app_flutter!897
merge-requests/898/merge
Elham Ali 4 years ago
commit 0c10d49ac7

@ -141,9 +141,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future sendActivationCodeByOTPNotificationType(
{
required int otpType}) async {
Future sendActivationCodeByOTPNotificationType({required int otpType}) async {
setState(ViewState.BusyLocal);
print(checkPatientForRegistrationModel);
print(checkPatientForRegistrationModel);
@ -181,7 +179,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
channel: 3,
// TODO Elham* loginType
loginType: 4,
logInTokenID:_patientRegistrationService.logInTokenID ,
logInTokenID: _patientRegistrationService.logInTokenID,
nationalID: checkPatientForRegistrationModel.patientIdentificationID,
patientID: 0,
mobileNo: checkPatientForRegistrationModel.patientMobileNumber.toString(),

@ -26,7 +26,10 @@ import 'package:hexcolor/hexcolor.dart';
class EndCallScreen extends StatefulWidget {
final PatiantInformtion? patient;
const EndCallScreen({Key? key, this.patient,}) : super(key: key);
const EndCallScreen({
Key? key,
this.patient,
}) : super(key: key);
@override
_EndCallScreenState createState() => _EndCallScreenState();
@ -34,7 +37,7 @@ class EndCallScreen extends StatefulWidget {
class _EndCallScreenState extends State<EndCallScreen> {
bool isInpatient = false;
PatiantInformtion ?patient;
PatiantInformtion? patient;
bool isDischargedPatient = false;
bool isSearchAndOut = false;
late String patientType;
@ -46,28 +49,26 @@ class _EndCallScreenState extends State<EndCallScreen> {
@override
void initState() {
super.initState();
if(widget.patient!=null)
patient = widget.patient;
if (widget.patient != null) patient = widget.patient;
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
if(routeArgs.containsKey('patient'))
patient = routeArgs['patient'];
if (routeArgs.containsKey('patient')) patient = routeArgs['patient'];
}
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png',
isInPatient: isInpatient,
color: Colors.green[800]!,
onTap: () async {
PatientProfileCardModel(TranslationBase.of(context).resume!,
TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png',
isInPatient: isInpatient, color: Colors.green[800]!, onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async {
await liveCareModel
.startCall(isReCall: false, vCID: patient!.vcId!)
.then((value) async {
await liveCareModel.getDoctorProfile();
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
@ -78,8 +79,13 @@ class _EndCallScreenState extends State<EndCallScreen> {
kSessionId: liveCareModel.startCallRes.openSessionID,
kApiKey: '46209962',
vcId: patient!.vcId,
isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording: false,
patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"),
isRecording: liveCareModel.startCallRes != null
? liveCareModel.startCallRes.isRecording!
: false,
patientName: patient!.fullName ??
(patient!.firstName != null
? "${patient!.firstName} ${patient!.lastName}"
: "-"),
tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID,
doctorId: liveCareModel.doctorProfile!.doctorID,
@ -92,13 +98,14 @@ class _EndCallScreenState extends State<EndCallScreen> {
await liveCareModel.endCall(
patient!.vcId!,
false,
);GifLoaderDialogUtils.hideDialog(context);
);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
}
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) async {
onCallNotRespond:
(SessionStatusModel sessionStatusModel) async {
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall(
@ -117,10 +124,12 @@ class _EndCallScreenState extends State<EndCallScreen> {
}
}, isDartIcon: true, dartIcon: DoctorApp.call),
PatientProfileCardModel(
TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png',
TranslationBase.of(context).endLC!,
TranslationBase.of(context).consultation!,
'',
'patient/vital_signs.png',
isInPatient: isInpatient,
color: Colors.red[800]!,
onTap: () {
color: Colors.red[800]!, onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?",
() async {
@ -131,14 +140,17 @@ class _EndCallScreenState extends State<EndCallScreen> {
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async {
showAlternativesDialog(context, liveCareModel,
(bool isConfirmed) async {
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCallWithCharge(patient!.vcId!, isConfirmed);
await liveCareModel.endCallWithCharge(
patient!.vcId!, isConfirmed);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
DrAppToastMsg.showSuccesToast("You successfully completed call with charge");
DrAppToastMsg.showSuccesToast(
"You successfully completed call with charge");
Navigator.of(context).pop();
Navigator.of(context).pop();
}
@ -146,34 +158,47 @@ class _EndCallScreenState extends State<EndCallScreen> {
}
});
}, isDartIcon: true, dartIcon: DoctorApp.end_consultaion),
PatientProfileCardModel(TranslationBase.of(context).sendLC!, TranslationBase.of(context).instruction!, "",
'patient/health_summary.png',
onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?",
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.sendSMSInstruction(patient!.vcId!);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
DrAppToastMsg.showSuccesToast("You successfully sent SMS instructions");
}
});
},
PatientProfileCardModel(
TranslationBase.of(context).sendLC!,
TranslationBase.of(context).instruction!,
"",
'patient/health_summary.png', onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?",
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.sendSMSInstruction(patient!.vcId!);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
DrAppToastMsg.showSuccesToast(
"You successfully sent SMS instructions");
}
});
},
isInPatient: isInpatient,
isDartIcon: true,
// isDisable: true,
dartIcon: DoctorApp.send_instruction),
PatientProfileCardModel(
TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png',
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!),
settings: RouteSettings(name: 'LivaCareTransferToAdmin'),),);
}, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin),
TranslationBase.of(context).transferTo!,
TranslationBase.of(context).admin!,
'',
'patient/health_summary.png', onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
LivaCareTransferToAdmin(patient: patient!),
settings: RouteSettings(name: 'LivaCareTransferToAdmin'),
),
);
},
isInPatient: isInpatient,
isDartIcon: true,
dartIcon: DoctorApp.transfer_to_admin),
];
return BaseView<LiveCarePatientViewModel>(
@ -182,19 +207,12 @@ class _EndCallScreenState extends State<EndCallScreen> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.patientProfile!,
backgroundColor: Theme
.of(context)
.scaffoldBackgroundColor,
appBarTitle: TranslationBase.of(context).patientProfile!,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true,
appBar: PatientProfileAppBar(
patient,
onPressed: (){
Navigator.pop(context);
},
appBar: PatientProfileAppBar(patient, onPressed: () {
Navigator.pop(context);
},
isInpatient: isInpatient,
height: (patient!.patientStatusType != null &&
patient!.patientStatusType == 43)
@ -212,7 +230,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
child: ListView(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
padding:
const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -237,7 +256,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
crossAxisCount: 3,
itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton(
itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: patient!,
patientType: patientType,
arrivalType: arrivalType,
@ -248,7 +268,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
route: cardsList[index].route,
icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient,
isDischargedPatient:
cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading,
@ -326,7 +347,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
),
actions: [
AppButton(
onPressed: (){
onPressed: () {
Navigator.of(context).pop();
okFunction(true);
},

@ -24,14 +24,15 @@ class UcafDetailScreen extends StatefulWidget {
final UcafViewModel model;
final Function changeLoadingState;
UcafDetailScreen(this.patient, this.model, {this.changeLoadingState});
UcafDetailScreen(this.patient, this.model,
{required this.changeLoadingState});
@override
_UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model);
_UcafDetailScreenState createState() =>
_UcafDetailScreenState(this.patient, this.model);
}
class _UcafDetailScreenState extends State<UcafDetailScreen> {
final PatiantInformtion patient;
final UcafViewModel model;
@ -43,17 +44,15 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
@override
void initState() {
model.saveUCAFOnTap = () async{
model.saveUCAFOnTap = () async {
widget.changeLoadingState(true);
await ucafModel.postUCAF(patient);
widget.changeLoadingState(false);
if (ucafModel.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.postUcafSuccessMsg);
TranslationBase.of(context).postUcafSuccessMsg);
Navigator.of(context).popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
return route.settings.name == PATIENTS_PROFILE;
});
} else {
DrAppToastMsg.showErrorToast(ucafModel.error);
@ -86,14 +85,17 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column(
children: [
treatmentStepsBar(context, model, screenSize, patient),
treatmentStepsBar(
context, model, screenSize, patient),
SizedBox(
height: 16,
),
...getSelectedTreatmentStepItem(context, model),
...getSelectedTreatmentStepItem(
context, model),
],
),
),
@ -107,7 +109,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
));
}
Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) {
Widget treatmentStepsBar(BuildContext _context, UcafViewModel model,
Size screenSize, PatiantInformtion patient) {
List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis ?? "".toUpperCase(),
TranslationBase.of(context).medications ?? "".toUpperCase(),
@ -115,7 +118,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
];
return Container(
height: screenSize.height * 0.070,
decoration: Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
decoration: Helpers.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
@ -127,13 +131,16 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
child: Container(
height: screenSize.height * 0.070,
decoration: Helpers.containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white),
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive ? Colors.white : Colors.black, //Colors.black,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
@ -166,17 +173,20 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
);
}
List<Widget> getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) {
List<Widget> getSelectedTreatmentStepItem(
BuildContext _context, UcafViewModel model) {
switch (_activeTap) {
case 0:
if (model.patientAssessmentList != null) {
return [
ListView.builder(itemCount: model.patientAssessmentList.length,
ListView.builder(
itemCount: model.patientAssessmentList.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return DiagnosisWidget(model, model.patientAssessmentList[index]);
return DiagnosisWidget(
model, model.patientAssessmentList[index]);
})
];
} else {
@ -187,12 +197,16 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
break;
case 1:
return [
ListView.builder(itemCount:model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0,
ListView.builder(
itemCount: model.prescriptionList != null
? model.prescriptionList!.entityList!.length
: 0,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return MedicationWidget(model, model.prescriptionList!.entityList![index]);
return MedicationWidget(
model, model.prescriptionList!.entityList![index]);
})
];
break;
@ -200,7 +214,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
if (model.orderProcedures != null) {
return [
ListView.builder(
itemCount:model.orderProcedures.length, scrollDirection: Axis.vertical,
itemCount: model.orderProcedures.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
@ -219,7 +234,6 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
];
}
}
}
class DiagnosisWidget extends StatelessWidget {
@ -230,10 +244,12 @@ class DiagnosisWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
MasterKeyModel? diagnosisType =
model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID);
MasterKeyModel? diagnosisCondition =
model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID);
MasterKeyModel? diagnosisType = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisType,
id: diagnosis.diagnosisTypeID);
MasterKeyModel? diagnosisCondition = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisCondition,
id: diagnosis.conditionID);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -21,7 +21,7 @@ class UCAFInputScreen extends StatefulWidget {
final PatiantInformtion patient;
final Function changeLoadingState;
UCAFInputScreen(this.patient, {this.changeLoadingState});
UCAFInputScreen(this.patient, {required this.changeLoadingState});
@override
_UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient);
@ -83,7 +83,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
children: [
// PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
margin: EdgeInsets.symmetric(
vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -137,7 +138,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 16,
),*/
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
@ -151,7 +153,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
),
AppText(
"BP (H/L)",
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
@ -160,7 +163,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
),
AppText(
"${model.bloodPressure}",
fontSize: SizeConfig.textMultiplier * 2,
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
@ -174,7 +178,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
children: [
AppText(
"${TranslationBase.of(context).temperature}",
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
@ -184,7 +189,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Expanded(
child: AppText(
"${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize: SizeConfig.textMultiplier * 2,
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
@ -198,13 +204,15 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 2,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).pulseBeats}:",
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
@ -213,7 +221,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
),
AppText(
"${model.hartRat}",
fontSize: SizeConfig.textMultiplier * 2,
fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
@ -225,7 +234,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 16,
),
AppText(
TranslationBase.of(context).chiefComplaintsAndSymptoms,
TranslationBase.of(context)
.chiefComplaintsAndSymptoms,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.w700,
@ -246,9 +256,12 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 8,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).instruction,
dropDownText:
Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint ?? ""),
hintText:
TranslationBase.of(context).instruction,
dropDownText: Helpers.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint ??
""),
controller: _additionalComplaintsController,
inputType: TextInputType.multiline,
enabled: false,
@ -370,29 +383,32 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
)
: model.patientChiefComplaintList != null ||
model.patientVitalSignsHistory != null
?Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
? 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(
model.patientVitalSignsHistory == null ||
model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context)
.chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal,
textAlign: TextAlign.center,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
)
],
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
model.patientVitalSignsHistory == null ||model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal,
textAlign: TextAlign.center,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
)
],
),
): Container(),
)
: Container(),
),
);
}

@ -16,9 +16,13 @@ class PageStepperWidget extends StatelessWidget {
final int stepsCount;
final int currentStepIndex;
final Size screenSize;
final List<String> stepsTitles;
final List<String>? stepsTitles;
PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize, this.stepsTitles});
PageStepperWidget(
{required this.stepsCount,
required this.currentStepIndex,
required this.screenSize,
this.stepsTitles});
@override
Widget build(BuildContext context) {
@ -33,9 +37,23 @@ class PageStepperWidget extends StatelessWidget {
children: [
for (int i = 1; i <= stepsCount; i++)
if (i == currentStepIndex)
StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,)
StepWidget(
i,
true,
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles!,
)
else
StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,)
StepWidget(
i,
false,
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles!,
)
],
)
],
@ -52,7 +70,9 @@ class StepWidget extends StatelessWidget {
final double dividerWidth;
final List<String> stepsTitles;
StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles});
StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish,
this.dividerWidth,
{required this.stepsTitles});
@override
Widget build(BuildContext context) {
@ -96,7 +116,9 @@ class StepWidget extends StatelessWidget {
child: Icon(
Icons.check,
size: 20,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.white,
color: status == StepStatus.Locked
? Color(0xFF969696)
: Colors.white,
)),
),
if (!isFinalStep)
@ -104,7 +126,9 @@ class StepWidget extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
width: dividerWidth,
height: 2,
color: status == StepStatus.Completed ? Color(0xFF359846) : Color(0xFFCCCCCC),
color: status == StepStatus.Completed
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
],
),
@ -112,7 +136,9 @@ class StepWidget extends StatelessWidget {
height: 8,
),
AppText(
stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles[index - 1]}",
stepsTitles == null
? "${TranslationBase.of(context).step} $index"
: "${stepsTitles[index - 1]}",
fontWeight: FontWeight.bold,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black,
fontFamily: 'Poppins',

@ -23,13 +23,13 @@ class UCAFPagerScreen extends StatefulWidget {
class _UCAFPagerScreenState extends State<UCAFPagerScreen>
with TickerProviderStateMixin {
PageController _controller;
late PageController _controller;
int _currentIndex = 0;
bool _isLoading = true;
PatiantInformtion patient;
String patientType;
String arrivalType;
late PatiantInformtion patient;
late String patientType;
late String arrivalType;
changePageViewIndex(pageIndex, {isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
@ -65,7 +65,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
isShowAppBar: true,
isLoading: _isLoading,
appBar: PatientProfileAppBar(patient),
appBarTitle: TranslationBase.of(context).ucaf,
appBarTitle: TranslationBase.of(context).ucaf!,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

@ -215,7 +215,7 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
.getDateTimeFromServerFormat(model
.admissionOrderList[
index]
.createdOn),
.createdOn!),
isArabic:
projectViewModel
.isArabic,
@ -241,7 +241,7 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
.getDateTimeFromServerFormat(model
.admissionOrderList[
index]
.createdOn))
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,

@ -12,7 +12,10 @@ class LineChartForDiabetic extends StatelessWidget {
final bool isOX;
LineChartForDiabetic(
{required this.title, required this.timeSeries1, required this.indexes, this.isOX= false});
{required this.title,
required this.timeSeries1,
required this.indexes,
this.isOX = false});
List<int> xAxixs = [];
List<double> yAxixs = [];
@ -93,7 +96,7 @@ class LineChartForDiabetic extends StatelessWidget {
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => TextStyle(
getTextStyles: (value) => TextStyle(
color: Colors.black,
fontSize: 10,
),
@ -121,13 +124,16 @@ class LineChartForDiabetic extends StatelessWidget {
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (value) => TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
interval: getMaxY() - getMinY() <= 500
? 50
: getMaxY() - getMinY() <= 1000
? 100
: 200,
margin: 12,
),
),
@ -226,10 +232,10 @@ class LineChartForDiabetic extends StatelessWidget {
);
List<LineChartBarData> lineChartData = [];
if(spots.isNotEmpty){
if (spots.isNotEmpty) {
lineChartData.add(lineChartBarData1);
}
if(spots2.isNotEmpty){
if (spots2.isNotEmpty) {
lineChartData.add(lineChartBarData2);
}
return lineChartData;

@ -71,21 +71,22 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
isCopyable: false,
),
CustomRow(
label: TranslationBase.of(context).dischargeDate! + ": ",
label:
TranslationBase.of(context).dischargeDate! + ": ",
value: AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn)
widget.dischargeSummary.createdOn!)
.day
.toString() +
" " +
AppDateUtils.getMonth(
AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn)
widget.dischargeSummary.createdOn!)
.month)
.toString()
.substring(0, 3) +
' ' +
AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn)
widget.dischargeSummary.createdOn!)
.year
.toString(),
isCopyable: false,
@ -140,7 +141,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
)),
new TextSpan(
text: Helpers.parseHtmlString(
widget.dischargeSummary.pastHistory),
widget.dischargeSummary.pastHistory!),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
@ -215,7 +216,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
)),
new TextSpan(
text: Helpers.parseHtmlString(widget
.dischargeSummary.conditionOnDischarge),
.dischargeSummary.conditionOnDischarge!),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
@ -252,7 +253,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
)),
new TextSpan(
text: Helpers.parseHtmlString(
widget.dischargeSummary.planedProcedure),
widget.dischargeSummary.planedProcedure!),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig

@ -91,11 +91,12 @@ class LineChartCurvedState extends State<LineChartCurved> {
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => const TextStyle(
color: Colors.black,
fontSize: 11,
),
@ -103,7 +104,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
rotateAngle: -65,
getTitles: (value) {
print(value);
DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime!);
DateTime date = AppDateUtils.convertStringToDate(
widget.labResult[value.toInt()].verifiedOnDateTime!);
if (widget.labResult.length < 8) {
if (widget.labResult.length > value.toInt()) {
return '${date.day}/ ${date.year}';
@ -111,7 +113,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
return '';
} else {
if (value.toInt() == 0) return '${date.day}/ ${date.year}';
if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}';
if (value.toInt() == widget.labResult.length - 1)
return '${date.day}/ ${date.year}';
if (xAxixs.contains(value.toInt())) {
return '${date.day}/ ${date.year}';
}
@ -122,7 +125,7 @@ class LineChartCurvedState extends State<LineChartCurved> {
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
@ -195,7 +198,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
List<FlSpot> spots = [];
for (int index = 0; index < widget.labResult.length; index++) {
try {
var resultValueDouble = double.parse(widget.labResult[index].resultValue ?? "");
var resultValueDouble =
double.parse(widget.labResult[index].resultValue ?? "");
spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) {
print(e);

@ -9,7 +9,8 @@ class LineChartCurvedLabHistory extends StatefulWidget {
final String title;
final List<LabResultHistory> labResultHistory;
LineChartCurvedLabHistory({required this.title, required this.labResultHistory});
LineChartCurvedLabHistory(
{required this.title, required this.labResultHistory});
@override
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
@ -98,7 +99,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => TextStyle(
color: Colors.black,
fontSize: 11,
),
@ -107,7 +108,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
getTitles: (value) {
print(value);
DateTime date = AppDateUtils.convertStringToDate(
widget.labResultHistory[value.toInt()].verifiedOnDateTime);
widget.labResultHistory[value.toInt()].verifiedOnDateTime!);
if (widget.labResultHistory.length < 8) {
if (widget.labResultHistory.length > value.toInt()) {
return '${date.day}/ ${date.year}';
@ -127,7 +128,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
@ -169,7 +170,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double max = 0;
widget.labResultHistory.forEach((element) {
try {
double resultValueDouble = double.parse(element.resultValue);
double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble > max) max = resultValueDouble;
} catch (e) {
print(e);
@ -182,10 +183,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double getMinY() {
double min = 0;
try {
min = double.parse(widget.labResultHistory[0].resultValue);
min = double.parse(widget.labResultHistory[0].resultValue!);
widget.labResultHistory.forEach((element) {
double resultValueDouble = double.parse(element.resultValue);
double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble < min) min = resultValueDouble;
});
} catch (e) {
@ -201,7 +202,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
for (int index = 0; index < widget.labResultHistory.length; index++) {
try {
var resultValueDouble =
double.parse(widget.labResultHistory[index].resultValue);
double.parse(widget.labResultHistory[index].resultValue!);
spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) {
print(e);

@ -68,8 +68,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
color: Colors.grey[200],
child: Column(
children: <Widget>[
model.reservationList == null ||
model.reservationList.length == 0
model.reservationList == null || model.reservationList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote!)
: Expanded(
@ -136,9 +135,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Column(
children: [
AppText(
model
.reservationList[
index]
model.reservationList[index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
@ -146,7 +143,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
.getDateTimeFromServerFormat(model
.reservationList[
index]
.createdOn),
.createdOn!),
isArabic:
projectViewModel
.isArabic,
@ -161,9 +158,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
fontSize: 14,
),
AppText(
model
.reservationList[
index]
model.reservationList[index]
.createdOn !=
null
? AppDateUtils.getHour(
@ -171,7 +166,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
.getDateTimeFromServerFormat(model
.reservationList[
index]
.createdOn))
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
@ -188,7 +183,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
AppText(
"Reservation: ",
@ -196,7 +191,9 @@ class _ProgressNoteState extends State<OperationReportScreen> {
),
Expanded(
child: AppText(
model.reservationList[index].oTReservationID.toString(),
model.reservationList[index]
.oTReservationID
.toString(),
fontSize: 10,
),
)
@ -222,7 +219,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
.getDateTimeFromServerFormat(model
.reservationList[
index]
.operationDate),
.operationDate!),
isArabic:
projectViewModel
.isArabic,

@ -100,34 +100,33 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
return BaseView<OperationReportViewModel>(
onModelReady: (model) async {
await model
.getOperationReportDetails(widget.reservation);
await model.getOperationReportDetails(widget.reservation);
OTReservationID.text = widget.reservation.oTReservationID.toString();
if (model.operationDetailsList.isNotEmpty) {
GetOperationDetailsResponseModel oldDetails =
model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis;
surgeonController.text = oldDetails.surgeon;
assistantNoteController.text = oldDetails.assistant;
operationController.text = oldDetails.operation;
inasionController.text = oldDetails.inasion;
findingController.text = oldDetails.finding;
surgeryProcedureController.text = oldDetails.surgeryProcedure;
postOpInstructionController.text = oldDetails.postOpInstruction;
complicationDetailsController.text = oldDetails.complicationDetail;
bloodLossDetailController.text = oldDetails.bloodLossDetail;
histopathSpecimenController.text = oldDetails.histopathSpecimen;
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis!;
surgeonController.text = oldDetails.surgeon!;
assistantNoteController.text = oldDetails.assistant!;
operationController.text = oldDetails.operation!;
inasionController.text = oldDetails.inasion!;
findingController.text = oldDetails.finding!;
surgeryProcedureController.text = oldDetails.surgeryProcedure!;
postOpInstructionController.text = oldDetails.postOpInstruction!;
complicationDetailsController.text = oldDetails.complicationDetail!;
bloodLossDetailController.text = oldDetails.bloodLossDetail!;
histopathSpecimenController.text = oldDetails.histopathSpecimen!;
microbiologySpecimenController.text =
oldDetails.microbiologySpecimen;
otherSpecimenController.text = oldDetails.otherSpecimen;
oldDetails.microbiologySpecimen!;
otherSpecimenController.text = oldDetails.otherSpecimen!;
scrubNurseController.text = oldDetails.scrubNurse;
circulatingNurseController.text = oldDetails.circulatingNurse;
BloodTransfusedDetailController.text =
oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist;
anasthetistController.text = oldDetails.anasthetist!;
}
},
builder: (_, model, w) => AppScaffold(
@ -530,94 +529,101 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
),
),
),
bottomSheet: model.state != ViewState.Idle?Container(height: 0,): Container(
height: 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd)! +
TranslationBase.of(context).operationReports!,
color: Color(0xff359846),
// disabled: operationReportsController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
setState(() {
isSubmitted = true;
});
if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context);
await model
.getDoctorProfile();
CreateUpdateOperationReportRequestModel
createUpdateOperationReportRequestModel =
CreateUpdateOperationReportRequestModel(
inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation
reservationNo:
widget.reservation.oTReservationID,
preOpDiagmosis:
preOpDiagmosisController.text,
postOpDiagmosis:
postOpDiagmosisNoteController.text,
surgeon: surgeonController.text,
assistant: assistantNoteController.text,
anasthetist: assistantNoteController.text,
operation: operationController.text,
finding: findingController.text,
surgeryProcedure: surgeonController.text,
postOpInstruction:
postOpInstructionController.text,
complicationDetails:
complicationDetailsController.text,
bloodLossDetail:
bloodLossDetailController.text,
histopathSpecimen:
histopathSpecimenController.text,
microbiologySpecimen:
microbiologySpecimenController.text,
otherSpecimen: otherSpecimenController.text,
scrubNurse: surgeonController.text,
circulatingNurse:
circulatingNurseController.text,
bloodTransfusedDetail:
bloodLossDetailController.text,
patientID: widget.patient.patientId,
admissionNo:
int.parse(widget.patient.admissionNo!),
createdBy: model
.doctorProfile!.doctorID!,
setupID: "010266");
await model
.updateOperationReport(
createUpdateOperationReportRequestModel);
if (model.state ==
ViewState.ErrorLocal) {
Helpers.showErrorToast(
model.error);
} else {
// await model.(
// operationReportsRequest.toJson());
DrAppToastMsg.showSuccesToast(
"Your Order added Successfully");
Navigator.of(context).pop();
}
GifLoaderDialogUtils.hideDialog(context);
}
},
bottomSheet: model.state != ViewState.Idle
? Container(
height: 0,
)
: Container(
height: 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd)! +
TranslationBase.of(context).operationReports!,
color: Color(0xff359846),
// disabled: operationReportsController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
setState(() {
isSubmitted = true;
});
if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context);
await model.getDoctorProfile();
CreateUpdateOperationReportRequestModel
createUpdateOperationReportRequestModel =
CreateUpdateOperationReportRequestModel(
inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation
reservationNo: widget
.reservation.oTReservationID,
preOpDiagmosis:
preOpDiagmosisController.text,
postOpDiagmosis:
postOpDiagmosisNoteController
.text,
surgeon: surgeonController.text,
assistant:
assistantNoteController.text,
anasthetist:
assistantNoteController.text,
operation: operationController.text,
finding: findingController.text,
surgeryProcedure:
surgeonController.text,
postOpInstruction:
postOpInstructionController.text,
complicationDetails:
complicationDetailsController
.text,
bloodLossDetail:
bloodLossDetailController.text,
histopathSpecimen:
histopathSpecimenController.text,
microbiologySpecimen:
microbiologySpecimenController
.text,
otherSpecimen:
otherSpecimenController.text,
scrubNurse: surgeonController.text,
circulatingNurse:
circulatingNurseController.text,
bloodTransfusedDetail:
bloodLossDetailController.text,
patientID: widget.patient.patientId,
admissionNo: int.parse(
widget.patient.admissionNo!),
createdBy:
model.doctorProfile!.doctorID!,
setupID: "010266");
await model.updateOperationReport(
createUpdateOperationReportRequestModel);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
} else {
// await model.(
// operationReportsRequest.toJson());
DrAppToastMsg.showSuccesToast(
"Your Order added Successfully");
Navigator.of(context).pop();
}
GifLoaderDialogUtils.hideDialog(context);
}
},
),
),
],
),
),
],
),
),
));
}

@ -35,11 +35,17 @@ class ProfileGridForInPatient extends StatelessWidget {
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital ?? "", TranslationBase.of(context).signs ?? "",
VITAL_SIGN_DETAILS, 'patient/vital_signs.png',
PatientProfileCardModel(
TranslationBase.of(context).vital ?? "",
TranslationBase.of(context).signs ?? "",
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab ?? "", TranslationBase.of(context).result ?? "",
LAB_RESULT, 'patient/lab_results.png',
PatientProfileCardModel(
TranslationBase.of(context).lab ?? "",
TranslationBase.of(context).result ?? "",
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab!,
@ -47,27 +53,51 @@ class ProfileGridForInPatient extends StatelessWidget {
ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).result!,
RADIOLOGY_PATIENT, 'patient/health_summary.png',
PatientProfileCardModel(
TranslationBase.of(context).radiology!,
TranslationBase.of(context).result!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png',
PatientProfileCardModel(
TranslationBase.of(context).patient!,
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).progress!, TranslationBase.of(context).note!, PROGRESS_NOTE,
PatientProfileCardModel(
TranslationBase.of(context).progress!,
TranslationBase.of(context).note!,
PROGRESS_NOTE,
'patient/Progress_notes.png',
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(TranslationBase.of(context).order!, TranslationBase.of(context).sheet!, ORDER_NOTE,
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).order!,
TranslationBase.of(context).sheet!,
ORDER_NOTE,
'patient/Progress_notes.png',
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!,
ORDER_PROCEDURE, 'patient/Order_Procedures.png',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY,
PatientProfileCardModel(
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).medical!, TranslationBase.of(context).report!,
PATIENT_MEDICAL_REPORT, 'patient/health_summary.png',
isInPatient: isInpatient, isDisable: false),
PatientProfileCardModel(
TranslationBase.of(context).medical!,
TranslationBase.of(context).report!,
PATIENT_MEDICAL_REPORT,
'patient/health_summary.png',
isInPatient: isInpatient,
isDisable: false),
PatientProfileCardModel(
TranslationBase.of(context).referral!,
TranslationBase.of(context).patient!,
@ -76,13 +106,19 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch,
),
PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).approvals!,
PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png',
PatientProfileCardModel(
TranslationBase.of(context).insurance!,
TranslationBase.of(context).approvals!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, DISCHARGE_SUMMARY,
'patient/patient_sick_leave.png',
isInPatient: isInpatient, )
,
PatientProfileCardModel(
TranslationBase.of(context).discharge!,
TranslationBase.of(context).report!,
DISCHARGE_SUMMARY,
'patient/patient_sick_leave.png',
isInPatient: isInpatient,
),
PatientProfileCardModel(
TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!,

@ -33,41 +33,77 @@ class ProfileGridForOther extends StatelessWidget {
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png',
PatientProfileCardModel(
TranslationBase.of(context).vital!,
TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png',
TranslationBase.of(context).lab!,
TranslationBase.of(context).result!,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab!, TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png',
PatientProfileCardModel(
TranslationBase.of(context).lab!,
TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!,
RADIOLOGY_PATIENT, 'patient/health_summary.png',
PatientProfileCardModel(
TranslationBase.of(context).radiology!,
TranslationBase.of(context).service!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png',
PatientProfileCardModel(
TranslationBase.of(context).orders!,
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY,
PatientProfileCardModel(
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png',
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG",
PATIENT_ECG, 'patient/patient_sick_leave.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!,
ORDER_PROCEDURE, 'patient/Order_Procedures.png',
PatientProfileCardModel(
TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png',
PatientProfileCardModel(
TranslationBase.of(context).insurance!,
TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png',
PatientProfileCardModel(
TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST, 'patient/ucaf.png',
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).patient!,
TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 || patient.appointmentNo == null),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).referral!,
TranslationBase.of(context).patient!,
@ -76,15 +112,21 @@ class ProfileGridForOther extends StatelessWidget {
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 || patient.appointmentNo == null,
: patient.patientStatusType != 43 ||
patient.appointmentNo == null,
),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png',
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).admission!,
TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 || patient.appointmentNo == null),
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
];
return Column(
@ -99,22 +141,23 @@ class ProfileGridForOther extends StatelessWidget {
crossAxisCount: 3,
itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: cardsList[index].nameLine1,
nameLine2: cardsList[index].nameLine2,
route: cardsList[index].route,
icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading,
isFromLiveCare: isFromLiveCare),
itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: cardsList[index].nameLine1,
nameLine2: cardsList[index].nameLine2,
route: cardsList[index].route,
icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading,
isFromLiveCare: isFromLiveCare),
),
),
],

@ -30,45 +30,87 @@ class ProfileGridForSearch extends StatelessWidget {
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png',
PatientProfileCardModel(
TranslationBase.of(context).vital!,
TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png',
TranslationBase.of(context).lab!,
TranslationBase.of(context).result!,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab!, TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png',
PatientProfileCardModel(
TranslationBase.of(context).lab!,
TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!,
RADIOLOGY_PATIENT, 'patient/health_summary.png',
PatientProfileCardModel(
TranslationBase.of(context).radiology!,
TranslationBase.of(context).service!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png',
PatientProfileCardModel(
TranslationBase.of(context).orders!,
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY,
PatientProfileCardModel(
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png',
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG",
PATIENT_ECG, 'patient/patient_sick_leave.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!,
ORDER_PROCEDURE, 'patient/Order_Procedures.png',
PatientProfileCardModel(
TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png',
PatientProfileCardModel(
TranslationBase.of(context).insurance!,
TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png',
PatientProfileCardModel(
TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST, 'patient/ucaf.png',
isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false),
PatientProfileCardModel(
TranslationBase.of(context).patient!,
TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(TranslationBase.of(context).referral!, TranslationBase.of(context).patient!,
REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png',
isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false),
PatientProfileCardModel(
TranslationBase.of(context).referral!,
TranslationBase.of(context).patient!,
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png',
isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false),
PatientProfileCardModel(
TranslationBase.of(context).admission!,
TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
];
return Column(
@ -83,7 +125,8 @@ class ProfileGridForSearch extends StatelessWidget {
crossAxisCount: 3,
itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton(
itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,

@ -18,7 +18,8 @@ import 'package:flutter/material.dart';
class MyReferralDetailScreen extends StatelessWidget {
final MyReferralPatientModel? referralPatient;
const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key);
const MyReferralDetailScreen({Key? key, this.referralPatient})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -53,7 +54,9 @@ class MyReferralDetailScreen extends StatelessWidget {
),
Expanded(
child: AppText(
(Helpers.capitalize(referralPatient!.firstName! + " " + referralPatient!.lastName!)),
(Helpers.capitalize(referralPatient!.firstName! +
" " +
referralPatient!.lastName!)),
fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -93,23 +96,32 @@ class MyReferralDetailScreen extends StatelessWidget {
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText(
referralPatient!.referralStatus != null
? model.getReferralStatusNameByCode(referralPatient!.referralStatus!, context)
? model.getReferralStatusNameByCode(
referralPatient!.referralStatus!,
context)
: "",
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
color: referralPatient!.referralStatus == 1
color: referralPatient!.referralStatus ==
1
? Color(0xffc4aa54)
: referralPatient!.referralStatus == 46 || referralPatient!.referralStatus! == 2
: referralPatient!.referralStatus ==
46 ||
referralPatient!
.referralStatus! ==
2
? Colors.green[700]
: Colors.red[700],
),
AppText(
AppDateUtils.getDayMonthYearDateFormatted(referralPatient!.referralDate!),
AppDateUtils.getDayMonthYearDateFormatted(
referralPatient!.referralDate!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
@ -118,29 +130,35 @@ class MyReferralDetailScreen extends StatelessWidget {
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).fileNumber,
TranslationBase.of(context)
.fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize:
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
"${referralPatient!.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
AppText(
AppDateUtils.getTimeHHMMA(referralPatient!.referralDate!),
AppDateUtils.getTimeHHMMA(
referralPatient!.referralDate!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
@ -149,50 +167,70 @@ class MyReferralDetailScreen extends StatelessWidget {
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).referredFrom,
TranslationBase.of(context)
.referredFrom,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
referralPatient!.targetProjectId! == referralPatient!.sourceProjectId!
? TranslationBase.of(context).sameBranch
: TranslationBase.of(context).otherBranch,
referralPatient!
.targetProjectId! ==
referralPatient!
.sourceProjectId!
? TranslationBase.of(
context)
.sameBranch
: TranslationBase.of(
context)
.otherBranch,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).remarks! + " : ",
TranslationBase.of(context)
.remarks! +
" : ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referralPatient!.referringDoctorRemarks ?? '',
referralPatient!
.referringDoctorRemarks ??
'',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
@ -204,22 +242,29 @@ class MyReferralDetailScreen extends StatelessWidget {
Row(
children: [
AppText(
referralPatient!.nationalityName != null
referralPatient!.nationalityName !=
null
? referralPatient!.nationalityName
: "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier,
fontSize:
1.4 * SizeConfig.textMultiplier,
),
referralPatient!.nationalityFlagURL != null
referralPatient!.nationalityFlagURL !=
null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
borderRadius:
BorderRadius.circular(20.0),
child: Image.network(
referralPatient!.nationalityFlagURL!,
referralPatient!
.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder:
(BuildContext ?context, Object ?exception, StackTrace? stackTrace) {
errorBuilder: (BuildContext?
context,
Object? exception,
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -232,7 +277,8 @@ class MyReferralDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 10, right: 0),
margin:
EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png',
height: 50,
@ -240,14 +286,20 @@ class MyReferralDetailScreen extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
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(referralPatient!.doctorImageURL!),
backgroundImage: NetworkImage(
referralPatient!.doctorImageURL!),
backgroundColor: Colors.transparent,
),
),
@ -255,14 +307,19 @@ class MyReferralDetailScreen extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0),
margin: EdgeInsets.only(
left: 10,
top: 25,
right: 10,
bottom: 0),
child: Column(
children: [
AppText(
referralPatient!.doctorName,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
@ -293,7 +350,8 @@ class MyReferralDetailScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox(
child: ProfileMedicalInfoWidgetSearch(
patient: model.getPatientFromReferralO(referralPatient!),
patient: model
.getPatientFromReferralO(referralPatient!),
patientType: "7",
isInpatient: false,
from: null,
@ -321,11 +379,14 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12,
disabled: model.state == ViewState.Busy,
onPressed: () async {
await model.responseReferral(referralPatient!, true);
await model.responseReferral(
referralPatient!, true);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgAccept);
model.getMyReferralOutPatientService();
Navigator.pop(context);
Navigator.pop(context);
@ -346,11 +407,14 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12,
disabled: model.state == ViewState.Busy,
onPressed: () async {
await model.responseReferral(referralPatient!, false);
await model.responseReferral(
referralPatient!, false);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgReject);
model.getMyReferralOutPatientService();
Navigator.pop(context);
Navigator.pop(context);

@ -10,7 +10,8 @@ class LineChartCurved extends StatelessWidget {
final List<TimeSeriesSales2> timeSeries;
final int indexes;
LineChartCurved({required this.title, required this.timeSeries, required this.indexes});
LineChartCurved(
{required this.title, required this.timeSeries, required this.indexes});
List<int> xAxixs = [];
List<double> yAxixs = [];
@ -105,11 +106,12 @@ class LineChartCurved extends StatelessWidget {
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => TextStyle(
color: Colors.black,
fontSize: 10,
),
@ -129,7 +131,9 @@ class LineChartCurved extends StatelessWidget {
return '';
}
} else {
if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) {
if (value.toInt() == 0 ||
value.toInt() == timeSeries.length - 1 ||
xAxixs.contains(value.toInt())) {
DateTime dateTime = timeSeries[value.toInt()].time;
if (isDatesSameYear) {
return monthFormat.format(dateTime);
@ -159,7 +163,7 @@ class LineChartCurved extends StatelessWidget {
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
@ -235,7 +239,9 @@ class LineChartCurved extends StatelessWidget {
int previousDateYear = 0;
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) {
if (isDatesSameYear == false ||
(previousDateYear != 0 &&
previousDateYear != timeSeries[index].time.year)) {
isDatesSameYear = false;
}
previousDateYear = timeSeries[index].time.year;

@ -58,7 +58,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
padding:
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
@ -77,12 +78,15 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
Container(
width: 20,
height: 20,
decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Theme.of(context).primaryColor),
),
SizedBox(
width: 5,
),
AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng)
AppText(
isOX ? "SAO2" : TranslationBase.of(context).systolicLng)
],
),
SizedBox(
@ -93,7 +97,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
Container(
width: 20,
height: 20,
decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red),
decoration: BoxDecoration(
shape: BoxShape.rectangle, color: Colors.red),
),
SizedBox(
width: 5,
@ -129,11 +134,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => TextStyle(
color: Colors.black,
fontSize: 10,
),
@ -160,7 +166,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (context, value) => TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,

@ -20,7 +20,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
int? projectID;
bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
VitalSignDetailsScreen(
{this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override
Widget build(BuildContext context) {
@ -35,7 +36,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
String assetBasePath = "${imageBasePath}patient/vital_signs/";
return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient),
onModelReady: (model) =>
model.getPatientVitalSignHistory(patient, from, to, isInpatient),
builder: (_, mode, widget) => AppScaffold(
baseViewModel: mode,
isShowAppBar: true,
@ -74,7 +76,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.23,
width: double.infinity,
padding: EdgeInsets.all(12.0),
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
@ -98,13 +101,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 1
? '${assetBasePath}underweight_BMI.png'
: '${assetBasePath}underweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
height: MediaQuery.of(context)
.size
.height *
0.10,
),
const SizedBox(
height: 4,
@ -112,28 +119,38 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiUnderWeight}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
fontSize:
SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontWeight: FontWeight.w700,
),
AppText(
"(<18.5)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
fontSize:
SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontWeight: FontWeight.w700,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 2
? '${assetBasePath}health_BMI.png'
: '${assetBasePath}health_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
height: MediaQuery.of(context)
.size
.height *
0.10,
),
const SizedBox(
height: 4,
@ -142,29 +159,40 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText(
"${TranslationBase.of(context).normal}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize:
SizeConfig.textMultiplier *
1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
),
),
AppText(
"(18.5-24.9)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 3
? '${assetBasePath}ovrweight_BMI.png'
: '${assetBasePath}ovrweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
height: MediaQuery.of(context)
.size
.height *
0.10,
),
const SizedBox(
height: 4,
@ -172,28 +200,38 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiOverWeight}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155,
fontSize:
SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
),
AppText(
"(25-29.9)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155,
fontSize:
SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 4
? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
height: MediaQuery.of(context)
.size
.height *
0.10,
),
const SizedBox(
height: 4,
@ -201,28 +239,38 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiObese}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
),
AppText(
"(30-34.9)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 5
? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
height: MediaQuery.of(context)
.size
.height *
0.10,
),
const SizedBox(
height: 4,
@ -232,17 +280,24 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText(
"${TranslationBase.of(context).bmiObeseExtreme}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize:
SizeConfig.textMultiplier *
1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
),
),
AppText(
"(35<)",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15,
fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
),
],
)),
@ -254,7 +309,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
Expanded(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16),
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -270,10 +326,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Height,
pageTitle: TranslationBase.of(context).height,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Height,
pageTitle:
TranslationBase.of(
context)
.height,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -283,28 +345,40 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context).height!,
imagePath: "${assetBasePath}height.png",
des: TranslationBase.of(context)
.height!,
imagePath:
"${assetBasePath}height.png",
lastVal: mode.heightCm,
unit: TranslationBase.of(context).cm!,
unit: TranslationBase.of(context)
.cm!,
),
),
),
if (isNotOneAppointment)
InkWell(
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Vital Sign Details Screen",
eventAction: "Vital Sign Details",
await locator<AnalyticsService>()
.logEvent(
eventCategory:
"Vital Sign Details Screen",
eventAction:
"Vital Sign Details",
);
Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Weight,
pageTitle: TranslationBase.of(context).weight,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey:
vitalSignDetails.Weight,
pageTitle:
TranslationBase.of(
context)
.weight,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -313,9 +387,12 @@ class VitalSignDetailsScreen extends StatelessWidget {
);
},
child: VitalSignItem(
des: TranslationBase.of(context).weight!,
imagePath: "${assetBasePath}weight.png",
unit: TranslationBase.of(context).kg!,
des: TranslationBase.of(context)
.weight!,
imagePath:
"${assetBasePath}weight.png",
unit: TranslationBase.of(context)
.kg!,
lastVal: mode.weightKg,
),
),
@ -324,10 +401,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Temperature,
pageTitle: TranslationBase.of(context).temperature,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Temperature,
pageTitle:
TranslationBase.of(
context)
.temperature,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -337,10 +420,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context).temperature!,
imagePath: "${assetBasePath}temperature.png",
des: TranslationBase.of(context)
.temperature!,
imagePath:
"${assetBasePath}temperature.png",
lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context).tempC!,
unit: TranslationBase.of(context)
.tempC!,
),
),
),
@ -349,10 +435,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.heart,
pageTitle: TranslationBase.of(context).heart,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.heart,
pageTitle:
TranslationBase.of(
context)
.heart,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -361,10 +453,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).heart!,
imagePath: "${assetBasePath}heart_rate.png",
des: TranslationBase.of(context)
.heart!,
imagePath:
"${assetBasePath}heart_rate.png",
lastVal: mode.hartRat,
unit: TranslationBase.of(context).bpm!,
unit: TranslationBase.of(context)
.bpm!,
),
),
InkWell(
@ -372,10 +467,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Respiration,
pageTitle: TranslationBase.of(context).respirationRate,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Respiration,
pageTitle:
TranslationBase.of(
context)
.respirationRate,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -384,10 +485,14 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).respirationRate!,
imagePath: "${assetBasePath}respiration_rate.png",
lastVal: mode.respirationBeatPerMinute,
unit: TranslationBase.of(context).respirationSigns!,
des: TranslationBase.of(context)
.respirationRate!,
imagePath:
"${assetBasePath}respiration_rate.png",
lastVal:
mode.respirationBeatPerMinute,
unit: TranslationBase.of(context)
.respirationSigns!,
),
),
InkWell(
@ -395,10 +500,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.BloodPressure,
pageTitle: TranslationBase.of(context).bloodPressure,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.BloodPressure,
pageTitle:
TranslationBase.of(
context)
.bloodPressure,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -407,10 +518,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).bloodPressure!,
imagePath: "${assetBasePath}blood_pressure.png",
des: TranslationBase.of(context)
.bloodPressure!,
imagePath:
"${assetBasePath}blood_pressure.png",
lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias!,
unit: TranslationBase.of(context)
.sysDias!,
),
),
InkWell(
@ -418,10 +532,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Oxygenation,
pageTitle: TranslationBase.of(context).oxygenation,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Oxygenation,
pageTitle:
TranslationBase.of(
context)
.oxygenation,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -430,8 +550,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).oxygenation!,
imagePath: "${assetBasePath}oxg.png",
des: TranslationBase.of(context)
.oxygenation!,
imagePath:
"${assetBasePath}oxg.png",
lastVal: "${mode.oxygenation}%",
unit: "",
),
@ -441,10 +563,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.PainScale,
pageTitle: TranslationBase.of(context).painScale,
vitalList: mode.patientVitalSignsHistory,
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.PainScale,
pageTitle:
TranslationBase.of(
context)
.painScale,
vitalList: mode
.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -453,10 +581,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).painScale!,
imagePath: "${assetBasePath}painScale.png",
des: TranslationBase.of(context)
.painScale!,
imagePath:
"${assetBasePath}painScale.png",
lastVal: mode.painScore,
unit: TranslationBase.of(context).severe!,
unit: TranslationBase.of(context)
.severe!,
),
),
],
@ -475,7 +606,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
: Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: ErrorMessage(
error: TranslationBase.of(context).vitalSignEmptyMsg,
error: TranslationBase.of(context).vitalSignEmptyMsg!,
)),
),
);

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class CustomEditableText extends StatefulWidget {
CustomEditableText({
Key key,
Key? key,
required this.controller,
this.hint,
this.isEditable = false,
@ -15,9 +15,9 @@ class CustomEditableText extends StatefulWidget {
final TextEditingController controller;
final String hint;
final String? hint;
bool isEditable;
final bool isSubmitted;
final bool? isSubmitted;
@override
_CustomEditableTextState createState() => _CustomEditableTextState();
@ -80,7 +80,7 @@ class _CustomEditableTextState extends State<CustomEditableText> {
//TranslationBase.of(context).addoperationReports,
controller: widget.controller,
validationError:
widget.controller.text.isEmpty && widget.isSubmitted
widget.controller.text.isEmpty && widget.isSubmitted!
? TranslationBase.of(context).emptyMessage
: null,
maxLines: 1,

@ -39,12 +39,15 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'CustomEditableText.dart';
class RegisterConfirmationPatientPage extends StatefulWidget {
final OperationReportViewModel operationReportViewModel;
final PatiantInformtion patient;
final OperationReportViewModel? operationReportViewModel;
final PatiantInformtion? patient;
final PatientRegistrationViewModel model;
const RegisterConfirmationPatientPage(
{Key? key, this.operationReportViewModel, this.patient, this.model})
{Key? key,
this.operationReportViewModel,
this.patient,
required this.model})
: super(key: key);
@override
@ -55,14 +58,14 @@ class RegisterConfirmationPatientPage extends StatefulWidget {
class _RegisterConfirmationPatientPageState
extends State<RegisterConfirmationPatientPage> {
bool isSubmitted = false;
ProjectViewModel projectViewModel;
TextEditingController firstNameN;
TextEditingController middleNameN;
TextEditingController lastNameN;
TextEditingController firstNameAr;
TextEditingController middleNameAr;
TextEditingController lastNameAr;
TextEditingController emailAddressController;
ProjectViewModel? projectViewModel;
late TextEditingController firstNameN;
late TextEditingController middleNameN;
late TextEditingController lastNameN;
late TextEditingController firstNameAr;
late TextEditingController middleNameAr;
late TextEditingController lastNameAr;
late TextEditingController emailAddressController;
TextEditingController langController = TextEditingController(text: "English");
int selectedLang = 1;
@ -392,8 +395,8 @@ class _RegisterConfirmationPatientPageState
print(
widget.model.getPatientInfoResponseModel.dateOfBirth);
var dateFormat = DateFormat('MM/dd/yyyy').parse(
widget.model.getPatientInfoResponseModel.dateOfBirth);
var dateFormat = DateFormat('MM/dd/yyyy').parse(widget
.model.getPatientInfoResponseModel.dateOfBirth!);
String wellFormat =
"${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}";
print(
@ -425,7 +428,7 @@ class _RegisterConfirmationPatientPageState
strDateofBirth: dateFormat.toUtc().toString(),
dateofBirth: AppDateUtils.convertToServerFormat(
widget.model.getPatientInfoResponseModel
.dateOfBirth,
.dateOfBirth!,
'MM/dd/yyyy'),
dateofBirthN: '$hijriDate',
gender: (widget.model.getPatientInfoResponseModel.gender == "M")

@ -20,7 +20,7 @@ class RegisterPatientPage extends StatefulWidget {
class _RegisterPatientPageState extends State<RegisterPatientPage>
with TickerProviderStateMixin {
PageController _controller;
late PageController _controller;
int _currentIndex = 0;
bool _isLoading = false;
@ -61,7 +61,7 @@ class _RegisterPatientPageState extends State<RegisterPatientPage>
isShowAppBar: true,
isLoading: _isLoading,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).registeraPatient,
title: TranslationBase.of(context).registeraPatient!,
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -30,7 +30,7 @@ class RegisterSearchPatientPage extends StatefulWidget {
final PatientRegistrationViewModel model;
const RegisterSearchPatientPage(
{Key? key, this.changePageViewIndex, this.model})
{Key? key, required this.changePageViewIndex, required this.model})
: super(key: key);
@override
@ -191,9 +191,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
title: AppText("Gregorian"),
value: CalenderType.Gregorian,
groupValue: calenderType,
onChanged: (CalenderType value) {
onChanged: (CalenderType? value) {
setState(() {
calenderType = value;
calenderType = value!;
});
},
),
@ -203,9 +203,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
title: AppText("Hijri"),
value: CalenderType.Hijri,
groupValue: calenderType,
onChanged: (CalenderType value) {
onChanged: (CalenderType? value) {
setState(() {
calenderType = value;
calenderType = value!;
});
},
),
@ -221,9 +221,10 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
dropDownText: getBirthdate(),
enabled: false,
isTextFieldHasSuffix: true,
validationError: _birthDateInGregorian == null && isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
validationError:
_birthDateInGregorian == null && isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
suffixIcon: IconButton(
icon: Icon(
Icons.calendar_today,
@ -240,17 +241,18 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
setState(() {
if (calenderType == CalenderType.Hijri) {
birthDateInHijri = selectedDate;
_birthDateInGregorian = HijriCalendar().hijriToGregorian(
birthDateInHijri.hYear,
birthDateInHijri.hMonth,
birthDateInHijri.hDay);
_birthDateInGregorian = HijriCalendar()
.hijriToGregorian(
birthDateInHijri.hYear,
birthDateInHijri.hMonth,
birthDateInHijri.hDay);
print(_birthDateInGregorian);
print(birthDateInHijri);
} else {
_birthDateInGregorian = selectedDate;
birthDateInHijri = HijriCalendar()
.gregorianToHijri(
selectedDate.year, selectedDate.month, selectedDate.day);
.gregorianToHijri(selectedDate.year,
selectedDate.month, selectedDate.day);
print(_birthDateInGregorian);
print(birthDateInHijri);
@ -307,9 +309,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
isSubmitted = true;
});
if (country == null) {
countryError = TranslationBase.of(context).fieldRequired;
countryError = TranslationBase.of(context).fieldRequired!;
} else {
countryError = null;
countryError = "";
}
if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context);
@ -397,7 +399,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
);
if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH);
} else {
final DateTime picked = await showDatePicker(
final DateTime? picked = await showDatePicker(
context: context,
initialDate: dateTime ?? DateTime.now(),
firstDate: DateTime(DateTime.now().year - 150),
@ -432,16 +434,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
}
getBirthdate() {
if (calenderType == CalenderType.Hijri) {
return birthDateInHijri != null
? "$birthDateInHijri"
: null;
}else{
return birthDateInHijri != null ? "$birthDateInHijri" : null;
} else {
return _birthDateInGregorian != null
? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}"
: null;
}
}
}

@ -35,7 +35,8 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) {
addPrescriptionForm(context, PrescriptionViewModel model,
PatiantInformtion patient, prescription) {
showModalBottomSheet(
isScrollControlled: true,
context: context,
@ -60,7 +61,8 @@ postPrescription(
String? icdCode,
PatiantInformtion? patient,
String? patientType}) async {
PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel();
PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> prescriptionList = [];
postProcedureReqModel.appointmentNo = patient!.appointmentNo;
@ -125,7 +127,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
DateTime? selectedDate;
int? strengthChar;
GetMedicationResponseModel? _selectedMedication;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController();
TextEditingController doseController = TextEditingController();
@ -169,7 +172,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
@ -212,7 +216,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
@ -257,13 +262,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
initialChildSize: 0.98,
maxChildSize: 0.98,
minChildSize: 0.9,
builder: (BuildContext context, ScrollController scrollController) {
builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.65,
color: Color(0xffF8F8F8),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0),
child: Column(
children: [
Column(
@ -285,8 +292,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
widthFactor: 0.9,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
onTap: () {
@ -294,7 +304,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
visbiltySearch = true;
},
borderColor: Colors.white,
hintText: TranslationBase.of(context).searchMedicineNameHere,
hintText: TranslationBase.of(context)
.searchMedicineNameHere,
controller: myController,
onSaved: (value) {},
onFieldSubmitted: (value) {
@ -320,9 +331,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: <Widget>[
// TODO change it secondary button and add loading
AppButton(
title: TranslationBase.of(context).search,
title: TranslationBase.of(
context)
.search,
onPressed: () async {
await searchMedicine(context, model);
await searchMedicine(
context, model);
},
),
],
@ -331,23 +345,44 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
),
if (myController.text != '')
Container(
height: MediaQuery.of(context).size.height * 0.5,
height: MediaQuery.of(context)
.size
.height *
0.5,
child: ListView.builder(
padding: const EdgeInsets.only(top: 20),
padding: const EdgeInsets.only(
top: 20),
scrollDirection: Axis.vertical,
itemCount: model.allMedicationList == null
? 0
: model.allMedicationList.length,
itemBuilder: (BuildContext context, int index) {
itemCount:
model.allMedicationList ==
null
? 0
: model
.allMedicationList
.length,
itemBuilder:
(BuildContext context,
int index) {
return InkWell(
child: MedicineItemWidget(
label: model.allMedicationList[index].description),
label: model
.allMedicationList[
index]
.description),
onTap: () {
model.getItem(itemID: model.allMedicationList[index].itemId!);
visbiltyPrescriptionForm = true;
model.getItem(
itemID: model
.allMedicationList[
index]
.itemId!);
visbiltyPrescriptionForm =
true;
visbiltySearch = false;
_selectedMedication = model.allMedicationList[index];
uom = _selectedMedication!.uom;
_selectedMedication =
model.allMedicationList[
index];
uom = _selectedMedication!
.uom;
},
);
},
@ -366,53 +401,69 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column(
children: [
AppText(
_selectedMedication?.description ?? "",
_selectedMedication?.description ??
"",
bold: true,
),
Container(
child: Row(
children: [
AppText(
TranslationBase.of(context).orderType,
TranslationBase.of(context)
.orderType,
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFB9382C),
activeColor:
Color(0xFFB9382C),
value: 1,
groupValue: selectedType,
onChanged: (int? value) {
setSelectedType(value!);
},
),
Text(TranslationBase.of(context).regular ?? ""),
Text(TranslationBase.of(context)
.regular ??
""),
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
width: double.infinity,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width * 0.35,
width: MediaQuery.of(context)
.size
.width *
0.35,
child: AppTextFieldCustom(
height: 40,
validationError: strengthError,
validationError:
strengthError,
hintText: 'Strength',
isTextFieldHasSuffix: false,
enabled: true,
controller: strengthController,
controller:
strengthController,
onChanged: (String value) {
setState(() {
strengthChar = value.length;
strengthChar =
value.length;
});
if (strengthChar! >= 5) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).only5DigitsAllowedForStrength,
DrAppToastMsg
.showErrorToast(
TranslationBase.of(
context)
.only5DigitsAllowedForStrength,
);
}
},
inputType: TextInputType.numberWithOptions(
inputType: TextInputType
.numberWithOptions(
decimal: true,
),
),
@ -422,15 +473,23 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
),
PrescriptionTextFiled(
isSubmitted: isSubmitted,
width: MediaQuery.of(context).size.width * 0.517,
element: model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]
width: MediaQuery.of(context)
.size
.width *
0.517,
element: model
.itemMedicineListUnit
.length ==
1
? model
.itemMedicineListUnit[0]
: units,
elementError: unitError!,
keyName: 'description',
keyId: 'parameterCode',
hintText: 'Select',
elementList: model.itemMedicineListUnit,
elementList: model
.itemMedicineListUnit,
okFunction: (selectedValue) {
setState(() {
units = selectedValue;
@ -441,11 +500,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
isSubmitted: isSubmitted,
elementList: model.itemMedicineListRoute,
element: model.itemMedicineListRoute.length == 1
elementList:
model.itemMedicineListRoute,
element: model.itemMedicineListRoute
.length ==
1
? model.itemMedicineListRoute[0]
: route,
elementError: routeError!,
@ -457,44 +520,69 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
route['isDefault'] = true;
});
},
hintText: TranslationBase.of(context).route ?? "",
hintText:
TranslationBase.of(context)
.route ??
"",
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
isSubmitted: isSubmitted,
hintText: TranslationBase.of(context).frequency ?? "",
elementError: frequencyError ?? "",
element: model.itemMedicineList.length == 1
? frequency = model.itemMedicineList[0]
hintText:
TranslationBase.of(context)
.frequency ??
"",
elementError:
frequencyError ?? "",
element: model.itemMedicineList
.length ==
1
? frequency =
model.itemMedicineList[0]
: frequency,
elementList: model.itemMedicineList,
elementList:
model.itemMedicineList,
keyId: 'parameterCode',
keyName: 'description',
okFunction: (selectedValue) {
setState(() {
frequency = selectedValue;
frequency['isDefault'] = true;
if (_selectedMedication != null &&
if (_selectedMedication !=
null &&
duration != null &&
frequency != null &&
strengthController.text != null) {
strengthController.text !=
null) {
model.getBoxQuantity(
freq: frequency['parameterCode'],
duration: duration['id'],
itemCode: _selectedMedication!.itemId!,
strength: double.parse(strengthController.text));
freq: frequency[
'parameterCode'],
duration:
duration['id'],
itemCode:
_selectedMedication!
.itemId!,
strength: double.parse(
strengthController
.text));
return;
}
});
}),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
isSubmitted: isSubmitted,
hintText: TranslationBase.of(context).doseTime ?? "",
hintText:
TranslationBase.of(context)
.doseTime ??
"",
elementError: doseTimeError ?? "",
element: doseTime,
elementList: model.medicationDoseTimeList,
elementList:
model.medicationDoseTimeList,
keyId: 'id',
keyName: 'nameEn',
okFunction: (selectedValue) {
@ -502,8 +590,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTime = selectedValue;
});
}),
SizedBox(height: spaceBetweenTextFileds),
if (model.patientAssessmentList.isNotEmpty)
SizedBox(
height: spaceBetweenTextFileds),
if (model
.patientAssessmentList.isNotEmpty)
Container(
height: screenSize.height * 0.070,
width: double.infinity,
@ -511,25 +601,49 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width * 0.29,
width:
MediaQuery.of(context)
.size
.width *
0.29,
child: TextField(
decoration: textFieldSelectorDecoration(
model.patientAssessmentList[0].icdCode10ID.toString(),
indication != null ? indication['name'] : null,
false),
decoration:
textFieldSelectorDecoration(
model
.patientAssessmentList[
0]
.icdCode10ID
.toString(),
indication != null
? indication[
'name']
: null,
false),
enabled: true,
readOnly: true,
),
),
Container(
width: MediaQuery.of(context).size.width * 0.59,
width:
MediaQuery.of(context)
.size
.width *
0.59,
color: Colors.white,
child: TextField(
maxLines: 5,
decoration: textFieldSelectorDecoration(
model.patientAssessmentList[0].asciiDesc.toString(),
indication != null ? indication['name'] : null,
false),
decoration:
textFieldSelectorDecoration(
model
.patientAssessmentList[
0]
.asciiDesc
.toString(),
indication != null
? indication[
'name']
: null,
false),
enabled: true,
readOnly: true,
),
@ -537,48 +651,66 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: () => selectDate(context, widget.model),
onTap: () => selectDate(
context, widget.model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).date ?? "",
selectedDate != null
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
decoration:
textFieldSelectorDecoration(
TranslationBase.of(
context)
.date ??
"",
selectedDate != null
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
isSubmitted: isSubmitted,
element: duration,
elementError: durationError ?? "",
hintText: TranslationBase.of(context).duration ?? "",
elementList: model.medicationDurationList,
hintText:
TranslationBase.of(context)
.duration ??
"",
elementList:
model.medicationDurationList,
keyName: 'nameEn',
keyId: 'id',
okFunction: (selectedValue) {
setState(() {
duration = selectedValue;
if (_selectedMedication != null &&
if (_selectedMedication !=
null &&
duration != null &&
frequency != null &&
strengthController.text != null) {
strengthController.text !=
null) {
model.getBoxQuantity(
freq: frequency['parameterCode'],
freq: frequency[
'parameterCode'],
duration: duration['id'],
itemCode: _selectedMedication!.itemId!,
strength: double.parse(strengthController.text),
itemCode:
_selectedMedication!
.itemId!,
strength: double.parse(
strengthController
.text),
);
box = model.boxQuintity;
@ -587,38 +719,53 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
});
},
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
color: Colors.white,
child: AppTextFieldCustom(
hintText: "UOM",
isTextFieldHasSuffix: false,
dropDownText: uom != null ? uom : null,
dropDownText:
uom != null ? uom : null,
enabled: false,
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
color: Colors.white,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).boxQuantity,
hintText:
TranslationBase.of(context)
.boxQuantity,
isTextFieldHasSuffix: false,
dropDownText: box != null ? model.boxQuintity.toString() : null,
dropDownText: box != null
? model.boxQuintity.toString()
: null,
enabled: false,
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
child: Stack(
children: [
TextFields(
maxLines: 6,
minLines: 4,
hintText: TranslationBase.of(context).instruction,
controller: instructionController,
hintText: TranslationBase.of(
context)
.instruction,
controller:
instructionController,
//keyboardType: TextInputType.number,
),
Positioned(
@ -631,51 +778,77 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
size: 35,
),
onPressed: () {
initSpeechState().then((value) => {onVoiceText()});
initSpeechState().then(
(value) =>
{onVoiceText()});
},
),
),
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
color: Color(0xff359846),
title: TranslationBase.of(context).addMedication,
title: TranslationBase.of(
context)
.addMedication,
fontWeight: FontWeight.w600,
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Prescription Form",
eventAction: "Add Prescription",
await locator<
AnalyticsService>()
.logEvent(
eventCategory:
"Add Prescription Form",
eventAction:
"Add Prescription",
);
if (duration != null &&
doseTime != null &&
frequency != null &&
selectedDate != null &&
strengthController.text != "") {
if (_selectedMedication!.isNarcotic == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context)
.narcoticMedicineCanOnlyBePrescribedFromVida);
strengthController
.text !=
"") {
if (_selectedMedication!
.isNarcotic ==
true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.narcoticMedicineCanOnlyBePrescribedFromVida);
// Navigator.pop(context);
return;
}
if (double.parse(strengthController.text) > 1000.0) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
if (double.parse(
strengthController
.text) >
1000.0) {
DrAppToastMsg
.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (double.parse(strengthController.text) < 0.0) {
DrAppToastMsg.showErrorToast("strength can't be zero");
if (double.parse(
strengthController
.text) <
0.0) {
DrAppToastMsg
.showErrorToast(
"strength can't be zero");
return;
}
if (formKey.currentState!.validate()) {
if (formKey.currentState!
.validate()) {
Navigator.pop(context);
openDrugToDrug(model);
{
@ -765,39 +938,60 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
setState(() {
isSubmitted = true;
if (duration == null) {
durationError = TranslationBase.of(context).fieldRequired;
durationError =
TranslationBase.of(
context)
.fieldRequired;
} else {
durationError = "";
}
if (doseTime == null) {
doseTimeError = TranslationBase.of(context).fieldRequired;
doseTimeError =
TranslationBase.of(
context)
.fieldRequired;
} else {
doseTimeError = "";
}
if (route == null) {
routeError = TranslationBase.of(context).fieldRequired;
routeError =
TranslationBase.of(
context)
.fieldRequired;
} else {
routeError = "";
}
if (frequency == null) {
frequencyError = TranslationBase.of(context).fieldRequired;
frequencyError =
TranslationBase.of(
context)
.fieldRequired;
} else {
frequencyError = "";
}
if (units == null) {
unitError = TranslationBase.of(context).fieldRequired;
unitError =
TranslationBase.of(
context)
.fieldRequired;
} else {
unitError = "";
}
if (strengthController.text == "") {
strengthError = TranslationBase.of(context).fieldRequired;
if (strengthController
.text ==
"") {
strengthError =
TranslationBase.of(
context)
.fieldRequired;
} else {
strengthError = "";
}
});
}
formKey.currentState!.save();
formKey.currentState!
.save();
},
),
],
@ -840,7 +1034,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}
}
InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown,
InputDecoration textFieldSelectorDecoration(
String? hintText, String? selectedText, bool isDropDown,
{Icon? suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
@ -891,7 +1086,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
DrugToDrug(widget.patient, getPriscriptionforDrug(widget.prescriptionList, model),
DrugToDrug(
widget.patient,
getPriscriptionforDrug(widget.prescriptionList, model),
model.patientAssessmentList),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
@ -902,23 +1099,28 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
postPrescription(
icdCode: model.patientAssessmentList.isNotEmpty
? model.patientAssessmentList[0].icdCode10ID.isEmpty
? model.patientAssessmentList[0].icdCode10ID
.isEmpty
? "test"
: model.patientAssessmentList[0].icdCode10ID.toString()
: model.patientAssessmentList[0].icdCode10ID
.toString()
: "test",
dose: strengthController.text,
doseUnit: model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['parameterCode'].toString()
? model.itemMedicineListUnit[0]['parameterCode']
.toString()
: units['parameterCode'].toString(),
patient: widget.patient,
doseTimeIn: doseTime['id'].toString(),
model: widget.model,
duration: duration['id'].toString(),
frequency: model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode'].toString()
? model.itemMedicineList[0]['parameterCode']
.toString()
: frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString()
? model.itemMedicineListRoute[0]['parameterCode']
.toString()
: route['parameterCode'].toString(),
drugId: _selectedMedication!.itemId.toString(),
strength: strengthController.text,
@ -937,7 +1139,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
});
}
getPriscriptionforDrug(List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
getPriscriptionforDrug(
List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
var prescriptionDetails = [];
if (prescriptionList.length > 0) {
prescriptionList[0].entityList!.forEach((element) {

File diff suppressed because it is too large Load Diff

@ -35,7 +35,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
version: "2.8.2"
autocomplete_textfield:
dependency: "direct main"
description:
@ -154,7 +154,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
@ -769,7 +769,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
@ -1173,7 +1173,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.4.3"
timing:
dependency: transitive
description:
@ -1257,7 +1257,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
video_player:
dependency: transitive
description:

Loading…
Cancel
Save