WD: adding the physical examinatoin.

update_flutter_3.24_vida_plus_episode_v2
taha.alam 11 months ago
parent 5e31c9cf98
commit a1960c8799

@ -332,6 +332,10 @@ const SEARCH_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/SearchP
const GET_GENERAL_SPECIALITY = 'Services/DoctorApplication.svc/REST/GetGeneralSpeciality';
const GET_SPECIALITY_DETAILS = 'Services/DoctorApplication.svc/REST/SearchGeneralSpeciality';
const POST_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
var selectedPatientType = 1;

@ -485,6 +485,7 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "ملاحظات على نوع النظام الغذائي"
},
"save": {"en": "SAVE", "ar": "حفظ"},
"saveSmall": {"en": "Save", "ar": "حفظ"},
"postPlansEstimatedCost": {
"en": "POST PLANS & ESTIMATED COST",
"ar": "خطط ما بعد العملية والتكلفة المقدرة"

@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
class Condition {
String? conditionCode;
String? conditionName;
Condition();
Condition.fromJson(Map<String, dynamic> json) {
conditionCode = json['conditionCode'];
conditionName = json['conditionName'];
}
Map<String, dynamic> toJson() {
return {
'conditionCode': conditionCode,
'conditionName': conditionName,
};
}
}
class Category {
int? categoryId;
String? code;
String? codeAlias;
List<Condition>? conditionsList;
String? description;
String? descriptionAlias;
int? id;
bool? isActive;
bool? isBuiltin;
String? languageCode;
String? name;
String? nameAlias;
int? rowVersion;
int? specialityId;
String? specialityName;
List<dynamic>? translationValues;
bool isSelected = false;
TextEditingController remarksController = TextEditingController();
int selectedCondition = -1;
String? pomrId;
int? paitientId;
int? userID;
Category();
Category.fromJson(Map<String, dynamic> json,int? specialityId, String specialityName, String? pomrId, int paitientId, int userID) {
categoryId = json['categoryId'];
code = json['code'];
codeAlias = json['codeAlias'];
if (json['conditionsList'] != null) {
conditionsList = <Condition>[];
json['conditionsList'].forEach((v) {
conditionsList!.add(Condition.fromJson(v));
});
}
description = json['description'];
descriptionAlias = json['descriptionAlias'];
id = json['id'];
isActive = json['isActive'];
isBuiltin = json['isBuiltin'];
languageCode = json['languageCode'];
name = json['name'];
nameAlias = json['nameAlias'];
rowVersion = json['rowVersion'];
translationValues = json['translationValues'];
this.specialityName = specialityName;
this.specialityId = specialityId;
this.pomrId = pomrId;
this.paitientId = paitientId;
this.userID = userID;
}
Map<String, dynamic> toJson() {
return {
'categoryId': categoryId,
'code': code,
'codeAlias': codeAlias,
'conditionsList': conditionsList?.map((v) => v.toJson()).toList(),
'description': description,
'descriptionAlias': descriptionAlias,
'id': id,
'isActive': isActive,
'isBuiltin': isBuiltin,
'languageCode': languageCode,
'name': name,
'nameAlias': nameAlias,
'rowVersion': rowVersion,
'translationValues': translationValues,
};
}
}

@ -0,0 +1,71 @@
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/Category.dart';
class CreatePhysicalExamination {
bool? isChecked; // it will be told
bool? selected; // same as above
String? pomrid; // paitient
int? patientID; // paitint
bool? isClinicPhysicalExamination; // it will be told
int? physicalExaminationSystemID; // category id
String? physicalExaminationDescription; // name of the category
int? specialityID; // id of the specialitiy id
dynamic selectedOptions; // it will also be told but it could be sent as null
bool? isMandatory; // it will also be checked default value is false
String? specialityDescription; // name of the speciality
int? physicalExaminationCondition; // condition selected
String? loginUserId; // doctor id
String? remark;
CreatePhysicalExamination();
CreatePhysicalExamination.fromJson(Map<String, dynamic> json) {
isChecked = json['isChecked'];
selected = json['selected'];
pomrid = json['pomrid'];
patientID = json['patientID'];
isClinicPhysicalExamination = json['isClinicPhysicalExamination'];
physicalExaminationSystemID = json['physicalExaminationSystemID'];
physicalExaminationDescription = json['physicalExaminationDescription'];
specialityID = json['specialityID'];
selectedOptions = json['selectedOptions'];
isMandatory = json['isMandatory'];
specialityDescription = json['specialityDescription'];
physicalExaminationCondition = json['physicalExaminationCondition'];
loginUserId = json['loginUserId'];
remark = json['remark'];
}
Map<String, dynamic> toJson() {
return {
'isChecked': isChecked,
'selected': selected,
'pomrid': pomrid,
'patientID': patientID,
'isClinicPhysicalExamination': isClinicPhysicalExamination,
'physicalExaminationSystemID': physicalExaminationSystemID,
'physicalExaminationDescription': physicalExaminationDescription,
'specialityID': specialityID,
'selectedOptions': selectedOptions,
'isMandatory': isMandatory,
'specialityDescription': specialityDescription,
'physicalExaminationCondition': physicalExaminationCondition,
'loginUserId': loginUserId,
'remark': remark,
};
}
}
extension ConvertCategoryToCreatePhysicalExamination on Category {
CreatePhysicalExamination createPhysicalExaminationFromCategory() =>
CreatePhysicalExamination()
..physicalExaminationDescription = this.name
..physicalExaminationSystemID = this.categoryId
..physicalExaminationCondition = this.selectedCondition
..remark = this.remarksController.text
..selected = false
..isChecked = false
..specialityID = this.specialityId
..patientID = this.paitientId
..pomrid = this.pomrId
..loginUserId = this.userID?.toString();
}

@ -1,3 +1,4 @@
@deprecated
class PostPhysicalExaminationModel {
bool? isChecked;
bool? selected;

@ -12,6 +12,8 @@ import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/search_chief_
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/get_hopi_details.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/Category.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/CreatePhysicalExamination.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/post_physical_examination_model.dart';
@ -58,6 +60,7 @@ class SOAPService extends LookupService {
List<SearchDiagnosis> searchDiagnosisList = [];
List<PatientPhysicalExamination> patientPhysicalExaminationList = [];
List<GeneralSpeciality> generalSpeciality = [];
Map<String, List<Category>> specialityDetails = {};
Map<String, dynamic> diagnosisTypeList = {};
Map<String, dynamic> conditionTypeList = {};
List<String> icdVersionList = [];
@ -80,7 +83,8 @@ class SOAPService extends LookupService {
}, body: postEpisodeReqModel.toJson());
}
Future postEpisodeForInPatient(PostEpisodeForInpatientRequestModel
Future postEpisodeForInPatient(
PostEpisodeForInpatientRequestModel
postEpisodeForInpatientRequestModel) async {
hasError = false;
@ -281,8 +285,7 @@ class SOAPService extends LookupService {
print("Success");
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(
GetChiefComplaintResModel.fromJson(v));
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -313,8 +316,7 @@ class SOAPService extends LookupService {
print("Success");
patientProgressNoteList.clear();
response['ProgressNoteList']['entityList'].forEach((v) {
patientProgressNoteList.add(
GetPatientProgressNoteResModel.fromJson(v));
patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -409,8 +411,8 @@ class SOAPService extends LookupService {
}, body: {"AllergyName": searchKey});
}
Future addAllergies(AllergiesListVidaPlus allergy,
PatiantInformtion patientInfo) async {
Future addAllergies(
AllergiesListVidaPlus allergy, PatiantInformtion patientInfo) async {
allergy.allergyReactionDTOs!.forEach((value) {
value.patientID = patientInfo.patientMRN;
value.pomrid = int.parse(patientInfo.pomrId!);
@ -451,8 +453,8 @@ class SOAPService extends LookupService {
});
}
Future resolveAllergies(PatientAllergiesVidaPlus allergy,
PatiantInformtion patientInfo) async {
Future resolveAllergies(
PatientAllergiesVidaPlus allergy, PatiantInformtion patientInfo) async {
/*changed request parameters based on the vida plus requested */
var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER);
@ -500,8 +502,8 @@ class SOAPService extends LookupService {
});
}
Future updateAllergies(AllergiesListVidaPlus allergy,
PatiantInformtion patientInfo) async {
Future updateAllergies(
AllergiesListVidaPlus allergy, PatiantInformtion patientInfo) async {
allergy.allergyReactionDTOs!.forEach((value) {
value.patientID = patientInfo.patientMRN;
value.pomrid = patientInfo.episodeNo;
@ -552,7 +554,9 @@ class SOAPService extends LookupService {
"patientId": patient.patientMRN,
"patientPomrId": patient.pomrId,
};
Map<String, dynamic> finalRequest = {}..addAll(request)..addAll(req);
Map<String, dynamic> finalRequest = {}
..addAll(request)
..addAll(req);
hasError = false;
await baseAppClient.post(CREATE_HOPI,
onSuccess: (dynamic response, int statusCode) {
@ -602,8 +606,8 @@ class SOAPService extends LookupService {
}, body: request);
}
postChiefComplaintVidaPlus(PatiantInformtion patient,
String cheifComplaint) async {
postChiefComplaintVidaPlus(
PatiantInformtion patient, String cheifComplaint) async {
Map<String, dynamic> request = {
"ListCreateChiefComplaint": [
{
@ -636,8 +640,7 @@ class SOAPService extends LookupService {
searchChiefComplaintListVidaPlus.clear();
//
response['List_SearchChiefComplaint']['resultData'].forEach((v) {
searchChiefComplaintListVidaPlus.add(
SearchChiefComplaint.fromJson(v));
searchChiefComplaintListVidaPlus.add(SearchChiefComplaint.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
searchChiefComplaintListVidaPlus.clear();
@ -656,8 +659,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(SEARCH_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
response['List_Diagnosis']['resultData']
.forEach((v) =>
searchDiagnosisList.add(SearchDiagnosis.fromJson(v)));
.forEach((v) => searchDiagnosisList.add(SearchDiagnosis.fromJson(v)));
_processData();
}, onFailure: (String error, int statusCode) {
searchChiefComplaintListVidaPlus.clear();
@ -693,8 +695,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(DIAGNOSIS_TYPE,
onSuccess: (dynamic response, int statusCode) {
response['ListDiagnosisTypeModel']['resultData']
.forEach((v) =>
diagnosisTypeList[v['name']] = v['diagnosisType']);
.forEach((v) => diagnosisTypeList[v['name']] = v['diagnosisType']);
}, onFailure: (String error, int statusCode) {
searchChiefComplaintListVidaPlus.clear();
hasError = true;
@ -718,8 +719,10 @@ class SOAPService extends LookupService {
}, body: request);
}
auditDiagnosis(PatiantInformtion patient,
String patientProblemRevisionID,) async {
auditDiagnosis(
PatiantInformtion patient,
String patientProblemRevisionID,
) async {
Map<String, dynamic> request = {
"patientProblemRevisionId": patientProblemRevisionID,
"ProjectID": patient.projectId
@ -729,8 +732,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(AUDIT_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
response['ListDaignosisAudit']['resultData']
.forEach((v) =>
auditDiagnosislist.add(AuditDiagnosis.fromJson(v)));
.forEach((v) => auditDiagnosislist.add(AuditDiagnosis.fromJson(v)));
showAuditBottomSheet = auditDiagnosislist.isNotEmpty;
}, onFailure: (String error, int statusCode) {
auditDiagnosislist.clear();
@ -790,8 +792,7 @@ class SOAPService extends LookupService {
patientPreviousDiagnosisList.clear();
await baseAppClient.post(REMOVE_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast(
response['ListDiagnosisRemove']['message']);
DrAppToastMsg.showSuccesToast(response['ListDiagnosisRemove']['message']);
//todo get the current diagnosis after the delete if it is successful
}, onFailure: (String error, int statusCode) {
patientPreviousDiagnosisList.clear();
@ -800,7 +801,9 @@ class SOAPService extends LookupService {
}, body: request);
}
favoriteDiagnosis(PatiantInformtion patientInfo,) async {
favoriteDiagnosis(
PatiantInformtion patientInfo,
) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
Map<String, dynamic> request = {
@ -816,8 +819,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(FAVORITE_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
response['ListDiagnosisGetFavourite']['resultData'].forEach((v) =>
favoriteDiagnosisDetailsList.add(
FavoriteDiseaseDetails.fromJson(v)));
favoriteDiagnosisDetailsList.add(FavoriteDiseaseDetails.fromJson(v)));
}, onFailure: (String error, int statusCode) {
favoriteDiagnosisDetailsList.clear();
hasError = true;
@ -825,7 +827,9 @@ class SOAPService extends LookupService {
}, body: request);
}
getPhysicalExamination(PatiantInformtion patientInfo,) async {
getPhysicalExamination(
PatiantInformtion patientInfo,
) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
Map<String, dynamic> request = {
@ -840,8 +844,8 @@ class SOAPService extends LookupService {
await baseAppClient.post(SEARCH_PHYSICAL_EXAMINATION,
onSuccess: (dynamic response, int statusCode) {
response['ListPhysicalExam']['resultData'].forEach((v) =>
patientPhysicalExaminationList.add(
PatientPhysicalExamination.fromJson(v)));
patientPhysicalExaminationList
.add(PatientPhysicalExamination.fromJson(v)));
}, onFailure: (String error, int statusCode) {
physicalExaminationList.clear();
hasError = true;
@ -849,28 +853,31 @@ class SOAPService extends LookupService {
}, body: request);
}
postPhysicalExamination(PatiantInformtion patientInfo,List<PostPhysicalExaminationModel> physicalExamination) async {
var jsonListOfPhysicalExamination = [];
physicalExamination.forEach((value)=>jsonListOfPhysicalExamination.add(value.toJson()));
Future<bool> postPhysicalExamination(PatiantInformtion patientInfo,
List<Category> physicalExamination) async {
List<CreatePhysicalExamination> jsonListOfPhysicalExamination = [];
physicalExamination
.forEach((value) => jsonListOfPhysicalExamination.add(value.createPhysicalExaminationFromCategory()));
Map<String, dynamic> request = {
"ProjectID": patientInfo.patientId,
"listCreatPhysicalExam": jsonListOfPhysicalExamination
};
hasError = false;
await baseAppClient.post(SEARCH_PHYSICAL_EXAMINATION,
bool data = await baseAppClient.post(POST_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast(
response['ListPhysicalExam']['message']);
DrAppToastMsg.showSuccesToast(response['ListPhysicalExam']['message']);
return true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
return false;
}, body: request);
}
return data;
}
getGeneralSpeciality(PatiantInformtion patientInfo) async {
Map<String, dynamic> request = {
"ProjectID": patientInfo.patientId,
};
@ -878,9 +885,8 @@ class SOAPService extends LookupService {
generalSpeciality.clear();
await baseAppClient.post(GET_GENERAL_SPECIALITY,
onSuccess: (dynamic response, int statusCode) {
response['ListGeneralSpeciality']['resultData'].forEach((v) =>
generalSpeciality.add(
GeneralSpeciality.fromJson(v)));
response['ListGeneralSpeciality']['resultData']
.forEach((v) => generalSpeciality.add(GeneralSpeciality.fromJson(v)));
}, onFailure: (String error, int statusCode) {
hasError = true;
generalSpeciality.clear();
@ -955,6 +961,26 @@ class SOAPService extends LookupService {
}, body: request);
}
getSpecialityDetails(String speciality, int? specialityId,
PatiantInformtion patientInfo) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
var userId = user?['List_MemberInformation'][0]['MemberID'];
Map<String, dynamic> request = {"searchParam": speciality};
hasError = false;
List<Category> categoryData = [];
await baseAppClient.post(MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
response['ContinuePreviousEpisode']['resultData'].forEach(
(value) => categoryData.add(Category.fromJson(value, specialityId, speciality,patientInfo.pomrId,patientInfo.patientId,user?['List_MemberInformation'][0]['MemberID'])));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: request);
if (!hasError) {
specialityDetails[speciality] = categoryData;
}
}
createDiagnosis(PatiantInformtion patient, SearchDiagnosis searchDiagnosis,
int diagnosisType, String conditionType, String remarks, bool isNew) {
/*{

@ -25,6 +25,8 @@ import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_reques
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/Category.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/CreatePhysicalExamination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_list_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/patient_physical_examination.dart';
@ -144,8 +146,10 @@ class SOAPViewModel extends BaseViewModel {
List<AuditDiagnosis> get auditDiagnosislist =>
_SOAPService.auditDiagnosislist;
List<GeneralSpeciality> get speciality =>
_SOAPService.generalSpeciality;
List<GeneralSpeciality> get speciality => _SOAPService.generalSpeciality;
Map<String, List<Category>> get specialityDetails =>
_SOAPService.specialityDetails;
int? get episodeID => _SOAPService.episodeID;
@ -1173,21 +1177,33 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
void postPhysicalExamination(PatiantInformtion patientInfo,
List<PostPhysicalExaminationModel> physicalExamination) async {
Future<bool> postPhysicalExamination(PatiantInformtion patientInfo,
List<Category> physicalExamination) async {
setState(ViewState.BusyLocal);
await _SOAPService.postPhysicalExamination(
bool result = await _SOAPService.postPhysicalExamination(
patientInfo, physicalExamination);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
void getGeneralSpeciality(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.getGeneralSpeciality(
patientInfo);
await _SOAPService.getGeneralSpeciality(patientInfo);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
void getSpecialityDetails(String speciality,int? specialityId, PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.getSpecialityDetails(speciality,specialityId, patientInfo);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
@ -1202,4 +1218,15 @@ class SOAPViewModel extends BaseViewModel {
void toggleShowBottomSheetValue(bool status) {
_SOAPService.showAuditBottomSheet = status;
}
void savePhysicalexamination() {
var mappedItems =
setState(ViewState.BusyLocal);
// await _SOAPService.getSpecialityDetails(speciality);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciality.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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
@ -10,6 +12,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plu
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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -17,15 +20,20 @@ import '../../../../../core/viewModel/project_view_model.dart';
class AddDetailsToExaminationVidaPlus extends StatefulWidget {
final List<GeneralSpeciality>? mySelectedExamination;
final PatiantInformtion patientInfo;
const AddDetailsToExaminationVidaPlus({super.key, this.mySelectedExamination});
const AddDetailsToExaminationVidaPlus(
{super.key,
this.mySelectedExamination,
required this.patientInfo});
@override
State<AddDetailsToExaminationVidaPlus> createState() =>
_AddDetailsToExaminationVidaPlusState();
}
class _AddDetailsToExaminationVidaPlusState extends State<AddDetailsToExaminationVidaPlus> {
class _AddDetailsToExaminationVidaPlusState
extends State<AddDetailsToExaminationVidaPlus> {
bool isSysExaminationExpand = false;
@override
@ -33,10 +41,15 @@ class _AddDetailsToExaminationVidaPlusState extends State<AddDetailsToExaminatio
print('the widget is build');
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model) async {},
onModelReady: (model) async {
widget.mySelectedExamination?.forEach((value) =>
model.getSpecialityDetails(
value.name ?? '', value.id, widget.patientInfo));
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
isLoading: model.state == ViewState.BusyLocal,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).examinationPart),
backgroundColor: Colors.white,
@ -44,36 +57,71 @@ class _AddDetailsToExaminationVidaPlusState extends State<AddDetailsToExaminatio
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
// Expanded(
// child: ListView.separated(
// itemBuilder: (context, index) {
// return ExpandableSOAPWidget(
// headerTitle:,
// onTap: () {
// setState(() {
// isSysExaminationExpand = !isSysExaminationExpand;
// });
// },
// child: ExaminationItems(examination:widget.mySelectedExamination![index]),
// isExpanded: isSysExaminationExpand,
// );
//
// },
// separatorBuilder: (context, index) {
// return SizedBox(height: 8,);
// },
// itemCount: widget?.mySelectedExamination?.length ?? 0),
// ),
Expanded(
child: ListView.separated(
itemBuilder: (context, index) {
var title =
model.specialityDetails.keys.elementAt(index);
return ExpandableSOAPWidget(
headerTitle: title,
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: ExaminationItems(
examination: model.specialityDetails[title]),
isExpanded: isSysExaminationExpand,
);
},
separatorBuilder: (context, index) {
return SizedBox(
height: 8,
);
},
itemCount: model.specialityDetails.length ?? 0),
),
],
),
)));
),
bottomNavigationBar: Material(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).cancelSmall,
color: Color(0xffEAEAEA),
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () async {
Navigator.pop(context);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).saveSmall,
color: Color(0xff359846),
fontColor: Colors.white,
fontWeight: FontWeight.w600,
onPressed: () async {
model.savePhysicalexamination();
},
),
),
],
))),
));
}
}
/* Container(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(

@ -174,6 +174,7 @@ class _AddExaminationPageVidaPlusState
FadePage(
page: AddDetailsToExaminationVidaPlus(
mySelectedExamination: mySelectedExaminationLocal,
patientInfo: widget.patientInfo,
),
),
);

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/Category.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -10,7 +11,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class ExaminationItems extends StatefulWidget {
final MySelectedExamination? examination;
final List<Category>? examination;
const ExaminationItems({super.key, this.examination});
@ -21,21 +22,24 @@ class ExaminationItems extends StatefulWidget {
class _ExaminationItemsState extends State<ExaminationItems> {
bool isExpanded = false;
int status = 1;
TextEditingController remarksController = TextEditingController();
List<Category>? examinations;
@override
void initState() {
// TODO: implement initState
super.initState();
remarksController.text = widget.examination?.remark ?? "";
this.examinations = examinations;
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
Expanded(
child: ListView.builder(
itemCount: examinations?.length ?? 0,
itemBuilder: (context, index) => Column(
children: [
ListTileTheme(
horizontalTitleGap: 0,
@ -51,29 +55,24 @@ class _ExaminationItemsState extends State<ExaminationItems> {
return const BorderSide(color: Color(0xFFE6E6E6));
},
),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
value: isExpanded,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16)),
value: examinations?[index].isSelected,
controlAffinity: ListTileControlAffinity.leading,
onChanged: (bool? value) {
setState(() {
isExpanded = value ?? false;
examinations?[index].isSelected = value ?? false;
});
},
title: AppText(
projectViewModel.isArabic
? widget.examination!.selectedExamination!.nameAr != null &&
widget.examination!.selectedExamination!.nameAr != ""
? widget.examination!.selectedExamination!.nameAr!
: widget.examination!.selectedExamination!.nameEn!
: widget.examination!.selectedExamination!.nameEn!,
examinations![index].name!,
color: Color(0XFF575757),
fontSize: 14,
fontWeight: FontWeight.w400,
),
),
),
(isExpanded)
(examinations?[index].isSelected == true)
? Container(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
@ -88,106 +87,34 @@ class _ExaminationItemsState extends State<ExaminationItems> {
fontSize: SizeConfig.textMultiplier! * 1.6,
),
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 1;
});
widget.examination!.isNormal = true;
widget.examination!.isAbnormal = false;
widget.examination!.notExamined = false;
},
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: status == 1
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).normal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
)),
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 2;
});
widget.examination!.isNormal = false;
widget.examination!.isAbnormal = true;
widget.examination!.notExamined = false;
},
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: status == 2
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).abnormal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
)),
if (widget.examination?.isLocal == false)
Expanded(
child: InkWell(
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(() {
status = 3;
examinations?[index]
.selectedCondition =
int.parse(examinations?[index]
.conditionsList?[
currentIndex]
.conditionName ??
"-1");
});
widget.examination!.isNormal = false;
widget.examination!.isAbnormal = false;
widget.examination!.notExamined = true;
},
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
margin: EdgeInsets.symmetric(
horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
@ -198,37 +125,211 @@ class _ExaminationItemsState extends State<ExaminationItems> {
),
child: Container(
decoration: BoxDecoration(
color: status == 3
color: examinations?[index]
.selectedCondition ==
int.parse(examinations?[
index]
.conditionsList?[
currentIndex]
.conditionName ??
"-1")
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
Expanded(
child: AppText(
TranslationBase.of(context).notExamined,
AppText(
examinations?[index]
.conditionsList?[
currentIndex]
.conditionCode ??
'',
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
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: remarksController,
controller: examinations?[index].remarksController,
minLines: 2,
maxLines: 4,
inputType: TextInputType.multiline,
onChanged: (value) {
widget.examination!.remark = value;
},
onChanged: (value) {},
onClick: () {},
onFieldSubmitted: () {},
),
@ -237,10 +338,10 @@ class _ExaminationItemsState extends State<ExaminationItems> {
),
)
: SizedBox.shrink(),
SizedBox(
height: 8,
],
),
),
),
Divider()
],
);
}

@ -503,6 +503,7 @@ class TranslationBase {
String get cancel => localizedValues['cancel']![locale.languageCode]!;
String get cancelSmall => localizedValues['cancelSmall']![locale.languageCode]!;
String get saveSmall => localizedValues['saveSmall']![locale.languageCode]!;
String get ok => localizedValues['ok']![locale.languageCode]!;

Loading…
Cancel
Save