Null Safety Update

ipd-changes-for-vida-plus
Aamir Muhammad 3 years ago
parent 597d5a3498
commit 76f8b37d1e

@ -4,19 +4,12 @@ class MySelectedAllergy {
MasterKeyModel? selectedAllergySeverity;
MasterKeyModel? selectedAllergy;
String? remark;
bool? isChecked;
bool? isExpanded;
bool? isLocal;
bool isChecked;
bool isExpanded;
bool isLocal;
int? createdBy;
bool? hasValidationError;
bool hasValidationError;
MySelectedAllergy(
{this.selectedAllergySeverity,
this.selectedAllergy,
this.remark,
this.isChecked,
this.isExpanded = true,
this.isLocal = true,
this.createdBy,
this.hasValidationError = false});
{this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked = false, this.isExpanded = true, this.isLocal = true, this.createdBy, this.hasValidationError = false});
}

@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
class MySelectedExamination {
MasterKeyModel? selectedExamination;
String? remark;
bool? isNormal;
bool? isAbnormal;
bool? notExamined;
bool? isNew;
bool? isLocal;
bool isNormal;
bool isAbnormal;
bool notExamined;
bool isNew;
bool isLocal;
int? createdBy;
String? createdOn;
String? editedOn;

@ -7,8 +7,6 @@ import 'package:firebase_analytics/observer.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import './config/size_config.dart';

@ -23,11 +23,11 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:hexcolor/hexcolor.dart';
class EndCallScreen extends StatefulWidget {
final PatiantInformtion patient;
final PatiantInformtion? patient;
const EndCallScreen({
Key? key,
required this.patient,
this.patient,
}) : super(key: key);
@override
@ -49,7 +49,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
@override
void initState() {
super.initState();
if (widget.patient != null) patient = widget.patient;
if (widget.patient != null) patient = widget.patient!;
}
@override
@ -233,11 +233,11 @@ class _EndCallScreenState extends State<EndCallScreen> {
isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap,
onTap: cardsList[index].onTap!,
isLoading: cardsList[index].isLoading,
isDartIcon: cardsList[index].isDartIcon,
dartIcon: cardsList[index].dartIcon,
color: cardsList[index].color,
dartIcon: cardsList[index].dartIcon!,
color: cardsList[index].color!,
),
),
],

