diff --git a/assets/images/svgs/favoriteadded.svg b/assets/images/svgs/favoriteadded.svg
new file mode 100644
index 00000000..3b4577cf
--- /dev/null
+++ b/assets/images/svgs/favoriteadded.svg
@@ -0,0 +1,3 @@
+
diff --git a/lib/config/config.dart b/lib/config/config.dart
index ad086d11..b7dd3ee2 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -308,6 +308,26 @@ const UPDATE_ALLERGIES = 'Services/DoctorApplication.svc/REST/UpdateAllergy';
const GET_CHIEF_COMPLAINT_VP = 'Services/DoctorApplication.svc/REST/ChiefComplaintDetails';
+const SEARCH_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/SearchDiagnosis';
+
+const DIAGNOSIS_TYPE = 'Services/DoctorApplication.svc/REST/DiagnosisType';
+
+const CONDITION_TYPE = 'Services/DoctorApplication.svc/REST/DiagnosisCondition';
+
+const CREATE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/CreateDiagnosis';
+
+const PREVIOUS_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisPreviousDetails';
+
+const AUDIT_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisAudit';
+
+const REMOVE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisRemove';
+
+const FAVORITE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisGetFavourite';
+
+const ADD_TO_FAVORITE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisAddFavourite';
+
+const MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/ContinuePreviousEpisode';
+
var selectedPatientType = 1;
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 22b0cc41..b8d6f97f 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -1203,7 +1203,17 @@ const Map> localizedValues = {
"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":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"},
"mild": {"en": "Mild", "ar":"خفيف"},
- "moderate": {"en": "Moderate", "ar":"معتدل"},
+ "noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"},
+ "event": {"en": "Event: ", "ar":"حدث: "},
+ "deletedRemarks": {"en": "Deleted Remarks: ", "ar":"ملاحظات محذوفة: "},
+ "newValue": {"en": "New Value: ", "ar":"قيمة جديدة: "},
+ "fieldName": {"en": "Field Name: ", "ar":"اسم الحقل: "},
+ "oldValue": {"en": "Old Value: ", "ar":"القيمة القديمة: "},
+ "favoriteDiagnosis": {"en": "Favorite Diagnosis", "ar":"التشخيص المفضل"},
+ "addToFavorite": {"en": "Add To Favorite", "ar":"إضافة إلى المفضلة"},
"noDiagnosisFound": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"},
-
+ "areYouSureYouWantToDeleteDiagnosis": {
+ "en": "Are you sure you want to delete diagnosis",
+ "ar": "هل أنت متأكد من أنك تريد حذف التشخيص"
+ }
};
diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart
index 04608719..514caf56 100644
--- a/lib/core/enum/master_lookup_key.dart
+++ b/lib/core/enum/master_lookup_key.dart
@@ -5,7 +5,7 @@ enum MasterKeysService {
HistorySocial,
HistorySports,
HistorySurgical,
- PhysicalExamination,
+ PostPhysicalExaminationModel,
AllergySeverity,
physiotherapyGoals,
DiagnosisCondition,
@@ -45,7 +45,7 @@ extension SelectedMasterKeysService on MasterKeysService {
case MasterKeysService.HistorySurgical:
return 66;
break;
- case MasterKeysService.PhysicalExamination:
+ case MasterKeysService.PostPhysicalExaminationModel:
return 59;
break;
case MasterKeysService.AllergySeverity:
diff --git a/lib/core/model/SOAP/assessment/FavoriteDiseaseDetails.dart b/lib/core/model/SOAP/assessment/FavoriteDiseaseDetails.dart
new file mode 100644
index 00000000..19614800
--- /dev/null
+++ b/lib/core/model/SOAP/assessment/FavoriteDiseaseDetails.dart
@@ -0,0 +1,92 @@
+class FavoriteDiseaseDetails {
+ String? categoryCode;
+ int? categoryId;
+ String? chapterCode;
+ String? codeRange;
+ String? createdBy;
+ String? diseaseType;
+ String? diseases;
+ String? diseasesCode;
+ int? diseasesId;
+ int? favoritesId;
+ int? hospitalGroupId;
+ int? hospitalId;
+ int? icdId;
+ String? icdSubVersion;
+ String? icdType;
+ String? icdVersion;
+ bool? isDeleted;
+ String? parentDiseasesCode;
+ String? problemCode;
+ String? problemDescription;
+ int? problemMasterId;
+ int? problemMasterRevisionId;
+ String? problemName;
+ String? problemType;
+ String? rowVersion;
+ String? sectionCode;
+ int? specificationId;
+
+ FavoriteDiseaseDetails.fromJson(Map json) {
+ categoryCode = json['CategoryCode'];
+ categoryId = json['CategoryId'];
+ chapterCode = json['ChapterCode'];
+ codeRange = json['CodeRange'];
+ createdBy = json['CreatedBy'];
+ diseaseType = json['DiseaseType'];
+ diseases = json['Diseases'];
+ diseasesCode = json['DiseasesCode'];
+ diseasesId = json['DiseasesId'];
+ favoritesId = json['FavoritesId'];
+ hospitalGroupId = json['HospitalGroupID'];
+ hospitalId = json['HospitalID'];
+ icdId = json['IcdId'];
+ icdSubVersion = json['IcdSubVersion'];
+ icdType = json['IcdType'];
+ icdVersion = json['IcdVersion'];
+ isDeleted = json['IsDeleted'];
+ parentDiseasesCode = json['ParentDiseasesCode'];
+ problemCode = json['ProblemCode'];
+ problemDescription = json['ProblemDescription'];
+ problemMasterId = json['ProblemMasterID'];
+ problemMasterRevisionId = json['ProblemMasterRevisionID'];
+ problemName = json['ProblemName'];
+ problemType = json['ProblemType'];
+ rowVersion = json['RowVersion'];
+ sectionCode = json['SectionCode'];
+ specificationId = json['SpecificationId'];
+ }
+
+ // toJson method
+ Map toJson() {
+ return {
+ 'CategoryCode': categoryCode,
+ 'CategoryId': categoryId,
+ 'ChapterCode': chapterCode,
+ 'CodeRange': codeRange,
+ 'CreatedBy': createdBy,
+ 'DiseaseType': diseaseType,
+ 'Diseases': diseases,
+ 'DiseasesCode': diseasesCode,
+ 'DiseasesId': diseasesId,
+ 'FavoritesId': favoritesId,
+ 'HospitalGroupID': hospitalGroupId,
+ 'HospitalID': hospitalId,
+ 'IcdId': icdId,
+ 'IcdSubVersion': icdSubVersion,
+ 'IcdType': icdType,
+ 'IcdVersion': icdVersion,
+ 'IsDeleted': isDeleted,
+ 'ParentDiseasesCode': parentDiseasesCode,
+ 'ProblemCode': problemCode,
+ 'ProblemDescription': problemDescription,
+ 'ProblemMasterID': problemMasterId,
+ 'ProblemMasterRevisionID': problemMasterRevisionId,
+ 'ProblemName': problemName,
+ 'ProblemType': problemType,
+ 'RowVersion': rowVersion,
+ 'SectionCode': sectionCode,
+ 'SpecificationId': specificationId,
+ };
+ }
+}
\ No newline at end of file
diff --git a/lib/core/model/SOAP/assessment/audit_diagnosis.dart b/lib/core/model/SOAP/assessment/audit_diagnosis.dart
new file mode 100644
index 00000000..ac7abbdc
--- /dev/null
+++ b/lib/core/model/SOAP/assessment/audit_diagnosis.dart
@@ -0,0 +1,37 @@
+class AuditDiagnosis {
+ String? approvedBy;
+ String? approvedOn;
+ String? createdBy;
+ String? createdOn;
+ String? deletedBy;
+ String? deletedOn;
+ String? deletedRemarks;
+ String? diagnosisType;
+ bool? isEventIdentifiedExternally;
+ bool? isResolved;
+ String? modifiedBy;
+ String? modifiedOn;
+ int? patientId;
+ int? patientProblemRevisionId;
+ String? remarks;
+ String? status;
+
+ AuditDiagnosis.fromJson(Map json) {
+ approvedBy = json['approvedBy'];
+ approvedOn = json['approvedOn'];
+ createdBy = json['createdBy'];
+ createdOn = json['createdOn'];
+ deletedBy = json['deletedBy'];
+ deletedOn = json['deletedOn'];
+ deletedRemarks = json['deletedRemarks'];
+ diagnosisType = json['diagnosisType'];
+ isEventIdentifiedExternally = json['isEventIdentifiedExternally'];
+ isResolved = json['isResolved'];
+ modifiedBy = json['modifiedBy'];
+ modifiedOn = json['modifiedOn'];
+ patientId = json['patientId'];
+ patientProblemRevisionId = json['patientProblemRevisionId'];
+ remarks = json['remarks'];
+ status = json['status'];
+ }
+}
\ No newline at end of file
diff --git a/lib/core/model/SOAP/assessment/diagnosis_type.dart b/lib/core/model/SOAP/assessment/diagnosis_type.dart
new file mode 100644
index 00000000..549342d0
--- /dev/null
+++ b/lib/core/model/SOAP/assessment/diagnosis_type.dart
@@ -0,0 +1,10 @@
+class DiagnosisType {
+ String? diagnosisType;
+ String? name;
+
+
+ DiagnosisType.fromJson(Map json) {
+ diagnosisType = json['diagnosisType'] ?? '';
+ name = json['name'] ?? '';
+ }
+}
\ No newline at end of file
diff --git a/lib/core/model/SOAP/assessment/patient_previous_diagnosis.dart b/lib/core/model/SOAP/assessment/patient_previous_diagnosis.dart
new file mode 100644
index 00000000..0cc2401e
--- /dev/null
+++ b/lib/core/model/SOAP/assessment/patient_previous_diagnosis.dart
@@ -0,0 +1,190 @@
+class PatientPreviousDiagnosis {
+ bool? active;
+ int? admissionId;
+ int? admissionRequestId;
+ int? appointmentId;
+ String? approvedBy;
+ String? approvedOn;
+ int? assessmentId;
+ int? chiefComplainId;
+ int? clinicGroupId;
+ int? clinicId;
+ String? condition;
+ String? createdBy;
+ String? createdOn;
+ String? deletedBy;
+ String? deletedByDoctorName;
+ String? deletedOn;
+ String? deletedRemarks;
+ String? diagnosisType;
+ int? doctorId;
+ int? episodeId;
+ int? hospitalGroupId;
+ int? hospitalId;
+ dynamic icdCodeDetailsDto;
+ String? icdSubVersion;
+ String? icdType;
+ dynamic icdVersion;
+ String? location;
+ String? loginUserId;
+ String? modifiedBy;
+ String? modifiedOn;
+ String? module;
+ String? parentLocation;
+ int? patientId;
+ dynamic patientProblemChangeHistories;
+ int? patientProblemId;
+ int? patientProblemRevisionId;
+ int? pomrId;
+ bool? previousProblem;
+ int? problemId;
+ String? problemName;
+ String? remarks;
+ bool? resolved;
+ String? selectedCategoryCode;
+ String? selectedChapterCode;
+ String? selectedDisease;
+ String? selectedIcdCode;
+ String? selectedSectionCode;
+ String? status;
+ List? visitWisePatientDiagnoses;
+ bool? visitWiseSelected;
+
+ PatientPreviousDiagnosis.fromJson(Map json) {
+ active = json['active'];
+ admissionId = json['admissionId'];
+ admissionRequestId = json['admissionRequestId'];
+ appointmentId = json['appointmentId'];
+ approvedBy = json['approvedBy'];
+ approvedOn = json['approvedOn'];
+ assessmentId = json['assessmentId'];
+ chiefComplainId = json['chiefComplainId'];
+ clinicGroupId = json['clinicGroupId'];
+ clinicId = json['clinicId'];
+ condition = json['condition'];
+ createdBy = json['createdBy'];
+ createdOn = json['createdOn'];
+ deletedBy = json['deletedBy'];
+ deletedByDoctorName = json['deletedByDoctorName'];
+ deletedOn = json['deletedOn'];
+ deletedRemarks = json['deletedRemarks'];
+ diagnosisType = json['diagnosisType'];
+ doctorId = json['doctorId'];
+ episodeId = json['episodeId'];
+ hospitalGroupId = json['hospitalGroupId'];
+ hospitalId = json['hospitalId'];
+ icdCodeDetailsDto = json['icdCodeDetailsDto'];
+ icdSubVersion = json['icdSubVersion'];
+ icdType = json['icdType'];
+ icdVersion = json['icdVersion'];
+ location = json['location'];
+ loginUserId = json['loginUserId'];
+ modifiedBy = json['modifiedBy'];
+ modifiedOn = json['modifiedOn'];
+ module = json['module'];
+ parentLocation = json['parentLocation'];
+ patientId = json['patientId'];
+ patientProblemChangeHistories = json['patientProblemChangeHistories'];
+ patientProblemId = json['patientProblemId'];
+ patientProblemRevisionId = json['patientProblemRevisionId'];
+ pomrId = json['pomrId'];
+ previousProblem = json['previousProblem'];
+ problemId = json['problemId'];
+ problemName = json['problemName'];
+ remarks = json['remarks'];
+ resolved = json['resolved'];
+ selectedCategoryCode = json['selectedCategoryCode'];
+ selectedChapterCode = json['selectedChapterCode'];
+ selectedDisease = json['selectedDisease'];
+ selectedIcdCode = json['selectedIcdCode'];
+ selectedSectionCode = json['selectedSectionCode'];
+ status = json['status'];
+ visitWiseSelected = json['visitWiseSelected'];
+ if (json['visitWisePatientDiagnoses'] != null) {
+ visitWisePatientDiagnoses = [];
+ json['visitWisePatientDiagnoses'].forEach((v) {
+ visitWisePatientDiagnoses!.add(VisitWisePatientDiagnosis.fromJson(v));
+ });
+ }
+ }
+}
+
+class VisitWisePatientDiagnosis {
+ bool? active;
+ int? admissionId;
+ int? appointmentId;
+ String? approvedBy;
+ String? approvedOn;
+ int? assessmentId;
+ int? clinicId;
+ String? condition;
+ String? createdBy;
+ String? createdOn;
+ String? deletedBy;
+ String? deletedOn;
+ String? deletedRemarks;
+ String? diagnosisType;
+ int? doctorId;
+ int? episodeId;
+ int? hospitalGroupId;
+ int? hospitalId;
+ String? icdSubVersion;
+ String? icdType;
+ dynamic icdVersion; // Adjust type if necessary
+ bool? isPreviousProblem;
+ String? location;
+ String? loginUserId;
+ String? modifiedBy;
+ String? modifiedOn;
+ int? patientDiagnosisId;
+ int? patientId;
+ int? patientProblemRevisionId;
+ int? pomrId;
+ String? problemName;
+ String? remarks;
+ bool? resolved;
+ bool? selected;
+ String? selectedDisease;
+ int? selectedDoctorId;
+ String? selectedIcdCode;
+
+ VisitWisePatientDiagnosis.fromJson(Map json) {
+ active = json['active'];
+ admissionId = json['admissionId'];
+ appointmentId = json['appointmentId'];
+ approvedBy = json['approvedBy'];
+ approvedOn = json['approvedOn'];
+ assessmentId = json['assessmentId'];
+ clinicId = json['clinicId'];
+ condition = json['condition'];
+ createdBy = json['createdBy'];
+ createdOn = json['createdOn'];
+ deletedBy = json['deletedBy'];
+ deletedOn = json['deletedOn'];
+ deletedRemarks = json['deletedRemarks'];
+ diagnosisType = json['diagnosisType'];
+ doctorId = json['doctorId'];
+ episodeId = json['episodeId'];
+ hospitalGroupId = json['hospitalGroupId'];
+ hospitalId = json['hospitalId'];
+ icdSubVersion = json['icdSubVersion'];
+ icdType = json['icdType'];
+ icdVersion = json['icdVersion'];
+ isPreviousProblem = json['isPreviousProblem'];
+ location = json['location'];
+ loginUserId = json['loginUserId'];
+ modifiedBy = json['modifiedBy'];
+ modifiedOn = json['modifiedOn'];
+ patientDiagnosisId = json['patientDiagnosisId'];
+ patientId = json['patientId'];
+ patientProblemRevisionId = json['patientProblemRevisionId'];
+ pomrId = json['pomrId'];
+ problemName = json['problemName'];
+ remarks = json['remarks'];
+ resolved = json['resolved'];
+ selected = json['selected'];
+ selectedDisease = json['selectedDisease'];
+ selectedDoctorId = json['selectedDoctorId'];
+ selectedIcdCode = json['selectedIcdCode'];
+ }
+}
\ No newline at end of file
diff --git a/lib/core/model/SOAP/assessment/search_diagnosis.dart b/lib/core/model/SOAP/assessment/search_diagnosis.dart
new file mode 100644
index 00000000..832ff167
--- /dev/null
+++ b/lib/core/model/SOAP/assessment/search_diagnosis.dart
@@ -0,0 +1,83 @@
+class SearchDiagnosis {
+ String? category;
+ String? categoryId;
+ String? codeRange;
+ String? diseaseType;
+ String? diseases;
+ String? diseasesBCode;
+ String? diseasesCode;
+ String? diseasesDataId;
+ String? diseasesId;
+ String? diseasesName;
+ int? hospitalGroupId;
+ int? hospitalId;
+ String? icdSubVersion;
+ String? icdType;
+ List? icdVersion;
+ String? icdVersionDisplay;
+ bool? isDeleted;
+ String? layerID;
+ String? parentDiseasesCode;
+ String? specification;
+ int? specificationId;
+ String? specificationNo;
+
+ // Default constructor
+ SearchDiagnosis();
+
+ // fromJson constructor
+ SearchDiagnosis.fromJson(Map json) {
+ category = json['category'];
+ categoryId = json['categoryId'];
+ codeRange = json['codeRange'];
+ diseaseType = json['diseaseType'];
+ diseases = json['diseases'];
+ diseasesBCode = json['diseasesBCode'];
+ diseasesCode = json['diseasesCode'];
+ diseasesDataId = json['diseasesDataId'];
+ diseasesId = json['diseasesId'];
+ diseasesName = json['diseasesName'];
+ hospitalGroupId = json['hospitalGroupId'];
+ hospitalId = json['hospitalId'];
+ icdSubVersion = json['icdSubVersion'];
+ icdType = json['icdType'];
+ icdVersion = json['icdVersion'] != null
+ ? List.from(json['icdVersion'])
+ : null;
+ icdVersionDisplay = json['icdVersionDisplay'];
+ isDeleted = json['isDeleted'] == "True";
+ layerID = json['layerID'];
+ parentDiseasesCode = json['parentDiseasesCode'];
+ specification = json['specification'];
+ specificationId = json['specificationId'];
+ specificationNo = json['specificationNo'];
+ }
+
+ // toJson method
+ Map toJson() {
+ return {
+ 'category': category,
+ 'categoryId': categoryId,
+ 'codeRange': codeRange,
+ 'diseaseType': diseaseType,
+ 'diseases': diseases,
+ 'diseasesBCode': diseasesBCode,
+ 'diseasesCode': diseasesCode,
+ 'diseasesDataId': diseasesDataId,
+ 'diseasesId': diseasesId,
+ 'diseasesName': diseasesName,
+ 'hospitalGroupId': hospitalGroupId,
+ 'hospitalId': hospitalId,
+ 'icdSubVersion': icdSubVersion,
+ 'icdType': icdType,
+ 'icdVersion': icdVersion,
+ 'icdVersionDisplay': icdVersionDisplay,
+ 'isDeleted': isDeleted.toString(),
+ 'layerID': layerID,
+ 'parentDiseasesCode': parentDiseasesCode,
+ 'specification': specification,
+ 'specificationId': specificationId,
+ 'specificationNo': specificationNo,
+ };
+ }
+}
\ No newline at end of file
diff --git a/lib/core/model/SOAP/physical_exam/patient_physical_examination.dart b/lib/core/model/SOAP/physical_exam/patient_physical_examination.dart
new file mode 100644
index 00000000..9938648f
--- /dev/null
+++ b/lib/core/model/SOAP/physical_exam/patient_physical_examination.dart
@@ -0,0 +1,97 @@
+class PatientPhysicalExamination {
+ int? patientPhysicalExaminationRevisionID;
+ int? patientPhysicalExaminationID;
+ int? patientID;
+ int? physicalExaminationSystemID;
+ String? physicalExaminationDescription;
+ int? physicalExaminationCondition;
+ String? remark;
+ int? assessmentId;
+ String? userType;
+ int? specialtyID;
+ String? specialityDescription;
+ String? loginUserId;
+ bool? isMandatory;
+ String? examinationType;
+ dynamic additionalParams; // Use dynamic for null or varied types
+ int? hospitalGroupID;
+ int? hospitalID;
+ int? dbCRUDOperation;
+ bool? isActive;
+ int? createdBy;
+ String? createdOn;
+ int? modifiedBy;
+ String? modifiedOn;
+ int? approvedBy;
+ String? approvedOn;
+ String? rowVersion;
+ int? pomrid;
+
+ // Default constructor
+ PatientPhysicalExamination();
+
+ // fromJson constructor
+ PatientPhysicalExamination.fromJson(Map json) {
+ patientPhysicalExaminationRevisionID =
+ json['patientPhysicalExaminationRevisionID'];
+ patientPhysicalExaminationID = json['patientPhysicalExaminationID'];
+ patientID = json['patientID'];
+ physicalExaminationSystemID = json['physicalExaminationSystemID'];
+ physicalExaminationDescription = json['physicalExaminationDescription'];
+ physicalExaminationCondition = json['physicalExaminationCondition'];
+ remark = json['remark'];
+ assessmentId = json['assessmentId'];
+ userType = json['userType'];
+ specialtyID = json['specialtyID'];
+ specialityDescription = json['specialityDescription'];
+ loginUserId = json['loginUserId'];
+ isMandatory = json['isMandatory'];
+ examinationType = json['examinationType'];
+ additionalParams = json['additionalParams'];
+ hospitalGroupID = json['hospitalGroupID'];
+ hospitalID = json['hospitalID'];
+ dbCRUDOperation = json['dbCRUDOperation'];
+ isActive = json['isActive'];
+ createdBy = json['createdBy'];
+ createdOn = json['createdOn'];
+ modifiedBy = json['modifiedBy'];
+ modifiedOn = json['modifiedOn'];
+ approvedBy = json['approvedBy'];
+ approvedOn = json['approvedOn'];
+ rowVersion = json['rowVersion'];
+ pomrid = json['pomrid'];
+ }
+
+ // toJson method
+ Map toJson() {
+ return {
+ 'patientPhysicalExaminationRevisionID': patientPhysicalExaminationRevisionID,
+ 'patientPhysicalExaminationID': patientPhysicalExaminationID,
+ 'patientID': patientID,
+ 'physicalExaminationSystemID': physicalExaminationSystemID,
+ 'physicalExaminationDescription': physicalExaminationDescription,
+ 'physicalExaminationCondition': physicalExaminationCondition,
+ 'remark': remark,
+ 'assessmentId': assessmentId,
+ 'userType': userType,
+ 'specialtyID': specialtyID,
+ 'specialityDescription': specialityDescription,
+ 'loginUserId': loginUserId,
+ 'isMandatory': isMandatory,
+ 'examinationType': examinationType,
+ 'additionalParams': additionalParams,
+ 'hospitalGroupID': hospitalGroupID,
+ 'hospitalID': hospitalID,
+ 'dbCRUDOperation': dbCRUDOperation,
+ 'isActive': isActive,
+ 'createdBy': createdBy,
+ 'createdOn': createdOn,
+ 'modifiedBy': modifiedBy,
+ 'modifiedOn': modifiedOn,
+ 'approvedBy': approvedBy,
+ 'approvedOn': approvedOn,
+ 'rowVersion': rowVersion,
+ 'pomrid': pomrid,
+ };
+ }
+}
diff --git a/lib/core/model/SOAP/physical_exam/post_physical_examination_model.dart b/lib/core/model/SOAP/physical_exam/post_physical_examination_model.dart
new file mode 100644
index 00000000..127b5e49
--- /dev/null
+++ b/lib/core/model/SOAP/physical_exam/post_physical_examination_model.dart
@@ -0,0 +1,54 @@
+class PostPhysicalExaminationModel {
+ bool? isChecked;
+ bool? selected;
+ int? pomrid;
+ int? patientID;
+ bool? isClinicPhysicalExamination;
+ int? physicalExaminationSystemID;
+ String? physicalExaminationDescription;
+ int? specialityID;
+ dynamic selectedOptions;
+ bool? isMandatory;
+ String? specialityDescription;
+ int? physicalExaminationCondition;
+ String? loginUserId;
+ String? remark;
+
+ PostPhysicalExaminationModel();
+
+ PostPhysicalExaminationModel.fromJson(Map 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 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,
+ };
+ }
+}
\ No newline at end of file
diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart
index b9f6a69f..d7254814 100644
--- a/lib/core/service/base/lookup-service.dart
+++ b/lib/core/service/base/lookup-service.dart
@@ -109,7 +109,7 @@ class LookupService extends BaseService {
_historySurgicalList.add(MasterKeyModel.fromJson(v));
});
break;
- case MasterKeysService.PhysicalExamination:
+ case MasterKeysService.PostPhysicalExaminationModel:
_physicalExaminationList.clear();
entryList.forEach((v) {
_physicalExaminationList.add(MasterKeyModel.fromJson(v));
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 e6321cd3..7fc58e7a 100644
--- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart
+++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart
@@ -3,11 +3,16 @@ import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_mod
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart';
import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/FavoriteDiseaseDetails.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/audit_diagnosis.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/patient_previous_diagnosis.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/search_diagnosis.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_vida_plus.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/search_chief_complaint_vidaplus.dart';
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/patient_physical_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart';
@@ -25,11 +30,8 @@ import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_e
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart';
-import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
-import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
-import 'package:http/http.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../utils/date-utils.dart';
import '../../../model/SOAP/assessment/patch_assessment_req_model.dart';
@@ -48,6 +50,16 @@ class SOAPService extends LookupService {
List hopiDetails = [];
List patientChiefComplaintListVidaPlus = [];
List searchChiefComplaintListVidaPlus = [];
+ List patientPreviousDiagnosisList = [];
+ List favoriteDiagnosisDetailsList = [];
+ List auditDiagnosislist = [];
+ List searchDiagnosisList = [];
+ List patientPhysicalExaminationList = [];
+ Map diagnosisTypeList = {};
+ Map conditionTypeList = {};
+ List icdVersionList = [];
+ bool addedToFavorite = false;
+ bool showAuditBottomSheet = false;
int? episodeID;
bool isPrescriptionOrder = false;
@@ -426,7 +438,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(POST_ALLERGIES,
onSuccess: (dynamic response, int statusCode) {
- DrAppToastMsg.showSuccesToast("Allergies Saved Successfully");
+ DrAppToastMsg.showSuccesToast("Allergies Saved Successfully");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@@ -437,10 +449,8 @@ class SOAPService extends LookupService {
Future resolveAllergies(
PatientAllergiesVidaPlus allergy, PatiantInformtion patientInfo) async {
-
/*changed request parameters based on the vida plus requested */
-
var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER);
List? reaction =
allergy.patientsAllergyReactionsDTOs!;
@@ -464,7 +474,7 @@ class SOAPService extends LookupService {
"allergyTypeName": allergy.allergyTypeName,
"assessmentId": 0,
"isActive": allergy.isActivePatientsAllergy,
- "patientsAllergyReactionsDTOs":reactionRequest,
+ "patientsAllergyReactionsDTOs": reactionRequest,
"dbCRUDOperation": 2,
"allergyID": allergy.allergyID,
"allergyName": allergy.allergyName,
@@ -477,7 +487,7 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(RESOLVE_ALLERGIES,
onSuccess: (dynamic response, int statusCode) {
- DrAppToastMsg.showSuccesToast("Resolved Successfully");
+ DrAppToastMsg.showSuccesToast("Resolved Successfully");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@@ -519,7 +529,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(UPDATE_ALLERGIES,
onSuccess: (dynamic response, int statusCode) {
- DrAppToastMsg.showSuccesToast("Allergies Saved Successfully");
+ DrAppToastMsg.showSuccesToast("Allergies Saved Successfully");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@@ -544,7 +554,7 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(CREATE_HOPI,
onSuccess: (dynamic response, int statusCode) {
- DrAppToastMsg.showSuccesToast("History Saved Successfully");
+ DrAppToastMsg.showSuccesToast("History Saved Successfully");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@@ -581,7 +591,8 @@ class SOAPService extends LookupService {
patientChiefComplaintListVidaPlus.clear();
response['ListChiefComplaintDetails']['resultData'].forEach((v) {
- patientChiefComplaintListVidaPlus.add(GetChiefComplaintVidaPlus.fromJson(v));
+ patientChiefComplaintListVidaPlus
+ .add(GetChiefComplaintVidaPlus.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@@ -631,4 +642,311 @@ class SOAPService extends LookupService {
super.error = error;
}, body: request);
}
+
+ searchDiagnosis(PatiantInformtion patient, String diagnosis) async {
+ Map request = {
+ "diseaseCode": diagnosis,
+ };
+ hasError = false;
+ searchDiagnosisList.clear();
+
+ await baseAppClient.post(SEARCH_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ response['List_Diagnosis']['resultData']
+ .forEach((v) => searchDiagnosisList.add(SearchDiagnosis.fromJson(v)));
+ _processData();
+ }, onFailure: (String error, int statusCode) {
+ searchChiefComplaintListVidaPlus.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ void _processData() {
+ Set icdVersions = {};
+ for (var item in searchDiagnosisList) {
+ if (item.icdVersion != null) {
+ icdVersions.addAll(item.icdVersion ?? []);
+ }
+ }
+ icdVersionList = icdVersions.toList();
+ }
+
+ SearchDiagnosis? findParent(String selectedICD) {
+ for (var item in searchDiagnosisList) {
+ if (item.icdVersion != null &&
+ (item.icdVersion as List).contains(selectedICD)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ getDiagnosisType(PatiantInformtion patient) async {
+ Map request = {};
+ hasError = false;
+ diagnosisTypeList.clear();
+ await baseAppClient.post(DIAGNOSIS_TYPE,
+ onSuccess: (dynamic response, int statusCode) {
+ response['ListDiagnosisTypeModel']['resultData']
+ .forEach((v) => diagnosisTypeList[v['name']] = v['diagnosisType']);
+ }, onFailure: (String error, int statusCode) {
+ searchChiefComplaintListVidaPlus.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ getConditionType(PatiantInformtion patient) async {
+ Map request = {};
+ hasError = false;
+ conditionTypeList.clear();
+ await baseAppClient.post(CONDITION_TYPE,
+ onSuccess: (dynamic response, int statusCode) {
+ response['ListDiagnosisCondition']['resultData']
+ .forEach((v) => conditionTypeList[v['itemName']] = v['id']);
+ ;
+ }, onFailure: (String error, int statusCode) {
+ searchChiefComplaintListVidaPlus.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ auditDiagnosis(
+ PatiantInformtion patient,
+ String patientProblemRevisionID,
+ ) async {
+ Map request = {
+ "patientProblemRevisionId": patientProblemRevisionID,
+ "ProjectID": patient.projectId
+ };
+ hasError = false;
+ auditDiagnosislist.clear();
+ await baseAppClient.post(AUDIT_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ response['ListDaignosisAudit']['resultData']
+ .forEach((v) => auditDiagnosislist.add(AuditDiagnosis.fromJson(v)));
+ showAuditBottomSheet = auditDiagnosislist.isNotEmpty;
+ }, onFailure: (String error, int statusCode) {
+ auditDiagnosislist.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ getPreviousDiagnosis(PatiantInformtion patient) async {
+ Map request = {
+ // "HospitalGroupID": await sharedPref.getString(DOCTOR_SETUP_ID), //setup
+ // "hospitalId": patient.projectId,
+ // "patientId": patient.patientId,
+ // "patientPomrId": patient.pomrId,
+ // "startRow": 0,
+ // "endRow": 1000,
+ // "ProjectID": patient.projectId
+ //todo just for the test as the create diagnosis is still not working
+ "HospitalGroupID": 105,
+ "hospitalId": 313,
+ "patientId": 70010976,
+ "patientPomrId": 8414,
+ "startRow": 0,
+ "endRow": 2,
+ "ProjectID": 313
+ };
+ hasError = false;
+ patientPreviousDiagnosisList.clear();
+ await baseAppClient.post(PREVIOUS_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ response['ListDiagnosisPrviousDetials']['resultData'].forEach((v) =>
+ patientPreviousDiagnosisList
+ .add(PatientPreviousDiagnosis.fromJson(v)));
+ }, onFailure: (String error, int statusCode) {
+ patientPreviousDiagnosisList.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ removeDiagnosis(PatiantInformtion patientInfo, String? patientProblemId,
+ String? problemId, String? deletedRemarks) async {
+ Map request = {
+ // "patientProblemId": patientProblemId,
+ // "patientId": patientInfo.patientId,
+ // "problemId": problemId,
+ // "deletedRemarks": deletedRemarks,
+ // "ProjectID": patientInfo.projectId
+ //todo just for the test as the create diagnosis is still not working
+ "patientProblemId": 13691,
+ "patientId": 70010986,
+ "problemId": 41698,
+ "deletedRemarks": "kethees test",
+ "ProjectID": 313
+ };
+ hasError = false;
+ patientPreviousDiagnosisList.clear();
+ await baseAppClient.post(REMOVE_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ DrAppToastMsg.showSuccesToast(response['ListDiagnosisRemove']['message']);
+ //todo get the current diagnosis after the delete if it is successful
+ }, onFailure: (String error, int statusCode) {
+ patientPreviousDiagnosisList.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ favoriteDiagnosis(
+ PatiantInformtion patientInfo,
+ ) async {
+ Map? user = await sharedPref.getObj(LOGGED_IN_USER);
+
+ Map request = {
+ "projectId": patientInfo.projectId,
+ "setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
+ "userId": user?['List_MemberInformation'][0]['MemberID'],
+ "favoritesType": "DIAGNOSIS",
+ "clinicId": patientInfo.clinicId,
+ "ProjectID": patientInfo.projectId,
+ };
+ hasError = false;
+ favoriteDiagnosisDetailsList.clear();
+ await baseAppClient.post(FAVORITE_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ response['ListDiagnosisGetFavourite']['resultData'].forEach((v) =>
+ favoriteDiagnosisDetailsList.add(FavoriteDiseaseDetails.fromJson(v)));
+ }, onFailure: (String error, int statusCode) {
+ favoriteDiagnosisDetailsList.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ getPhysicalExamination(
+ PatiantInformtion patientInfo,
+ ) async {
+ Map? user = await sharedPref.getObj(LOGGED_IN_USER);
+
+ Map request = {
+ "patientId": patientInfo.patientId,
+ "pomrId": patientInfo.pomrId,
+ "hospitalId": patientInfo.projectId,
+ "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
+ "ProjectID":patientInfo.projectId
+ };
+ hasError = false;
+ patientPhysicalExaminationList.clear();
+ await baseAppClient.post(FAVORITE_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ response['ListPhysicalExam']['resultData'].forEach((v) =>
+ patientPhysicalExaminationList.add(PatientPhysicalExamination.fromJson(v)));
+ }, onFailure: (String error, int statusCode) {
+ physicalExaminationList.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ addToFavoriteDiagnosis(PatiantInformtion paitientInfo, String doctorName,
+ String subFavoriteCode, String? userId) async {
+ Map request = {
+ "ProjectID": paitientInfo.projectId,
+ "listDiagnosisFavourite": [
+ {
+ "createdBy": doctorName,
+ "favoritesType": "DIAGNOSIS",
+ "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
+ "hospitalId": paitientInfo.projectId,
+ "subFavoritesCode": subFavoriteCode,
+ "userId": userId
+ }
+ ]
+ };
+ hasError = false;
+ addedToFavorite = false;
+ favoriteDiagnosisDetailsList.clear();
+ await baseAppClient.post(ADD_TO_FAVORITE_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ var result = response['ListDiagnosisAddFavourite']['resultData'];
+ if ((result as List).isEmpty) {
+ addedToFavorite = false;
+ DrAppToastMsg.showErrorToast(
+ response['ListDiagnosisAddFavourite']['message']);
+ } else {
+ addedToFavorite = true;
+ DrAppToastMsg.showSuccesToast("Added To Favorite");
+ }
+ }, onFailure: (String error, int statusCode) {
+ favoriteDiagnosisDetailsList.clear();
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo, PatientPreviousDiagnosis diagnosis) async {
+ Map request = {
+ "patientProblemRevisionId": diagnosis.patientProblemRevisionId,
+ "patientId": paitientInfo.patientId,
+ "doctorId": paitientInfo.doctorId,
+ "pomrId": paitientInfo.pomrId,
+ "appointmentId": paitientInfo.appointmentNo,
+ "createdBy": diagnosis.createdBy,
+ "hospitalId": diagnosis.hospitalId,
+ "hospitalGroupId": diagnosis.hospitalGroupId,
+ "clinicGroupId": diagnosis.clinicGroupId,
+ "clinicId": diagnosis.clinicId,
+ "isSelected": true,
+ "ProjectID":paitientInfo.projectId
+ };
+ hasError = false;
+ addedToFavorite = false;
+ await baseAppClient.post(MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS,
+ onSuccess: (dynamic response, int statusCode) {
+ var result = response['ContinuePreviousEpisode']['resultData'];
+ if ((result as List).isEmpty) {
+ DrAppToastMsg.showErrorToast(
+ response['ContinuePreviousEpisode']['message']);
+ }
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: request);
+ }
+
+ createDiagnosis(PatiantInformtion patient, SearchDiagnosis searchDiagnosis,
+ int diagnosisType, String conditionType, String remarks, bool isNew) {
+ /*{
+"codeRange": "A79",
+"selectedDisease": "Trench fever",
+"categoryId": 3962,
+"diseasesCode": "A79.0",
+"diseasesId": 17664,
+"selectedIcdCode": "A79.0",
+"selectedCategoryCode": "A79.0",
+"selectedSectionCode": "A79",
+"selectedChapterCode": "XX",
+"selectedNandaCode": "A79.0",
+"codeType": "ICD",
+"problemId": 1634,
+"icdId": 1,
+"problemName": "default",
+}*/
+
+ var request = {
+ "pomrId": patient.pomrId,
+ "appointmentId": patient.appointmentNo,
+ "clinicGroupId": patient.clinicGroupId,
+ "clinicId": patient.clinicId,
+ "patientId": patient.patientId,
+ "hospitalId": searchDiagnosis.hospitalId,
+ "hospitalGroupId": searchDiagnosis.hospitalGroupId,
+ "diagnosisType": diagnosisType,
+ "condition": conditionType,
+ "remarks": remarks,
+ "icdType": searchDiagnosis.icdType,
+ "icdVersion": searchDiagnosis.icdVersion,
+ "icdSubVersion": searchDiagnosis.icdSubVersion,
+ "isNew": isNew,
+ "specificationId": searchDiagnosis.specificationId,
+ };
+ }
}
diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart
index be098f49..7b431a04 100644
--- a/lib/core/viewModel/SOAP_view_model.dart
+++ b/lib/core/viewModel/SOAP_view_model.dart
@@ -1,3 +1,4 @@
+import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
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/Allergy/get_allergies_res_model.dart';
@@ -6,6 +7,11 @@ import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/FavoriteDiseaseDetails.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/audit_diagnosis.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/diagnosis_type.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/patient_previous_diagnosis.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/search_diagnosis.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_vida_plus.dart';
@@ -21,6 +27,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_I
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.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';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
@@ -108,10 +115,36 @@ class SOAPViewModel extends BaseViewModel {
List get searchChiefComplaintList =>
_SOAPService.searchChiefComplaintListVidaPlus;
+ List get searchDiagnosisList =>
+ _SOAPService.searchDiagnosisList;
+
+ List get icdVersionList => _SOAPService.icdVersionList;
+
+ List get patientPreviousDiagnosis =>
+ _SOAPService.patientPreviousDiagnosisList;
+
+ List get favoriteDiagnosisDetails =>
+ _SOAPService.favoriteDiagnosisDetailsList;
+
+ Map get diagnosisTypeList => _SOAPService.diagnosisTypeList;
+
+ Map get conditionTypeMap => _SOAPService.conditionTypeList;
+
+ List get conditionTypeList =>
+ _SOAPService.conditionTypeList.keys.toList();
+
List get getChiefComplaintListVidaPlus =>
_SOAPService.patientChiefComplaintListVidaPlus;
+ List get patientPhysicalExaminationList =>
+ _SOAPService.patientPhysicalExaminationList;
+
+ List get auditDiagnosislist =>
+ _SOAPService.auditDiagnosislist;
+
int? get episodeID => _SOAPService.episodeID;
+ bool get isFavorite => _SOAPService.addedToFavorite;
+ bool get showAudit => _SOAPService.showAuditBottomSheet;
bool get isPrescriptionOrder => _SOAPService.isPrescriptionOrder;
bool isAddProgress = true;
@@ -120,6 +153,7 @@ class SOAPViewModel extends BaseViewModel {
String complaintsControllerError = '';
String medicationControllerError = '';
String illnessControllerError = '';
+ String selectedIcd = '';
get medicationStrengthList => _SOAPService.medicationStrengthListWithModel;
@@ -430,7 +464,7 @@ class SOAPViewModel extends BaseViewModel {
return result.first;
}
break;
- case MasterKeysService.PhysicalExamination:
+ case MasterKeysService.PostPhysicalExaminationModel:
List result = physicalExaminationList.where((element) {
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
@@ -1002,4 +1036,142 @@ class SOAPViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
+
+ searchDiagnosis(PatiantInformtion patientInfo, String searchQuery) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.searchDiagnosis(patientInfo, searchQuery);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ getConditionAndType(PatiantInformtion patientInfo) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.getDiagnosisType(patientInfo);
+ await _SOAPService.getConditionType(patientInfo);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ getType(PatiantInformtion patientInfo) async {
+ setState(ViewState.BusyLocal);
+ // await _SOAPService.getDiagnosisType(patientInfo);
+ await _SOAPService.getConditionType(patientInfo);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ getPreviousPatientDetails(PatiantInformtion patientInfo) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.getPreviousDiagnosis(patientInfo);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ getAuditOfDiagnosis(
+ PatiantInformtion patient,
+ String patientProblemRevisionID,
+ ) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.auditDiagnosis(patient, patientProblemRevisionID);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ SearchDiagnosis? findTheDiagnosisItem(String icdVersion) {
+ selectedIcd = icdVersion;
+ return _SOAPService.findParent(icdVersion);
+ }
+
+ void removeDiagnosis(
+ PatiantInformtion patientInfo, {
+ String? patientProblemId,
+ String? problemId,
+ String? deletedRemarks,
+ }) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.removeDiagnosis(
+ patientInfo, patientProblemId, problemId, deletedRemarks);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ void favoriteDiagnosis(
+ PatiantInformtion patientInfo, {
+ String? patientProblemId,
+ String? problemId,
+ String? deletedRemarks,
+ }) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.favoriteDiagnosis(patientInfo);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ void addToFavoriteDiagnosis(
+ PatiantInformtion patientInfo, {
+ SearchDiagnosis? diagnosis
+ }) async {
+ setState(ViewState.BusyLocal);
+ Map? profile = await sharedPref.getObj(DOCTOR_PROFILE);
+ Map? user = await sharedPref.getObj(LOGGED_IN_USER);
+ await _SOAPService.addToFavoriteDiagnosis(patientInfo,profile?['DoctorName'] ??'',diagnosis?.diseasesBCode ?? '',user?['List_MemberInformation'][0]['MemberID'] ??'');
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+ void convertPreviousDiagnosisCurrent(
+ PatiantInformtion paitientInfo, PatientPreviousDiagnosis diagnosis) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.convertPreviousDiagnosisCurrent(paitientInfo,diagnosis);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ void getPhysicalExamination(
+ PatiantInformtion paitientInfo) async {
+ setState(ViewState.BusyLocal);
+ await _SOAPService.getPhysicalExamination(paitientInfo);
+ if (_SOAPService.hasError) {
+ error = _SOAPService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ void toggleFavorite(bool status ){
+ _SOAPService.addedToFavorite
+ = status;
+ }
+
+ void toggleShowBottomSheetValue(bool status){
+ _SOAPService.showAuditBottomSheet
+ = status;
+ }
+
}
diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart
index 7be4b062..238f8dd8 100644
--- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart
+++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart
@@ -38,7 +38,7 @@ class _AddExaminationPageState extends State {
if (model.physicalExaminationList.length == 0) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
await model.getMasterLookup(
- MasterKeysService.PhysicalExamination,
+ MasterKeysService.PostPhysicalExaminationModel,
);
});
}
diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart
index b44c35db..d9d4ed1b 100644
--- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart
+++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart
@@ -63,11 +63,11 @@ class _UpdateObjectivePageState extends State implements Ob
await model.getPatientPhysicalExam(widget.patientInfo);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
- await model.getMasterLookup(MasterKeysService.PhysicalExamination);
+ await model.getMasterLookup(MasterKeysService.PostPhysicalExaminationModel);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel? examMaster = model.getOneMasterKey(
- masterKeys: MasterKeysService.PhysicalExamination,
+ masterKeys: MasterKeysService.PostPhysicalExaminationModel,
id: element.examId,
);
MySelectedExamination tempEam = SoapUtils.generateMySelectedExamination(
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart
index e9e5d933..c271a5ae 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart
@@ -1,13 +1,23 @@
+import 'package:doctor_app_flutter/config/size_config.dart';
+import 'package:doctor_app_flutter/core/enum/view_state.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';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart';
+import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/favotite_diagnosis.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_texts_widget.dart';
+import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
+import 'package:hexcolor/hexcolor.dart';
class AddDiagnosis extends StatefulWidget {
+ final PatiantInformtion patientInfo;
+
+ const AddDiagnosis({super.key, required this.patientInfo});
+
@override
State createState() => _AddDiagnosisState();
}
@@ -15,6 +25,7 @@ class AddDiagnosis extends StatefulWidget {
class _AddDiagnosisState extends State
with SingleTickerProviderStateMixin {
TabController? _tabController;
+ bool isLoading = true;
@override
void initState() {
@@ -25,7 +36,18 @@ class _AddDiagnosisState extends State
@override
Widget build(BuildContext context) {
return BaseView(
+ onModelReady: (model) {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ model.toggleFavorite(false);
+ model.getConditionAndType(widget.patientInfo);
+ model.favoriteDiagnosis(widget.patientInfo);
+ setState(() {
+ isLoading = false;
+ });
+ });
+ },
builder: (_, model, w) => AppScaffold(
+ isLoading: model.state == ViewState.BusyLocal ,
isShowAppBar: true,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).addDiagnosis),
@@ -51,7 +73,7 @@ class _AddDiagnosisState extends State
),
Tab(
child: AppText(
- TranslationBase.of(context).mappedDiagnosis,
+ TranslationBase.of(context).favoriteDiagnosis,
color: Color(0xFF6D6D6D),
fontSize: 14,
fontWeight: FontWeight.w600,
@@ -65,13 +87,67 @@ class _AddDiagnosisState extends State
child: TabBarView(
controller: _tabController,
children: [
- EnterDiagnosis(),
- EnterDiagnosis(),
+ EnterDiagnosis(
+ patientInfo: widget.patientInfo,
+ ),
+ FavoriteDiagnosis(
+ patientInfo: widget.patientInfo,
+ ),
],
),
),
],
),
+ bottomSheet: Container(
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.all(
+ Radius.circular(0.0),
+ ),
+ border: Border.all(color: HexColor('#707070'), width: 0),
+ ),
+ height: SizeConfig.heightMultiplier! *
+ (SizeConfig.isHeightVeryShort ? 12 : 10),
+ width: double.infinity,
+ child: Padding(
+ padding: const EdgeInsets.all(10),
+ child: Column(
+ children: [
+ Center(
+ child: Row(
+ children: [
+ Expanded(
+ child: AppButton(
+ title: TranslationBase.of(context).previous,
+ color: Colors.grey[300]!,
+ // height: SizeConfig.heightMultiplier! *
+ // (SizeConfig.isHeightVeryShort ? 8 : 6),
+ // padding: 10,
+ fontColor: Colors.black,
+ fontWeight: FontWeight.w600,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ ),
+ SizedBox(
+ width: 5,
+ ),
+ Expanded(
+ child: AppButton(
+ title: TranslationBase.of(context).save,
+ fontWeight: FontWeight.w600,
+ color: Color(0xFF359846),
+ onPressed: () async {},
+ ),
+ ),
+ ],
+ ),
+ )
+ ],
+ ),
+ ),
+ ),
));
}
}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/update_assessment_page.dart
index a320ce92..09c07d54 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/update_assessment_page.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/update_assessment_page.dart
@@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
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/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
@@ -67,49 +68,15 @@ class _UpdateAssessmentPageState extends State
model.setAssessmentCallBack(this);
mySelectedAssessmentList.clear();
WidgetsBinding.instance.addPostFrameCallback((_) async {
- await model.isPrescriptionOrderCreated(widget.patientInfo);
- await model.onUpdateAssessmentStepStart(widget.patientInfo);
-
- if (model.patientAssessmentList.isNotEmpty) {
- model.patientAssessmentList.forEach((element) {
- MasterKeyModel? diagnosisType = model.getOneMasterKey(
- masterKeys: MasterKeysService.DiagnosisType,
- id: element.diagnosisTypeID,
- );
- MasterKeyModel? selectedICD = model.getOneMasterKey(
- masterKeys: MasterKeysService.ICD10,
- id: element.icdCode10ID,
- );
- MasterKeyModel? diagnosisCondition = model.getOneMasterKey(
- masterKeys: MasterKeysService.DiagnosisCondition,
- id: element.conditionID!,
- );
- if (diagnosisCondition != null &&
- diagnosisType != null &&
- diagnosisCondition != null) {
- MySelectedAssessment temMySelectedAssessment =
- SoapUtils.generateMySelectedAssessment(
- appointmentNo: element.appointmentNo,
- remark: element.remarks,
- diagnosisType: diagnosisType,
- diagnosisCondition: diagnosisCondition,
- selectedICD: selectedICD,
- doctorID: element.doctorID,
- doctorName: element.doctorName,
- createdBy: element.createdBy,
- createdOn: element.createdOn,
- icdCode10ID: element.icdCode10ID);
-
- mySelectedAssessmentList.add(temMySelectedAssessment);
- }
- });
- }
-
+ widget.changeLoadingState(true);
+ model.getPreviousPatientDetails(widget.patientInfo);
widget.changeLoadingState(false);
+ //todo handle get diagnosis list
});
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
+ isLoading: model.state == ViewState.BusyLocal,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
physics: ScrollPhysics(),
@@ -158,7 +125,7 @@ class _UpdateAssessmentPageState extends State
Tab(
child: AppText(
TranslationBase.of(context)
- .currentDiagnosis,
+ .previousDiagnosis,
color: Color(0xFF6D6D6D),
fontSize: 14,
fontWeight: FontWeight.w600,
@@ -175,10 +142,13 @@ class _UpdateAssessmentPageState extends State
controller: _tabController,
children: [
CurrentDiagnosis(
+ patientInfo: widget.patientInfo,
+ model: model,
currentDiagnosisItems: [''],
),
PreviousDiagnosis(
- diagnosisItems: [''],
+ diagnosisItems: model.patientPreviousDiagnosis,
+ patientInfo: widget.patientInfo,
)
],
),
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_item.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_item.dart
new file mode 100644
index 00000000..3fc197f7
--- /dev/null
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_item.dart
@@ -0,0 +1,94 @@
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/audit_diagnosis.dart';
+import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
+import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
+import 'package:flutter/material.dart';
+import 'package:intl/intl.dart';
+
+class AuditItem extends StatelessWidget {
+ final AuditDiagnosis auditDiagnosis;
+
+ const AuditItem({super.key, required this.auditDiagnosis});
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ AppText(
+ auditDiagnosis.createdBy ?? '',
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ color: Color(0xFF2B353E),
+ ),
+ AppText(
+ getDate(auditDiagnosis.createdOn?.isNotEmpty== true ? auditDiagnosis.createdOn ?? '' : auditDiagnosis.modifiedOn??''),
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ color: Color(0xFF2B353E),
+ ),
+ ],
+ ),
+ SizedBox(height: 4,),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ AppText(
+ "${TranslationBase.of(context).diagnosis}: ${auditDiagnosis.diagnosisType}",
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ color: Color(0xFF2B353E),
+ ),
+ AppText(
+ getTime(auditDiagnosis.createdOn?.isNotEmpty== true ? auditDiagnosis.createdOn ?? '' : auditDiagnosis.modifiedOn??''),
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ color: Color(0xFF2B353E),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 4,
+ ),
+
+ Visibility(
+ visible: auditDiagnosis.deletedRemarks?.isEmpty == true,
+ child: AppText(
+ //todo handle the item after the discussion from the vidapro team this is temporary
+ "${TranslationBase.of(context).remarks}: ${auditDiagnosis.remarks?.isNotEmpty == true? auditDiagnosis.remarks : TranslationBase.of(context).noRemarks}",
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ color: Color(0xFF2B353E),
+ ),
+ ),
+ Visibility(
+ visible: auditDiagnosis.deletedRemarks?.isNotEmpty == true,
+ child: AppText(
+ //todo handle the item after the discussion from the vidapro team this is temporary
+ "${TranslationBase.of(context).deletedRemarks}${auditDiagnosis.deletedRemarks}",
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ color: Color(0xFF2B353E),
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ String getDate(String dateTime) {
+ if (dateTime.isEmpty) return '';
+ DateTime now = DateTime.now();
+ return DateFormat('dd MMM yyyy').format(now);
+ }
+
+ String getTime(String dateTime) {
+ if (dateTime.isEmpty) return '';
+ DateTime now = DateTime.now();
+ return DateFormat('hh:mm a').format(now);
+ }
+}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_list_bottom_sheet.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_list_bottom_sheet.dart
new file mode 100644
index 00000000..befb56e5
--- /dev/null
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_list_bottom_sheet.dart
@@ -0,0 +1,62 @@
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/audit_diagnosis.dart';
+import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/audit_item.dart';
+import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
+import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
+import 'package:flutter/material.dart';
+
+class AuditListBottomSheet extends StatelessWidget {
+ final List auditList;
+
+ const AuditListBottomSheet({super.key, required this.auditList});
+
+ @override
+ Widget build(BuildContext context) {
+ return SizedBox(
+ height: (auditList.length>1)?MediaQuery.sizeOf(context).height*.56:MediaQuery.sizeOf(context).height*.28,
+ child: Material(
+ color: Color(0xFFF7F7F7),
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 32),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ AppText(
+ TranslationBase.of(context).audit,
+ fontWeight: FontWeight.w700,
+ fontSize: 24,
+ color: Color(0xFF2B353E),
+ ),
+ SizedBox(
+ height: 16,
+ ),
+ SizedBox(
+ height: (auditList.length>1)?MediaQuery.sizeOf(context).height*.25:MediaQuery.sizeOf(context).height*.12,
+ child: Material(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10)),
+ color: Colors.white,
+ child: Column(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: ListView.separated(
+
+ itemCount: auditList.length,
+ itemBuilder: (context, index) => AuditItem(
+ auditDiagnosis: auditList[index],
+ ),
+ separatorBuilder: (_, __) => Divider(),
+ ))
+ ],
+ ),
+ ),
+ )
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart
index 8d64deee..71a69dbb 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart
@@ -1,15 +1,35 @@
+import 'package:doctor_app_flutter/config/config.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/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.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/widgets/SoapDetailItem.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
-class CurrentDiagnosis extends StatelessWidget {
+import '../../../../../../widgets/shared/text_fields/app-textfield-custom.dart';
+
+class CurrentDiagnosis extends StatefulWidget {
+ final PatiantInformtion patientInfo;
final List currentDiagnosisItems;
+ final SOAPViewModel model;
+
+ const CurrentDiagnosis(
+ {super.key,
+ required this.currentDiagnosisItems,
+ required this.patientInfo,
+ required this.model});
+
+ @override
+ State createState() => _CurrentDiagnosisState();
+}
- const CurrentDiagnosis({super.key, required this.currentDiagnosisItems});
+class _CurrentDiagnosisState extends State {
+ TextEditingController deleteController = TextEditingController();
@override
Widget build(BuildContext context) {
@@ -24,7 +44,12 @@ class CurrentDiagnosis extends StatelessWidget {
AddSoapItem(
title: TranslationBase.of(context).addNewDiagnosis,
onAddSoapItemClicked: () {
- Navigator.push(context, FadePage(page: AddDiagnosis()));
+ Navigator.push(
+ context,
+ FadePage(
+ page: AddDiagnosis(
+ patientInfo: widget.patientInfo,
+ )));
}),
SizedBox(
height: 16,
@@ -33,29 +58,125 @@ class CurrentDiagnosis extends StatelessWidget {
SizedBox(
height: 16,
),
- if (currentDiagnosisItems.isEmpty) ...{
+ if (widget.currentDiagnosisItems.isEmpty) ...{
Center(
child: EmptyDiagnosis(),
),
} else ...{
Flexible(
+ child: ListView.separated(
+ itemBuilder: (_, index) {
+ return SoapDetailItem(
+ title: 'lorem ipsum',
+ status: 'active',
+ condition: 'acute',
+ remarks: 'initial',
+ onSoapDetailActionClicked: (action) {
+ switch (action) {
+ case SoapDetailItemActions.EDIT:
+ // TODO: Handle this case.
+ case SoapDetailItemActions.RESOLVE:
+ // TODO: Handle this case.
- child:
- ListView.separated(
- itemBuilder: (_, index) {
- return SoapDetailItem(
- title: 'lorem ipsum',
- status: 'active',
- condition: 'acute',
- remarks: 'initial',
- onSoapDetailActionClicked: (action) {},
- );
- },
- separatorBuilder: (_, index) => Divider(),
- itemCount: currentDiagnosisItems.length))
+ case SoapDetailItemActions.REMOVE:
+ showConfirmationDialog(context,
+ "${TranslationBase.of(context).delete} ${TranslationBase.of(context).diagnosis}",
+ () {
+ widget.model
+ .removeDiagnosis(widget.patientInfo);
+ });
+ case SoapDetailItemActions.CHANGE_STATUS:
+ // TODO: Handle this case.
+ default:
+ }
+ },
+ );
+ },
+ separatorBuilder: (_, index) => Divider(),
+ itemCount: widget.currentDiagnosisItems.length))
}
],
),
);
}
+
+ showConfirmationDialog(
+ BuildContext context, String message, Function okFunction) {
+ return showDialog(
+ context: context,
+ barrierDismissible: true, // user must tap button!
+ builder: (_) {
+ return Container(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ AlertDialog(
+ title: null,
+ content: Container(
+ child: Column(
+ children: [
+ AppText(message),
+ SizedBox(
+ height: 8,
+ ),
+ AppText(
+ TranslationBase.of(context)
+ .areYouSureYouWantToDeleteDiagnosis,
+ textAlign: TextAlign.center,
+ ),
+ SizedBox(
+ height: 8,
+ ),
+ AppTextFieldCustom(
+ hintText: TranslationBase.of(context).remarks,
+ controller: deleteController,
+ maxLines: 25,
+ minLines: 3,
+ hasBorder: true,
+ onChanged: (value) {},
+ inputType: TextInputType.multiline,
+ onClick: () {},
+ onFieldSubmitted: () {},
+ ),
+ ],
+ ),
+ ),
+ actions: [
+ Row(
+ children: [
+ Expanded(
+ child: AppButton(
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ title: TranslationBase.of(context).cancel,
+ fontColor: Colors.black,
+ color: Color(0xffEAEAEA),
+ ),
+ ),
+ SizedBox(
+ width: 8,
+ ),
+ Expanded(
+ child: AppButton(
+ onPressed: () {
+ okFunction();
+ Navigator.of(context).pop();
+ },
+ title: TranslationBase.of(context).delete,
+ fontColor: Colors.white,
+ color: Colors.red[600],
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
+ );
+ }).then((value) {
+ deleteController.clear();
+ });
+ }
}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_dropdown.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_dropdown.dart
new file mode 100644
index 00000000..1db5dd98
--- /dev/null
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_dropdown.dart
@@ -0,0 +1,20 @@
+import 'package:flutter/material.dart';
+
+class EmptyDropDown extends StatelessWidget{
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Row(
+ children: [
+ Expanded(child: SizedBox.shrink()),
+ Align(
+ alignment: Alignment.centerLeft,
+ child: Icon(Icons.keyboard_arrow_down),
+ )
+ ],
+ ),
+ );
+ }
+
+}
\ No newline at end of file
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart
index 8e34b682..45b6ddbe 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart
@@ -1,14 +1,27 @@
+import 'dart:async';
+
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/diagnosis_type.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/search_diagnosis.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/profile/soap_update_vida_plus/assessment/widget/empty_dropdown.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart';
-List patientState = ["","Stable", "Not Stable", "Not Defined"];
+
+List patientState = ["", "Stable", "Not Stable", "Not Defined"];
class EnterDiagnosis extends StatefulWidget {
+ final PatiantInformtion patientInfo;
+
+ const EnterDiagnosis({super.key, required this.patientInfo});
+
@override
State createState() => _EnterDiagnosisState();
}
@@ -17,276 +30,420 @@ class _EnterDiagnosisState extends State {
final TextEditingController filteredSearchController =
TextEditingController();
bool showAllDiagnosis = true;
- bool status = true;
- String selectedItem = "Stable";
+ String status = '';
+ String? selectedItem;
TextEditingController remarksController = TextEditingController();
+ Timer? _tTimer;
+ SOAPViewModel? model;
+ SearchDiagnosis? selectedDiagnosis;
+ void _onTextChanged(String text) {
+ if (_tTimer != null) {
+ _tTimer!.cancel();
+ }
+ _tTimer = Timer(Duration(milliseconds: 500), () {
+ _onStopped(text);
+ });
+ }
+
+ void _onStopped(String searchText) async {
+ await model?.searchDiagnosis(widget.patientInfo, searchText);
+ }
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- AppText(
- TranslationBase.of(context).addDiagnosis,
- fontWeight: FontWeight.w600,
- color: Color(0xFF2E303A),
- fontSize: 16,
- ),
- SizedBox(
- height: 16,
- ),
- AppTextFieldCustom(
- hintText: TranslationBase.of(context).selectAllergy,
- isTextFieldHasSuffix: true,
- hasBorder: true,
- controller: filteredSearchController,
- onChanged: (value) {},
- onFieldSubmitted: () {},
- suffixIcon: IconButton(
- icon: Icon(
- Icons.search,
- color: Color(0xff2B353E),
- size: 30,
- ),
- onPressed: () {},
- ),
- ),
- SizedBox(
- height: 8,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ return BaseView(
+ onModelReady: (model) {
+ this.model = model;
+ },
+ builder: (_, model, w) => SingleChildScrollView(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Row(
- children: [
- Switch(
- value: showAllDiagnosis,
- activeColor: Colors.red,
- onChanged: (bool value) {
- setState(() {
- showAllDiagnosis = value;
- });
+ AppText(
+ TranslationBase.of(context).addDiagnosis,
+ fontWeight: FontWeight.w600,
+ color: Color(0xFF2E303A),
+ fontSize: 16,
+ ),
+ SizedBox(
+ height: 16,
+ ),
+ AppTextFieldCustom(
+ hintText: TranslationBase.of(context).diagnosis,
+ isTextFieldHasSuffix: true,
+ hasBorder: true,
+ controller: filteredSearchController,
+ onClick: () {
+ setState(
+ () {
+ selectedDiagnosis = null;
+ filteredSearchController.text = '';
+ model.selectedIcd = '';
},
+ );
+ },
+ onChanged: (value) {
+ if (value != null) _onTextChanged(value);
+ },
+ onFieldSubmitted: () {},
+ suffixIcon: IconButton(
+ icon: Icon(
+ Icons.search,
+ color: Color(0xff2B353E),
+ size: 30,
),
- SizedBox(
- width: 8,
- ),
- AppText(
- TranslationBase.of(context).showAllDiagnosis,
- fontWeight: FontWeight.w500,
- color: Color(0xFF2E303A),
- fontSize: 11,
- ),
- ],
+ onPressed: () {},
+ ),
),
- SvgPicture.asset('assets/images/svgs/information.svg'),
- ],
- ),
- Container(
- margin: EdgeInsets.only(bottom: 12),
- child: AppText(
- TranslationBase.of(context).condition,
- fontWeight: FontWeight.bold,
- fontFamily: 'Poppins',
- fontSize: 11,
- ),
- ),
- Row(
- children: [
- Expanded(
- child: InkWell(
- onTap: () {},
- 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).acute,
- fontWeight: FontWeight.normal,
- fontFamily: 'Poppins',
- fontSize: SizeConfig.textMultiplier! * 1.6,
+ Positioned(
+ child: Material(
+ elevation: 4.0, // Optional: for shadow effect
+ child: ConstrainedBox(
+ constraints: BoxConstraints(minHeight: 0, maxHeight: 300),
+ child: ListView.builder(
+ shrinkWrap: true,
+ itemCount: model.icdVersionList.length,
+ itemBuilder: (context, index) {
+ return ListTile(
+ title: InkWell(
+ child: AppText(model.icdVersionList[index]),
+ onTap: () {
+ setState(
+ () {
+ selectedDiagnosis =
+ model.findTheDiagnosisItem(
+ model.icdVersionList[index]);
+ filteredSearchController.text =
+ model.icdVersionList[index];
+ model.searchDiagnosisList.clear();
+ model.icdVersionList.clear();
+ },
+ );
+ },
+ ),
+ );
+ },
),
- ],
+ ),
),
- )),
- Expanded(
- child: InkWell(
- onTap: () {},
- child: Row(
+ ),
+ SizedBox(
+ height: 8,
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ 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,
- ),
- ),
+ Switch(
+ value: showAllDiagnosis,
+ activeColor: Colors.red,
+ onChanged: (bool value) {
+ setState(() {
+ showAllDiagnosis = value;
+ });
+ },
+ ),
+ SizedBox(
+ width: 8,
),
AppText(
- TranslationBase.of(context).subAcute,
- fontWeight: FontWeight.normal,
- fontFamily: 'Poppins',
- fontSize: SizeConfig.textMultiplier! * 1.6,
+ TranslationBase.of(context).showAllDiagnosis,
+ fontWeight: FontWeight.w500,
+ color: Color(0xFF2E303A),
+ fontSize: 11,
),
],
),
+ SvgPicture.asset('assets/images/svgs/information.svg'),
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.only(bottom: 12),
+ child: AppText(
+ TranslationBase.of(context).condition,
+ fontWeight: FontWeight.bold,
+ fontFamily: 'Poppins',
+ fontSize: 11,
),
),
- Expanded(
- child: InkWell(
- onTap: () {},
- 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 == 3 ? HexColor("#D02127") : Colors.white,
- shape: BoxShape.circle,
+ // Row(
+ // children: [
+ // Expanded(
+ // child: InkWell(
+ // onTap: () {
+ // setState(() {
+ // status = "";
+ // });
+ // },
+ // 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).acute,
+ // fontWeight: FontWeight.normal,
+ // fontFamily: 'Poppins',
+ // fontSize: SizeConfig.textMultiplier! * 1.6,
+ // ),
+ // ],
+ // ),
+ // )),
+ // Expanded(
+ // child: InkWell(
+ // onTap: () {
+ // setState(() {
+ // status = "2";
+ // });
+ // },
+ // 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).subAcute,
+ // fontWeight: FontWeight.normal,
+ // fontFamily: 'Poppins',
+ // fontSize: SizeConfig.textMultiplier! * 1.6,
+ // ),
+ // ],
+ // ),
+ // ),
+ // ),
+ // Expanded(
+ // child: InkWell(
+ // onTap: () {
+ // setState(() {
+ // status = "3";
+ // });
+ // },
+ // 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 == 3
+ // ? HexColor("#D02127")
+ // : Colors.white,
+ // shape: BoxShape.circle,
+ // ),
+ // ),
+ // ),
+ // AppText(
+ // TranslationBase.of(context).chronic,
+ // fontWeight: FontWeight.normal,
+ // fontFamily: 'Poppins',
+ // fontSize: SizeConfig.textMultiplier! * 1.6,
+ // ),
+ // ],
+ // ),
+ // ),
+ // ),
+ // ],
+ // ),
+ SizedBox(
+ width: MediaQuery.sizeOf(context).width,
+ height: 24,
+ child: ListView.builder(
+ shrinkWrap: true,
+ scrollDirection: Axis.horizontal,
+ itemCount: model.conditionTypeList.length,
+ itemBuilder: (context, index) => InkWell(
+ onTap: () {
+ setState(() {
+ status = model.conditionTypeList[index];
+ });
+ },
+ 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 == model.conditionTypeList[index]
+ ? HexColor("#D02127")
+ : Colors.white,
+ shape: BoxShape.circle,
+ ),
+ ),
+ ),
+ AppText(
+ model.conditionTypeList[index],
+ fontWeight: FontWeight.normal,
+ fontFamily: 'Poppins',
+ fontSize: SizeConfig.textMultiplier! * 1.6,
+ ),
+ ],
),
- ),
- ),
+ )),
+ ),
+ SizedBox(
+ height: 8,
+ ),
+ Material(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: BorderSide(
+ width: 1,
+ color: Color(0xFFEFEFEF),
+ )),
+ color: Colors.white,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16.0, vertical: 12),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
AppText(
- TranslationBase.of(context).chronic,
- fontWeight: FontWeight.normal,
- fontFamily: 'Poppins',
- fontSize: SizeConfig.textMultiplier! * 1.6,
+ TranslationBase.of(context).diagnoseType,
+ textAlign: TextAlign.start,
+ fontWeight: FontWeight.w600,
+ fontSize: 11,
+ color: Color(0xFF2E303A),
+ ),
+ SizedBox(
+ height: 4,
),
+ model.diagnosisTypeList.isEmpty
+ ? EmptyDropDown()
+ : DropdownButtonHideUnderline(
+ child: DropdownButton(
+ dropdownColor: Colors.white,
+ iconEnabledColor: Colors.black,
+ icon: Icon(Icons.keyboard_arrow_down),
+ isExpanded: true,
+ value: selectedItem == null
+ ? model.diagnosisTypeList.keys.first
+ : selectedItem,
+ iconSize: 25,
+ elevation: 16,
+ onChanged: (newValue) async {
+ if (newValue != null)
+ setState(() {
+ selectedItem = newValue;
+ });
+ },
+ items: model.diagnosisTypeList.keys.map((item) {
+ return DropdownMenuItem(
+ child: AppText(
+ item ?? '',
+ fontSize: 14,
+ letterSpacing: -0.96,
+ color: AppGlobal.appTextColor,
+ fontWeight: FontWeight.normal,
+ textAlign: TextAlign.left,
+ ),
+ value: item,
+ );
+ }).toList(),
+ ),
+ ),
],
),
),
),
- ],
- ),
- SizedBox(height: 8,),
-
- Material(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- side: BorderSide(
- width: 1,
- color: Color(0xFFEFEFEF),
- )),
- color: Colors.white,
- child: Padding(
- padding:
- const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- AppText(
- TranslationBase.of(context).patientCondition,
- textAlign: TextAlign.start,
- fontWeight: FontWeight.w600,
- fontSize: 11,
- color: Color(0xFF2E303A),
- ),
- SizedBox(
- height: 4,
- ),
- DropdownButtonHideUnderline(
- child: DropdownButton(
- dropdownColor: Colors.white,
- iconEnabledColor: Colors.black,
- icon: Icon(Icons.keyboard_arrow_down),
- isExpanded: true,
- value: selectedItem,
- iconSize: 25,
- elevation: 16,
-
- onChanged: (newValue) async {
- setState(() {
- selectedItem = newValue ?? "";
- });
- },
- items: patientState.map((item) {
- return DropdownMenuItem(
- child: AppText(
- item,
- fontSize: 14,
- letterSpacing: -0.96,
- color: AppGlobal.appTextColor,
- fontWeight: FontWeight.normal,
- textAlign: TextAlign.left,
- ),
- value: item,
- );
- }).toList(),
- ),
- ),
- ],
+ Container(
+ margin: EdgeInsets.only(top: 8),
+ child: AppTextFieldCustom(
+ hintText: TranslationBase.of(context).remarks,
+ controller: remarksController,
+ minLines: 2,
+ maxLines: 4,
+ inputType: TextInputType.multiline,
+ onChanged: (value) {},
+ onClick: () {},
+ onFieldSubmitted: () {},
+ ),
),
- ),
- ),
- Container(
- margin: EdgeInsets.only(top: 8),
- child: AppTextFieldCustom(
- hintText: TranslationBase.of(context).remarks,
- controller: remarksController,
- minLines: 2,
- maxLines: 4,
- inputType: TextInputType.multiline,
- onChanged: (value) {},
- onClick: () {},
- onFieldSubmitted: () {},
- ),
- ),
- SizedBox(
- height: 16,
- ),
- Row(
- children: [
- SvgPicture.asset('assets/images/svgs/save_as_draft.svg'),
SizedBox(
- width: 4,
- ),
- AppText(
- TranslationBase.of(context).saveAsDraft,
- textAlign: TextAlign.start,
- fontWeight: FontWeight.w600,
- fontSize: 10,
- color: Color(0xFF449BF1),
+ height: 16,
),
+ InkWell(
+ onTap: () {
+ if (selectedDiagnosis != null)
+ model.addToFavoriteDiagnosis(widget.patientInfo,
+ diagnosis: selectedDiagnosis);
+ },
+ child: Row(
+ children: [
+ SvgPicture.asset(model.isFavorite
+ ? 'assets/images/svgs/favoriteadded.svg'
+ : 'assets/images/svgs/favorite.svg'),
+ SizedBox(
+ width: 4,
+ ),
+ AppText(
+ TranslationBase.of(context).addToFavorite,
+ textAlign: TextAlign.start,
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ color: Color(0xFF449BF1),
+ ),
+ ],
+ ),
+ )
],
- )
- ],
+ ),
+ ),
),
);
}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/favotite_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/favotite_diagnosis.dart
new file mode 100644
index 00000000..219f45cb
--- /dev/null
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/favotite_diagnosis.dart
@@ -0,0 +1,416 @@
+import 'dart:async';
+
+import 'package:doctor_app_flutter/config/config.dart';
+import 'package:doctor_app_flutter/config/size_config.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/diagnosis_type.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/search_diagnosis.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/profile/soap_update_vida_plus/assessment/widget/empty_dropdown.dart';
+import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
+import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
+import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import 'package:hexcolor/hexcolor.dart';
+
+List patientState = ["", "Stable", "Not Stable", "Not Defined"];
+
+class FavoriteDiagnosis extends StatefulWidget {
+ final PatiantInformtion patientInfo;
+
+ const FavoriteDiagnosis({super.key, required this.patientInfo});
+
+ @override
+ State createState() => _FavoriteDiagnosisState();
+}
+
+class _FavoriteDiagnosisState extends State {
+ final TextEditingController filteredSearchController =
+ TextEditingController();
+ bool showAllDiagnosis = true;
+ String status = '';
+ String? selectedItem;
+ String? selectedFavorite;
+ TextEditingController remarksController = TextEditingController();
+ Timer? _tTimer;
+ SOAPViewModel? model;
+ SearchDiagnosis? selectedDiagnosis;
+
+ void _onTextChanged(String text) {
+ if (_tTimer != null) {
+ _tTimer!.cancel();
+ }
+ _tTimer = Timer(Duration(milliseconds: 500), () {
+ _onStopped(text);
+ });
+ }
+
+ void _onStopped(String searchText) async {
+ await model?.searchDiagnosis(widget.patientInfo, searchText);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return BaseView(
+ onModelReady: (model) {
+ this.model = model;
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ model.favoriteDiagnosis(widget.patientInfo);
+ });
+ },
+ builder: (_, model, w) => SingleChildScrollView(
+ child: Padding(
+ padding:
+ const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ AppText(
+ TranslationBase.of(context).addDiagnosis,
+ fontWeight: FontWeight.w600,
+ color: Color(0xFF2E303A),
+ fontSize: 16,
+ ),
+ SizedBox(
+ height: 16,
+ ),
+ Material(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: BorderSide(
+ width: 1,
+ color: Color(0xFFEFEFEF),
+ )),
+ color: Colors.white,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16.0, vertical: 12),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ AppText(
+ TranslationBase.of(context).diagnosis,
+ textAlign: TextAlign.start,
+ fontWeight: FontWeight.w600,
+ fontSize: 11,
+ color: Color(0xFF2E303A),
+ ),
+ SizedBox(
+ height: 4,
+ ),
+ model.favoriteDiagnosisDetails.isEmpty
+ ? EmptyDropDown()
+ : DropdownButtonHideUnderline(
+ child: DropdownButton(
+ dropdownColor: Colors.white,
+ iconEnabledColor: Colors.black,
+ icon: Icon(Icons.keyboard_arrow_down),
+ isExpanded: true,
+ itemHeight: null,
+ value: selectedFavorite == null
+ ? model.favoriteDiagnosisDetails.first
+ .diseases
+ : selectedFavorite,
+ iconSize: 25,
+ elevation: 16,
+ onChanged: (newValue) async {
+ if (newValue != null)
+ setState(() {
+ selectedFavorite = newValue;
+ });
+ },
+ items: model.favoriteDiagnosisDetails
+ .map((item) {
+ return DropdownMenuItem(
+ child: AppText(
+ item.diseases ?? '',
+ fontSize: 14,
+ letterSpacing: -0.96,
+ color: AppGlobal.appTextColor,
+ fontWeight: FontWeight.normal,
+ textAlign: TextAlign.left,
+ ),
+ value: item.diseases,
+ );
+ }).toList(),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+
+ SizedBox(
+ height: 8,
+ ),
+ Container(
+ margin: EdgeInsets.only(bottom: 12),
+ child: AppText(
+ TranslationBase.of(context).condition,
+ fontWeight: FontWeight.bold,
+ fontFamily: 'Poppins',
+ fontSize: 11,
+ ),
+ ),
+ // Row(
+ // children: [
+ // Expanded(
+ // child: InkWell(
+ // onTap: () {
+ // setState(() {
+ // status = "";
+ // });
+ // },
+ // 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).acute,
+ // fontWeight: FontWeight.normal,
+ // fontFamily: 'Poppins',
+ // fontSize: SizeConfig.textMultiplier! * 1.6,
+ // ),
+ // ],
+ // ),
+ // )),
+ // Expanded(
+ // child: InkWell(
+ // onTap: () {
+ // setState(() {
+ // status = "2";
+ // });
+ // },
+ // 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).subAcute,
+ // fontWeight: FontWeight.normal,
+ // fontFamily: 'Poppins',
+ // fontSize: SizeConfig.textMultiplier! * 1.6,
+ // ),
+ // ],
+ // ),
+ // ),
+ // ),
+ // Expanded(
+ // child: InkWell(
+ // onTap: () {
+ // setState(() {
+ // status = "3";
+ // });
+ // },
+ // 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 == 3
+ // ? HexColor("#D02127")
+ // : Colors.white,
+ // shape: BoxShape.circle,
+ // ),
+ // ),
+ // ),
+ // AppText(
+ // TranslationBase.of(context).chronic,
+ // fontWeight: FontWeight.normal,
+ // fontFamily: 'Poppins',
+ // fontSize: SizeConfig.textMultiplier! * 1.6,
+ // ),
+ // ],
+ // ),
+ // ),
+ // ),
+ // ],
+ // ),
+ SizedBox(
+ width: MediaQuery.sizeOf(context).width,
+ height: 24,
+ child: ListView.builder(
+ shrinkWrap: true,
+ scrollDirection: Axis.horizontal,
+ itemCount: model.conditionTypeList.length,
+ itemBuilder: (context, index) => InkWell(
+ onTap: () {
+ setState(() {
+ status = model.conditionTypeList[index];
+ });
+ },
+ 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 ==
+ model.conditionTypeList[index]
+ ? HexColor("#D02127")
+ : Colors.white,
+ shape: BoxShape.circle,
+ ),
+ ),
+ ),
+ AppText(
+ model.conditionTypeList[index],
+ fontWeight: FontWeight.normal,
+ fontFamily: 'Poppins',
+ fontSize:
+ SizeConfig.textMultiplier! * 1.6,
+ ),
+ ],
+ ),
+ )),
+ ),
+ SizedBox(
+ height: 8,
+ ),
+ Material(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: BorderSide(
+ width: 1,
+ color: Color(0xFFEFEFEF),
+ )),
+ color: Colors.white,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16.0, vertical: 12),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ AppText(
+ TranslationBase.of(context).diagnoseType,
+ textAlign: TextAlign.start,
+ fontWeight: FontWeight.w600,
+ fontSize: 11,
+ color: Color(0xFF2E303A),
+ ),
+ SizedBox(
+ height: 4,
+ ),
+ model.diagnosisTypeList.isEmpty
+ ? EmptyDropDown()
+ : DropdownButtonHideUnderline(
+ child: DropdownButton(
+ itemHeight: null,
+ dropdownColor: Colors.white,
+ iconEnabledColor: Colors.black,
+ icon: Icon(Icons.keyboard_arrow_down),
+ isExpanded: true,
+ value: selectedItem == null
+ ? model.diagnosisTypeList.keys.first
+ : selectedItem,
+ iconSize: 25,
+ elevation: 16,
+ onChanged: (newValue) async {
+ if (newValue != null)
+ setState(() {
+ selectedItem = newValue;
+ });
+ },
+ items: model.diagnosisTypeList.keys
+ .map((item) {
+ return DropdownMenuItem(
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: AppText(
+ item ?? '',
+ fontSize: 14,
+ letterSpacing: -0.96,
+ color: AppGlobal.appTextColor,
+ fontWeight: FontWeight.normal,
+ textAlign: TextAlign.left,
+ ),
+ ),
+ value: item,
+ );
+ }).toList(),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 8),
+ child: AppTextFieldCustom(
+ hintText: TranslationBase.of(context).remarks,
+ controller: remarksController,
+ minLines: 2,
+ maxLines: 4,
+ inputType: TextInputType.multiline,
+ onChanged: (value) {},
+ onClick: () {},
+ onFieldSubmitted: () {},
+ ),
+ ),
+ SizedBox(
+ height: 16,
+ ),
+ ],
+ ),
+ ),
+ ));
+ }
+}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart
index 48dc1189..20a30c2f 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart
@@ -1,3 +1,9 @@
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/audit_diagnosis.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/assessment/patient_previous_diagnosis.dart';
+import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
+import 'package:doctor_app_flutter/core/viewModel/base_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/assessment/widget/audit_list_bottom_sheet.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
@@ -5,10 +11,14 @@ 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:flutter/material.dart';
+import '../../../../../../core/viewModel/SOAP_view_model.dart';
+
class PreviousDiagnosis extends StatelessWidget {
- final List diagnosisItems;
+ final List diagnosisItems;
+ final PatiantInformtion patientInfo;
- const PreviousDiagnosis({super.key, required this.diagnosisItems});
+ const PreviousDiagnosis(
+ {super.key, required this.diagnosisItems, required this.patientInfo});
@override
Widget build(BuildContext context) {
@@ -17,27 +27,68 @@ class PreviousDiagnosis extends StatelessWidget {
child: EmptyDiagnosis(),
);
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
- child: Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- Flexible(
- child: ListView.separated(
- itemBuilder: (_, index) {
- return PreviousDiagnosisItem(
- title: 'lorem ipsum',
- status: 'active',
- condition: 'acute',
- remarks: 'initial',
- onSoapDetailActionClicked: (action) {},
- );
- },
- separatorBuilder: (_, index) => Divider(),
- itemCount: diagnosisItems.length),
- )
- ],
- ),
+ return BaseView(
+ onModelReady: (model) async {},
+ builder: (_, model, w) {
+ if(model.showAudit){
+ WidgetsBinding.instance.addPostFrameCallback((_){
+ showAuditBottomSheet(context,model.auditDiagnosislist,model.toggleShowBottomSheetValue);
+ model.toggleShowBottomSheetValue(false);
+ });
+ }
+
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ child: Column(
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Flexible(
+ child: ListView.separated(
+ itemBuilder: (_, index) {
+ return PreviousDiagnosisItem(
+ title: diagnosisItems[index].selectedDisease ?? '',
+ status: diagnosisItems[index].status ?? '',
+ condition: diagnosisItems[index].condition ?? '',
+ remarks: diagnosisItems[index].remarks ?? '',
+ onSoapDetailActionClicked: (action) {
+ switch (action) {
+ case SoapDetailItemActions.AUDIT:
+ model.getAuditOfDiagnosis(
+ patientInfo,
+ diagnosisItems[index]
+ .patientProblemRevisionId
+ ?.toString() ??
+ '');
+ break;
+ case SoapDetailItemActions.CHANGE_STATUS:
+ model.convertPreviousDiagnosisCurrent(patientInfo, diagnosisItems[index]);
+ default:
+ }
+ },
+ );
+ },
+ separatorBuilder: (_, index) => Divider(),
+ itemCount: diagnosisItems.length),
+ )
+ ],
+ ),
+ );}
);
}
+
+ void showAuditBottomSheet(
+ BuildContext context,
+ List diagnosis, void Function(bool status) toggleShowBottomSheetValue,
+ ) {
+ showModalBottomSheet(
+ isDismissible: true,
+ context: context,
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
+ builder: (_) {
+ return AuditListBottomSheet(
+ auditList: diagnosis,
+ );
+ },
+ ).then((value)=>toggleShowBottomSheetValue(false));
+ }
}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart
index 8cb6c800..0b83fc8f 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart
@@ -4,6 +4,7 @@ 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:flutter_svg/svg.dart';
+import 'package:hexcolor/hexcolor.dart';
typedef OnSoapDetailActionClicked = Function(SoapDetailItemActions);
@@ -29,35 +30,49 @@ class PreviousDiagnosisItem extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Stack(
- children: [
+ // Stack(
+ // children: [
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- AppText(
- title,
- color: Color(0XFF2B353E),
- fontSize: 12,
- fontWeight: FontWeight.bold,
- ),
Row(
children: [
- AppText(
- "${TranslationBase.of(context).condition}:",
- color: Color(0XFF2B353E),
- fontSize: 10,
- fontWeight: FontWeight.w500,
- ),
- SizedBox(
- width: 4,
- ),
- AppText(
- condition,
- color: Color(0xffD02127),
- fontSize: 10,
- fontWeight: FontWeight.w500,
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ AppText(
+ title,
+ color: Color(0XFF2B353E),
+ fontSize: 12,
+ fontWeight: FontWeight.bold,
+ ),
+ SizedBox(height: 4,),
+ Row(
+ children: [
+ AppText(
+ "${TranslationBase.of(context).condition}:",
+ color: Color(0XFF2B353E),
+ fontSize: 10,
+ fontWeight: FontWeight.w500,
+ ),
+ SizedBox(
+ width: 4,
+ ),
+ AppText(
+ condition,
+ color: Color(0xffD02127),
+ fontSize: 10,
+ fontWeight: FontWeight.w500,
+ ),
+ ],
+ ),
+ ],
+ ),
),
+ Status(status: status),
+
],
),
Visibility(
@@ -77,10 +92,10 @@ class PreviousDiagnosisItem extends StatelessWidget {
))
],
),
- Align(
- alignment: Alignment.topRight, child: Status(status: status))
- ],
- ),
+ // Align(
+ // alignment: Alignment.topRight, child: Status(status: status))
+ // ],
+ // ),
SizedBox(
height: 16,
),
@@ -103,13 +118,18 @@ class PreviousDiagnosisItem extends StatelessWidget {
),
SizedBox(
width: 187,
- child: AppButton(
- onPressed: () {
- onSoapDetailActionClicked(
- SoapDetailItemActions.CHANGE_STATUS);
- },
- title: TranslationBase.of(context).makeCurrentDiagnosis,
- ),
+ height: 27,
+ child: Material(
+ color: HexColor("#D02127"),
+ shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(5.0)) ,
+ child: InkWell(
+ onTap: () {
+ onSoapDetailActionClicked(
+ SoapDetailItemActions.CHANGE_STATUS);
+ },
+ child:Center(child: AppText( TranslationBase.of(context).makeCurrentDiagnosis, color: Colors.white,)),
+ ),
+ ),
)
],
)
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart
index 9b2c73a2..49b0d9d7 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart
@@ -43,7 +43,7 @@ class _AddExaminationPageVidaPlusState
if (model.physicalExaminationList.length == 0) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
await model.getMasterLookup(
- MasterKeysService.PhysicalExamination,
+ MasterKeysService.PostPhysicalExaminationModel,
);
});
}
@@ -77,7 +77,7 @@ class _AddExaminationPageVidaPlusState
children: [
ExaminationsListSearchVidaPlusWidget(
mySelectedExamination: widget.mySelectedExamination,
- masterList: model.physicalExaminationList,
+ masterList: model.patientPhysicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
removeExamination: (selectedExamination) {
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/objective/examinations_list_search_vida_plus_widget.dart b/lib/screens/patients/profile/soap_update_vida_plus/objective/examinations_list_search_vida_plus_widget.dart
index 954f6cf2..502114c9 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/objective/examinations_list_search_vida_plus_widget.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/objective/examinations_list_search_vida_plus_widget.dart
@@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.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/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';
@@ -12,7 +13,7 @@ class ExaminationsListSearchVidaPlusWidget extends StatefulWidget {
final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
- final List? masterList;
+ final List? masterList;
final List? mySelectedExamination;
ExaminationsListSearchVidaPlusWidget({required this.removeExamination, required this.addExamination, required this.isServiceSelected, this.masterList, this.mySelectedExamination});
@@ -23,7 +24,7 @@ class ExaminationsListSearchVidaPlusWidget extends StatefulWidget {
class _ExaminationsListSearchVidaPlusWidgetState extends State {
int expandedIndex = -1;
- List? items = [];
+ List? items = [];
TextEditingController filteredSearchController = TextEditingController();
@override
@@ -66,55 +67,55 @@ class _ExaminationsListSearchVidaPlusWidgetState extends State dummySearchList = [];
- dummySearchList.addAll(widget.masterList as Iterable);
- if (query.isNotEmpty) {
- List dummyListData = [];
- dummySearchList.forEach((item) {
- if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
- dummyListData.add(item);
- }
- });
- setState(() {
- items!.clear();
- items!.addAll(dummyListData);
- });
- return;
- } else {
- setState(() {
- items!.clear();
- items!.addAll(widget.masterList as Iterable);
- });
- }
+ // List dummySearchList = [];
+ // dummySearchList.addAll(widget.masterList as Iterable);
+ // if (query.isNotEmpty) {
+ // List dummyListData = [];
+ // dummySearchList.forEach((item) {
+ // if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
+ // dummyListData.add(item);
+ // }
+ // });
+ // setState(() {
+ // items!.clear();
+ // items!.addAll(dummyListData);
+ // });
+ // return;
+ // } else {
+ // setState(() {
+ // items!.clear();
+ // items!.addAll(widget.masterList as Iterable);
+ // });
+ // }
}
}
diff --git a/lib/screens/patients/profile/soap_update_vida_plus/objective/update_objective_page_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/objective/update_objective_page_vida_plus.dart
index fc8e53d7..7f5805c5 100644
--- a/lib/screens/patients/profile/soap_update_vida_plus/objective/update_objective_page_vida_plus.dart
+++ b/lib/screens/patients/profile/soap_update_vida_plus/objective/update_objective_page_vida_plus.dart
@@ -68,40 +68,45 @@ class _UpdateObjectivePageVidaPlusState
@override
Widget build(BuildContext context) {
-
return BaseView(
onModelReady: (model) async {
WidgetsBinding.instance.addPostFrameCallback((_) async {
- model.setObjectiveCallBack(this);
- mySelectedExamination.clear();
- model.isAddExamInProgress = true;
- await model.getPatientPhysicalExam(widget.patientInfo);
- if (model.patientPhysicalExamList.isNotEmpty) {
- if (model.physicalExaminationList.length == 0) {
- await model.getMasterLookup(MasterKeysService.PhysicalExamination);
+ if (model.patientPhysicalExaminationList == 0) {
+ model.getPhysicalExamination(widget.patientInfo);
}
- model.patientPhysicalExamList.forEach((element) {
- MasterKeyModel? examMaster = model.getOneMasterKey(
- masterKeys: MasterKeysService.PhysicalExamination,
- id: element.examId,
- );
- MySelectedExamination tempEam =
- SoapUtils.generateMySelectedExamination(
- examination: examMaster,
- remark: element.remarks,
- isNormal: element.isNormal,
- createdBy: element.createdBy,
- createdOn: element.createdOn,
- editedOn: element.editedOn,
- notExamined: element.notExamined,
- isNew: element.isNew,
- isLocal: false,
- isAbnormal: element.isAbnormal,
- );
- mySelectedExamination.add(tempEam);
- });
- }
- widget.changeLoadingState(false);});
+ // model.getPatientPhysicalExam(widget.patientInfo);
+ model.setObjectiveCallBack(this);
+ mySelectedExamination.clear();
+ model.isAddExamInProgress = true;
+ await model.getPatientPhysicalExam(widget.patientInfo);
+ if (model.patientPhysicalExamList.isNotEmpty) {
+ if (model.physicalExaminationList.length == 0) {
+ await model
+ .getMasterLookup(MasterKeysService.PostPhysicalExaminationModel);
+ }
+ model.patientPhysicalExamList.forEach((element) {
+ MasterKeyModel? examMaster = model.getOneMasterKey(
+ masterKeys: MasterKeysService.PostPhysicalExaminationModel,
+ id: element.examId,
+ );
+ MySelectedExamination tempEam =
+ SoapUtils.generateMySelectedExamination(
+ examination: examMaster,
+ remark: element.remarks,
+ isNormal: element.isNormal,
+ createdBy: element.createdBy,
+ createdOn: element.createdOn,
+ editedOn: element.editedOn,
+ notExamined: element.notExamined,
+ isNew: element.isNew,
+ isLocal: false,
+ isAbnormal: element.isAbnormal,
+ );
+ mySelectedExamination.add(tempEam);
+ });
+ }
+ widget.changeLoadingState(false);
+ });
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
@@ -131,29 +136,31 @@ class _UpdateObjectivePageVidaPlusState
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
- SizedBox(height: 10,),
+ SizedBox(
+ height: 10,
+ ),
AddSoapItem(
title:
TranslationBase.of(context).physicalExamination,
onAddSoapItemClicked: () {
openExaminationList(context);
}),
- SizedBox(height: 16,),
+ SizedBox(
+ height: 16,
+ ),
if (mySelectedExamination.isEmpty) ...{
-
- Center(
+ Center(
child: Padding(
padding: const EdgeInsets.all(65),
- child: EmptyWidget(TranslationBase.of(context).noPhysicalExamination),
+ child: EmptyWidget(TranslationBase.of(context)
+ .noPhysicalExamination),
),
),
-
} else ...{
Divider(),
ListOfExamination(
- listOfSelection: mySelectedExamination
- )
+ listOfSelection: mySelectedExamination)
}
// if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal)
@@ -333,10 +340,8 @@ class _UpdateObjectivePageVidaPlusState
mySelectedExamination: mySelectedExamination,
addSelectedExamination:
(List mySelectedExaminationLocal) {
-
pushAddExamination(mySelectedExaminationLocal);
-
// mySelectedExaminationLocal.forEach((element) {
// if (mySelectedExamination.singleWhere(
// (it) =>
@@ -377,12 +382,14 @@ class _UpdateObjectivePageVidaPlusState
await submitUpdateObjectivePage(model);
}
- void pushAddExamination(List mySelectedExaminationLocal) {
+ void pushAddExamination(
+ List mySelectedExaminationLocal) {
Navigator.push(
context,
FadePage(
page: AddDetailsToExaminationVidaPlus(
- mySelectedExamination: mySelectedExamination,),
+ mySelectedExamination: mySelectedExamination,
+ ),
),
);
}
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 4608e1e0..50cf8db0 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
@@ -32,7 +32,7 @@ class UpdateSoapIndexVidaPlus extends StatefulWidget {
class _UpdateSoapIndexVidaPlusState extends State
with TickerProviderStateMixin {
PageController? _controller;
- int _currentIndex = 0;
+ int _currentIndex =2;
List myAllergiesList = [];
List myHistoryList = [];
@@ -98,7 +98,12 @@ class _UpdateSoapIndexVidaPlusState extends State
scrollDirection: Axis.horizontal,
children: [
-
+ UpdateAssessmentPage(
+ changePageViewIndex: changePageViewIndex,
+ currentIndex: _currentIndex,
+ patientInfo: patient,
+ changeLoadingState: changeLoadingState,
+ ),
UpdateSubjectivePageVidaPlus(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
@@ -109,12 +114,7 @@ class _UpdateSoapIndexVidaPlusState extends State
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
- UpdateAssessmentPage(
- changePageViewIndex: changePageViewIndex,
- currentIndex: _currentIndex,
- patientInfo: patient,
- changeLoadingState: changeLoadingState,
- ),
+
UpdatePlanPageVidaPlus(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart
index 27db82f0..d443785b 100644
--- a/lib/utils/translations_delegate_base_utils.dart
+++ b/lib/utils/translations_delegate_base_utils.dart
@@ -1932,6 +1932,16 @@ class TranslationBase {
String get subAcute => localizedValues['subAcute']![locale.languageCode]!;
String get chronic => localizedValues['chronic']![locale.languageCode]!;
+ String get addToFavorite => localizedValues['addToFavorite']![locale.languageCode]!;
+ String get favoriteDiagnosis => localizedValues['favoriteDiagnosis']![locale.languageCode]!;
+ String get areYouSureYouWantToDeleteDiagnosis => localizedValues['areYouSureYouWantToDeleteDiagnosis']![locale.languageCode]!;
+ String get fieldName => localizedValues['fieldName']![locale.languageCode]!;
+ String get oldValue => localizedValues['oldValue']![locale.languageCode]!;
+ String get newValue => localizedValues['newValue']![locale.languageCode]!;
+ String get event => localizedValues['event']![locale.languageCode]!;
+ String get deletedRemarks => localizedValues['deletedRemarks']![locale.languageCode]!;
+ String get noRemarks => localizedValues['noRemarks']![locale.languageCode]!;
+
}
class TranslationBaseDelegate extends LocalizationsDelegate {