diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 1c09696b..ee9f981d 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -10,6 +10,8 @@ class LabResult { String projectID; String referanceRange; String resultValue; + String maxValue; + String minValue; String sampleCollectedOn; String sampleReceivedOn; String setupID; @@ -21,24 +23,26 @@ class LabResult { LabResult( {this.description, - this.femaleInterpretativeData, - this.gender, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.maxValue, + this.minValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResult.fromJson(Map json) { description = json['Description']; @@ -52,6 +56,8 @@ class LabResult { projectID = json['ProjectID'].toString(); referanceRange = json['ReferenceRange'] ?? json['ReferanceRange']; resultValue = json['ResultValue']; + maxValue = json['MaxValue']; + minValue = json['MinValue']; sampleCollectedOn = json['SampleCollectedOn']; sampleReceivedOn = json['SampleReceivedOn']; setupID = json['SetupID']; @@ -75,6 +81,8 @@ class LabResult { data['ProjectID'] = this.projectID; data['ReferanceRange'] = this.referanceRange; data['ResultValue'] = this.resultValue; + data['MaxValue'] = this.maxValue; + data['MinValue'] = this.minValue; data['SampleCollectedOn'] = this.sampleCollectedOn; data['SampleReceivedOn'] = this.sampleReceivedOn; data['SetupID'] = this.setupID; @@ -85,8 +93,29 @@ class LabResult { data['VerifiedOnDateTime'] = this.verifiedOnDateTime; return data; } -} + int checkResultStatus() { + try { + var max = double.tryParse(maxValue) ?? null; + var min = double.tryParse(minValue) ?? null; + var result = double.tryParse(resultValue) ?? null; + if (max != null && min != null && result != null) { + if (result > max) { + return 1; + } else if (result < min) { + return -1; + } else { + return 0; + } + } else { + return 0; + } + }catch (e){ + return 0; + } + + } +} class LabResultList { String filterName = ""; diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 22f53226..53fa257e 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -8,8 +8,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { - List patientChiefComplaintList = []; - List patientVitalSignsHistory = []; + List patientChiefComplaintList; + List patientVitalSignsHistory; List patientAssessmentList = []; List orderProcedureList = []; PrescriptionModel prescriptionList; @@ -17,15 +17,20 @@ class UcafService extends LookupService { Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientMRN ; + body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - body['EpisodeID'] = patient.episodeNo ; + body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; + patientChiefComplaintList = null; await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); - patientChiefComplaintList.clear(); + if (patientChiefComplaintList != null) { + patientChiefComplaintList.clear(); + } else { + patientChiefComplaintList = new List(); + } response['List_ChiefComplaint']['entityList'].forEach((v) { patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); }); @@ -47,10 +52,15 @@ class UcafService extends LookupService { body['InOutPatientType'] = 2; } + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); + if (patientVitalSignsHistory != null) { + patientVitalSignsHistory.clear(); + } else { + patientVitalSignsHistory = new List(); + } if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); @@ -79,10 +89,15 @@ class UcafService extends LookupService { body['From'] = fromDate; body['To'] = toDate; + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); + if (patientVitalSignsHistory != null) { + patientVitalSignsHistory.clear(); + } else { + patientVitalSignsHistory = new List(); + } if (response['VitalSignsHistory'] != null) { response['VitalSignsHistory'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 1dc34679..809c154f 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -45,12 +45,12 @@ class UcafViewModel extends BaseViewModel { String temperatureCelcius = "0"; String hartRat = "0"; String respirationBeatPerMinute = "0"; - String bloodPressure = "0 / 0"; + String bloodPressure = "0/0"; resetDataInFirst({bool firstPage = true}) { if(firstPage){ - _ucafService.patientVitalSignsHistory = []; - _ucafService.patientChiefComplaintList = []; + _ucafService.patientVitalSignsHistory = null; + _ucafService.patientChiefComplaintList = null; } _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index de5cc05f..66261292 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -88,10 +88,10 @@ class _DashboardSwipeWidgetState extends State { if (index == 1) return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, + shadowWidth: 0.1, + shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( @@ -100,10 +100,10 @@ class _DashboardSwipeWidgetState extends State { if (index == 0) return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, + shadowWidth: 0.1, + shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( @@ -112,10 +112,10 @@ class _DashboardSwipeWidgetState extends State { if (index == 2) return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, + shadowWidth: 0.1, + shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 9960a1b3..93bae074 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -71,7 +71,8 @@ class _UCAFInputScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - body: model.patientVitalSignsHistory.length > 0 && + body: model.patientVitalSignsHistory != null && + model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 ? Column( @@ -380,30 +381,33 @@ class _UCAFInputScreenState extends State { ), ], ) - : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, + : model.patientChiefComplaintList != null || + model.patientVitalSignsHistory != null + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context) + .chiefComplaintEmptyMsg, + fontWeight: FontWeight.normal, + textAlign: TextAlign.center, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - model.patientVitalSignsHistory.length == 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context) - .chiefComplaintEmptyMsg, - fontWeight: FontWeight.normal, - textAlign: TextAlign.center, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], - ), - ), + ) + : Container(), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index e1b5cfc0..6ca92a4a 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -163,6 +163,7 @@ class LabResultWidget extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ + if(patientLabResultList[index].checkResultStatus() != 0) Container( decoration: BoxDecoration( shape: BoxShape.circle, @@ -172,7 +173,7 @@ class LabResultWidget extends StatelessWidget { // ), ), child: Icon( - Icons.arrow_upward, + patientLabResultList[index].checkResultStatus() == 1 ? Icons.arrow_upward : Icons.arrow_downward, color: Colors.white, size: 16, ), diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index d9b9aae9..cfc26eee 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -141,7 +141,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { AppText( "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 ? Color(0xffc4aa54) @@ -155,7 +155,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], @@ -170,14 +170,14 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${referredPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -188,7 +188,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], @@ -208,7 +208,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -216,7 +216,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -231,7 +231,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -239,7 +239,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.frequencyDescription ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -284,7 +284,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -292,7 +292,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.priorityDescription ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -307,7 +307,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).maxResponseTime + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -318,7 +318,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { : '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -347,7 +347,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { width: 30, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { - return Text('No Image'); + return Text(''); }, )) : Container( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 6d573cc4..ff1cb256 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -158,7 +158,7 @@ class PatientReferralItemWidget extends StatelessWidget { patientID, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -188,7 +188,7 @@ class PatientReferralItemWidget extends StatelessWidget { : " " + referralClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -215,7 +215,7 @@ class PatientReferralItemWidget extends StatelessWidget { errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { - return Text('No Image'); + return Text(''); }, )) : SizedBox() @@ -239,7 +239,7 @@ class PatientReferralItemWidget extends StatelessWidget { remark ?? "", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), maxLines: 1, ), diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 8364bb79..9c622dd3 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -53,7 +53,7 @@ class _RoundedContainerState extends State { margin: widget.margin, decoration: widget.showBorder == true ? BoxDecoration( - color: Theme.of(context).primaryColor, + color: Colors.white/*Theme.of(context).primaryColor*/, border: Border.all( color: widget.borderColor, width: widget.borderWidth), borderRadius: widget.customCornerRaduis @@ -64,13 +64,15 @@ class _RoundedContainerState extends State { bottomLeft: Radius.circular(widget.bottomLeft)) : BorderRadius.circular(widget.raduis), boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(widget.shadowWidth), - spreadRadius: widget.shadowSpreadRadius, - blurRadius: 5, - offset: Offset(0, widget.shadowDy), // changes position of shadow - ), - ]) + BoxShadow( + color: Colors.grey.withOpacity(widget.shadowWidth), + spreadRadius: widget.shadowSpreadRadius, + blurRadius: 5, + offset: Offset( + 0, widget.shadowDy), // changes position of shadow + ), + ], + ) : null, child: Card( margin: EdgeInsets.all(0),