@ -29,7 +29,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
builder: (_, model, w) => AppScaffold(
//appBarTitle: 'Discharged Patient',
//subtitle: "Last Three Months",
backgroundColor: Colors.grey[200],
backgroundColor: Colors.grey[200]!,
isShowAppBar: false,
baseViewModel: model,
body: model.myDischargedPatient.isEmpty
@ -58,7 +58,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
iconSize: 20, onPressed: () { },
),
),
SizedBox(
@ -155,17 +155,17 @@ class _DischargedPatientState extends State<DischargedPatient> {
.filterData[
index]
.nationalityName
.trim()
!.trim()
: model.filterData[index].nationality !=
null
? model
.filterData[
index]
.nationality
.trim()
!.trim()
: model.filterData[index].nationalityId !=
null
? model.filterData[index].nationalityId
? model.filterData[index].nationalityId!
: "",
fontWeight:
FontWeight
@ -187,7 +187,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
.network(
model.filterData[index].nationalityFlagURL !=
null
? model.filterData[index].nationalityFlagURL
? model.filterData[index].nationalityFlagURL!
: '',
height:
25,
@ -196,7 +196,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
errorBuilder: (BuildContext context,
Object
exception,
StackTrace
StackTrace?
stackTrace) {
return AppText(
'',
@ -254,7 +254,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
style: new TextStyle(
fontSize: 2.0 *
SizeConfig
.textMultiplier,
.textMultiplier!,
color: Colors
.black),
children: <
@ -292,7 +292,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
new TextStyle(
fontSize: 2.0 *
SizeConfig
.textMultiplier,
.textMultiplier!,
color: Colors
.black,
fontFamily:
@ -330,7 +330,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
new TextStyle(
fontSize: 2.0 *
SizeConfig
.textMultiplier,
.textMultiplier!,
color: Colors
.black,
fontFamily:
@ -369,7 +369,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
.w300,
),
AppText(
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}",
fontSize:
15,
fontWeight:

@ -17,7 +17,7 @@ import 'package:url_launcher/url_launcher.dart';
class ECGPage extends StatelessWidget {
@override
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'];
String patientType = routeArgs['patient-type'];
String arrivalType = routeArgs['arrival-type'];
@ -60,7 +60,7 @@ class ECGPage extends StatelessWidget {
(index) => InkWell(
onTap: () async {
await launch(model
.patientMuseResultsModelList[index].imageURL);
.patientMuseResultsModelList[index].imageURL!);
},
child: Container(
width: double.infinity,
@ -92,7 +92,7 @@ class ECGPage extends StatelessWidget {
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
@ -122,15 +122,15 @@ class ECGPage extends StatelessWidget {
CrossAxisAlignment.end,
children: [
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!, isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}',
fontWeight: FontWeight.w600,
color: Colors.grey[700],
color: Colors.grey[700]!,
fontSize: 14,
),
],

@ -50,9 +50,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
Expanded(
child: AppText(
(Utils.capitalize(
"${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5,
(Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier! * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -68,20 +67,15 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
InkWell(
onTap: () {
PatiantInformtion patient =
model.getPatientFromDischargeReferralPatient(
referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
PatiantInformtion patient = model.getPatientFromDischargeReferralPatient(referredPatient);
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"isDischargedPatient": true,
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Icon(
@ -112,27 +106,26 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}",
"${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}",
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? AppGlobal.inProgressColor
: referredPatient.referralStatus == 46
? AppGlobal.appGreenColor
: Colors.red[700],
: Colors.red[700]!,
),
AppText(
AppDateUtils.getDayMonthYearDateFormatted(
referredPatient.referralDate,
referredPatient.referralDate!,
),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Color(0XFF28353E),
)
],
@ -145,19 +138,15 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"Admission Date: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
AppDateUtils
.convertDateFromServerFormat(
referredPatient.admissionDate,
"dd MMM,yyyy"),
AppDateUtils.convertDateFromServerFormat(referredPatient.admissionDate!, "dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -171,19 +160,15 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"Discharge Date: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
AppDateUtils
.convertDateFromServerFormat(
referredPatient.dischargeDate,
"dd MMM,yyyy"),
AppDateUtils.convertDateFromServerFormat(referredPatient.dischargeDate!, "dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -197,16 +182,15 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"Number of Days: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
"${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}",
"${AppDateUtils.convertStringToDate(referredPatient.dischargeDate!).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate!)).inDays + 1}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -220,44 +204,38 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"Referring Doctor ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.referringDoctorName,
referredPatient.referringDoctorName!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.fileNumber,
TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
"${referredPatient.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -265,60 +243,48 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
referredPatient
.referringClinicDescription,
referredPatient.referringClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.frequency +
": ",
TranslationBase.of(context).frequency + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.frequencyDescription,
referredPatient.frequencyDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -334,20 +300,18 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).priority +
": ",
TranslationBase.of(context).priority + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.priorityDescription,
referredPatient.priorityDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -361,17 +325,15 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"Referring Clinic ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.referringClinicDescription,
referredPatient.referringClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -385,7 +347,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"Frequency ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
@ -393,8 +355,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
referredPatient.frequency.toString(),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -408,7 +369,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"Priority ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
@ -416,8 +377,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
referredPatient.frequency.toString(),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -428,24 +388,18 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.maxResponseTime +
": ",
TranslationBase.of(context).maxResponseTime + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
AppDateUtils
.convertDateFromServerFormat(
referredPatient.mAXResponseTime,
"dd MMM,yyyy"),
AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime!, "dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -455,8 +409,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 0),
margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
'assets/images/patient/ic_ref_arrow_left.png',
height: 50,
@ -500,30 +453,22 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10,
top: 30,
right: 10,
bottom: 0),
margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.5 *
SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Colors.black,
),
AppText(
referredPatient
.referringClinicDescription,
referredPatient.referringClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 *
SizeConfig.textMultiplier,
fontSize: 1.3 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -563,14 +508,14 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
fontSize: 2.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referringDoctorRemarks,
referredPatient.referringDoctorRemarks!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
SizedBox(

@ -26,7 +26,7 @@ class _ReferralDischargedPatientPageState
onModelReady: (model) => model.gtMyDischargeReferralPatient(),
builder: (_, model, w) => AppScaffold(
appBarTitle: 'Referral Discharged ',
backgroundColor: Colors.grey[200],
backgroundColor: Colors.grey[200]!,
isShowAppBar: false,
baseViewModel: model,
body: model.myDischargeReferralPatient.isEmpty
@ -63,27 +63,27 @@ class _ReferralDischargedPatientPageState
model.getReferralStatusNameByCode(
model
.myDischargeReferralPatient[index]
.referralStatus,
.referralStatus!,
context),
referralStatusCode: model
.myDischargeReferralPatient[index]
.referralStatus,
.referralStatus!,
patientName: model
.myDischargeReferralPatient[index]
.firstName +
.firstName! +
" " +
model.myDischargeReferralPatient[index]
.lastName,
.lastName!,
patientGender: model
.myDischargeReferralPatient[index].gender,
.myDischargeReferralPatient[index].gender!,
referredDate:
AppDateUtils.getDayMonthYearDateFormatted(
model
.myDischargeReferralPatient[index]
.referralDate),
.referralDate!),
referredTime: AppDateUtils.getTimeHHMMA(model
.myDischargeReferralPatient[index]
.referralDate),
.referralDate!),
patientID:
"${model.myDischargeReferralPatient[index].patientID}",
isSameBranch: false,
@ -93,20 +93,20 @@ class _ReferralDischargedPatientPageState
"${model.myDischargeReferralPatient[index].referringClinicDescription}",
remark: model
.myDischargeReferralPatient[index]
.referringDoctorRemarks,
.referringDoctorRemarks!,
nationality: model
.myDischargeReferralPatient[index]
.nationalityName,
.nationalityName!,
nationalityFlag: '',
//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend
doctorAvatar: '',
//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend
referralDoctorName: model
.myDischargeReferralPatient[index]
.referringDoctorName,
.referringDoctorName!,
clinicDescription: model
.myDischargeReferralPatient[index]
.referringClinicDescription,
.referringClinicDescription!,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),

@ -20,7 +20,7 @@ import '../base/base_view.dart';
class InsuranceApprovalScreenNew extends StatefulWidget {
final int appointmentNo;
InsuranceApprovalScreenNew({this.appointmentNo});
InsuranceApprovalScreenNew({this.appointmentNo = 0});
@override
_InsuranceApprovalScreenNewState createState() =>
@ -32,7 +32,7 @@ class _InsuranceApprovalScreenNewState
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
@ -42,10 +42,10 @@ class _InsuranceApprovalScreenNewState
? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: int.parse(patient?.appointmentNo.toString()),
appointmentNo: int.parse(patient.appointmentNo!.toString()),
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
builder: (BuildContext context, InsuranceViewModel model, Widget? child) =>
AppScaffold(
appBar: PatientProfileAppBar(
patient,
@ -58,9 +58,9 @@ class _InsuranceApprovalScreenNewState
? SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004,
right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04,
left: SizeConfig.screenWidth! * 0.004,
right: SizeConfig.screenWidth! * 0.004,
top: SizeConfig.screenWidth! * 0.04,
),
child: model.insuranceApprovalInPatient.length != 0
? Column(
@ -93,13 +93,13 @@ class _InsuranceApprovalScreenNewState
patientOut: "In Patient",
profileUrl: model
.insuranceApprovalInPatient[index]
.doctorImage,
.doctorImage!,
clinic: model
.insuranceApprovalInPatient[index]
.clinicName,
.clinicName!,
doctorName: model
.insuranceApprovalInPatient[index]
.doctorName,
.doctorName!,
approvalNo: model
.insuranceApprovalInPatient[index]
.approvalNo
@ -111,7 +111,7 @@ class _InsuranceApprovalScreenNewState
'',
branch2: model
.insuranceApprovalInPatient[index]
.projectName,
.projectName!,
),
),
),
@ -127,9 +127,9 @@ class _InsuranceApprovalScreenNewState
: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004,
right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04,
left: SizeConfig.screenWidth! * 0.004,
right: SizeConfig.screenWidth! * 0.004,
top: SizeConfig.screenWidth! * 0.04,
),
child: model.insuranceApproval.length != 0
? Column(
@ -168,13 +168,13 @@ class _InsuranceApprovalScreenNewState
},
child: DoctorCardInsurance(
patientOut: model.insuranceApproval[index]
.patientDescription,
.patientDescription!,
profileUrl: model
.insuranceApproval[index].doctorImage,
.insuranceApproval[index].doctorImage!,
clinic: model
.insuranceApproval[index].clinicName,
.insuranceApproval[index].clinicName!,
doctorName: model
.insuranceApproval[index].doctorName,
.insuranceApproval[index].doctorName!,
approvalNo: model
.insuranceApproval[index].approvalNo
.toString(),
@ -184,7 +184,7 @@ class _InsuranceApprovalScreenNewState
.approvalStatusDescption ??
'',
branch2: model
.insuranceApproval[index].projectName,
.insuranceApproval[index].projectName!,
),
),
),

File diff suppressed because it is too large Load Diff

@ -10,23 +10,21 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class OutPatientPrescriptionDetailsScreen extends StatefulWidget {
final PrescriptionResModel prescriptionResModel;
final PrescriptionResModel? prescriptionResModel;
OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel});
OutPatientPrescriptionDetailsScreen({Key? key, this.prescriptionResModel});
@override
_OutPatientPrescriptionDetailsScreenState createState() =>
_OutPatientPrescriptionDetailsScreenState();
_OutPatientPrescriptionDetailsScreenState createState() => _OutPatientPrescriptionDetailsScreenState();
}
class _OutPatientPrescriptionDetailsScreenState
extends State<OutPatientPrescriptionDetailsScreen> {
class _OutPatientPrescriptionDetailsScreenState extends State<OutPatientPrescriptionDetailsScreen> {
getPrescriptionReport(BuildContext context, PatientViewModel model) {
RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport(
appointmentNo: widget.prescriptionResModel.appointmentNo,
episodeID: widget.prescriptionResModel.episodeID,
setupID: widget.prescriptionResModel.setupID,
patientTypeID: widget.prescriptionResModel.patientID);
appointmentNo: widget.prescriptionResModel!.appointmentNo,
episodeID: widget.prescriptionResModel!.episodeID,
setupID: widget.prescriptionResModel!.setupID,
patientTypeID: widget.prescriptionResModel!.patientID);
model.getPrescriptionReport(prescriptionReqModel.toJson());
}

@ -9,18 +9,18 @@ import '../../../../config/config.dart';
class PageStepperWidget extends StatelessWidget {
final int stepsCount;
final int currentStepIndex;
final Size screenSize;
final List<String> stepsTitles;
final Size? screenSize;
final List<String>? stepsTitles;
PageStepperWidget(
{this.stepsCount,
this.currentStepIndex,
{this.stepsCount = 0,
this.currentStepIndex = 0,
this.screenSize,
this.stepsTitles});
@override
Widget build(BuildContext context) {
double dividerWidth = (screenSize.width / stepsCount) - (10 * stepsCount);
double dividerWidth = (screenSize!.width / stepsCount) - (10 * stepsCount);
return Container(
margin: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
@ -37,7 +37,7 @@ class PageStepperWidget extends StatelessWidget {
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles,
stepsTitles: stepsTitles!,
)
else
StepWidget(
@ -46,7 +46,7 @@ class PageStepperWidget extends StatelessWidget {
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles,
stepsTitles: stepsTitles!,
)
],
)
@ -62,7 +62,7 @@ class StepWidget extends StatelessWidget {
final bool isFinalStep;
final bool isStepFinish;
final double dividerWidth;
final List<String> stepsTitles;
final List<String>? stepsTitles;
StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish,
this.dividerWidth,
@ -132,11 +132,11 @@ class StepWidget extends StatelessWidget {
AppText(
stepsTitles == null
? "${TranslationBase.of(context).step} $index"
: "${stepsTitles[index - 1]}",
: "${stepsTitles![index - 1]}",
fontWeight: FontWeight.bold,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
),
Container(
margin: EdgeInsets.symmetric(vertical: 4),
@ -167,7 +167,7 @@ class StepWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.4,
fontSize: SizeConfig.textMultiplier! * 1.4,
color: status == StepStatus.InProgress
? Color(0xFFCC9B14)
: status == StepStatus.Locked

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/widgets/diagnosis_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/widgets/medication_widget.dart';
@ -14,12 +15,11 @@ import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class UcafDetailScreen extends StatefulWidget {
final PatiantInformtion patient;
final UcafViewModel model;
final Function changeLoadingState;
final Function? changeLoadingState;
UcafDetailScreen(this.patient, this.model, {this.changeLoadingState});
@ -32,7 +32,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
final PatiantInformtion patient;
final UcafViewModel model;
UcafViewModel ucafModel;
UcafViewModel ucafModel = UcafViewModel();
int _activeTap = 0;
@ -41,9 +41,9 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
@override
void initState() {
model.saveUCAFOnTap = () async {
widget.changeLoadingState(true);
widget.changeLoadingState!(true);
await ucafModel.postUCAF(patient);
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
if (ucafModel.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).postUcafSuccessMsg);
@ -67,7 +67,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
model.resetDataInFirst(firstPage: false);
await model.getLanguage();
await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -134,18 +134,18 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
onTap: () async {
print(__treatmentSteps.indexOf(item));
if (__treatmentSteps.indexOf(item) == 0) {
widget.changeLoadingState(true);
widget.changeLoadingState!(true);
await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
} else if (__treatmentSteps.indexOf(item) == 1) {
widget.changeLoadingState(true);
widget.changeLoadingState!(true);
await model.getPrescription(patient);
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
}
if (__treatmentSteps.indexOf(item) == 2) {
widget.changeLoadingState(true);
widget.changeLoadingState!(true);
await model.getOrderProcedures(patient);
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
}
setState(() {
_activeTap = __treatmentSteps.indexOf(item);
@ -181,18 +181,18 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
}
break;
case 1:
if (model.prescriptionList != null && model.prescriptionList.entityList != null && model.prescriptionList.entityList.isNotEmpty) {
if (model.prescriptionList != null && model.prescriptionList.entityList != null && model.prescriptionList.entityList!.isNotEmpty) {
return [
ListView.builder(
itemCount: model.prescriptionList != null
? model.prescriptionList.entityList.length
? model.prescriptionList.entityList!.length
: 0,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return MedicationWidget(
model, model.prescriptionList.entityList[index]);
model, model.prescriptionList.entityList![index]);
})
];} else {

@ -7,15 +7,14 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../../../widgets/shared/errors/error_message.dart';
class UCAFInputScreen extends StatefulWidget {
final PatiantInformtion patient;
final Function changeLoadingState;
final Function? changeLoadingState;
UCAFInputScreen(this.patient, {this.changeLoadingState});
@ -63,7 +62,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
onModelReady: (model) async {
model.resetDataInFirst();
await model.getUCAFData(patient);
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -100,7 +99,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
AppText(
"BP (H/L)",
fontSize:
SizeConfig.textMultiplier * 1.8,
SizeConfig.textMultiplier! * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
@ -110,7 +109,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
AppText(
"${model.bloodPressure}",
fontSize:
SizeConfig.textMultiplier * 2,
SizeConfig.textMultiplier! * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
@ -123,7 +122,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
AppText(
"${TranslationBase.of(context).temperature}",
fontSize:
SizeConfig.textMultiplier * 1.8,
SizeConfig.textMultiplier! * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
@ -134,7 +133,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
child: AppText(
"${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize:
SizeConfig.textMultiplier * 2,
SizeConfig.textMultiplier! * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
@ -149,7 +148,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
AppText(
"${TranslationBase.of(context).pulseBeats}:",
fontSize:
SizeConfig.textMultiplier * 1.8,
SizeConfig.textMultiplier! * 1.8,
color: Colors.black,
fontWeight: FontWeight.normal,
),
@ -159,7 +158,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
AppText(
"${model.hartRat}",
fontSize:
SizeConfig.textMultiplier * 2,
SizeConfig.textMultiplier! * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.w700,
),
@ -172,7 +171,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Utils.convertToTitleCase(TranslationBase.of(context)
.chiefComplaintsAndSymptoms),
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
fontSize: SizeConfig.textMultiplier! * 2.2,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
@ -184,7 +183,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
TranslationBase.of(context).instruction,
dropDownText: Utils.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint + '\n'),
.chiefComplaint! + '\n'),
controller: _additionalComplaintsController,
inputType: TextInputType.multiline,
enabled: false,

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page_stepper_widget.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -9,13 +10,11 @@ import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-prof
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
import 'ucaf_detail_screen.dart';
import 'ucaf_input_screen.dart';
class UCAFPagerScreen extends StatefulWidget {
const UCAFPagerScreen({Key key}) : super(key: key);
const UCAFPagerScreen({Key? key}) : super(key: key);
@override
_UCAFPagerScreenState createState() => _UCAFPagerScreenState();
@ -23,17 +22,17 @@ class UCAFPagerScreen extends StatefulWidget {
class _UCAFPagerScreenState extends State<UCAFPagerScreen>
with TickerProviderStateMixin {
PageController _controller;
PageController? _controller;
int _currentIndex = 0;
bool _isLoading = true;
PatiantInformtion patient;
String patientType;
String arrivalType;
PatiantInformtion? patient;
String? patientType;
String? arrivalType;
changePageViewIndex(pageIndex, {isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
_controller.jumpToPage(pageIndex);
_controller!.jumpToPage(pageIndex);
setState(() {
_currentIndex = pageIndex;
});
@ -53,7 +52,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
@override
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'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -64,7 +63,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isLoading: _isLoading,
appBar: PatientProfileAppBar(patient),
appBar: PatientProfileAppBar(patient!),
appBarTitle: TranslationBase.of(context).ucaf,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -101,11 +100,11 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
scrollDirection: Axis.horizontal,
children: <Widget>[
UCAFInputScreen(
patient,
patient!,
changeLoadingState: changeLoadingState,
),
UcafDetailScreen(
patient,
patient!,
model,
changeLoadingState: changeLoadingState,
),
@ -178,7 +177,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
color: AppGlobal.appRedColor,
fontColor: Colors.white,
onPressed: () {
model.saveUCAFOnTap();
model.saveUCAFOnTap!();
},
),
),

@ -34,20 +34,20 @@ class DiagnosisWidget extends StatelessWidget {
label: "${TranslationBase.of(context).diagnoseType}: ",
value: diagnosisType != null
? model.selectedLanguage == 'ar'
? diagnosisType.nameAr
: diagnosisType.nameEn
? diagnosisType.nameAr!
: diagnosisType.nameEn!
: "-",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(
height: 4,
),
CustomRow(
label: "",
value: diagnosis.asciiDesc,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
value: diagnosis.asciiDesc!,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
isExpanded: true,
),
SizedBox(
@ -57,8 +57,8 @@ class DiagnosisWidget extends StatelessWidget {
CustomRow(
label: "${TranslationBase.of(context).condition}: ",
value: "${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(
height: 4,
@ -68,8 +68,8 @@ class DiagnosisWidget extends StatelessWidget {
CustomRow(
label: "${TranslationBase.of(context).icd}:",
value: "${diagnosis.icdCode10ID}",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(

@ -26,8 +26,8 @@ class MedicationWidget extends StatelessWidget {
label: "${TranslationBase.of(context).id}: ",
value: "${prescription.medicineCode}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(
width: 16,
@ -36,8 +36,8 @@ class MedicationWidget extends StatelessWidget {
label: "${TranslationBase.of(context).price}: ",
value: "${prescription.medicationPrice}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(
width: 16,
@ -46,8 +46,8 @@ class MedicationWidget extends StatelessWidget {
label: "${TranslationBase.of(context).quantity}: ",
value: "${prescription.quantity}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
@ -58,8 +58,8 @@ class MedicationWidget extends StatelessWidget {
label: "${TranslationBase.of(context).durDays}: ",
value: "${prescription.doseDurationDays}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(
height: 4,
@ -68,8 +68,8 @@ class MedicationWidget extends StatelessWidget {
label: " ",
value: Utils.convertToTitleCase("${prescription.medicationName}"),
isExpanded: true,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(
height: 4,
@ -79,8 +79,8 @@ class MedicationWidget extends StatelessWidget {
label: " ",
value: Utils.convertToTitleCase("${prescription.doseDetail}"),
isExpanded: true,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
],
));

@ -26,16 +26,16 @@ class ProceduresWidget extends StatelessWidget {
label: "${TranslationBase.of(context).codeNo}: ",
value: "${procedure.achiCode}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(width: 10,),
CustomRow(
label: "${TranslationBase.of(context).quantity}: ",
value: "${procedure.lineItemNo}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
@ -45,8 +45,8 @@ class ProceduresWidget extends StatelessWidget {
CustomRow(
label: "",
value: "${procedure.procedureName}",
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
SizedBox(
height: 4,
@ -58,9 +58,9 @@ class ProceduresWidget extends StatelessWidget {
label: "${TranslationBase.of(context).covered}: ",
value: "${procedure.isCovered}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueColor: procedure.isCovered
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
valueColor: procedure.isCovered!
? AppGlobal.appGreenColor
: AppGlobal.appRedColor,
),
@ -68,8 +68,8 @@ class ProceduresWidget extends StatelessWidget {
label: "${TranslationBase.of(context).approvalRequired}: ",
value: "${procedure.isApprovalRequired}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
),
@ -83,9 +83,9 @@ class ProceduresWidget extends StatelessWidget {
label: "${TranslationBase.of(context).uncoveredByDoctor}: ",
value: "${procedure.isUncoveredByDoctor}",
isExpanded: false,
valueSize: SizeConfig.textMultiplier * 1.8,
labelSize: SizeConfig.textMultiplier * 1.6,
valueColor: procedure.isCovered
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,
valueColor: procedure.isCovered!
? AppGlobal.appGreenColor
: AppGlobal.appRedColor,
),

@ -9,9 +9,9 @@ import 'line_chart_curved_lab_history.dart';
class LabResultHistoryChartAndDetails extends StatelessWidget {
LabResultHistoryChartAndDetails({
Key key,
@required this.labResultHistory,
@required this.name,
Key? key,
required this.labResultHistory,
required this.name,
}) : super(key: key);
final List<LabResultHistory> labResultHistory;
@ -43,7 +43,7 @@ class LabResultHistoryChartAndDetails extends StatelessWidget {
children: [
AppText(
TranslationBase.of(context).graphDetails,
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold,
),
SizedBox(

@ -12,7 +12,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget {
final List<LabResultHistory> labResultHistory;
LabResultHistoryDetailsWidget({
this.labResultHistory,
required this.labResultHistory,
});
@override
@ -39,7 +39,7 @@ class _VitalSignDetailsWidgetState
padding: EdgeInsets.all(8),
child: AppText(
TranslationBase.of(context).date,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.bold,
),
),
@ -51,7 +51,7 @@ class _VitalSignDetailsWidgetState
child: Container(
child: AppText(
TranslationBase.of(context).labResult,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.bold,
),
// height: 60
@ -67,7 +67,7 @@ class _VitalSignDetailsWidgetState
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
inside: BorderSide(width: 1.0, color: Colors.grey[300]!),
),
children: fullData(projectViewModel),
),
@ -80,7 +80,7 @@ class _VitalSignDetailsWidgetState
List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
widget.labResultHistory.forEach((vital) {
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime);
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!);
tableRow.add(TableRow(children: [
Container(
child: Container(
@ -88,7 +88,7 @@ class _VitalSignDetailsWidgetState
color: Colors.white,
child: AppText(
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}',
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
),
),
@ -99,7 +99,7 @@ class _VitalSignDetailsWidgetState
color: Colors.white,
child: AppText(
'${vital.resultValue}',
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
),
),

@ -9,14 +9,13 @@ class LineChartCurvedLabHistory extends StatefulWidget {
final String title;
final List<LabResultHistory> labResultHistory;
LineChartCurvedLabHistory({this.title, this.labResultHistory});
LineChartCurvedLabHistory({required this.title, required this.labResultHistory});
@override
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
}
class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
bool isShowingMainData;
List<int> xAxixs = [];
int indexes = 0;
@ -24,7 +23,6 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
void initState() {
super.initState();
getXaxix();
isShowingMainData = true;
}
getXaxix() {
@ -56,7 +54,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
),
AppText(
widget.title,
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textAlign: TextAlign.center,
@ -69,7 +67,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
padding: const EdgeInsets.only(right: 16.0, left: 8.0),
child: LineChart(
sampleData1(),
swapAnimationDuration: const Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
),
),
),
@ -90,56 +88,73 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (LineTouchResponse touchResponse) {},
touchCallback: (event, touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTextStyles: (context, value) {
return TextStyle(
color: Colors.black,
fontSize: 10,
);
},
margin: 28,
rotateAngle: -65,
getTitles: (value) {
print(value);
DateTime date = AppDateUtils.convertStringToDate(
widget.labResultHistory[value.toInt()].verifiedOnDateTime);
reservedSize: 28,
// rotateAngle: -65,
getTitlesWidget: (value, meta) {
DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime!);
if (widget.labResultHistory.length < 8) {
if (widget.labResultHistory.length > value.toInt()) {
return '${date.day}/ ${date.year}';
return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else
return '';
return Text("");
} else {
if (value.toInt() == 0) return '${date.day}/ ${date.year}';
if (value.toInt() == 0)
return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (value.toInt() == widget.labResultHistory.length - 1)
return '${date.day}/ ${date.year}';
return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (xAxixs.contains(value.toInt())) {
return '${date.day}/ ${date.year}';
return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
}
return '';
return Text("");
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (context, value) {
return TextStyle(
color: Colors.black,
fontSize: 10,
);
},
getTitles: (value) {
return '${value.toInt()}';
},
margin: 8,
//reservedSize: 30,
)),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTitlesWidget: (value, meta) {
return Text('${value.toInt()}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
));
},
reservedSize: 8,
//reservedSize: 30,
),
),
),
borderData: FlBorderData(
@ -172,7 +187,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double max = 0;
widget.labResultHistory.forEach((element) {
try {
double resultValueDouble = double.parse(element.resultValue);
double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble > max) max = resultValueDouble;
} catch (e) {
print(e);
@ -185,10 +200,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double getMinY() {
double min = 0;
try {
min = double.parse(widget.labResultHistory[0].resultValue);
min = double.parse(widget.labResultHistory[0].resultValue!);
widget.labResultHistory.forEach((element) {
double resultValueDouble = double.parse(element.resultValue);
double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble < min) min = resultValueDouble;
});
} catch (e) {
@ -203,8 +218,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
List<FlSpot> spots = [];
for (int index = 0; index < widget.labResultHistory.length; index++) {
try {
var resultValueDouble =
double.parse(widget.labResultHistory[index].resultValue);
var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue!);
spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) {
print(e);
@ -215,7 +229,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Colors.red],
color: Colors.red,
barWidth: 3,
isStrokeCapRound: true,
curveSmoothness: 0.12,

@ -17,7 +17,7 @@ class FlowChartPage extends StatelessWidget {
final bool isInpatient;
FlowChartPage(
{this.patientLabOrder, this.filterName, this.patient, this.isInpatient});
{required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient});
@override
Widget build(BuildContext context) {

@ -12,7 +12,7 @@ class LabResultDetailsWidget extends StatefulWidget {
final List<LabOrderResult> labResult;
LabResultDetailsWidget({
this.labResult,
required this.labResult,
});
@override
@ -38,7 +38,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
padding: EdgeInsets.all(8),
child: AppText(
TranslationBase.of(context).date,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -51,7 +51,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
child: Container(
child: AppText(
TranslationBase.of(context).labResult,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -68,7 +68,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
inside: BorderSide(width: 1.0, color: Colors.grey[300]!),
),
children: fullData(projectViewModel),
),
@ -81,7 +81,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
widget.labResult.forEach((vital) {
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime);
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!);
tableRow.add(TableRow(children: [
Container(
child: Container(
@ -89,7 +89,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
color: Colors.white,
child: AppText(
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}',
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
@ -101,7 +101,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
color: Colors.white,
child: AppText(
'${vital.resultValue}',
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),

@ -18,15 +18,8 @@ class LabResultWidget extends StatelessWidget {
final PatiantInformtion patient;
final bool isInpatient;
LabResultWidget(
{Key key,
this.filterName,
this.patientLabResultList,
this.patientLabOrder,
this.patient,
this.isInpatient})
: super(key: key);
ProjectViewModel projectViewModel;
LabResultWidget({Key? key, required this.filterName, required this.patientLabResultList, required this.patientLabOrder, required this.patient, required this.isInpatient}) : super(key: key);
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -45,7 +38,7 @@ class LabResultWidget extends StatelessWidget {
children: [
AppText(
filterName,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w700,
),
],
@ -63,7 +56,7 @@ class LabResultWidget extends StatelessWidget {
child: AppText(
TranslationBase.of(context).description,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w700,
),
),
@ -75,7 +68,7 @@ class LabResultWidget extends StatelessWidget {
child: AppText(
TranslationBase.of(context).value,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w700,
),
),
@ -86,7 +79,7 @@ class LabResultWidget extends StatelessWidget {
child: Center(
child: AppText(
TranslationBase.of(context).range,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w700,
),
),
@ -128,9 +121,9 @@ class LabResultWidget extends StatelessWidget {
padding: EdgeInsets.all(10),
child: Center(
child: AppText(
patientLabResultList[index].description,
patientLabResultList[index].description!,
textAlign: TextAlign.center,
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
isCopyable: true,
),
),
@ -140,20 +133,14 @@ class LabResultWidget extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (patientLabResultList[index]
.checkResultStatus() !=
0)
if (patientLabResultList[index].checkResultStatus() != 0)
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.red.shade700,
),
child: Icon(
patientLabResultList[index]
.checkResultStatus() ==
1
? Icons.arrow_upward
: Icons.arrow_downward,
patientLabResultList[index].checkResultStatus() == 1 ? Icons.arrow_upward : Icons.arrow_downward,
color: Colors.white,
size: 16,
),
@ -161,19 +148,13 @@ class LabResultWidget extends StatelessWidget {
Expanded(
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical: 10, horizontal: 4),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 4),
child: Center(
child: AppText(
patientLabResultList[index]
.resultValue ??
"" +
" " +
"${patientLabResultList[index].uOM ?? ""}",
patientLabResultList[index].resultValue ?? "" + " " + "${patientLabResultList[index].uOM ?? ""}",
textAlign: TextAlign.center,
isCopyable: true,
fontSize:
SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
),
),
),
@ -187,9 +168,9 @@ class LabResultWidget extends StatelessWidget {
// color: Colors.white,
child: Center(
child: AppText(
patientLabResultList[index].referanceRange,
patientLabResultList[index].referanceRange!,
textAlign: TextAlign.center,
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
isCopyable: true,
),
),
@ -203,8 +184,7 @@ class LabResultWidget extends StatelessWidget {
context,
FadePage(
page: FlowChartPage(
filterName: patientLabResultList[index]
.description,
filterName: patientLabResultList[index].description!,
patientLabOrder: patientLabOrder,
patient: patient,
isInpatient: isInpatient,
@ -219,7 +199,7 @@ class LabResultWidget extends StatelessWidget {
TranslationBase.of(context).showMoreBtn,
textDecoration: TextDecoration.underline,
color: Colors.red.shade700,
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w700,
),
],
@ -290,7 +270,7 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white,
child: Center(
child: AppText(
lab.description,
lab.description!,
textAlign: TextAlign.center,
),
),
@ -302,7 +282,7 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white,
child: Center(
child: AppText(
lab.resultValue + " " + lab.uOM,
lab.resultValue! + " " + lab.uOM!,
textAlign: TextAlign.center,
),
),
@ -314,7 +294,7 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white,
child: Center(
child: AppText(
lab.referanceRange,
lab.referanceRange!,
textAlign: TextAlign.center,
),
),

@ -17,12 +17,12 @@ class LaboratoryResultPage extends StatefulWidget {
final bool isInpatient;
LaboratoryResultPage(
{Key key,
this.patientLabOrders,
this.patient,
this.patientType,
this.arrivalType,
this.isInpatient});
{Key? key,
required this.patientLabOrders,
required this.patient,
required this.patientType,
required this.arrivalType,
required this.isInpatient});
@override
_LaboratoryResultPageState createState() => _LaboratoryResultPageState();
@ -42,7 +42,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
widget.patient,
isInpatient: widget.isInpatient,
isFromLabResult: true,
appointmentDate: widget.patientLabOrders.orderDate,
appointmentDate: widget.patientLabOrders.orderDate!,
),
baseViewModel: model,
body: AppScaffold(
@ -50,11 +50,11 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
body: SingleChildScrollView(
child: LaboratoryResultWidget(
onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo,
billNo: widget.patientLabOrders.invoiceNo!,
details: model.patientLabSpecialResult.length > 0
? model.patientLabSpecialResult[0].resultDataHTML
: null,
orderNo: widget.patientLabOrders.orderNo,
? model.patientLabSpecialResult[0].resultDataHTML!
: "",
orderNo: widget.patientLabOrders.orderNo!,
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
isInpatient: widget.patientType == "1",

@ -16,16 +16,16 @@ import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart';
class LaboratoryResultWidget extends StatefulWidget {
final GestureTapCallback onTap;
final String billNo;
final String details;
final String orderNo;
final PatientLabOrders patientLabOrder;
final PatiantInformtion patient;
final bool isInpatient;
final GestureTapCallback? onTap;
final String? billNo;
final String? details;
final String? orderNo;
final PatientLabOrders? patientLabOrder;
final PatiantInformtion? patient;
final bool? isInpatient;
const LaboratoryResultWidget(
{Key key,
{Key? key,
this.onTap,
this.billNo,
this.details,
@ -42,7 +42,7 @@ class LaboratoryResultWidget extends StatefulWidget {
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bool _isShowMoreGeneral = true;
bool _isShowMore = true;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -97,7 +97,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
TranslationBase.of(context)
.generalResult,
fontSize:
SizeConfig.textMultiplier * 2.3,
SizeConfig.textMultiplier! * 2.3,
bold: false,
))),
Container(
@ -141,15 +141,15 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
itemBuilder: (context, index) {
return LabResultWidget(
patientLabOrder:
widget.patientLabOrder,
widget.patientLabOrder!,
filterName: model
.labResultLists[index]
.filterName,
patientLabResultList: model
.labResultLists[index]
.patientLabResultList,
patient: widget.patient,
isInpatient: widget.isInpatient,
patient: widget.patient!,
isInpatient: widget.isInpatient!,
);
}),
],
@ -168,7 +168,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
SizedBox(
height: 15,
),
if (widget.details != null && widget.details.isNotEmpty)
if (widget.details != null && widget.details!.isNotEmpty)
Column(
children: [
InkWell(
@ -196,7 +196,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
TranslationBase.of(context)
.specialResult,
fontSize:
SizeConfig.textMultiplier * 2.3,
SizeConfig.textMultiplier! * 2.3,
bold: false,
))),
Container(
@ -228,7 +228,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
duration: Duration(milliseconds: 7000),
child: Container(
width: double.infinity,
child: !Utils.isTextHtml(widget.details)
child: !Utils.isTextHtml(widget.details!)
? AppText(
widget.details ??
TranslationBase.of(context)

@ -24,17 +24,17 @@ class LabsHomePage extends StatefulWidget {
}
class _LabsHomePageState extends State<LabsHomePage> {
String patientType;
String? patientType;
String arrivalType;
PatiantInformtion patient;
bool isInpatient;
bool isFromLiveCare;
String? arrivalType;
PatiantInformtion? patient;
bool? isInpatient;
bool? isFromLiveCare;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -48,14 +48,14 @@ class _LabsHomePageState extends State<LabsHomePage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getLabs(patient, isInpatient: false),
onModelReady: (model) => model.getLabs(patient!, isInpatient: false),
builder: (context, ProcedureViewModel model, widget) => AppScaffold(
baseViewModel: model,
backgroundColor: Colors.grey[100],
backgroundColor: Colors.grey[100]!,
isShowAppBar: true,
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
patient!,
isInpatient: isInpatient!,
),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
@ -68,22 +68,22 @@ class _LabsHomePageState extends State<LabsHomePage> {
height: 12,
),
if ((model.patientLabOrdersList.isNotEmpty &&
patient.patientStatusType != 43)|| (patient.patientStatusType != null &&
patient.patientStatusType == 43))
patient!.patientStatusType != 43)|| (patient!.patientStatusType != null &&
patient!.patientStatusType == 43))
ServiceTitle(
title: TranslationBase.of(context).lab,
subTitle: TranslationBase.of(context).result,
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
if ((patient!.patientStatusType != null &&
patient!.patientStatusType == 43) ||
(isFromLiveCare! && patient!.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
patient: patient!,
previousProcedureViewModel: model,
procedureType: ProcedureType.LAB_RESULT,
),
@ -116,10 +116,10 @@ class _LabsHomePageState extends State<LabsHomePage> {
width: 20,
decoration: BoxDecoration(
color: model.patientLabOrdersList[index]
.isLiveCareAppointment
.isLiveCareAppointment!
? Colors.red[900]
: !model.patientLabOrdersList[index]
.isInOutPatient
.isInOutPatient!
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
@ -141,12 +141,12 @@ class _LabsHomePageState extends State<LabsHomePage> {
child: Center(
child: Text(
model.patientLabOrdersList[index]
.isLiveCareAppointment
.isLiveCareAppointment!
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.patientLabOrdersList[index]
.isInOutPatient
.isInOutPatient!
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
@ -170,26 +170,26 @@ class _LabsHomePageState extends State<LabsHomePage> {
page: LaboratoryResultPage(
patientLabOrders:
model.patientLabOrdersList[index],
patient: patient,
isInpatient: isInpatient,
arrivalType: arrivalType,
patientType: patientType,
patient: patient!,
isInpatient: isInpatient!,
arrivalType: arrivalType!,
patientType: patientType!,
),
),
),
doctorName:
Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName),
Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName!),
invoiceNO:
' ${model.patientLabOrdersList[index].invoiceNo}',
profileUrl: model
.patientLabOrdersList[index].doctorImageURL,
.patientLabOrdersList[index].doctorImageURL!,
branch:
model.patientLabOrdersList[index].projectName,
model.patientLabOrdersList[index].projectName!,
clinic:
Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription),
Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription!),
appointmentDate:
model.patientLabOrdersList[index].createdOn,
orderNo: model.patientLabOrdersList[index].orderNo,
model.patientLabOrdersList[index].createdOn!,
orderNo: model.patientLabOrdersList[index].orderNo!,
isShowTime: false,
),
),
@ -198,7 +198,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
),
),
if (model.patientLabOrdersList.isEmpty &&
patient.patientStatusType != 43)
patient!.patientStatusType != 43)
Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,

@ -18,24 +18,24 @@ import 'package:provider/provider.dart';
import '../../../../../widgets/shared/errors/error_message.dart';
class AllLabSpecialResult extends StatefulWidget {
const AllLabSpecialResult({Key key}) : super(key: key);
const AllLabSpecialResult({Key? key}) : super(key: key);
@override
_AllLabSpecialResultState createState() => _AllLabSpecialResultState();
}
class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
String patientType;
String? patientType;
String arrivalType;
PatiantInformtion patient;
bool isInpatient;
bool isFromLiveCare;
String? arrivalType;
PatiantInformtion? patient;
bool? isInpatient;
bool? isFromLiveCare;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -50,14 +50,14 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>(
onModelReady: (model) =>
model.getAllSpecialLabResult(patientId: patient.patientMRN),
model.getAllSpecialLabResult(patientId: patient!.patientMRN!),
builder: (context, LabsViewModel model, widget) => AppScaffold(
baseViewModel: model,
backgroundColor: Colors.grey[100],
backgroundColor: Colors.grey[100]!,
isShowAppBar: true,
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
patient!,
isInpatient: isInpatient!,
),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
@ -102,10 +102,10 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
height: 160,
decoration: BoxDecoration(
color: model.allSpecialLabList[index]
.isLiveCareAppointment
? Colors.red[900]
.isLiveCareAppointment!
? Colors.red[900]!
: !model.allSpecialLabList[index]
.isInOutPatient
.isInOutPatient!
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
@ -127,12 +127,12 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
child: Center(
child: Text(
model.allSpecialLabList[index]
.isLiveCareAppointment
.isLiveCareAppointment!
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.allSpecialLabList[index]
.isInOutPatient
.isInOutPatient!
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
@ -151,26 +151,26 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
FadePage(
page: SpecialLabResultDetailsPage(
resultData: model.allSpecialLabList[index]
.resultDataHTML,
patient: patient,
.resultDataHTML!,
patient: patient!,
),
),
),
doctorName:
Utils.convertToTitleCase(model.allSpecialLabList[index].doctorName),
Utils.convertToTitleCase(model.allSpecialLabList[index].doctorName!),
invoiceNO:
' ${model.allSpecialLabList[index].invoiceNo}',
profileUrl: model
.allSpecialLabList[index].doctorImageURL,
.allSpecialLabList[index].doctorImageURL!,
branch:
model.allSpecialLabList[index].projectName,
model.allSpecialLabList[index].projectName!,
clinic:
Utils.convertToTitleCase(model.allSpecialLabList[index].clinicDescription),
Utils.convertToTitleCase(model.allSpecialLabList[index].clinicDescription!),
appointmentDate:
AppDateUtils.getDateTimeFromServerFormat(
model.allSpecialLabList[index].createdOn,
),
orderNo: model.allSpecialLabList[index].orderNo,
orderNo: model.allSpecialLabList[index].orderNo!,
isShowTime: false,
),
),

@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget {
final String resultData;
final PatiantInformtion patient;
const SpecialLabResultDetailsPage({Key key, this.resultData, this.patient})
const SpecialLabResultDetailsPage({Key? key, required this.resultData, required this.patient})
: super(key: key);
@override

@ -16,24 +16,15 @@ import 'package:permission_handler/permission_handler.dart';
import '../../../../config/config.dart';
class AddVerifyMedicalReport extends StatefulWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final MedicalReportModel medicalReport;
final PatientMedicalReportViewModel model;
final MedicalReportStatus status;
final String medicalNote;
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final MedicalReportModel? medicalReport;
final PatientMedicalReportViewModel? model;
final MedicalReportStatus? status;
final String? medicalNote;
const AddVerifyMedicalReport(
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.medicalReport,
this.model,
this.status,
this.medicalNote})
: super(key: key);
const AddVerifyMedicalReport({Key? key, this.patient, this.patientType, this.arrivalType, this.medicalReport, this.model, this.status, this.medicalNote}) : super(key: key);
@override
_AddVerifyMedicalReportState createState() => _AddVerifyMedicalReportState();
@ -53,9 +44,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: widget.status == MedicalReportStatus.ADD
? TranslationBase.of(context).medicalReportAdd
: TranslationBase.of(context).medicalReportVerify,
appBarTitle: widget.status == MedicalReportStatus.ADD ? TranslationBase.of(context).medicalReportAdd : TranslationBase.of(context).medicalReportVerify,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Column(
children: [
@ -72,26 +61,14 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
children: [
if (model.medicalReportTemplate.length > 0)
HtmlRichEditor(
initialText: (widget.medicalReport !=
null
? widget.medicalNote
: widget
.model
.medicalReportTemplate[
0]
.templateText
.length >
0
? widget
.model
.medicalReportTemplate[0]
.templateText
initialText: (widget.medicalReport != null
? widget.medicalNote!
: widget.model!.medicalReportTemplate[0].templateText!.length > 0
? widget.model!.medicalReportTemplate[0].templateText!
: ""),
controller: _controller,
hint: "Write the medical report ",
height:
MediaQuery.of(context).size.height *
0.75,
height: MediaQuery.of(context).size.height * 0.75,
),
],
),
@ -109,43 +86,30 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
children: [
Expanded(
child: AppButton(
title: widget.status == MedicalReportStatus.ADD
? TranslationBase.of(context).save
: TranslationBase.of(context).save,
title: widget.status == MedicalReportStatus.ADD ? TranslationBase.of(context).save : TranslationBase.of(context).save,
color: Color(0xffEAEAEA),
fontColor: Colors.black,
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
txtOfMedicalReport = await _controller.getText();
txtOfMedicalReport = (await _controller.getText())!;
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.medicalReport != null
? await widget.model.updateMedicalReport(
widget.patient,
txtOfMedicalReport,
widget.medicalReport != null
? widget.medicalReport.lineItemNo
: null,
widget.medicalReport != null
? widget.medicalReport.invoiceNo
: null)
: await widget.model.addMedicalReport(
widget.patient, txtOfMedicalReport);
? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo! : 0,
widget.medicalReport != null ? widget.medicalReport!.invoiceNo! : "")
: await widget.model!.addMedicalReport(widget.patient!, txtOfMedicalReport);
//model.getMedicalReportList(patient);
Navigator.pop(context);
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
widget.model.error);
if (widget.model!.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(widget.model!.error);
}
} else {
DrAppToastMsg.showErrorToast(
"Please enter medical note");
DrAppToastMsg.showErrorToast("Please enter medical note");
}
},
),
@ -156,28 +120,21 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
if (widget.medicalReport != null)
Expanded(
child: AppButton(
title: widget.status == MedicalReportStatus.ADD
? TranslationBase.of(context).add
: TranslationBase.of(context).verify,
title: widget.status == MedicalReportStatus.ADD ? TranslationBase.of(context).add : TranslationBase.of(context).verify,
color: AppGlobal.appGreenColor,
fontWeight: FontWeight.w700,
onPressed: () async {
txtOfMedicalReport =
await _controller.getText();
txtOfMedicalReport = (await _controller.getText())!;
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.verifyMedicalReport(
widget.patient, widget.medicalReport);
await widget.model!.verifyMedicalReport(widget.patient!, widget.medicalReport!);
GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context);
if (widget.model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
widget.model.error);
if (widget.model!.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(widget.model!.error);
}
} else {
DrAppToastMsg.showErrorToast(
"Please enter medical note");
DrAppToastMsg.showErrorToast("Please enter medical note");
}
},
),

@ -17,7 +17,7 @@ class MedicalReportDetailPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
@ -43,13 +43,13 @@ class MedicalReportDetailPage extends StatelessWidget {
children: [
AppText(
"${TranslationBase.of(context).medical}",
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
AppText(
TranslationBase.of(context).report,
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
)

@ -34,7 +34,7 @@ class MedicalReportPage extends StatefulWidget {
class _MedicalReportPageState extends State<MedicalReportPage> {
@override
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'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
@ -64,13 +64,13 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
children: [
AppText(
"${TranslationBase.of(context).medical}",
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
AppText(
TranslationBase.of(context).report,
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
)
@ -159,7 +159,7 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
1
? Color(0xFFCC9B14)
: AppGlobal.appGreenColor,
fontSize: 1.4 * SizeConfig.textMultiplier,
fontSize: 1.4 * SizeConfig.textMultiplier!,
bold: true,
),
AppText(
@ -170,7 +170,7 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
: model.medicalReportList[index]
.doctorName ??
"",
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
@ -180,16 +180,16 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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),
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
),
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),
fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
),
],
),
@ -204,11 +204,11 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
child: LargeAvatar(
name: projectViewModel.isArabic
? model
.medicalReportList[index].doctorNameN
.medicalReportList[index].doctorNameN!
: model
.medicalReportList[index].doctorName,
.medicalReportList[index].doctorName!,
url: model
.medicalReportList[index].doctorImageURL,
.medicalReportList[index].doctorImageURL!,
),
width: 50,
height: 50,
@ -222,21 +222,21 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
AppText(
projectViewModel.isArabic
? model.medicalReportList[index]
.projectNameN
.projectNameN!
: model.medicalReportList[index]
.projectName,
.projectName!,
fontSize:
1.6 * SizeConfig.textMultiplier,
1.6 * SizeConfig.textMultiplier!,
color: Color(0xFF2E303A),
),
AppText(
projectViewModel.isArabic
? model.medicalReportList[index]
.clinicNameN
.clinicNameN!
: model.medicalReportList[index]
.clinicName,
.clinicName!,
fontSize:
1.6 * SizeConfig.textMultiplier,
1.6 * SizeConfig.textMultiplier!,
color: Color(0xFF2E303A),
),
],

@ -32,22 +32,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class ProgressNoteScreen extends StatefulWidget {
final int visitType;
const ProgressNoteScreen({Key key, this.visitType}) : super(key: key);
const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key);
@override
_ProgressNoteState createState() => _ProgressNoteState();
}
class _ProgressNoteState extends State<ProgressNoteScreen> {
List<NoteModel> notesList;
List<NoteModel>? notesList;
var filteredNotesList;
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
@ -56,15 +55,12 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient.admissionNo!),
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
model
.getPatientProgressNote(progressNoteRequest.toJson(),
isLocalBusy: isLocalBusy)
.then((c) {
model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) {
notesList = model.patientProgressNoteList;
});
}
@ -73,11 +69,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold(
@ -88,513 +83,340 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patient,
isInpatient: true,
),
body: Container(
color: Colors.grey[200],
child: Column(
children: <Widget>[
if (!isDischargedPatient)
AddNewOrder(
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Progress Note Screen",
eventAction: "Update Progress Note",
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UpdateNoteOrder(
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: false,
),
settings: RouteSettings(name: 'UpdateNoteOrder'),
),
);
},
label: widget.visitType == 3
? TranslationBase.of(context).addNewOrderSheet
: TranslationBase.of(context).addProgressNote,
body: Container(
color: Colors.grey[200],
child: Column(
children: <Widget>[
if (!isDischargedPatient)
AddNewOrder(
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Progress Note Screen",
eventAction: "Update Progress Note",
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UpdateNoteOrder(
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: false,
),
settings: RouteSettings(name: 'UpdateNoteOrder'),
),
Expanded(
child: Container(
child: ListView.builder(
itemCount: model.patientProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox(
widthFactor: 0.95,
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.patientProgressNoteList[index]
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy
? Color(0xFFCC9B14)
: model.patientProgressNoteList[index]
.status ==
4
? Colors.red.shade700
: model.patientProgressNoteList[index]
.status ==
2
? AppGlobal.appGreenColor
: Color(0xFFCC9B14),
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
);
},
label: widget.visitType == 3 ? TranslationBase.of(context).addNewOrderSheet : TranslationBase.of(context).addProgressNote,
),
Expanded(
child: Container(
child: ListView.builder(
itemCount: model.patientProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox(
widthFactor: 0.95,
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy
? Color(0xFFCC9B14)
: model.patientProgressNoteList[index].status == 4
? Colors.red.shade700
: model.patientProgressNoteList[index].status == 2
? AppGlobal.appGreenColor
: Color(0xFFCC9B14),
widget: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy)
AppText(
TranslationBase.of(context).notePending,
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model.patientProgressNoteList[index].status == 4)
AppText(
TranslationBase.of(context).noteCanceled,
fontWeight: FontWeight.bold,
color: Colors.red.shade700,
fontSize: 12,
),
if (model.patientProgressNoteList[index].status == 2)
AppText(
TranslationBase.of(context).noteVerified,
fontWeight: FontWeight.bold,
color: AppGlobal.appGreenColor,
fontSize: 12,
),
if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model
.patientProgressNoteList[
index]
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy)
AppText(
TranslationBase.of(context)
.notePending,
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
4)
AppText(
TranslationBase.of(context)
.noteCanceled,
fontWeight: FontWeight.bold,
color: Colors.red.shade700,
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
2)
AppText(
TranslationBase.of(context)
.noteVerified,
fontWeight: FontWeight.bold,
color: AppGlobal.appGreenColor,
fontSize: 12,
),
if (model.patientProgressNoteList[index].status != 2 &&
model
.patientProgressNoteList[
index]
.status !=
4 &&
authenticationViewModel
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
UpdateNoteOrder(
note: model
.patientProgressNoteList[
index],
patientModel:
model,
patient:
patient,
visitType: widget
.visitType,
isUpdate: true,
)),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UpdateNoteOrder(
note: model.patientProgressNoteList[index],
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: true,
)),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
DoctorApp.edit_1,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
TranslationBase.of(
context)
.update,
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
child: Row(
children: [
Icon(
DoctorApp.edit_1,
size: 12,
color: Colors.white,
),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: "verify",
confirmFun: () async {
GifLoaderDialogUtils
.showMyDialog(
context);
UpdateNoteReqModel
reqModel =
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
cancelledNote:
false,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
conditionId: model
.patientProgressNoteList[
index].condition,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: true,
patientTypeID:
patient
.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
});
},
child: Container(
decoration: BoxDecoration(
color: AppGlobal
.appGreenColor,
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons
.check,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
TranslationBase.of(
context)
.noteVerify,
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
SizedBox(
width: 2,
),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName:
TranslationBase.of(
context)
.cancel,
confirmFun: () async {
GifLoaderDialogUtils
.showMyDialog(
context,
);
UpdateNoteReqModel
reqModel =
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
conditionId: model
.patientProgressNoteList[
index].condition,
cancelledNote: true,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: false,
patientTypeID:
patient
.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.red[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons
.trash,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
'Cancel',
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
AppText(
TranslationBase.of(context).update,
fontSize: 10,
color: Colors.white,
),
),
SizedBox(
width: 10,
)
],
],
),
padding: EdgeInsets.all(6),
),
),
SizedBox(
height: 10,
width: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.60,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(
context)
.createdBy + ' ',
fontSize: 10,
),
Expanded(
child: AppText(
model
.patientProgressNoteList[
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12,
isCopyable: true,
),
),
],
),
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(context).conditionDescription + ' : ',
fontSize: 10,
),
Expanded(
child: AppText(
model.patientProgressNoteList[index].conditionDescription ?? '',
fontWeight:
FontWeight.w600,
fontSize: 12,
isCopyable: true,
),
),
],
),
],
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: "verify",
confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(context);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo!),
cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
conditionId: model.patientProgressNoteList[index].condition,
createdBy: model.patientProgressNoteList[index].createdBy,
notes: model.patientProgressNoteList[index].notes,
verifiedNote: true,
patientTypeID: patient.patientType,
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel);
await getProgressNoteList(context, model, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
});
},
child: Container(
decoration: BoxDecoration(
color: AppGlobal.appGreenColor,
borderRadius: BorderRadius.circular(10),
),
Column(
// color:Colors.red[600],
child: Row(
children: [
AppText(
model
.patientProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientProgressNoteList[
index]
.createdOn),
isArabic:
projectViewModel
.isArabic,
isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
Icon(
FontAwesomeIcons.check,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
model
.patientProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientProgressNoteList[
index]
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
TranslationBase.of(context).noteVerify,
fontSize: 10,
color: Colors.white,
),
],
crossAxisAlignment:
CrossAxisAlignment.end,
)
],
),
padding: EdgeInsets.all(6),
),
),
SizedBox(
height: 8,
width: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
model
.patientProgressNoteList[
index]
.notes,
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: TranslationBase.of(context).cancel,
confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(
context,
);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo!),
conditionId: model.patientProgressNoteList[index].condition,
cancelledNote: true,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
createdBy: model.patientProgressNoteList[index].createdBy,
notes: model.patientProgressNoteList[index].notes,
verifiedNote: false,
patientTypeID: patient.patientType,
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel);
await getProgressNoteList(context, model, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.red[600],
borderRadius: BorderRadius.circular(10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons.trash,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
'Cancel',
fontSize: 10,
isCopyable: true,
color: Colors.white,
),
),
])
],
),
padding: EdgeInsets.all(6),
),
),
SizedBox(
width: 10,
)
],
),
SizedBox(
height: 20,
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context).size.width * 0.60,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).createdBy + ' ',
fontSize: 10,
),
Expanded(
child: AppText(
model.patientProgressNoteList[index].doctorName ?? '',
fontWeight: FontWeight.w600,
fontSize: 12,
isCopyable: true,
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).conditionDescription + ' : ',
fontSize: 10,
),
Expanded(
child: AppText(
model.patientProgressNoteList[index].conditionDescription ?? '',
fontWeight: FontWeight.w600,
fontSize: 12,
isCopyable: true,
),
),
],
),
],
),
),
Column(
children: [
AppText(
model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!),
isArabic: projectViewModel.isArabic, isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
AppText(
model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!))
: AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
],
crossAxisAlignment: CrossAxisAlignment.end,
)
],
),
SizedBox(
height: 8,
),
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded(
child: AppText(
model.patientProgressNoteList[index].notes!,
fontSize: 10,
isCopyable: true,
),
),
],
),
])
],
),
);
}),
),
),
],
SizedBox(
height: 20,
),
],
),
),
);
}),
),
),
],
),
),
),
);
}
/// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext context, Function confirmFun, String actionName}) {
showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) {
showDialog(
context: context,
builder: (ctx) => Center(
@ -637,9 +459,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel.isArabic
? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟"
: 'Are you sure you want $actionName this order?',
projectViewModel.isArabic ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" : 'Are you sure you want $actionName this order?',
fontSize: 15,
textAlign: TextAlign.center,
),
@ -654,7 +474,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
ElevatedButton(
child: AppText(
TranslationBase.of(context).cancel,
fontWeight: FontWeight.w600,
@ -664,7 +484,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onPressed: () {
Navigator.of(context).pop();
}),
FlatButton(
ElevatedButton(
child: AppText(
TranslationBase.of(context).noteConfirm,
fontWeight: FontWeight.w600,

@ -30,24 +30,15 @@ import '../../../../../widgets/shared/dialogs/dailog-list-select.dart';
import '../../../../base/base_view.dart';
class UpdateNoteOrder extends StatefulWidget {
final NoteModel note;
final PatientViewModel patientModel;
final PatiantInformtion patient;
final int visitType;
final NoteModel? note;
final PatientViewModel? patientModel;
final PatiantInformtion? patient;
final int? visitType;
final bool isUpdate;
final List<dynamic> elementList;
final Function(dynamic) okFunction;
final List<dynamic>? elementList;
final Function(dynamic)? okFunction;
const UpdateNoteOrder(
{Key key,
this.note,
this.patientModel,
this.patient,
this.visitType,
this.isUpdate,
this.elementList,
this.okFunction})
: super(key: key);
UpdateNoteOrder({Key? key, this.note, this.patientModel, this.patient, this.visitType, this.isUpdate = false, this.elementList, this.okFunction}) : super(key: key);
@override
_UpdateNoteOrderState createState() => _UpdateNoteOrderState();
@ -55,12 +46,12 @@ class UpdateNoteOrder extends StatefulWidget {
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
dynamic selectValue;
int selectedType;
int selectedType = 0;
bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord;
var event = RobotProvider();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
TextEditingController progressNoteController = TextEditingController();
@ -90,12 +81,10 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
projectViewModel = Provider.of(context);
if (widget.note != null) {
progressNoteController.text = widget.note.notes;
if(selectValue==null)
selectValue={};
selectValue[keyId] = widget.note.condition;
selectValue['Description'] = widget.note.conditionDescription;
progressNoteController.text = widget.note!.notes!;
if (selectValue == null) selectValue = {};
selectValue[keyId] = widget.note!.condition;
selectValue['Description'] = widget.note!.conditionDescription!;
}
return BaseView<PatientViewModel>(
@ -115,14 +104,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [
BottomSheetTitle(
title: widget.visitType == 3
? (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
),
SizedBox(
height: 10.0,
@ -136,11 +119,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
ListSelectDialog dialog = ListSelectDialog(
list: model.stpMasterList,
attributeName: 'Description',
attributeValueId:
model.stpMasterList.length == 1
? model.stpMasterList[0]['${keyId}']
.toString()
: '${keyId}',
attributeValueId: model.stpMasterList.length == 1 ? model.stpMasterList[0]['${keyId}'].toString() : '${keyId}',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => {
setState(() {
@ -159,7 +138,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}
: null,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).selectCondition,//'Select Condition',
hintText: TranslationBase.of(context).selectCondition, //'Select Condition',
dropDownText: model.stpMasterList.length == 1
? model.stpMasterList[0]['Description']
: selectValue == null
@ -182,19 +161,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [
AppTextFieldCustom(
hintText: widget.visitType == 3
? (widget.isUpdate
? TranslationBase.of(context)
.noteUpdate
: TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context)
.noteUpdate
: TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context)
.progressNote,
? (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
: (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
//TranslationBase.of(context).addProgressNote,
controller: progressNoteController,
maxLines: 40,
@ -202,26 +170,18 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: progressNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
Positioned(
top: -2,
//MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic
? MediaQuery.of(context).size.width * 0.75
: 15,
right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15,
child: Column(
children: [
IconButton(
icon: Icon(DoctorApp.speechtotext,
color: Colors.black, size: 35),
icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35),
onPressed: () {
initSpeechState()
.then((value) => {onVoiceText()});
initSpeechState().then((value) => {onVoiceText()});
},
),
],
@ -258,14 +218,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
margin: EdgeInsets.all(5),
child: AppButton(
title: widget.visitType == 3
? (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote,
color: AppGlobal.appGreenColor,
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
@ -275,61 +229,51 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
});
if (progressNoteController.text.trim().isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
DoctorProfileModel.fromJson(profile);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo:
int.parse(widget.patient.admissionNo),
admissionNo: int.parse(widget.patient!.admissionNo!),
cancelledNote: false,
lineItemNo: widget.note.lineItemNo,
createdBy: widget.note.createdBy,
lineItemNo: widget.note!.lineItemNo!,
createdBy: widget.note!.createdBy!,
notes: progressNoteController.text,
verifiedNote: false,
patientTypeID: widget.patient.patientType,
patientTypeID: widget.patient!.patientType,
patientOutSA: false,
conditionId: selectValue['ParameterCode']);
await widget.patientModel
.updatePatientProgressNote(reqModel);
await widget.patientModel!.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo:
int.parse(widget.patient.admissionNo),
admissionNo: int.parse(widget.patient!.admissionNo!),
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
patientID: widget.patient!.patientId,
nursingRemarks: ' ',
patientTypeID: widget.patient.patientType,
patientTypeID: widget.patient!.patientType,
patientOutSA: false,
notes: progressNoteController.text,
conditionId: selectValue['ParameterCode']);
await widget.patientModel
.createPatientProgressNote(reqModel);
await widget.patientModel!.createPatientProgressNote(reqModel);
}
if (widget.patientModel.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(widget.patientModel.error);
if (widget.patientModel!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.patientModel!.error);
} else {
ProgressNoteRequest progressNoteRequest =
ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo:
int.parse(widget.patient.admissionNo),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient!.admissionNo!),
projectID: widget.patient!.projectId,
patientTypeID: widget.patient!.patientType,
languageID: 2);
await widget.patientModel!.getPatientProgressNote(progressNoteRequest.toJson());
}
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).yourOrderAddedSuccessfully);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully);
Navigator.of(context).pop();
} else {
Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces);
@ -345,8 +289,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
@ -390,8 +333,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}

@ -20,29 +20,29 @@ import 'package:provider/provider.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class NursingProgressNoteScreen extends StatefulWidget {
const NursingProgressNoteScreen({Key key}) : super(key: key);
const NursingProgressNoteScreen({Key? key}) : super(key: key);
@override
_ProgressNoteState createState() => _ProgressNoteState();
}
class _ProgressNoteState extends State<NursingProgressNoteScreen> {
List<NoteModel> notesList;
List<NoteModel> notesList = [];
var filteredNotesList;
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type);
GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel =
GetNursingProgressNoteRequestModel(
admissionNo: int.parse(patient.admissionNo),
admissionNo: int.parse(patient.admissionNo!),
patientTypeID: patient.patientType,
patientID: patient.patientId,
setupID: "010266");
@ -53,7 +53,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
@ -156,7 +156,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
.getDateTimeFromServerFormat(model
.patientNursingProgressNoteList[
index]
.createdOn),
.createdOn!),
isArabic:
projectViewModel
.isArabic,
@ -182,7 +182,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
.getDateTimeFromServerFormat(model
.patientNursingProgressNoteList[
index]
.createdOn))
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
@ -207,7 +207,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
model
.patientNursingProgressNoteList[
index]
.notes,
.notes!,
fontSize: 10,
isCopyable: true,
),

@ -24,31 +24,30 @@ import '../../../../widgets/shared/app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class OperationReportScreen extends StatefulWidget {
final int visitType;
final int? visitType;
const OperationReportScreen({Key key, this.visitType}) : super(key: key);
const OperationReportScreen({Key? key, this.visitType}) : super(key: key);
@override
_ProgressNoteState createState() => _ProgressNoteState();
}
class _ProgressNoteState extends State<OperationReportScreen> {
List<NoteModel> notesList;
List<NoteModel> notesList = [];
var filteredNotesList;
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<OperationReportViewModel>(
onModelReady: (model) => model.getReservations(patient.patientMRN),
onModelReady: (model) => model.getReservations(patient.patientMRN!),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -59,8 +58,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
),
body: Container(
color: Colors.grey[200],
child: model.reservationList == null ||
model.reservationList.length == 0
child: model.reservationList == null || model.reservationList.length == 0
? Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
@ -81,46 +79,29 @@ class _ProgressNoteState extends State<OperationReportScreen> {
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.60,
width: MediaQuery.of(context).size.width * 0.60,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(
context)
.createdBy,
TranslationBase.of(context).createdBy,
fontSize: 10,
),
Expanded(
child: AppText(
model
.reservationList[
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
model.reservationList[index].doctorName ?? '',
fontWeight: FontWeight.w600,
fontSize: 12,
),
),
@ -132,146 +113,83 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Column(
children: [
AppText(
model.reservationList[index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.reservationList[
index]
.createdOn),
isArabic:
projectViewModel
.isArabic,
isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
model.reservationList[index].createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.reservationList[index].createdOn!),
isArabic: projectViewModel.isArabic, isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
model.reservationList[index]
.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.reservationList[
index]
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
model.reservationList[index].createdOn != null
? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.reservationList[index].createdOn!))
: AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
),
],
crossAxisAlignment:
CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.reservation,
fontSize: 10,
),
Expanded(
child: AppText(
model.reservationList[index]
.oTReservationID
.toString(),
fontSize: 10,
),
)
]),
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
AppText(
TranslationBase.of(context).reservation,
fontSize: 10,
),
Expanded(
child: AppText(
model.reservationList[index].oTReservationID.toString(),
fontSize: 10,
),
)
]),
SizedBox(
height: 8,
),
if (model.reservationList[index]
.operationDate !=
null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.operationDate,
fontSize: 10,
),
Expanded(
child: AppText(
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.reservationList[
index]
.operationDate),
isArabic:
projectViewModel
.isArabic,
isMonthShort: true),
fontSize: 10,
),
)
]),
if (model.reservationList[index]
.timeStart !=
null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.operationTimeStart,
fontSize: 10,
),
Expanded(
child: AppText(
model
.reservationList[
index]
.timeStart,
fontSize: 10,
),
)
]),
if (model.reservationList[index]
.remarks !=
null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.remarks,
fontSize: 10,
),
Expanded(
child: AppText(
model
.reservationList[
index]
.remarks ??
'',
fontSize: 10,
),
),
])
if (model.reservationList[index].operationDate != null)
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
AppText(
TranslationBase.of(context).operationDate,
fontSize: 10,
),
Expanded(
child: AppText(
AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.reservationList[index].operationDate!),
isArabic: projectViewModel.isArabic, isMonthShort: true),
fontSize: 10,
),
)
]),
if (model.reservationList[index].timeStart != null)
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
AppText(
TranslationBase.of(context).operationTimeStart,
fontSize: 10,
),
Expanded(
child: AppText(
model.reservationList[index].timeStart!,
fontSize: 10,
),
)
]),
if (model.reservationList[index].remarks != null)
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
AppText(
TranslationBase.of(context).remarks,
fontSize: 10,
),
Expanded(
child: AppText(
model.reservationList[index].remarks ?? '',
fontSize: 10,
),
),
])
],
),
@ -287,28 +205,20 @@ class _ProgressNoteState extends State<OperationReportScreen> {
// index]
// .createdBy)
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
onTap: () async {
await locator<AnalyticsService>()
.logEvent(
eventCategory:
"Operation Report Screen",
eventAction:
"Update Operation Report ",
await locator<AnalyticsService>().logEvent(
eventCategory: "Operation Report Screen",
eventAction: "Update Operation Report ",
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
UpdateOperationReport(
reservation: model
.reservationList[
index],
builder: (context) => UpdateOperationReport(
reservation: model.reservationList[index],
patient: patient,
isUpdate: true,
)),
@ -317,8 +227,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
child: Container(
decoration: BoxDecoration(
color: AppGlobal.appGreenColor,
borderRadius:
BorderRadius.circular(10),
borderRadius: BorderRadius.circular(10),
),
// color:Colors.red[600],
@ -333,8 +242,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
width: 2,
),
AppText(
TranslationBase.of(context)
.operationReports,
TranslationBase.of(context).operationReports,
fontSize: 10,
color: Colors.white,
),

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
@ -20,18 +21,14 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../config/config.dart';
class UpdateOperationReport extends StatefulWidget {
final GetReservationsResponseModel reservation;
// final OperationReportViewModel operationReportViewModel;
final PatiantInformtion patient;
final int visitType;
final bool isUpdate;
final GetReservationsResponseModel? reservation;
final PatiantInformtion? patient;
final int? visitType;
final bool? isUpdate;
const UpdateOperationReport(
{Key key,
{Key? key,
// this.operationReportViewModel,
this.patient,
this.visitType,
@ -44,12 +41,12 @@ class UpdateOperationReport extends StatefulWidget {
}
class _UpdateOperationReportState extends State<UpdateOperationReport> {
int selectedType;
int? selectedType;
bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord;
var event = RobotProvider();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
TextEditingController preOpDiagmosisController = TextEditingController();
TextEditingController postOpDiagmosisNoteController = TextEditingController();
@ -63,13 +60,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
TextEditingController complicationDetailsController = TextEditingController();
TextEditingController bloodLossDetailController = TextEditingController();
TextEditingController histopathSpecimenController = TextEditingController();
TextEditingController microbiologySpecimenController =
TextEditingController();
TextEditingController microbiologySpecimenController = TextEditingController();
TextEditingController otherSpecimenController = TextEditingController();
TextEditingController scrubNurseController = TextEditingController();
TextEditingController circulatingNurseController = TextEditingController();
TextEditingController BloodTransfusedDetailController =
TextEditingController();
TextEditingController BloodTransfusedDetailController = TextEditingController();
TextEditingController anasthetistController = TextEditingController();
TextEditingController OTReservationID = TextEditingController();
@ -91,33 +86,30 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
return BaseView<OperationReportViewModel>(
onModelReady: (model) async {
await model.getOperationReportDetails(widget.reservation);
OTReservationID.text = widget.reservation.oTReservationID.toString();
await model.getOperationReportDetails(widget.reservation!);
OTReservationID.text = widget.reservation!.oTReservationID.toString();
if (model.operationDetailsList.isNotEmpty) {
GetOperationDetailsResponseModel oldDetails =
model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis;
surgeonController.text = oldDetails.surgeon;
assistantNoteController.text = oldDetails.assistant;
operationController.text = oldDetails.operation;
inasionController.text = oldDetails.inasion;
findingController.text = oldDetails.finding;
surgeryProcedureController.text = oldDetails.surgeryProcedure;
postOpInstructionController.text = oldDetails.postOpInstruction;
complicationDetailsController.text = oldDetails.complicationDetail;
bloodLossDetailController.text = oldDetails.bloodLossDetail;
histopathSpecimenController.text = oldDetails.histopathSpecimen;
microbiologySpecimenController.text =
oldDetails.microbiologySpecimen;
otherSpecimenController.text = oldDetails.otherSpecimen;
GetOperationDetailsResponseModel oldDetails = model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis!;
surgeonController.text = oldDetails.surgeon!;
assistantNoteController.text = oldDetails.assistant!;
operationController.text = oldDetails.operation!;
inasionController.text = oldDetails.inasion!;
findingController.text = oldDetails.finding!;
surgeryProcedureController.text = oldDetails.surgeryProcedure!;
postOpInstructionController.text = oldDetails.postOpInstruction!;
complicationDetailsController.text = oldDetails.complicationDetail!;
bloodLossDetailController.text = oldDetails.bloodLossDetail!;
histopathSpecimenController.text = oldDetails.histopathSpecimen!;
microbiologySpecimenController.text = oldDetails.microbiologySpecimen!;
otherSpecimenController.text = oldDetails.otherSpecimen!;
scrubNurseController.text = oldDetails.scrubNurse;
circulatingNurseController.text = oldDetails.circulatingNurse;
BloodTransfusedDetailController.text =
oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist;
BloodTransfusedDetailController.text = oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist!;
}
},
builder: (_, model, w) => AppScaffold(
@ -146,8 +138,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
child: Column(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.reservation,
hintText: TranslationBase.of(context).reservation,
controller: OTReservationID,
maxLines: 1,
minLines: 1,
@ -158,95 +149,63 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.preOperationDiagnosis,
hintText: TranslationBase.of(context).preOperationDiagnosis,
controller: preOpDiagmosisController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: preOpDiagmosisController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.postOperationDiagnosis,
hintText: TranslationBase.of(context).postOperationDiagnosis,
controller: postOpDiagmosisNoteController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
postOpDiagmosisNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).surgeon,
hintText: TranslationBase.of(context).surgeon,
controller: surgeonController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
surgeonController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).assistant,
hintText: TranslationBase.of(context).assistant,
controller: assistantNoteController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: assistantNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).operation,
hintText: TranslationBase.of(context).operation,
controller: operationController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
operationController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
@ -260,248 +219,162 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
inasionController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).finding,
hintText: TranslationBase.of(context).finding,
controller: findingController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
findingController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.surgeryProcedure,
hintText: TranslationBase.of(context).surgeryProcedure,
controller: surgeryProcedureController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
surgeryProcedureController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.postOperationInstruction,
hintText: TranslationBase.of(context).postOperationInstruction,
controller: postOpInstructionController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
postOpInstructionController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.complicationDetails1,
hintText: TranslationBase.of(context).complicationDetails1,
controller: complicationDetailsController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
complicationDetailsController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.bloodLossDetail,
hintText: TranslationBase.of(context).bloodLossDetail,
controller: bloodLossDetailController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: bloodLossDetailController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.histopathSpecimen,
hintText: TranslationBase.of(context).histopathSpecimen,
controller: histopathSpecimenController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
histopathSpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.microbiologySpecimen,
controller:
microbiologySpecimenController,
hintText: TranslationBase.of(context).microbiologySpecimen,
controller: microbiologySpecimenController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
microbiologySpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.otherSpecimen,
hintText: TranslationBase.of(context).otherSpecimen,
controller: otherSpecimenController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: otherSpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.scrubNurse,
hintText: TranslationBase.of(context).scrubNurse,
controller: scrubNurseController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
scrubNurseController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.circulatingNurse,
hintText: TranslationBase.of(context).circulatingNurse,
controller: circulatingNurseController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
circulatingNurseController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.bloodTransfusedDetail,
controller:
BloodTransfusedDetailController,
hintText: TranslationBase.of(context).bloodTransfusedDetail,
controller: BloodTransfusedDetailController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
BloodTransfusedDetailController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.anesthetist,
hintText: TranslationBase.of(context).anesthetist,
controller: anasthetistController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
anasthetistController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 250,
@ -529,11 +402,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
" " +
TranslationBase.of(context).operationReports,
title: (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + " " + TranslationBase.of(context).operationReports,
color: AppGlobal.appGreenColor,
// disabled: operationReportsController.text.isEmpty,
fontWeight: FontWeight.w700,
@ -545,55 +414,33 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
GifLoaderDialogUtils.showMyDialog(context);
await model.getDoctorProfile();
CreateUpdateOperationReportRequestModel
createUpdateOperationReportRequestModel =
CreateUpdateOperationReportRequestModel(
inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation
reservationNo: widget
.reservation.oTReservationID,
preOpDiagmosis:
preOpDiagmosisController.text,
postOpDiagmosis:
postOpDiagmosisNoteController
.text,
surgeon: surgeonController.text,
assistant:
assistantNoteController.text,
anasthetist:
assistantNoteController.text,
operation: operationController.text,
finding: findingController.text,
surgeryProcedure:
surgeonController.text,
postOpInstruction:
postOpInstructionController.text,
complicationDetails:
complicationDetailsController
.text,
bloodLossDetail:
bloodLossDetailController.text,
histopathSpecimen:
histopathSpecimenController.text,
microbiologySpecimen:
microbiologySpecimenController
.text,
otherSpecimen:
otherSpecimenController.text,
scrubNurse: surgeonController.text,
circulatingNurse:
circulatingNurseController.text,
bloodTransfusedDetail:
bloodLossDetailController.text,
patientID: widget.patient.patientId,
admissionNo: int.parse(
widget.patient.admissionNo),
createdBy:
model.doctorProfile.doctorID,
setupID: "010266");
await model.updateOperationReport(
createUpdateOperationReportRequestModel);
CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel(
inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation
reservationNo: widget.reservation!.oTReservationID,
preOpDiagmosis: preOpDiagmosisController.text,
postOpDiagmosis: postOpDiagmosisNoteController.text,
surgeon: surgeonController.text,
assistant: assistantNoteController.text,
anasthetist: assistantNoteController.text,
operation: operationController.text,
finding: findingController.text,
surgeryProcedure: surgeonController.text,
postOpInstruction: postOpInstructionController.text,
complicationDetails: complicationDetailsController.text,
bloodLossDetail: bloodLossDetailController.text,
histopathSpecimen: histopathSpecimenController.text,
microbiologySpecimen: microbiologySpecimenController.text,
otherSpecimen: otherSpecimenController.text,
scrubNurse: surgeonController.text,
circulatingNurse: circulatingNurseController.text,
bloodTransfusedDetail: bloodLossDetailController.text,
patientID: widget.patient!.patientId!,
admissionNo: int.parse(widget.patient!.admissionNo!),
createdBy: model.doctorProfile!.doctorID!,
setupID: "010266");
await model.updateOperationReport(createUpdateOperationReportRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
@ -601,8 +448,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// await model.(
// operationReportsRequest.toJson());
DrAppToastMsg.showSuccesToast(
"Your Order added Successfully");
DrAppToastMsg.showSuccesToast("Your Order added Successfully");
}
GifLoaderDialogUtils.hideDialog(context);
}

@ -10,22 +10,18 @@ import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
class PendingOrdersScreen extends StatelessWidget {
const PendingOrdersScreen({Key key}) : super(key: key);
const PendingOrdersScreen({Key? key}) : super(key: key);
@override
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'];
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<PendingOrdersViewModel>(
onModelReady: (model) => model.getPendingOrders(
patientId: patient.patientMRN,
admissionNo: int.parse(patient.admissionNo)),
builder:
(BuildContext context, PendingOrdersViewModel model, Widget child) =>
AppScaffold(
onModelReady: (model) => model.getPendingOrders(patientId: patient.patientMRN!, admissionNo: int.parse(patient.admissionNo!)),
builder: (BuildContext context, PendingOrdersViewModel model, Widget? child) => AppScaffold(
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
@ -33,8 +29,7 @@ class PendingOrdersScreen extends StatelessWidget {
isShowAppBar: true,
baseViewModel: model,
appBarTitle: "Pending Orders",
body: model.pendingOrdersList == null ||
model.pendingOrdersList.length == 0
body: model.pendingOrdersList == null || model.pendingOrdersList.length == 0
? Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
@ -83,8 +78,7 @@ class PendingOrdersScreen extends StatelessWidget {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: AppText(
model.pendingOrdersList[index].notes),
child: AppText(model.pendingOrdersList[index].notes!),
),
SizedBox(
height: 20,

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/intervention_medication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -11,29 +12,27 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../core/viewModel/profile/intervention_medication_view_model.dart';
import '../../../../widgets/transitions/fade_page.dart';
import 'intervention_medication_history_screen.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class InterventionMedicationScreen extends StatefulWidget {
final PatiantInformtion patient;
final InterventionMedicationViewModel previousModel;
const InterventionMedicationScreen(this.patient, {Key key, this.previousModel}) : super(key: key);
final PatiantInformtion? patient;
final InterventionMedicationViewModel? previousModel;
const InterventionMedicationScreen(this.patient, {Key? key, this.previousModel}) : super(key: key);
@override
_InterventionMedicationScreenState createState() =>
_InterventionMedicationScreenState();
_InterventionMedicationScreenState createState() => _InterventionMedicationScreenState();
}
class _InterventionMedicationScreenState
extends State<InterventionMedicationScreen> {
class _InterventionMedicationScreenState extends State<InterventionMedicationScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -42,164 +41,142 @@ class _InterventionMedicationScreenState
return BaseView<InterventionMedicationViewModel>(
onModelReady: (model) => model.getInterventionMedication(
patientId: widget.patient.patientId,
//admissionNo: int.parse(widget.patient.admissionNo),
fromDate: widget.previousModel.selectedFromDate,
toDate: widget.previousModel.selectedToDate,
patientId: widget.patient!.patientId,
//admissionNo: int.parse(widget.patient.admissionNo),
fromDate: widget.previousModel!.selectedFromDate,
toDate: widget.previousModel!.selectedToDate,
),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileAppBar(
widget.patient,
widget.patient!,
isInpatient: true,
),
body: model.allInterventionList == null ||
model.allInterventionList.length == 0
body: model.allInterventionList == null || model.allInterventionList.length == 0
? Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
),
)
: Container(
color: Colors.grey[200],
child: Column(
children: <Widget>[
Expanded(
child: Container(
child: ListView.builder(
itemCount: model.allInterventionList.length,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
child: FractionallySizedBox(
widthFactor: 0.95,
child: CardWithBgWidget(
hasBorder: false,
bgColor: Colors.transparent,
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.60,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
: Container(
color: Colors.grey[200],
child: Column(
children: <Widget>[
Expanded(
child: Container(
child: ListView.builder(
itemCount: model.allInterventionList.length,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
child: FractionallySizedBox(
widthFactor: 0.95,
child: CardWithBgWidget(
hasBorder: false,
bgColor: Colors.transparent,
widget: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context).size.width * 0.60,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
valueSize: 14,
label: '',
value: model.allInterventionList[index].cS!,
)
],
),
),
Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
valueSize: 14,
label: '',
value: model.allInterventionList[index].cS,
)
AppText(
AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(model.allInterventionList[index].startDatetime!),
isArabic: projectViewModel.isArabic, isMonthShort: true),
fontWeight: FontWeight.w600,
fontSize: 14,
color: Color(0xFF2B353E),
),
],
),
),
Column(
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(model
.allInterventionList[
index]
.startDatetime),
isArabic:
projectViewModel
.isArabic,
isMonthShort:
true),
fontWeight:
FontWeight.w600,
fontSize: 14,
color: Color(0xFF2B353E),
),
],
),
],
)
],
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).description,
value: model.allInterventionList[index].description,
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).medication,
value: model.allInterventionList[index].medication,
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).doctorComments,
value: model.allInterventionList[index].doctorComments,
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).statusDescription,
value: model.allInterventionList[index].statusDescription,
),
],
),
SizedBox(
height: 20,
),
],
),
],
)
],
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).description,
value: model.allInterventionList[index].description!,
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).medication,
value: model.allInterventionList[index].medication!,
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).doctorComments,
value: model.allInterventionList[index].doctorComments!,
),
SizedBox(
height: 8,
),
CustomRow(
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).statusDescription,
value: model.allInterventionList[index].statusDescription!,
),
],
),
SizedBox(
height: 20,
),
],
),
),
onTap: () {
Navigator.push(
context,
FadePage(
page: InterventionMedicationHistoryScreen(widget.patient, model.allInterventionList[index]),
),
);
},
);
}),
),
),
onTap: () {
Navigator.push(
context,
FadePage(
page: InterventionMedicationHistoryScreen(widget.patient!, model.allInterventionList[index]),
),
);
},
);
}),
),
],
),
),
],
),
),
),
);
}

