screen fixes 4

dev_v2.8_reverting
Elham Rababh 4 years ago
parent efd4b0221b
commit f097005b8c

@ -68,9 +68,9 @@ class PatientMedicalReportViewModel extends BaseViewModel {
} }
} }
Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { Future updateMedicalReport(PatiantInformtion patient, String htmlText, dynamic limitNumber, String? invoiceNumber) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); await _service.updateMedicalReport(patient, htmlText, limitNumber!, invoiceNumber!);
if (_service.hasError) { if (_service.hasError) {
error = _service.error!; error = _service.error!;
await getMedicalReportList(patient); await getMedicalReportList(patient);

@ -1,110 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class TimeBar extends StatefulWidget {
final PatientSearchViewModel model;
final PatientType selectedPatientType;
final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo;
const TimeBar(
{Key ? key,
this.model,
this.selectedPatientType,
this.patientSearchRequestModel,
this.isSearchWithKeyInfo})
: super(key: key);
@override
_TimeBarState createState() => _TimeBarState();
}
class _TimeBarState extends State<TimeBar> {
@override
Widget build(BuildContext context) {
List _locations = [
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
];
int _activeLocation = 0;
return Container(
height: MediaQuery.of(context).size.height * 0.0619,
width: SizeConfig.screenWidth * 0.94,
decoration: BoxDecoration(
color: Color(0Xffffffff),
borderRadius: BorderRadius.circular(12.5),
// border: Border.all(
// width: 0.5,
// ),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color: _isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
onTap: () async {
setState(() {
_activeLocation = _locations.indexOf(item);
});
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.getPatientBasedOnDate(
item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel:
widget.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context);
}),
_isActive
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
}).toList(),
),
);
}
}

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
@ -8,6 +7,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -33,8 +33,8 @@ class UcafDetailScreen extends StatefulWidget {
} }
class _UcafDetailScreenState extends State<UcafDetailScreen> { class _UcafDetailScreenState extends State<UcafDetailScreen> {
PatiantInformtion patient; PatiantInformtion patient;
UcafViewModel model; UcafViewModel model;
late UcafViewModel ucafModel; late UcafViewModel ucafModel;
@ -74,48 +74,47 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16), vertical: 16, horizontal: 16),
child: Column( child: Column(
children: [ children: [
treatmentStepsBar( treatmentStepsBar(
context, model, screenSize, patient), context, model, screenSize, patient),
SizedBox( SizedBox(
height: 16, height: 16,
),
...getSelectedTreatmentStepItem(
context, model),
],
), ),
), ...getSelectedTreatmentStepItem(
], context, model),
],
),
), ),
), ],
), ),
), ),
),
],
), ),
)); ],
),
));
} }
Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Widget treatmentStepsBar(BuildContext _context, UcafViewModel model,
Size screenSize, PatiantInformtion patient) { Size screenSize, PatiantInformtion patient) {
List<String> __treatmentSteps = [ List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis.toUpperCase(), TranslationBase.of(context).diagnosis ?? "".toUpperCase(),
TranslationBase.of(context).medications.toUpperCase(), TranslationBase.of(context).medications ?? "".toUpperCase(),
TranslationBase.of(context).procedures.toUpperCase(), TranslationBase.of(context).procedures ?? "".toUpperCase(),
]; ];
return Container( return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -200,14 +199,14 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
return [ return [
ListView.builder( ListView.builder(
itemCount: model.prescriptionList != null itemCount: model.prescriptionList != null
? model.prescriptionList.entityList.length ? model.prescriptionList!.entityList!.length
: 0, : 0,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
physics: ScrollPhysics(), physics: ScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return MedicationWidget( return MedicationWidget(
model, model.prescriptionList.entityList[index]); model, model.prescriptionList!.entityList![index]);
}) })
]; ];
break; break;
@ -245,10 +244,10 @@ class DiagnosisWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
MasterKeyModel diagnosisType = model.findMasterDataById( MasterKeyModel? diagnosisType = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisType, masterKeys: MasterKeysService.DiagnosisType,
id: diagnosis.diagnosisTypeID); id: diagnosis.diagnosisTypeID);
MasterKeyModel diagnosisCondition = model.findMasterDataById( MasterKeyModel? diagnosisCondition = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisCondition, masterKeys: MasterKeysService.DiagnosisCondition,
id: diagnosis.conditionID); id: diagnosis.conditionID);
@ -265,8 +264,8 @@ class DiagnosisWidget extends StatelessWidget {
AppText( AppText(
diagnosisType != null diagnosisType != null
? model.selectedLanguage == 'ar' ? model.selectedLanguage == 'ar'
? diagnosisType.nameAr ? diagnosisType.nameAr
: diagnosisType.nameEn : diagnosisType.nameEn
: "-", : "-",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
@ -521,7 +520,7 @@ class ProceduresWidget extends StatelessWidget {
AppText( AppText(
"${procedure.isCovered}", "${procedure.isCovered}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: procedure.isCovered ? AppGlobal.appGreenColor : Colors.red, color: procedure.isCovered! ? Colors.green : Colors.red,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
SizedBox( SizedBox(

@ -261,7 +261,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
TranslationBase.of(context).instruction, TranslationBase.of(context).instruction,
dropDownText: Helpers.parseHtmlString(model dropDownText: Helpers.parseHtmlString(model
.patientChiefComplaintList[0] .patientChiefComplaintList[0]
.chiefComplaint ), .chiefComplaint! ??
""),
controller: _additionalComplaintsController, controller: _additionalComplaintsController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
enabled: false, enabled: false,

@ -19,10 +19,10 @@ class PageStepperWidget extends StatelessWidget {
final List<String> ?stepsTitles; final List<String> ?stepsTitles;
PageStepperWidget( PageStepperWidget(
{ this.stepsCount, {required this.stepsCount,
this.currentStepIndex, required this.currentStepIndex,
this.screenSize, required this.screenSize,
this.stepsTitles}); this.stepsTitles});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -63,7 +63,6 @@ class PageStepperWidget extends StatelessWidget {
} }
class StepWidget extends StatelessWidget { class StepWidget extends StatelessWidget {
final int index; final int index;
final bool isInProgress; final bool isInProgress;
final bool isFinalStep; final bool isFinalStep;
@ -81,9 +80,9 @@ class StepWidget extends StatelessWidget {
if (isInProgress) { if (isInProgress) {
status = StepStatus.InProgress; status = StepStatus.InProgress;
} else { } else {
if(isStepFinish){ if (isStepFinish) {
status = StepStatus.Completed; status = StepStatus.Completed;
}else { } else {
status = StepStatus.Locked; status = StepStatus.Locked;
} }
} }
@ -99,20 +98,28 @@ class StepWidget extends StatelessWidget {
width: 30, width: 30,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), color: status == StepStatus.InProgress
? Color(0xFFCC9B14)
: status == StepStatus.Locked
? Color(0xFFE3E3E3)
: Color(0xFF359846),
shape: BoxShape.circle, shape: BoxShape.circle,
border: Border.all( border: Border.all(
color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), color: status == StepStatus.InProgress
? Color(0xFFCC9B14)
: status == StepStatus.Locked
? Color(0xFFE3E3E3)
: Color(0xFF359846),
width: 1), width: 1),
), ),
child: Center( child: Center(
child: Icon( child: Icon(
Icons.check, Icons.check,
size: 20, size: 20,
color: status == StepStatus.Locked color: status == StepStatus.Locked
? Color(0xFF969696) ? Color(0xFF969696)
: Colors.white, : Colors.white,
)), )),
), ),
if (!isFinalStep) if (!isFinalStep)
Container( Container(
@ -144,23 +151,25 @@ class StepWidget extends StatelessWidget {
color: status == StepStatus.InProgress color: status == StepStatus.InProgress
? Color(0xFFF1E9D3) ? Color(0xFFF1E9D3)
: status == StepStatus.Locked : status == StepStatus.Locked
? Color(0x29797979) ? Color(0x29797979)
: Color(0xFFD8E8D8), : Color(0xFFD8E8D8),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(4.0), Radius.circular(4.0),
), ),
border: Border.all(color: status == StepStatus.InProgress border: Border.all(
? Color(0xFFF1E9D3) color: status == StepStatus.InProgress
: status == StepStatus.Locked ? Color(0xFFF1E9D3)
? Color(0x29797979) : status == StepStatus.Locked
: Color(0xFFD8E8D8), width: 0.30), ? Color(0x29797979)
: Color(0xFFD8E8D8),
width: 0.30),
), ),
child: AppText( child: AppText(
status == StepStatus.InProgress status == StepStatus.InProgress
? "inProgress" ? "inProgress"
: status == StepStatus.Locked : status == StepStatus.Locked
? "Locked" ? "Locked"
: "Completed", : "Completed",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -181,4 +190,4 @@ enum StepStatus {
InProgress, InProgress,
Locked, Locked,
Completed, Completed,
} }

@ -18,7 +18,7 @@ import 'UCAF-detail-screen.dart';
import 'UCAF-input-screen.dart'; import 'UCAF-input-screen.dart';
class UCAFPagerScreen extends StatefulWidget { class UCAFPagerScreen extends StatefulWidget {
const UCAFPagerScreen({Key ? key}) : super(key: key); const UCAFPagerScreen({Key? key}) : super(key: key);
@override @override
_UCAFPagerScreenState createState() => _UCAFPagerScreenState(); _UCAFPagerScreenState createState() => _UCAFPagerScreenState();
@ -56,7 +56,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings!.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];

@ -331,7 +331,7 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: AppText( child: AppText(
lab.resultValue + " " + lab.uOM, lab.resultValue! + " " + lab.uOM!,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),

@ -74,7 +74,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
), ),
Table( Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 1.0, color: Colors.grey[300]), inside: BorderSide(width: 1.0, color: Colors.grey[300]!),
), ),
children: fullData(projectViewModel), children: fullData(projectViewModel),
), ),
@ -87,7 +87,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
List<TableRow> fullData(ProjectViewModel projectViewModel) { List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
widget.labResult.forEach((vital) { widget.labResult.forEach((vital) {
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); var date = AppDateUtils.convertStringToDate(vital!.verifiedOnDateTime!);
tableRow.add(TableRow(children: [ tableRow.add(TableRow(children: [
Container( Container(
child: Container( child: Container(

@ -122,7 +122,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
? await widget.model!.updateMedicalReport( ? await widget.model!.updateMedicalReport(
widget.patient!, widget.patient!,
txtOfMedicalReport, txtOfMedicalReport,
widget.medicalReport != null widget.medicalReport! != null
? widget.medicalReport!.lineItemNo! ? widget.medicalReport!.lineItemNo!
: '', : '',
widget.medicalReport != null widget.medicalReport != null

@ -168,13 +168,13 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index]!.editedOn! ?? model.medicalReportList[index].createdOn!, "dd MMM yyyy")}',
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
), ),
AppText( AppText(
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index]!.editedOn! ?? model.medicalReportList[index]!.createdOn!, "hh:mm a")}',
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier,

@ -84,7 +84,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
model.patientNursingProgressNoteList.length == 0 model.patientNursingProgressNoteList.length == 0
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context)!.noDataAvailable!,
), ),
) )
: Container( : Container(

@ -34,9 +34,8 @@ import '../../../../widgets/shared/app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class OperationReportScreen extends StatefulWidget { class OperationReportScreen extends StatefulWidget {
final int visitType;
const OperationReportScreen({Key? key, this.visitType}) : super(key: key); const OperationReportScreen({Key? key}) : super(key: key);
@override @override
_ProgressNoteState createState() => _ProgressNoteState(); _ProgressNoteState createState() => _ProgressNoteState();
@ -74,7 +73,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
model.reservationList == null || model.reservationList.length == 0 model.reservationList == null || model.reservationList.length == 0
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, ), error: TranslationBase.of(context).noDataAvailable!, ),
): Column( ): Column(
children: [ children: [
Expanded( Expanded(

@ -219,7 +219,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText:TranslationBase.of(context).assistant, hintText:TranslationBase.of(context).assistant!,
controller: assistantNoteController, controller: assistantNoteController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
@ -237,8 +237,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: "Operation",
TranslationBase.of(context).operation, //TranslationBase.of(context).addoperationReports,
controller: operationController, controller: operationController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,

@ -34,14 +34,14 @@ class ProfileGridForOther extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).vital, TranslationBase.of(context).vital!,
TranslationBase.of(context).signs, TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS, VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab, TranslationBase.of(context).lab!,
TranslationBase.of(context).result, TranslationBase.of(context).result!,
LAB_RESULT, LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg', 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
@ -64,37 +64,37 @@ class ProfileGridForOther extends StatelessWidget {
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).health, TranslationBase.of(context).health!,
TranslationBase.of(context).summary, TranslationBase.of(context).summary!,
HEALTH_SUMMARY, HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg', 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG",
PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).orders, TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures, TranslationBase.of(context).procedures!,
ORDER_PROCEDURE, ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg', 'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).insurance, TranslationBase.of(context).insurance!,
TranslationBase.of(context).service, TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW, PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/insurance approval.svg', 'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patientSick, TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave, TranslationBase.of(context).leave!,
ADD_SICKLEAVE, ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg', 'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
if (isFromLiveCare || if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0)) (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient!,
TranslationBase.of(context).ucaf, TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST, PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg', 'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
@ -105,8 +105,8 @@ class ProfileGridForOther extends StatelessWidget {
if (isFromLiveCare || if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0)) (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral!,
TranslationBase.of(context).patient, TranslationBase.of(context).patient!,
REFER_PATIENT_TO_DOCTOR, REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
@ -118,8 +118,8 @@ class ProfileGridForOther extends StatelessWidget {
if (isFromLiveCare || if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0)) (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).admission, TranslationBase.of(context).admission!,
TranslationBase.of(context).request, TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST, PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg', 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,

@ -31,14 +31,14 @@ class ProfileGridForSearch extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).vital, TranslationBase.of(context).vital!,
TranslationBase.of(context).signs, TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS, VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab, TranslationBase.of(context).lab!,
TranslationBase.of(context).result, TranslationBase.of(context).result!,
LAB_RESULT, LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg', 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
@ -61,52 +61,52 @@ class ProfileGridForSearch extends StatelessWidget {
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).health, TranslationBase.of(context).health!,
TranslationBase.of(context).summary, TranslationBase.of(context).summary!,
HEALTH_SUMMARY, HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg', 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG",
PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).orders, TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures, TranslationBase.of(context).procedures!,
ORDER_PROCEDURE, ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg', 'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).insurance, TranslationBase.of(context).insurance!,
TranslationBase.of(context).service, TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW, PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/vital signs.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patientSick, TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave, TranslationBase.of(context).leave!,
ADD_SICKLEAVE, ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg', 'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient!,
TranslationBase.of(context).ucaf, TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST, PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg', 'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false), isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral!,
TranslationBase.of(context).patient, TranslationBase.of(context).patient!,
REFER_PATIENT_TO_DOCTOR, REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false), isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).admission, TranslationBase.of(context).admission!,
TranslationBase.of(context).request, TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST, PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg', 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,

@ -17,12 +17,13 @@ import '../../../../locator.dart';
class RadiologyDetailsPage extends StatelessWidget { class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology; final FinalRadiology finalRadiology;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String? patientType;
final String arrivalType; final String? arrivalType;
final bool isInpatient; final bool isInpatient;
RadiologyDetailsPage( RadiologyDetailsPage(
{Key? key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false}); {Key? key, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType,
this.isInpatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -106,7 +107,7 @@ class RadiologyDetailsPage extends StatelessWidget {
); );
launch(model.radImageURL); launch(model.radImageURL);
}, },
label: TranslationBase.of(context).openRad, label: TranslationBase.of(context).openRad ?? "",
), ),
), ),
) )

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
@ -23,16 +24,16 @@ class RadiologyHomePage extends StatefulWidget {
} }
class _RadiologyHomePageState extends State<RadiologyHomePage> { class _RadiologyHomePageState extends State<RadiologyHomePage> {
String patientType; String? patientType;
PatiantInformtion patient; late PatiantInformtion patient;
String arrivalType; late String arrivalType;
bool isInpatient; late bool isInpatient;
bool isFromLiveCare; late bool isFromLiveCare;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
@ -50,10 +51,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
// appBarTitle: TranslationBase.of(context).radiology, // appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileAppBar( patientProfileAppBarModel: PatientProfileAppBarModel(
patient, patient: patient, isInpatient:isInpatient,),
isInpatient: isInpatient,
),
baseViewModel: model, baseViewModel: model,
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -118,7 +117,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
settingRoute: 'AddProcedureTabPage'), settingRoute: 'AddProcedureTabPage'),
); );
}, },
label: TranslationBase.of(context).applyForRadiologyOrder, label: TranslationBase.of(context).applyForRadiologyOrder ?? "",
), ),
...List.generate( ...List.generate(
model.radiologyList.length, model.radiologyList.length,
@ -140,9 +139,9 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: model.radiologyList[index].isLiveCareAppodynamicment color: model.radiologyList[index].isLiveCareAppodynamicment!
? Colors.red[900] ? Colors.red[900]
: !model.radiologyList[index].isInOutPatient : !model.radiologyList[index].isInOutPatient!
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -155,11 +154,11 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.radiologyList[index].isLiveCareAppodynamicment model.radiologyList[index]!.isLiveCareAppodynamicment!
? TranslationBase.of(context).liveCare.toUpperCase() ? TranslationBase.of(context).liveCare!.toUpperCase()
: !model.radiologyList[index].isInOutPatient : !model.radiologyList[index].isInOutPatient!
? TranslationBase.of(context).inPatientLabel.toUpperCase() ? TranslationBase.of(context).inPatientLabel!.toUpperCase()
: TranslationBase.of(context).outpatient.toUpperCase(), : TranslationBase.of(context).outpatient!.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -173,7 +172,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
branch: '${model.radiologyList[index].projectName}', branch: '${model.radiologyList[index].projectName}',
clinic: model.radiologyList[index].clinicDescription, clinic: model.radiologyList[index].clinicDescription,
appointmentDate: appointmentDate:
model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate!,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,

@ -11,12 +11,12 @@ class RadiologyReportScreen extends StatelessWidget {
final String reportData; final String reportData;
final String url; final String url;
RadiologyReportScreen({Key ? key, this.reportData, this.url}); RadiologyReportScreen({Key? key, required this.reportData, required this.url});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).radiologyReport, appBarTitle: TranslationBase.of(context).radiologyReport ?? "",
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [

@ -26,13 +26,11 @@ import 'ReplySummeryOnReferralPatient.dart';
class AddReplayOnReferralPatient extends StatefulWidget { class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel; final MyReferralPatientModel myReferralInPatientModel;
final AddReferredRemarksRequestModel myReferralInPatientRequestModel; final AddReferredRemarksRequestModel? myReferralInPatientRequestModel;
final bool isEdited; final bool? isEdited;
const AddReplayOnReferralPatient( const AddReplayOnReferralPatient(
{Key? key, {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel,
this.patientReferralViewModel,
this.myReferralInPatientModel,
this.isEdited, this.isEdited,
this.myReferralInPatientRequestModel}) this.myReferralInPatientRequestModel})
: super(key: key); : super(key: key);

@ -38,7 +38,7 @@ class _ReplySummeryOnReferralPatientState
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).summeryReply, appBarTitle: TranslationBase.of(context).summeryReply!,
body: Container( body: Container(
child: Column( child: Column(
children: [ children: [

@ -32,7 +32,7 @@ class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient ?? "",
body: Column( body: Column(
children: [ children: [
Container( Container(
@ -112,8 +112,8 @@ class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
referralStatus: referralStatus:
model.getReferralStatusNameByCode( model.getReferralStatusNameByCode(
model.myReferralPatients[index] model.myReferralPatients[index]!
.referralStatus, .referralStatus!,
context), context),
referralStatusCode: model referralStatusCode: model
.myReferralPatients[index] .myReferralPatients[index]
@ -125,11 +125,11 @@ class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
.myReferralPatients[index].gender, .myReferralPatients[index].gender,
referredDate: AppDateUtils referredDate: AppDateUtils
.getDayMonthYearDateFormatted(model .getDayMonthYearDateFormatted(model
.myReferralPatients[index] .myReferralPatients[index]!
.referralDate), .referralDate!),
referredTime: AppDateUtils.getTimeHHMMA( referredTime: AppDateUtils.getTimeHHMMA(
model.myReferralPatients[index] model.myReferralPatients[index]!
.referralDate), .referralDate!!),
patientID: patientID:
"${model.myReferralPatients[index].patientID}", "${model.myReferralPatients[index].patientID}",
isSameBranch: false, isSameBranch: false,

@ -17,7 +17,7 @@ class MyReferralPatientScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient ?? "",
body: model.pendingReferral == null || model.pendingReferral.length == 0 body: model.pendingReferral == null || model.pendingReferral.length == 0
? Center( ? Center(
child: Column( child: Column(
@ -50,49 +50,30 @@ class MyReferralPatientScreen extends StatelessWidget {
model.pendingReferral.length, model.pendingReferral.length,
(index) => InkWell( (index) => InkWell(
onTap: () { onTap: () {
Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, Navigator.of(context)
arguments: { .pushNamed(MY_REFERRAL_DETAIL, arguments: {'referral': model.pendingReferral[index]});
'referral': model.pendingReferral[index]
});
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
referralStatus: referralStatus: model.pendingReferral[index].referralStatus,
model.pendingReferral[index].referralStatus, patientName: model.pendingReferral[index].patientName,
patientName: patientGender: model.pendingReferral[index].patientDetails?.gender,
model.pendingReferral[index].patientName, referredDate: model.pendingReferral[index].referredOn!.split(" ")[0],
patientGender: model referredTime: model.pendingReferral[index].referredOn!.split(" ")[1],
.pendingReferral[index].patientDetails.gender, patientID: "${model.pendingReferral[index].patientID}",
referredDate: model isSameBranch: model.pendingReferral[index].isReferralDoctorSameBranch,
.pendingReferral[index].referredOn
.split(" ")[0],
referredTime: model
.pendingReferral[index].referredOn
.split(" ")[1],
patientID:
"${model.pendingReferral[index].patientID}",
isSameBranch: model.pendingReferral[index]
.isReferralDoctorSameBranch,
isReferral: true, isReferral: true,
remark: remark: model.pendingReferral[index].remarksFromSource,
model.pendingReferral[index].remarksFromSource, nationality: model.pendingReferral[index].patientDetails!.nationalityName,
nationality: model.pendingReferral[index] nationalityFlag: model.pendingReferral[index].nationalityFlagUrl,
.patientDetails.nationalityName, doctorAvatar: model.pendingReferral[index].doctorImageUrl,
nationalityFlag: referralDoctorName: model.pendingReferral[index].referredByDoctorInfo,
model.pendingReferral[index].nationalityFlagUrl,
doctorAvatar:
model.pendingReferral[index].doctorImageUrl,
referralDoctorName: model
.pendingReferral[index].referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
infoIcon: InkWell( infoIcon: InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL,
.pushNamed(MY_REFERRAL_DETAIL, arguments: { arguments: {'referral': model.pendingReferral[index]});
'referral': model.pendingReferral[index]
});
}, },
child: Icon(FontAwesomeIcons.arrowRight, child: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black),
size: 25, color: Colors.black),
), ),
), ),
), ),

@ -21,9 +21,8 @@ class PatientReferralScreen extends StatefulWidget {
_PatientReferralScreen createState() => _PatientReferralScreen(); _PatientReferralScreen createState() => _PatientReferralScreen();
} }
class _PatientReferralScreen extends State<PatientReferralScreen> class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin { late TabController _tabController;
TabController _tabController;
int index = 0; int index = 0;
@override @override
@ -52,9 +51,9 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: TranslationBase.of(context).patientsreferral, title: TranslationBase.of(context).patientsreferral!,
), ),
appBarTitle: TranslationBase.of(context).patientsreferral, appBarTitle: TranslationBase.of(context).patientsreferral!,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
@ -81,7 +80,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
decoration: Helpers.getBoxTabsBoxDecoration( decoration: Helpers.getBoxTabsBoxDecoration(
isActive: index == 0, isFirst: true, projectViewModel:projectsProvider ), isActive: index == 0, isFirst: true, projectViewModel:projectsProvider ),
child: Center( child: Center(
child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient!, isActive:index == 0 )
), ),
), ),
Center( Center(
@ -89,7 +88,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
decoration:Helpers.getBoxTabsBoxDecoration( decoration:Helpers.getBoxTabsBoxDecoration(
isActive: index == 1, isMiddle: true, projectViewModel:projectsProvider ), isActive: index == 1, isMiddle: true, projectViewModel:projectsProvider ),
child: Center( child: Center(
child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) child:Helpers.getTabText(title:TranslationBase.of(context).referral!, isActive:index == 1 )
), ),
), ),
), ),
@ -98,7 +97,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
decoration:Helpers.getBoxTabsBoxDecoration( decoration:Helpers.getBoxTabsBoxDecoration(
isActive: index == 2, isLast: true, projectViewModel:projectsProvider ), isActive: index == 2, isLast: true, projectViewModel:projectsProvider ),
child: Center( child: Center(
child: Helpers.getTabText(title:TranslationBase.of(context).discharged, isActive:index == 2 ), child: Helpers.getTabText(title:TranslationBase.of(context).discharged!, isActive:index == 2 ),
), ),
), ),
), ),

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -31,8 +32,8 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget {
class _PatientMakeInPatientReferralScreenState class _PatientMakeInPatientReferralScreenState
extends State<PatientMakeInPatientReferralScreen> { extends State<PatientMakeInPatientReferralScreen> {
PatiantInformtion patient; late PatiantInformtion patient;
List<dynamic> referToList; late List<dynamic> referToList;
dynamic _referTo; dynamic _referTo;
dynamic _selectedBranch; dynamic _selectedBranch;
dynamic _selectedClinic; dynamic _selectedClinic;
@ -41,13 +42,13 @@ class _PatientMakeInPatientReferralScreenState
final _remarksController = TextEditingController(); final _remarksController = TextEditingController();
final _extController = TextEditingController(); final _extController = TextEditingController();
int _activePriority = 1; int _activePriority = 1;
String appointmentDate; late String appointmentDate;
String branchError; String? branchError;
String hospitalError; String? hospitalError;
String clinicError; String? clinicError;
String doctorError; String? doctorError;
String frequencyError; String? frequencyError;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
@ -121,7 +122,7 @@ class _PatientMakeInPatientReferralScreenState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings!.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
@ -144,12 +145,10 @@ class _PatientMakeInPatientReferralScreenState
onModelReady: (model) => model.getReferralFrequencyList(), onModelReady: (model) => model.getReferralFrequencyList(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient!,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( patientProfileAppBarModel: PatientProfileAppBarModel(
patient, patient: patient, isInpatient:isInpatient,),
isInpatient: isInpatient,
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -593,9 +592,9 @@ class _PatientMakeInPatientReferralScreenState
Widget priorityBar(BuildContext _context, Size screenSize) { Widget priorityBar(BuildContext _context, Size screenSize) {
List<String> _priorities = [ List<String> _priorities = [
TranslationBase.of(context).veryUrgent.toUpperCase(), TranslationBase.of(context).veryUrgent!.toUpperCase(),
TranslationBase.of(context).urgent.toUpperCase(), TranslationBase.of(context).urgent!.toUpperCase(),
TranslationBase.of(context).routine.toUpperCase(), TranslationBase.of(context).routine!.toUpperCase(),
]; ];
return Container( return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -23,24 +24,23 @@ import 'package:hexcolor/hexcolor.dart';
class PatientMakeReferralScreen extends StatefulWidget { class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: ReferPatientScreen // previous design page is: ReferPatientScreen
@override @override
_PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState();
_PatientMakeReferralScreenState();
} }
class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> { class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
PatiantInformtion patient; late PatiantInformtion patient;
List<dynamic> referToList; late List<dynamic> referToList;
dynamic _referTo; dynamic _referTo;
dynamic _selectedBranch; dynamic _selectedBranch;
dynamic _selectedClinic; dynamic _selectedClinic;
dynamic _selectedDoctor; dynamic _selectedDoctor;
DateTime appointmentDate; late DateTime appointmentDate;
final _remarksController = TextEditingController(); final _remarksController = TextEditingController();
String branchError = null; String? branchError = null;
String hospitalError = null; String? hospitalError = null;
String clinicError = null; String? clinicError = null;
String doctorError = null; String? doctorError = null;
@override @override
void initState() { void initState() {
@ -51,7 +51,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings!.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
@ -74,9 +74,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
onModelReady: (model) => model.getPatientReferral(patient), onModelReady: (model) => model.getPatientReferral(patient),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient!,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar(patient), patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -110,57 +110,25 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0 model.patientReferral.length == 0
? referralForm(model, screenSize) ? referralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
referralStatus: model referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus,
.patientReferral[ patientName: model.patientReferral[model.patientReferral.length - 1].patientName,
model.patientReferral.length - 1] patientGender:
.referralStatus, model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender,
patientName: model referredDate:
.patientReferral[ model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[0],
model.patientReferral.length - 1] referredTime:
.patientName, model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[1],
patientGender: model patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}",
.patientReferral[ isSameBranch:
model.patientReferral.length - 1] model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch,
.patientDetails
.gender,
referredDate: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[0],
referredTime: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[1],
patientID:
"${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model
.patientReferral[
model.patientReferral.length - 1]
.isReferralDoctorSameBranch,
isReferral: true, isReferral: true,
remark: model remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource,
.patientReferral[ nationality:
model.patientReferral.length - 1] model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName,
.remarksFromSource, nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl,
nationality: model doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl,
.patientReferral[ referralDoctorName:
model.patientReferral.length - 1] model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo,
.patientDetails
.nationalityName,
nationalityFlag: model
.patientReferral[
model.patientReferral.length - 1]
.nationalityFlagUrl,
doctorAvatar: model
.patientReferral[
model.patientReferral.length - 1]
.doctorImageUrl,
referralDoctorName: model
.patientReferral[
model.patientReferral.length - 1]
.referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
), ),
], ],
@ -180,26 +148,22 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
setState(() { setState(() {
if (_referTo == null) { if (_referTo == null) {
branchError = branchError = TranslationBase.of(context).fieldRequired!;
TranslationBase.of(context).fieldRequired;
} else { } else {
branchError = null; branchError = null;
} }
if (_selectedBranch == null) { if (_selectedBranch == null) {
hospitalError = hospitalError = TranslationBase.of(context).fieldRequired!;
TranslationBase.of(context).fieldRequired;
} else { } else {
hospitalError = null; hospitalError = null;
} }
if (_selectedClinic == null) { if (_selectedClinic == null) {
clinicError = clinicError = TranslationBase.of(context).fieldRequired!;
TranslationBase.of(context).fieldRequired;
} else { } else {
clinicError = null; clinicError = null;
} }
if (_selectedDoctor == null) { if (_selectedDoctor == null) {
doctorError = doctorError = TranslationBase.of(context).fieldRequired!;
TranslationBase.of(context).fieldRequired;
} else { } else {
doctorError = null; doctorError = null;
} }
@ -443,10 +407,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
suffixIcon: IconButton( suffixIcon: IconButton(
onPressed: () {},
icon: Icon( icon: Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
)), )),
onClick: () { onClick: () {
_selectDate(context, model); _selectDate(context, model);
}, },
@ -469,12 +434,12 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectDate(BuildContext context, PatientReferralViewModel model) async { _selectDate(BuildContext context, PatientReferralViewModel model) async {
// https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference
// https://stackoverflow.com/a/63147062/6246772 to customize a date picker // https://stackoverflow.com/a/63147062/6246772 to customize a date picker
final DateTime picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: appointmentDate, initialDate: appointmentDate,
firstDate: DateTime.now().add(Duration(hours: 2)), firstDate: DateTime.now().add(Duration(hours: 2)),
lastDate: DateTime(2040), lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar, initialEntryMode: DatePickerEntryMode.calendar!,
); );
if (picked != null && picked != appointmentDate) { if (picked != null && picked != appointmentDate) {
setState(() { setState(() {

@ -22,7 +22,6 @@ import 'AddReplayOnReferralPatient.dart';
class ReferralPatientDetailScreen extends StatelessWidget { class ReferralPatientDetailScreen extends StatelessWidget {
final MyReferralPatientModel referredPatient; final MyReferralPatientModel referredPatient;
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel);
@override @override
@ -140,7 +139,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -152,7 +151,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
AppText( AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(
referredPatient.referralDate, referredPatient.referralDate!,
), ),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -185,7 +184,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
AppText( AppText(
AppDateUtils.getTimeHHMMA( AppDateUtils.getTimeHHMMA(
referredPatient.referralDate, referredPatient.referralDate!,
), ),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -223,29 +222,28 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if (referredPatient.frequency != null) if (referredPatient.frequency != null)Row(
Row( mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ AppText(
AppText( TranslationBase.of(context).frequency! + ": ",
TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.frequencyDescription?? '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w700,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF2E303A),
),
Expanded(
child: AppText(
referredPatient.frequencyDescription ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
), ),
], ),
), ],
),
], ],
), ),
), ),
@ -263,11 +261,11 @@ class ReferralPatientDetailScreen extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.nationalityFlagURL, referredPatient.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
(BuildContext context, Object exception, StackTrace stackTrace) { (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -282,7 +280,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).priority + ": ", TranslationBase.of(context).priority! + ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier,
@ -290,7 +288,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.priorityDescription ?? '', referredPatient.priorityDescription! ?? '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
@ -305,7 +303,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).maxResponseTime + ": ", TranslationBase.of(context).maxResponseTime! + ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier,
@ -315,7 +313,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
child: AppText( child: AppText(
referredPatient.mAXResponseTime != null referredPatient.mAXResponseTime != null
? AppDateUtils.convertDateFromServerFormat( ? AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime, "dd MMM,yyyy") referredPatient.mAXResponseTime!, "dd MMM,yyyy")
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -343,11 +341,11 @@ class ReferralPatientDetailScreen extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL, referredPatient.doctorImageURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
(BuildContext context, Object exception, StackTrace stackTrace) { (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text(''); return Text('');
}, },
)) ))
@ -437,7 +435,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
), ),
if (referredPatient.referredDoctorRemarks != null && if (referredPatient.referredDoctorRemarks != null &&
referredPatient.referredDoctorRemarks.isNotEmpty) referredPatient.referredDoctorRemarks!.isNotEmpty)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0),
@ -501,7 +499,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
patientReferralViewModel: patientReferralViewModel, patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient, myReferralInPatientModel: referredPatient,
isEdited: referredPatient.referredDoctorRemarks != null && isEdited: referredPatient.referredDoctorRemarks != null &&
referredPatient.referredDoctorRemarks.isNotEmpty, referredPatient.referredDoctorRemarks!.isNotEmpty,
), ),
), ),
); );

