WD: physical examination completed.

update_flutter_3.24_vida_plus_episode_v2
taha.alam 1 year ago
parent 2fbb25de77
commit 7253f6c05e

@ -1204,6 +1204,8 @@ const Map<String, Map<String, String>> localizedValues = {
"noPhysicalExamination": {"en": "No Physical Examination added, please add it from the button above", "ar":"لم يتم إضافة فحص بدني ، يرجى إضافته من الزر أعلاه"}, "noPhysicalExamination": {"en": "No Physical Examination added, please add it from the button above", "ar":"لم يتم إضافة فحص بدني ، يرجى إضافته من الزر أعلاه"},
"noProgressNote": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"}, "noProgressNote": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"},
"mild": {"en": "Mild", "ar":"خفيف"}, "mild": {"en": "Mild", "ar":"خفيف"},
"remarksCanNotBeEmpty": {"en": "Remarks Can Not Be Empty", "ar":"لا يمكن أن تكون الملاحظات فارغة"},
"kindlySelectCategory": {"en": "Kindly Select Any Diagnosis Category", "ar":"يرجى اختيار أي فئة تشخيص"},
"noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"}, "noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"},
"event": {"en": "Event: ", "ar":"حدث: "}, "event": {"en": "Event: ", "ar":"حدث: "},
"deletedRemarks": {"en": "Deleted Remarks: ", "ar":"ملاحظات محذوفة: "}, "deletedRemarks": {"en": "Deleted Remarks: ", "ar":"ملاحظات محذوفة: "},

@ -42,6 +42,7 @@ class Category {
String? pomrId; String? pomrId;
int? paitientId; int? paitientId;
int? userID; int? userID;
bool isExpanded = false;
Category(); Category();
@ -55,6 +56,7 @@ class Category {
conditionsList!.add(Condition.fromJson(v)); conditionsList!.add(Condition.fromJson(v));
}); });
} }
if(conditionsList?.isNotEmpty == true) selectedCondition = int.parse(conditionsList?.first.conditionName ??'-1');
description = json['description']; description = json['description'];
descriptionAlias = json['descriptionAlias']; descriptionAlias = json['descriptionAlias'];
id = json['id']; id = json['id'];

@ -67,5 +67,8 @@ extension ConvertCategoryToCreatePhysicalExamination on Category {
..specialityID = this.specialityId ..specialityID = this.specialityId
..patientID = this.paitientId ..patientID = this.paitientId
..pomrid = this.pomrId ..pomrid = this.pomrId
..loginUserId = this.userID?.toString(); ..loginUserId = this.userID?.toString()
..isMandatory = false
..specialityDescription = this.specialityName
..isClinicPhysicalExamination = true;
} }