@ -27,7 +27,7 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class InterventionMedicationHistoryScreen extends StatefulWidget {
final PatiantInformtion patient;
final InterventionMedicationResModel interventionMedication;
const InterventionMedicationHistoryScreen(this.patient, this.interventionMedication, {Key key}) : super(key: key);
const InterventionMedicationHistoryScreen(this.patient, this.interventionMedication, {Key? key}) : super(key: key);
@override
_InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState();
@ -35,8 +35,8 @@ class InterventionMedicationHistoryScreen extends StatefulWidget {
class _InterventionMedicationHistoryScreenState extends State<InterventionMedicationHistoryScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -107,7 +107,7 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).createdByName,
value: model.allInterventionHistoryList[index].createdByName,
value: model.allInterventionHistoryList[index].createdByName!,
),
],
),
@ -125,7 +125,7 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
AppDateUtils.convertStringToDate(
model
.allInterventionHistoryList[
index].createdOn)
index].createdOn!)
,isArabic:
projectViewModel
.isArabic,
@ -147,7 +147,7 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
labelSize: 12,
valueSize: 12,
label: TranslationBase.of(context).remarks,
value: model.allInterventionHistoryList[index].remark,
value: model.allInterventionHistoryList[index].remark!,
),
SizedBox(
height: 8,

@ -1,5 +1,8 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/intervention_medication_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
@ -9,26 +12,21 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../config/config.dart';
import '../../../../core/viewModel/profile/intervention_medication_view_model.dart';
import '../../../base/base_view.dart';
import 'intervention_medication.dart';
class PharmacyInterventionScreen extends StatefulWidget {
final OutPatientFilterType outPatientFilterType;
final OutPatientFilterType? outPatientFilterType;
const PharmacyInterventionScreen({
Key key,
Key? key,
this.outPatientFilterType,
}) : super(key: key);
@override
_PharmacyInterventionScreenState createState() =>
_PharmacyInterventionScreenState();
_PharmacyInterventionScreenState createState() => _PharmacyInterventionScreenState();
}
class _PharmacyInterventionScreenState
extends State<PharmacyInterventionScreen> {
class _PharmacyInterventionScreenState extends State<PharmacyInterventionScreen> {
@override
void initState() {
// TODO: implement initState
@ -37,7 +35,7 @@ class _PharmacyInterventionScreenState
@override
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'];
return BaseView<InterventionMedicationViewModel>(
builder: (_, model, w) => AppScaffold(
@ -52,10 +50,7 @@ class _PharmacyInterventionScreenState
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(
title: (OutPatientFilterType.Previous ==
widget.outPatientFilterType)
? ""
: TranslationBase.of(context).pharmacyIntervention,
title: (OutPatientFilterType.Previous == widget.outPatientFilterType) ? "" : TranslationBase.of(context).pharmacyIntervention,
),
SizedBox(
height: 10.0,
@ -71,24 +66,13 @@ class _PharmacyInterventionScreenState
onTap: () => selectDate(
context,
model,
firstDate: DateTime(
DateTime.now().year - 20,
DateTime.now().month,
DateTime.now().day),
lastDate: DateTime(
DateTime.now().year,
DateTime.now().month,
DateTime.now().day + 100),
selectedDate: model.selectedFromDate != null
? model.selectedFromDate
: DateTime.now(),
firstDate: DateTime(DateTime.now().year - 20, DateTime.now().month, DateTime.now().day),
lastDate: DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 100),
selectedDate: model.selectedFromDate != null ? model.selectedFromDate : DateTime.now(),
),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).fromDate,
"${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}"
,
true,
TranslationBase.of(context).fromDate, "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}", true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
@ -107,24 +91,13 @@ class _PharmacyInterventionScreenState
context,
model,
isFromDate: false,
firstDate: DateTime(
DateTime.now().year - 20,
DateTime.now().month,
DateTime.now().day),
lastDate: DateTime(
DateTime.now().year,
DateTime.now().month,
DateTime.now().day + 100),
selectedDate: model.selectedToDate != null
? model.selectedToDate
: DateTime.now().add(Duration(days: 1)),
firstDate: DateTime(DateTime.now().year - 20, DateTime.now().month, DateTime.now().day),
lastDate: DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 100),
selectedDate: model.selectedToDate != null ? model.selectedToDate : DateTime.now().add(Duration(days: 1)),
),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).toDate,
"${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}"
,
true,
TranslationBase.of(context).toDate, "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}", true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
@ -169,8 +142,7 @@ class _PharmacyInterventionScreenState
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InterventionMedicationScreen(
builder: (context) => InterventionMedicationScreen(
patient,
previousModel: model,
)),
@ -188,16 +160,12 @@ class _PharmacyInterventionScreenState
)));
}
selectDate(BuildContext context, InterventionMedicationViewModel model,
{bool isFromDate = true,
DateTime firstDate,
lastDate,
selectedDate}) async {
selectDate(BuildContext context, InterventionMedicationViewModel model, {bool isFromDate = true, DateTime? firstDate, lastDate, selectedDate}) async {
Utils.hideKeyboard(context);
final DateTime picked = await showDatePicker(
final DateTime? picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: firstDate,
firstDate: firstDate!,
lastDate: lastDate,
initialEntryMode: DatePickerEntryMode.calendar,
);
@ -219,9 +187,7 @@ class _PharmacyInterventionScreenState
}
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),