@ -27,7 +27,7 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referredPatient, appBarTitle: TranslationBase.of(context).referredPatient!,
body: Column( body: Column(
children: [ children: [
Container( Container(
@ -107,13 +107,13 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
.convertDateFromServerFormat( .convertDateFromServerFormat(
model model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.referralDate, .referralDate!,
"dd/MM/yyyy"), "dd/MM/yyyy"),
referredTime: AppDateUtils referredTime: AppDateUtils
.convertDateFromServerFormat( .convertDateFromServerFormat(
model model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.referralDate, .referralDate!,
"hh:mm a"), "hh:mm a"),
patientID: patientID:
"${model.getReferredPatientItem(index).patientID}", "${model.getReferredPatientItem(index).patientID}",
@ -182,9 +182,9 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
title: AppText(TranslationBase.of(context).inPatient), title: AppText(TranslationBase.of(context).inPatient),
value: PatientType.IN_PATIENT, value: PatientType.IN_PATIENT,
groupValue: patientType, groupValue: patientType,
onChanged: (PatientType value) { onChanged: (PatientType? value) {
setState(() { setState(() {
patientType = value; patientType = value!;
radioOnChange(value); radioOnChange(value);
}); });
}, },
@ -195,10 +195,10 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
title: AppText(TranslationBase.of(context).outpatient), title: AppText(TranslationBase.of(context).outpatient),
value: PatientType.OUT_PATIENT, value: PatientType.OUT_PATIENT,
groupValue: patientType, groupValue: patientType,
onChanged: (PatientType value) { onChanged: (PatientType? value) {
setState(() { setState(() {
patientType = value; patientType = value!;
radioOnChange(value); radioOnChange(value)!;
}); });
}, },
), ),

@ -163,8 +163,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat( AppDateUtils.convertDateFromServerFormat(
referredPatient.referralDate, referredPatient.referralDate ?? "", "dd MMM,yyyy"),
"dd MMM,yyyy"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
@ -200,8 +199,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat( AppDateUtils.convertDateFromServerFormat(
referredPatient.referralDate, referredPatient.referralDate ?? "", "hh:mm a"),
"hh:mm a"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -252,7 +250,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.frequency + .frequency! +
": ", ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -294,13 +292,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
BorderRadius.circular(20.0), BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient referredPatient
.nationalityFlagURL, .nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext errorBuilder:
context, (BuildContext context, Object exception, StackTrace? stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -316,7 +312,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).priority + TranslationBase.of(context).priority! +
": ", ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -341,7 +337,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.maxResponseTime + .maxResponseTime! +
": ", ": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -356,7 +352,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? AppDateUtils ? AppDateUtils
.convertDateFromServerFormat( .convertDateFromServerFormat(
referredPatient referredPatient
.mAXResponseTime, .mAXResponseTime!,
"dd MMM,yyyy") "dd MMM,yyyy")
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -394,13 +390,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
borderRadius: borderRadius:
BorderRadius.circular(20.0), BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL, referredPatient.doctorImageURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
(BuildContext context, (BuildContext context, Object exception, StackTrace? stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -503,12 +497,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL, referredPatient.doctorImageURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -536,7 +528,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
referredPatient.referredDoctorRemarks == referredPatient.referredDoctorRemarks ==
null null
? '' ? ''
: referredPatient.referredDoctorRemarks : referredPatient.referredDoctorRemarks!
.isNotEmpty .isNotEmpty
? referredPatient ? referredPatient
.referredDoctorRemarks .referredDoctorRemarks
@ -570,7 +562,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
vPadding: 12, vPadding: 12,
disabled: referredPatient.referredDoctorRemarks == null disabled: referredPatient.referredDoctorRemarks == null
? true ? true
: referredPatient.referredDoctorRemarks.isNotEmpty : referredPatient.referredDoctorRemarks!.isNotEmpty
? false ? false
: true, : true,
onPressed: () async { onPressed: () async {

@ -29,17 +29,17 @@ class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment; final MySelectedAssessment mySelectedAssessment;
final List<MySelectedAssessment> mySelectedAssessmentList; final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)
addSelectedAssessment; addSelectedAssessment;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final bool isUpdate; final bool isUpdate;
AddAssessmentDetails( AddAssessmentDetails(
{Key ? key, {Key? key,
this.mySelectedAssessment, required this.mySelectedAssessment,
this.addSelectedAssessment, required this.addSelectedAssessment,
this.patientInfo, required this.patientInfo,
this.isUpdate = false, this.isUpdate = false,
this.mySelectedAssessmentList}); required this.mySelectedAssessmentList});
@override @override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -60,48 +60,37 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
remarkController.text = widget.mySelectedAssessment.remark ?? ""; remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text = appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
widget.mySelectedAssessment.appointmentId.toString();
if (widget.isUpdate) { if (widget.isUpdate) {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) if (widget.mySelectedAssessment.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic conditionController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? ""
: widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? "";
if (widget.mySelectedAssessment.selectedDiagnosisType != null) if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic typeController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisType.nameAr ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr ?? ""
: widget.mySelectedAssessment.selectedDiagnosisType.nameEn; : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn ?? "";
if (widget.mySelectedAssessment.selectedICD != null) if (widget.mySelectedAssessment.selectedICD != null)
icdNameController.text = widget.mySelectedAssessment.selectedICD.code; icdNameController.text = widget.mySelectedAssessment.selectedICD!.code;
} }
InputDecoration textFieldSelectorDecoration( InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown,
String hintText, String selectedText, bool isDropDown, {IconData? icon, String? validationError}) {
{IconData icon, String validationError}) {
return new InputDecoration( return new InputDecoration(
fillColor: Colors.white, fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide:
color: (validationError != null BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide:
color: (validationError != null BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide:
color: (validationError != null BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
@ -135,9 +124,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox( SizedBox(
height: 16, height: 16,
), ),
@ -145,10 +132,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
// height: 55.0, // height: 55.0,
height: Helpers.getTextFieldHeight(), height: Helpers.getTextFieldHeight(),hintText: TranslationBase.of(context).appointmentNumber,
hintText:
TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
enabled: false, enabled: false,
controller: appointmentIdController, controller: appointmentIdController,
@ -161,155 +145,109 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: InkWell( child: InkWell(
onTap: model.listOfICD10 != null onTap: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment.selectedICD = null;
.selectedICD = null; icdNameController.text = null!;
icdNameController.text = null; });
}); }
}
: null, : null,
child: widget child: widget.mySelectedAssessment.selectedICD == null
.mySelectedAssessment.selectedICD ==
null
? CustomAutoCompleteTextField( ? CustomAutoCompleteTextField(
isShowError: isFormSubmitted && isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
widget.mySelectedAssessment child: AutoCompleteTextField<MasterKeyModel>(
.selectedICD == decoration: TextFieldsUtils.textFieldSelectorDecoration(
null, TranslationBase.of(context).nameOrICD!, "", true,
child: AutoCompleteTextField< suffixIcon: Icons.search),
MasterKeyModel>( itemSubmitted: (item) => setState(() {
decoration: TextFieldsUtils widget.mySelectedAssessment.selectedICD = item;
.textFieldSelectorDecoration( icdNameController.text = '${item.code.trim()}/${item.description}';
TranslationBase.of(context) }),
.nameOrICD, suggestions: model.listOfICD10,
null, itemBuilder: (context, suggestion) => new Padding(
true, child: AppText(suggestion.description + " / " + suggestion.code.toString()),
suffixIcon: Icons.search), padding: EdgeInsets.all(8.0)),
itemSubmitted: (item) => setState(() { itemSorter: (a, b) => 1,
widget.mySelectedAssessment itemFilter: (suggestion, input) =>
.selectedICD = item; suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
icdNameController.text = suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
'${item.code.trim()}/${item.description}'; suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
}), ),
key: key, )
suggestions: model.listOfICD10, : AppTextFieldCustom(height: Helpers.getTextFieldHeight(),
itemBuilder: (context, suggestion) =>
new Padding(
child: AppText(
suggestion.description +
" / " +
suggestion.code
.toString()),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.code
.toLowerCase()
.startsWith(
input.toLowerCase()),
),
)
: AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
onClick: model.listOfICD10 != null onClick: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment.selectedICD = null;
.selectedICD = null; icdNameController.text = null!;
icdNameController.text = null; });
}); }
} : null,
: null, hintText: TranslationBase.of(context).nameOrICD,
hintText: TranslationBase.of(context) maxLines: 1,
.nameOrICD, minLines: 1,
maxLines: 1, controller: icdNameController,
minLines: 1, enabled: true,
controller: icdNameController, isTextFieldHasSuffix: true,
enabled: true, suffixIcon: IconButton(
isTextFieldHasSuffix: true, onPressed: () {},
suffixIcon: IconButton( icon: Icon(
icon: Icon( Icons.search,
Icons.search, color: Colors.grey.shade600,
color: Colors.grey.shade600,
)),
)), )),
), )),),
if(widget.mySelectedAssessment if(widget.mySelectedAssessment
.selectedICD != null) .selectedICD != null)
Column( Column(
children: [ children: [
SizedBox( SizedBox(
height: 3, height: 3,
), ),
Container( Container(
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.7, .width * 0.7,
child: AppText( child: AppText(
widget.mySelectedAssessment widget.mySelectedAssessment
.selectedICD!.description! + .selectedICD!.description! +
(' (${widget.mySelectedAssessment (' (${widget.mySelectedAssessment
.selectedICD!.code!} )'), .selectedICD!.code!} )'),
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.4, letterSpacing: -0.4,
), ),
),
],
), ),
],
),
SizedBox( SizedBox(
height: 7, height: 7,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: Helpers.getTextFieldHeight(), height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisCondition != null
? () {
onClick: model.listOfDiagnosisCondition != null MasterKeyDailog dialog = MasterKeyDailog(
? () { list: model.listOfDiagnosisCondition,
MasterKeyDailog dialog = MasterKeyDailog( okText: TranslationBase.of(context).ok,
list: model.listOfDiagnosisCondition, selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,okFunction: (MasterKeyModel selectedValue) {
okText: TranslationBase.of(context).ok, setState(() {
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
conditionController.text = projectViewModel.isArabic
okFunction: ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? ""
(MasterKeyModel selectedValue) { : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? "";
setState(() { });
widget.mySelectedAssessment },
.selectedDiagnosisCondition = );
selectedValue; showDialog(
conditionController barrierDismissible: false,
.text = projectViewModel context: context,
.isArabic builder: (BuildContext context) {
? widget return dialog;
.mySelectedAssessment },
.selectedDiagnosisCondition );
.nameAr }
: widget : null,
.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).condition, hintText: TranslationBase.of(context).condition,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
@ -317,10 +255,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
enabled: false, enabled: false,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && validationError:
widget.mySelectedAssessment isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null
.selectedDiagnosisCondition ==
null
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
), ),
@ -328,36 +264,28 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: Helpers.getTextFieldHeight(), height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisType != null
? () {
onClick: model.listOfDiagnosisType != null MasterKeyDailog dialog = MasterKeyDailog(
? () { list: model.listOfDiagnosisType,
MasterKeyDailog dialog = MasterKeyDailog( okText: TranslationBase.of(context).ok,
list: model.listOfDiagnosisType, selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,okFunction: (MasterKeyModel selectedValue) {
okText: TranslationBase.of(context).ok, setState(() {
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, widget.mySelectedAssessment.selectedDiagnosisType = selectedValue;
okFunction: typeController.text =
(MasterKeyModel selectedValue) { (projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn)!;
setState(() { });
widget.mySelectedAssessment },
.selectedDiagnosisType = );
selectedValue; showDialog(
typeController.text = barrierDismissible: false,
projectViewModel.isArabic context: context,
? selectedValue.nameAr builder: (BuildContext context) {
: selectedValue.nameEn; return dialog;
}); },
}, );
); }
showDialog( : null,
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).dType, hintText: TranslationBase.of(context).dType,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
@ -365,10 +293,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
controller: typeController, controller: typeController,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null
widget.mySelectedAssessment
.selectedDiagnosisType ==
null
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
), ),
@ -384,8 +309,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
controller: remarkController, controller: remarkController,
onChanged: (value) { onChanged: (value) {
widget.mySelectedAssessment.remark = widget.mySelectedAssessment.remark = remarkController.text;
remarkController.text;
}, },
), ),
), ),
@ -402,31 +326,23 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
bottomSheet: model.state == ViewState.Busy?Container(height: 0,): bottomSheet: model.state == ViewState.Busy?Container(height: 0,):
BottomSheetDialogButton( BottomSheetDialogButton(
label: (widget.isUpdate label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'),
? 'Update Assessment Details'
: 'Add Assessment Details'),
onTap: () async { onTap: () async {
setState(() { setState(() {
isFormSubmitted = true; isFormSubmitted = true;
}); });
widget.mySelectedAssessment.remark = widget.mySelectedAssessment.remark = remarkController.text;
remarkController.text; widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text);
widget.mySelectedAssessment.appointmentId = if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
int.parse(appointmentIdController.text); widget.mySelectedAssessment.selectedDiagnosisType != null &&
if (widget.mySelectedAssessment
.selectedDiagnosisCondition !=
null &&
widget.mySelectedAssessment
.selectedDiagnosisType !=
null &&
widget.mySelectedAssessment.selectedICD != null) { widget.mySelectedAssessment.selectedICD != null) {
await submitAssessment( await submitAssessment(
isUpdate: widget.isUpdate, isUpdate: widget.isUpdate,
model: model, model: model,
mySelectedAssessment: mySelectedAssessment: widget.mySelectedAssessment);
widget.mySelectedAssessment);
} }
}, },
), ),
), ),
), ),
@ -434,9 +350,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
} }
submitAssessment( submitAssessment(
{SOAPViewModel model, {required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async {
MySelectedAssessment mySelectedAssessment,
bool isUpdate = false}) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) { if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
@ -445,25 +359,24 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment.remark, remarks: mySelectedAssessment.remark,
complexDiagnosis: true, complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD.code, icdcode10Id: mySelectedAssessment.selectedICD!.code,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID); prevIcdCode10ID: mySelectedAssessment.icdCode10ID);
await model.patchAssessment(patchAssessmentReqModel); await model.patchAssessment(patchAssessmentReqModel);
} else { } else {
PostAssessmentRequestModel postAssessmentRequestModel = PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel(
new PostAssessmentRequestModel( patientMRN: widget.patientInfo.patientMRN,
patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo,
episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo,
appointmentNo: widget.patientInfo.appointmentNo, icdCodeDetails: [
icdCodeDetails: [
new IcdCodeDetails( new IcdCodeDetails(
remarks: mySelectedAssessment.remark, remarks: mySelectedAssessment.remark,
complexDiagnosis: true, complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD.code) icdcode10Id: mySelectedAssessment.selectedICD!.code)
]); ]);
await model.postAssessment(postAssessmentRequestModel); await model.postAssessment(postAssessmentRequestModel);
@ -476,9 +389,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code;
mySelectedAssessment.doctorName = doctorProfile!.doctorName; mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment(mySelectedAssessment, isUpdate); widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }

@ -30,13 +30,12 @@ class UpdateAssessmentPage extends StatefulWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
UpdateAssessmentPage( UpdateAssessmentPage(
{Key ? key, {Key? key,
this.changePageViewIndex, required this.changePageViewIndex,
this.patientInfo, required this.patientInfo,
this.changeLoadingState, required this.changeLoadingState,
this.currentIndex}); required this.currentIndex});
@override @override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
@ -56,37 +55,34 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
model.setAssessmentCallBack(this); model.setAssessmentCallBack(this);
mySelectedAssessmentList.clear(); mySelectedAssessmentList.clear();
await model.onUpdateAssessmentStepStart(widget.patientInfo); await model.onUpdateAssessmentStepStart(widget.patientInfo);
if (model.patientAssessmentList.isNotEmpty) { if (model.patientAssessmentList.isNotEmpty) {
model.patientAssessmentList.forEach((element) { model.patientAssessmentList.forEach((element) {
MasterKeyModel diagnosisType = model.getOneMasterKey( MasterKeyModel? diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType, masterKeys: MasterKeysService.DiagnosisType,
id: element.diagnosisTypeID, id: element.diagnosisTypeID,
); );
MasterKeyModel selectedICD = model.getOneMasterKey( MasterKeyModel? selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10, masterKeys: MasterKeysService.ICD10,
id: element.icdCode10ID, id: element.icdCode10ID,
); );
MasterKeyModel diagnosisCondition = model.getOneMasterKey( MasterKeyModel? diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition, masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID, id: element.conditionID,
); );
if (diagnosisCondition != null && if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) {
diagnosisType != null && MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment(
diagnosisCondition != null) { appointmentNo: element.appointmentNo,
MySelectedAssessment temMySelectedAssessment = remark: element.remarks,
SoapUtils.generateMySelectedAssessment( diagnosisType: diagnosisType,
appointmentNo: element.appointmentNo, diagnosisCondition: diagnosisCondition,
remark: element.remarks, selectedICD: selectedICD,
diagnosisType: diagnosisType, doctorID: element.doctorID,
diagnosisCondition: diagnosisCondition, doctorName: element.doctorName,
selectedICD: selectedICD, createdBy: element.createdBy,
doctorID: element.doctorID, createdOn: element.createdOn,
doctorName: element.doctorName, icdCode10ID: element.icdCode10ID);
createdBy: element.createdBy,
createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID);
mySelectedAssessmentList.add(temMySelectedAssessment); mySelectedAssessmentList.add(temMySelectedAssessment);
} }
@ -128,7 +124,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
children: [ children: [
SOAPOpenItems( SOAPOpenItems(
label: label:
"${TranslationBase.of(context).addAssessment}", "${TranslationBase.of(context).addAssessment}",
onTap: () { onTap: () {
openAssessmentDialog(context, openAssessmentDialog(context,
isUpdate: false, model: model); isUpdate: false, model: model);
@ -139,25 +135,25 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
Column( Column(
children: children:
mySelectedAssessmentList.map((assessment) { mySelectedAssessmentList.map((assessment) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5, right: 5, top: 15, bottom: 15), left: 5, right: 5, top: 15, bottom: 15),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -169,23 +165,23 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
new TextSpan( new TextSpan(
text: assessment text: assessment
.selectedICD!.code .selectedICD!.code
.trim() .trim()
.toUpperCase() ?? .toUpperCase() ??
""), ""),
], ],
), ),
), ),
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
0.50, 0.50,
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
5, 5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -206,7 +202,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.5, 3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -215,11 +211,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.appointmentNo, .appointmentNo,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3, 3,
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
@ -227,11 +223,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
new TextSpan( new TextSpan(
text: assessment.appointmentId text: assessment.appointmentId
.toString() ?? .toString() ??
"", "",
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -244,7 +240,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3, 3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -252,8 +248,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.condition! + .condition! +
" : ", " : ",
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
@ -262,16 +258,16 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
new TextSpan( new TextSpan(
text: projectViewModel text: projectViewModel
.isArabic .isArabic
? assessment ? assessment
.selectedDiagnosisCondition! .selectedDiagnosisCondition!
.nameAr! .nameAr!
: assessment : assessment
.selectedDiagnosisCondition! .selectedDiagnosisCondition!
.nameEn!, .nameEn!,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -284,7 +280,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3, 3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -292,8 +288,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.dType! + .dType! +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
@ -302,16 +298,16 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
new TextSpan( new TextSpan(
text: projectViewModel text: projectViewModel
.isArabic .isArabic
? assessment ? assessment
.selectedDiagnosisType! .selectedDiagnosisType!
.nameAr .nameAr
: assessment : assessment
.selectedDiagnosisType! .selectedDiagnosisType!
.nameEn, .nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -325,21 +321,21 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight:
FontWeight.w600), FontWeight.w600),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.doctor! + .doctor! +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3, 3,
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
@ -347,11 +343,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
new TextSpan( new TextSpan(
text: text:
assessment.doctorName ?? assessment.doctorName ??
'', '',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -365,24 +361,24 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 6, height: 6,
), ),
AppText( AppText(
(assessment.remark != null && (assessment.remark != null &&
assessment.remark != assessment.remark !=
'') '')
? TranslationBase.of( ? TranslationBase.of(
context) context)
.remarks! + .remarks! +
" : " " : "
: '', : '',
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3, 3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -396,41 +392,41 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.end, CrossAxisAlignment.end,
children: [ children: [
Row( Row(
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.end, CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
assessment.createdOn != null assessment.createdOn != null
? AppDateUtils ? AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.parse( DateTime.parse(
assessment! assessment!
.createdOn!)) .createdOn!))
: AppDateUtils : AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
), ),
AppText( AppText(
assessment.createdOn != null assessment.createdOn != null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
assessment! assessment!
.createdOn!)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.6, 3.6,
), ),
], ],
@ -439,8 +435,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context) height: MediaQuery.of(context)
.size .size
.height * .height *
0.05, 0.05,
), ),
InkWell( InkWell(
@ -481,10 +477,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
} }
openAssessmentDialog(BuildContext context, openAssessmentDialog(BuildContext context,
{MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { {MySelectedAssessment? assessment, required bool isUpdate, required SOAPViewModel model}) {
if (assessment == null) { if (assessment == null) {
assessment = SoapUtils.generateMySelectedAssessment( assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo);
remark: '', appointmentNo: widget.patientInfo.appointmentNo);
} }
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -492,12 +487,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
context: context, context: context,
builder: (context) { builder: (context) {
return AddAssessmentDetails( return AddAssessmentDetails(
mySelectedAssessment: assessment, mySelectedAssessment: assessment!,
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
isUpdate: isUpdate, isUpdate: isUpdate,
mySelectedAssessmentList: mySelectedAssessmentList, mySelectedAssessmentList: mySelectedAssessmentList,
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async {
bool isUpdate) async {
setState(() { setState(() {
if (!isUpdate) if (!isUpdate)
mySelectedAssessmentList.add(mySelectedAssessment); mySelectedAssessmentList.add(mySelectedAssessment);

@ -18,9 +18,7 @@ class AddExaminationPage extends StatefulWidget {
final Function(MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
AddExaminationPage( AddExaminationPage(
{this.mySelectedExamination, {required this.mySelectedExamination, required this.addSelectedExamination, required this.removeExamination});
this.addSelectedExamination,
this.removeExamination});
@override @override
_AddExaminationPageState createState() => _AddExaminationPageState(); _AddExaminationPageState createState() => _AddExaminationPageState();
@ -44,78 +42,74 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar: BottomSheetTitle(
title: "${TranslationBase.of(context).addExamination}", title: "${TranslationBase.of(context).addExamination}",
), ),
backgroundColor: Color.fromRGBO(248, 248, 248, 1), backgroundColor: Color.fromRGBO(248, 248, 248, 1),
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded( children: [
child: SingleChildScrollView( Expanded(
child: Column( child: SingleChildScrollView(
children: [ child: Column(
Container( children: [
margin: EdgeInsets.all(16.0), Container(
padding: EdgeInsets.all(0.0), margin: EdgeInsets.all(16.0),
decoration: BoxDecoration( padding: EdgeInsets.all(0.0),
shape: BoxShape.rectangle, decoration: BoxDecoration(
color: Colors.white, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(12), color: Colors.white,
border: Border.fromBorderSide(BorderSide( borderRadius: BorderRadius.circular(12),
color: Colors.grey.shade400, border: Border.fromBorderSide(BorderSide(
width: 0.4, color: Colors.grey.shade400,
)), width: 0.4,
), )),
child: Column( ),
children: [ child: Column(
ExaminationsListSearchWidget( children: [
mySelectedExamination: ExaminationsListSearchWidget(
widget.mySelectedExamination, mySelectedExamination:
masterList: model.physicalExaminationList, widget.mySelectedExamination,masterList: model.physicalExaminationList,
isServiceSelected: (master) => isServiceSelected: (master) => isServiceSelected(master),
isServiceSelected(master), removeExamination: (selectedExamination) {
removeExamination: (selectedExamination) { setState(() {
setState(() { mySelectedExaminationLocal.remove(selectedExamination);
mySelectedExaminationLocal.remove(selectedExamination); });
}); },
}, addExamination: (selectedExamination) {
addExamination: (selectedExamination) {
mySelectedExaminationLocal mySelectedExaminationLocal.insert(0, selectedExamination);
.insert(0, selectedExamination); // setState(() {});
// setState(() {}); },
},
),
],
), ),
), ],
], ),
), ),
), ],
), ),
], ),
), ),
bottomSheet: model.state != ViewState.Idle ],
? Container( ),
height: 0, bottomSheet: model.state != ViewState.Idle
) ? Container(
: BottomSheetDialogButton( height: 0,
label: "${TranslationBase.of(context).addExamination}", )
onTap: () { : BottomSheetDialogButton(
widget.addSelectedExamination(mySelectedExaminationLocal); label: "${TranslationBase.of(context).addExamination}",
}, onTap: () {
), widget.addSelectedExamination(mySelectedExaminationLocal);
)); },
),
));
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where( Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where((element) =>
(element) => masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId);
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) { if (exam.length > 0) {
return true; return true;
} }

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
@ -11,7 +10,7 @@ import 'package:provider/provider.dart';
class ExaminationItemCard extends StatelessWidget { class ExaminationItemCard extends StatelessWidget {
final MySelectedExamination examination; final MySelectedExamination examination;
final Function removeExamination; final VoidCallback removeExamination;
ExaminationItemCard(this.examination, this.removeExamination); ExaminationItemCard(this.examination, this.removeExamination);
@ -30,37 +29,36 @@ class ExaminationItemCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
? examination.selectedExamination.nameAr != null && ? examination.selectedExamination!.nameAr != null && examination.selectedExamination!.nameAr != ""
examination.selectedExamination.nameAr != "" ? examination.selectedExamination!.nameAr
? examination.selectedExamination.nameAr : examination.selectedExamination!.nameEn
: examination.selectedExamination.nameEn : examination.selectedExamination!.nameEn,
: examination.selectedExamination.nameEn, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, fontFamily: 'Poppins',
fontFamily: 'Poppins', color: Color(0xFF2B353E),
color: Color(0xFF2B353E), fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier * 1.8, ),
), )),
)),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
!examination.isNormal !examination.isNormal!
? examination.isAbnormal ? examination.isAbnormal!
? TranslationBase.of(context).abnormal ? TranslationBase.of(context).abnormal
: TranslationBase.of(context).notExamined : TranslationBase.of(context).notExamined
: TranslationBase.of(context).normal, : TranslationBase.of(context).normal,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: !examination.isNormal color: !examination.isNormal!
? examination.isAbnormal ? examination.isAbnormal!
? Colors.red.shade800 ? Colors.red.shade800
: Colors.grey.shade800 : Colors.grey.shade800
: AppGlobal.appGreenColor, : Colors.green.shade800,
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
), ),
if (!examination.notExamined) if (!examination.notExamined)

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
@ -32,11 +31,11 @@ class UpdateObjectivePage extends StatefulWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage( UpdateObjectivePage(
{Key ? key, {Key? key,
this.changePageViewIndex, required this.changePageViewIndex,
this.patientInfo, required this.patientInfo,
this.changeLoadingState, required this.changeLoadingState,
this.currentIndex}); required this.currentIndex});
@override @override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState(); _UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -47,8 +46,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
bool isSysExaminationExpand = false; bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = []; List<MySelectedExamination> mySelectedExamination = [];
BoxDecoration containerBorderDecoration( BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -78,7 +76,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
id: element.examId, id: element.examId,
); );
MySelectedExamination tempEam = MySelectedExamination tempEam =
SoapUtils.generateMySelectedExamination( SoapUtils.generateMySelectedExamination(
examination: examMaster, examination: examMaster,
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
@ -108,13 +106,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex, changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
), ),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: headerTitle:
TranslationBase.of(context).physicalSystemExamination, TranslationBase.of(context).physicalSystemExamination,
onTap: () { onTap: () {
setState(() { setState(() {
isSysExaminationExpand = !isSysExaminationExpand; isSysExaminationExpand = !isSysExaminationExpand;
@ -124,7 +122,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
children: [ children: [
SOAPOpenItems( SOAPOpenItems(
label: label:
"${TranslationBase.of(context).addExamination}", "${TranslationBase.of(context).addExamination}",
onTap: () { onTap: () {
openExaminationList(context); openExaminationList(context);
}, },
@ -144,13 +142,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
Column( Column(
children: mySelectedExamination children: mySelectedExamination
.sublist( .sublist(
0, 0,
model.getFirstIndexForOldExamination( model.getFirstIndexForOldExamination(
mySelectedExamination) == mySelectedExamination) ==
-1 -1
? 0 ? 0
: model.getFirstIndexForOldExamination( : model.getFirstIndexForOldExamination(
mySelectedExamination)) mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
@ -160,7 +158,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
), ),
if (mySelectedExamination.isNotEmpty && if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination( model.getFirstIndexForOldExamination(
mySelectedExamination) > mySelectedExamination) >
-1) -1)
Row( Row(
children: [ children: [
@ -168,18 +166,18 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
"Verified", "Verified",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppGlobal.appGreenColor, color: Colors.green,
), ),
], ],
), ),
Column( Column(
children: mySelectedExamination children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination( .sublist(model.getFirstIndexForOldExamination(
mySelectedExamination) == mySelectedExamination) ==
-1 -1
? 0 ? 0
: model.getFirstIndexForOldExamination( : model.getFirstIndexForOldExamination(
mySelectedExamination)) mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
@ -228,9 +226,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
episodeId: widget.patientInfo.episodeNo == null?0: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo == null?0: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo == null?0:widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo == null?0:widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '', remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile!.doctorID, createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile!.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination!.id, examId: exam.selectedExamination!.id,
examType: exam.selectedExamination!.typeId, examType: exam.selectedExamination!.typeId,
@ -295,9 +293,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where( Iterable<MySelectedExamination> history = mySelectedExamination.where(
(element) => (element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId);
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) { if (history.length > 0) {
setState(() { setState(() {
@ -325,8 +322,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExaminationLocal.forEach((element) { mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere( if ((mySelectedExamination.singleWhere(
(it) => (it) =>
it.selectedExamination!.id == it.selectedExamination!.id ==
element.selectedExamination!.id)) == element.selectedExamination!.id)) ==
null) { null) {
mySelectedExamination.insert(0,element); mySelectedExamination.insert(0,element);
} }
@ -336,10 +333,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
List<MySelectedExamination> removedList = []; List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) { mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere( if ((mySelectedExaminationLocal.singleWhere(
(it) => (it) =>
it.selectedExamination!.id == it.selectedExamination!.id ==
element.selectedExamination!.id, element.selectedExamination!.id,
)) == )) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }

@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SOAPOpenItems extends StatelessWidget { class SOAPOpenItems extends StatelessWidget {
final Function onTap; final VoidCallback onTap;
final String label; final String label;
const SOAPOpenItems({Key? key, this.onTap, this.label}) : super(key: key); const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
BottomSheetTitle({ BottomSheetTitle({
Key? key, Key? key,
this.title, required this.title,
}) : super(key: key); }) : super(key: key);
final String title; final String title;

@ -9,12 +9,17 @@ import 'package:hexcolor/hexcolor.dart';
class ExpandableSOAPWidget extends StatelessWidget { class ExpandableSOAPWidget extends StatelessWidget {
final bool isExpanded; final bool isExpanded;
final Widget child; final Widget child;
final Function onTap; final VoidCallback onTap;
final headerTitle; final headerTitle;
final bool isRequired; final bool isRequired;
const ExpandableSOAPWidget( const ExpandableSOAPWidget(
{Key? key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) {Key? key,
required this.isExpanded,
required this.child,
required this.onTap,
this.headerTitle,
this.isRequired = true})
: super(key: key); : super(key: key);
@override @override

@ -17,7 +17,7 @@ import 'add_allergies.dart';
class UpdateAllergiesWidget extends StatefulWidget { class UpdateAllergiesWidget extends StatefulWidget {
List<MySelectedAllergy> myAllergiesList; List<MySelectedAllergy> myAllergiesList;
UpdateAllergiesWidget({Key? key, this.myAllergiesList}); UpdateAllergiesWidget({Key? key, required this.myAllergiesList});
@override @override
_UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState();
@ -38,6 +38,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
onTap: () { onTap: () {
openAllergiesList(context, changeAllState, removeAllergy); openAllergiesList(context, changeAllState, removeAllergy);
}, },
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -46,78 +47,75 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
margin: EdgeInsets.only(left: 15, right: 15, top: 15), margin: EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column( child: Column(
children: widget.myAllergiesList.map((selectedAllergy) { children: widget.myAllergiesList.map((selectedAllergy) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Row( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Row(
child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Container(
projectViewModel.isArabic child: Column(
? selectedAllergy.selectedAllergy.nameAr crossAxisAlignment: CrossAxisAlignment.start,
: selectedAllergy.selectedAllergy.nameEn children: [
.toUpperCase(), AppText(
textDecoration: selectedAllergy.isChecked projectViewModel.isArabic
? null ? selectedAllergy.selectedAllergy!.nameAr
: TextDecoration.lineThrough, : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(),
bold: true, textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough,
color: Color(0xFF2B353E), bold: true,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2B353E),
fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
letterSpacing: -0.48, fontWeight: FontWeight.w700,
// fontHeight:0.18 , letterSpacing: -0.48,
), // fontHeight:0.18 ,
AppText( ),
projectViewModel.isArabic AppText(
? selectedAllergy projectViewModel.isArabic
? selectedAllergy
.selectedAllergySeverity!.nameAr .selectedAllergySeverity!.nameAr
: selectedAllergy : selectedAllergy
.selectedAllergySeverity!.nameEn! .selectedAllergySeverity!.nameEn!
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy!.isChecked! textDecoration: selectedAllergy!.isChecked!
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
color: Color(0xFFCC9B14), color: Color(0xFFCC9B14),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.48, letterSpacing: -0.48,
),
],
), ),
width: MediaQuery.of(context).size.width * 0.5,
),
if (selectedAllergy.isChecked!)
RemoveButton(
onTap: () => removeAllergy(selectedAllergy),
)
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
children: [
RemarkText(remark: selectedAllergy.remark,),
], ],
), ),
width: MediaQuery.of(context).size.width * 0.5,
), ),
if (selectedAllergy.isChecked) DividerWithSpacesAround()
RemoveButton(
onTap: () => removeAllergy(selectedAllergy),
)
], ],
), ),
Padding( SizedBox(
padding: const EdgeInsets.symmetric(vertical: 8), height: 10,
child: Row(
children: [
RemarkText(remark: selectedAllergy.remark,),
],
),
), ),
DividerWithSpacesAround()
], ],
), );
SizedBox( }).toList()),
height: 10,
),
],
);
}).toList()),
) )
], ],
); );
@ -125,14 +123,13 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
removeAllergy(MySelectedAllergy mySelectedAllergy) { removeAllergy(MySelectedAllergy mySelectedAllergy) {
List<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
// ignore: missing_return // ignore: missing_return
widget.myAllergiesList widget.myAllergiesList
.where((element) => .where((element) =>
mySelectedAllergy.selectedAllergySeverity.id == mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id &&
element.selectedAllergySeverity.id && mySelectedAllergy.selectedAllergy!.id ==
mySelectedAllergy.selectedAllergy.id == element.selectedAllergy!.id)
element.selectedAllergy.id) .toList();
.toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if (allergy!.first!.isLocal!) { if (allergy!.first!.isLocal!) {
@ -167,9 +164,9 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
if (isAllDataFilled) { if (isAllDataFilled) {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere( if ((widget.myAllergiesList.singleWhere(
(it) => (it) =>
it.selectedAllergy!.id == it.selectedAllergy!.id ==
element.selectedAllergy!.id,)) == element.selectedAllergy!.id,)) ==
null) { null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
@ -180,8 +177,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
widget.myAllergiesList.forEach((element) { widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere( if ((mySelectedAllergy.singleWhere(
(it) => (it) =>
it.selectedAllergy!.id == it.selectedAllergy!.id ==
element.selectedAllergy!.id)) == element.selectedAllergy!.id)) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }
@ -193,8 +190,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
changeParentState(); changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Helpers.showErrorToast( Helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
TranslationBase.of(context).requiredMsg);
} }
}); });
}); });

@ -8,13 +8,13 @@ import '../medication/update_medication_widget.dart';
class UpdateChiefComplaints extends StatelessWidget { class UpdateChiefComplaints extends StatelessWidget {
const UpdateChiefComplaints({ const UpdateChiefComplaints({
Key? key, Key? key,
@required this.formKey, required this.formKey,
@required this.complaintsController, required this.complaintsController,
@required this.illnessController, required this.illnessController,
@required this.medicationController, required this.medicationController,
this.complaintsControllerError, required this.complaintsControllerError,
this.illnessControllerError, required this.illnessControllerError,
this.medicationControllerError, required this.medicationControllerError,
}) : super(key: key); }) : super(key: key);
final GlobalKey<FormState> formKey; final GlobalKey<FormState> formKey;

@ -23,12 +23,12 @@ class AddHistoryDialog extends StatefulWidget {
final Function(MasterKeyModel) removeHistory; final Function(MasterKeyModel) removeHistory;
const AddHistoryDialog( const AddHistoryDialog(
{Key ? key, {Key? key,
this.changePageViewIndex, required this.changePageViewIndex,
this.controller, required this.controller,
this.myHistoryList, required this.myHistoryList,
this.addSelectedHistories, required this.addSelectedHistories,
this.removeHistory}) required this.removeHistory})
: super(key: key); : super(key: key);
@override @override
@ -59,136 +59,135 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: appBar:
BottomSheetTitle(title: TranslationBase.of(context).addHistory!), BottomSheetTitle(title: TranslationBase.of(context).addHistory!),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
PriorityBar(onTap: (activePriority) async { PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority); widget.changePageViewIndex(activePriority);
}), }),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Expanded( Expanded(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: widget.controller, controller: widget.controller,
onPageChanged: (index) { onPageChanged: (index) {
setState(() {}); setState(() {});
}, },
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: MasterKeyCheckboxSearchWidget( child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
masterList: model.historyFamilyList, masterList: model.historyFamilyList,
removeHistory: (history) { removeHistory: (history) {
setState(() { setState(() {
widget.removeHistory(history); widget.removeHistory(history);
}); });
}, },
addHistory: (history) { addHistory: (history) {
setState(() { setState(() {
createAndAddHistory(history); createAndAddHistory(history);
}); });
}, },
addSelectedHistories: () { addSelectedHistories: () {
widget.addSelectedHistories(); widget.addSelectedHistories();
}, },
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
), ),
), ),
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: MasterKeyCheckboxSearchWidget( child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
masterList: model masterList: model
.mergeHistorySurgicalWithHistorySportList, .mergeHistorySurgicalWithHistorySportList,
removeHistory: (history) { removeHistory: (history) {
setState(() { setState(() {
widget.removeHistory(history); widget.removeHistory(history);
}); });
}, },
addHistory: (history) { addHistory: (history) {
setState(() { setState(() {
createAndAddHistory(history); createAndAddHistory(history);
}); });
}, },
addSelectedHistories: () { addSelectedHistories: () {
widget.addSelectedHistories(); widget.addSelectedHistories();
}, },
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
), ),
), ),
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: MasterKeyCheckboxSearchWidget( child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
masterList: model.historyMedicalList, masterList: model.historyMedicalList,
removeHistory: (history) { removeHistory: (history) {
setState(() { setState(() {
widget.removeHistory(history); widget.removeHistory(history);
}); });
}, },
addHistory: (history) { addHistory: (history) {
setState(() { setState(() {
createAndAddHistory(history); createAndAddHistory(history);
}); });
}, },
addSelectedHistories: () { addSelectedHistories: () {
widget.addSelectedHistories(); widget.addSelectedHistories();
}, },
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
), ),
),
],
), ),
], ),
), ),
), SizedBox(
), height: MediaQuery.of(context).size.height * 0.11,
SizedBox( )
height: MediaQuery.of(context).size.height * 0.11, ],
) )),
],
)),
), ),
bottomSheet: model.state != ViewState.Idle bottomSheet: model.state != ViewState.Idle
? Container( ? Container(
height: 0, height: 0,
) )
: BottomSheetDialogButton( : BottomSheetDialogButton(
label: TranslationBase.of(context).addSelectedHistories, label: TranslationBase.of(context).addSelectedHistories,
onTap: () { onTap: () {
widget.addSelectedHistories(); widget.addSelectedHistories();
}, },
), ),
), ),
)); ));
} }
createAndAddHistory(MasterKeyModel history) { createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList List<MySelectedHistory> myhistory = widget.myHistoryList
.where((element) => .where(
history.id == element.selectedHistory.id && (element) => history.id == element.selectedHistory!.id && history.typeId == element.selectedHistory!.typeId)
history.typeId == element.selectedHistory.typeId)
.toList(); .toList();
if (myhistory.isEmpty) { if (myhistory.isEmpty) {
setState(() { setState(() {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
remark: history.remarks ?? "", remark: history.remarks ?? "",
history: history, history: history,
isChecked: true); isChecked: true);
widget.myHistoryList.add(mySelectedHistory); widget.myHistoryList.add(mySelectedHistory);
}); });
@ -198,11 +197,10 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedHistory> history = widget.myHistoryList.where( Iterable<MySelectedHistory> history = widget.myHistoryList.where((element) =>
(element) => masterKey.id == element.selectedHistory!.id &&
masterKey.id == element.selectedHistory.id && masterKey.typeId == element.selectedHistory!.typeId &&
masterKey.typeId == element.selectedHistory.typeId && element.isChecked!);
element.isChecked);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }

@ -8,7 +8,7 @@ import 'package:provider/provider.dart';
class PriorityBar extends StatefulWidget { class PriorityBar extends StatefulWidget {
final Function onTap; final Function onTap;
const PriorityBar({Key ? key, this.onTap}) : super(key: key); const PriorityBar({Key? key, required this.onTap}) : super(key: key);
@override @override
_PriorityBarState createState() => _PriorityBarState(); _PriorityBarState createState() => _PriorityBarState();

@ -14,15 +14,14 @@ import 'add_history_dialog.dart';
class UpdateHistoryWidget extends StatefulWidget { class UpdateHistoryWidget extends StatefulWidget {
final List<MySelectedHistory> myHistoryList; final List<MySelectedHistory> myHistoryList;
const UpdateHistoryWidget({Key ? key, this.myHistoryList}) : super(key: key); const UpdateHistoryWidget({Key? key, required this.myHistoryList}) : super(key: key);
@override @override
_UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState();
} }
class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerProviderStateMixin {
with TickerProviderStateMixin { late PageController _controller;
PageController _controller;
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
@ -61,16 +60,14 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
Container( Container(
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
? myHistory.selectedHistory.nameAr ? myHistory.selectedHistory!.nameAr
: myHistory.selectedHistory.nameEn, : myHistory.selectedHistory!.nameEn,
textDecoration: myHistory.isChecked
? null textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough,
: TextDecoration.lineThrough,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.48, letterSpacing: -0.48,),
),
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
if (myHistory!.isChecked!) if (myHistory!.isChecked!)
@ -93,14 +90,13 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
removeHistory(MasterKeyModel historyKey) { removeHistory(MasterKeyModel historyKey) {
List<MySelectedHistory> history = List<MySelectedHistory> history =
// ignore: missing_return // ignore: missing_return
widget.myHistoryList widget.myHistoryList
.where((element) => .where((element) =>
historyKey.id == element.selectedHistory.id && historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId)
historyKey.typeId == element.selectedHistory.typeId) .toList();
.toList();
if (history.length > 0) { if (history.length > 0){
if (history!.first!.isLocal!) { if (history!.first!.isLocal!) {
setState(() { setState(() {
widget.myHistoryList.remove(history.first); widget.myHistoryList.remove(history.first);

@ -10,7 +10,7 @@ class UpdateMedicationWidget extends StatefulWidget {
UpdateMedicationWidget({ UpdateMedicationWidget({
Key? key, Key? key,
this.medicationController, required this.medicationController,
}); });
@override @override

@ -26,11 +26,11 @@ class UpdateSubjectivePage extends StatefulWidget {
final int currentIndex; final int currentIndex;
UpdateSubjectivePage( UpdateSubjectivePage(
{Key ? key, {Key? key,
this.changePageViewIndex, required this.changePageViewIndex,
this.patientInfo, required this.patientInfo,
this.changeLoadingState, required this.changeLoadingState,
this.currentIndex}); required this.currentIndex});
@override @override
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
@ -53,67 +53,63 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
widget.changeLoadingState(true); widget.changeLoadingState(true);
if (model.patientHistoryList.isNotEmpty) { if (model.patientHistoryList.isNotEmpty) {
model.patientHistoryList.forEach((element) { model.patientHistoryList.forEach((element) {
if (element.historyType == if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeysService.HistoryFamily.getMasterKeyService()) { MasterKeyModel? history = model.getOneMasterKey(
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily, masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId, id: element.historyId,
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, history: history,
isChecked: element.isChecked, isChecked: element.isChecked,
remark: element.remarks, remark: element.remarks,
isLocal: false); isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeysService.HistoryMedical.getMasterKeyService()) { MasterKeyModel? history = model.getOneMasterKey(
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical, masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId, id: element.historyId,
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, history: history,
isChecked: element.isChecked, isChecked: element.isChecked,
remark: element.remarks, remark: element.remarks,
isLocal: false); isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeysService.HistorySports.getMasterKeyService()) { MasterKeyModel? history = model.getOneMasterKey(
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports, masterKeys: MasterKeysService.HistorySports,
id: element.historyId, id: element.historyId,
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, history: history,
isChecked: element.isChecked, isChecked: element.isChecked,
remark: element.remarks, remark: element.remarks,
isLocal: false); isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
MasterKeysService.HistorySurgical.getMasterKeyService()) { MasterKeyModel? history = model.getOneMasterKey(
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical, masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId, id: element.historyId,
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, history: history,
isChecked: element.isChecked, isChecked: element.isChecked,
remark: element.remarks, remark: element.remarks,
isLocal: false); isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
@ -124,35 +120,30 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
getAllergies(SOAPViewModel model) async { getAllergies(SOAPViewModel model) async {
if (model.patientAllergiesList.isNotEmpty) { if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) { model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey( MasterKeyModel? selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies, masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity; MasterKeyModel selectedAllergySeverity;
if (element.severity == 0) { if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel( selectedAllergySeverity = MasterKeyModel(
id: 0, id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(),
typeId: MasterKeysService.AllergySeverity.getMasterKeyService(),
nameAr: '', nameAr: '',
nameEn: ''); nameEn: '');
} else { } else {
selectedAllergySeverity = model.getOneMasterKey( selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity, masterKeys: MasterKeysService.AllergySeverity,
id: element.severity, id: element.severity,
); )!;
} }
MySelectedAllergy mySelectedAllergy = MySelectedAllergy mySelectedAllergy =
SoapUtils.generateMySelectedAllergy( SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy, allergy: selectedAllergy,
isChecked: element.isChecked, isChecked: element.isChecked,
createdBy: element!.createdBy!, createdBy: element!.createdBy!,
remark: element.remarks, remark: element.remarks,
isLocal: false, isLocal: false,
allergySeverity: selectedAllergySeverity); allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
if (selectedAllergy != null && selectedAllergySeverity != null)
myAllergiesList.add(mySelectedAllergy);
}); });
} }
} }
@ -168,14 +159,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (model.patientChiefComplaintList.isNotEmpty) { if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true; isChiefExpand = true;
complaintsController.text = Helpers.parseHtmlString( complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!);
model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi!;
illnessController.text = model.patientChiefComplaintList[0].hopi; medicationController.text = !(model.patientChiefComplaintList[0].currentMedication)!.isNotEmpty
medicationController.text = ? model.patientChiefComplaintList[0].currentMedication! + '\n \n'
!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty : model.patientChiefComplaintList[0].currentMedication!;
? model.patientChiefComplaintList[0].currentMedication +
'\n \n'
: model.patientChiefComplaintList[0].currentMedication;
} }
if (widget.patientInfo.admissionNo == null) { if (widget.patientInfo.admissionNo == null) {
await getHistory(model); await getHistory(model);
@ -215,10 +203,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
illnessController: illnessController, illnessController: illnessController,
medicationController: medicationController, medicationController: medicationController,
complaintsControllerError: complaintsControllerError:
model.complaintsControllerError, model.complaintsControllerError,
illnessControllerError: model.illnessControllerError, illnessControllerError: model.illnessControllerError,
medicationControllerError: medicationControllerError:
model.medicationControllerError, model.medicationControllerError,
), ),
isExpanded: isChiefExpand, isExpanded: isChiefExpand,
), ),
@ -226,47 +214,43 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 4 : 2), (SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
if (widget.patientInfo.admissionNo == null) if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget(
ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).histories,
headerTitle: TranslationBase.of(context).histories, isRequired: false,
isRequired: false, onTap: () {
onTap: () { setState(() {
setState(() { isHistoryExpand = !isHistoryExpand;
isHistoryExpand = !isHistoryExpand; });
}); },
}, child: Column(
child: Column( children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
children: [
UpdateHistoryWidget(myHistoryList: myHistoryList)
],
),
isExpanded: isHistoryExpand,
), ),
isExpanded: isHistoryExpand,
),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 4 : 2), (SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
if (widget.patientInfo.admissionNo == null) if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget(
ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).allergiesSoap,
headerTitle: TranslationBase.of(context).allergiesSoap, isRequired: false,
isRequired: false, onTap: () {
onTap: () { setState(() {
setState(() { isAllergiesExpand = !isAllergiesExpand;
isAllergiesExpand = !isAllergiesExpand; });
}); },
}, child: Column(
child: Column( children: [
children: [ UpdateAllergiesWidget(
UpdateAllergiesWidget( myAllergiesList: myAllergiesList,
myAllergiesList: myAllergiesList, ),
), SizedBox(
SizedBox( height: 30,
height: 30, ),
), ],
],
),
isExpanded: isAllergiesExpand,
), ),
isExpanded: isAllergiesExpand,
),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 20 : 10), (SizeConfig.isHeightVeryShort ? 20 : 10),
@ -282,8 +266,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
addSubjectiveInfo( addSubjectiveInfo(
{required SOAPViewModel model, {required SOAPViewModel model,
required List<MySelectedAllergy> myAllergiesList, required List<MySelectedAllergy> myAllergiesList,
required List<MySelectedHistory> myHistoryList}) async { required List<MySelectedHistory> myHistoryList}) async {
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
widget.changeLoadingState(true); widget.changeLoadingState(true);
formKey.currentState!.save(); formKey.currentState!.save();
@ -310,21 +294,17 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
} else { } else {
setState(() { setState(() {
if (complaintsController.text.isEmpty) { if (complaintsController.text.isEmpty) {
model.complaintsControllerError = model.complaintsControllerError = TranslationBase.of(context).emptyMessage!;
TranslationBase.of(context).emptyMessage;
} else if (complaintsController.text.length < 25) { } else if (complaintsController.text.length < 25) {
model.complaintsControllerError = model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLength!;
TranslationBase.of(context).chiefComplaintLength;
} }
if (illnessController.text.isEmpty) { if (illnessController.text.isEmpty) {
model.illnessControllerError = model.illnessControllerError = TranslationBase.of(context).emptyMessage!;
TranslationBase.of(context).emptyMessage;
} }
if (medicationController.text.isEmpty) { if (medicationController.text.isEmpty) {
model.medicationControllerError = model.medicationControllerError = TranslationBase.of(context).emptyMessage!;
TranslationBase.of(context).emptyMessage;
} }
}); });
@ -335,8 +315,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
} }
@override @override
VoidCallback? nextFunction(model) { VoidCallback? nextFunction(model) {
addSubjectiveInfo( addSubjectiveInfo(
model: model, model: model,
myAllergiesList: myAllergiesList, myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList); myHistoryList: myHistoryList);

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -21,22 +22,21 @@ import 'plan/update_plan_page.dart';
class UpdateSoapIndex extends StatefulWidget { class UpdateSoapIndex extends StatefulWidget {
final bool isUpdate; final bool isUpdate;
const UpdateSoapIndex({Key ? key, this.isUpdate}) : super(key: key); const UpdateSoapIndex({Key? key, required this.isUpdate}) : super(key: key);
@override @override
_UpdateSoapIndexState createState() => _UpdateSoapIndexState(); _UpdateSoapIndexState createState() => _UpdateSoapIndexState();
} }
class _UpdateSoapIndexState extends State<UpdateSoapIndex> class _UpdateSoapIndexState extends State<UpdateSoapIndex> with TickerProviderStateMixin {
with TickerProviderStateMixin { PageController? _controller;
PageController _controller;
int _currentIndex = 0; int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList = []; List<MySelectedAllergy> myAllergiesList = [];
List<MySelectedHistory> myHistoryList = []; List<MySelectedHistory> myHistoryList = [];
changePageViewIndex(pageIndex, {isChangeState = true}) { changePageViewIndex(pageIndex, {isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
_controller.jumpToPage(pageIndex); _controller?.jumpToPage(pageIndex);
setState(() { setState(() {
_currentIndex = pageIndex; _currentIndex = pageIndex;
}); });
@ -64,7 +64,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
builder: (_,model,w)=>AppScaffold( builder: (_,model,w)=>AppScaffold(
@ -72,8 +72,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar(patient), appBar: PatientProfileAppBar(patient),
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(
isInpatient:patient.admissionNo== null || patient.admissionNo!.isEmpty?false:true , isInpatient:patient.admissionNo== null || patient.admissionNo!.isEmpty?false:true ,
patient: patient patient: patient
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
@ -149,8 +149,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
), ),
Container( Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: .80, widthFactor: .80,
child: getBottomSheet(model, patient) child: getBottomSheet(model, patient)
), ),
), ),
SizedBox( SizedBox(
@ -258,7 +258,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
padding: 10, padding: 10,
disabled: model.state == ViewState.BusyLocal, disabled: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
model.nextOnAssessmentPage(model); model.nextOnAssessmentPage(model);
}, },
), ),
), ),
@ -283,7 +283,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal, disabled: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
changePageViewIndex(2); changePageViewIndex(2);
}, },
), ),
), ),
@ -302,7 +302,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
color: Colors.red[700], color: Colors.red[700],
disabled: model.progressNoteText.isEmpty, disabled: model.progressNoteText.isEmpty,
onPressed: () async { onPressed: () async {
model.nextOnPlanPage(model); model.nextOnPlanPage(model);
}, },
), ),
), ),

