From ba68ad867962a821b147f6139b484ba4e869ede0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 1 Dec 2025 18:45:05 +0300 Subject: [PATCH 1/4] Code reverted to before IPD changes merged, Pharmacy intervention remarks added again, Update to Stores VersionID 10.3 --- lib/config/config.dart | 2 +- .../InterventionHistoryBottomSheet.dart | 25 +++++++++---------- .../widgets/intervention_history_item.dart | 2 +- .../translations_delegate_base_utils.dart | 1 + 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 29f954c3..fa83b9ae 100755 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -413,7 +413,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 10.2; +const VERSION_ID = 10.3; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart b/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart index 034d934d..39a4a5fa 100644 --- a/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart +++ b/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart @@ -54,21 +54,20 @@ class InterventionHistoryBottomSheet extends StatelessWidget { color: Colors.white, child: InterventionHistoryItem( interventionHistory: interventionList[index], - onAcceptClick: (intervention, remarks) { - model.updateInterventionDiseaseStatus( - remarks: remarks, - isAccepted: true, - interventionID: interventionList[index].interventionId.toString(), - successMessage: TranslationBase.of(context).interventionAcceptedSuccessfully, - errorMessage: TranslationBase.of(context).unableToPerformTheAction - ); + onAcceptClick: (intervention, remarks) { + model.updateInterventionDiseaseStatus( + remarks: remarks, + isAccepted: true, + interventionID: interventionList[index].interventionId.toString(), + successMessage: TranslationBase.of(context).interventionAcceptedSuccessfully, + errorMessage: TranslationBase.of(context).unableToPerformTheAction); Navigator.pop(context); }, - onRejectClick: (intervention, remarks) { - model.updateInterventionDiseaseStatus( - remarks: remarks, - interventionID: interventionList[index].interventionId.toString(), - successMessage: TranslationBase.of(context).interventionRejectedSuccessfully, + onRejectClick: (intervention, remarks) { + model.updateInterventionDiseaseStatus( + remarks: remarks, + interventionID: interventionList[index].interventionId.toString(), + successMessage: TranslationBase.of(context).interventionRejectedSuccessfully, errorMessage: TranslationBase.of(context).unableToPerformTheAction ); Navigator.pop(context); diff --git a/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart b/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart index 104a1f75..51cad620 100644 --- a/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart +++ b/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart @@ -20,7 +20,7 @@ class InterventionHistoryItem extends StatelessWidget { required this.interventionHistory, required this.onAcceptClick, required this.onRejectClick, - + }); @override diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index 9dff29c9..9e7fb92c 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -1999,6 +1999,7 @@ class TranslationBase { String get filterInPatient => localizedValues['filterInPatient']![locale.languageCode]!; String get remarksNotAdded => localizedValues['remarksNotAdded']![locale.languageCode]!; String get addDoctorRemarks => localizedValues['addDoctorRemarks']![locale.languageCode]!; + } class TranslationBaseDelegate extends LocalizationsDelegate { From 80207d59421219ca9851edd1a69e8ce0f9607b40 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 4 Dec 2025 16:46:08 +0300 Subject: [PATCH 2/4] Pharmacy intervention fixes --- lib/config/config.dart | 4 +- .../intervention_history.dart | 3 + lib/screens/patients/In_patient/NoData.dart | 2 +- .../patients/insurance_approvals_details.dart | 10 +- .../PharmacyIntervention.dart | 35 +++-- .../pharmacy_intervention_view_model.dart | 5 + .../InterventionHistoryBottomSheet.dart | 129 +++++++++--------- .../widgets/intervention_history_item.dart | 3 +- lib/utils/utils.dart | 13 +- 9 files changed, 110 insertions(+), 94 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index fa83b9ae..f3d92582 100755 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,7 +13,9 @@ const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/'; // const BASE_URL = 'http://10.20.200.111:1010/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; + +const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://webservices.hmg.com/'; // diff --git a/lib/core/model/pharmacy-intervention-model/intervention_history.dart b/lib/core/model/pharmacy-intervention-model/intervention_history.dart index 7c57fb3b..c3e872b9 100644 --- a/lib/core/model/pharmacy-intervention-model/intervention_history.dart +++ b/lib/core/model/pharmacy-intervention-model/intervention_history.dart @@ -1,3 +1,5 @@ +import 'package:flutter/cupertino.dart'; + class InterventionHistoryList{ List? history = []; InterventionHistoryList.fromJson(Map json){ @@ -19,6 +21,7 @@ class InterventionHistory { String? interventionDesc; int? interventionId; String? remark; + TextEditingController remarksController = TextEditingController(); InterventionHistory({ this.authizationFormText, diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 912c23cc..5c45a671 100644 --- a/lib/screens/patients/In_patient/NoData.dart +++ b/lib/screens/patients/In_patient/NoData.dart @@ -9,7 +9,7 @@ class NoData extends StatelessWidget { @override Widget build(BuildContext context) { - return Center( + return SingleChildScrollView( child: Container( child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable), ), diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 5066ace4..b355a9e7 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -436,9 +436,10 @@ class _InsuranceApprovalsDetailsState extends State { AppText('Sample') ], ), - Row( - children: [ - AppText( + model.insuranceApproval[indexInsurance].rceiptOn != null + ? Row( + children: [ + AppText( TranslationBase.of(context).receiptOn + ": ", color: Colors.grey[500], ), @@ -450,7 +451,8 @@ class _InsuranceApprovalsDetailsState extends State { ), ), ], - ), + ) + : SizedBox.shrink(), Row( children: [ AppText( diff --git a/lib/screens/pharmacy_intervention/PharmacyIntervention.dart b/lib/screens/pharmacy_intervention/PharmacyIntervention.dart index 2249d039..f0259f6e 100644 --- a/lib/screens/pharmacy_intervention/PharmacyIntervention.dart +++ b/lib/screens/pharmacy_intervention/PharmacyIntervention.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_history.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -19,6 +21,7 @@ class PharmacyIntervention extends StatefulWidget { } class _PharmacyInterventionState extends State { + bool isBottomSheetShown = false; @override Widget build(BuildContext context) { return BaseView(onModelReady: (model) { @@ -29,7 +32,8 @@ class _PharmacyInterventionState extends State { ]); }); }, builder: (_, model, __) { - if (model.interventionHistoryList != null) { + if (model.interventionHistoryList != null && !model.isBottomSheetShown) { + model.toggleBottomOpenValue(true); WidgetsBinding.instance.addPostFrameCallback((_) { showBottomSheet( context, @@ -117,28 +121,23 @@ class _PharmacyInterventionState extends State { showModalBottomSheet( isDismissible: true, context: context, + isScrollControlled: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20))), builder: (_) { - return DraggableScrollableSheet( - key: _sheet, - initialChildSize: 0.7, - minChildSize: 0.7, - maxChildSize: 1, - snapSizes: [ - 0.7, // constraints.maxHeight, - 1, - ], - expand: false, - controller: _controller, - builder: (_, controller) => InterventionHistoryBottomSheet( - interventionList: interventionHistory, - model: model, - controller: controller, - )); + return Padding( + padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), + child: InterventionHistoryBottomSheet( + interventionList: interventionHistory, + model: model, + ), + ); }, - ).then((value) => model.toggleShowBottomSheetValue()); + ).then((value) { + model.toggleShowBottomSheetValue(); + model.toggleBottomOpenValue(false); + }); } void SearchDialog(BuildContext context, PharmacyInterventionViewModel model) { diff --git a/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart b/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart index a0449fea..dbfba2c4 100644 --- a/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart +++ b/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart @@ -12,6 +12,7 @@ import 'package:intl/intl.dart'; class PharmacyInterventionViewModel extends BaseViewModel { PharmacyInterventionService _service = locator(); MedicationList? medicationList; + bool isBottomSheetShown = false; // MedicationList? medicationList = MedicationList.fromJson({ // "entityList": [ @@ -630,4 +631,8 @@ class PharmacyInterventionViewModel extends BaseViewModel { toggleShowBottomSheetValue() { interventionHistoryList = null; } + + toggleBottomOpenValue(bool bottomSheetValue){ + isBottomSheetShown = bottomSheetValue; + } } diff --git a/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart b/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart index 39a4a5fa..ed6584ca 100644 --- a/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart +++ b/lib/screens/pharmacy_intervention/widgets/InterventionHistoryBottomSheet.dart @@ -8,79 +8,74 @@ import 'package:flutter/material.dart'; class InterventionHistoryBottomSheet extends StatelessWidget { final List interventionList; - final ScrollController controller; + + // final ScrollController controller; final PharmacyInterventionViewModel model; - const InterventionHistoryBottomSheet( - {super.key, required this.interventionList, required this.controller, required this.model}); + const InterventionHistoryBottomSheet({super.key, required this.interventionList, required this.model}); @override Widget build(BuildContext context) { - return Material( - color: Color(0xFFF7F7F7), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), topRight: Radius.circular(20))), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 32), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase - .of(context) - .histories, - fontWeight: FontWeight.w700, - fontSize: 24, - color: Color(0xFF2B353E), - ), - SizedBox( - height: 16, - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: ListView.separated( - shrinkWrap: true, - controller: controller, - itemCount: interventionList.length, - itemBuilder: (context, index) => - Material( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10)), - color: Colors.white, - child: InterventionHistoryItem( - interventionHistory: interventionList[index], - onAcceptClick: (intervention, remarks) { - model.updateInterventionDiseaseStatus( - remarks: remarks, - isAccepted: true, - interventionID: interventionList[index].interventionId.toString(), - successMessage: TranslationBase.of(context).interventionAcceptedSuccessfully, - errorMessage: TranslationBase.of(context).unableToPerformTheAction); - Navigator.pop(context); - }, - onRejectClick: (intervention, remarks) { - model.updateInterventionDiseaseStatus( - remarks: remarks, - interventionID: interventionList[index].interventionId.toString(), - successMessage: TranslationBase.of(context).interventionRejectedSuccessfully, - errorMessage: TranslationBase.of(context).unableToPerformTheAction - ); - Navigator.pop(context); - - }, - ), + return SizedBox( + height: MediaQuery.sizeOf(context).height * (interventionList.length == 1 ? 0.5 : 0.7), + child: Material( + color: Color(0xFFF7F7F7), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 32), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).histories, + fontWeight: FontWeight.w700, + fontSize: 24, + color: Color(0xFF2B353E), + ), + SizedBox( + height: 16, + ), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ListView.separated( + shrinkWrap: true, + itemCount: interventionList.length, + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) => Material( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + color: Colors.white, + child: InterventionHistoryItem( + remarksController: interventionList[index].remarksController, + interventionHistory: interventionList[index], + onAcceptClick: (intervention, remarks) { + model.updateInterventionDiseaseStatus( + remarks: remarks, + isAccepted: true, + interventionID: interventionList[index].interventionId.toString(), + successMessage: TranslationBase.of(context).interventionAcceptedSuccessfully, + errorMessage: TranslationBase.of(context).unableToPerformTheAction); + Navigator.pop(context); + }, + onRejectClick: (intervention, remarks) { + model.updateInterventionDiseaseStatus( + remarks: remarks, + interventionID: interventionList[index].interventionId.toString(), + successMessage: TranslationBase.of(context).interventionRejectedSuccessfully, + errorMessage: TranslationBase.of(context).unableToPerformTheAction); + Navigator.pop(context); + }, ), - separatorBuilder: (_, __) => Divider(), - )) - ], - ), - ) - ], + ), + separatorBuilder: (_, __) => Divider(), + ) + ], + ) + ], + ), + ), ), ), ); diff --git a/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart b/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart index 51cad620..b9b5a578 100644 --- a/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart +++ b/lib/screens/pharmacy_intervention/widgets/intervention_history_item.dart @@ -12,7 +12,7 @@ class InterventionHistoryItem extends StatelessWidget { final Function(InterventionHistory, String) onAcceptClick; final Function(InterventionHistory, String) onRejectClick; - final TextEditingController remarksController = TextEditingController(); + final TextEditingController remarksController; InterventionHistoryItem({ @@ -20,6 +20,7 @@ class InterventionHistoryItem extends StatelessWidget { required this.interventionHistory, required this.onAcceptClick, required this.onRejectClick, + required this.remarksController, }); diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 096722c9..2b956957 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -141,8 +141,17 @@ class Utils { } static Future checkConnection() async { - List result = await (Connectivity().checkConnectivity()); - return result.contains(ConnectivityResult.wifi)||result.contains(ConnectivityResult.mobile); + List connectivityResult = await (Connectivity().checkConnectivity()); + if (connectivityResult.contains(ConnectivityResult.mobile) || + connectivityResult.contains(ConnectivityResult.wifi) || + connectivityResult.contains(ConnectivityResult.ethernet) || + connectivityResult.contains(ConnectivityResult.bluetooth) || + connectivityResult.contains(ConnectivityResult.vpn)) { + return true; + } else { + return false; + } + // return result.contains(ConnectivityResult.wifi)||result.contains(ConnectivityResult.mobile); } static List getWorkingHours(String workingHours) { From 0e54255e0a16a33c465eba85694607ec3fa6e464 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 10 Dec 2025 09:51:16 +0300 Subject: [PATCH 3/4] prescription support ticket issue fixed --- lib/config/config.dart | 2 +- .../prescription_form_widget.dart | 209 +++++++++--------- 2 files changed, 108 insertions(+), 103 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f3d92582..35cbee3a 100755 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -415,7 +415,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 10.3; +const VERSION_ID = 10.4; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/prescription/add_prescription/prescription_form_widget.dart b/lib/screens/prescription/add_prescription/prescription_form_widget.dart index 7aefa133..8c8211ca 100644 --- a/lib/screens/prescription/add_prescription/prescription_form_widget.dart +++ b/lib/screens/prescription/add_prescription/prescription_form_widget.dart @@ -61,7 +61,7 @@ class _PrescriptionFormWidgetState extends State { bool visibilityPrescriptionForm = false; bool visibilitySearch = true; - DateTime selectedDate = DateTime.now(); + DateTime? selectedDate; int? strengthChar; GlobalKey key = new GlobalKey>(); @@ -97,10 +97,11 @@ class _PrescriptionFormWidgetState extends State { }); } -getIcdCodeData() async{ - await widget.prescriptionViewModel.getIcd10DISESECode(patient: widget.patient, itemID:widget.selectedMedication.itemId ); - icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems); -} + getIcdCodeData() async { + await widget.prescriptionViewModel.getIcd10DISESECode(patient: widget.patient, itemID: widget.selectedMedication.itemId); + icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems); + } + onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; @@ -217,7 +218,7 @@ getIcdCodeData() async{ ), PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.510, - element: widget.medicineViewModel.itemMedicineListUnit.length == 1 ? widget.medicineViewModel.itemMedicineListUnit[0] : units, + element: widget.medicineViewModel.itemMedicineListUnit.length == 1 ? units = widget.medicineViewModel.itemMedicineListUnit[0] : units, elementError: unitError, keyName: 'description', keyId: 'parameterCode', @@ -252,7 +253,7 @@ getIcdCodeData() async{ hintText: TranslationBase.of(context).frequency, elementError: frequencyError, // element: frequency, - element: widget.medicineViewModel.medicationFrequencyList.length == 1 ? frequency = widget.medicineViewModel.medicationFrequencyList[0] : frequency, + element: widget.medicineViewModel.itemMedicineList.length == 1 ? frequency = widget.medicineViewModel.itemMedicineList[0] : frequency, elementList: widget.medicineViewModel.itemMedicineList, keyId: 'parameterCode', keyName: 'description', @@ -282,8 +283,9 @@ getIcdCodeData() async{ }); }), SizedBox(height: spaceBetweenTextFields), - widget.prescriptionViewModel.icd10DeseaseItems.isNotEmpty ? - // PrescriptionTextFiled( + widget.prescriptionViewModel.icd10DeseaseItems.isNotEmpty + ? + // PrescriptionTextFiled( // hintText: TranslationBase.of(context).nameOrICD, // elementError: icdCodeError, // element: icdCode, @@ -296,98 +298,100 @@ getIcdCodeData() async{ // }); // }) - Column( - children:[ InkWell( - onTap: widget.prescriptionViewModel.icd10DeseaseItems != null - ? () { - icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems); - setState(() { - icdCode = null; - icdNameController.text = ''; - }); - } - : null, - child: AppTextFieldCustom( - validationError: icdCodeError, - onChanged: (text){ - icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems); - setState(() { - icdNameController.text; - }); - }, - height: Utils.getTextFieldHeight(), - onClick: widget.prescriptionViewModel.icd10DeseaseItems != null - ? () { - setState(() { - icdCode = null; - icdNameController.text = ''; - }); - } - : null, - hintText: TranslationBase.of(context).nameOrICD, - maxLines: 1, - minLines: 1, - controller: icdNameController, - enabled:true, - isTextFieldHasSuffix: true, onFieldSubmitted: () { }, - - )), - - icdCodeList.isNotEmpty && icdNameController.text.isNotEmpty ? Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, - child:ListView.builder( - shrinkWrap: true, - itemCount:icdCodeList.length, - itemBuilder: (context, index) { - return InkWell(child:ListTile( - title: AppText( widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc + " / " + widget.prescriptionViewModel.icd10DeseaseItems[index].codeId.toString(), fontSize: 12.0)), - onTap: (){ - icdCode = widget.prescriptionViewModel.icd10DeseaseItems[index]; - icdNameController.text = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc; - widget.medicineViewModel.patientAssessmentList[0].icdCode10ID = widget.prescriptionViewModel.icd10DeseaseItems[index].codeId; - widget.medicineViewModel.patientAssessmentList[0].asciiDesc = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc; - icdCodeList.clear(); - setState(() { - - }); - } - ); - - }, - )) :SizedBox() - ]) - - : widget.medicineViewModel.patientAssessmentList.isNotEmpty ? - Container( - height: screenSize.height * 0.068, - width: double.infinity, - color: Colors.white, - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: AppTextFieldCustom( - hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(), - enabled: true, - onChanged: (value) {}, - onFieldSubmitted: () {}, - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.57, - color: Colors.white, - child: AppTextFieldCustom( - maxLines: 5, - hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(), - enabled: true, - onChanged: (value) {}, - onFieldSubmitted: () {}, - ), - ), - ], - ), - ) :SizedBox(), + Column(children: [ + InkWell( + onTap: widget.prescriptionViewModel.icd10DeseaseItems != null + ? () { + icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems); + setState(() { + icdCode = null; + icdNameController.text = ''; + }); + } + : null, + child: AppTextFieldCustom( + validationError: icdCodeError, + onChanged: (text) { + icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems); + setState(() { + icdNameController.text; + }); + }, + height: Utils.getTextFieldHeight(), + onClick: widget.prescriptionViewModel.icd10DeseaseItems != null + ? () { + setState(() { + icdCode = null; + icdNameController.text = ''; + }); + } + : null, + hintText: TranslationBase.of(context).nameOrICD, + maxLines: 1, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + onFieldSubmitted: () {}, + )), + icdCodeList.isNotEmpty && icdNameController.text.isNotEmpty + ? Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, + child: ListView.builder( + shrinkWrap: true, + itemCount: icdCodeList.length, + itemBuilder: (context, index) { + return InkWell( + child: ListTile( + title: AppText(widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc + " / " + widget.prescriptionViewModel.icd10DeseaseItems[index].codeId.toString(), + fontSize: 12.0)), + onTap: () { + icdCode = widget.prescriptionViewModel.icd10DeseaseItems[index]; + icdNameController.text = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc; + if (widget.medicineViewModel.patientAssessmentList.isNotEmpty) { + widget.medicineViewModel.patientAssessmentList[0].icdCode10ID = widget.prescriptionViewModel.icd10DeseaseItems[index].codeId; + widget.medicineViewModel.patientAssessmentList[0].asciiDesc = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc; + } + icdCodeList.clear(); + setState(() {}); + } + ); + }, + )) + : SizedBox() + ]) + : widget.medicineViewModel.patientAssessmentList.isNotEmpty + ? Container( + height: screenSize.height * 0.068, + width: double.infinity, + color: Colors.white, + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: AppTextFieldCustom( + hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(), + enabled: true, + onChanged: (value) {}, + onFieldSubmitted: () {}, + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.57, + color: Colors.white, + child: AppTextFieldCustom( + maxLines: 5, + hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(), + enabled: true, + onChanged: (value) {}, + onFieldSubmitted: () {}, + ), + ), + ], + ), + ) + : SizedBox(), SizedBox(height: spaceBetweenTextFields), SizedBox(height: 10,), Container( @@ -523,6 +527,7 @@ getIcdCodeData() async{ } addMedicationButton(MedicineViewModel model) async { + print("Add"); await locator().logEvent( eventCategory: "Add Prescription Form", eventAction: "Add Prescription", @@ -612,4 +617,4 @@ getIcdCodeData() async{ } formKey.currentState!.save(); } -} +} \ No newline at end of file From f3265819b8ccf6ee74c6cc085f3704ce61ba1825 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 25 Dec 2025 15:54:01 +0300 Subject: [PATCH 4/4] QR Scan issue fixed --- lib/core/service/home/scan_qr_service.dart | 4 +++- .../profile/profile_screen/patient_profile_screen.dart | 2 +- lib/screens/qr_reader/QR_reader_screen.dart | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index 1e241fc1..2fbd0e6b 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -10,9 +10,11 @@ class ScanQrService extends BaseService { Future getInPatient( PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; - await getDoctorProfile(); + await getDoctorProfile(isGetProfile: true); requestModel.loginDoctorID = doctorProfile!.doctorID; requestModel.doctorID = 0; + requestModel.from = "0"; + requestModel.to = "0"; await baseAppClient.post( GET_PATIENT_IN_PATIENT_LIST, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 7a632500..ce8d06a3 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -166,7 +166,7 @@ String noteValidation =""; children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient, arrivalType!, patientType!, + PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? "1", patientType ?? "1", videoCallDurationStream: videoCallDurationStream, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 9e33f11e..ecf67787 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -112,6 +112,8 @@ class _QrReaderScreenState extends State { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": model.inPatientList[0], "isInpatient": true, + "patientType": "1", + "arrivalType": "1", }); } else { DrAppToastMsg.showErrorToast(model.error);