@ -17,10 +17,10 @@ class InpatientPrescriptionDetailsScreen extends StatefulWidget {
class _InpatientPrescriptionDetailsScreenState
extends State<InpatientPrescriptionDetailsScreen> {
bool _showDetails = false;
String error;
TextEditingController answerController;
String? error;
TextEditingController answerController = TextEditingController();
bool _isInit = true;
PrescriptionReportForInPatient prescription;
PrescriptionReportForInPatient prescription = PrescriptionReportForInPatient();
@override
void initState() {
@ -31,7 +31,7 @@ class _InpatientPrescriptionDetailsScreenState
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
prescription = routeArgs['prescription'];
}
_isInit = false;
@ -49,8 +49,8 @@ class _InpatientPrescriptionDetailsScreenState
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
AppText(
prescription.itemDescription,
fontSize: 2.5 * SizeConfig.textMultiplier,
prescription.itemDescription!,
fontSize: 2.5 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
),
InkWell(
@ -96,11 +96,11 @@ class _InpatientPrescriptionDetailsScreenState
key: 'UOM'),
buildTableRow(
des:
'${AppDateUtils.getDate(prescription.startDatetime)}',
'${AppDateUtils.getDate(prescription.startDatetime!)}',
key: 'Start Date'),
buildTableRow(
des:
'${AppDateUtils.getDate(prescription.stopDatetime)}',
'${AppDateUtils.getDate(prescription.stopDatetime!)}',
key: 'Stop Date'),
buildTableRow(
des: '${prescription.noOfDoses}',
@ -115,7 +115,7 @@ class _InpatientPrescriptionDetailsScreenState
key: 'Pharmacy Remarks'),
buildTableRow(
des:
'${AppDateUtils.getDate(prescription.prescriptionDatetime)}',
'${AppDateUtils.getDate(prescription.prescriptionDatetime!)}',
key: 'Prescription Date'),
buildTableRow(
des: '${prescription.refillID}',
@ -160,7 +160,7 @@ class _InpatientPrescriptionDetailsScreenState
child: Container(
child: AppText(
key,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
@ -176,7 +176,7 @@ class _InpatientPrescriptionDetailsScreenState
children: <Widget>[
AppText(
'${des}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w300,
textAlign: TextAlign.center,
)

@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
class OutPatientPrescriptionDetailsItem extends StatefulWidget {
final PrescriptionReport prescriptionReport;
OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport});
OutPatientPrescriptionDetailsItem({Key? key, required this.prescriptionReport});
@override
_OutPatientPrescriptionDetailsItemState createState() =>
@ -30,7 +30,7 @@ class _OutPatientPrescriptionDetailsItemState
flex: 5,
child: AppText(
'${widget.prescriptionReport.itemDescription} ',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontSize: 2.5 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
),
),
@ -106,7 +106,7 @@ class _OutPatientPrescriptionDetailsItemState
child: Container(
child: AppText(
key,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
@ -122,7 +122,7 @@ class _OutPatientPrescriptionDetailsItemState
children: <Widget>[
AppText(
'${des}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w300,
textAlign: TextAlign.center,
)

@ -8,12 +8,12 @@ class PatientProfileCardModel {
final bool isInPatient;
final bool isDisable;
final bool isLoading;
final Function onTap;
final Function? onTap;
final bool isDischargedPatient;
final bool isSelectInpatient;
final bool isDartIcon;
final IconData dartIcon;
final Color color;
final IconData? dartIcon;
final Color? color;
PatientProfileCardModel(
this.nameLine1,

@ -9,6 +9,8 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart';
@ -26,17 +28,13 @@ import 'package:flutter_svg/svg.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:quiver/async.dart';
import '../../../../locator.dart';
import '../../../../routes.dart';
class PatientProfileScreen extends StatefulWidget {
@override
_PatientProfileScreenState createState() => _PatientProfileScreenState();
}
class _PatientProfileScreenState extends State<PatientProfileScreen>
with SingleTickerProviderStateMixin {
PatiantInformtion patient;
class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
PatiantInformtion patient = PatiantInformtion();
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
bool isFromSearch = false;
@ -48,16 +46,16 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
bool isDischargedPatient = false;
bool isSearchAndOut = false;
bool isCallStarted = false;
String patientType;
String arrivalType;
String from;
String to;
TabController _tabController;
String? patientType;
String? arrivalType;
String? from;
String? to;
TabController? _tabController;
int index = 0;
int _activeTab = 0;
StreamController<String> videoCallDurationStreamController;
Stream<String> videoCallDurationStream = (() async* {})();
late StreamController<String> videoCallDurationStreamController;
late Stream<String> videoCallDurationStream;
@override
void initState() {
@ -69,17 +67,17 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
@override
void dispose() {
_tabController.dispose();
_tabController!.dispose();
super.dispose();
if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId);
_liveCareViewModel.removePatientFromDoctorList(patient.vcId!);
}
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -112,23 +110,22 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
_activeTab = 1;
}
StreamSubscription callTimer;
late StreamSubscription callTimer;
callConnected() {
callTimer =
CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
..onDone(() {
callTimer.cancel();
})
..onData((data) {
var t = Utils.timeFrom(duration: data.elapsed);
videoCallDurationStreamController.sink.add(t);
});
callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
..onDone(() {
callTimer.cancel();
})
..onData((data) {
var t = Utils.timeFrom(duration: data.elapsed);
videoCallDurationStreamController.sink.add(t);
});
}
callDisconnected() {
callTimer.cancel();
videoCallDurationStreamController.sink.add(null);
videoCallDurationStreamController.sink.add("");
setState(() {
isCallStarted = false;
@ -140,8 +137,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
final screenSize = MediaQuery.of(context).size;
return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1)
await model.addPatientToDoctorList(patient.vcId);
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId!);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -154,13 +150,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
children: [
Column(
children: [
PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType,
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!,
videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
height: (patient.patientStatusType != null &&
patient.patientStatusType == 43)
height: (patient.patientStatusType != null && patient.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
@ -178,32 +172,31 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
child: isSearchAndOut
? ProfileGridForSearch(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patientType: patientType!,
arrivalType: arrivalType!,
isInpatient: isInpatient,
from: from,
to: to,
from: from!,
to: to!,
)
: isInpatient
? ProfileGridForInPatient(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patientType: patientType!,
arrivalType: arrivalType!,
isInpatient: isInpatient,
from: from,
to: to,
isDischargedPatient:
isDischargedPatient,
from: from!,
to: to!,
isDischargedPatient: isDischargedPatient,
isFromSearch: isFromSearch,
)
: ProfileGridForOther(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patientType: patientType!,
arrivalType: arrivalType!,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
from: from,
to: to,
from: from!,
to: to!,
),
),
SizedBox(
@ -218,8 +211,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
? true
: isFromLiveCare
? patient.episodeNo != null
: patient.patientStatusType != null &&
patient.patientStatusType == 43)
: patient.patientStatusType != null && patient.patientStatusType == 43)
BaseView<SOAPViewModel>(
onModelReady: (model) async {
model.getDoctorProfile();
@ -237,10 +229,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
if (patient.episodeNo == 0)
AppButton(
loading: model.state == ViewState.BusyLocal,
disabled:
model.state == ViewState.BusyLocal,
title:
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
disabled: model.state == ViewState.BusyLocal,
title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare || isInpatient
? AppGlobal.appRedColor
: patient.patientStatusType == 43
@ -248,8 +238,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
: AppGlobal.appRedColor,
fontColor: Colors.white,
// vPadding: 8,
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 9 : 6),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 25,
fontWeight: FontWeight.normal,
@ -260,34 +249,24 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30,
),
onPressed: () async {
if ((isFromLiveCare &&
patient.appointmentNo != null) ||
patient.patientStatusType == 43 ||
isInpatient) {
createEpisode(
patient: patient, model: model);
if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) {
createEpisode(patient: patient, model: model);
}
},
),
if (patient.episodeNo != 0)
AppButton(
loading:
model.state == ViewState.BusyLocal,
disabled:
model.state == ViewState.BusyLocal,
title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: ((isInpatient) ||
isFromLiveCare) &&
model.state != ViewState.BusyLocal
loading: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal,
title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal
? AppGlobal.appRedColor
: patient.patientStatusType == 43
?AppGlobal.appRedColor
? AppGlobal.appRedColor
: AppGlobal.appRedColor,
fontColor: Colors.white,
// vPadding: 8,
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 9 : 6),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 25,
fontWeight: FontWeight.normal,
@ -298,19 +277,12 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30,
),
onPressed: () async {
await locator<AnalyticsService>()
.logEvent(
await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile ",
eventAction: "Update Episode",
);
if ((isFromLiveCare &&
patient.appointmentNo != null &&
patient.appointmentNo != 0) ||
patient.patientStatusType == 43 ||
isInpatient) {
Navigator.of(context).pushNamed(
UPDATE_EPISODE,
arguments: {'patient': patient});
if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || patient.patientStatusType == 43 || isInpatient) {
Navigator.of(context).pushNamed(UPDATE_EPISODE, arguments: {'patient': patient});
}
}),
],
@ -342,14 +314,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
color: isCallFinished
? Colors.red[600]
: AppGlobal.appGreenColor,
title: isCallFinished
? TranslationBase.of(context).endCall
: TranslationBase.of(context).initiateCall,
disabled: isCallStarted ||
model.state == ViewState.BusyLocal,
color: isCallFinished ? Colors.red[600]! : AppGlobal.appGreenColor,
title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall,
disabled: isCallStarted || model.state == ViewState.BusyLocal,
onPressed: () async {
// TODO MOSA TEST
// AppPermissionsUtils
@ -367,50 +334,32 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
EndCallScreen(patient: patient),
settings:
RouteSettings(name: 'EndCallScreen'),
builder: (BuildContext context) => EndCallScreen(patient: patient),
settings: RouteSettings(name: 'EndCallScreen'),
),
);
} else {
GifLoaderDialogUtils.showMyDialog(context);
await model.startCall(
isReCall: false, vCID: patient.vcId);
await model.startCall(isReCall: false, vCID: patient.vcId!);
if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(model.error);
} else {
await model.getDoctorProfile();
patient.appointmentNo = int.parse(model
.startCallRes.appointmentNo
.toString());
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
patient.episodeNo = 0;
model.updateInCallPatient(
patient: patient,
appointmentNo: int.parse(model
.startCallRes.appointmentNo
.toString()));
model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString()));
setState(() {
isCallStarted = true;
});
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils
.requestVideoCallPermission(
context: context,
onTapGrant: () {
locator<VideoCallService>()
.openVideo(
model.startCallRes,
patient,
model.startCallRes != null
? model.startCallRes
.isRecording
: true,
callConnected,
callDisconnected);
});
AppPermissionsUtils.requestVideoCallPermission(
context: context,
onTapGrant: () {
locator<VideoCallService>()
.openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording! : true, callConnected, callDisconnected);
});
}
}
},
@ -424,29 +373,24 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
],
),
)
: null,
: SizedBox(),
),
);
}
createEpisode({PatiantInformtion patient, SOAPViewModel model}) async {
createEpisode({PatiantInformtion? patient, SOAPViewModel? model}) async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile",
eventAction: "Create Episode",
);
GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel =
PostEpisodeForInpatientRequestModel(
admissionNo: int.parse(patient.admissionNo),
patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel);
if (patient!.admissionNo != null && patient.admissionNo!.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo!), patientID: patient.patientId);
await model!.postEpisodeForInPatient(postEpisodeReqModel);
} else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: int.parse(patient.appointmentNo.toString()),
patientMRN: patient.patientMRN);
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
await model!.postEpisode(postEpisodeReqModel);
}
GifLoaderDialogUtils.hideDialog(context);
@ -454,8 +398,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
Utils.showErrorToast(model.error);
} else {
patient.episodeNo = model.episodeID;
Navigator.of(context)
.pushNamed(CREATE_EPISODE, arguments: {'patient': patient});
Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient});
}
}
}
@ -469,12 +412,7 @@ class AvatarWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)],
borderRadius: BorderRadius.all(Radius.circular(35.0)),
color: Color(0xffCCCCCC),
),

@ -8,102 +8,44 @@ import '../../../../routes.dart';
// ignore: must_be_immutable
class ProfileGridForInPatient extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final double? height;
final bool isInpatient;
final bool isDischargedPatient;
final bool isFromSearch;
String from;
String to;
String? from;
String? to;
ProfileGridForInPatient(
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient,
this.from,
this.to,
this.isDischargedPatient,
this.isFromSearch})
{Key? key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isDischargedPatient = false, this.isFromSearch = false})
: super(key: key);
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).vital,
TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).result,
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/Radiology.svg',
PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).result, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/Radiology.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD,
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).progress,
TranslationBase.of(context).note,
PROGRESS_NOTE,
'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).order,
TranslationBase.of(context).sheet,
ORDER_NOTE,
'assets/images/svgs/profile_screen/order sheets.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg',
PatientProfileCardModel(TranslationBase.of(context).progress, TranslationBase.of(context).note, PROGRESS_NOTE, 'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(TranslationBase.of(context).order, TranslationBase.of(context).sheet, ORDER_NOTE, 'assets/images/svgs/profile_screen/order sheets.svg',
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg',
PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).medical,
TranslationBase.of(context).report,
PATIENT_MEDICAL_REPORT,
'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient,
isDisable: false),
PatientProfileCardModel(TranslationBase.of(context).medical, TranslationBase.of(context).report, PATIENT_MEDICAL_REPORT, 'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient, isDisable: false),
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
@ -112,11 +54,7 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch,
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).approvals,
PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/insurance approval.svg',
PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).approvals, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).discharge,
@ -205,11 +143,11 @@ class ProfileGridForInPatient extends StatelessWidget {
//change the number as you want
children: cardsList.map((item) {
return PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
patient: patient!,
patientType: patientType!,
arrivalType: arrivalType!,
from: from!,
to: to!,
nameLine1: item.nameLine1,
nameLine2: item.nameLine2,
route: item.route,
@ -217,7 +155,7 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable,
onTap: item.onTap,
onTap: item.onTap!,
isLoading: item.isLoading,
);
}).toList(),

@ -1,137 +1,61 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
// ignore: must_be_immutable
class ProfileGridForOther extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final double? height;
final bool isInpatient;
final bool isFromLiveCare;
String from;
String to;
String? from;
String? to;
ProfileGridForOther(
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient,
this.from,
this.to,
this.isFromLiveCare})
: super(key: key);
ProfileGridForOther({Key? key, this.patient, this.patientType, this.arrivalType, this.height , this.isInpatient = false, this.from, this.to, this.isFromLiveCare = false}) : super(key: key);
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).vital,
TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).service,
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/health summary.svg',
PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg',
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG",
PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg',
PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg',
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).service,
PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/insurance approval.svg',
PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg',
PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null,
isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null,
),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null),
];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
@ -148,11 +72,11 @@ class ProfileGridForOther extends StatelessWidget {
//change the number as you want
children: cardsList.map((item) {
return PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
patient: patient!,
patientType: patientType!,
arrivalType: arrivalType!,
from: from!,
to: to!,
nameLine1: item.nameLine1,
nameLine2: item.nameLine2,
route: item.route,
@ -160,7 +84,7 @@ class ProfileGridForOther extends StatelessWidget {
isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable,
onTap: item.onTap,
onTap: item.onTap!,
isLoading: item.isLoading,
);
}).toList(),

@ -7,21 +7,21 @@ import 'package:flutter/material.dart';
import '../../../../routes.dart';
class ProfileGridForSearch extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final double? height;
final bool isInpatient;
String from;
String to;
String? from;
String? to;
ProfileGridForSearch(
{Key key,
{Key? key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient,
this.isInpatient = false,
this.from,
this.to})
: super(key: key);
@ -92,30 +92,30 @@ class ProfileGridForSearch extends StatelessWidget {
ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
isDisable: patient!.patientStatusType != 43 ? true : false),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
isDisable: patient!.patientStatusType != 43 ? true : false),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
isDisable: patient!.patientStatusType != 43 ? true : false),
];
return Padding(
@ -133,11 +133,11 @@ class ProfileGridForSearch extends StatelessWidget {
//change the number as you want
children: cardsList.map((item) {
return PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
patient: patient!,
patientType: patientType!,
arrivalType: arrivalType!,
from: from!,
to: to!,
nameLine1: item.nameLine1,
nameLine2: item.nameLine2,
route: item.route,
@ -145,7 +145,7 @@ class ProfileGridForSearch extends StatelessWidget {
isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable,
onTap: item.onTap,
onTap: item.onTap!,
isLoading: item.isLoading,
);
}).toList(),

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
@ -11,46 +12,35 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../../locator.dart';
import 'package:url_launcher/url_launcher_string.dart';
class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology;
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final FinalRadiology? finalRadiology;
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final bool isInpatient;
RadiologyDetailsPage(
{Key key,
this.finalRadiology,
this.patient,
this.patientType,
this.arrivalType,
this.isInpatient = false});
RadiologyDetailsPage({Key? key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false});
@override
Widget build(BuildContext context) {
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(
patient: patient,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: finalRadiology.invoiceNo),
onModelReady: (model) => model.getRadImageURL(patient: patient!, projectId: finalRadiology!.projectID, lineItem: finalRadiology!.invoiceLineItemNo, invoiceNo: finalRadiology!.invoiceNo),
builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileAppBar(
patient,
appointmentDate: finalRadiology.orderDate,
doctorName: finalRadiology.doctorName,
clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName,
profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(),
patient!,
appointmentDate: finalRadiology!.orderDate!,
doctorName: finalRadiology!.doctorName,
clinic: finalRadiology!.clinicDescription,
branch: finalRadiology!.projectName,
profileUrl: finalRadiology!.doctorImageURL,
invoiceNO: finalRadiology!.invoiceNo.toString(),
isAppointmentHeader: true,
),
isShowAppBar: true,
baseViewModel: model,
body: SingleChildScrollView(
body: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
@ -78,7 +68,7 @@ class RadiologyDetailsPage extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
'${finalRadiology.reportData.trim()}',
'${finalRadiology!.reportData.trim()}',
textAlign: TextAlign.start,
isCopyable: true,
fontSize: 17,
@ -99,23 +89,22 @@ class RadiologyDetailsPage extends StatelessWidget {
height: 80,
width: double.maxFinite,
child: Container(
margin:
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: AppButton(
color: Color(0xffD02127),
disabled: finalRadiology.dIAPACSURL == "",
disabled: finalRadiology!.dIAPACSURL == "",
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "RadiologyDetailsPage",
eventAction: "Open Radiology Image",
);
launch(model.radImageURL);
launchUrlString(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
),
),
)
: null,
: SizedBox(),
),
);
}

@ -12,12 +12,12 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../widgets/shared/errors/error_message.dart';
class RadiologyHomePage extends StatefulWidget {
@override
@ -25,16 +25,16 @@ class RadiologyHomePage extends StatefulWidget {
}
class _RadiologyHomePageState extends State<RadiologyHomePage> {
String patientType;
PatiantInformtion patient;
String arrivalType;
bool isInpatient;
bool isFromLiveCare;
String? patientType;
PatiantInformtion? patient;
String? arrivalType;
bool isInpatient = false;
bool isFromLiveCare = false;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -47,14 +47,14 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient,
onModelReady: (model) => model.getPatientRadOrders(patient!,
patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
backgroundColor: Colors.grey[100]!,
// appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileAppBar(
patient,
patient!,
isInpatient: isInpatient,
),
baseViewModel: model,
@ -67,27 +67,27 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 12,
),
if (model.radiologyList.isNotEmpty &&
patient.patientStatusType != 43)
patient!.patientStatusType != 43)
ServiceTitle(
title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result,
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
if (patient!.patientStatusType != null &&
patient!.patientStatusType == 43)
ServiceTitle(
title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result,
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
if ((patient!.patientStatusType != null &&
patient!.patientStatusType == 43) ||
(isFromLiveCare && patient!.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
SlideUpPageRoute(
widget: BaseAddProcedureTabPage(
patient: patient,
patient: patient!,
previousProcedureViewModel: model,
procedureType: ProcedureType.RADIOLOGY,
),
@ -118,9 +118,9 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: model.radiologyList[index]
.isLiveCareAppodynamicment
? Colors.red[900]
: !model.radiologyList[index].isInOutPatient
.isLiveCareAppodynamicment!
? Colors.red[900]!
: !model.radiologyList[index].isInOutPatient!
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
@ -142,12 +142,12 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
child: Center(
child: Text(
model.radiologyList[index]
.isLiveCareAppodynamicment
.isLiveCareAppodynamicment!
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.radiologyList[index]
.isInOutPatient
.isInOutPatient!
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
@ -173,7 +173,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate:
model.radiologyList[index].orderDate ??
model.radiologyList[index].reportDate,
model.radiologyList[index].reportDate!,
onTap: () {
Navigator.push(
context,
@ -192,7 +192,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
),
)),
if (model.radiologyList.isEmpty &&
patient.patientStatusType != 43)
patient!.patientStatusType != 43)
Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,

@ -11,7 +11,7 @@ class RadiologyReportScreen extends StatelessWidget {
final String reportData;
final String url;
RadiologyReportScreen({Key key, this.reportData, this.url});
RadiologyReportScreen({Key? key, required this.reportData, required this.url});
@override
Widget build(BuildContext context) {
@ -35,7 +35,7 @@ class RadiologyReportScreen extends StatelessWidget {
),
child: AppText(
reportData,
fontSize: 2.5 * SizeConfig.textMultiplier,
fontSize: 2.5 * SizeConfig.textMultiplier!,
),
),
SizedBox(

@ -28,13 +28,12 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
class PatientMakeInPatientReferralScreen extends StatefulWidget {
@override
_PatientMakeInPatientReferralScreenState createState() =>
_PatientMakeInPatientReferralScreenState();
_PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState();
}
class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatientReferralScreen>{
PatiantInformtion patient;
List<dynamic> referToList;
class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatientReferralScreen> {
PatiantInformtion? patient;
List<dynamic>? referToList;
dynamic _referTo;
dynamic _selectedBranch;
dynamic _selectedClinic;
@ -44,19 +43,17 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
final _remarksController = TextEditingController();
final _extController = TextEditingController();
int _activePriority = 1;
String appointmentDate;
String branchError;
String hospitalError;
String clinicError;
String doctorError;
String frequencyError;
String remarkError;
String? appointmentDate;
String? branchError;
String? hospitalError;
String? clinicError;
String? doctorError;
String? frequencyError;
String? remarkError;
stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord;
var event = RobotProvider();
@override
void initState() {
requestPermissions();
@ -73,8 +70,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
@ -118,15 +114,13 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
@override
Widget build(BuildContext context) {
dynamic priority1 = {
"ParameterCode": 1,
"Description": TranslationBase.of(context).veryUrgent.toUpperCase(),
@ -145,503 +139,427 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
_priorityList.add(priority2);
_priorityList.add(priority3);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient'];
referToList = [];
dynamic sameBranch = {
"id": 1,
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch);
referToList.add(otherBranch);
dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch};
dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch};
referToList!.add(sameBranch);
referToList!.add(otherBranch);
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getReferralFrequencyList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true,
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
),
body: SingleChildScrollView(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ServiceTitle(
title: TranslationBase.of(context).refer,
subTitle: TranslationBase.of(context).patient,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true,
appBar: PatientProfileAppBar(
patient!,
isInpatient: isInpatient,
),
body: SingleChildScrollView(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).branch,
dropDownText:
_referTo != null ? _referTo['name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: branchError,
onClick: referToList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
Padding(
padding: const EdgeInsets.all(8.0),
child: ServiceTitle(
title: TranslationBase.of(context).refer,
subTitle: TranslationBase.of(context).patient,
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).branch,
dropDownText: _referTo != null ? _referTo['name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: branchError!,
onClick: referToList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: referToList!,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model.getDoctorBranch().then((value) async {
_selectedBranch = value;
if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(context);
await model.getClinics(_selectedBranch['facilityId']).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
} else {
_selectedBranch = null;
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).hospital,
dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError!,
onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
attributeName: 'facilityName',
attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) async {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
model
.getDoctorBranch()
.then((value) async {
_selectedBranch = value;
if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinics(_selectedBranch[
'facilityId'])
.then((_) =>
GifLoaderDialogUtils
.hideDialog(context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
} else {
_selectedBranch = null;
}
GifLoaderDialogUtils.showMyDialog(context);
await model.getClinics(_selectedBranch['facilityId']).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError!,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
usingSearch: true,
hintSearchText: TranslationBase.of(context).clinicSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) async {
_selectedDoctor = null;
_selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(context);
await model.getClinicDoctors(patient!, _selectedClinic['ClinicID'], _selectedBranch['facilityId']).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: doctorError!,
onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'Name',
attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText: TranslationBase.of(context).doctorSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).hospital,
dropDownText: _selectedBranch != null
? _selectedBranch['facilityName']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError,
onClick: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
attributeName: 'facilityName',
attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) async {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinics(
_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
dropDownText: _selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError,
onClick: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
usingSearch: true,
hintSearchText:
TranslationBase.of(context)
.clinicSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) async {
_selectedDoctor = null;
_selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinicDoctors(
patient,
_selectedClinic['ClinicID'],
_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
dropDownText: _selectedDoctor != null
? _selectedDoctor['Name']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: doctorError,
onClick: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'Name',
attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText:
TranslationBase.of(context)
.doctorSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {
if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast(
"You need to select a clinic first");
} else if (model.doctorsList == null ||
model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {
if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast("You need to select a clinic first");
} else if (model.doctorsList == null || model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast("There is no doctors for this clinic");
}
},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).priority,
dropDownText: _selectedPriority != null ? _selectedPriority['Description'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError!,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: _priorityList,
attributeName: 'Description',
attributeValueId: 'Description',
usingSearch: false,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedPriority = selectedValue;
_activePriority = selectedValue["ParameterCode"];
});
},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText:
TranslationBase.of(context).priority,
dropDownText: _selectedPriority != null
? _selectedPriority['Description']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: _priorityList,
attributeName: 'Description',
attributeValueId: 'Description',
usingSearch: false,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedPriority = selectedValue;
_activePriority = selectedValue["ParameterCode"];
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
),
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.all(4.0),
child: AppText(
"${TranslationBase.of(context).replayBefore}: ${getPriority()}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.9,
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
),
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText:
TranslationBase.of(context).referralFrequency,
dropDownText: _selectedFrequency != null
? _selectedFrequency['Description']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: model.referralFrequencyList,
attributeName: 'Description',
attributeValueId: 'ParameterCode',
usingSearch: true,
hintSearchText: TranslationBase.of(context)
.selectReferralFrequency,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedFrequency = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).ext,
controller: _extController,
inputType: TextInputType.text,
),
SizedBox(
height: 10,
),
Stack(
children: [
AppTextFieldCustom(
validationError: remarkError,
hintText: "Remarks",
controller: _remarksController,
inputType: TextInputType.multiline,
minLines: 4,
maxLines: 6,
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.all(4.0),
child: AppText(
"${TranslationBase.of(context).replayBefore}: ${getPriority()}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier! * 1.9,
),
Positioned(
top: 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
initSpeechState()
.then((value) => {onVoiceText()});
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).referralFrequency,
dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError!,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: model.referralFrequencyList,
attributeName: 'Description',
attributeValueId: 'ParameterCode',
usingSearch: true,
hintSearchText: TranslationBase.of(context).selectReferralFrequency,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedFrequency = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).ext,
controller: _extController,
inputType: TextInputType.text,
),
SizedBox(
height: 10,
),
Stack(
children: [
AppTextFieldCustom(
validationError: remarkError!,
hintText: "Remarks",
controller: _remarksController,
inputType: TextInputType.multiline,
minLines: 4,
maxLines: 6,
),
),
],
),
SizedBox(
height: 100,
)
],
Positioned(
top: 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
initSpeechState().then((value) => {onVoiceText()});
},
),
),
],
),
SizedBox(
height: 100,
)
],
),
)
],
),
Column(
children: [
_remarksController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: TranslationBase.of(context).clearText,
onPressed: () {
setState(() {
_remarksController.text = '';
});
},
)),
SizedBox(
height: 10,
),
)
],
),
Column(
children: [
_remarksController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: TranslationBase.of(context).clearText,
onPressed: () {
setState(() {
_remarksController.text = '';
});
},
)),
SizedBox(
height: 10,
),
],
),
],
],
),
],
),
),
),
),
bottomSheet:
model.state != ViewState.Idle
bottomSheet: model.state != ViewState.Idle
? Container(
height: 0,
)
:CustomBottomSheetContainer(
label: "${TranslationBase.of(context).refer}",
onTap: () async {
setState(() {
if (_referTo == null) {
branchError =
TranslationBase.of(context).fieldRequired;
} else {
branchError = null;
}
if (_selectedBranch == null) {
hospitalError =
TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if (_selectedFrequency == null) {
frequencyError =
TranslationBase.of(context).fieldRequired;
} else {
frequencyError = null;
}
if (_selectedPriority == null) {
remarkError =
TranslationBase.of(context).fieldRequired;
} else {
remarkError = null;
}
});
if (_selectedFrequency == null ||
_selectedPriority == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null ||
_extController.text == null) return;
{
GifLoaderDialogUtils.showMyDialog(context);
await model.makeInPatientReferral(
patient: patient,
projectID: _selectedBranch['facilityId'],
clinicID: _selectedClinic['ClinicID'],
doctorID: _selectedDoctor['DoctorID'],
frequencyCode:
_selectedFrequency['ParameterCode'],
ext: _extController.text,
remarks: _remarksController.text,
priority: _activePriority,
referralDate: appointmentDate,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
DrAppToastMsg.showErrorToast(model.error);
else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsg);
Navigator.pop(context);
}
}
},
)
),
height: 0,
)
: CustomBottomSheetContainer(
label: "${TranslationBase.of(context).refer}",
onTap: () async {
setState(() {
if (_referTo == null) {
branchError = TranslationBase.of(context).fieldRequired;
} else {
branchError = null;
}
if (_selectedBranch == null) {
hospitalError = TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if (_selectedFrequency == null) {
frequencyError = TranslationBase.of(context).fieldRequired;
} else {
frequencyError = null;
}
if (_selectedPriority == null) {
remarkError = TranslationBase.of(context).fieldRequired;
} else {
remarkError = null;
}
});
if (_selectedFrequency == null ||
_selectedPriority == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null ||
_extController.text == null) return;
{
GifLoaderDialogUtils.showMyDialog(context);
await model.makeInPatientReferral(
patient: patient,
projectID: _selectedBranch['facilityId'],
clinicID: _selectedClinic['ClinicID'],
doctorID: _selectedDoctor['DoctorID'],
frequencyCode: _selectedFrequency['ParameterCode'],
ext: _extController.text,
remarks: _remarksController.text,
priority: _activePriority,
referralDate: appointmentDate,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
DrAppToastMsg.showErrorToast(model.error);
else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
}
}
},
)),
);
}
@ -666,8 +584,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
return time;
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,