@ -25,7 +25,7 @@ class PatientPhysicalExamination {
int? approvedBy; int? approvedBy;
String? approvedOn; String? approvedOn;
String? rowVersion; String? rowVersion;
int? pomrid; String? pomrid;
// Default constructor // Default constructor
PatientPhysicalExamination(); PatientPhysicalExamination();

@ -834,7 +834,16 @@ class SOAPService extends LookupService {
) async { ) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER); Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
Map<String, dynamic> request = { Map<String, dynamic> request =
// {
// "patientId": 70024978,
// "pomrId": 10819,
// "hospitalId": 313,
// "hospitalGroupId": 105,
// "ProjectID": 313
// };
{
"patientId": patientInfo.patientId, "patientId": patientInfo.patientId,
"pomrId": patientInfo.pomrId, "pomrId": patientInfo.pomrId,
"hospitalId": patientInfo.projectId, "hospitalId": patientInfo.projectId,
@ -855,40 +864,42 @@ class SOAPService extends LookupService {
}, body: request); }, body: request);
} }
Future<bool> postPhysicalExamination(PatiantInformtion patientInfo, Future<bool> postPhysicalExamination(
List<Category> physicalExamination) async { PatiantInformtion patientInfo, List<Category> physicalExamination) async {
List<CreatePhysicalExamination> jsonListOfPhysicalExamination = []; List<CreatePhysicalExamination> jsonListOfPhysicalExamination = [];
physicalExamination physicalExamination.forEach((value) => jsonListOfPhysicalExamination
.forEach((value) => jsonListOfPhysicalExamination.add(value.createPhysicalExaminationFromCategory())); .add(value.createPhysicalExaminationFromCategory()));
Map<String, dynamic> request = { Map<String, dynamic> request = {
"ProjectID": patientInfo.patientId, "ProjectID": patientInfo.projectId,
"listCreatPhysicalExam": jsonListOfPhysicalExamination "listCreatPhysicalExam": jsonListOfPhysicalExamination
}; };
hasError = false; hasError = false;
bool data = await baseAppClient.post(POST_PHYSICAL_EXAM, var success = false;
await baseAppClient.post(POST_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast(response['ListPhysicalExam']['message']); DrAppToastMsg.showSuccesToast(response['ListPhysicalExam']['message']);
return true; success = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
return false; success = false;
}, body: request); }, body: request);
return data; return success;
} }
getGeneralSpeciality(PatiantInformtion patientInfo) async { getGeneralSpeciality(PatiantInformtion patientInfo) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"ProjectID": patientInfo.patientId, "ProjectID": patientInfo.projectId,
}; };
hasError = false; hasError = false;
generalSpeciality.clear(); generalSpeciality.clear();
await baseAppClient.post(GET_GENERAL_SPECIALITY, await baseAppClient.post(GET_GENERAL_SPECIALITY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['ListGeneralSpeciality']['resultData'] response['ListGeneralSpeciality']['resultData'].forEach((v) =>
.forEach((v) => generalSpeciality.add(GeneralSpeciality.fromJson(v))); v['categories'].forEach(
(cat) => generalSpeciality.add(GeneralSpeciality.fromJson(cat))));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
generalSpeciality.clear(); generalSpeciality.clear();
@ -963,8 +974,7 @@ class SOAPService extends LookupService {
}, body: request); }, body: request);
} }
Future getProgressNoteNew( Future getProgressNoteNew(PatiantInformtion patientInformation) async {
PatiantInformtion patientInformation) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID), "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"hospitalId": patientInformation.projectId, "hospitalId": patientInformation.projectId,
@ -981,8 +991,8 @@ class SOAPService extends LookupService {
patientProgressNoteListVidaPlus.clear(); patientProgressNoteListVidaPlus.clear();
response['ProgressNoteList']['resultData'].forEach((v) { response['ProgressNoteList']['resultData'].forEach((v) {
v['data'].forEach((progressNote) { v['data'].forEach((progressNote) {
patientProgressNoteListVidaPlus.add(ProgressNote.fromJson(progressNote)); patientProgressNoteListVidaPlus
.add(ProgressNote.fromJson(progressNote));
}); });
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -991,18 +1001,24 @@ class SOAPService extends LookupService {
}, body: request); }, body: request);
} }
getSpecialityDetails(String speciality, int? specialityId, getSpecialityDetails(String speciality, int? specialityId,
PatiantInformtion patientInfo) async { PatiantInformtion patientInfo) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER); Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
var userId = user?['List_MemberInformation'][0]['MemberID']; var userId = user?['List_MemberInformation'][0]['MemberID'];
Map<String, dynamic> request = {"searchParam": speciality}; Map<String, dynamic> request = {"searchParam": speciality};
hasError = false; hasError = false;
specialityDetails.clear();
List<Category> categoryData = []; List<Category> categoryData = [];
await baseAppClient.post(MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS, await baseAppClient.post(GET_SPECIALITY_DETAILS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['ContinuePreviousEpisode']['resultData'].forEach( response['ListEyeGeneralSpeciality']['resultData'].forEach((value) =>
(value) => categoryData.add(Category.fromJson(value, specialityId, speciality,patientInfo.pomrId,patientInfo.patientId,user?['List_MemberInformation'][0]['MemberID']))); categoryData.add(Category.fromJson(
value,
specialityId,
speciality,
patientInfo.pomrId,
patientInfo.patientId,
user?['List_MemberInformation'][0]['MemberID'])));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -48,6 +48,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessme
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart'; import '../model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart';
@ -147,7 +148,8 @@ class SOAPViewModel extends BaseViewModel {
List<AuditDiagnosis> get auditDiagnosislist => List<AuditDiagnosis> get auditDiagnosislist =>
_SOAPService.auditDiagnosislist; _SOAPService.auditDiagnosislist;
List<GeneralSpeciality> get speciality => _SOAPService.generalSpeciality; List<GeneralSpeciality>? mainSpecialityList = null;
List<GeneralSpeciality> speciality = [];
List<ProgressNote> get progressNote => List<ProgressNote> get progressNote =>
_SOAPService.patientProgressNoteListVidaPlus; _SOAPService.patientProgressNoteListVidaPlus;
@ -1181,16 +1183,21 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future<bool> postPhysicalExamination(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal); List<Category> getListOfSelectedCategory(){
List<Category> mappedItems = []; List<Category> mappedItems = [];
for (List<Category> category in specialityDetails.values) { for (List<Category> category in specialityDetails.values) {
var selectedCategory = var selectedCategory =
category.where((value) => value.isSelected == true); category.where((value) => value.isSelected == true);
mappedItems.addAll(selectedCategory); mappedItems.addAll(selectedCategory);
} }
return mappedItems;
}
Future<bool> postPhysicalExamination(PatiantInformtion patientInfo, List<Category> listOfSelectedCategory) async {
setState(ViewState.BusyLocal);
bool result = bool result =
await _SOAPService.postPhysicalExamination(patientInfo, mappedItems); await _SOAPService.postPhysicalExamination(patientInfo, listOfSelectedCategory);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -1200,9 +1207,11 @@ class SOAPViewModel extends BaseViewModel {
return result; return result;
} }
void getGeneralSpeciality(PatiantInformtion patientInfo) async { getGeneralSpeciality(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.getGeneralSpeciality(patientInfo); await _SOAPService.getGeneralSpeciality(patientInfo);
mainSpecialityList = _SOAPService.generalSpeciality;
speciality = mainSpecialityList ?? [];
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -1210,7 +1219,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
void getSpecialityDetails(String speciality, int? specialityId, getSpecialityDetails(String speciality, int? specialityId,
PatiantInformtion patientInfo) async { PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.getSpecialityDetails( await _SOAPService.getSpecialityDetails(
@ -1230,7 +1239,7 @@ class SOAPViewModel extends BaseViewModel {
_SOAPService.showAuditBottomSheet = status; _SOAPService.showAuditBottomSheet = status;
} }
void getProgressNote(PatiantInformtion patientInformation) async { getProgressNote(PatiantInformtion patientInformation) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.getProgressNoteNew(patientInformation); await _SOAPService.getProgressNoteNew(patientInformation);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -1239,4 +1248,26 @@ class SOAPViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
void changeCurrentCategorySelectedState(
GeneralSpeciality selectedExamination, bool status) {
final item = speciality.firstWhere(
(speciality) => speciality.id == selectedExamination.id,
orElse: () => throw Exception(
'Speciality with ID ${selectedExamination.id} not found!'),
);
item.isSelected = status;
notifyListeners();
}
void filterData(String query) {
if (query.isEmpty) {
speciality = mainSpecialityList ?? [];
}
var searchList =
mainSpecialityList?.where((value) => value.name?.toLowerCase().contains(query.toLowerCase()) == true).toList() ??
[];
speciality = searchList;
notifyListeners();
}
} }

@ -4,11 +4,13 @@ import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciali
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_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/shared_soap_widgets/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/widget/examination_items.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/widget/examination_items.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
@ -34,7 +36,7 @@ class AddDetailsToExaminationVidaPlus extends StatefulWidget {
class _AddDetailsToExaminationVidaPlusState class _AddDetailsToExaminationVidaPlusState
extends State<AddDetailsToExaminationVidaPlus> { extends State<AddDetailsToExaminationVidaPlus> {
bool isSysExaminationExpand = false; String currentlyExpanded = '';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,12 +44,12 @@ class _AddDetailsToExaminationVidaPlusState
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
WidgetsBinding.instance.addPostFrameCallback((_) async {
widget.mySelectedExamination?.forEach((value) => widget.mySelectedExamination?.forEach((value) =>
model.getSpecialityDetails( model.getSpecialityDetails(
value.name ?? '', value.id, widget.patientInfo)); value.name ?? '', value.id, widget.patientInfo));});
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
isLoading: model.state == ViewState.BusyLocal, isLoading: model.state == ViewState.BusyLocal,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
@ -66,13 +68,14 @@ class _AddDetailsToExaminationVidaPlusState
headerTitle: title, headerTitle: title,
onTap: () { onTap: () {
setState(() { setState(() {
isSysExaminationExpand = if(currentlyExpanded == title) {
!isSysExaminationExpand; currentlyExpanded = '';
}else currentlyExpanded = title;
}); });
}, },
child: ExaminationItems( child: ExaminationItems(
examination: model.specialityDetails[title]), examination: model.specialityDetails[title]),
isExpanded: isSysExaminationExpand, isExpanded: currentlyExpanded == title,
); );
}, },
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
@ -112,7 +115,26 @@ class _AddDetailsToExaminationVidaPlusState
fontColor: Colors.white, fontColor: Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onPressed: () async { onPressed: () async {
model.postPhysicalExamination(widget.patientInfo,); var listOfSelectedCategory = model.getListOfSelectedCategory();
if(listOfSelectedCategory.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectCategory);
return;
}
if(listOfSelectedCategory.any((value) => value.remarksController.text.isEmpty)){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).remarksCanNotBeEmpty);
return;
}
var result = await model.postPhysicalExamination(widget.patientInfo,listOfSelectedCategory);
if(result){
model.getPhysicalExamination(widget.patientInfo);
Navigator.popUntil(context, ((route) {
if (route.settings.name == UPDATE_EPISODE_VIDA_PLUS) {
return true;
} else {
return false;
}
}));
}
}, },
), ),
), ),