@ -17,13 +17,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget {
final String viewKey2; final String viewKey2;
VitalSignBloodPressureWidget( VitalSignBloodPressureWidget(
{Key ? key, {Key? key,
this.vitalList, required this.vitalList,
this.title1, required this.title1,
this.title2, required this.title2,
this.viewKey1, required this.viewKey1,
this.title3, required this.title3,
this.viewKey2}); required this.viewKey2});
@override @override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -96,7 +96,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
), ),
Table( Table(
border: TableBorder( border: TableBorder(
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!),
), ),
children: fullData(projectViewModel), children: fullData(projectViewModel),
), ),

@ -15,7 +15,7 @@ class VitalSignDetailsWidget extends StatefulWidget {
final String viewKey; final String viewKey;
VitalSignDetailsWidget( VitalSignDetailsWidget(
{Key ? key, this.vitalList, this.title1, this.title2, this.viewKey}); {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey});
@override @override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -93,7 +93,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
), ),
Table( Table(
border: TableBorder( border: TableBorder(
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!),
), ),
children: fullData(projectViewModel), children: fullData(projectViewModel),
), ),

@ -9,17 +9,17 @@ class VitalSignItem extends StatelessWidget {
final String lastVal; final String lastVal;
final String unit; final String unit;
final String imagePath; final String imagePath;
final double height; final double? height;
final double width; final double? width;
const VitalSignItem( const VitalSignItem(
{Key ? key, {Key? key,
@required this.des, required this.des,
this.lastVal = 'N/A', this.lastVal = 'N/A',
this.unit = '', this.unit = '',
this.height, this.height,
this.width, this.width,
@required this.imagePath}) required this.imagePath})
: super(key: key); : super(key: key);
@override @override

@ -14,20 +14,20 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class VitalSignItemDetailsScreen extends StatelessWidget { class VitalSignItemDetailsScreen extends StatelessWidget {
final vitalSignDetails pageKey; final vitalSignDetails? pageKey;
final String pageTitle; final String? pageTitle;
List<Map> VSchart; List<Map>? VSchart;
PatiantInformtion patient; PatiantInformtion patient;
String patientType; String patientType;
String arrivalType; String arrivalType;
VitalSignItemDetailsScreen( VitalSignItemDetailsScreen(
{this.vitalList, {required this.vitalList,
this.pageKey, required this.pageKey,
this.pageTitle, required this.pageTitle,
this.patient, required this.patient,
this.patientType, required this.patientType,
this.arrivalType}); required this.arrivalType});
final List<VitalSignHistory> vitalList; final List<VitalSignHistory> vitalList;
@ -187,7 +187,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
default: default:
} }
return AppScaffold( return AppScaffold(
appBarTitle: pageTitle, appBarTitle: pageTitle ?? "",
backgroundColor: Color.fromRGBO(248, 248, 248, 1), backgroundColor: Color.fromRGBO(248, 248, 248, 1),
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
@ -202,7 +202,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -220,7 +220,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
child: ListView( child: ListView(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: VSchart.map((chartInfo) { children: VSchart!.map((chartInfo) {
var vitalListTemp = vitalList.where( var vitalListTemp = vitalList.where(
(element) => element.toJson()[chartInfo['viewKey']] != null, (element) => element.toJson()[chartInfo['viewKey']] != null,
); );

@ -11,12 +11,12 @@ import 'LineChartCurved.dart';
class VitalSingChartAndDetials extends StatelessWidget { class VitalSingChartAndDetials extends StatelessWidget {
VitalSingChartAndDetials({ VitalSingChartAndDetials({
Key ? key, Key? key,
@required this.vitalList, required this.vitalList,
@required this.name, required this.name,
@required this.viewKey, required this.viewKey,
@required this.title1, required this.title1,
@required this.title2, required this.title2,
}) : super(key: key); }) : super(key: key);
final List<VitalSignHistory> vitalList; final List<VitalSignHistory> vitalList;

@ -11,14 +11,14 @@ import 'LineChartCurvedBloodPressure.dart';
class VitalSingChartBloodPressure extends StatelessWidget { class VitalSingChartBloodPressure extends StatelessWidget {
VitalSingChartBloodPressure({ VitalSingChartBloodPressure({
Key ? key, Key? key,
@required this.vitalList, required this.vitalList,
@required this.name, required this.name,
@required this.viewKey1, required this.viewKey1,
@required this.viewKey2, required this.viewKey2,
@required this.title1, required this.title1,
@required this.title2, required this.title2,
@required this.title3, required this.title3,
}) : super(key: key); }) : super(key: key);
final List<VitalSignHistory> vitalList; final List<VitalSignHistory> vitalList;

Loading…
Cancel
Save