@ -21,24 +21,23 @@ import 'package:flutter/services.dart';
class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: ReferPatientScreen
@override
_PatientMakeReferralScreenState createState() =>
_PatientMakeReferralScreenState();
_PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState();
}
class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
PatiantInformtion patient;
List<dynamic> referToList;
PatiantInformtion? patient;
List<dynamic>? referToList;
dynamic _referTo;
dynamic _selectedBranch;
dynamic _selectedClinic;
dynamic _selectedDoctor;
DateTime appointmentDate;
DateTime? appointmentDate;
final _remarksController = TextEditingController();
String branchError = null;
String hospitalError = null;
String clinicError = null;
String doctorError = null;
String branchError = '';
String hospitalError = '';
String clinicError = '';
String doctorError = '';
@override
void initState() {
@ -49,32 +48,26 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
@override
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'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
referToList = [];
dynamic sameBranch = {
"id": 1,
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch);
referToList.add(otherBranch);
dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch};
dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch};
referToList!.add(sameBranch);
referToList!.add(otherBranch);
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getPatientReferral(patient),
onModelReady: (model) => model.getPatientReferral(patient!),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true,
appBar: PatientProfileAppBar(patient),
appBar: PatientProfileAppBar(patient!),
body: SingleChildScrollView(
child: Container(
child: Column(
@ -93,19 +86,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0
? referralForm(model, screenSize)
: PatientReferralItemWidget(
referralStatus: model
.patientReferral[
model.patientReferral.length - 1]
.referralStatus,
patientName: model
.patientReferral[
model.patientReferral.length - 1]
.patientName,
patientGender: model
.patientReferral[
model.patientReferral.length - 1]
.patientDetails
.gender,
referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus!,
patientName: model.patientReferral[model.patientReferral.length - 1].patientName!,
patientGender: model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender!,
///TODO Elham* check this
// referredDate: model
@ -118,35 +101,15 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
// model.patientReferral.length - 1]
// .referredOn
// .split(" ")[1],
patientID:
"${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model
.patientReferral[
model.patientReferral.length - 1]
.isReferralDoctorSameBranch,
patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch,
isReferral: true,
remark: model
.patientReferral[
model.patientReferral.length - 1]
.remarksFromSource,
nationality: model
.patientReferral[
model.patientReferral.length - 1]
.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,
remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource!,
nationality: model.patientReferral[model.patientReferral.length - 1].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: "",
),
SizedBox(
height: 10,
@ -162,46 +125,32 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
eventAction: "Submit Refer",
);
if (_referTo == null) {
branchError =
TranslationBase.of(context).fieldRequired;
branchError = TranslationBase.of(context).fieldRequired;
} else {
branchError = null;
branchError = "";
}
if (_selectedBranch == null) {
hospitalError =
TranslationBase.of(context).fieldRequired;
hospitalError = TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
hospitalError = "";
}
if (_selectedClinic == null) {
clinicError =
TranslationBase.of(context).fieldRequired;
clinicError = TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
clinicError = "";
}
if (_selectedDoctor == null) {
doctorError =
TranslationBase.of(context).fieldRequired;
doctorError = TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
doctorError = "";
}
if (appointmentDate == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null) return;
if (appointmentDate == null || _selectedBranch == null || _selectedClinic == null || _selectedDoctor == null || _remarksController.text == null) return;
model
.makeReferral(
patient,
appointmentDate.toIso8601String(),
_selectedBranch['facilityId'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text)
patient!, appointmentDate!.toIso8601String(), _selectedBranch['facilityId'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text)
.then((_) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
});
}),
@ -229,7 +178,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
onClick: referToList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: referToList,
list: referToList!,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
@ -243,10 +192,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedBranch = value;
if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
await model.getClinics(_selectedBranch['facilityId']).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
@ -265,7 +211,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
},
);
}
: null,
: () {},
),
SizedBox(
height: 10,
@ -273,16 +219,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).hospital,
dropDownText: _selectedBranch != null
? _selectedBranch['facilityName']
: null,
dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError,
onClick: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
@ -294,10 +235,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedClinic = null;
_selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
await model.getClinics(_selectedBranch['facilityId']).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
@ -311,7 +249,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
},
);
}
: null,
: () {},
),
SizedBox(
height: 10,
@ -319,15 +257,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
dropDownText: _selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError,
onClick: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
@ -340,13 +274,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedDoctor = null;
_selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinicDoctors(
patient,
_selectedClinic['ClinicID'],
_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
await model.getClinicDoctors(patient!, _selectedClinic['ClinicID'], _selectedBranch['facilityId']).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
@ -360,7 +288,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
},
);
}
: null,
: () {},
),
SizedBox(
height: 10,
@ -368,14 +296,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
dropDownText:
_selectedDoctor != null ? _selectedDoctor['Name'] : null,
dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: doctorError,
onClick: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
@ -400,12 +325,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
}
: () {
if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast(
"You need to select a clinic first");
} else if (model.doctorsList == null ||
model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
DrAppToastMsg.showErrorToast("You need to select a clinic first");
} else if (model.doctorsList == null || model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast("There is no doctors for this clinic");
}
},
),
@ -415,16 +337,16 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).date,
dropDownText: appointmentDate != null
? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null,
dropDownText: appointmentDate != null ? "${AppDateUtils.convertDateToFormat(appointmentDate!, "yyyy-MM-dd")}" : "",
enabled: false,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
icon: Icon(
Icons.calendar_today,
color: Colors.black,
),
onPressed: () {},
),
onClick: () {
_selectDate(context, model);
},
@ -447,7 +369,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectDate(BuildContext context, PatientReferralViewModel model) async {
// 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
final DateTime picked = await showDatePicker(
final DateTime? picked = await showDatePicker(
context: context,
initialDate: appointmentDate,
firstDate: DateTime.now().add(Duration(hours: 2)),

@ -8,11 +8,11 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../../../../../widgets/shared/errors/error_message.dart';
class ReferredPatientScreen extends StatefulWidget {
@override
@ -81,31 +81,31 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
child: PatientReferralItemWidget(
referralStatus: model
.getReferredPatientItem(index)
.referralStatusDesc,
.referralStatusDesc!,
referralStatusCode: model
.getReferredPatientItem(index)
.referralStatus,
.referralStatus!,
patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
patientGender: model
.getReferredPatientItem(index)
.gender,
.gender!,
referredDate: model.state == ViewState.BusyLocal ?"":
AppDateUtils.getDayMonthYearDateFormatted(
patientType == PatientType.IN_PATIENT?
AppDateUtils.getDateTimeFromServerFormat(
model.getReferredPatientItem(index).referralDate,
model.getReferredPatientItem(index).referralDate!,
):AppDateUtils.getDateTimeFromString(
model.getReferredPatientItem(index).referralDate,
model.getReferredPatientItem(index).referralDate!,
),
isMonthShort: true
),
referredTime:model.state == ViewState.BusyLocal ?"":AppDateUtils.getHour(
patientType == PatientType.IN_PATIENT?
AppDateUtils.getDateTimeFromServerFormat(
model.getReferredPatientItem(index).referralDate,
model.getReferredPatientItem(index).referralDate!,
):AppDateUtils.getDateTimeFromString(
model.getReferredPatientItem(index).referralDate,
model.getReferredPatientItem(index).referralDate!,
),
// isMonthShort: true
),
@ -117,21 +117,21 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
isReferral: false,
remark: model
.getReferredPatientItem(index)
.referringDoctorRemarks,
.referringDoctorRemarks!,
nationality: model
.getReferredPatientItem(index)
.nationalityName,
.nationalityName!,
nationalityFlag: model
.getReferredPatientItem(index)
.nationalityFlagURL,
.nationalityFlagURL!,
doctorAvatar: model
.getReferredPatientItem(index)
.doctorImageURL,
.doctorImageURL!,
referralDoctorName: "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model
.getReferredPatientItem(index)
.referralClinicDescription,
.referralClinicDescription!,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
@ -176,10 +176,10 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
title: AppText(TranslationBase.of(context).inPatient),
value: PatientType.IN_PATIENT,
groupValue: patientType,
onChanged: (PatientType value) {
onChanged: (PatientType? value) {
setState(() {
patientType = value;
radioOnChange(value);
patientType = value!;
radioOnChange(value!);
});
},
),
@ -189,10 +189,10 @@ class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
title: AppText(TranslationBase.of(context).outpatient),
value: PatientType.OUT_PATIENT,
groupValue: patientType,
onChanged: (PatientType value) {
onChanged: (PatientType? value) {
setState(() {
patientType = value;
radioOnChange(value);
patientType = value!;
radioOnChange(value!);
});
},
),

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dar
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
@ -15,7 +16,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import '../../../../../routes.dart';
class ReferredPatientDetailScreen extends StatelessWidget {
final MyReferredPatientModel referredPatient;
@ -54,7 +54,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
child: AppText(
(Utils.capitalize(
"${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5,
fontSize: SizeConfig.textMultiplier!! * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -133,8 +133,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
AppText(
TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.red[700],
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Colors.red[700]!,
)
],
),
@ -150,23 +150,23 @@ class ReferredPatientDetailScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween,
children: [
AppText(
referredPatient.referralStatusDesc,
referredPatient.referralStatusDesc!,
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? AppGlobal.inProgressColor
: referredPatient.referralStatus == 46
? AppGlobal.appGreenColor
: Colors.red[700],
: Colors.red[700]!,
),
AppText(
AppDateUtils.convertDateFromServerFormat(
referredPatient.referralDate,
referredPatient.referralDate!,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Color(0XFF28353E),
)
],
@ -185,7 +185,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
@ -199,11 +199,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
AppText(
AppDateUtils.convertDateFromServerFormat(
referredPatient.referralDate,
referredPatient.referralDate!,
"hh:mm a"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
)
],
@ -225,13 +225,13 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.referralClinicDescription,
.referralClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 13,
@ -256,13 +256,13 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.frequencyDescription,
.frequencyDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
@ -279,12 +279,12 @@ class ReferredPatientDetailScreen extends StatelessWidget {
AppText(
referredPatient.nationalityName !=
null
? referredPatient.nationalityName
? referredPatient.nationalityName!
: "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize:
1.4 * SizeConfig.textMultiplier,
1.4 * SizeConfig.textMultiplier!,
),
referredPatient.nationalityFlagURL !=
null
@ -293,13 +293,13 @@ class ReferredPatientDetailScreen extends StatelessWidget {
BorderRadius.circular(20.0),
child: Image.network(
referredPatient
.nationalityFlagURL,
.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext
context,
Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -320,11 +320,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
referredPatient.priorityDescription,
referredPatient.priorityDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
@ -345,7 +345,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
@ -355,13 +355,13 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? AppDateUtils
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime,
.mAXResponseTime!,
"dd MMM,yyyy")
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -393,13 +393,13 @@ class ReferredPatientDetailScreen extends StatelessWidget {
borderRadius:
BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL,
referredPatient.doctorImageURL!,
height: 25,
width: 30,
errorBuilder:
(BuildContext context,
Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -429,16 +429,16 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.5 *
SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Colors.black,
),
AppText(
referredPatient
.referralClinicDescription,
.referralClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 *
SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -478,14 +478,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
fontSize: 2.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referringDoctorRemarks,
referredPatient.referringDoctorRemarks!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
SizedBox(
@ -502,12 +502,12 @@ class ReferredPatientDetailScreen extends StatelessWidget {
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL,
referredPatient.doctorImageURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -528,22 +528,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referredDoctorRemarks ==
null
? ''
: referredPatient.referredDoctorRemarks
: referredPatient.referredDoctorRemarks!
.isNotEmpty
? referredPatient
.referredDoctorRemarks
.referredDoctorRemarks!
: TranslationBase.of(context)
.notRepliedYet,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -561,14 +561,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: TranslationBase.of(context).acknowledged,
color: Colors.red[700],
color: Colors.red[700]!,
fontColor: Colors.white,
fontWeight: FontWeight.w700,
hPadding: 8,
vPadding: 12,
disabled: referredPatient.referredDoctorRemarks == null
? true
: referredPatient.referredDoctorRemarks.isNotEmpty
: referredPatient.referredDoctorRemarks!.isNotEmpty
? false
: true,
onPressed: () async {

@ -22,16 +22,16 @@ import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel;
final AddReferredRemarksRequestModel myReferralInPatientRequestModel;
final PatientReferralViewModel? patientReferralViewModel;
final MyReferralPatientModel? myReferralInPatientModel;
final AddReferredRemarksRequestModel? myReferralInPatientRequestModel;
final bool isEdited;
const AddReplayOnReferralPatient(
{Key key,
{Key? key,
this.patientReferralViewModel,
this.myReferralInPatientModel,
this.isEdited,
this.isEdited = false,
this.myReferralInPatientRequestModel})
: super(key: key);
@ -55,7 +55,7 @@ class _AddReplayOnReferralPatientState
requestPermissions();
super.initState();
replayOnReferralController.text =
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
widget.myReferralInPatientModel!.referredDoctorRemarks ?? "";
}
@override
@ -91,7 +91,7 @@ class _AddReplayOnReferralPatientState
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
: "",
),
Positioned(
top: 0,
@ -150,14 +150,14 @@ class _AddReplayOnReferralPatientState
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel
.replayReferred(
!.replayReferred(
replayOnReferralController.text.trim(),
widget.myReferralInPatientModel,
widget.myReferralInPatientModel!,
reject);
if (widget.patientReferralViewModel.state ==
if (widget.patientReferralViewModel!.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
widget.patientReferralViewModel.error);
widget.patientReferralViewModel!.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
@ -175,7 +175,7 @@ class _AddReplayOnReferralPatientState
},
title: TranslationBase.of(context).reject,
fontColor: Colors.white,
color: Colors.red[600],
color: Colors.red[600]!,
),
),
SizedBox(
@ -190,14 +190,14 @@ class _AddReplayOnReferralPatientState
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel
.replayReferred(
!.replayReferred(
replayOnReferralController.text.trim(),
widget.myReferralInPatientModel,
widget.myReferralInPatientModel!,
replay);
if (widget.patientReferralViewModel.state ==
if (widget.patientReferralViewModel!.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
widget.patientReferralViewModel.error);
widget.patientReferralViewModel!.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(

@ -17,10 +17,9 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable
class MyReferralDetailScreen extends StatelessWidget {
final MyReferralPatientModel referralPatient;
final MyReferralPatientModel? referralPatient;
const MyReferralDetailScreen({Key key, this.referralPatient})
: super(key: key);
const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -55,15 +54,13 @@ class MyReferralDetailScreen extends StatelessWidget {
),
Expanded(
child: AppText(
(Utils.capitalize(referralPatient.firstName +
" " +
referralPatient.lastName)),
fontSize: SizeConfig.textMultiplier * 2.5,
(Utils.capitalize(referralPatient!.firstName! + " " + referralPatient!.lastName!)),
fontSize: SizeConfig.textMultiplier! * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
referralPatient.gender == 1
referralPatient!.gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
@ -83,9 +80,7 @@ class MyReferralDetailScreen extends StatelessWidget {
width: 60,
height: 60,
child: Image.asset(
referralPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
referralPatient!.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -97,140 +92,102 @@ class MyReferralDetailScreen extends StatelessWidget {
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
referralPatient.referralStatus != null
? model.getReferralStatusNameByCode(
referralPatient.referralStatus,
context)
: "",
referralPatient!.referralStatus != null ? model.getReferralStatusNameByCode(referralPatient!.referralStatus!, context) : "",
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w700,
color: referralPatient.referralStatus == 1
color: referralPatient!.referralStatus == 1
? AppGlobal.inProgressColor
: referralPatient.referralStatus ==
46 ||
referralPatient
.referralStatus ==
2
: referralPatient!.referralStatus == 46 || referralPatient!.referralStatus == 2
? AppGlobal.appGreenColor
: Colors.red[700],
: Colors.red[700]!,
),
AppText(
AppDateUtils.getDayMonthYearDateFormatted(
referralPatient.referralDate),
AppDateUtils.getDayMonthYearDateFormatted(referralPatient!.referralDate!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 2.0 * SizeConfig.textMultiplier!,
color: Color(0XFF28353E),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.fileNumber,
TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
"${referralPatient.patientID}",
"${referralPatient!.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
),
AppText(
AppDateUtils.getTimeHHMMA(
referralPatient.referralDate),
AppDateUtils.getTimeHHMMA(referralPatient!.referralDate!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.referredFrom,
TranslationBase.of(context).referredFrom,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
referralPatient
.targetProjectId ==
referralPatient
.sourceProjectId
? TranslationBase.of(
context)
.sameBranch
: TranslationBase.of(
context)
.otherBranch,
referralPatient!.targetProjectId == referralPatient!.sourceProjectId ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.remarks +
" : ",
TranslationBase.of(context).remarks + " : ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referralPatient
.referringDoctorRemarks ??
'',
referralPatient!.referringDoctorRemarks ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -242,29 +199,19 @@ class MyReferralDetailScreen extends StatelessWidget {
Row(
children: [
AppText(
referralPatient.nationalityName !=
null
? referralPatient.nationalityName
: "",
referralPatient!.nationalityName != null ? referralPatient!.nationalityName! : "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize:
1.4 * SizeConfig.textMultiplier,
fontSize: 1.4 * SizeConfig.textMultiplier!,
),
referralPatient.nationalityFlagURL !=
null
referralPatient!.nationalityFlagURL != null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referralPatient
.nationalityFlagURL,
referralPatient!.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext
context,
Object exception,
StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -277,8 +224,7 @@ class MyReferralDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 0),
margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png',
height: 50,
@ -286,20 +232,14 @@ class MyReferralDetailScreen extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.only(
left: 0,
top: 25,
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: Container(
width: 40,
height: 40,
child: CircleAvatar(
radius: 25.0,
backgroundImage: NetworkImage(
referralPatient.doctorImageURL),
backgroundImage: NetworkImage(referralPatient!.doctorImageURL!),
backgroundColor: Colors.transparent,
),
),
@ -307,19 +247,14 @@ class MyReferralDetailScreen extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10,
top: 25,
right: 10,
bottom: 0),
margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0),
child: Column(
children: [
AppText(
referralPatient.doctorName,
referralPatient!.doctorName!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -350,12 +285,11 @@ class MyReferralDetailScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox(
child: ProfileMedicalInfoWidgetSearch(
patient: model
.getPatientFromReferralO(referralPatient),
patient: model.getPatientFromReferralO(referralPatient!),
patientType: "7",
isInpatient: false,
from: null,
to: null,
from: "",
to: "",
),
),
),
@ -364,7 +298,7 @@ class MyReferralDetailScreen extends StatelessWidget {
),
),
),
if (referralPatient.referralStatus == 1)
if (referralPatient!.referralStatus == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
@ -378,13 +312,11 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12,
disabled: model.state == ViewState.Busy,
onPressed: () async {
await model.responseReferral(referralPatient, true);
await model.responseReferral(referralPatient!, true);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgAccept);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept);
model.getMyReferralOutPatientService();
Navigator.pop(context);
Navigator.pop(context);
@ -404,14 +336,11 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12,
disabled: model.state == ViewState.Busy,
onPressed: () async {
await model.responseReferral(
referralPatient, false);
await model.responseReferral(referralPatient!, false);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgReject);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject);
model.getMyReferralOutPatientService();
Navigator.pop(context);
Navigator.pop(context);

@ -8,16 +8,15 @@ import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../../../../../widgets/shared/errors/error_message.dart';
class MyReferralInPatientScreen extends StatefulWidget {
@override
_MyReferralInPatientScreenState createState() =>
_MyReferralInPatientScreenState();
_MyReferralInPatientScreenState createState() => _MyReferralInPatientScreenState();
}
class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
@ -45,8 +44,7 @@ class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
if (patientType == PatientType.IN_PATIENT) {
await model.getMyReferralPatientService(localBusy: true);
} else {
await model.getMyReferralOutPatientService(
localBusy: true);
await model.getMyReferralOutPatientService(localBusy: true);
}
GifLoaderDialogUtils.hideDialog(context);
},
@ -73,78 +71,41 @@ class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
itemBuilder: (context, index) {
return InkWell(
onTap: () {
if (patientType ==
PatientType.OUT_PATIENT) {
if (patientType == PatientType.OUT_PATIENT) {
Navigator.push(
context,
FadePage(
page: MyReferralDetailScreen(
referralPatient:
model.myReferralPatients[
index]),
page: MyReferralDetailScreen(referralPatient: model.myReferralPatients[index]),
),
);
} else {
Navigator.push(
context,
FadePage(
page: ReferralPatientDetailScreen(
model.myReferralPatients[
index],
model),
page: ReferralPatientDetailScreen(model.myReferralPatients[index], model),
),
);
}
},
child: PatientReferralItemWidget(
referralStatus:
model.getReferralStatusNameByCode(
model.myReferralPatients[index]
.referralStatus,
context),
referralStatusCode: model
.myReferralPatients[index]
.referralStatus,
patientName: model
.myReferralPatients[index]
.patientName,
patientGender: model
.myReferralPatients[index].gender,
referredDate: AppDateUtils
.getDayMonthYearDateFormatted(model
.myReferralPatients[index]
.referralDate),
referredTime: AppDateUtils.getTimeHHMMA(
model.myReferralPatients[index]
.referralDate),
patientID:
"${model.myReferralPatients[index].patientID}",
referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus!, context),
referralStatusCode: model.myReferralPatients[index].referralStatus!,
patientName: model.myReferralPatients[index].patientName,
patientGender: model.myReferralPatients[index].gender!,
referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate!),
referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate!),
patientID: "${model.myReferralPatients[index].patientID}",
isSameBranch: false,
isReferral: true,
isReferralClinic: true,
referralClinic:
"${model.myReferralPatients[index].referringClinicDescription}",
remark: model.myReferralPatients[index]
.referringDoctorRemarks,
nationality: model
.myReferralPatients[index]
.nationalityName,
nationalityFlag: model
.myReferralPatients[index]
.nationalityFlagURL,
doctorAvatar: model
.myReferralPatients[index]
.doctorImageURL,
referralDoctorName: model
.myReferralPatients[index]
.referringDoctorName,
clinicDescription: model
.myReferralPatients[index]
.referringClinicDescription,
infoIcon: Icon(
FontAwesomeIcons.arrowRight,
size: 25,
color: Colors.black),
referralClinic: "${model.myReferralPatients[index].referringClinicDescription}",
remark: model.myReferralPatients[index].referringDoctorRemarks!,
nationality: model.myReferralPatients[index].nationalityName!,
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL!,
doctorAvatar: model.myReferralPatients[index].doctorImageURL!,
referralDoctorName: model.myReferralPatients[index].referringDoctorName!,
clinicDescription: model.myReferralPatients[index].referringClinicDescription!,
infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black),
),
);
})

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/refer_details/referred-patient-screen.dart';
import 'package:doctor_app_flutter/utils/tab_utils.dart';
@ -8,7 +9,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../ReferralDischargedPatientPage.dart';
import 'my-referral-inpatient-screen.dart';
class PatientReferralScreen extends StatefulWidget {
@ -18,26 +18,26 @@ class PatientReferralScreen extends StatefulWidget {
class _PatientReferralScreen extends State<PatientReferralScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
TabController? _tabController;
int index = 0;
@override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection);
_tabController!.addListener(_handleTabSelection);
}
_handleTabSelection() {
setState(() {
index = _tabController.index;
index = _tabController!.index;
});
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
_tabController!.dispose();
}
@override

@ -23,8 +23,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
final MyReferralPatientModel referredPatient;
final PatientReferralViewModel patientReferralViewModel;
ReferralPatientDetailScreen(
this.referredPatient, this.patientReferralViewModel);
ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel);
@override
Widget build(BuildContext context) {
@ -55,9 +54,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
Expanded(
child: AppText(
(Utils.capitalize(
"${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5,
(Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier! * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -73,18 +71,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
InkWell(
onTap: () {
PatiantInformtion patient = model
.getPatientFromReferralO(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
PatiantInformtion patient = model.getPatientFromReferralO(referredPatient);
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Icon(
@ -101,18 +95,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
children: [
InkWell(
onTap: () {
PatiantInformtion patient = model
.getPatientFromReferralO(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
PatiantInformtion patient = model.getPatientFromReferralO(referredPatient);
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Padding(
@ -121,9 +111,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
width: 60,
height: 60,
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -135,8 +123,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
AppText(
TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.red[700],
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Colors.red[700]!,
)
],
),
@ -147,103 +135,87 @@ class ReferralPatientDetailScreen extends StatelessWidget {
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}",
"${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}",
fontFamily: 'Poppins',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? AppGlobal.inProgressColor
: referredPatient.referralStatus ==
46 ||
referredPatient
.referralStatus ==
2
: referredPatient.referralStatus == 46 || referredPatient.referralStatus == 2
? AppGlobal.appGreenColor
: Colors.red[700],
: Colors.red[700]!,
),
AppText(
AppDateUtils.getDayMonthYearDateFormatted(
referredPatient.referralDate,
referredPatient.referralDate!,
),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF28353E),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.fileNumber,
TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
AppText(
"${referredPatient.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.6 * SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
),
AppText(
AppDateUtils.getTimeHHMMA(
referredPatient.referralDate,
referredPatient.referralDate!,
),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.5 *
SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.referringClinicDescription,
referredPatient.referringClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.6 *
SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -251,31 +223,22 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
if (referredPatient.frequency != null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.frequency +
": ",
TranslationBase.of(context).frequency + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.5 *
SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.frequencyDescription ??
'',
referredPatient.frequencyDescription ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -287,29 +250,19 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Row(
children: [
AppText(
referredPatient.nationalityName !=
null
? referredPatient.nationalityName
: "",
referredPatient.nationalityName != null ? referredPatient.nationalityName! : "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize:
1.4 * SizeConfig.textMultiplier,
fontSize: 1.4 * SizeConfig.textMultiplier!,
),
referredPatient.nationalityFlagURL !=
null
referredPatient.nationalityFlagURL != null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient
.nationalityFlagURL,
referredPatient.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext
context,
Object exception,
StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -321,26 +274,21 @@ class ReferralPatientDetailScreen extends StatelessWidget {
if (referredPatient.priorityDescription != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).priority +
": ",
TranslationBase.of(context).priority + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.priorityDescription ??
'',
referredPatient.priorityDescription ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.6 * SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -349,33 +297,21 @@ class ReferralPatientDetailScreen extends StatelessWidget {
if (referredPatient.mAXResponseTime != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.maxResponseTime +
": ",
TranslationBase.of(context).maxResponseTime + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.mAXResponseTime !=
null
? AppDateUtils
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime,
"dd MMM,yyyy")
: '',
referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime!, "dd MMM,yyyy") : '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.6 * SizeConfig.textMultiplier,
fontSize: 1.6 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
),
@ -385,8 +321,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 0),
margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png',
height: 50,
@ -394,34 +329,22 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.only(
left: 0,
top: 25,
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL !=
null
margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL != null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL,
referredPatient.doctorImageURL!,
height: 25,
width: 30,
errorBuilder:
(BuildContext context,
Object exception,
StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('');
},
))
: Container(
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -429,30 +352,22 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10,
top: 30,
right: 10,
bottom: 0),
margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.5 *
SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
color: Colors.black,
),
AppText(
referredPatient
.referringClinicDescription,
referredPatient.referringClinicDescription!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 *
SizeConfig.textMultiplier,
fontSize: 1.3 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -476,10 +391,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
children: [
Container(
width: double.infinity,
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
@ -496,14 +409,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
fontSize: 2.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referringDoctorRemarks ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
SizedBox(
@ -512,14 +425,11 @@ class ReferralPatientDetailScreen extends StatelessWidget {
],
),
),
if (referredPatient.referredDoctorRemarks != null &&
referredPatient.referredDoctorRemarks.isNotEmpty)
if (referredPatient.referredDoctorRemarks != null && referredPatient.referredDoctorRemarks!.isNotEmpty)
Container(
width: double.infinity,
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 0),
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 16),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
@ -536,14 +446,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
fontSize: 2.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referredDoctorRemarks ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
SizedBox(
@ -561,7 +471,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: TranslationBase.of(context).replay,
color: Colors.red[700],
color: Colors.red[700]!,
fontColor: Colors.white,
fontWeight: FontWeight.w700,
hPadding: 8,
@ -577,10 +487,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient,
isEdited:
referredPatient.referredDoctorRemarks != null &&
referredPatient
.referredDoctorRemarks.isNotEmpty,
isEdited: referredPatient.referredDoctorRemarks != null && referredPatient.referredDoctorRemarks!.isNotEmpty,
),
),
);

@ -26,20 +26,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment;
final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)
addSelectedAssessment;
final PatiantInformtion patientInfo;
final MySelectedAssessment? mySelectedAssessment;
final List<MySelectedAssessment>? mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)? addSelectedAssessment;
final PatiantInformtion? patientInfo;
final bool isUpdate;
AddAssessmentDetails(
{Key key,
this.mySelectedAssessment,
this.addSelectedAssessment,
this.patientInfo,
this.isUpdate = false,
this.mySelectedAssessmentList});
AddAssessmentDetails({Key? key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList});
@override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -52,56 +45,36 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController typeController = TextEditingController();
TextEditingController icdNameController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>> key = GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text =
widget.mySelectedAssessment.appointmentId.toString();
remarkController.text = widget.mySelectedAssessment!.remark ?? "";
appointmentIdController.text = widget.mySelectedAssessment!.appointmentId.toString();
if (widget.isUpdate) {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr
: widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisType.nameAr
: widget.mySelectedAssessment.selectedDiagnosisType.nameEn;
if (widget.mySelectedAssessment.selectedICD != null)
icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!;
if (widget.mySelectedAssessment!.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment!.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment!.selectedDiagnosisType!.nameEn!;
if (widget.mySelectedAssessment!.selectedICD != null) icdNameController.text = widget.mySelectedAssessment!.selectedICD!.code;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon, String validationError}) {
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon, String? validationError}) {
return new InputDecoration(
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
@ -123,8 +96,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
appBar: BottomSheetTitle(title: TranslationBase.of(context).addAssessmentDetails),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Center(
@ -133,263 +105,196 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
FractionallySizedBox(
widthFactor: 0.9,
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
// height: 55.0,
height: Utils.getTextFieldHeight(),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
// height: 55.0,
height: Utils.getTextFieldHeight(),
hintText:
TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
),
),
SizedBox(
height: 10,
),
Container(
child: InkWell(
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment
.selectedICD = null;
icdNameController.text = null;
});
}
: null,
child: widget
.mySelectedAssessment.selectedICD ==
null
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedICD ==
null,
child: AutoCompleteTextField<
MasterKeyModel>(
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
TranslationBase.of(context)
.nameOrICD,
null,
true,
suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment
.selectedICD = item;
icdNameController.text =
'${item.code.trim()}/${item.description}';
}),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) =>
new Padding(
child: AppText(
suggestion.description +
" / " +
suggestion.code
.toString()),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.code
.toLowerCase()
.startsWith(
input.toLowerCase()),
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment
.selectedICD = null;
icdNameController.text = null;
});
}
: null,
hintText: TranslationBase.of(context)
.nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
)),
),
if (widget.mySelectedAssessment.selectedICD != null)
Column(
children: [
SizedBox(
height: 3,
),
Container(
width:
MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment.selectedICD
.description +
(' (${widget.mySelectedAssessment.selectedICD.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
],
),
SizedBox(
height: 7,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisCondition != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment
.selectedDiagnosisCondition,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
conditionController
.text = projectViewModel
.isArabic
? widget
.mySelectedAssessment
.selectedDiagnosisCondition
.nameAr
: widget
.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).condition,
maxLines: 1,
minLines: 1,
controller: conditionController,
isTextFieldHasSuffix: true,
enabled: false,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisCondition ==
null
? TranslationBase.of(context).emptyMessage
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisType != null
hintText: TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
),
),
SizedBox(
height: 10,
),
Container(
child: InkWell(
onTap: model.listOfICD10 != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment
.selectedDiagnosisType,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisType =
selectedValue;
typeController.text =
projectViewModel.isArabic
? selectedValue.nameAr
: selectedValue.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
setState(() {
widget.mySelectedAssessment!.selectedICD = null;
icdNameController.text = "";
});
}
: null,
hintText: TranslationBase.of(context).dType,
maxLines: 1,
minLines: 1,
enabled: false,
isTextFieldHasSuffix: true,
controller: typeController,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisType ==
null
? TranslationBase.of(context).emptyMessage
: null,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
maxLines: 18,
minLines: 5,
inputType: TextInputType.multiline,
controller: remarkController,
onChanged: (value) {
widget.mySelectedAssessment.remark =
remarkController.text;
},
child: widget.mySelectedAssessment!.selectedICD == null
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted && widget.mySelectedAssessment!.selectedICD == null,
child: AutoCompleteTextField<MasterKeyModel>(
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, "", true, suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment!.selectedICD = item;
icdNameController.text = '${item.code.trim()}/${item.description}';
}),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString()), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment!.selectedICD = null;
icdNameController.text = "";
});
}
: () {},
hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
),
onPressed: () {},
),
)),
),
if (widget.mySelectedAssessment!.selectedICD != null)
Column(
children: [
SizedBox(
height: 3,
),
Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment!.selectedICD!.description + (' (${widget.mySelectedAssessment!.selectedICD!.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
])),
],
),
SizedBox(
height: 7,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisCondition != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment!.selectedDiagnosisCondition!,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment!.selectedDiagnosisCondition = selectedValue;
conditionController.text = projectViewModel.isArabic
? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr!
: widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {},
hintText: TranslationBase.of(context).condition,
maxLines: 1,
minLines: 1,
controller: conditionController,
isTextFieldHasSuffix: true,
enabled: false,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment!.selectedDiagnosisType!,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment!.selectedDiagnosisType = selectedValue;
typeController.text = projectViewModel.isArabic ? selectedValue.nameAr! : selectedValue.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {},
hintText: TranslationBase.of(context).dType,
maxLines: 1,
minLines: 1,
enabled: false,
isTextFieldHasSuffix: true,
controller: typeController,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
maxLines: 18,
minLines: 5,
inputType: TextInputType.multiline,
controller: remarkController,
onChanged: (value) {
widget.mySelectedAssessment!.remark = remarkController.text;
},
),
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
])),
),
],
),
@ -400,26 +305,17 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 0,
)
: CustomBottomSheetContainer(
label: (widget.isUpdate
? 'Update Assessment Details'
: 'Add Assessment Details'),
label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'),
onTap: () async {
setState(() {
isFormSubmitted = true;
});
widget.mySelectedAssessment.remark = remarkController.text;
widget.mySelectedAssessment.appointmentId =
int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment
.selectedDiagnosisCondition !=
null &&
widget.mySelectedAssessment.selectedDiagnosisType !=
null &&
widget.mySelectedAssessment.selectedICD != null) {
await submitAssessment(
isUpdate: widget.isUpdate,
model: model,
mySelectedAssessment: widget.mySelectedAssessment);
widget.mySelectedAssessment!.remark = remarkController.text;
widget.mySelectedAssessment!.appointmentId = int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment!.selectedDiagnosisType != null &&
widget.mySelectedAssessment!.selectedICD != null) {
await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment!);
}
},
),
@ -428,51 +324,44 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
);
}
submitAssessment(
{SOAPViewModel model,
MySelectedAssessment mySelectedAssessment,
bool isUpdate = false}) async {
submitAssessment({SOAPViewModel? model, MySelectedAssessment? mySelectedAssessment, bool isUpdate = false}) async {
GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment.remark,
patientMRN: widget.patientInfo!.patientMRN,
episodeID: widget.patientInfo!.episodeNo,
appointmentNo: widget.patientInfo!.appointmentNo,
remarks: mySelectedAssessment!.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID);
await model.patchAssessment(patchAssessmentReqModel);
await model!.patchAssessment(patchAssessmentReqModel);
} else {
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code)
]);
new PostAssessmentRequestModel(patientMRN: widget.patientInfo!.patientMRN, episodeId: widget.patientInfo!.episodeNo, appointmentNo: widget.patientInfo!.appointmentNo, icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment!.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code)
]);
await model.postAssessment(postAssessmentRequestModel);
await model!.postAssessment(postAssessmentRequestModel);
}
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
widget.addSelectedAssessment!(mySelectedAssessment, isUpdate);
Navigator.of(context).pop();
}
}

