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 db5e01f3..e964dc05 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1162,6 +1162,9 @@ 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":"لا يوجد حساسية معروفة"}, + + "addChiefComplaint": {"en": "Add Chief Complaints*", "ar":"إضافة الشكاوى الرئيسية*"}, "myFavoriteList": {"en": "My Favourite List", "ar":"قائمتي المفضلة"}, "generalList": {"en": "General list", "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 861e4458..a33ddae8 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 @@ -22,7 +22,6 @@ class UpdateChiefComplaints extends StatelessWidget { onAddSoapItemClicked: () { Navigator.push( context, - //Todo(handle the parameter here) MaterialPageRoute( builder: (BuildContext context) => AddChiefComplaint( complaints: complaints, @@ -32,6 +31,7 @@ class UpdateChiefComplaints extends StatelessWidget { thirdField: ''), )); }, + title: "Add Chief Complaint", ), SizedBox(height: 16), 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 afcd5492..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,10 +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: false, onPressed: () async { onAddSoapItemClicked(); }, diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page_vida_plus.dart index fd5ba8b3..4c332c11 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page_vida_plus.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/update_subjective_page_vida_plus.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,6 +16,7 @@ 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'; @@ -202,7 +202,7 @@ class _UpdateSubjectivePageVidaPlusState extends State localizedValues['select']![locale.languageCode]!; + + String get noKnownAllergies => localizedValues['noKnownAllergies']![locale.languageCode]!; } class TranslationBaseDelegate extends LocalizationsDelegate {