@ -45,27 +45,22 @@ class _AddExaminationPageVidaPlusState
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { WidgetsBinding.instance.addPostFrameCallback((_) async =>
WidgetsBinding.instance.addPostFrameCallback((_) async { await model.getGeneralSpeciality(widget.patientInfo)
if (model.speciality.isEmpty) { );
await model.getGeneralSpeciality(widget.patientInfo);
}
});
}
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
isLoading: model.state == ViewState.Busy, isLoading: model.state == ViewState.BusyLocal,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: TranslationBase.of(context).examinationPart), title: TranslationBase.of(context).examinationPart),
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Column( body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Flexible( Padding(
child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Material( child: Material(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -75,31 +70,16 @@ class _AddExaminationPageVidaPlusState
color: Color(0xFFEFEFEF), color: Color(0xFFEFEFEF),
)), )),
color: Colors.white, color: Colors.white,
child: Padding( child: ExaminationsListSearchVidaPlusWidget(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
ExaminationsListSearchVidaPlusWidget(
masterList: model.speciality, masterList: model.speciality,
removeExamination: (selectedExamination) { removeExamination: (selectedExamination) {
if(selectedExamination == null ) return; if(selectedExamination == null ) return;
setState(() { setState(() {
mySelectedExaminationLocal mySelectedExaminationLocal
.remove(selectedExamination); .remove(selectedExamination);
// Find the object by its ID // Find the object by its ID
try { try {
final speciality = model.changeCurrentCategorySelectedState(selectedExamination, false);
model.speciality.firstWhere(
(speciality) =>
speciality.id == selectedExamination.id,
orElse: () => throw Exception(
'Speciality with ID ${selectedExamination.id} not found!'),
);
speciality.isSelected = false;
} catch (e) {} } catch (e) {}
}); });
}, },
@ -110,26 +90,16 @@ class _AddExaminationPageVidaPlusState
0, selectedExamination); 0, selectedExamination);
try { try {
final speciality = model.speciality.firstWhere( model.changeCurrentCategorySelectedState(selectedExamination, true);
(speciality) =>
speciality.id == selectedExamination.id,
orElse: () => throw Exception(
'Speciality with ID ${selectedExamination.id} not found!'),
);
speciality.isSelected = true;
} catch (e) {} } catch (e) {}
//setState(() {}); //setState(() {});
}, },
), ),
],
),
),
),
),
), ),
), ),
], ],
), ),
),
bottomNavigationBar: Material( bottomNavigationBar: Material(
color: Colors.white, color: Colors.white,
child: Padding( child: Padding(
@ -157,6 +127,10 @@ class _AddExaminationPageVidaPlusState
fontColor: Colors.white, fontColor: Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onPressed: () async { onPressed: () async {
if(mySelectedExaminationLocal.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectCategory);
return;
}
pushAddExamination(mySelectedExaminationLocal); pushAddExamination(mySelectedExaminationLocal);
}, },
), ),

@ -77,7 +77,7 @@ class _AddExaminationVidaPlusWidgetState extends State<AddExaminationVidaPlusWid
} }
onExamTap() { onExamTap() {
if(widget.item == null ){ if(widget.item != null ){
if(widget.item?.isSelected == true){ if(widget.item?.isSelected == true){
widget.removeExamination(widget.item); widget.removeExamination(widget.item);
}else{ }else{

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciality.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciality.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/patient_physical_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/patient_physical_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/add_examination_vida_plus_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/add_examination_vida_plus_widget.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
@ -32,13 +34,16 @@ class _ExaminationsListSearchVidaPlusWidgetState
@override @override
void initState() { void initState() {
items!.addAll(widget.masterList!);
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return BaseView<SOAPViewModel>(
builder: (_, model, w) => Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [ children: [
Material( Material(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -57,7 +62,7 @@ class _ExaminationsListSearchVidaPlusWidgetState
hasBorder: false, hasBorder: false,
controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
if (value != null) filterSearchResults(value); if (value != null) filterSearchResults(model,value);
}, },
suffixWidget: InkWell( suffixWidget: InkWell(
child: Icon( child: Icon(
@ -72,44 +77,27 @@ class _ExaminationsListSearchVidaPlusWidgetState
), ),
), ),
ListView.separated(
itemCount: items?.length ?? 0, ...model.speciality.mapIndexed((index, item) {
itemBuilder: (_, index) => AddExaminationVidaPlusWidget( return Column(
item: items![index], children: [
AddExaminationVidaPlusWidget(
item: item,
addExamination: widget.addExamination, addExamination: widget.addExamination,
removeExamination: widget.removeExamination, removeExamination: widget.removeExamination,
), ),
separatorBuilder: (_, __) => Divider(), SizedBox(height: 8,),
) Divider()
// ...items!.mapIndexed((index, item) {
// return Column(
// children: [
// AddExaminationVidaPlusWidget(
// item: item,
// addExamination: widget.addExamination,
// removeExamination: widget.removeExamination,
// mySelectedExamination: widget.mySelectedExamination,
// isServiceSelected: widget.isServiceSelected,
// isExpand: index == expandedIndex,
// expandClick: () {
// setState(() {
// if (expandedIndex == index) {
// expandedIndex = -1;
// } else {
// expandedIndex = index;
// }
// });
// },
// ),
// Divider()
// ],
// );
// }).toList(),
], ],
); );
}).toList(),
],
),
));
} }
void filterSearchResults(String query) { void filterSearchResults(SOAPViewModel model,String query) {
model.filterData(query);
// List<MasterKeyModel> dummySearchList = []; // List<MasterKeyModel> dummySearchList = [];
// dummySearchList.addAll(widget.masterList as Iterable<MasterKeyModel>); // dummySearchList.addAll(widget.masterList as Iterable<MasterKeyModel>);
// if (query.isNotEmpty) { // if (query.isNotEmpty) {

@ -21,7 +21,7 @@ class ListOfExamination extends StatelessWidget {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (_, index) => SoapDetailItem( itemBuilder: (_, index) => SoapDetailItem(
title: "${listOfSelection[index].physicalExaminationDescription}", title: "${listOfSelection[index].specialityDescription}>${listOfSelection[index].physicalExaminationDescription}",
condition: getCondition(listOfSelection[index].physicalExaminationCondition ?? 3, context)??TranslationBase.of(context).notExamined, condition: getCondition(listOfSelection[index].physicalExaminationCondition ?? 3, context)??TranslationBase.of(context).notExamined,
remarks: listOfSelection[index].remark??'', remarks: listOfSelection[index].remark??'',
onSoapDetailActionClicked: (action) { onSoapDetailActionClicked: (action) {

@ -72,14 +72,16 @@ class _UpdateObjectivePageVidaPlusState
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
if (model.patientPhysicalExaminationList == 0) { widget.changeLoadingState(true);
model.getPhysicalExamination(widget.patientInfo); model.getPhysicalExamination(widget.patientInfo);
}
widget.changeLoadingState(false); widget.changeLoadingState(false);
}); });
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
isLoading: model.state == ViewState.BusyLocal,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
@ -119,7 +121,7 @@ class _UpdateObjectivePageVidaPlusState
height: 16, height: 16,
), ),
if (mySelectedExamination.isEmpty) ...{ if (model.patientPhysicalExaminationList.isEmpty) ...{
Center( Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(65), padding: const EdgeInsets.all(65),
@ -130,7 +132,7 @@ class _UpdateObjectivePageVidaPlusState
} else ...{ } else ...{
Divider(), Divider(),
ListOfExamination( ListOfExamination(
listOfSelection: mySelectedExamination) listOfSelection: model.patientPhysicalExaminationList)
} }
// if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal) // if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal)

@ -28,18 +28,15 @@ class _ExaminationItemsState extends State<ExaminationItems> {
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
this.examinations = examinations; this.examinations = widget.examination;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Column( return SingleChildScrollView(
children: [ child: Column(
Expanded( children: examinations?.map((value)=> Column(
child: ListView.builder(
itemCount: examinations?.length ?? 0,
itemBuilder: (context, index) => Column(
children: [ children: [
ListTileTheme( ListTileTheme(
horizontalTitleGap: 0, horizontalTitleGap: 0,
@ -57,22 +54,22 @@ class _ExaminationItemsState extends State<ExaminationItems> {
), ),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16)), borderRadius: BorderRadius.circular(16)),
value: examinations?[index].isSelected, value: value.isSelected,
controlAffinity: ListTileControlAffinity.leading, controlAffinity: ListTileControlAffinity.leading,
onChanged: (bool? value) { onChanged: (bool? selected) {
setState(() { setState(() {
examinations?[index].isSelected = value ?? false; value?.isSelected = selected ?? false;
}); });
}, },
title: AppText( title: AppText(
examinations![index].name!, value.name!,
color: Color(0XFF575757), color: Color(0XFF575757),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
), ),
), ),
(examinations?[index].isSelected == true) (value.isSelected == true)
? Container( ? Container(
padding: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric(horizontal: 12),
child: Column( child: Column(
@ -93,16 +90,16 @@ class _ExaminationItemsState extends State<ExaminationItems> {
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: examinations?[index] itemCount: value
.conditionsList .conditionsList
?.length ?? ?.length ??
0, 0,
itemBuilder: (context, currentIndex) => InkWell( itemBuilder: (context, currentIndex) => InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
examinations?[index] value
.selectedCondition = .selectedCondition =
int.parse(examinations?[index] int.parse(value
.conditionsList?[ .conditionsList?[
currentIndex] currentIndex]
.conditionName ?? .conditionName ??
@ -125,10 +122,9 @@ class _ExaminationItemsState extends State<ExaminationItems> {
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: examinations?[index] color: value
.selectedCondition == .selectedCondition ==
int.parse(examinations?[ int.parse(value
index]
.conditionsList?[ .conditionsList?[
currentIndex] currentIndex]
.conditionName ?? .conditionName ??
@ -140,7 +136,7 @@ class _ExaminationItemsState extends State<ExaminationItems> {
), ),
), ),
AppText( AppText(
examinations?[index] value
.conditionsList?[ .conditionsList?[
currentIndex] currentIndex]
.conditionCode ?? .conditionCode ??
@ -325,7 +321,7 @@ class _ExaminationItemsState extends State<ExaminationItems> {
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
controller: examinations?[index].remarksController, controller: value.remarksController,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
@ -339,10 +335,316 @@ class _ExaminationItemsState extends State<ExaminationItems> {
) )
: SizedBox.shrink(), : SizedBox.shrink(),
], ],
),)?.toList() ?? []
// Expanded(
// child: ListView.builder(
// shrinkWrap: true,
// itemCount: examinations?.length ?? 0,
// itemBuilder: (context, index) => Column(
// children: [
// ListTileTheme(
// horizontalTitleGap: 0,
// child: CheckboxListTile(
// activeColor: Color(0xFFD02127),
// checkColor: Colors.white,
// contentPadding: EdgeInsets.zero,
// side: MaterialStateBorderSide.resolveWith(
// (Set<MaterialState> states) {
// if (states.contains(MaterialState.selected)) {
// return const BorderSide(color: Color(0xFFD02127));
// }
// return const BorderSide(color: Color(0xFFE6E6E6));
// },
// ),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(16)),
// value: examinations?[index].isSelected,
// controlAffinity: ListTileControlAffinity.leading,
// onChanged: (bool? value) {
// setState(() {
// examinations?[index].isSelected = value ?? false;
// });
// },
// title: AppText(
// examinations![index].name!,
// color: Color(0XFF575757),
// fontSize: 14,
// fontWeight: FontWeight.w400,
// ),
// ),
// ),
// (examinations?[index].isSelected == true)
// ? Container(
// padding: EdgeInsets.symmetric(horizontal: 12),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// margin: EdgeInsets.only(bottom: 8),
// child: AppText(
// TranslationBase.of(context).condition,
// fontWeight: FontWeight.bold,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ),
// SizedBox(
// width: MediaQuery.sizeOf(context).width,
// height: 24,
// child: ListView.builder(
// shrinkWrap: true,
// scrollDirection: Axis.horizontal,
// itemCount: examinations?[index]
// .conditionsList
// ?.length ??
// 0,
// itemBuilder: (context, currentIndex) => InkWell(
// onTap: () {
// setState(() {
// examinations?[index]
// .selectedCondition =
// int.parse(examinations?[index]
// .conditionsList?[
// currentIndex]
// .conditionName ??
// "-1");
// });
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin: EdgeInsets.symmetric(
// horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(
// color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: examinations?[index]
// .selectedCondition ==
// int.parse(examinations?[
// index]
// .conditionsList?[
// currentIndex]
// .conditionName ??
// "-1")
// ? HexColor("#D02127")
// : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// AppText(
// examinations?[index]
// .conditionsList?[
// currentIndex]
// .conditionCode ??
// '',
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize:
// SizeConfig.textMultiplier! *
// 1.6,
// ),
// ],
// ),
// )),
// ),
// // Row(
// // children: [
// // if(examinations?[index]
// // .conditionsList?.length == 1)
// // Expanded(
// // child: InkWell(
// // onTap: () {
// // setState(() {
// // examinations?[index].selectedCondition =
// // int.parse(examinations?[index]
// // .conditionsList?[0]
// // .conditionName ??
// // "-1");
// // });
// // },
// // child: Row(
// // children: [
// // Container(
// // padding: EdgeInsets.all(2.0),
// // margin:
// // EdgeInsets.symmetric(horizontal: 6),
// // width: 20,
// // height: 20,
// // decoration: BoxDecoration(
// // color: Colors.white,
// // shape: BoxShape.circle,
// // border: Border.all(
// // color: Colors.grey, width: 1),
// // ),
// // child: Container(
// // decoration: BoxDecoration(
// // color: examinations?[index].selectedCondition ==
// // int.parse(examinations?[index]
// // .conditionsList?[0]
// // .conditionName ??
// // "-1")
// // ? HexColor("#D02127")
// // : Colors.white,
// // shape: BoxShape.circle,
// // ),
// // ),
// // ),
// // AppText(
// // examinations?[index]
// // .conditionsList?[0]
// // .conditionCode ??
// // TranslationBase.of(context).normal,
// // fontWeight: FontWeight.normal,
// // fontFamily: 'Poppins',
// // fontSize:
// // SizeConfig.textMultiplier! * 1.6,
// // ),
// // ],
// // ),
// // )),
// // Expanded(
// // child: InkWell(
// // onTap: () {
// // setState(() {
// // setState(() {
// // examinations?[index].selectedCondition =
// // int.parse(examinations?[index]
// // .conditionsList?[1]
// // .conditionName ??
// // "-1");
// // });
// // });
// // },
// // child: Row(
// // children: [
// // Container(
// // padding: EdgeInsets.all(2.0),
// // margin:
// // EdgeInsets.symmetric(horizontal: 6),
// // width: 20,
// // height: 20,
// // decoration: BoxDecoration(
// // color: Colors.white,
// // shape: BoxShape.circle,
// // border: Border.all(
// // color: Colors.grey, width: 1),
// // ),
// // child: Container(
// // decoration: BoxDecoration(
// // color: examinations?[index].selectedCondition ==
// // int.parse(examinations?[index]
// // .conditionsList?[1]
// // .conditionName ??
// // "-1")
// // ? HexColor("#D02127")
// // : Colors.white,
// // shape: BoxShape.circle,
// // ),
// // ),
// // ),
// // AppText(
// // examinations?[index]
// // .conditionsList?[1]
// // .conditionCode ??
// // TranslationBase.of(context).abnormal,
// // fontWeight: FontWeight.normal,
// // fontFamily: 'Poppins',
// // fontSize:
// // SizeConfig.textMultiplier! * 1.6,
// // ),
// // ],
// // ),
// // )),
// // Expanded(
// // child: InkWell(
// // onTap: () {
// // setState(() {
// // setState(() {
// // examinations?[index].selectedCondition =
// // int.parse(examinations?[index]
// // .conditionsList?[2]
// // .conditionName ??
// // "-1");
// // });
// // });
// //
// // },
// // child: Row(
// // children: [
// // Container(
// // padding: EdgeInsets.all(2.0),
// // margin:
// // EdgeInsets.symmetric(horizontal: 6),
// // width: 20,
// // height: 20,
// // decoration: BoxDecoration(
// // color: Colors.white,
// // shape: BoxShape.circle,
// // border: Border.all(
// // color: Colors.grey, width: 1),
// // ),
// // child: Container(
// // decoration: BoxDecoration(
// // color: examinations?[index].selectedCondition ==
// // int.parse(examinations?[index]
// // .conditionsList?[2]
// // .conditionName ??
// // "-1")
// // ? HexColor("#D02127")
// // : Colors.white,
// // shape: BoxShape.circle,
// // ),
// // ),
// // ),
// // Expanded(
// // child: AppText(
// // examinations?[index]
// // .conditionsList?[2]
// // .conditionCode ??
// // TranslationBase.of(context).notExamined,
// // fontWeight: FontWeight.normal,
// // fontFamily: 'Poppins',
// // fontSize:
// // SizeConfig.textMultiplier! * 1.6,
// // ),
// // ),
// // ],
// // ),
// // )),
// // ],
// // ),
// Container(
// margin: EdgeInsets.only(top: 8),
// child: AppTextFieldCustom(
// hintText: TranslationBase.of(context).remarks,
// controller: examinations?[index].remarksController,
// minLines: 2,
// maxLines: 4,
// inputType: TextInputType.multiline,
// onChanged: (value) {},
// onClick: () {},
// onFieldSubmitted: () {},
// ),
// ),
// ],
// ),
// )
// : SizedBox.shrink(),
// ],
// ),
// ),
// ),
// ],
), ),
),
),
],
); );
} }
} }

@ -104,7 +104,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
widget.changeLoadingState(true); widget.changeLoadingState(true);
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
if (model.progressNote.isEmpty) { if (model.progressNote.isEmpty) {
await model.getProgressNote(widget.patientInfo); model.getProgressNote(widget.patientInfo);
} }
}); });
widget.changeLoadingState(false); widget.changeLoadingState(false);

@ -32,7 +32,7 @@ class UpdateSoapIndexVidaPlus extends StatefulWidget {
class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus> class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
with TickerProviderStateMixin { with TickerProviderStateMixin {
PageController? _controller; PageController? _controller;
int _currentIndex =2; int _currentIndex =3;
List<MySelectedAllergy> myAllergiesList = []; List<MySelectedAllergy> myAllergiesList = [];
List<MySelectedHistory> myHistoryList = []; List<MySelectedHistory> myHistoryList = [];
@ -97,32 +97,30 @@ class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
}, },
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
UpdatePlanPageVidaPlus(
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState, changeLoadingState: changeLoadingState,
sOAPViewModel: model,
changeStateFun: changeStateFun,
), ),
UpdateSubjectivePageVidaPlus(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePageVidaPlus( UpdateObjectivePageVidaPlus(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState), changeLoadingState: changeLoadingState),
UpdateAssessmentPage(
UpdatePlanPageVidaPlus(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState, changeLoadingState: changeLoadingState,
sOAPViewModel: model,
changeStateFun: changeStateFun,
), ),
UpdateSubjectivePageVidaPlus(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
], ],
), ),
) )

@ -1943,6 +1943,9 @@ class TranslationBase {
String get deletedRemarks => localizedValues['deletedRemarks']![locale.languageCode]!; String get deletedRemarks => localizedValues['deletedRemarks']![locale.languageCode]!;
String get noRemarks => localizedValues['noRemarks']![locale.languageCode]!; String get noRemarks => localizedValues['noRemarks']![locale.languageCode]!;
String get kindlySelectCategory => localizedValues['kindlySelectCategory']![locale.languageCode]!;
String get remarksCanNotBeEmpty => localizedValues['remarksCanNotBeEmpty']![locale.languageCode]!;
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save