@ -25,13 +25,13 @@ import 'assessment_call_back.dart';
// ignore: must_be_immutable
class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
final Function changeLoadingState;
final int currentIndex;
final Function? changePageViewIndex;
final PatiantInformtion? patientInfo;
final Function? changeLoadingState;
final int? currentIndex;
UpdateAssessmentPage(
{Key key,
{Key? key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
@ -55,7 +55,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
model.setAssessmentCallBack(this);
mySelectedAssessmentList.clear();
await model.onUpdateAssessmentStepStart(widget.patientInfo);
await model.onUpdateAssessmentStepStart(widget.patientInfo!);
if (model.patientAssessmentList.isNotEmpty) {
model.patientAssessmentList.forEach((element) {
@ -92,7 +92,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
});
}
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
@ -108,9 +108,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
mainAxisAlignment: MainAxisAlignment.start,
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
currentIndex: widget.currentIndex!,
changePageViewIndex: widget.changePageViewIndex!,
patientInfo: widget.patientInfo!,
),
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).assessment,
@ -163,7 +163,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
),
new TextSpan(
text: assessment
.selectedICD.code
.selectedICD!.code
.trim()
.toUpperCase() ??
""),
@ -180,7 +180,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
.getDayMonthYearDateFormatted(
DateTime.parse(
assessment
.createdOn), isMonthShort: true)
.createdOn!), isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
@ -194,7 +194,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
? AppDateUtils.getHour(
DateTime.parse(
assessment
.createdOn))
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
@ -239,7 +239,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
children: <TextSpan>[
new TextSpan(
text: assessment
.selectedICD.description
.selectedICD!.description
.toString(),
),
],
@ -309,10 +309,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
.isArabic
? assessment
.selectedDiagnosisCondition
.nameAr
!.nameAr
: assessment
.selectedDiagnosisCondition
.nameEn,
!.nameEn,
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
@ -349,10 +349,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
.isArabic
? assessment
.selectedDiagnosisType
.nameAr
!.nameAr
: assessment
.selectedDiagnosisType
.nameEn,
!.nameEn,
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
@ -489,10 +489,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
}
openAssessmentDialog(BuildContext context,
{MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) {
{MySelectedAssessment? assessment, bool isUpdate = false, SOAPViewModel? model}) {
if (assessment == null) {
assessment = SoapUtils.generateMySelectedAssessment(
remark: '', appointmentNo: widget.patientInfo.appointmentNo);
remark: '', appointmentNo: widget.patientInfo!.appointmentNo);
}
showModalBottomSheet(
backgroundColor: Colors.white,
@ -519,8 +519,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
if (mySelectedAssessmentList.isEmpty) {
Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(3);
widget.changeLoadingState!(true);
widget.changePageViewIndex!(3);
}
}
}

@ -9,13 +9,12 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'examinations_list_search_widget.dart';
class AddExaminationPage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function(List<MySelectedExamination>) addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
final List<MySelectedExamination>? mySelectedExamination;
final Function(List<MySelectedExamination>)? addSelectedExamination;
final Function(MasterKeyModel)? removeExamination;
AddExaminationPage(
{this.mySelectedExamination,
@ -27,12 +26,12 @@ class AddExaminationPage extends StatefulWidget {
}
class _AddExaminationPageState extends State<AddExaminationPage> {
List<MySelectedExamination> mySelectedExaminationLocal;
List<MySelectedExamination> mySelectedExaminationLocal = [];
@override
initState() {
super.initState();
mySelectedExaminationLocal = [...widget.mySelectedExamination];
mySelectedExaminationLocal = [...?widget.mySelectedExamination];
}
@override
@ -73,7 +72,7 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
children: [
ExaminationsListSearchWidget(
mySelectedExamination:
widget.mySelectedExamination,
widget.mySelectedExamination!,
masterList: model.physicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
@ -106,7 +105,7 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
label: "${TranslationBase.of(context).addExamination}",
onTap: () {
widget
.addSelectedExamination(mySelectedExaminationLocal);
.addSelectedExamination!(mySelectedExaminationLocal);
},
),
));
@ -115,8 +114,8 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where(
(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) {
return true;
}

@ -13,20 +13,21 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable
class AddExaminationWidget extends StatefulWidget {
MasterKeyModel item;
final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
MasterKeyModel? item;
final Function(MySelectedExamination)? removeExamination;
final Function(MySelectedExamination)? addExamination;
final bool Function(MasterKeyModel)? isServiceSelected;
bool isExpand;
final Function expandClick;
final List<MySelectedExamination> mySelectedExamination;
final Function? expandClick;
final List<MySelectedExamination>? mySelectedExamination;
AddExaminationWidget({
this.item,
this.removeExamination,
this.addExamination,
this.isServiceSelected,
this.isExpand,
this.isExpand = false,
this.expandClick,
this.mySelectedExamination,
});
@ -42,14 +43,14 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override
void initState() {
if (getSelectedExam(widget.item) != null) {
examination = getSelectedExam(widget.item);
status = examination.isNormal
if (getSelectedExam(widget.item!) != null) {
examination = getSelectedExam(widget.item!);
status = examination.isNormal!
? 1
: examination.isAbnormal
: examination.isAbnormal!
? 2
: 3;
remarksController.text = examination.remark;
remarksController.text = examination.remark!;
} else {
examination.selectedExamination = widget.item;
}
@ -72,22 +73,20 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
child: Row(
children: [
Checkbox(
value: widget.isServiceSelected(widget.item),
value: widget.isServiceSelected!(widget.item!),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
onChanged: (bool? newValue) {
onExamTap();
}),
Container(
child: AppText(
projectViewModel.isArabic
? widget.item.nameAr != null &&
widget.item.nameAr != ""
? widget.item.nameAr
: widget.item.nameEn
: widget.item.nameEn,
? widget.item!.nameAr != null && widget.item!.nameAr != ""
? widget.item!.nameAr!
: widget.item!.nameEn!
: widget.item!.nameEn!,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 3 : 3.8),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8),
letterSpacing: -0.56,
),
),
@ -97,10 +96,9 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Container(
margin: EdgeInsets.symmetric(horizontal: 8),
child: InkWell(
onTap: widget.expandClick,
child: Icon(widget.isExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)),
onTap: widget.expandClick!(),
child: Icon(widget.isExpand! ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down),
),
),
],
),
@ -115,7 +113,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
TranslationBase.of(context).status,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
),
),
Row(
@ -144,9 +142,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
),
child: Container(
decoration: BoxDecoration(
color: status == 1
? HexColor("#D02127")
: Colors.white,
color: status == 1 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
),
),
@ -155,7 +151,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
TranslationBase.of(context).normal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
@ -184,9 +180,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
),
child: Container(
decoration: BoxDecoration(
color: status == 2
? HexColor("#D02127")
: Colors.white,
color: status == 2 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
),
),
@ -195,7 +189,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
TranslationBase.of(context).abnormal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
@ -225,9 +219,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
),
child: Container(
decoration: BoxDecoration(
color: status == 3
? HexColor("#D02127")
: Colors.white,
color: status == 3 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
),
),
@ -237,7 +229,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
TranslationBase.of(context).notExamined,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
),
),
],
@ -268,28 +260,25 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
onExamTap() {
setState(() {
if (widget.isServiceSelected(widget.item)) {
if (examination.isLocal) widget.removeExamination(examination);
widget.expandClick();
if (widget.isServiceSelected!(widget.item!)) {
if (examination.isLocal) widget.removeExamination!(examination);
widget.expandClick!();
} else {
examination.isNormal = status == 1;
examination.isAbnormal = status == 2;
examination.notExamined = status == 3;
examination.remark = remarksController.text;
widget.addExamination(examination);
widget.expandClick();
widget.addExamination!(examination);
widget.expandClick!();
}
});
}
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) {
return exam.first;
}
return null;
return MySelectedExamination();
}
}

@ -32,15 +32,15 @@ class ExaminationItemCard extends StatelessWidget {
child: Container(
child: AppText(
projectViewModel.isArabic
? examination.selectedExamination.nameAr != null &&
examination.selectedExamination.nameAr != ""
? examination.selectedExamination.nameAr
: examination.selectedExamination.nameEn
: examination.selectedExamination.nameEn,
? examination.selectedExamination!.nameAr != null &&
examination.selectedExamination!.nameAr != ""
? examination.selectedExamination!.nameAr!
: examination.selectedExamination!.nameEn!
: examination.selectedExamination!.nameEn!,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
),
)),
],
@ -61,7 +61,7 @@ class ExaminationItemCard extends StatelessWidget {
? Colors.red.shade800
: Colors.grey.shade800
: AppGlobal.appGreenColor,
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
),
if (!examination.notExamined)
RemoveButton(
@ -75,8 +75,8 @@ class ExaminationItemCard extends StatelessWidget {
SizedBox(
height: 4,
),
if (examination.remark.isNotEmpty)
RemarkText(remark: examination.remark),
if (examination.remark!.isNotEmpty)
RemarkText(remark: examination.remark!),
],
),
);

@ -9,11 +9,11 @@ import 'package:flutter/material.dart';
import 'add_examination_widget.dart';
class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList;
final List<MySelectedExamination> mySelectedExamination;
final Function(MySelectedExamination)? removeExamination;
final Function(MySelectedExamination)? addExamination;
final bool Function(MasterKeyModel)? isServiceSelected;
final List<MasterKeyModel>? masterList;
final List<MySelectedExamination>? mySelectedExamination;
ExaminationsListSearchWidget(
{this.removeExamination,
@ -35,7 +35,7 @@ class _ExaminationsListSearchWidgetState
@override
void initState() {
items.addAll(widget.masterList);
items.addAll(widget.masterList as Iterable<MasterKeyModel>);
super.initState();
}
@ -56,7 +56,7 @@ class _ExaminationsListSearchWidgetState
icon: Icon(
Icons.search,
color: Colors.black,
)),
), onPressed: () { },),
),
DividerWithSpacesAround(
height: 2,
@ -86,12 +86,12 @@ class _ExaminationsListSearchWidgetState
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = [];
dummySearchList.addAll(widget.masterList);
dummySearchList.addAll(widget.masterList as Iterable<MasterKeyModel>);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((item) {
if (item.nameAr.toLowerCase().contains(query.toLowerCase()) ||
item.nameEn.toLowerCase().contains(query.toLowerCase())) {
if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) ||
item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
@ -103,7 +103,7 @@ class _ExaminationsListSearchWidgetState
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
items.addAll(widget.masterList as Iterable<MasterKeyModel>);
});
}
}

@ -26,29 +26,22 @@ import 'examination_item_card.dart';
import 'objective_call_back.dart';
class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final Function? changePageViewIndex;
final Function? changeLoadingState;
final int currentIndex;
final PatiantInformtion patientInfo;
final PatiantInformtion? patientInfo;
UpdateObjectivePage(
{Key key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
UpdateObjectivePage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex = 0});
@override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
}
class _UpdateObjectivePageState extends State<UpdateObjectivePage>
implements ObjectiveCallBack {
class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack {
bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = [];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
@ -67,7 +60,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
model.setObjectiveCallBack(this);
mySelectedExamination.clear();
model.isAddExamInProgress = true;
await model.getPatientPhysicalExam(widget.patientInfo);
await model.getPatientPhysicalExam(widget.patientInfo!);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
@ -77,8 +70,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam =
SoapUtils.generateMySelectedExamination(
MySelectedExamination tempEam = SoapUtils.generateMySelectedExamination(
examination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
@ -93,7 +85,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExamination.add(tempEam);
});
}
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
@ -109,12 +101,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
changePageViewIndex: widget.changePageViewIndex!,
patientInfo: widget.patientInfo!,
),
ExpandableSOAPWidget(
headerTitle:
TranslationBase.of(context).physicalSystemExamination,
headerTitle: TranslationBase.of(context).physicalSystemExamination,
onTap: () {
setState(() {
isSysExaminationExpand = !isSysExaminationExpand;
@ -123,14 +114,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
child: Column(
children: [
SOAPOpenItems(
label:
"${TranslationBase.of(context).addExamination}",
label: "${TranslationBase.of(context).addExamination}",
onTap: () {
openExaminationList(context);
},
),
if (mySelectedExamination.isNotEmpty &&
mySelectedExamination.first.isLocal)
if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal)
Row(
children: [
AppText(
@ -143,25 +132,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
),
Column(
children: mySelectedExamination
.sublist(
0,
model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
removeExamination(examination.selectedExamination!);
});
}).toList(),
),
if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination(
mySelectedExamination) >
-1)
if (mySelectedExamination.isNotEmpty && model.getFirstIndexForOldExamination(mySelectedExamination) > -1)
Row(
children: [
AppText(
@ -174,16 +152,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
),
Column(
children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
removeExamination(examination.selectedExamination!);
});
}).toList(),
)
@ -192,8 +164,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
isExpanded: isSysExaminationExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 14 : 12),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 14 : 12),
)
],
),
@ -206,40 +177,27 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) {
if (!model.isAddExamInProgress &&
widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
if (!model.isAddExamInProgress && widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) {
Navigator.of(context).pop();
} else {
widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
widget.changeLoadingState!(true);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel
.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
ListHisProgNotePhysicalExaminationVM
listHisProgNotePhysicalExaminationVM =
ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo == null
? 0
: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo == null
? 0
: widget.patientInfo.appointmentNo,
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
ListHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM = ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo!.patientMRN,
episodeId: widget.patientInfo!.episodeNo == null ? 0 : widget.patientInfo!.episodeNo,
appointmentNo: widget.patientInfo!.appointmentNo == null ? 0 : widget.patientInfo!.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
examId: exam.selectedExamination!.id,
examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
@ -255,15 +213,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
: "Not Examined",
isNew: exam.isNew,
);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo);
if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo!.admissionNo!);
} else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0;
}
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(listHisProgNotePhysicalExaminationVM);
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(listHisProgNotePhysicalExaminationVM);
});
if (model.patientPhysicalExamList.isEmpty) {
@ -273,22 +228,20 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
}
if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
Utils.showErrorToast(model.error);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop();
model.isAddExamInProgress = false;
}
} else {
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop();
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
model.isAddExamInProgress = false;
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
widget.changeLoadingState!(true);
widget.changePageViewIndex!(2);
}
}
}
@ -298,10 +251,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
Iterable<MySelectedExamination> history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (history.length > 0) {
setState(() {
@ -322,16 +272,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
FadePage(
page: AddExaminationPage(
mySelectedExamination: mySelectedExamination,
addSelectedExamination:
(List<MySelectedExamination> mySelectedExaminationLocal) {
addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal) {
setState(() {
{
mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
if ((
mySelectedExamination.singleWhere(
(it) => it.selectedExamination!.id == element.selectedExamination!.id,
orElse: () => MySelectedExamination(),
),
) ==
null) {
mySelectedExamination.insert(0, element);
}
@ -340,18 +290,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
/// remove items.
List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) {
removedList.add(element);
}
});
removedList.forEach((element) {
removeExamination(element.selectedExamination);
removeExamination(element.selectedExamination!);
});
Navigator.of(context).pop();
}

@ -22,16 +22,16 @@ import '../shared_soap_widgets/SOAP_step_header.dart';
import '../shared_soap_widgets/expandable_SOAP_widget.dart';
class UpdatePlanPage extends StatefulWidget {
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
final Function changeLoadingState;
final Function changeStateFun;
final SOAPViewModel sOAPViewModel;
final Function? changePageViewIndex;
final PatiantInformtion? patientInfo;
final Function? changeLoadingState;
final Function? changeStateFun;
final SOAPViewModel? sOAPViewModel;
final int currentIndex;
final int? currentIndex;
UpdatePlanPage(
{Key key,
{Key? key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
@ -81,34 +81,34 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
int.parse(widget.patientInfo!.appointmentNo.toString()),
patientMRN: widget.patientInfo!.patientMRN,
episodeID: widget.patientInfo!.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
!.getPatientProgressNote(getGetProgressNoteReqModel);
///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel!.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
widget.sOAPViewModel!.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = isAddProgress;
widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
widget.sOAPViewModel!.isAddProgress = isAddProgress;
widget.sOAPViewModel!.progressNoteText = progressNoteController.text;
});
}
}
@ -117,40 +117,40 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.sOAPViewModel.setPlanCallBack(this);
widget.sOAPViewModel!.setPlanCallBack(this);
GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
int.parse(widget.patientInfo!.appointmentNo.toString()),
patientMRN: widget.patientInfo!.patientMRN,
episodeID: widget.patientInfo!.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
!.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel!.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
widget.sOAPViewModel!.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.progressNoteText = progressNoteController.text;
setState(() {
isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
widget.sOAPViewModel!.isAddProgress = false;
});
}
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
},
builder: (_, model, w) => AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -163,9 +163,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
child: Column(
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
currentIndex: widget.currentIndex!,
changePageViewIndex: widget.changePageViewIndex!,
patientInfo: widget.patientInfo!,
),
SizedBox(
height: 10,
@ -199,7 +199,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
patientProgressNote.planNote =
value;
model.progressNoteText = value;
widget.changeStateFun();
widget.changeStateFun!();
});
},
),
@ -258,7 +258,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
.getDayMonthYearDateFormatted(
DateTime.parse(
patientProgressNote
.createdOn))
.createdOn!))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
@ -293,7 +293,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
? AppDateUtils.getHour(
DateTime.parse(
patientProgressNote
.createdOn))
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
@ -322,7 +322,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
setState(() {
isAddProgress = true;
widget.sOAPViewModel
.isAddProgress = true;
!.isAddProgress = true;
});
},
child: Icon(
@ -354,62 +354,62 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) {
widget.changeLoadingState(true);
widget.changeLoadingState!(true);
PostProgressNoteRequestModel postProgressNoteRequestModel =
new PostProgressNoteRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
patientMRN: widget.patientInfo!.patientMRN,
episodeId: widget.patientInfo!.episodeNo!,
appointmentNo: widget.patientInfo!.appointmentNo,
planNote: patientProgressNote.planNote,
doctorID: '',
editedBy: '');
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
if (widget.sOAPViewModel!.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel
.postProgressNote(postProgressNoteRequestModel);
! .postProgressNote(postProgressNoteRequestModel);
} else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel
.patchProgressNote(postProgressNoteRequestModel);
!.patchProgressNote(postProgressNoteRequestModel);
}
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.sOAPViewModel.error);
if (widget.sOAPViewModel!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.sOAPViewModel!.error);
} else {
GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
int.parse(widget.patientInfo!.appointmentNo.toString()),
patientMRN: widget.patientInfo!.patientMRN,
episodeID: widget.patientInfo!.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
!.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel!.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
widget.sOAPViewModel!.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
widget.sOAPViewModel!.isAddProgress = false;
});
}
}
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
} else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
}

@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class SOAPOpenItems extends StatelessWidget {
final Function onTap;
final Function? onTap;
final String label;
const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key);
const SOAPOpenItems({Key? key, this.onTap, this.label = ''}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
onTap: onTap!(),
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0),
margin: EdgeInsets.symmetric(vertical: 8),

@ -7,15 +7,15 @@ import 'package:flutter/material.dart';
class SOAPStepHeader extends StatelessWidget {
const SOAPStepHeader({
Key key,
Key? key,
this.currentIndex,
this.changePageViewIndex,
this.patientInfo,
}) : super(key: key);
final int currentIndex;
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
final int? currentIndex;
final Function? changePageViewIndex;
final PatiantInformtion? patientInfo;
@override
Widget build(BuildContext context) {
@ -32,16 +32,14 @@ class SOAPStepHeader extends StatelessWidget {
),
AppText(
TranslationBase.of(context).createNew,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 3 : 4),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4),
fontWeight: FontWeight.w700,
letterSpacing: -0.72,
color: Color(0xFF2E303A),
),
AppText(
TranslationBase.of(context).episode,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 6 : 8),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 8),
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
color: Color(0xFF2E303A),
@ -49,14 +47,13 @@ class SOAPStepHeader extends StatelessWidget {
Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: StepsWidget(
index: currentIndex,
index: currentIndex ?? 0,
changeCurrentTab: changePageViewIndex,
patientInfo: patientInfo,
),
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 1 : 2),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 1 : 2),
),
],
);

@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
class BottomSheetTitle extends StatelessWidget {
BottomSheetTitle({
Key key,
this.title,
Key? key,
this.title = '',
}) : super(key: key);
final String title;

@ -8,25 +8,17 @@ import 'package:hexcolor/hexcolor.dart';
class ExpandableSOAPWidget extends StatelessWidget {
final bool isExpanded;
final Widget child;
final Function onTap;
final Widget? child;
final Function? onTap;
final headerTitle;
final bool isRequired;
const ExpandableSOAPWidget(
{Key key,
this.isExpanded,
this.child,
this.onTap,
this.headerTitle,
this.isRequired = true})
: super(key: key);
const ExpandableSOAPWidget({Key? key, this.isExpanded = false, this.child, this.onTap, this.headerTitle, this.isRequired = true}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(
vertical: SizeConfig.isHeightVeryShort ? 10 : 20, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: SizeConfig.isHeightVeryShort ? 10 : 20, horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
@ -36,12 +28,12 @@ class ExpandableSOAPWidget extends StatelessWidget {
),
child: HeaderBodyExpandableNotifier(
headerWidget: InkWell(
onTap: onTap,
onTap: onTap!(),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: onTap,
onTap: onTap!(),
child: Row(
children: [
AppText(
@ -66,15 +58,13 @@ class ExpandableSOAPWidget extends StatelessWidget {
),
),
InkWell(
onTap: onTap,
child: Icon(isExpanded
? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline),
onTap: onTap!(),
child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline),
)
],
),
),
bodyWidget: child,
bodyWidget: child!,
isExpand: isExpanded,
),
);

@ -5,8 +5,8 @@ class RemarkText extends StatelessWidget {
final String remark;
const RemarkText({
Key key,
this.remark,
Key? key,
this.remark = '',
}) : super(key: key);
@override

@ -6,10 +6,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
class RemoveButton extends StatelessWidget {
final Function onTap;
final Function? onTap;
final String label;
const RemoveButton({Key key, this.onTap, this.label}) : super(key: key);
const RemoveButton({Key? key, this.onTap, this.label = ''}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -32,7 +32,7 @@ class RemoveButton extends StatelessWidget {
),
],
),
onTap: onTap,
onTap: onTap!(),
);
}
}

