From f1b87f2568836b0f3b505039c9741a9db277e768 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Sun, 3 Nov 2024 10:06:01 +0300 Subject: [PATCH] allergies work in progress --- lib/config/config.dart | 5 +++ lib/config/localized_values.dart | 1 + lib/core/service/base/lookup-service.dart | 2 + .../soap/SOAP_service.dart | 19 ++++++++ .../allergies/update_allergies_widget.dart | 43 ++++++++++++++++--- .../chief_complaint/chief_complaints.dart | 1 + .../widgets/add_chief_complaint.dart | 9 ++-- .../subjective/update_subjective_page.dart | 10 ++--- .../update_soap_index_vida_plus.dart | 4 +- .../translations_delegate_base_utils.dart | 2 + 10 files changed, 78 insertions(+), 18 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 1fbdc041..d49cb1bc 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -285,6 +285,11 @@ const DOCTOR_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/ const ACKNOWLEDGE_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/Acknowledgeradcriticalfindings"; + + /*vida plus API */ + +const PATIENT_ALLERGIES = 'Services/DoctorApplication.svc/REST/PatientAllergies'; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 422ceb8b..e6876f49 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1161,6 +1161,7 @@ const Map> localizedValues = { "principalCoveredOrNot": {"en": "Principal Diagnosis is not covered for this patient", "ar":"لا يتم تغطية التشخيص الرئيسي لهذا المريض"}, "complexDiagnosis": {"en": "Complex Diagnosis", "ar":"التشخيص المعقد"}, "noComplaintsFound": {"en": "No Chief Complaints added, please add it from the button above", "ar":"لم تتم إضافة شكاوى رئيسية ، يرجى إضافتها من الزر أعلاه"}, + "noKnownAllergies": {"en": "No Known Allergies", "ar":"لا يوجد حساسية معروفة"}, diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index f1e086a1..b9f6a69f 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -214,4 +214,6 @@ class LookupService extends BaseService { break; } } + + } diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index ab87eeb8..87d2bc57 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -336,4 +336,23 @@ class SOAPService extends LookupService { "DoctorID":patientInfo.doctorId, }); } +/* vida plus API allergies */ + + Future patientAllergies(GeneralGetReqForSOAP generalGetReqForSOAP) async { + hasError = false; + + await baseAppClient.post(PATIENT_ALLERGIES, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + patientAllergiesList.clear(); + + response['List_Allergies']['entityList'].forEach((v) { + patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: generalGetReqForSOAP.toJson()); + } + } diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart index 1b02197c..762401bf 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart @@ -11,19 +11,20 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../../soap_update/shared_soap_widgets/SOAP_open_items.dart'; +import '../chief_complaint/widgets/add_chief_complaint.dart'; import 'add_allergies.dart'; // ignore: must_be_immutable -class UpdateAllergiesWidget extends StatefulWidget { +class UpdateAllergiesWidgetVidaPlus extends StatefulWidget { List? myAllergiesList; - UpdateAllergiesWidget({Key? key, this.myAllergiesList}); + UpdateAllergiesWidgetVidaPlus({Key? key, this.myAllergiesList}); @override _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); } - -class _UpdateAllergiesWidgetState extends State { +bool noKnownAllergies = false; +class _UpdateAllergiesWidgetState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -35,15 +36,39 @@ class _UpdateAllergiesWidgetState extends State { return Column( children: [ - SOAPOpenItems( - label: "${TranslationBase.of(context).addAllergies}", - onTap: () { + SizedBox( + height: 20, + ), + AddSoapItem( + title: "${TranslationBase.of(context).addAllergies}", + onAddSoapItemClicked: (){ openAllergiesList(context, changeAllState, removeAllergy); }, + ), SizedBox( height: 20, ), + + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Checkbox( + value: noKnownAllergies, + checkColor: Colors.white, + activeColor: Colors.red, + onChanged: (value) { + noKnownAllergies = value!; + setState(() {}); + }, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, // Reduces padding around checkbox + visualDensity: VisualDensity.compact, // Minimizes size further + ), + AppText(TranslationBase.of(context).noKnownAllergies) + ], + ), + + Container( margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( @@ -190,4 +215,8 @@ class _UpdateAllergiesWidgetState extends State { }); }); } + + loadPatientAllergies(){ + + } } diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/chief_complaints.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/chief_complaints.dart index 0ce7ce7b..44024e88 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/chief_complaints.dart @@ -18,6 +18,7 @@ class UpdateChiefComplaints extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ AddSoapItem( + title: "Add Chief Complaint", onAddSoapItemClicked: () {}, ), if (complaints.isEmpty) ...{ diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_chief_complaint.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_chief_complaint.dart index 66214d72..e8f2104e 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_chief_complaint.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_chief_complaint.dart @@ -5,8 +5,9 @@ import 'package:flutter_svg/flutter_svg.dart'; class AddSoapItem extends StatelessWidget{ final VoidCallback onAddSoapItemClicked; + final String title; - const AddSoapItem({super.key, required this.onAddSoapItemClicked}); + const AddSoapItem({super.key, required this.onAddSoapItemClicked, required this.title}); @override Widget build(BuildContext context) { return Row( @@ -14,11 +15,11 @@ class AddSoapItem extends StatelessWidget{ Expanded( child: AppButton( icon: SvgPicture.asset('assets/images/svgs/add-square.svg'), - title: TranslationBase.of(context).previous, - color: Colors.grey[300]!, + title:this.title, + color: Color(0xffEAEAEA), fontColor: Colors.black, fontWeight: FontWeight.w600, - disabled: true, + disabled: false, onPressed: () async { onAddSoapItemClicked(); }, diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page.dart index e3f728ed..a2f3a6f3 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page.dart @@ -9,7 +9,6 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -17,23 +16,24 @@ import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'allergies/update_allergies_widget.dart'; import 'chief_complaint/chief_complaints.dart'; -class UpdateSubjectivePage extends StatefulWidget { +class UpdateSubjectivePageVidaPlus extends StatefulWidget { final Function changePageViewIndex; final Function changeLoadingState; final PatiantInformtion patientInfo; final int currentIndex; - UpdateSubjectivePage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex}); + UpdateSubjectivePageVidaPlus({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); } -class _UpdateSubjectivePageState extends State implements SubjectiveCallBack { +class _UpdateSubjectivePageState extends State implements SubjectiveCallBack { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; @@ -202,7 +202,7 @@ class _UpdateSubjectivePageState extends State implements }, child: Column( children: [ - UpdateAllergiesWidget( + UpdateAllergiesWidgetVidaPlus( myAllergiesList: myAllergiesList, ), SizedBox( diff --git a/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart index d088f8d4..9509f368 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_al import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page.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'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -92,7 +92,7 @@ class _UpdateSoapIndexVidaPlusState extends State }, scrollDirection: Axis.horizontal, children: [ - UpdateSubjectivePage( + UpdateSubjectivePageVidaPlus( changePageViewIndex: changePageViewIndex, currentIndex: _currentIndex, patientInfo: patient, diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index c456d65f..48181ae9 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -1466,6 +1466,8 @@ class TranslationBase { String get noComplaintsFound => localizedValues['noComplaintsFound']![locale.languageCode]!; + + String get noKnownAllergies => localizedValues['noKnownAllergies']![locale.languageCode]!; } class TranslationBaseDelegate extends LocalizationsDelegate {