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';
@ -104,7 +104,6 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
), ),
), ),
], ],
), ),
)); ));
@ -113,9 +112,9 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
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);
@ -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,9 +19,9 @@ 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
@ -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;
@ -99,10 +98,18 @@ 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(
@ -149,11 +156,13 @@ class StepWidget extends StatelessWidget {
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: status == StepStatus.InProgress
? Color(0xFFF1E9D3) ? Color(0xFFF1E9D3)
: status == StepStatus.Locked : status == StepStatus.Locked
? Color(0x29797979) ? Color(0x29797979)
: Color(0xFFD8E8D8), width: 0.30), : Color(0xFFD8E8D8),
width: 0.30),
), ),
child: AppText( child: AppText(
status == StepStatus.InProgress status == StepStatus.InProgress

@ -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,6 +407,7 @@ 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,
@ -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,13 +222,12 @@ 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', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier,
@ -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 {

@ -35,11 +35,11 @@ class AddAssessmentDetails extends StatefulWidget {
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,
@ -162,86 +146,55 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
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<
MasterKeyModel>(
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
TranslationBase.of(context)
.nameOrICD,
null,
true,
suffixIcon: Icons.search), suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() { itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment.selectedICD = item;
.selectedICD = item; icdNameController.text = '${item.code.trim()}/${item.description}';
icdNameController.text =
'${item.code.trim()}/${item.description}';
}), }),
key: key,
suggestions: model.listOfICD10, suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) => itemBuilder: (context, suggestion) => new Padding(
new Padding( child: AppText(suggestion.description + " / " + suggestion.code.toString()),
child: AppText(
suggestion.description +
" / " +
suggestion.code
.toString()),
padding: EdgeInsets.all(8.0)), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1, itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) => itemFilter: (suggestion, input) =>
suggestion.description suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
.toLowerCase() suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
.startsWith( suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.code
.toLowerCase()
.startsWith(
input.toLowerCase()),
), ),
) )
: AppTextFieldCustom( : AppTextFieldCustom(height: Helpers.getTextFieldHeight(),
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) hintText: TranslationBase.of(context).nameOrICD,
.nameOrICD,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
controller: icdNameController, controller: icdNameController,
enabled: true, enabled: true,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
suffixIcon: IconButton( suffixIcon: IconButton(
onPressed: () {},
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)
@ -272,32 +225,17 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 7, height: 7,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: Helpers.getTextFieldHeight(), height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisCondition != null
onClick: model.listOfDiagnosisCondition != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition, list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,okFunction: (MasterKeyModel selectedValue) {
okFunction:
(MasterKeyModel selectedValue) {
setState(() { setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
.selectedDiagnosisCondition = conditionController.text = projectViewModel.isArabic
selectedValue; ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? ""
conditionController : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? "";
.text = projectViewModel
.isArabic
? widget
.mySelectedAssessment
.selectedDiagnosisCondition
.nameAr
: widget
.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
}); });
}, },
); );
@ -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,24 +264,16 @@ 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( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType, list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,okFunction: (MasterKeyModel selectedValue) {
okFunction:
(MasterKeyModel selectedValue) {
setState(() { setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment.selectedDiagnosisType = selectedValue;
.selectedDiagnosisType =
selectedValue;
typeController.text = typeController.text =
projectViewModel.isArabic (projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn)!;
? selectedValue.nameAr
: selectedValue.nameEn;
}); });
}, },
); );
@ -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,15 +359,14 @@ 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,
@ -461,9 +374,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
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,8 +389,8 @@ 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();
@ -60,23 +59,20 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
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) {
MySelectedAssessment temMySelectedAssessment =
SoapUtils.generateMySelectedAssessment(
appointmentNo: element.appointmentNo, appointmentNo: element.appointmentNo,
remark: element.remarks, remark: element.remarks,
diagnosisType: diagnosisType, diagnosisType: diagnosisType,
@ -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();
@ -52,6 +50,7 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
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: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -73,10 +72,8 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
children: [ children: [
ExaminationsListSearchWidget( ExaminationsListSearchWidget(
mySelectedExamination: mySelectedExamination:
widget.mySelectedExamination, widget.mySelectedExamination,masterList: model.physicalExaminationList,
masterList: model.physicalExaminationList, isServiceSelected: (master) => isServiceSelected(master),
isServiceSelected: (master) =>
isServiceSelected(master),
removeExamination: (selectedExamination) { removeExamination: (selectedExamination) {
setState(() { setState(() {
mySelectedExaminationLocal.remove(selectedExamination); mySelectedExaminationLocal.remove(selectedExamination);
@ -84,8 +81,7 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
}, },
addExamination: (selectedExamination) { addExamination: (selectedExamination) {
mySelectedExaminationLocal mySelectedExaminationLocal.insert(0, selectedExamination);
.insert(0, selectedExamination);
// setState(() {}); // setState(() {});
}, },
), ),
@ -112,10 +108,8 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
} }
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);
@ -32,11 +31,10 @@ class ExaminationItemCard extends StatelessWidget {
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),
@ -49,18 +47,18 @@ class ExaminationItemCard extends StatelessWidget {
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';
@ -33,10 +32,10 @@ class UpdateObjectivePage extends StatefulWidget {
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,
@ -168,7 +166,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
"Verified", "Verified",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppGlobal.appGreenColor, color: Colors.green,
), ),
], ],
), ),
@ -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,
@ -296,8 +294,7 @@ 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(() {

@ -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,
@ -63,12 +64,9 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
children: [ children: [
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr ? selectedAllergy.selectedAllergy!.nameAr
: selectedAllergy.selectedAllergy.nameEn : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(),
.toUpperCase(), textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough,
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true, bold: true,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
@ -95,7 +93,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
), ),
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
if (selectedAllergy.isChecked) if (selectedAllergy.isChecked!)
RemoveButton( RemoveButton(
onTap: () => removeAllergy(selectedAllergy), onTap: () => removeAllergy(selectedAllergy),
) )
@ -128,10 +126,9 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
// 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) {
@ -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;

@ -24,11 +24,11 @@ class AddHistoryDialog extends StatefulWidget {
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
@ -177,9 +177,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
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) {
@ -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!)
@ -96,8 +93,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
// 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){

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

@ -27,10 +27,10 @@ class UpdateSubjectivePage extends StatefulWidget {
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,9 +53,8 @@ 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,
); );
@ -69,9 +68,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
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,
); );
@ -85,9 +83,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
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,
); );
@ -101,9 +98,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
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,
); );
@ -124,22 +120,19 @@ 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 =
@ -150,9 +143,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
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);
@ -226,8 +214,7 @@ 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: () {
@ -236,9 +223,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
}); });
}, },
child: Column( child: Column(
children: [ children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
UpdateHistoryWidget(myHistoryList: myHistoryList)
],
), ),
isExpanded: isHistoryExpand, isExpanded: isHistoryExpand,
), ),
@ -246,8 +231,7 @@ 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).allergiesSoap, headerTitle: TranslationBase.of(context).allergiesSoap,
isRequired: false, isRequired: false,
onTap: () { onTap: () {
@ -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;
} }
}); });

@ -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(

@ -18,12 +18,12 @@ class VitalSignBloodPressureWidget extends StatefulWidget {
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,
); );

@ -12,11 +12,11 @@ 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;

@ -12,13 +12,13 @@ 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