@ -7,8 +7,8 @@ class StepDetailsWidget extends StatelessWidget {
final double marginLeft;
const StepDetailsWidget({
Key key,
this.stepLabel,
Key? key,
this.stepLabel = '',
this.marginLeft = 0,
}) : super(key: key);

@ -1,16 +1,15 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../../../config/config.dart';
class StatusLabel extends StatelessWidget {
const StatusLabel({
Key key,
this.stepId,
this.selectedStepId,
Key? key,
this.stepId = 0,
this.selectedStepId = 0,
}) : super(key: key);
final int stepId;

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/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/model/patient/patiant_info_model.dart';
@ -7,21 +8,15 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import '../../../../../../config/config.dart';
import 'Step_details_widget.dart';
class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
final Function? changeCurrentTab;
final double height;
final PatiantInformtion patientInfo;
final PatiantInformtion? patientInfo;
StepsWidget(
{Key key,
this.index,
this.changeCurrentTab,
this.height = 0.0,
this.patientInfo});
StepsWidget({Key? key, this.index = 0, this.changeCurrentTab, this.height = 0.0, this.patientInfo});
@override
Widget build(BuildContext context) {
@ -36,8 +31,7 @@ class StepsWidget extends StatelessWidget {
: SizeConfig.isHeightShort
? 10
: 10);
double containerHeight =
SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 16 : 15);
double containerHeight = SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 16 : 15);
return !projectViewModel.isArabic
? Stack(
@ -51,11 +45,7 @@ class StepsWidget extends StatelessWidget {
top: 30,
child: Center(
child: Container(
width: MediaQuery.of(context).size.width *
(patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty
? 0.9
: 0.85),
width: MediaQuery.of(context).size.width * (patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty ? 0.9 : 0.85),
child: Divider(
color: Colors.grey,
height: 0.75,
@ -68,7 +58,7 @@ class StepsWidget extends StatelessWidget {
top: circleTop,
left: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
onTap: () => changeCurrentTab!(0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -80,8 +70,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
: Border.all(color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
@ -115,12 +104,9 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: circleTop,
left: patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty
? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.71,
left: patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty ? MediaQuery.of(context).size.width * 0.25 : MediaQuery.of(context).size.width * 0.71,
child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null,
onTap: () => index >= 1 ? changeCurrentTab!(1) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -132,8 +118,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
: Border.all(color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
@ -167,14 +152,13 @@ class StepsWidget extends StatelessWidget {
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
if (patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty)
Positioned(
top: circleTop,
left: MediaQuery.of(context).size.width * 0.47,
child: InkWell(
onTap: () {
if (index >= 3) changeCurrentTab(2);
if (index >= 3) changeCurrentTab!(2);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -187,8 +171,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
: Border.all(color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
@ -222,13 +205,12 @@ class StepsWidget extends StatelessWidget {
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
if (patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty)
Positioned(
top: circleTop,
right: 0,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null,
onTap: () => index >= 3 ? changeCurrentTab!(4) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
@ -240,8 +222,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
: Border.all(color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
@ -289,11 +270,7 @@ class StepsWidget extends StatelessWidget {
top: 30,
child: Center(
child: Container(
width: MediaQuery.of(context).size.width *
(patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty
? 0.9
: 0.85),
width: MediaQuery.of(context).size.width * (patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty ? 0.9 : 0.85),
child: Divider(
color: Colors.grey,
height: 0.75,
@ -306,7 +283,7 @@ class StepsWidget extends StatelessWidget {
top: circleTop,
right: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
onTap: () => changeCurrentTab!(0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -318,8 +295,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
: Border.all(color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
@ -352,13 +328,9 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: circleTop,
right: MediaQuery.of(context).size.width *
(patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty
? 0.25
: 0.71),
right: MediaQuery.of(context).size.width * (patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty ? 0.25 : 0.71),
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
onTap: () => index >= 2 ? changeCurrentTab!(1) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -370,8 +342,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
: Border.all(color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
@ -402,13 +373,12 @@ class StepsWidget extends StatelessWidget {
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
if (patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty)
Positioned(
top: circleTop,
right: MediaQuery.of(context).size.width * 0.50,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
onTap: () => index >= 3 ? changeCurrentTab!(2) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -420,8 +390,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
: Border.all(color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
@ -457,13 +426,12 @@ class StepsWidget extends StatelessWidget {
),
),
),
if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty)
if (patientInfo!.admissionNo == null || patientInfo!.admissionNo!.isEmpty)
Positioned(
top: circleTop,
left: 0,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null,
onTap: () => index >= 3 ? changeCurrentTab!(4) : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
@ -475,8 +443,7 @@ class StepsWidget extends StatelessWidget {
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
: Border.all(color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)

@ -20,7 +20,7 @@ class SoapUtils {
isChecked = false,
remark,
isLocal = true,
int createdBy,
int? createdBy,
bool isExpanded = false}) {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: allergy,

@ -16,25 +16,24 @@ import '../../shared_soap_widgets/bottom_sheet_title.dart';
import 'master_key_checkbox_search_allergies_widget.dart';
class AddAllergies extends StatefulWidget {
final Function addAllergiesFun;
final List<MySelectedAllergy> myAllergiesList;
final Function? addAllergiesFun;
final List<MySelectedAllergy>? myAllergiesList;
const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList})
: super(key: key);
const AddAllergies({Key? key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key);
@override
_AddAllergiesState createState() => _AddAllergiesState();
}
class _AddAllergiesState extends State<AddAllergies> {
List<MasterKeyModel> allergiesList;
List<MasterKeyModel> allergySeverityList;
List<MySelectedAllergy> myAllergiesListLocal;
List<MasterKeyModel> allergiesList = [];
List<MasterKeyModel> allergySeverityList = [];
List<MySelectedAllergy> myAllergiesListLocal = [];
@override
initState() {
super.initState();
myAllergiesListLocal = [...widget.myAllergiesList];
myAllergiesListLocal = [...?widget.myAllergiesList];
}
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
@ -61,54 +60,48 @@ class _AddAllergiesState extends State<AddAllergies> {
),
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () {
setState(() {
widget
.addAllergiesFun(myAllergiesListLocal);
});
},
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy: (MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () {
setState(() {
widget.addAllergiesFun!(myAllergiesListLocal);
});
},
isServiceSelected: (master) => isServiceSelected(master),
getServiceSelectedAllergy: (master) => getSelectedAllergy(master),
),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
),
]),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
),
]),
),
),
bottomSheet: model.state != ViewState.Idle
@ -119,7 +112,7 @@ class _AddAllergiesState extends State<AddAllergies> {
label: TranslationBase.of(context).addAllergies,
onTap: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
widget.addAllergiesFun!(myAllergiesListLocal);
});
},
),
@ -129,11 +122,8 @@ class _AddAllergiesState extends State<AddAllergies> {
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where(
(element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy?.id && masterKey.typeId == element.selectedAllergy?.typeId && element.isChecked!);
if (allergy.length > 0) {
return true;
}
@ -141,20 +131,16 @@ class _AddAllergiesState extends State<AddAllergies> {
}
removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal
.removeWhere((element) => element.selectedAllergy.id == masterKey.id);
myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id);
}
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where(
(element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked!);
if (allergy.length > 0) {
return allergy.first;
}
return null;
return MySelectedAllergy();
}
addAllergyLocally(MySelectedAllergy mySelectedAllergy) {
@ -164,18 +150,13 @@ class _AddAllergiesState extends State<AddAllergies> {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id).toList();
if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy);
} else {
allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
}

@ -17,49 +17,39 @@ import 'package:provider/provider.dart';
import '../../soap_utils.dart';
class AddAllergiesItem extends StatefulWidget {
final SOAPViewModel model;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final SOAPViewModel? model;
final Function(MasterKeyModel)? removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy)? addAllergy;
final bool Function(MasterKeyModel)? isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel)? getServiceSelectedAllergy;
final MasterKeyModel? item;
final MasterKeyModel item;
const AddAllergiesItem(
{Key key,
this.model,
this.removeAllergy,
this.addAllergy,
this.isServiceSelected,
this.getServiceSelectedAllergy,
this.item})
: super(key: key);
const AddAllergiesItem({Key? key, this.model, this.removeAllergy, this.addAllergy, this.isServiceSelected, this.getServiceSelectedAllergy, this.item}) : super(key: key);
@override
_AddAllergiesItemState createState() => _AddAllergiesItemState();
}
class _AddAllergiesItemState extends State<AddAllergiesItem> {
MasterKeyModel _selectedAllergySeverity;
MasterKeyModel _selectedAllergySeverity = MasterKeyModel();
bool isSubmitted = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
bool isSelected = widget.isServiceSelected(widget.item);
MySelectedAllergy mySelectedAllergy;
bool isSelected = widget.isServiceSelected!(widget.item!);
MySelectedAllergy mySelectedAllergy = MySelectedAllergy();
if (isSelected) {
mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item);
mySelectedAllergy = widget.getServiceSelectedAllergy!(widget.item!);
}
TextEditingController remarkController = TextEditingController(
text: isSelected ? mySelectedAllergy.remark : null);
TextEditingController remarkController = TextEditingController(text: isSelected ? mySelectedAllergy.remark : null);
TextEditingController severityController = TextEditingController(
text: isSelected
? mySelectedAllergy.selectedAllergySeverity != null
? projectViewModel.isArabic
? mySelectedAllergy.selectedAllergySeverity.nameAr
: mySelectedAllergy.selectedAllergySeverity.nameEn
? mySelectedAllergy.selectedAllergySeverity!.nameAr
: mySelectedAllergy.selectedAllergySeverity!.nameEn
: null
: null);
return HeaderBodyExpandableNotifier(
@ -69,9 +59,9 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
Row(
children: [
Checkbox(
value: widget.isServiceSelected(widget.item),
value: widget.isServiceSelected!(widget.item!),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
onChanged: (bool? newValue) {
onTapItem();
}),
InkWell(
@ -79,13 +69,12 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
child: Container(
child: AppText(
projectViewModel.isArabic
? widget.item.nameAr != ""
? widget.item.nameAr
: widget.item.nameEn
: widget.item.nameEn,
? widget.item!.nameAr != ""
? widget.item!.nameAr!
: widget.item!.nameEn!
: widget.item!.nameEn!,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 3 : 3.8),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8),
letterSpacing: -0.56,
),
width: MediaQuery.of(context).size.width * 0.55,
@ -97,15 +86,12 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
onTap: () {
if (mySelectedAllergy != null) {
setState(() {
mySelectedAllergy.isExpanded =
mySelectedAllergy.isExpanded ? false : true;
mySelectedAllergy.isExpanded = mySelectedAllergy.isExpanded == null ? false : true;
});
}
},
child: Icon(
(mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false)
? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline,
(mySelectedAllergy != null ? mySelectedAllergy.isExpanded! : false) ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline,
color: Color(0xFF575757),
size: 20,
),
@ -119,17 +105,15 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
child: Column(
children: [
AppTextFieldCustom(
onClick: widget.model.allergySeverityList != null
onClick: widget.model!.allergySeverityList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: widget.model.allergySeverityList,
selectedValue:
mySelectedAllergy.selectedAllergySeverity,
list: widget.model!.allergySeverityList,
selectedValue: mySelectedAllergy.selectedAllergySeverity!,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
mySelectedAllergy.selectedAllergySeverity =
selectedValue;
mySelectedAllergy.selectedAllergySeverity = selectedValue;
});
},
);
@ -141,18 +125,15 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
},
);
}
: null,
: () {},
isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity + "*",
enabled: false,
maxLines: 1,
minLines: 1,
height: Utils.getTextFieldHeight(),
validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError
? TranslationBase.of(context).severityValidationError
: null,
validationError:
mySelectedAllergy != null && mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.hasValidationError! ? TranslationBase.of(context).severityValidationError : "",
controller: severityController,
),
SizedBox(
@ -177,24 +158,17 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
),
),
),
isExpand:
mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false,
isExpand: mySelectedAllergy != null ? mySelectedAllergy.isExpanded! : false,
);
}
onTapItem() {
setState(() {
if (widget.isServiceSelected(widget.item)) {
widget.removeAllergy(widget.item);
if (widget.isServiceSelected!(widget.item!)) {
widget.removeAllergy!(widget.item!);
} else {
MySelectedAllergy mySelectedAllergy =
SoapUtils.generateMySelectedAllergy(
allergy: widget.item,
allergySeverity: _selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);
widget.addAllergy(mySelectedAllergy);
MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy(allergy: widget.item, allergySeverity: _selectedAllergySeverity, remark: null, isChecked: true, isExpanded: true);
widget.addAllergy!(mySelectedAllergy);
}
});
}

@ -11,19 +11,19 @@ import 'package:flutter/material.dart';
import 'allergies_item.dart';
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final SOAPViewModel model;
final Function() addSelectedAllergy;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final SOAPViewModel? model;
final Function()? addSelectedAllergy;
final Function(MasterKeyModel)? removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy)? addAllergy;
final bool Function(MasterKeyModel)? isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel)? getServiceSelectedAllergy;
final List<MasterKeyModel> masterList;
final String buttonName;
final String hintSearchText;
final List<MasterKeyModel>? masterList;
final String? buttonName;
final String? hintSearchText;
MasterKeyCheckboxSearchAllergiesWidget(
{Key key,
{Key? key,
this.model,
this.addSelectedAllergy,
this.removeAllergy,
@ -47,7 +47,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
@override
void initState() {
items.addAll(widget.masterList);
items.addAll(widget.masterList!);
super.initState();
}
@ -78,7 +78,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
icon: Icon(
Icons.search,
color: Colors.black,
)),
), onPressed: () { },),
),
DividerWithSpacesAround(),
SizedBox(
@ -122,12 +122,12 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = [];
dummySearchList.addAll(widget.masterList);
dummySearchList.addAll(widget.masterList as Iterable<MasterKeyModel>);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items);
}
});
@ -139,7 +139,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
items.addAll(widget.masterList as Iterable<MasterKeyModel>);
});
}
}

@ -15,9 +15,9 @@ import 'add_allergies.dart';
// ignore: must_be_immutable
class UpdateAllergiesWidget extends StatefulWidget {
List<MySelectedAllergy> myAllergiesList;
List<MySelectedAllergy>? myAllergiesList;
UpdateAllergiesWidget({Key key, this.myAllergiesList});
UpdateAllergiesWidget({Key? key, this.myAllergiesList});
@override
_UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState();
@ -45,7 +45,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myAllergiesList.map((selectedAllergy) {
children: widget.myAllergiesList!.map((selectedAllergy) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
@ -62,36 +62,20 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
projectViewModel.isArabic ? selectedAllergy.selectedAllergy!.nameAr! : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(),
textDecoration: selectedAllergy.isChecked! ? TextDecoration.none : TextDecoration.lineThrough,
bold: true,
color: Color(0xFF2B353E),
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
// fontHeight:0.18 ,
),
AppText(
projectViewModel.isArabic
? selectedAllergy
.selectedAllergySeverity.nameAr
: selectedAllergy
.selectedAllergySeverity.nameEn
.toUpperCase(),
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
projectViewModel.isArabic ? selectedAllergy.selectedAllergySeverity!.nameAr! : selectedAllergy.selectedAllergySeverity!.nameEn!.toUpperCase(),
textDecoration: selectedAllergy.isChecked! ? TextDecoration.none : TextDecoration.lineThrough,
color: Color(0xFFCC9B14),
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
@ -110,7 +94,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
child: Row(
children: [
RemarkText(
remark: selectedAllergy.remark,
remark: selectedAllergy.remark!,
),
],
),
@ -132,18 +116,14 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
removeAllergy(MySelectedAllergy mySelectedAllergy) {
List<MySelectedAllergy> allergy =
// ignore: missing_return
widget.myAllergiesList
.where((element) =>
mySelectedAllergy.selectedAllergySeverity.id ==
element.selectedAllergySeverity.id &&
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
widget.myAllergiesList!
.where((element) => mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id)
.toList();
if (allergy.length > 0) {
if (allergy.first.isLocal) {
setState(() {
widget.myAllergiesList.remove(allergy.first);
widget.myAllergiesList!.remove(allergy.first);
});
}
setState(() {
@ -152,8 +132,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
}
}
openAllergiesList(
BuildContext context, Function changeParentState, removeAllergy) {
openAllergiesList(BuildContext context, Function changeParentState, removeAllergy) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
@ -172,24 +151,26 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
});
if (isAllDataFilled) {
mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere(
(it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
if ((
widget.myAllergiesList!.singleWhere(
(it) => it.selectedAllergy!.id == element.selectedAllergy!.id,
orElse: () => MySelectedAllergy(),
),
) ==
null) {
widget.myAllergiesList.add(element);
widget.myAllergiesList!.add(element);
}
});
/// remove items.
List<MySelectedAllergy> removedList = [];
widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere(
(it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
widget.myAllergiesList!.forEach((element) {
if ((
mySelectedAllergy.singleWhere(
(it) => it.selectedAllergy!.id == element.selectedAllergy!.id,
orElse: () => MySelectedAllergy(),
),
) ==
null) {
removedList.add(element);
}
@ -201,8 +182,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
changeParentState();
Navigator.of(context).pop();
} else {
Utils.showErrorToast(
TranslationBase.of(context).requiredMsg);
Utils.showErrorToast(TranslationBase.of(context).requiredMsg);
}
});
});

@ -7,14 +7,14 @@ import '../medication/update_medication_widget.dart';
class UpdateChiefComplaints extends StatelessWidget {
const UpdateChiefComplaints({
Key key,
@required this.formKey,
@required this.complaintsController,
@required this.illnessController,
@required this.medicationController,
this.complaintsControllerError,
this.illnessControllerError,
this.medicationControllerError,
Key? key,
required this.formKey,
required this.complaintsController,
required this.illnessController,
required this.medicationController,
this.complaintsControllerError = '',
this.illnessControllerError = '',
this.medicationControllerError = '',
}) : super(key: key);
final GlobalKey<FormState> formKey;
@ -41,9 +41,7 @@ class UpdateChiefComplaints extends StatelessWidget {
minLines: 7,
hasBorder: true,
inputType: TextInputType.multiline,
validationError: complaintsControllerError != ''
? complaintsControllerError
: null,
validationError: complaintsControllerError != '' ? complaintsControllerError : "",
),
SizedBox(
height: 20,
@ -56,8 +54,7 @@ class UpdateChiefComplaints extends StatelessWidget {
maxLines: 25,
minLines: 7,
hasBorder: true,
validationError:
illnessControllerError != '' ? illnessControllerError : null,
validationError: illnessControllerError != '' ? illnessControllerError : "",
),
SizedBox(
height: 10,
@ -75,9 +72,7 @@ class UpdateChiefComplaints extends StatelessWidget {
minLines: 7,
hasBorder: true,
inputType: TextInputType.multiline,
validationError: medicationControllerError != ''
? medicationControllerError
: null,
validationError: medicationControllerError != '' ? medicationControllerError : "",
),
SizedBox(
height: 10,

@ -16,20 +16,13 @@ import '../../shared_soap_widgets/bottom_sheet_title.dart';
import 'priority_bar.dart';
class AddHistoryDialog extends StatefulWidget {
final Function changePageViewIndex;
final PageController controller;
final List<MySelectedHistory> myHistoryList;
final Function addSelectedHistories;
final Function(MasterKeyModel) removeHistory;
final Function? changePageViewIndex;
final PageController? controller;
final List<MySelectedHistory>? myHistoryList;
final Function? addSelectedHistories;
final Function(MasterKeyModel)? removeHistory;
const AddHistoryDialog(
{Key key,
this.changePageViewIndex,
this.controller,
this.myHistoryList,
this.addSelectedHistories,
this.removeHistory})
: super(key: key);
const AddHistoryDialog({Key? key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) : super(key: key);
@override
_AddHistoryDialogState createState() => _AddHistoryDialogState();
@ -58,8 +51,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar:
BottomSheetTitle(title: TranslationBase.of(context).addHistory),
appBar: BottomSheetTitle(title: TranslationBase.of(context).addHistory),
body: Center(
child: Container(
child: Column(
@ -68,7 +60,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
widget.changePageViewIndex!(activePriority);
}),
SizedBox(
height: 20,
@ -91,7 +83,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
masterList: model.historyFamilyList,
removeHistory: (history) {
setState(() {
widget.removeHistory(history);
widget.removeHistory!(history);
});
},
addHistory: (history) {
@ -100,21 +92,19 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
});
},
addSelectedHistories: () {
widget.addSelectedHistories();
widget.addSelectedHistories!();
},
isServiceSelected: (master) =>
isServiceSelected(master),
isServiceSelected: (master) => isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model
.mergeHistorySurgicalWithHistorySportList,
masterList: model.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history) {
setState(() {
widget.removeHistory(history);
widget.removeHistory!(history);
});
},
addHistory: (history) {
@ -123,10 +113,9 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
});
},
addSelectedHistories: () {
widget.addSelectedHistories();
widget.addSelectedHistories!();
},
isServiceSelected: (master) =>
isServiceSelected(master),
isServiceSelected: (master) => isServiceSelected(master),
),
),
NetworkBaseView(
@ -136,7 +125,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
masterList: model.historyMedicalList,
removeHistory: (history) {
setState(() {
widget.removeHistory(history);
widget.removeHistory!(history);
});
},
addHistory: (history) {
@ -145,10 +134,9 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
});
},
addSelectedHistories: () {
widget.addSelectedHistories();
widget.addSelectedHistories!();
},
isServiceSelected: (master) =>
isServiceSelected(master),
isServiceSelected: (master) => isServiceSelected(master),
),
),
],
@ -168,7 +156,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
: CustomBottomSheetContainer(
label: TranslationBase.of(context).addSelectedHistories,
onTap: () {
widget.addSelectedHistories();
widget.addSelectedHistories!();
},
),
),
@ -176,21 +164,13 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}
createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList
.where((element) =>
history.id == element.selectedHistory.id &&
history.typeId == element.selectedHistory.typeId)
.toList();
List<MySelectedHistory> myhistory = widget.myHistoryList!.where((element) => history.id == element.selectedHistory!.id && history.typeId == element.selectedHistory!.typeId).toList();
if (myhistory.isEmpty) {
setState(() {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
remark: history.remarks ?? "",
history: history,
isChecked: true);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(remark: history.remarks ?? "", history: history, isChecked: true);
widget.myHistoryList.add(mySelectedHistory);
widget.myHistoryList!.add(mySelectedHistory);
});
} else {
myhistory.first.isChecked = true;
@ -198,11 +178,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedHistory> history = widget.myHistoryList.where(
(element) =>
masterKey.id == element.selectedHistory.id &&
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
Iterable<MySelectedHistory> history =
widget.myHistoryList!.where((element) => masterKey.id == element.selectedHistory!.id && masterKey.typeId == element.selectedHistory!.typeId && element.isChecked!);
if (history.length > 0) {
return true;
}

@ -6,9 +6,9 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class PriorityBar extends StatefulWidget {
final Function onTap;
final Function? onTap;
const PriorityBar({Key key, this.onTap}) : super(key: key);
const PriorityBar({Key? key, this.onTap}) : super(key: key);
@override
_PriorityBarState createState() => _PriorityBarState();
@ -28,8 +28,7 @@ class _PriorityBarState extends State<PriorityBar> {
"طبي",
];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration();
}
@ -58,19 +57,13 @@ class _PriorityBarState extends State<PriorityBar> {
children: [
Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
decoration: containerBorderDecoration(_isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
(projectViewModel.isArabic)
? _prioritiesAr[index]
: item,
(projectViewModel.isArabic) ? _prioritiesAr[index] : item,
textAlign: TextAlign.center,
style: TextStyle(
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Colors.black,
fontWeight: FontWeight.bold,
),
@ -87,7 +80,7 @@ class _PriorityBarState extends State<PriorityBar> {
),
),
onTap: () {
widget.onTap(_priorities.indexOf(item));
widget.onTap!(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);

@ -12,20 +12,19 @@ import '../../shared_soap_widgets/SOAP_open_items.dart';
import 'add_history_dialog.dart';
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, this.myHistoryList}) : super(key: key);
@override
_UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState();
}
class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
with TickerProviderStateMixin {
PageController _controller;
class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerProviderStateMixin {
PageController? _controller;
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
_controller!.jumpToPage(pageIndex);
}
@override
@ -52,7 +51,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myHistoryList.map((myHistory) {
children: widget.myHistoryList!.map((myHistory) {
return Column(
children: [
Row(
@ -60,23 +59,18 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
children: [
Container(
child: AppText(
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
projectViewModel.isArabic ? myHistory.selectedHistory!.nameAr! : myHistory.selectedHistory!.nameEn!,
textDecoration: myHistory.isChecked! ? TextDecoration.none : TextDecoration.lineThrough,
color: Color(0xFF2B353E),
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
width: MediaQuery.of(context).size.width * 0.5,
),
if (myHistory.isChecked)
if (myHistory.isChecked!)
RemoveButton(
onTap: () => removeHistory(myHistory.selectedHistory),
onTap: () => removeHistory(myHistory.selectedHistory!),
)
],
),
@ -95,16 +89,12 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
removeHistory(MasterKeyModel historyKey) {
List<MySelectedHistory> history =
// ignore: missing_return
widget.myHistoryList
.where((element) =>
historyKey.id == element.selectedHistory.id &&
historyKey.typeId == element.selectedHistory.typeId)
.toList();
widget.myHistoryList!.where((element) => historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId).toList();
if (history.length > 0) {
if (history.first.isLocal) {
if (history.first.isLocal!) {
setState(() {
widget.myHistoryList.remove(history.first);
widget.myHistoryList!.remove(history.first);
});
} else {
setState(() {

@ -23,30 +23,28 @@ import '../../shared_soap_widgets/bottom_sheet_title.dart';
// ignore: must_be_immutable
class AddMedication extends StatefulWidget {
final Function addMedicationFun;
TextEditingController medicationController;
final Function? addMedicationFun;
TextEditingController? medicationController;
AddMedication({Key key, this.addMedicationFun, this.medicationController})
: super(key: key);
AddMedication({Key? key, this.addMedicationFun, this.medicationController}) : super(key: key);
@override
_AddMedicationState createState() => _AddMedicationState();
}
class _AddMedicationState extends State<AddMedication> {
MasterKeyModel _selectedMedicationDose;
MasterKeyModel _selectedMedicationStrength;
MasterKeyModel _selectedMedicationRoute;
MasterKeyModel _selectedMedicationFrequency;
MasterKeyModel _selectedMedicationDose = MasterKeyModel();
MasterKeyModel _selectedMedicationStrength = MasterKeyModel();
MasterKeyModel _selectedMedicationRoute = MasterKeyModel();
MasterKeyModel _selectedMedicationFrequency = MasterKeyModel();
TextEditingController doseController = TextEditingController();
TextEditingController strengthController = TextEditingController();
TextEditingController routeController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
GetMedicationResponseModel _selectedMedication;
GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel();
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false;
@override
@ -65,359 +63,248 @@ class _AddMedicationState extends State<AddMedication> {
),
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 10,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 2
: SizeConfig.isHeightShort
? 2
: SizeConfig.isHeightShort
? 2
: 2),
),
Container(
// height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allMedicationList != null
? () {
setState(() {
_selectedMedication = null;
});
}
: null,
child: _selectedMedication == null
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted &&
_selectedMedication == null,
child: AutoCompleteTextField<
GetMedicationResponseModel>(
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
TranslationBase.of(
context)
.searchMedicineNameHere,
null,
true,
suffixIcon:
Icons.search),
itemSubmitted: (item) =>
setState(() =>
_selectedMedication =
item),
key: key,
suggestions:
model.allMedicationList,
itemBuilder: (context,
suggestion) =>
new Padding(
child: AppText(suggestion
.description +
'/' +
suggestion
.genericName),
padding: EdgeInsets.all(
8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion,
input) =>
suggestion.genericName.toLowerCase().startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(input
.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(input
.toLowerCase()),
),
)
: AppTextFieldCustom(
height:
Utils.getTextFieldHeight(),
hintText: _selectedMedication !=
null
? _selectedMedication
.description +
(' (${_selectedMedication.genericName} )')
: TranslationBase.of(context)
.searchMedicineNameHere,
minLines: 1,
maxLines: 1,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
enabled: false,
),
),
),
if (_selectedMedication != null)
Column(
children: [
SizedBox(
height: 3,
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.7,
child: AppText(
_selectedMedication.description +
(' (${_selectedMedication.genericName} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
: 2),
),
Container(
// height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allMedicationList != null
? () {
setState(() {
_selectedMedication = GetMedicationResponseModel();
});
}
: null,
child: _selectedMedication == null
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted && _selectedMedication == null,
child: AutoCompleteTextField<GetMedicationResponseModel>(
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() => _selectedMedication = item),
key: key,
suggestions: model.allMedicationList,
itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()),
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
hintText: _selectedMedication != null
? _selectedMedication.description! + (' (${_selectedMedication.genericName} )')
: TranslationBase.of(context).searchMedicineNameHere,
minLines: 1,
maxLines: 1,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
), onPressed: () { },),
enabled: false,
),
],
),
),
if (_selectedMedication != null)
Column(
children: [
SizedBox(
height: 3,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
enabled: false,
onClick: model.medicationDoseTimeList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list:
model.medicationDoseTimeList,
okText:
TranslationBase.of(context)
.ok,
selectedValue:
_selectedMedicationDose,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose =
selectedValue;
Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
_selectedMedication.description! + (' (${_selectedMedication.genericName} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
],
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
enabled: false,
onClick: model.medicationDoseTimeList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.medicationDoseTimeList,
okText: TranslationBase.of(context).ok,
selectedValue: _selectedMedicationDose,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose = selectedValue;
doseController
.text = projectViewModel
.isArabic
? _selectedMedicationDose
.nameAr
: _selectedMedicationDose
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).doseTime,
maxLines: 1,
minLines: 1,
isTextFieldHasSuffix: true,
controller: doseController,
validationError: isFormSubmitted &&
_selectedMedicationDose == null
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
enabled: false,
isTextFieldHasSuffix: true,
onClick: model.medicationStrengthList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list:
model.medicationStrengthList,
okText:
TranslationBase.of(context)
.ok,
selectedValue:
_selectedMedicationStrength,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength =
selectedValue;
doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! : _selectedMedicationDose.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: (){},
hintText: TranslationBase.of(context).doseTime,
maxLines: 1,
minLines: 1,
isTextFieldHasSuffix: true,
controller: doseController,
validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
enabled: false,
isTextFieldHasSuffix: true,
onClick: model.medicationStrengthList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.medicationStrengthList,
okText: TranslationBase.of(context).ok,
selectedValue: _selectedMedicationStrength,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength = selectedValue;
strengthController
.text = projectViewModel
.isArabic
? _selectedMedicationStrength
.nameAr
: _selectedMedicationStrength
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).strength,
maxLines: 1,
minLines: 1,
controller: strengthController,
validationError: isFormSubmitted &&
_selectedMedicationStrength == null
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 5,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
enabled: false,
isTextFieldHasSuffix: true,
onClick: model.medicationRouteList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationRouteList,
selectedValue:
_selectedMedicationRoute,
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationRoute =
selectedValue;
strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr! : _selectedMedicationStrength.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: (){},
hintText: TranslationBase.of(context).strength,
maxLines: 1,
minLines: 1,
controller: strengthController,
validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 5,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
enabled: false,
isTextFieldHasSuffix: true,
onClick: model.medicationRouteList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.medicationRouteList,
selectedValue: _selectedMedicationRoute,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationRoute = selectedValue;
routeController
.text = projectViewModel
.isArabic
? _selectedMedicationRoute
.nameAr
: _selectedMedicationRoute
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).route,
maxLines: 1,
minLines: 1,
controller: routeController,
validationError: isFormSubmitted &&
_selectedMedicationRoute == null
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 5,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.medicationFrequencyList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list:
model.medicationFrequencyList,
okText:
TranslationBase.of(context)
.ok,
selectedValue:
_selectedMedicationFrequency,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationFrequency =
selectedValue;
routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr! : _selectedMedicationRoute.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: (){},
hintText: TranslationBase.of(context).route,
maxLines: 1,
minLines: 1,
controller: routeController,
validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: 5,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.medicationFrequencyList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.medicationFrequencyList,
okText: TranslationBase.of(context).ok,
selectedValue: _selectedMedicationFrequency,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationFrequency = selectedValue;
frequencyController
.text = projectViewModel
.isArabic
? _selectedMedicationFrequency
.nameAr
: _selectedMedicationFrequency
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).frequency,
enabled: false,
maxLines: 1,
minLines: 1,
isTextFieldHasSuffix: true,
controller: frequencyController,
validationError: isFormSubmitted &&
_selectedMedicationFrequency == null
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
],
frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr! : _selectedMedicationFrequency.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: (){},
hintText: TranslationBase.of(context).frequency,
enabled: false,
maxLines: 1,
minLines: 1,
isTextFieldHasSuffix: true,
controller: frequencyController,
validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : "",
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
)),
),
]),
],
),
)),
),
]),
),
),
bottomSheet: model.state != ViewState.Idle
@ -435,8 +322,7 @@ class _AddMedicationState extends State<AddMedication> {
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text = widget
.medicationController.text +
widget.medicationController!.text = widget.medicationController!.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop();
}

@ -6,10 +6,10 @@ import '../../shared_soap_widgets/SOAP_open_items.dart';
import 'add_medication.dart';
class UpdateMedicationWidget extends StatefulWidget {
final TextEditingController medicationController;
final TextEditingController? medicationController;
UpdateMedicationWidget({
Key key,
Key? key,
this.medicationController,
});

@ -20,24 +20,18 @@ import 'cheif_complaints/update_Chief_complaints.dart';
import 'history/update_history_widget.dart';
class UpdateSubjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final PatiantInformtion patientInfo;
final int currentIndex;
final Function? changePageViewIndex;
final Function? changeLoadingState;
final PatiantInformtion? patientInfo;
final int? currentIndex;
UpdateSubjectivePage(
{Key key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
UpdateSubjectivePage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
@override
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
}
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
implements SubjectiveCallBack {
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements SubjectiveCallBack {
bool isChiefExpand = false;
bool isHistoryExpand = false;
bool isAllergiesExpand = false;
@ -50,70 +44,46 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
List<MySelectedHistory> myHistoryList = [];
getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true);
widget.changeLoadingState!(true);
if (model.patientHistoryList.isNotEmpty) {
model.patientHistoryList.forEach((element) {
if (element.historyType ==
MasterKeysService.HistoryFamily.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
MasterKeysService.HistoryMedical.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
MasterKeysService.HistorySports.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
MasterKeysService.HistorySurgical.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
@ -124,17 +94,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
getAllergies(SOAPViewModel model) async {
if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity;
if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel(
id: 0,
typeId: MasterKeysService.AllergySeverity.getMasterKeyService(),
nameAr: '',
nameEn: '');
selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
} else {
selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
@ -142,17 +105,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
);
}
MySelectedAllergy mySelectedAllergy =
SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy,
isChecked: element.isChecked,
createdBy: element.createdBy,
remark: element.remarks,
isLocal: false,
allergySeverity: selectedAllergySeverity);
MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy!, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null)
myAllergiesList.add(mySelectedAllergy);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
});
}
}
@ -164,26 +120,23 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
myAllergiesList.clear();
myHistoryList.clear();
model.setSubjectiveCallBack(this);
await model.onUpdateSubjectStepStart(widget.patientInfo);
await model.onUpdateSubjectStepStart(widget.patientInfo!);
if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true;
complaintsController.text = Utils.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text =
!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
? model.patientChiefComplaintList[0].currentMedication +
'\n \n'
: model.patientChiefComplaintList[0].currentMedication;
complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!);
illnessController.text = model.patientChiefComplaintList[0].hopi!;
medicationController.text = !(model.patientChiefComplaintList[0].currentMedication)!.isNotEmpty
? model.patientChiefComplaintList[0].currentMedication! + '\n \n'
: model.patientChiefComplaintList[0].currentMedication!;
}
if (widget.patientInfo.admissionNo == null) {
if (widget.patientInfo!.admissionNo == null) {
await getHistory(model);
await getAllergies(model);
}
widget.changeLoadingState(false);
widget.changeLoadingState!(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
@ -214,19 +167,16 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
complaintsController: complaintsController,
illnessController: illnessController,
medicationController: medicationController,
complaintsControllerError:
model.complaintsControllerError,
complaintsControllerError: model.complaintsControllerError,
illnessControllerError: model.illnessControllerError,
medicationControllerError:
model.medicationControllerError,
medicationControllerError: model.medicationControllerError,
),
isExpanded: isChiefExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 4 : 2),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
),
if (widget.patientInfo.admissionNo == null)
if (widget.patientInfo!.admissionNo == null)
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).histories,
isRequired: false,
@ -236,17 +186,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
});
},
child: Column(
children: [
UpdateHistoryWidget(myHistoryList: myHistoryList)
],
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
),
isExpanded: isHistoryExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 4 : 2),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
),
if (widget.patientInfo.admissionNo == null)
if (widget.patientInfo!.admissionNo == null)
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).allergiesSoap,
isRequired: false,
@ -268,8 +215,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
isExpanded: isAllergiesExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 20 : 10),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10),
),
],
),
@ -280,20 +226,16 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
);
}
addSubjectiveInfo(
{SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MySelectedHistory> myHistoryList}) async {
addSubjectiveInfo({SOAPViewModel? model, List<MySelectedAllergy>? myAllergiesList, List<MySelectedHistory>? myHistoryList}) async {
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
widget.changeLoadingState(true);
formKey.currentState.save();
formKey.currentState.validate();
widget.changeLoadingState!(true);
formKey.currentState!.save();
formKey.currentState!.validate();
model.complaintsControllerError = '';
model!.complaintsControllerError = '';
model.medicationControllerError = '';
model.illnessControllerError = '';
if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty) {
if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty) {
await model.postSubjectServices(
patientInfo: widget.patientInfo,
complaintsText: complaintsController.text,
@ -303,38 +245,31 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
myAllergiesList: myAllergiesList,
);
widget.changeLoadingState(true);
widget.changeLoadingState!(true);
widget.changePageViewIndex(1);
widget.changePageViewIndex!(1);
} else {
setState(() {
if (complaintsController.text.isEmpty) {
model.complaintsControllerError =
TranslationBase.of(context).emptyMessage;
model.complaintsControllerError = TranslationBase.of(context).emptyMessage;
}
if (illnessController.text.isEmpty) {
model.illnessControllerError =
TranslationBase.of(context).emptyMessage;
model.illnessControllerError = TranslationBase.of(context).emptyMessage;
}
if (medicationController.text.isEmpty) {
model.medicationControllerError =
TranslationBase.of(context).emptyMessage;
model.medicationControllerError = TranslationBase.of(context).emptyMessage;
}
});
widget.changeLoadingState(false);
Utils.showErrorToast(
TranslationBase.of(context).chiefComplaintErrorMsg);
widget.changeLoadingState!(false);
Utils.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
}
}
@override
Function nextFunction(model) {
addSubjectiveInfo(
model: model,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList);
return addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
}
}

@ -21,22 +21,21 @@ import 'plan/update_plan_page.dart';
class UpdateSoapIndex extends StatefulWidget {
final bool isUpdate;
const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key);
const UpdateSoapIndex({Key? key, this.isUpdate = false}) : super(key: key);
@override
_UpdateSoapIndexState createState() => _UpdateSoapIndexState();
}
class _UpdateSoapIndexState extends State<UpdateSoapIndex>
with TickerProviderStateMixin {
PageController _controller;
class _UpdateSoapIndexState extends State<UpdateSoapIndex> with TickerProviderStateMixin {
PageController? _controller;
int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList = [];
List<MySelectedHistory> myHistoryList = [];
changePageViewIndex(pageIndex, {isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
_controller.jumpToPage(pageIndex);
_controller!.jumpToPage(pageIndex);
setState(() {
_currentIndex = pageIndex;
});
@ -63,7 +62,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
@override
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'];
return BaseView<SOAPViewModel>(
builder: (_, model, w) => AppScaffold(
@ -75,9 +74,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
boxShadow: <BoxShadow>[],
color: Theme.of(context).scaffoldBackgroundColor),
decoration: BoxDecoration(boxShadow: <BoxShadow>[], color: Theme.of(context).scaffoldBackgroundColor),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -95,21 +92,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateSubjectivePage(changePageViewIndex: changePageViewIndex, currentIndex: _currentIndex, patientInfo: patient, changeLoadingState: changeLoadingState),
UpdateObjectivePage(changePageViewIndex: changePageViewIndex, currentIndex: _currentIndex, patientInfo: patient, changeLoadingState: changeLoadingState),
UpdateAssessmentPage(changePageViewIndex: changePageViewIndex, currentIndex: _currentIndex, patientInfo: patient, changeLoadingState: changeLoadingState),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
@ -138,8 +123,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort ? 12 : 10),
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 12 : 10),
width: double.infinity,
child: Column(
children: [
@ -147,9 +131,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: getBottomSheet(model, patient)),
child: FractionallySizedBox(widthFactor: .80, child: getBottomSheet(model, patient)),
),
SizedBox(
height: 5,
@ -169,7 +151,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
color: Colors.red[700]!,
onPressed: () async {
model.nextOnSubjectPage(model);
},
@ -185,7 +167,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
color: Colors.grey[300]!,
// height: SizeConfig.heightMultiplier! *
// (SizeConfig.isHeightVeryShort ? 8 : 6),
// padding: 10,
@ -201,13 +183,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
),
Expanded(
child: AppButton(
title: patient.admissionNo != null &&
patient.admissionNo.isNotEmpty &&
!model.isAddExamInProgress
? TranslationBase.of(context).finish
: TranslationBase.of(context).next,
title: patient.admissionNo != null && patient.admissionNo!.isNotEmpty && !model.isAddExamInProgress ? TranslationBase.of(context).finish : TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
color: Colors.red[700]!,
// height: SizeConfig.heightMultiplier! *
// (SizeConfig.isHeightVeryShort ? 8 : 6),
// padding: 10,
@ -230,7 +208,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
color: Colors.grey[300]!,
fontColor: Colors.black,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
@ -246,8 +224,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
color: Colors.red[700]!,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
model.nextOnAssessmentPage(model);
@ -267,7 +244,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
color: Colors.grey[300]!,
fontColor: Colors.black,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
@ -281,12 +258,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
),
Expanded(
child: AppButton(
title: model.isAddProgress
? TranslationBase.of(context).next
: TranslationBase.of(context).finish,
title: model.isAddProgress ? TranslationBase.of(context).next : TranslationBase.of(context).finish,
fontWeight: FontWeight.w600,
color: Colors.red[700],
color: Colors.red[700]!,
disabled: model.progressNoteText.isEmpty,
onPressed: () async {
model.nextOnPlanPage(model);
@ -299,5 +273,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
}
break;
}
return SizedBox();
}
}

@ -7,10 +7,10 @@ import 'package:intl/intl.dart';
class LineChartCurved extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries;
final List<TimeSeriesSales2>? timeSeries;
final int indexes;
LineChartCurved({this.title, this.timeSeries, this.indexes});
LineChartCurved({this.title = '', this.timeSeries, this.indexes = 0});
List<int> xAxixs = [];
List<double> yAxixs = [];
@ -46,7 +46,7 @@ class LineChartCurved extends StatelessWidget {
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textAlign: TextAlign.center,
@ -62,7 +62,7 @@ class LineChartCurved extends StatelessWidget {
padding: const EdgeInsets.only(right: 18.0, left: 16.0),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
),
),
),
@ -78,110 +78,97 @@ class LineChartCurved extends StatelessWidget {
}
getXaxix() {
for (int index = 0; index < timeSeries.length; index++) {
for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries.length) {
if (mIndex < timeSeries!.length) {
xAxixs.add(mIndex);
}
}
}
getYaxix() {
int indexess = (timeSeries.length * 0.30).toInt();
for (int index = 0; index < timeSeries.length; index++) {
int indexess = (timeSeries!.length * 0.30).toInt();
for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexess * index;
if (mIndex < timeSeries.length) {
yAxixs.add(timeSeries[mIndex].sales);
if (mIndex < timeSeries!.length) {
yAxixs.add(timeSeries![mIndex].sales!);
}
}
}
LineChartData sampleData1(context) {
return LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (LineTouchResponse touchResponse) {},
touchCallback: (event, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (context, value) {
return TextStyle(
color: Colors.black,
fontSize: 10,
);
},
rotateAngle: -65,
//rotateAngle:-65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) {
DateTime dateTime = timeSeries[value.toInt()].time;
if (isDatesSameYear) {
return monthFormat.format(dateTime);
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
//rotateAngle: -65,
//rotateAngle:-65,
reservedSize: 22,
getTitlesWidget: (value, meta) {
if (timeSeries!.length < 15) {
if (timeSeries!.length > value.toInt()) {
DateTime dateTime = timeSeries![value.toInt()].time;
if (isDatesSameYear) {
return Text(
monthFormat.format(dateTime),
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else {
return Text(
yearFormat.format(dateTime),
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
} else {
return yearFormat.format(dateTime);
return Text('');
}
} else {
return '';
}
} else {
if (value.toInt() == 0 ||
value.toInt() == timeSeries.length - 1 ||
xAxixs.contains(value.toInt())) {
DateTime dateTime = timeSeries[value.toInt()].time;
if (isDatesSameYear) {
return monthFormat.format(dateTime);
} else {
return yearFormat.format(dateTime);
if (value.toInt() == 0 || value.toInt() == timeSeries!.length - 1 || xAxixs.contains(value.toInt())) {
DateTime dateTime = timeSeries![value.toInt()].time;
if (isDatesSameYear) {
return Text(
monthFormat.format(dateTime),
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else {
return Text(
yearFormat.format(dateTime),
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
}
}
}
/*if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) {
DateTime dateTime = timeSeries[value.toInt()].time;
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
}
}*/
return '';
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval:getInterval(),
// getTitles: (value) {
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
// return '';
// },
margin: 12,
return Text('');
},
),
),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
interval: getInterval(),
reservedSize: 12,
)),
),
borderData: FlBorderData(
show: true,
@ -202,7 +189,7 @@ class LineChartCurved extends StatelessWidget {
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxX: (timeSeries!.length - 1).toDouble(),
maxY: getMaxY() + getInterval(),
minY: 0,
lineBarsData: getData(context),
@ -230,21 +217,18 @@ class LineChartCurved extends StatelessWidget {
// return value.toDouble();
// }
double getInterval(){
double getInterval() {
return getMaxY() - getMinY() <= 100
? 20
: getMaxY() - getMinY() <= 1000
? 100
: 200;
? 100
: 200;
}
double getMaxY() {
double max = 0;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
timeSeries!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble;
});
@ -252,9 +236,9 @@ class LineChartCurved extends StatelessWidget {
}
double getMinY() {
double min = timeSeries[0].sales;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
double min = timeSeries![0].sales!;
timeSeries!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble;
});
int value = min.toInt();
@ -266,20 +250,18 @@ class LineChartCurved extends StatelessWidget {
List<FlSpot> spots = [];
isDatesSameYear = true;
int previousDateYear = 0;
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
if (isDatesSameYear == false ||
(previousDateYear != 0 &&
previousDateYear != timeSeries[index].time.year)) {
for (int index = 0; index < timeSeries!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries![index].sales!));
if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries![index].time.year)) {
isDatesSameYear = false;
}
previousDateYear = timeSeries[index].time.year;
previousDateYear = timeSeries![index].time.year;
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Colors.red] /*[Theme.of(context).primaryColor]*/,
color: Colors.red /*[Theme.of(context).primaryColor]*/,
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(

@ -7,17 +7,12 @@ import 'package:flutter/material.dart';
class LineChartCurvedBloodPressure extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2;
final List<TimeSeriesSales2>? timeSeries1;
final List<TimeSeriesSales2>? timeSeries2;
final int indexes;
final bool isOX;
LineChartCurvedBloodPressure(
{this.title,
this.timeSeries1,
this.indexes,
this.timeSeries2,
this.isOX = false});
LineChartCurvedBloodPressure({this.title = '', this.timeSeries1, this.indexes = 0, this.timeSeries2, this.isOX = false});
List<int> xAxixs = [];
List<double> yAxixs = [];
@ -45,7 +40,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textAlign: TextAlign.center,
@ -58,11 +53,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
),
Expanded(
child: Padding(
padding:
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
),
),
),
@ -78,15 +72,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Theme.of(context).primaryColor),
decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor),
),
SizedBox(
width: 5,
),
AppText(
isOX ? "SAO2" : TranslationBase.of(context).systolicLng)
AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng)
],
),
SizedBox(
@ -97,8 +88,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle, color: Colors.red),
decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red),
),
SizedBox(
width: 5,
@ -117,9 +107,9 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
}
getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) {
for (int index = 0; index < timeSeries1!.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries1.length) {
if (mIndex < timeSeries1!.length) {
xAxixs.add(mIndex);
}
}
@ -131,54 +121,73 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (LineTouchResponse touchResponse) {},
touchCallback: (event, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTextStyles: (context, value) {
return TextStyle(
color: Colors.black,
fontSize: 10,
);
},
rotateAngle: -65,
//rotateAngle: -65,
//rotateAngle:-65,
margin: 22,
getTitles: (value) {
if (timeSeries1.length < 15) {
if (timeSeries1.length > value.toInt()) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
reservedSize: 22,
getTitlesWidget: (value, meta) {
if (timeSeries1!.length < 15) {
if (timeSeries1!.length > value.toInt()) {
return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else
return '';
return Text("");
} else {
if (value.toInt() == 0)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (value.toInt() == timeSeries1!.length - 1)
return Text('${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
));
if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}
}
return '';
return Text("");
},
),
leftTitles: SideTitles(
)),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval:getInterval(),
getTitles: (value) {
return '${value.toInt()}';
interval: getInterval(),
getTitlesWidget: (value, meta) {
return Text(
'${value.toInt()}',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
);
},
margin: 12,
),
reservedSize: 12,
)),
),
borderData: FlBorderData(
show: true,
@ -200,28 +209,24 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
),
minX: 0,
maxX: 0,
maxY: getMaxY() + getInterval(),
maxY: getMaxY() + getInterval(),
minY: 0,
lineBarsData: getData(context),
);
}
double getInterval(){
double getInterval() {
return getMaxY() - getMinY() <= 100
? 20
: getMaxY() - getMinY() <= 1000
? 100
: 200;
? 100
: 200;
}
double getMaxY() {
double max = 0;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble > max) max = resultValueDouble;
});
@ -229,15 +234,16 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
}
double getMinY() {
double min = timeSeries1[0].sales;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
double min = timeSeries1![0].sales!;
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales!;
if (resultValueDouble < min) min = resultValueDouble;
});
int value = min.toInt();
return value.toDouble();
}
// double getMaxY() {
// double max = 0;
// timeSeries1.forEach((element) {
@ -270,19 +276,19 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
List<LineChartBarData> getData(context) {
List<FlSpot> spots = [];
for (int index = 0; index < timeSeries1.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
for (int index = 0; index < timeSeries1!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!));
}
List<FlSpot> spots2 = [];
for (int index = 0; index < timeSeries2.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
for (int index = 0; index < timeSeries2!.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales!));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Theme.of(context).primaryColor],
color: Theme.of(context).primaryColor,
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(
@ -295,7 +301,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2,
isCurved: true,
colors: [Colors.red],
color: Colors.red,
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(

@ -98,7 +98,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
TranslationBase.of(context)
.painScale,
fontSize:
SizeConfig.textMultiplier * 1.5,
SizeConfig.textMultiplier! * 1.5,
color: Color(0XFF28353E),
fontWeight: FontWeight.w600,
),
@ -112,7 +112,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize:
SizeConfig.textMultiplier *
SizeConfig.textMultiplier! *
1.3,
),
),
@ -128,7 +128,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
child: AppText(
"Location",
fontSize:
SizeConfig.textMultiplier * 1.5,
SizeConfig.textMultiplier! * 1.5,
color: Color(0XFF28353E),
fontWeight: FontWeight.w600,
),
@ -142,7 +142,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize:
SizeConfig.textMultiplier *
SizeConfig.textMultiplier! *
1.3,
),
),
@ -157,7 +157,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
child: AppText(
"Character",
fontSize:
SizeConfig.textMultiplier * 1.5,
SizeConfig.textMultiplier! * 1.5,
color: Color(0XFF28353E),
fontWeight: FontWeight.w600,
),
@ -171,7 +171,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize:
SizeConfig.textMultiplier *
SizeConfig.textMultiplier! *
1.3,
),
),
@ -186,7 +186,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
child: AppText(
"Duration",
fontSize:
SizeConfig.textMultiplier * 1.5,
SizeConfig.textMultiplier! * 1.5,
color: Color(0XFF28353E),
fontWeight: FontWeight.w600,
),
@ -200,7 +200,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize:
SizeConfig.textMultiplier *
SizeConfig.textMultiplier! *
1.3,
),
),
@ -216,7 +216,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
TranslationBase.of(context)
.painManagement,
fontSize:
SizeConfig.textMultiplier * 1.5,
SizeConfig.textMultiplier! * 1.5,
color: Color(0XFF28353E),
fontWeight: FontWeight.w600,
),
@ -230,7 +230,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize:
SizeConfig.textMultiplier *
SizeConfig.textMultiplier! *
1.3,
),
),
@ -245,7 +245,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
child: AppText(
"Frequency",
fontSize:
SizeConfig.textMultiplier * 1.5,
SizeConfig.textMultiplier! * 1.5,
color: Color(0XFF28353E),
fontWeight: FontWeight.w600,
),
@ -259,7 +259,7 @@ class VitalSignDetailPainScale extends StatelessWidget {
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize:
SizeConfig.textMultiplier *
SizeConfig.textMultiplier! *
1.3,
),
),
@ -281,13 +281,13 @@ class VitalSignDetailPainScale extends StatelessWidget {
"${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM")}",
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
),
AppText(
"${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "hh:mm a")}",
fontWeight: FontWeight.w700,
color: Color(0XFF28353E),
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),

@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class VitalSignBloodPressureWidget extends StatefulWidget {
final List<VitalSignHistory> vitalList;
final List<VitalSignHistory>? vitalList;
final String title1;
final String title2;
final String title3;
@ -17,13 +17,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget {
final String viewKey2;
VitalSignBloodPressureWidget(
{Key key,
{Key? key,
this.vitalList,
this.title1,
this.title2,
this.viewKey1,
this.title3,
this.viewKey2});
this.title1 = '' ,
this.title2 = '',
this.viewKey1 = '',
this.title3 = '',
this.viewKey2 = ''});
@override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -48,7 +48,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
padding: EdgeInsets.all(8),
child: AppText(
TranslationBase.of(context).date,
fontSize: SizeConfig.textMultiplier * 1.5,
fontSize: SizeConfig.textMultiplier! * 1.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -62,7 +62,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
child: Container(
child: AppText(
widget.title2,
fontSize: SizeConfig.textMultiplier * 1.5,
fontSize: SizeConfig.textMultiplier! * 1.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -76,7 +76,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
child: Container(
child: AppText(
widget.title3,
fontSize: SizeConfig.textMultiplier * 1.5,
fontSize: SizeConfig.textMultiplier! * 1.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -94,7 +94,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
Table(
border: TableBorder(
horizontalInside:
BorderSide(width: 1.0, color: Colors.grey[300]),
BorderSide(width: 1.0, color: Colors.grey[300]!),
),
children: fullData(projectViewModel),
),
@ -122,7 +122,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
height: 60),
),
]));*/
widget.vitalList.forEach((vital) {
widget.vitalList!.forEach((vital) {
var data = vital.toJson()[widget.viewKey1];
DateTime elementDate =
AppDateUtils.getDateTimeFromServerFormat(vital.createdOn);
@ -135,7 +135,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
child: AppText(
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}',
// textAlign: TextAlign.center,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
@ -149,7 +149,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
child: AppText(
'${vital.toJson()[widget.viewKey1]}',
// textAlign: TextAlign.center,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
@ -163,7 +163,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
child: AppText(
'${vital.toJson()[widget.viewKey2]}',
// textAlign: TextAlign.center,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',

@ -20,12 +20,11 @@ class VitalSignDetailsScreen extends StatelessWidget {
int projectID;
bool isNotOneAppointment;
VitalSignDetailsScreen(
{this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
VitalSignDetailsScreen({this.appointmentNo = 0, this.projectID = 0, this.isNotOneAppointment = true});
@override
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'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
@ -36,8 +35,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
String assetBasePath = "${imageBasePath}patient/vital_signs/";
return BaseView<VitalSignsViewModel>(
onModelReady: (model) =>
model.getPatientVitalSignHistory(patient, from, to, isInpatient),
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient),
builder: (_, mode, widget) => AppScaffold(
baseViewModel: mode,
isShowAppBar: true,
@ -59,13 +57,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
children: [
AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
AppText(
TranslationBase.of(context).vitalSign,
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
)
@ -76,8 +74,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.23,
width: double.infinity,
padding: EdgeInsets.all(12.0),
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
@ -93,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}",
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w700,
),
Row(
@ -101,17 +98,11 @@ class VitalSignDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 1
? '${assetBasePath}underweight_BMI.png'
: '${assetBasePath}underweight_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 1 ? '${assetBasePath}underweight_BMI.png' : '${assetBasePath}underweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -119,38 +110,26 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiUnderWeight}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontSize: SizeConfig.textMultiplier! * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.grey,
fontWeight: FontWeight.w700,
),
AppText(
"(<18.5)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontSize: SizeConfig.textMultiplier! * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.grey,
fontWeight: FontWeight.w700,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 2
? '${assetBasePath}health_BMI.png'
: '${assetBasePath}health_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 2 ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -159,40 +138,27 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText(
"${TranslationBase.of(context).normal}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier *
1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.grey,
),
),
AppText(
"(18.5-24.9)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.grey,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 3
? '${assetBasePath}ovrweight_BMI.png'
: '${assetBasePath}ovrweight_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 3 ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -200,38 +166,26 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiOverWeight}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.155,
fontSize: SizeConfig.textMultiplier! * 1.155,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.grey,
),
AppText(
"(25-29.9)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.155,
fontSize: SizeConfig.textMultiplier! * 1.155,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.grey,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 4
? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 4 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -239,38 +193,26 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiObese}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.grey,
),
AppText(
"(30-34.9)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.grey,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 5
? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 5 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -280,24 +222,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText(
"${TranslationBase.of(context).bmiObeseExtreme}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier *
1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.grey,
),
),
AppText(
"(35<)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier! * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.grey,
),
],
)),
@ -309,8 +244,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
Expanded(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 16),
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -326,16 +260,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Height,
pageTitle:
TranslationBase.of(
context)
.height,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Height,
pageTitle: TranslationBase.of(context).height,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -345,40 +273,28 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context)
.height,
imagePath:
"${assetBasePath}height.png",
des: TranslationBase.of(context).height,
imagePath: "${assetBasePath}height.png",
lastVal: mode.heightCm,
unit: TranslationBase.of(context)
.cm,
unit: TranslationBase.of(context).cm,
),
),
),
if (isNotOneAppointment)
InkWell(
onTap: () async {
await locator<AnalyticsService>()
.logEvent(
eventCategory:
"Vital Sign Details Screen",
eventAction:
"Vital Sign Details",
await locator<AnalyticsService>().logEvent(
eventCategory: "Vital Sign Details Screen",
eventAction: "Vital Sign Details",
);
Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey:
vitalSignDetails.Weight,
pageTitle:
TranslationBase.of(
context)
.weight,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Weight,
pageTitle: TranslationBase.of(context).weight,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -387,12 +303,9 @@ class VitalSignDetailsScreen extends StatelessWidget {
);
},
child: VitalSignItem(
des: TranslationBase.of(context)
.weight,
imagePath:
"${assetBasePath}weight.png",
unit: TranslationBase.of(context)
.kg,
des: TranslationBase.of(context).weight,
imagePath: "${assetBasePath}weight.png",
unit: TranslationBase.of(context).kg,
lastVal: mode.weightKg,
),
),
@ -401,16 +314,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Temperature,
pageTitle:
TranslationBase.of(
context)
.temperature,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Temperature,
pageTitle: TranslationBase.of(context).temperature,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -420,13 +327,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context)
.temperature,
imagePath:
"${assetBasePath}temperature.png",
des: TranslationBase.of(context).temperature,
imagePath: "${assetBasePath}temperature.png",
lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context)
.tempC,
unit: TranslationBase.of(context).tempC,
),
),
),
@ -435,16 +339,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.heart,
pageTitle:
TranslationBase.of(
context)
.heart,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.heart,
pageTitle: TranslationBase.of(context).heart,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -453,13 +351,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.heart,
imagePath:
"${assetBasePath}heart_rate.png",
des: TranslationBase.of(context).heart,
imagePath: "${assetBasePath}heart_rate.png",
lastVal: mode.hartRat,
unit:
TranslationBase.of(context).bpm,
unit: TranslationBase.of(context).bpm,
),
),
InkWell(
@ -467,16 +362,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Respiration,
pageTitle:
TranslationBase.of(
context)
.respirationRate,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Respiration,
pageTitle: TranslationBase.of(context).respirationRate,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -485,14 +374,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.respirationRate,
imagePath:
"${assetBasePath}respiration_rate.png",
lastVal:
mode.respirationBeatPerMinute,
unit: TranslationBase.of(context)
.respirationSigns,
des: TranslationBase.of(context).respirationRate,
imagePath: "${assetBasePath}respiration_rate.png",
lastVal: mode.respirationBeatPerMinute,
unit: TranslationBase.of(context).respirationSigns,
),
),
InkWell(
@ -500,16 +385,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.BloodPressure,
pageTitle:
TranslationBase.of(
context)
.bloodPressure,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.BloodPressure,
pageTitle: TranslationBase.of(context).bloodPressure,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -518,13 +397,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.bloodPressure,
imagePath:
"${assetBasePath}blood_pressure.png",
des: TranslationBase.of(context).bloodPressure,
imagePath: "${assetBasePath}blood_pressure.png",
lastVal: mode.bloodPressure,
unit: TranslationBase.of(context)
.sysDias,
unit: TranslationBase.of(context).sysDias,
),
),
InkWell(
@ -532,16 +408,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Oxygenation,
pageTitle:
TranslationBase.of(
context)
.oxygenation,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Oxygenation,
pageTitle: TranslationBase.of(context).oxygenation,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -550,10 +420,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.oxygenation,
imagePath:
"${assetBasePath}oxg.png",
des: TranslationBase.of(context).oxygenation,
imagePath: "${assetBasePath}oxg.png",
lastVal: "${mode.oxygenation}%",
unit: "",
),
@ -563,16 +431,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.PainScale,
pageTitle:
TranslationBase.of(
context)
.painScale,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.PainScale,
pageTitle: TranslationBase.of(context).painScale,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -581,13 +443,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.painScale,
imagePath:
"${assetBasePath}painScale.png",
des: TranslationBase.of(context).painScale,
imagePath: "${assetBasePath}painScale.png",
lastVal: mode.painScore,
unit: TranslationBase.of(context)
.severe,
unit: TranslationBase.of(context).severe,
),
),
],

@ -9,13 +9,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class VitalSignDetailsWidget extends StatefulWidget {
final List<VitalSignHistory> vitalList;
final List<VitalSignHistory>? vitalList;
final String title1;
final String title2;
final String viewKey;
VitalSignDetailsWidget(
{Key key, this.vitalList, this.title1, this.title2, this.viewKey});
{Key? key, this.vitalList, this.title1 = '', this.title2 = '', this.viewKey =''});
@override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -53,7 +53,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
),*/
child: AppText(
TranslationBase.of(context).date,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -74,7 +74,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
),*/
child: AppText(
widget.title2,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -92,7 +92,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
Table(
border: TableBorder(
horizontalInside:
BorderSide(width: 1.0, color: Colors.grey[300]),
BorderSide(width: 1.0, color: Colors.grey[300]!),
),
children: fullData(projectViewModel),
),
@ -107,7 +107,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
/* tableRow.add(TableRow(children: [
]));*/
widget.vitalList.forEach((vital) {
widget.vitalList!.forEach((vital) {
var data = vital.toJson()[widget.viewKey];
DateTime elementDate =
AppDateUtils.getDateTimeFromServerFormat(vital.createdOn);
@ -120,7 +120,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
child: AppText(
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}',
// textAlign: TextAlign.center,
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
@ -134,7 +134,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
child: AppText(
'${vital.toJson()[widget.viewKey]}',
// textAlign: TextAlign.center,
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',

@ -13,13 +13,13 @@ class VitalSignItem extends StatelessWidget {
final double width;
const VitalSignItem(
{Key key,
@required this.des,
{Key? key,
required this.des,
this.lastVal = 'N/A',
this.unit = '',
this.height,
this.width,
@required this.imagePath})
this.height = 0,
this.width = 0,
required this.imagePath})
: super(key: key);
@override
@ -50,7 +50,7 @@ class VitalSignItem extends StatelessWidget {
AppText(
"$lastVal",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.4,
fontSize: SizeConfig.textMultiplier! * 1.4,
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
margin: 0,
@ -61,7 +61,7 @@ class VitalSignItem extends StatelessWidget {
AppText(
"$unit",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.2,
fontSize: SizeConfig.textMultiplier! * 1.2,
fontWeight: FontWeight.w700,
color: Color(0xFFD02127),
margin: 0,
@ -100,7 +100,7 @@ class VitalSignItem extends StatelessWidget {
child: AppText(
"$des",
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.3,
fontSize: SizeConfig.textMultiplier! * 1.3,
fontWeight: FontWeight.bold,
),
),

@ -14,22 +14,22 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class VitalSignItemDetailsScreen extends StatelessWidget {
final vitalSignDetails pageKey;
final vitalSignDetails? pageKey;
final String pageTitle;
List<Map> VSchart;
PatiantInformtion patient;
List<Map>? VSchart;
PatiantInformtion? patient;
String patientType;
String arrivalType;
VitalSignItemDetailsScreen(
{this.vitalList,
this.pageKey,
this.pageTitle,
this.pageTitle = '',
this.patient,
this.patientType,
this.arrivalType});
this.patientType = '',
this.arrivalType = ''});
final List<VitalSignHistory> vitalList;
final List<VitalSignHistory>? vitalList;
@override
Widget build(BuildContext context) {
@ -191,7 +191,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
backgroundColor: Color.fromRGBO(248, 248, 248, 1),
isShowAppBar: true,
appBar: PatientProfileAppBar(
patient,
patient!,
),
body: SingleChildScrollView(
child: Column(
@ -203,15 +203,15 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
"${patient!.firstName ?? patient?.patientDetails?.firstName ?? patient!.fullName ?? ''}'s",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
TranslationBase.of(context).vitalSign,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold,
)
],
@ -221,20 +221,20 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
child: ListView(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
children: VSchart.map((chartInfo) {
var vitalListTemp = vitalList.where(
children: VSchart!.map((chartInfo) {
var vitalListTemp = vitalList!.where(
(element) => element.toJson()[chartInfo['viewKey']] != null,
);
if (chartInfo['viewKey'] == 'PainScore') {
return VitalSignDetailPainScale(vitalList);
return VitalSignDetailPainScale(vitalList!);
}
if (vitalListTemp.length != 0 &&
chartInfo['viewKey'] == 'BloodPressure' ||
chartInfo['viewKey'] == 'O2') {
return VitalSingChartBloodPressure(
vitalList: vitalList,
vitalList: vitalList!,
name: projectViewModel.isArabic
? chartInfo['nameAr']
: chartInfo['name'],
@ -256,7 +256,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
return vitalListTemp.length != 0
? VitalSingChartAndDetials(
vitalList: vitalList,
vitalList: vitalList!,
name: projectViewModel.isArabic
? chartInfo['nameAr']
: chartInfo['name'],

@ -11,12 +11,12 @@ import 'line_chart_curved.dart';
class VitalSingChartAndDetials extends StatelessWidget {
VitalSingChartAndDetials({
Key key,
@required this.vitalList,
@required this.name,
@required this.viewKey,
@required this.title1,
@required this.title2,
Key? key,
required this.vitalList,
required this.name,
required this.viewKey,
required this.title1,
required this.title2,
}) : super(key: key);
final List<VitalSignHistory> vitalList;
@ -57,7 +57,7 @@ class VitalSingChartAndDetials extends StatelessWidget {
children: [
AppText(
TranslationBase.of(context).graphDetails,
fontSize: SizeConfig.textMultiplier * 2.1,
fontSize: SizeConfig.textMultiplier! * 2.1,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),

@ -11,14 +11,14 @@ import 'line_chart_curved_blood_pressure.dart';
class VitalSingChartBloodPressure extends StatelessWidget {
VitalSingChartBloodPressure({
Key key,
@required this.vitalList,
@required this.name,
@required this.viewKey1,
@required this.viewKey2,
@required this.title1,
@required this.title2,
@required this.title3,
Key? key,
required this.vitalList,
required this.name,
required this.viewKey1,
required this.viewKey2,
required this.title1,
required this.title2,
required this.title3,
}) : super(key: key);
final List<VitalSignHistory> vitalList;
@ -64,7 +64,7 @@ class VitalSingChartBloodPressure extends StatelessWidget {
children: [
AppText(
TranslationBase.of(context).graphDetails,
fontSize: SizeConfig.textMultiplier * 2.3,
fontSize: SizeConfig.textMultiplier! * 2.3,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save