Merge branch 'update_flutter_3.24_vida_plus_episode' of http://34.17.52.180/Haroon6138/doctor_app_flutter into update_flutter_3.24_vida_plus_episode

main
Sultan khan 2 years ago
commit c040927e67

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.45416 1.79596C4.93831 0.272187 7.16683 0.879476 8.51311 1.89051C8.73459 2.05683 8.8866 2.17067 8.99975 2.24754C9.11292 2.17067 9.26492 2.05683 9.4864 1.89051C10.8327 0.879476 13.0612 0.272187 15.5454 1.79596C17.2631 2.8496 18.2296 5.0505 17.8904 7.57926C17.5496 10.1202 15.905 12.9941 12.422 15.5721C11.2125 16.4678 10.3248 17.1253 8.99976 17.1253C7.67471 17.1253 6.78702 16.4678 5.57754 15.5721C2.09453 12.9941 0.449878 10.1202 0.109088 7.57926C-0.230066 5.0505 0.73646 2.8496 2.45416 1.79596Z" fill="#459BF1"/>
</svg>

After

Width:  |  Height:  |  Size: 628 B

@ -308,6 +308,43 @@ const UPDATE_ALLERGIES = 'Services/DoctorApplication.svc/REST/UpdateAllergy';
const GET_CHIEF_COMPLAINT_VP = 'Services/DoctorApplication.svc/REST/ChiefComplaintDetails'; 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';
const SEARCH_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/SearchPhysicalExam';
const GET_GENERAL_SPECIALITY = 'Services/DoctorApplication.svc/REST/GetGeneralSpeciality';
const GET_SPECIALITY_DETAILS = 'Services/DoctorApplication.svc/REST/SearchGeneralSpeciality';
const POST_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const GET_PROGRESS_NOTE_NEW = 'Services/DoctorApplication.svc/REST/GetProgressNote';
const GET_LIST_OF_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisDetailsSearch';
const EDIT_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/EditDiagnosis';
const RESOLVE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisResolve';
const GET_CLINIC = 'Services/DoctorApplication.svc/REST/GetDoctorClinicsForVidaPlus';
const CONTINUE_EPISODE_VP = 'Services/DoctorApplication.svc/REST/ContinueEpisode'; const CONTINUE_EPISODE_VP = 'Services/DoctorApplication.svc/REST/ContinueEpisode';
const UPDATE_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/UpdateChiefComplaint'; const UPDATE_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/UpdateChiefComplaint';

@ -485,6 +485,7 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "ملاحظات على نوع النظام الغذائي" "ar": "ملاحظات على نوع النظام الغذائي"
}, },
"save": {"en": "SAVE", "ar": "حفظ"}, "save": {"en": "SAVE", "ar": "حفظ"},
"saveSmall": {"en": "Save", "ar": "حفظ"},
"postPlansEstimatedCost": { "postPlansEstimatedCost": {
"en": "POST PLANS & ESTIMATED COST", "en": "POST PLANS & ESTIMATED COST",
"ar": "خطط ما بعد العملية والتكلفة المقدرة" "ar": "خطط ما بعد العملية والتكلفة المقدرة"
@ -1204,7 +1205,25 @@ const Map<String, Map<String, String>> localizedValues = {
"noProgressNote": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"}, "noProgressNote": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"},
"mild": {"en": "Mild", "ar":"خفيف"}, "mild": {"en": "Mild", "ar":"خفيف"},
"moderate": {"en": "Moderate", "ar":"معتدل"}, "moderate": {"en": "Moderate", "ar":"معتدل"},
"remarksCanNotBeEmpty": {"en": "Remarks Can Not Be Empty", "ar":"لا يمكن أن تكون الملاحظات فارغة"},
"kindlySelectCategory": {"en": "Kindly Select Any Diagnosis Category", "ar":"يرجى اختيار أي فئة تشخيص"},
"noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"},
"event": {"en": "Event: ", "ar":"حدث: "},
"editDiagnosis": {"en": "Edit Diagnosis ", "ar":"تحرير التشخيص"},
"selectedDiagnosis": {"en": "Kindly Select Diagnosis", "ar":"يرجى اختيار التشخيص: "},
"selectConditionFirst": {"en": "Kindly Select Diagnosis Condition", "ar":"يرجى اختيار حالة التشخيص: "},
"deletedRemarks": {"en": "Deleted Remarks: ", "ar":"ملاحظات محذوفة: "},
"newValue": {"en": "New Value: ", "ar":"قيمة جديدة: "},
"fieldName": {"en": "Field Name: ", "ar":"اسم الحقل: "},
"noChangeRecorded": {"en": "No Change Recorded Unable To Perform Edit", "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":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"}, "noDiagnosisFound": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"},
"areYouSureYouWantToDeleteDiagnosis": {
"en": "Are you sure you want to delete diagnosis",
"ar": "هل أنت متأكد من أنك تريد حذف التشخيص"
},
"activate": {"en": "Activate", "ar":"فعل"}, "activate": {"en": "Activate", "ar":"فعل"},
"resolved": {"en": "Resolved", "ar":"تم الحل"}, "resolved": {"en": "Resolved", "ar":"تم الحل"},

@ -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<String, dynamic> 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<String, dynamic> 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,
};
}
}

@ -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<String, dynamic> 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'];
}
}

@ -0,0 +1,10 @@
class DiagnosisType {
String? diagnosisType;
String? name;
DiagnosisType.fromJson(Map<String, dynamic> json) {
diagnosisType = json['diagnosisType'] ?? '';
name = json['name'] ?? '';
}
}

@ -0,0 +1,287 @@
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<VisitWisePatientDiagnosis>? visitWisePatientDiagnoses;
bool? visitWiseSelected;
PatientPreviousDiagnosis.fromJson(Map<String, dynamic> 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));
});
}
}
Map<String, dynamic> toJson() {
return {
'active': active,
'admissionId': admissionId,
'admissionRequestId': admissionRequestId,
'appointmentId': appointmentId,
'approvedBy': approvedBy,
'approvedOn': approvedOn,
'assessmentId': assessmentId,
'chiefComplainId': chiefComplainId,
'clinicGroupId': clinicGroupId,
'clinicId': clinicId,
'condition': condition,
'createdBy': createdBy,
'createdOn': createdOn,
'deletedBy': deletedBy,
'deletedByDoctorName': deletedByDoctorName,
'deletedOn': deletedOn,
'deletedRemarks': deletedRemarks,
'diagnosisType': diagnosisType,
'doctorId': doctorId,
'episodeId': episodeId,
'hospitalGroupId': hospitalGroupId,
'hospitalId': hospitalId,
'icdCodeDetailsDto': icdCodeDetailsDto,
'icdSubVersion': icdSubVersion,
'icdType': icdType,
'icdVersion': icdVersion,
'location': location,
'loginUserId': loginUserId,
'modifiedBy': modifiedBy,
'modifiedOn': modifiedOn,
'module': module,
'parentLocation': parentLocation,
'patientId': patientId,
'patientProblemChangeHistories': patientProblemChangeHistories,
'patientProblemId': patientProblemId,
'patientProblemRevisionId': patientProblemRevisionId,
'pomrId': pomrId,
'previousProblem': previousProblem,
'problemId': problemId,
'problemName': problemName,
'remarks': remarks,
'resolved': resolved,
'selectedCategoryCode': selectedCategoryCode,
'selectedChapterCode': selectedChapterCode,
'selectedDisease': selectedDisease,
'selectedIcdCode': selectedIcdCode,
'selectedSectionCode': selectedSectionCode,
'status': status,
'visitWiseSelected': visitWiseSelected,
'visitWisePatientDiagnoses': visitWisePatientDiagnoses?.map((v) => v.toJson()).toList(),
};
}
}
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;
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<String, dynamic> 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'];
}
Map<String, dynamic> toJson() {
return {
'active': active,
'admissionId': admissionId,
'appointmentId': appointmentId,
'approvedBy': approvedBy,
'approvedOn': approvedOn,
'assessmentId': assessmentId,
'clinicId': clinicId,
'condition': condition,
'createdBy': createdBy,
'createdOn': createdOn,
'deletedBy': deletedBy,
'deletedOn': deletedOn,
'deletedRemarks': deletedRemarks,
'diagnosisType': diagnosisType,
'doctorId': doctorId,
'episodeId': episodeId,
'hospitalGroupId': hospitalGroupId,
'hospitalId': hospitalId,
'icdSubVersion': icdSubVersion,
'icdType': icdType,
'icdVersion': icdVersion,
'isPreviousProblem': isPreviousProblem,
'location': location,
'loginUserId': loginUserId,
'modifiedBy': modifiedBy,
'modifiedOn': modifiedOn,
'patientDiagnosisId': patientDiagnosisId,
'patientId': patientId,
'patientProblemRevisionId': patientProblemRevisionId,
'pomrId': pomrId,
'problemName': problemName,
'remarks': remarks,
'resolved': resolved,
'selected': selected,
'selectedDisease': selectedDisease,
'selectedDoctorId': selectedDoctorId,
'selectedIcdCode': selectedIcdCode,
};
}
}

@ -0,0 +1,99 @@
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<String>? icdVersion;
String? icdVersionDisplay;
bool? isDeleted;
String? layerID;
String? parentDiseasesCode;
String? specification;
int? specificationId;
String? specificationNo;
String? selectedIcdCode;
String? selectedCategoryCode;
String? selectedSectionCode;
String? selectedChapterCode;
String? selectedNandaCode;
bool isFavorite = false;
// Default constructor
SearchDiagnosis();
// fromJson constructor
SearchDiagnosis.fromJson(Map<String, dynamic> 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<String>.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'];
selectedIcdCode = json['selectedIcdCode'];
selectedCategoryCode = json['selectedCategoryCode'];
selectedSectionCode = json['selectedSectionCode'];
selectedChapterCode = json['selectedChapterCode'];
selectedNandaCode = json['selectedNandaCode'];
}
// toJson method
Map<String, dynamic> 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,
'selectedIcdCode': selectedIcdCode,
'selectedCategoryCode': selectedCategoryCode,
'selectedSectionCode': selectedSectionCode,
'selectedChapterCode': selectedChapterCode,
'selectedNandaCode': selectedNandaCode,
};
}
}

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

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

@ -0,0 +1,24 @@
class GeneralSpeciality {
int? id;
bool? isActive;
String? name;
int? rowVersion;
bool isSelected = false;
GeneralSpeciality();
GeneralSpeciality.fromJson(Map<String, dynamic> json) {
id = json['id'];
isActive = json['isActive'];
name = json['name'];
rowVersion = json['rowVersion'];
}
Map<String, dynamic> toJson() {
return {
'id': id,
'isActive': isActive,
'name': name,
'rowVersion': rowVersion,
};
}
}

@ -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;
String? pomrid;
// Default constructor
PatientPhysicalExamination();
// fromJson constructor
PatientPhysicalExamination.fromJson(Map<String, dynamic> 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<String, dynamic> 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,
};
}
}

@ -0,0 +1,55 @@
@deprecated
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<String, dynamic> json) {
isChecked = json['isChecked'];
selected = json['selected'];
pomrid = json['pomrid'];
patientID = json['patientID'];
isClinicPhysicalExamination = json['isClinicPhysicalExamination'];
physicalExaminationSystemID = json['physicalExaminationSystemID'];
physicalExaminationDescription = json['physicalExaminationDescription'];
specialityID = json['specialityID'];
selectedOptions = json['selectedOptions'];
isMandatory = json['isMandatory'];
specialityDescription = json['specialityDescription'];
physicalExaminationCondition = json['physicalExaminationCondition'];
loginUserId = json['loginUserId'];
remark = json['remark'];
}
Map<String, dynamic> toJson() {
return {
'isChecked': isChecked,
'selected': selected,
'pomrid': pomrid,
'patientID': patientID,
'isClinicPhysicalExamination': isClinicPhysicalExamination,
'physicalExaminationSystemID': physicalExaminationSystemID,
'physicalExaminationDescription': physicalExaminationDescription,
'specialityID': specialityID,
'selectedOptions': selectedOptions,
'isMandatory': isMandatory,
'specialityDescription': specialityDescription,
'physicalExaminationCondition': physicalExaminationCondition,
'loginUserId': loginUserId,
'remark': remark,
};
}
}

@ -0,0 +1,35 @@
class Clinic {
int? clinicGroupID;
String? clinicGroupName;
int? clinicID;
String? clinicNameArabic;
String? clinicNameEnglish;
Clinic({
this.clinicGroupID,
this.clinicGroupName,
this.clinicID,
this.clinicNameArabic,
this.clinicNameEnglish,
});
factory Clinic.fromJson(Map<String, dynamic> json) {
return Clinic(
clinicGroupID: json['clinicGroupID'],
clinicGroupName: json['clinicGroupName'],
clinicID: json['clinicID'],
clinicNameArabic: json['clinicNameArabic'],
clinicNameEnglish: json['clinicNameEnglish'],
);
}
Map<String, dynamic> toJson() {
return {
'clinicGroupID': clinicGroupID,
'clinicGroupName': clinicGroupName,
'clinicID': clinicID,
'clinicNameArabic': clinicNameArabic,
'clinicNameEnglish': clinicNameEnglish,
};
}
}

@ -0,0 +1,85 @@
class ProgressNote {
int? clinicGroupId;
int? clinicId;
int? createdById;
String? createdOn;
int? employeeId;
int? hospitalGroupId;
int? hospitalId;
String? loginUserId;
String? manualDate;
String? modifiedOn;
String? patientCondition;
String? patientConditionName;
int? patientId;
int? patientPomrId;
String? progressNote;
int? progressNoteId;
String? progressNotesTypes;
String? progressNotesTypesName;
String? speciality;
String? specialityName;
int? subCategoryId;
String? userFullName;
int? userId;
String? userType;
ProgressNote();
ProgressNote.fromJson(Map<String, dynamic> json) {
clinicGroupId = json['clinicGroupId'];
clinicId = json['clinicId'];
createdById = json['createdById'];
createdOn = json['createdOn'];
employeeId = json['employeeId'];
hospitalGroupId = json['hospitalGroupId'];
hospitalId = json['hospitalId'];
loginUserId = json['loginUserId'];
manualDate = json['manualDate'];
modifiedOn = json['modifiedOn'];
patientCondition = json['patientCondition'];
patientConditionName = json['patientConditionName'];
patientId = json['patientId'];
patientPomrId = json['patientPomrId'];
progressNote = json['progressNote'];
progressNoteId = json['progressNoteId'];
progressNotesTypes = json['progressNotesTypes'];
progressNotesTypesName = json['progressNotesTypesName'];
speciality = json['speciality'];
specialityName = json['specialityName'];
subCategoryId = json['subCategoryId'];
userFullName = json['userFullName'];
userId = json['userId'];
userType = json['userType'];
}
// toJson method
Map<String, dynamic> toJson() {
return {
'clinicGroupId': clinicGroupId,
'clinicId': clinicId,
'createdById': createdById,
'createdOn': createdOn,
'employeeId': employeeId,
'hospitalGroupId': hospitalGroupId,
'hospitalId': hospitalId,
'loginUserId': loginUserId,
'manualDate': manualDate,
'modifiedOn': modifiedOn,
'patientCondition': patientCondition,
'patientConditionName': patientConditionName,
'patientId': patientId,
'patientPomrId': patientPomrId,
'progressNote': progressNote,
'progressNoteId': progressNoteId,
'progressNotesTypes': progressNotesTypes,
'progressNotesTypesName': progressNotesTypesName,
'speciality': speciality,
'specialityName': specialityName,
'subCategoryId': subCategoryId,
'userFullName': userFullName,
'userId': userId,
'userType': userType,
};
}
}

@ -4,6 +4,10 @@ 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/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_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/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/assessment/patch_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/episode_by_chief_complaint_vidaplus.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/episode_by_chief_complaint_vidaplus.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/get_chief_complaint_vida_plus.dart';
@ -11,6 +15,11 @@ import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/search_chief_
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart'; import 'package:doctor_app_flutter/core/model/SOAP/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/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/get_hopi_details.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/Category.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/CreatePhysicalExamination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciality.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/patient_physical_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_examination_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetHomeMedication.dart'; import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetHomeMedication.dart';
import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetSearchCurrentMedication.dart'; import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetSearchCurrentMedication.dart';
import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetSearchCurrentMedicationDetails.dart'; import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetSearchCurrentMedicationDetails.dart';
@ -28,15 +37,22 @@ import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_reques
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_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/get_physical_exam_req_model.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/physical_exam/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/Clinic.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; 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/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/SOAP/progress_note/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../utils/date-utils.dart';
import '../../../model/SOAP/assessment/patch_assessment_req_model.dart';
import '../../../model/patient/patiant_info_model.dart';
import '../../base/lookup-service.dart';
class SOAPService extends LookupService { class SOAPService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList = []; List<GetChiefComplaintResModel> patientChiefComplaintList = [];
@ -44,6 +60,7 @@ class SOAPService extends LookupService {
List<GetHistoryResModel> patientHistoryList = []; List<GetHistoryResModel> patientHistoryList = [];
List<GetPhysicalExamResModel> patientPhysicalExamList = []; List<GetPhysicalExamResModel> patientPhysicalExamList = [];
List<GetPatientProgressNoteResModel> patientProgressNoteList = []; List<GetPatientProgressNoteResModel> patientProgressNoteList = [];
List<ProgressNote> patientProgressNoteListVidaPlus = [];
List<GetAssessmentResModel> patientAssessmentList = []; List<GetAssessmentResModel> patientAssessmentList = [];
List<AllergiesListVidaPlus> searchAllergiesList = []; List<AllergiesListVidaPlus> searchAllergiesList = [];
List<PatientAllergiesVidaPlus> patientAllergiesVidaPlus = []; List<PatientAllergiesVidaPlus> patientAllergiesVidaPlus = [];
@ -54,6 +71,20 @@ class SOAPService extends LookupService {
List<GetHomeMedicationList> getHomeMedicationList = []; List<GetHomeMedicationList> getHomeMedicationList = [];
List<GetSearchCurrentMedication> getSearchCurrentMedication = []; List<GetSearchCurrentMedication> getSearchCurrentMedication = [];
List<GetSearchCurrentMedicationDetails> getSearchCurrentMedicationDetails = []; List<GetSearchCurrentMedicationDetails> getSearchCurrentMedicationDetails = [];
List<PatientPreviousDiagnosis> patientPreviousDiagnosisList = [];
List<PatientPreviousDiagnosis> patientDiagnosisList = [];
List<FavoriteDiseaseDetails> favoriteDiagnosisDetailsList = [];
List<AuditDiagnosis> auditDiagnosislist = [];
List<SearchDiagnosis> searchDiagnosisList = [];
List<PatientPhysicalExamination> patientPhysicalExaminationList = [];
List<GeneralSpeciality> generalSpeciality = [];
List<Clinic> clinicsList = [];
Map<String, List<Category>> specialityDetails = {};
Map<String, dynamic> diagnosisTypeList = {};
Map<String, dynamic> conditionTypeList = {};
List<String> icdVersionList = [];
bool showAuditBottomSheet = false;
int? episodeID; int? episodeID;
bool isPrescriptionOrder = false; bool isPrescriptionOrder = false;
@ -665,6 +696,539 @@ class SOAPService extends LookupService {
}, body: request); }, body: request);
} }
searchDiagnosis(PatiantInformtion patient, String diagnosis) async {
Map<String, dynamic> 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<String> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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);
}
getDiagnosis(PatiantInformtion patient) async {
Map<String, dynamic> request = {
"hospitalGroupId": 105,
"hospitalId": 313,
"patientId": 70023498,
"patientPomrId": 9907,
"startRow": 0,
"endRow": 10,
"isSelected": true,
"ProjectID": 313
// "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
// "hospitalId": patient.projectId,
// "patientId": patient.patientId,
// "patientPomrId": patient.pomrId,
// "startRow": 0,
// "endRow": 1000000,
// "ProjectID": patient.projectId
};
hasError = false;
await baseAppClient.post(GET_LIST_OF_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
patientDiagnosisList.clear();
response['ListDiagnosisDetailsSearch']['resultData'].forEach((v) =>
patientDiagnosisList.add(PatientPreviousDiagnosis.fromJson(v)));
}, onFailure: (String error, int statusCode) {
patientDiagnosisList.clear();
hasError = true;
super.error = error;
}, body: request);
}
removeDiagnosis(PatiantInformtion patientInfo, String? patientProblemId,
String? problemId, String? deletedRemarks) async {
Map<String, dynamic> 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<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
Map<String, dynamic> 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<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
Map<String, dynamic> request =
// {
// "patientId": 70024978,
// "pomrId": 10819,
// "hospitalId": 313,
// "hospitalGroupId": 105,
// "ProjectID": 313
// };
{
"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(SEARCH_PHYSICAL_EXAMINATION,
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);
}
Future<bool> postPhysicalExamination(
PatiantInformtion patientInfo, List<Category> physicalExamination) async {
List<CreatePhysicalExamination> jsonListOfPhysicalExamination = [];
physicalExamination.forEach((value) => jsonListOfPhysicalExamination
.add(value.createPhysicalExaminationFromCategory()));
Map<String, dynamic> request = {
"ProjectID": patientInfo.projectId,
"listCreatPhysicalExam": jsonListOfPhysicalExamination
};
hasError = false;
var success = false;
await baseAppClient.post(POST_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast(response['ListPhysicalExam']['message']);
success = true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
success = false;
}, body: request);
return success;
}
getGeneralSpeciality(PatiantInformtion patientInfo) async {
Map<String, dynamic> request = {
"ProjectID": patientInfo.projectId,
};
hasError = false;
generalSpeciality.clear();
await baseAppClient.post(GET_GENERAL_SPECIALITY,
onSuccess: (dynamic response, int statusCode) {
response['ListGeneralSpeciality']['resultData'].forEach((v) =>
v['categories'].forEach(
(cat) => generalSpeciality.add(GeneralSpeciality.fromJson(cat))));
}, onFailure: (String error, int statusCode) {
hasError = true;
generalSpeciality.clear();
super.error = error;
}, body: request);
}
Future<bool> addToFavoriteDiagnosis(PatiantInformtion paitientInfo,
String doctorName, String subFavoriteCode, dynamic? userId) async {
Map<String, dynamic> 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;
var isFavoriteAdded = false;
favoriteDiagnosisDetailsList.clear();
await baseAppClient.post(ADD_TO_FAVORITE_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
var result = response['ListDiagnosisAddFavourite']['resultData'];
isFavoriteAdded = true;
if ((result is List) && (result as List).isEmpty) {
DrAppToastMsg.showErrorToast(
response['ListDiagnosisAddFavourite']['message']);
} else {
DrAppToastMsg.showSuccesToast(
response['ListDiagnosisAddFavourite']['message']);
}
}, onFailure: (String error, int statusCode) {
favoriteDiagnosisDetailsList.clear();
hasError = true;
isFavoriteAdded = false;
super.error = error;
}, body: request);
return isFavoriteAdded;
}
convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo,
PatientPreviousDiagnosis diagnosis) async {
Map<String, dynamic> 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;
var 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);
}
Future getProgressNoteNew(PatiantInformtion patientInformation) async {
Map<String, dynamic> request = {
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"hospitalId": patientInformation.projectId,
"patientId": patientInformation.patientId,
"patientPomrId": patientInformation.pomrId,
"endRow": 10000, // because no information is provided for the end row
"startRow": 0,
"ProjectID": patientInformation.projectId
};
hasError = false;
await baseAppClient.post(GET_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientProgressNoteListVidaPlus.clear();
response['ListProgressNote']['resultData'].forEach((v) {
v['data'].forEach((progressNote) {
patientProgressNoteListVidaPlus
.add(ProgressNote.fromJson(progressNote));
});
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: request);
}
getSpecialityDetails(String speciality, int? specialityId,
PatiantInformtion patientInfo) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
var userId = user?['List_MemberInformation'][0]['MemberID'];
Map<String, dynamic> request = {"searchParam": speciality};
hasError = false;
specialityDetails.clear();
List<Category> categoryData = [];
await baseAppClient.post(GET_SPECIALITY_DETAILS,
onSuccess: (dynamic response, int statusCode) {
response['ListEyeGeneralSpeciality']['resultData'].forEach((value) =>
categoryData.add(Category.fromJson(
value,
specialityId,
speciality,
patientInfo.pomrId,
patientInfo.patientId,
user?['List_MemberInformation'][0]['MemberID'])));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: request);
if (!hasError) {
specialityDetails[speciality] = categoryData;
}
}
Future<bool> createDiagnosis(
PatiantInformtion patient,
SearchDiagnosis? searchDiagnosis,
String? diagnosisType,
String conditionType,
String remarks,
bool isNew) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
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,
"selectedDisease": searchDiagnosis.diseasesName,
"diseasesCode": searchDiagnosis.diseasesCode,
"diseasesId": searchDiagnosis.diseasesId,
"selectedIcdCode": searchDiagnosis.selectedIcdCode,
"selectedCategoryCode": searchDiagnosis.selectedCategoryCode,
"selectedSectionCode": searchDiagnosis.selectedSectionCode,
"selectedChapterCode": searchDiagnosis.selectedChapterCode,
"selectedNandaCode": searchDiagnosis.selectedNandaCode,
"isResolved": false,
"doctorId": patient.doctorId,
"doctorCode": user?['List_MemberInformation'][0]['MemberID'],
"ProjectID": patient.projectId,
"codeRange": searchDiagnosis.codeRange
};
var success = false;
await baseAppClient.post(CREATE_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast(response['CreatDiagnosis']['message']);
success = true;
}, onFailure: (String error, int statusCode) {
success = false;
hasError = true;
super.error = error;
}, body: request);
return success;
}
Future<bool> editDiagnosis(PatientPreviousDiagnosis diagnosis) async {
var request = diagnosis.toJson();
var success = false;
await baseAppClient.post(EDIT_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
if (response['ListVisitWisePatientDiagnosis']['resultData'] != null &&
(response['ListVisitWisePatientDiagnosis']['resultData'] as List)
.isNotEmpty) {
success = true;
return;
}
success = false;
}, onFailure: (String error, int statusCode) {
success = false;
hasError = true;
super.error = error;
}, body: request);
return success;
}
Future<bool> resolveDiagnosis(PatientPreviousDiagnosis diagnosis) async {
var request = {
"patientProblemRevisionId": diagnosis.patientProblemRevisionId,
"patientProblemId": diagnosis.patientProblemId,
"patientId": diagnosis.patientId,
"doctorId": diagnosis.doctorId,
"pomrId": diagnosis.pomrId,
"appointmentId": diagnosis.appointmentId,
"problemId": diagnosis.problemId,
"diagnosisType": diagnosis.diagnosisType,
};
var success = false;
await baseAppClient.post(RESOLVE_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
if (response['ListDiagnosisResolve'] != null &&
response['ListDiagnosisResolve']['resultData'] != null &&
(response['ListVisitWisePatientDiagnosis']['resultData'] as List)
.isNotEmpty) {
success = true;
return;
}
success = false;
}, onFailure: (String error, int statusCode) {
success = false;
hasError = true;
super.error = error;
}, body: request);
return success;
}
Future<bool> getClinic() async {
Map<String,dynamic> request = {};
var success = false;
await baseAppClient.post(GET_CLINIC,
onSuccess: (dynamic response, int statusCode) {
response['ListDoctorClinics'].forEach((v) =>
v['categories'].forEach(
(cat) => clinicsList.add(Clinic.fromJson(cat))));
success = false;
}, onFailure: (String error, int statusCode) {
success = false;
hasError = true;
super.error = error;
}, body: request);
return success;
}
continueEpisodeVidaPlus( continueEpisodeVidaPlus(

@ -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/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.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'; import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
@ -6,6 +7,10 @@ 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/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/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/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/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/episode_by_chief_complaint_vidaplus.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/episode_by_chief_complaint_vidaplus.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_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_res_model.dart';
@ -23,13 +28,17 @@ import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetSearchC
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/Category.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_list_res_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/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/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/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/Clinic.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; 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/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/SOAP/progress_note/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart';
@ -42,10 +51,12 @@ import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objectiv
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart'; import '../model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart';
import '../model/SOAP/assessment/patch_assessment_req_model.dart'; import '../model/SOAP/assessment/patch_assessment_req_model.dart';
import '../model/SOAP/physical_exam/GeneralSpeciality.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class SOAPViewModel extends BaseViewModel { class SOAPViewModel extends BaseViewModel {
@ -113,6 +124,27 @@ class SOAPViewModel extends BaseViewModel {
List<SearchChiefComplaint> get searchChiefComplaintList => List<SearchChiefComplaint> get searchChiefComplaintList =>
_SOAPService.searchChiefComplaintListVidaPlus; _SOAPService.searchChiefComplaintListVidaPlus;
List<SearchDiagnosis> get searchDiagnosisList =>
_SOAPService.searchDiagnosisList;
List<String> get icdVersionList => _SOAPService.icdVersionList;
List<PatientPreviousDiagnosis> get patientPreviousDiagnosis =>
_SOAPService.patientPreviousDiagnosisList;
List<PatientPreviousDiagnosis> get diagnosisList =>
_SOAPService.patientDiagnosisList;
List<FavoriteDiseaseDetails> get favoriteDiagnosisDetails =>
_SOAPService.favoriteDiagnosisDetailsList;
Map<String, dynamic> get diagnosisTypeList => _SOAPService.diagnosisTypeList;
Map<String, dynamic> get conditionTypeMap => _SOAPService.conditionTypeList;
List<String> get conditionTypeList =>
_SOAPService.conditionTypeList.keys.toList();
List<GetChiefComplaintVidaPlus> get getChiefComplaintListVidaPlus => List<GetChiefComplaintVidaPlus> get getChiefComplaintListVidaPlus =>
_SOAPService.patientChiefComplaintListVidaPlus; _SOAPService.patientChiefComplaintListVidaPlus;
@ -121,8 +153,28 @@ class SOAPViewModel extends BaseViewModel {
_SOAPService.episodeByChiefComplaintListVidaPlus; _SOAPService.episodeByChiefComplaintListVidaPlus;
List<PatientPhysicalExamination> get patientPhysicalExaminationList =>
_SOAPService.patientPhysicalExaminationList;
List<AuditDiagnosis> get auditDiagnosislist =>
_SOAPService.auditDiagnosislist;
List<GeneralSpeciality>? mainSpecialityList = null;
List<GeneralSpeciality> speciality = [];
List<ProgressNote> get progressNote =>
_SOAPService.patientProgressNoteListVidaPlus;
List<Clinic> get clinics =>
_SOAPService.clinicsList;
Map<String, List<Category>> get specialityDetails =>
_SOAPService.specialityDetails;
int? get episodeID => _SOAPService.episodeID; int? get episodeID => _SOAPService.episodeID;
bool get showAudit => _SOAPService.showAuditBottomSheet;
bool get isPrescriptionOrder => _SOAPService.isPrescriptionOrder; bool get isPrescriptionOrder => _SOAPService.isPrescriptionOrder;
bool isAddProgress = true; bool isAddProgress = true;
bool isAddExamInProgress = true; bool isAddExamInProgress = true;
@ -130,6 +182,7 @@ class SOAPViewModel extends BaseViewModel {
String complaintsControllerError = ''; String complaintsControllerError = '';
String medicationControllerError = ''; String medicationControllerError = '';
String illnessControllerError = ''; String illnessControllerError = '';
String selectedIcd = '';
get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationStrengthList => _SOAPService.medicationStrengthListWithModel;
@ -1125,4 +1178,290 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); 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);
}
getCurrentDiagnosisList(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.getDiagnosis(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);
}
Future<SearchDiagnosis?> addToFavoriteDiagnosis(PatiantInformtion patientInfo,
{SearchDiagnosis? diagnosis}) async {
setState(ViewState.BusyLocal);
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
var userID = user?['List_MemberInformation'][0]['MemberID'];
bool result = await _SOAPService.addToFavoriteDiagnosis(
patientInfo,
profile?['DoctorName'] ?? '',
diagnosis?.diseasesBCode ?? '',
userID);
// if (diagnosis != null) {
diagnosis?.isFavorite = result;
// searchDiagnosisList[index] = diagnosis;
// }
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return diagnosis;
}
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);
}
List<Category> getListOfSelectedCategory() {
List<Category> mappedItems = [];
for (List<Category> category in specialityDetails.values) {
var selectedCategory =
category.where((value) => value.isSelected == true);
mappedItems.addAll(selectedCategory);
}
return mappedItems;
}
Future<bool> postPhysicalExamination(PatiantInformtion patientInfo,
List<Category> listOfSelectedCategory) async {
setState(ViewState.BusyLocal);
bool result = await _SOAPService.postPhysicalExamination(
patientInfo, listOfSelectedCategory);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
getGeneralSpeciality(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.getGeneralSpeciality(patientInfo);
mainSpecialityList = _SOAPService.generalSpeciality;
speciality = mainSpecialityList ?? [];
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
getSpecialityDetails(String speciality, int? specialityId,
PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.getSpecialityDetails(
speciality, specialityId, patientInfo);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
void toggleShowBottomSheetValue(bool status) {
_SOAPService.showAuditBottomSheet = status;
}
getProgressNote(PatiantInformtion patientInformation) async {
setState(ViewState.BusyLocal);
await _SOAPService.getProgressNoteNew(patientInformation);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future<bool> createDiagnosis(
PatiantInformtion patientInformation,
SearchDiagnosis? searchDiagnosis,
String? diagnosisType,
String conditionType,
String remarks,
bool isNew) async {
setState(ViewState.BusyLocal);
bool result = await _SOAPService.createDiagnosis(patientInformation,
searchDiagnosis, diagnosisType, conditionType, remarks, isNew);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
Future<bool> editDiagnosis(PatientPreviousDiagnosis diagnosis) async {
setState(ViewState.BusyLocal);
bool result = await _SOAPService.editDiagnosis(diagnosis);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
Future<bool> resolveDiagnosis(PatientPreviousDiagnosis diagnosis) async {
setState(ViewState.BusyLocal);
bool result = await _SOAPService.resolveDiagnosis(diagnosis);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
void changeCurrentCategorySelectedState(
GeneralSpeciality selectedExamination, bool status) {
final item = speciality.firstWhere(
(speciality) => speciality.id == selectedExamination.id,
orElse: () => throw Exception(
'Speciality with ID ${selectedExamination.id} not found!'),
);
item.isSelected = status;
notifyListeners();
}
void filterData(String query) {
if (query.isEmpty) {
speciality = mainSpecialityList ?? [];
}
var searchList = mainSpecialityList
?.where((value) =>
value.name?.toLowerCase().contains(query.toLowerCase()) == true)
.toList() ??
[];
speciality = searchList;
notifyListeners();
}
getClinics() async {
setState(ViewState.BusyLocal);
await _SOAPService.getClinic();
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
} }

@ -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/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.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/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class AddDiagnosis extends StatefulWidget { class AddDiagnosis extends StatefulWidget {
final PatiantInformtion patientInfo;
const AddDiagnosis({super.key, required this.patientInfo});
@override @override
State<AddDiagnosis> createState() => _AddDiagnosisState(); State<AddDiagnosis> createState() => _AddDiagnosisState();
} }
@ -15,6 +25,7 @@ class AddDiagnosis extends StatefulWidget {
class _AddDiagnosisState extends State<AddDiagnosis> class _AddDiagnosisState extends State<AddDiagnosis>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController? _tabController; TabController? _tabController;
bool isLoading = true;
@override @override
void initState() { void initState() {
@ -25,7 +36,17 @@ class _AddDiagnosisState extends State<AddDiagnosis>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) {
WidgetsBinding.instance.addPostFrameCallback((_) {
model.getConditionAndType(widget.patientInfo);
model.favoriteDiagnosis(widget.patientInfo);
setState(() {
isLoading = false;
});
});
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isLoading: model.state == ViewState.BusyLocal ,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: TranslationBase.of(context).addDiagnosis), title: TranslationBase.of(context).addDiagnosis),
@ -51,7 +72,7 @@ class _AddDiagnosisState extends State<AddDiagnosis>
), ),
Tab( Tab(
child: AppText( child: AppText(
TranslationBase.of(context).mappedDiagnosis, TranslationBase.of(context).favoriteDiagnosis,
color: Color(0xFF6D6D6D), color: Color(0xFF6D6D6D),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -65,8 +86,12 @@ class _AddDiagnosisState extends State<AddDiagnosis>
child: TabBarView( child: TabBarView(
controller: _tabController, controller: _tabController,
children: [ children: [
EnterDiagnosis(), EnterDiagnosis(
EnterDiagnosis(), patientInfo: widget.patientInfo,
),
FavoriteDiagnosis(
patientInfo: widget.patientInfo,
),
], ],
), ),
), ),

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; 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/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/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/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
@ -67,49 +68,16 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
model.setAssessmentCallBack(this); model.setAssessmentCallBack(this);
mySelectedAssessmentList.clear(); mySelectedAssessmentList.clear();
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
await model.isPrescriptionOrderCreated(widget.patientInfo); widget.changeLoadingState(true);
await model.onUpdateAssessmentStepStart(widget.patientInfo); model.getPreviousPatientDetails(widget.patientInfo);
model.getCurrentDiagnosisList(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(false); widget.changeLoadingState(false);
//todo handle get diagnosis list
}); });
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
isLoading: model.state == ViewState.BusyLocal,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
@ -158,7 +126,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
Tab( Tab(
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.currentDiagnosis, .previousDiagnosis,
color: Color(0xFF6D6D6D), color: Color(0xFF6D6D6D),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -175,10 +143,13 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
controller: _tabController, controller: _tabController,
children: [ children: [
CurrentDiagnosis( CurrentDiagnosis(
currentDiagnosisItems: [''], patientInfo: widget.patientInfo,
model: model,
currentDiagnosisItems: model.diagnosisList,
), ),
PreviousDiagnosis( PreviousDiagnosis(
diagnosisItems: [''], diagnosisItems: model.patientPreviousDiagnosis,
patientInfo: widget.patientInfo,
) )
], ],
), ),

@ -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);
}
}

@ -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<AuditDiagnosis> auditList;
const AuditListBottomSheet({super.key, required this.auditList});
@override
Widget build(BuildContext context) {
return SizedBox(
height: (auditList.length>1)?MediaQuery.sizeOf(context).height*.41: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(),
))
],
),
),
)
],
),
),
),
);
}
}

@ -1,61 +1,250 @@
import 'package:doctor_app_flutter/config/config.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/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/add_diagnosis.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/audit_list_bottom_sheet.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/edit_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/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/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/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/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:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CurrentDiagnosis extends StatelessWidget { import '../../../../../../widgets/shared/text_fields/app-textfield-custom.dart';
final List<dynamic> currentDiagnosisItems;
const CurrentDiagnosis({super.key, required this.currentDiagnosisItems}); class CurrentDiagnosis extends StatefulWidget {
final PatiantInformtion patientInfo;
final List<PatientPreviousDiagnosis> currentDiagnosisItems;
final SOAPViewModel model;
const CurrentDiagnosis(
{super.key,
required this.currentDiagnosisItems,
required this.patientInfo,
required this.model});
@override
State<CurrentDiagnosis> createState() => _CurrentDiagnosisState();
}
class _CurrentDiagnosisState extends State<CurrentDiagnosis> {
TextEditingController deleteController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return BaseView<SOAPViewModel>(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), onModelReady: (model) async {},
child: Column( builder: (_, model, w) {
mainAxisSize: MainAxisSize.max, if (model.showAudit) {
children: [ WidgetsBinding.instance.addPostFrameCallback((_) {
SizedBox( showAuditBottomSheet(context, model.auditDiagnosislist,
height: 10, model.toggleShowBottomSheetValue);
), model.toggleShowBottomSheetValue(false);
AddSoapItem( });
title: TranslationBase.of(context).addNewDiagnosis,
onAddSoapItemClicked: () {
Navigator.push(context, FadePage(page: AddDiagnosis()));
}),
SizedBox(
height: 16,
),
Divider(),
SizedBox(
height: 16,
),
if (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) {},
);
},
separatorBuilder: (_, index) => Divider(),
itemCount: currentDiagnosisItems.length))
} }
],
), return Padding(
); padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
SizedBox(
height: 10,
),
AddSoapItem(
title: TranslationBase.of(context).addNewDiagnosis,
onAddSoapItemClicked: () async {
bool result = await Navigator.push(
context,
FadePage(
page: AddDiagnosis(
patientInfo: widget.patientInfo,
)));
if (result) {
model.getCurrentDiagnosisList(widget.patientInfo);
}
}),
SizedBox(
height: 16,
),
Divider(),
SizedBox(
height: 16,
),
if (widget.currentDiagnosisItems.isEmpty) ...{
Center(
child: EmptyDiagnosis(),
),
} else ...{
Flexible(
child: ListView.separated(
itemBuilder: (_, index) {
return SoapDetailItem(
title: widget.currentDiagnosisItems[index]
.selectedDisease ??
'',
status:
widget.currentDiagnosisItems[index].status ??
'',
condition: widget
.currentDiagnosisItems[index].condition ??
'',
remarks:
widget.currentDiagnosisItems[index].remarks ??
'',
onSoapDetailActionClicked: (action) async{
switch (action) {
case SoapDetailItemActions.AUDIT:
model.getAuditOfDiagnosis(
widget.patientInfo,
widget.currentDiagnosisItems[index]
.patientProblemRevisionId
?.toString() ??
'');
break;
case SoapDetailItemActions.EDIT:
bool result = await Navigator.push(
context,
FadePage(
page: EditDiagnosis(
patientInfo: widget.patientInfo, diagnosis: widget.currentDiagnosisItems[index],
)));
if (result) {
model.getCurrentDiagnosisList(widget.patientInfo);
}
break;
case SoapDetailItemActions.RESOLVE:
bool result = await model.resolveDiagnosis(widget.currentDiagnosisItems[index]);
if (result) {
model.getCurrentDiagnosisList(widget.patientInfo);
}
break;
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();
});
}
void showAuditBottomSheet(
BuildContext context,
List<AuditDiagnosis> 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));
} }
} }

@ -0,0 +1,477 @@
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/enum/view_state.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/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/empty_dropdown.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/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: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:get_it/get_it.dart';
import 'package:hexcolor/hexcolor.dart';
class EditDiagnosis extends StatefulWidget {
final PatiantInformtion patientInfo;
final PatientPreviousDiagnosis diagnosis;
const EditDiagnosis(
{super.key, required this.patientInfo, required this.diagnosis});
@override
State<EditDiagnosis> createState() => _EditDiagnosisState();
}
class _EditDiagnosisState extends State<EditDiagnosis> {
final TextEditingController filteredSearchController =
TextEditingController();
bool showAllDiagnosis = true;
String status = '';
String? selectedDiagnosisItem;
String? selectedDiagnosisItemValue;
TextEditingController remarksController = TextEditingController();
Timer? _tTimer;
SOAPViewModel? model;
SearchDiagnosis? selectedDiagnosis;
@override
void initState() {
super.initState();
filteredSearchController.text = widget.diagnosis.selectedDisease ?? '';
filteredSearchController.text = widget.diagnosis.remarks ?? '';
status = widget.diagnosis.condition ?? '';
selectedDiagnosisItemValue = widget.diagnosis?.diagnosisType ?? '';
}
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<SOAPViewModel>(onModelReady: (model) {
this.model = model;
WidgetsBinding.instance.addPostFrameCallback((_) {
model.getConditionAndType(widget.patientInfo);
});
}, builder: (_, model, w) {
if (selectedDiagnosisItem == null && model.diagnosisTypeList.isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) {
setState(() {
selectedDiagnosisItem = model.diagnosisTypeList.keys.firstWhere(
(k) =>
model.diagnosisTypeList[k] == selectedDiagnosisItemValue,
orElse: () => '');
if (selectedDiagnosisItem?.isEmpty == true)
selectedDiagnosisItem = null;
});
}
});
}
return AppScaffold(
isLoading: model.state == ViewState.BusyLocal,
isShowAppBar: true,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).editDiagnosis),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).editDiagnosis,
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,
),
onPressed: () {},
),
),
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();
},
);
},
),
);
},
),
),
),
),
SizedBox(
height: 8,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Row(
// children: [
// Switch(
// value: showAllDiagnosis,
// activeColor: Colors.red,
// onChanged: (bool value) {
// setState(() {
// showAllDiagnosis = value;
// });
// },
// ),
// SizedBox(
// width: 8,
// ),
// AppText(
// 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,
),
),
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]
.toLowerCase()
? 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(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: selectedDiagnosisItem == null
? model.diagnosisTypeList.keys.first
: selectedDiagnosisItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
if (newValue != null)
setState(() {
selectedDiagnosisItem = 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(),
),
),
],
),
),
),
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,
),
// InkWell(
// onTap: () async {
// if (selectedDiagnosis != null) {
// SearchDiagnosis? diagnosis =
// await model.addToFavoriteDiagnosis(widget.patientInfo,
// diagnosis: selectedDiagnosis);
// setState(() {
// selectedDiagnosis = diagnosis;
// });
// }
// },
// child: Row(
// children: [
// SvgPicture.asset(selectedDiagnosis?.isFavorite == true
// ? '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),
// ),
// ],
// ),
// )
],
),
),
),
bottomNavigationBar: 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]!,
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 {
selectedDiagnosisItem ??=
model.diagnosisTypeList.keys.first;
if (selectedDiagnosis == null &&
filteredSearchController.text.isEmpty) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.selectedDiagnosis);
return;
}
if (status.isEmpty) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.selectConditionFirst);
return;
}
if (remarksController.text.isEmpty) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.remarksCanNotBeEmpty);
return;
}
if (filteredSearchController.text ==
widget.diagnosis.selectedDisease &&
status == widget.diagnosis.condition &&
widget.diagnosis.diagnosisType ==
selectedDiagnosisItem &&
widget.diagnosis.remarks ==
filteredSearchController.text) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.noChangeRecorded);
return;
}
widget.diagnosis.selectedDisease =
filteredSearchController.text;
widget.diagnosis.selectedCategoryCode =
selectedDiagnosis?.selectedCategoryCode ?? '';
widget.diagnosis.selectedIcdCode =
selectedDiagnosis?.selectedIcdCode ?? '';
widget.diagnosis.selectedChapterCode =
selectedDiagnosis?.selectedChapterCode ?? '';
widget.diagnosis.selectedSectionCode =
selectedDiagnosis?.selectedSectionCode ?? '';
widget.diagnosis.condition = status;
widget.diagnosis.diagnosisType =
selectedDiagnosisItem;
bool result =
await model.editDiagnosis(widget.diagnosis);
if (result) {
Navigator.pop(context, result);
}
}),
),
],
),
)
],
),
),
),
);
});
}
}

@ -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),
)
],
),
);
}
}

@ -1,14 +1,30 @@
import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_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/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
List<String> patientState = ["","Stable", "Not Stable", "Not Defined"];
List<String> patientState = ["", "Stable", "Not Stable", "Not Defined"];
class EnterDiagnosis extends StatefulWidget { class EnterDiagnosis extends StatefulWidget {
final PatiantInformtion patientInfo;
const EnterDiagnosis({super.key, required this.patientInfo});
@override @override
State<EnterDiagnosis> createState() => _EnterDiagnosisState(); State<EnterDiagnosis> createState() => _EnterDiagnosisState();
} }
@ -17,276 +33,386 @@ class _EnterDiagnosisState extends State<EnterDiagnosis> {
final TextEditingController filteredSearchController = final TextEditingController filteredSearchController =
TextEditingController(); TextEditingController();
bool showAllDiagnosis = true; bool showAllDiagnosis = true;
bool status = true; String status = '';
String selectedItem = "Stable"; String? selectedDiagnosisItem;
String? selectedDiagnosisItemValue;
TextEditingController remarksController = TextEditingController(); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return BaseView<SOAPViewModel>(
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), onModelReady: (model) {
child: Column( this.model = model;
crossAxisAlignment: CrossAxisAlignment.start, },
children: [ builder: (_, model, w) => AppScaffold(
AppText( isShowAppBar: false,
TranslationBase.of(context).addDiagnosis, body: SingleChildScrollView(
fontWeight: FontWeight.w600, child: Padding(
color: Color(0xFF2E303A), padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
fontSize: 16, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: 16, AppText(
), TranslationBase.of(context).addDiagnosis,
AppTextFieldCustom( fontWeight: FontWeight.w600,
hintText: TranslationBase.of(context).selectAllergy, color: Color(0xFF2E303A),
isTextFieldHasSuffix: true, fontSize: 16,
hasBorder: true, ),
controller: filteredSearchController, SizedBox(
onChanged: (value) {}, height: 16,
onFieldSubmitted: () {}, ),
suffixIcon: IconButton( AppTextFieldCustom(
icon: Icon( hintText: TranslationBase.of(context).diagnosis,
Icons.search, isTextFieldHasSuffix: true,
color: Color(0xff2B353E), hasBorder: true,
size: 30, controller: filteredSearchController,
), onClick: () {
onPressed: () {}, setState(
), () {
), selectedDiagnosis = null;
SizedBox( filteredSearchController.text = '';
height: 8, model.selectedIcd = '';
), },
Row( );
mainAxisAlignment: MainAxisAlignment.spaceBetween, },
children: [ onChanged: (value) {
Row( if (value != null) _onTextChanged(value);
children: [ },
Switch( onFieldSubmitted: () {},
value: showAllDiagnosis, suffixIcon: IconButton(
activeColor: Colors.red, icon: Icon(
onChanged: (bool value) { Icons.search,
setState(() { color: Color(0xff2B353E),
showAllDiagnosis = value; size: 30,
}); ),
}, onPressed: () {},
),
SizedBox(
width: 8,
), ),
AppText( ),
TranslationBase.of(context).showAllDiagnosis, Positioned(
fontWeight: FontWeight.w500, child: Material(
color: Color(0xFF2E303A), elevation: 4.0, // Optional: for shadow effect
fontSize: 11, 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();
},
);
},
),
);
},
),
),
), ),
], ),
), SizedBox(
SvgPicture.asset('assets/images/svgs/information.svg'), height: 8,
], ),
), Row(
Container( mainAxisAlignment: MainAxisAlignment.spaceBetween,
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: [ children: [
Container( Row(
padding: EdgeInsets.all(2.0), children: [
margin: EdgeInsets.symmetric(horizontal: 6), Switch(
width: 20, value: showAllDiagnosis,
height: 20, activeColor: Colors.red,
decoration: BoxDecoration( onChanged: (bool value) {
color: Colors.white, setState(() {
shape: BoxShape.circle, showAllDiagnosis = value;
border: Border.all(color: Colors.grey, width: 1), });
), },
child: Container(
decoration: BoxDecoration(
color: status == 1 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
), ),
), SizedBox(
), width: 8,
AppText( ),
TranslationBase.of(context).acute, AppText(
fontWeight: FontWeight.normal, TranslationBase.of(context).showAllDiagnosis,
fontFamily: 'Poppins', fontWeight: FontWeight.w500,
fontSize: SizeConfig.textMultiplier! * 1.6, color: Color(0xFF2E303A),
fontSize: 11,
),
],
), ),
SvgPicture.asset('assets/images/svgs/information.svg'),
], ],
), ),
)), Container(
Expanded( margin: EdgeInsets.only(bottom: 12),
child: InkWell( child: AppText(
onTap: () {}, TranslationBase.of(context).condition,
child: Row( fontWeight: FontWeight.bold,
children: [ fontFamily: 'Poppins',
Container( fontSize: 11,
padding: EdgeInsets.all(2.0), ),
margin: EdgeInsets.symmetric(horizontal: 6), ),
width: 20, SizedBox(
height: 20, width: MediaQuery.sizeOf(context).width,
decoration: BoxDecoration( height: 24,
color: Colors.white, child: ListView.builder(
shape: BoxShape.circle, shrinkWrap: true,
border: Border.all(color: Colors.grey, width: 1), 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),
), ),
child: Container( SizedBox(
decoration: BoxDecoration( height: 4,
color:
status == 2 ? HexColor("#D02127") : Colors.white,
shape: BoxShape.circle,
),
), ),
), model.diagnosisTypeList.isEmpty
AppText( ? EmptyDropDown()
TranslationBase.of(context).subAcute, : DropdownButtonHideUnderline(
fontWeight: FontWeight.normal, child: DropdownButton(
fontFamily: 'Poppins', dropdownColor: Colors.white,
fontSize: SizeConfig.textMultiplier! * 1.6, iconEnabledColor: Colors.black,
), icon: Icon(Icons.keyboard_arrow_down),
], isExpanded: true,
value: selectedDiagnosisItem == null
? model.diagnosisTypeList.keys.first
: selectedDiagnosisItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
if (newValue != null)
setState(() {
selectedDiagnosisItem = newValue;
selectedDiagnosisItemValue = model.diagnosisTypeList[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(),
),
),
],
),
), ),
), ),
), Container(
Expanded( margin: EdgeInsets.only(top: 8),
child: InkWell( child: AppTextFieldCustom(
onTap: () {}, hintText: TranslationBase.of(context).remarks,
controller: remarksController,
minLines: 2,
maxLines: 4,
inputType: TextInputType.multiline,
onChanged: (value) {},
onClick: () {},
onFieldSubmitted: () {},
),
),
SizedBox(
height: 16,
),
InkWell(
onTap: () async {
if (selectedDiagnosis != null) {
SearchDiagnosis? diagnosis =
await model.addToFavoriteDiagnosis(widget.patientInfo,
diagnosis: selectedDiagnosis);
setState(() {
selectedDiagnosis = diagnosis;
});
}
},
child: Row( child: Row(
children: [ children: [
Container( SvgPicture.asset(selectedDiagnosis?.isFavorite == true
padding: EdgeInsets.all(2.0), ? 'assets/images/svgs/favoriteadded.svg'
margin: EdgeInsets.symmetric(horizontal: 6), : 'assets/images/svgs/favorite.svg'),
width: 20, SizedBox(
height: 20, width: 4,
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( AppText(
TranslationBase.of(context).chronic, TranslationBase.of(context).addToFavorite,
fontWeight: FontWeight.normal, textAlign: TextAlign.start,
fontFamily: 'Poppins', fontWeight: FontWeight.w600,
fontSize: SizeConfig.textMultiplier! * 1.6, fontSize: 10,
color: Color(0xFF449BF1),
), ),
], ],
), ),
), )
), ],
], ),
), ),
SizedBox(height: 8,), ),
bottomNavigationBar: Container(
Material( decoration: BoxDecoration(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 1,
color: Color(0xFFEFEFEF),
)),
color: Colors.white, color: Colors.white,
child: Padding( borderRadius: BorderRadius.all(
padding: Radius.circular(0.0),
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(),
),
),
],
),
), ),
border: Border.all(color: HexColor('#707070'), width: 0),
), ),
Container( height: SizeConfig.heightMultiplier! *
margin: EdgeInsets.only(top: 8), (SizeConfig.isHeightVeryShort ? 12 : 10),
child: AppTextFieldCustom( width: double.infinity,
hintText: TranslationBase.of(context).remarks, child: Padding(
controller: remarksController, padding: const EdgeInsets.all(10),
minLines: 2, child: Column(
maxLines: 4, children: [
inputType: TextInputType.multiline, Center(
onChanged: (value) {}, child: Row(
onClick: () {}, children: [
onFieldSubmitted: () {}, Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300]!,
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 {
selectedDiagnosisItem ??= model.diagnosisTypeList.keys.first;
selectedDiagnosisItemValue = model.diagnosisTypeList[selectedDiagnosisItem];
if(selectedDiagnosis == null ){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).selectedDiagnosis);
return;
}
if(status.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).selectConditionFirst);
return;
}
if(remarksController.text.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).remarksCanNotBeEmpty);
return;
}
bool result = await model.createDiagnosis(
widget.patientInfo,
selectedDiagnosis,
selectedDiagnosisItemValue,
status,
remarksController.text,
false);
if (result) {
Navigator.pop(context, result);
}
},
),
),
],
),
)
],
), ),
), ),
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),
),
],
)
],
), ),
); );
} }

@ -0,0 +1,467 @@
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_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: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<String> patientState = ["", "Stable", "Not Stable", "Not Defined"];
class FavoriteDiagnosis extends StatefulWidget {
final PatiantInformtion patientInfo;
const FavoriteDiagnosis({super.key, required this.patientInfo});
@override
State<FavoriteDiagnosis> createState() => _FavoriteDiagnosisState();
}
class _FavoriteDiagnosisState extends State<FavoriteDiagnosis> {
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<SOAPViewModel>(
onModelReady: (model) {
this.model = model;
WidgetsBinding.instance.addPostFrameCallback((_) {
model.favoriteDiagnosis(widget.patientInfo);
});
},
builder: (_, model, w) => AppScaffold(
body: 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,
),
],
),
),
),
bottomNavigationBar: 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]!,
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 {},
),
),
],
),
)
],
),
),
),
));
}
}

@ -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/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/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'; 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:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../../../core/viewModel/SOAP_view_model.dart';
class PreviousDiagnosis extends StatelessWidget { class PreviousDiagnosis extends StatelessWidget {
final List<dynamic> diagnosisItems; final List<PatientPreviousDiagnosis> diagnosisItems;
final PatiantInformtion patientInfo;
const PreviousDiagnosis({super.key, required this.diagnosisItems}); const PreviousDiagnosis(
{super.key, required this.diagnosisItems, required this.patientInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -17,27 +27,68 @@ class PreviousDiagnosis extends StatelessWidget {
child: EmptyDiagnosis(), child: EmptyDiagnosis(),
); );
return Padding( return BaseView<SOAPViewModel>(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), onModelReady: (model) async {},
child: Column( builder: (_, model, w) {
mainAxisSize: MainAxisSize.max, if(model.showAudit){
children: [ WidgetsBinding.instance.addPostFrameCallback((_){
Flexible( showAuditBottomSheet(context,model.auditDiagnosislist,model.toggleShowBottomSheetValue);
child: ListView.separated( model.toggleShowBottomSheetValue(false);
itemBuilder: (_, index) { });
return PreviousDiagnosisItem( }
title: 'lorem ipsum',
status: 'active', return Padding(
condition: 'acute', padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
remarks: 'initial', child: Column(
onSoapDetailActionClicked: (action) {}, mainAxisSize: MainAxisSize.max,
); children: [
}, Flexible(
separatorBuilder: (_, index) => Divider(), child: ListView.separated(
itemCount: diagnosisItems.length), 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<AuditDiagnosis> 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));
}
} }

@ -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:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:hexcolor/hexcolor.dart';
typedef OnSoapDetailActionClicked = Function(SoapDetailItemActions); typedef OnSoapDetailActionClicked = Function(SoapDetailItemActions);
@ -29,35 +30,49 @@ class PreviousDiagnosisItem extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( // Stack(
children: [ // children: [
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText(
title,
color: Color(0XFF2B353E),
fontSize: 12,
fontWeight: FontWeight.bold,
),
Row( Row(
children: [ children: [
AppText( Expanded(
"${TranslationBase.of(context).condition}:", child: Column(
color: Color(0XFF2B353E), crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 10, children: [
fontWeight: FontWeight.w500, AppText(
), title,
SizedBox( color: Color(0XFF2B353E),
width: 4, fontSize: 12,
), fontWeight: FontWeight.bold,
AppText( ),
condition, SizedBox(height: 4,),
color: Color(0xffD02127), Row(
fontSize: 10, children: [
fontWeight: FontWeight.w500, 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( Visibility(
@ -77,10 +92,10 @@ class PreviousDiagnosisItem extends StatelessWidget {
)) ))
], ],
), ),
Align( // Align(
alignment: Alignment.topRight, child: Status(status: status)) // alignment: Alignment.topRight, child: Status(status: status))
], // ],
), // ),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
@ -103,13 +118,18 @@ class PreviousDiagnosisItem extends StatelessWidget {
), ),
SizedBox( SizedBox(
width: 187, width: 187,
child: AppButton( height: 27,
onPressed: () { child: Material(
onSoapDetailActionClicked( color: HexColor("#D02127"),
SoapDetailItemActions.CHANGE_STATUS); shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(5.0)) ,
}, child: InkWell(
title: TranslationBase.of(context).makeCurrentDiagnosis, onTap: () {
), onSoapDetailActionClicked(
SoapDetailItemActions.CHANGE_STATUS);
},
child:Center(child: AppText( TranslationBase.of(context).makeCurrentDiagnosis, color: Colors.white,)),
),
),
) )
], ],
) )

@ -1,83 +1,149 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/physical_exam/GeneralSpeciality.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/widget/examination_items.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/widget/examination_items.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../../core/viewModel/project_view_model.dart'; import '../../../../../core/viewModel/project_view_model.dart';
class AddDetailsToExaminationVidaPlus extends StatefulWidget { class AddDetailsToExaminationVidaPlus extends StatefulWidget {
final List<MySelectedExamination>? mySelectedExamination; final List<GeneralSpeciality>? mySelectedExamination;
final PatiantInformtion patientInfo;
const AddDetailsToExaminationVidaPlus({super.key, this.mySelectedExamination}); const AddDetailsToExaminationVidaPlus(
{super.key,
this.mySelectedExamination,
required this.patientInfo});
@override @override
State<AddDetailsToExaminationVidaPlus> createState() => State<AddDetailsToExaminationVidaPlus> createState() =>
_AddDetailsToExaminationVidaPlusState(); _AddDetailsToExaminationVidaPlusState();
} }
class _AddDetailsToExaminationVidaPlusState extends State<AddDetailsToExaminationVidaPlus> { class _AddDetailsToExaminationVidaPlusState
bool isSysExaminationExpand = false; extends State<AddDetailsToExaminationVidaPlus> {
String currentlyExpanded = '';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print('the widget is build'); print('the widget is build');
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async {}, onModelReady: (model) async {
WidgetsBinding.instance.addPostFrameCallback((_) async {
widget.mySelectedExamination?.forEach((value) =>
model.getSpecialityDetails(
value.name ?? '', value.id, widget.patientInfo));});
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, isShowAppBar: true,
isShowAppBar: true, isLoading: model.state == ViewState.BusyLocal,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: TranslationBase.of(context).examinationPart), title: TranslationBase.of(context).examinationPart),
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Padding( body: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: Column( child: Column(
children: [ children: [
Expanded( Expanded(
child: ListView.separated( child: ListView.separated(
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ExpandableSOAPWidget( var title =
headerTitle: model.specialityDetails.keys.elementAt(index);
projectViewModel.isArabic return ExpandableSOAPWidget(
? widget.mySelectedExamination![index].selectedExamination!.nameAr != null && widget.mySelectedExamination![index].selectedExamination!.nameAr != "" headerTitle: title,
? widget.mySelectedExamination![index].selectedExamination!.nameAr! onTap: () {
: widget.mySelectedExamination![index].selectedExamination!.nameEn! setState(() {
: widget.mySelectedExamination![index].selectedExamination!.nameEn!, if(currentlyExpanded == title) {
onTap: () { currentlyExpanded = '';
setState(() { }else currentlyExpanded = title;
isSysExaminationExpand = !isSysExaminationExpand; });
}); },
}, child: ExaminationItems(
child: ExaminationItems(examination:widget.mySelectedExamination![index]), examination: model.specialityDetails[title]),
isExpanded: isSysExaminationExpand, isExpanded: currentlyExpanded == title,
); );
},
}, separatorBuilder: (context, index) {
separatorBuilder: (context, index) { return SizedBox(
return SizedBox(height: 8,); height: 8,
}, );
itemCount: widget?.mySelectedExamination?.length ?? 0), },
), itemCount: model.specialityDetails.length ?? 0),
], ),
],
),
), ),
))); bottomNavigationBar: Material(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).cancelSmall,
color: Color(0xffEAEAEA),
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () async {
Navigator.pop(context);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).saveSmall,
color: Color(0xff359846),
fontColor: Colors.white,
fontWeight: FontWeight.w600,
onPressed: () async {
var listOfSelectedCategory = model.getListOfSelectedCategory();
if(listOfSelectedCategory.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectCategory);
return;
}
if(listOfSelectedCategory.any((value) => value.remarksController.text.isEmpty)){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).remarksCanNotBeEmpty);
return;
}
var result = await model.postPhysicalExamination(widget.patientInfo,listOfSelectedCategory);
if(result){
model.getPhysicalExamination(widget.patientInfo);
Navigator.popUntil(context, ((route) {
if (route.settings.name == UPDATE_EPISODE_VIDA_PLUS) {
return true;
} else {
return false;
}
}));
}
},
),
),
],
))),
));
} }
} }
/* Container( /* Container(
padding: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric(horizontal: 12),
child: Column( child: Column(
@ -230,4 +296,4 @@ class _AddDetailsToExaminationVidaPlusState extends State<AddDetailsToExaminatio
), ),
], ],
), ),
);*/ );*/

@ -1,25 +1,31 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciality.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/patient_physical_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/add_details_to_examination_vida_plus.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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'; import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'examinations_list_search_vida_plus_widget.dart'; import 'examinations_list_search_vida_plus_widget.dart';
class AddExaminationPageVidaPlus extends StatefulWidget { class AddExaminationPageVidaPlus extends StatefulWidget {
final List<MySelectedExamination>? mySelectedExamination; final PatiantInformtion patientInfo;
final Function(List<MySelectedExamination>) addSelectedExamination; final List<PatientPhysicalExamination>? examination;
final Function(MasterKeyModel) removeExamination;
AddExaminationPageVidaPlus( ///todo handle the data if edit is added
{this.mySelectedExamination, AddExaminationPageVidaPlus({required this.patientInfo, this.examination});
required this.addSelectedExamination,
required this.removeExamination});
@override @override
_AddExaminationPageVidaPlusState createState() => _AddExaminationPageVidaPlusState createState() =>
@ -28,38 +34,33 @@ class AddExaminationPageVidaPlus extends StatefulWidget {
class _AddExaminationPageVidaPlusState class _AddExaminationPageVidaPlusState
extends State<AddExaminationPageVidaPlus> { extends State<AddExaminationPageVidaPlus> {
List<MySelectedExamination> mySelectedExaminationLocal = []; List<GeneralSpeciality> mySelectedExaminationLocal = [];
@override @override
initState() { initState() {
super.initState(); super.initState();
mySelectedExaminationLocal = widget.mySelectedExamination!;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { WidgetsBinding.instance.addPostFrameCallback((_) async =>
WidgetsBinding.instance.addPostFrameCallback((_) async { await model.getGeneralSpeciality(widget.patientInfo)
await model.getMasterLookup( );
MasterKeysService.PhysicalExamination,
);
});
}
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
isLoading: model.state == ViewState.BusyLocal,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: TranslationBase.of(context).examinationPart), title: TranslationBase.of(context).examinationPart),
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Column( body: SingleChildScrollView(
mainAxisAlignment: MainAxisAlignment.start, child: Column(
mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start,
children: [ mainAxisSize: MainAxisSize.max,
Flexible( children: [
child: Padding( Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Material( child: Material(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -69,37 +70,35 @@ class _AddExaminationPageVidaPlusState
color: Color(0xFFEFEFEF), color: Color(0xFFEFEFEF),
)), )),
color: Colors.white, color: Colors.white,
child: Padding( child: ExaminationsListSearchVidaPlusWidget(
padding: const EdgeInsets.all(16.0), masterList: model.speciality,
child: SingleChildScrollView( removeExamination: (selectedExamination) {
child: Column( if(selectedExamination == null ) return;
mainAxisSize: MainAxisSize.max, setState(() {
children: [ mySelectedExaminationLocal
ExaminationsListSearchVidaPlusWidget( .remove(selectedExamination);
mySelectedExamination: widget.mySelectedExamination, // Find the object by its ID
masterList: model.physicalExaminationList, try {
isServiceSelected: (master) => model.changeCurrentCategorySelectedState(selectedExamination, false);
isServiceSelected(master), } catch (e) {}
removeExamination: (selectedExamination) { });
setState(() { },
mySelectedExaminationLocal addExamination: (selectedExamination) {
.remove(selectedExamination); if(selectedExamination == null ) return;
});
}, mySelectedExaminationLocal.insert(
addExamination: (selectedExamination) { 0, selectedExamination);
mySelectedExaminationLocal.insert(
0, selectedExamination); try {
//setState(() {}); model.changeCurrentCategorySelectedState(selectedExamination, true);
}, } catch (e) {}
), //setState(() {});
], },
),
),
), ),
), ),
), ),
), ],
], ),
), ),
bottomNavigationBar: Material( bottomNavigationBar: Material(
color: Colors.white, color: Colors.white,
@ -128,10 +127,11 @@ class _AddExaminationPageVidaPlusState
fontColor: Colors.white, fontColor: Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onPressed: () async { onPressed: () async {
Navigator.pop(context); if(mySelectedExaminationLocal.isEmpty){
widget.addSelectedExamination(mySelectedExaminationLocal); DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectCategory);
return;
}
pushAddExamination(mySelectedExaminationLocal);
}, },
), ),
), ),
@ -141,14 +141,16 @@ class _AddExaminationPageVidaPlusState
); );
} }
isServiceSelected(MasterKeyModel masterKey) { void pushAddExamination(
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where( List<GeneralSpeciality> mySelectedExaminationLocal) {
(element) => Navigator.push(
masterKey.id == element.selectedExamination!.id && context,
masterKey.typeId == element.selectedExamination!.typeId); FadePage(
if (exam.length > 0) { page: AddDetailsToExaminationVidaPlus(
return true; mySelectedExamination: mySelectedExaminationLocal,
} patientInfo: widget.patientInfo,
return false; ),
),
);
} }
} }

@ -1,6 +1,7 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciality.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -13,22 +14,16 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class AddExaminationVidaPlusWidget extends StatefulWidget { class AddExaminationVidaPlusWidget extends StatefulWidget {
MasterKeyModel? item; GeneralSpeciality? item;
final Function(MySelectedExamination) removeExamination; final Function(GeneralSpeciality?) removeExamination;
final Function(MySelectedExamination) addExamination; final Function(GeneralSpeciality?) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand;
final Function() expandClick; final List<GeneralSpeciality>? mySelectedExamination;
final List<MySelectedExamination>? mySelectedExamination;
AddExaminationVidaPlusWidget({ AddExaminationVidaPlusWidget({
this.item, this.item,
required this.removeExamination, required this.removeExamination,
required this.addExamination, required this.addExamination,
required this.isServiceSelected,
this.isExpand = false,
required this.expandClick,
this.mySelectedExamination, this.mySelectedExamination,
}); });
@ -43,17 +38,7 @@ class _AddExaminationVidaPlusWidgetState extends State<AddExaminationVidaPlusWid
@override @override
void initState() { void initState() {
if (getSelectedExam(widget.item!) != null) {
examination = getSelectedExam(widget.item!)!;
status = examination.isNormal
? 1
: examination.isAbnormal
? 2
: 3;
remarksController.text = examination.remark!;
} else {
examination.selectedExamination = widget.item;
}
super.initState(); super.initState();
} }
@ -71,18 +56,14 @@ class _AddExaminationVidaPlusWidgetState extends State<AddExaminationVidaPlusWid
child: Row( child: Row(
children: [ children: [
Checkbox( Checkbox(
value: widget.isServiceSelected(widget.item!), value:widget.item?.isSelected ?? false,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool? newValue) { onChanged: (bool? newValue) {
onExamTap(); onExamTap();
}), }),
Container( Container(
child: AppText( child: AppText(
projectViewModel.isArabic widget.item?.name ?? '',
? widget.item!.nameAr != null && widget.item!.nameAr != ""
? widget.item!.nameAr!
: widget.item!.nameEn!
: widget.item!.nameEn!,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8),
letterSpacing: -0.56, letterSpacing: -0.56,
@ -93,226 +74,17 @@ class _AddExaminationVidaPlusWidgetState extends State<AddExaminationVidaPlusWid
), ),
], ],
); );
// return Container(
// child: HeaderBodyExpandableNotifier(
// headerWidget: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// InkWell(
// onTap: () {
// onExamTap();
// },
// child: Row(
// children: [
// Checkbox(
// value: widget.isServiceSelected(widget.item!),
// activeColor: Colors.red[800],
// onChanged: (bool? newValue) {
// onExamTap();
// }),
// Container(
// child: AppText(
// projectViewModel.isArabic
// ? widget.item!.nameAr != null && widget.item!.nameAr != ""
// ? widget.item!.nameAr!
// : widget.item!.nameEn!
// : widget.item!.nameEn!,
// color: Color(0xFF575757),
// fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8),
// letterSpacing: -0.56,
// ),
// ),
// ],
// ),
// ),
// Container(
// margin: EdgeInsets.symmetric(horizontal: 8),
// child: InkWell(
// onTap: widget.expandClick,
// child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down),
// ),
// ),
// ],
// ),
// bodyWidget: Container(
// padding: EdgeInsets.symmetric(horizontal: 12),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// margin: EdgeInsets.only(bottom: 8),
// child: AppText(
// TranslationBase.of(context).status,
// fontWeight: FontWeight.bold,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ),
// Row(
// children: [
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// status = 1;
// });
// examination.isNormal = true;
// examination.isAbnormal = false;
// examination.notExamined = false;
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin: EdgeInsets.symmetric(horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: status == 1 ? HexColor("#D02127") : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// AppText(
// TranslationBase.of(context).normal,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ],
// ),
// )),
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// status = 2;
// });
// examination.isNormal = false;
// examination.isAbnormal = true;
// examination.notExamined = false;
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin: EdgeInsets.symmetric(horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: status == 2 ? HexColor("#D02127") : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// AppText(
// TranslationBase.of(context).abnormal,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ],
// ),
// )),
// if (!examination.isLocal)
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// status = 3;
// });
// examination.isNormal = false;
// examination.isAbnormal = false;
// examination.notExamined = true;
// },
// 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,
// ),
// ),
// ),
// Expanded(
// child: AppText(
// TranslationBase.of(context).notExamined,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ),
// ],
// ),
// )),
// ],
// ),
// Container(
// margin: EdgeInsets.only(top: 8),
// child: AppTextFieldCustom(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 2,
// maxLines: 4,
// inputType: TextInputType.multiline,
// onChanged: (value) {
// examination.remark = value;
// },
// onClick: () {},
// onFieldSubmitted: () {},
// ),
// ),
// ],
// ),
// ),
// isExpand: widget.isExpand,
// ),
// );
} }
onExamTap() { onExamTap() {
setState(() { if(widget.item != null ){
if (widget.isServiceSelected(widget.item!)) { if(widget.item?.isSelected == true){
if (examination.isLocal) widget.removeExamination(examination); widget.removeExamination(widget.item);
widget.expandClick(); }else{
} else { widget.addExamination(widget.item);
examination.isNormal = status == 1;
examination.isAbnormal = status == 2;
examination.notExamined = status == 3;
examination.remark = remarksController.text;
widget.addExamination(examination);
widget.expandClick();
}
});
}
MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) { }
Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) {
return exam.first;
} }
return null;
} }
} }

@ -1,5 +1,9 @@
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/GeneralSpeciality.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/patient_physical_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/add_examination_vida_plus_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/add_examination_vida_plus_widget.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
@ -7,114 +11,113 @@ import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dar
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExaminationsListSearchVidaPlusWidget extends StatefulWidget { class ExaminationsListSearchVidaPlusWidget extends StatefulWidget {
final Function(MySelectedExamination) removeExamination; final Function(GeneralSpeciality?) removeExamination;
final Function(MySelectedExamination) addExamination; final Function(GeneralSpeciality?) addExamination;
final bool Function(MasterKeyModel) isServiceSelected; final List<GeneralSpeciality>? masterList;
final List<MasterKeyModel>? masterList;
final List<MySelectedExamination>? mySelectedExamination;
ExaminationsListSearchVidaPlusWidget({required this.removeExamination, required this.addExamination, required this.isServiceSelected, this.masterList, this.mySelectedExamination}); ExaminationsListSearchVidaPlusWidget(
{required this.removeExamination,
required this.addExamination,
this.masterList});
@override @override
_ExaminationsListSearchVidaPlusWidgetState createState() => _ExaminationsListSearchVidaPlusWidgetState(); _ExaminationsListSearchVidaPlusWidgetState createState() =>
_ExaminationsListSearchVidaPlusWidgetState();
} }
class _ExaminationsListSearchVidaPlusWidgetState extends State<ExaminationsListSearchVidaPlusWidget> { class _ExaminationsListSearchVidaPlusWidgetState
extends State<ExaminationsListSearchVidaPlusWidget> {
int expandedIndex = -1; int expandedIndex = -1;
List<MasterKeyModel>? items = []; List<GeneralSpeciality>? items = [];
TextEditingController filteredSearchController = TextEditingController(); TextEditingController filteredSearchController = TextEditingController();
@override @override
void initState() { void initState() {
items!.addAll(widget.masterList!);
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return BaseView<SOAPViewModel>(
children: [
Material( builder: (_, model, w) => Padding(
shape: RoundedRectangleBorder( padding: const EdgeInsets.all(16.0),
borderRadius: BorderRadius.circular(10), child: Column(
side: BorderSide( children: [
width: 1, Material(
color: Color(0xFFEFEFEF), shape: RoundedRectangleBorder(
)), borderRadius: BorderRadius.circular(10),
color: Colors.white,child: Padding( side: BorderSide(
padding: const EdgeInsets.all(8.0), width: 1,
child: AppTextFieldCustom( color: Color(0xFFEFEFEF),
height: Utils.getTextFieldHeight(), )),
hintText: TranslationBase.of(context).searchExamination, color: Colors.white,
isTextFieldHasSuffix: false, child: Padding(
hasBorder: false, padding: const EdgeInsets.all(8.0),
controller: filteredSearchController, child: AppTextFieldCustom(
onChanged: (value) { height: Utils.getTextFieldHeight(),
if (value != null) filterSearchResults(value); hintText: TranslationBase.of(context).searchExamination,
}, isTextFieldHasSuffix: false,
suffixWidget: InkWell( hasBorder: false,
child: Icon( controller: filteredSearchController,
Icons.search, onChanged: (value) {
color: Colors.black, if (value != null) filterSearchResults(model,value);
},
suffixWidget: InkWell(
child: Icon(
Icons.search,
color: Colors.black,
),
onTap: () {},
), ),
onTap: () {}, onClick: () {},
onFieldSubmitted: () {},
), ),
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
),
...items!.mapIndexed((index, item) {
return Column( ...model.speciality.mapIndexed((index, item) {
children: [ return Column(
AddExaminationVidaPlusWidget( children: [
item: item, AddExaminationVidaPlusWidget(
addExamination: widget.addExamination, item: item,
removeExamination: widget.removeExamination, addExamination: widget.addExamination,
mySelectedExamination: widget.mySelectedExamination, removeExamination: widget.removeExamination,
isServiceSelected: widget.isServiceSelected, ),
isExpand: index == expandedIndex, SizedBox(height: 8,),
expandClick: () { Divider()
setState(() { ],
if (expandedIndex == index) { );
expandedIndex = -1; }).toList(),
} else { ],
expandedIndex = index; ),
} ));
});
},
),
Divider()
],
);
}).toList(),
],
);
} }
void filterSearchResults(String query) { void filterSearchResults(SOAPViewModel model,String query) {
List<MasterKeyModel> dummySearchList = []; model.filterData(query);
dummySearchList.addAll(widget.masterList as Iterable<MasterKeyModel>); // List<MasterKeyModel> dummySearchList = [];
if (query.isNotEmpty) { // dummySearchList.addAll(widget.masterList as Iterable<MasterKeyModel>);
List<MasterKeyModel> dummyListData = []; // if (query.isNotEmpty) {
dummySearchList.forEach((item) { // List<MasterKeyModel> dummyListData = [];
if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || item.nameEn!.toLowerCase().contains(query.toLowerCase())) { // dummySearchList.forEach((item) {
dummyListData.add(item); // if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
} // dummyListData.add(item);
}); // }
setState(() { // });
items!.clear(); // setState(() {
items!.addAll(dummyListData); // items!.clear();
}); // items!.addAll(dummyListData);
return; // });
} else { // return;
setState(() { // } else {
items!.clear(); // setState(() {
items!.addAll(widget.masterList as Iterable<MasterKeyModel>); // items!.clear();
}); // items!.addAll(widget.masterList as Iterable<MasterKeyModel>);
} // });
// }
} }
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/patient_physical_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart';
@ -8,7 +9,7 @@ import 'package:provider/provider.dart';
import '../../../../../utils/translations_delegate_base_utils.dart'; import '../../../../../utils/translations_delegate_base_utils.dart';
class ListOfExamination extends StatelessWidget { class ListOfExamination extends StatelessWidget {
final List<MySelectedExamination> listOfSelection; final List<PatientPhysicalExamination> listOfSelection;
const ListOfExamination({super.key, required this.listOfSelection}); const ListOfExamination({super.key, required this.listOfSelection});
@ -20,25 +21,8 @@ class ListOfExamination extends StatelessWidget {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (_, index) => SoapDetailItem( itemBuilder: (_, index) => SoapDetailItem(
title: projectViewModel.isArabic title: "${listOfSelection[index].specialityDescription}>${listOfSelection[index].physicalExaminationDescription}",
? listOfSelection[index] condition: getCondition(listOfSelection[index].physicalExaminationCondition ?? 3, context)??TranslationBase.of(context).notExamined,
.selectedExamination!
.nameAr !=
null &&
listOfSelection[index]
.selectedExamination!
.nameAr !=
""
? listOfSelection[index]
.selectedExamination!
.nameAr!
: listOfSelection[index]
.selectedExamination!
.nameEn!
: listOfSelection[index]
.selectedExamination!
.nameEn!,
condition: getCondition(listOfSelection[index], context)??TranslationBase.of(context).notExamined,
remarks: listOfSelection[index].remark??'', remarks: listOfSelection[index].remark??'',
onSoapDetailActionClicked: (action) { onSoapDetailActionClicked: (action) {
///todo handle the event as per the actiion ///todo handle the event as per the actiion
@ -51,9 +35,9 @@ class ListOfExamination extends StatelessWidget {
); );
} }
String? getCondition(MySelectedExamination examination, BuildContext context) => examination.isNormal String? getCondition(int condition, BuildContext context) => condition ==0
? TranslationBase.of(context).normal ? TranslationBase.of(context).normal
: examination.isAbnormal : condition == 1
? TranslationBase.of(context).abnormal ? TranslationBase.of(context).abnormal
: TranslationBase.of(context).notExamined; : TranslationBase.of(context).notExamined;
} }

@ -4,6 +4,7 @@ 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/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.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/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/physical_exam/post_physical_exam_request_model.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/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
@ -51,7 +52,7 @@ class UpdateObjectivePageVidaPlus extends StatefulWidget {
class _UpdateObjectivePageVidaPlusState class _UpdateObjectivePageVidaPlusState
extends State<UpdateObjectivePageVidaPlus> implements ObjectiveCallBack { extends State<UpdateObjectivePageVidaPlus> implements ObjectiveCallBack {
bool isSysExaminationExpand = false; bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = []; List<PatientPhysicalExamination> mySelectedExamination = [];
BoxDecoration containerBorderDecoration( BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) { Color containerColor, Color borderColor) {
@ -68,43 +69,19 @@ class _UpdateObjectivePageVidaPlusState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
model.setObjectiveCallBack(this); widget.changeLoadingState(true);
mySelectedExamination.clear();
model.isAddExamInProgress = true; model.getPhysicalExamination(widget.patientInfo);
await model.getPatientPhysicalExam(widget.patientInfo);
if (model.patientPhysicalExamList.isNotEmpty) { widget.changeLoadingState(false);
if (model.physicalExaminationList.length == 0) { });
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
}
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);});
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
isLoading: model.state == ViewState.BusyLocal,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
@ -131,29 +108,31 @@ class _UpdateObjectivePageVidaPlusState
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox(height: 10,), SizedBox(
height: 10,
),
AddSoapItem( AddSoapItem(
title: title:
TranslationBase.of(context).physicalExamination, TranslationBase.of(context).physicalExamination,
onAddSoapItemClicked: () { onAddSoapItemClicked: () {
openExaminationList(context); openExaminationList(context);
}), }),
SizedBox(height: 16,), SizedBox(
height: 16,
if (mySelectedExamination.isEmpty) ...{ ),
Center( if (model.patientPhysicalExaminationList.isEmpty) ...{
Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(65), padding: const EdgeInsets.all(65),
child: EmptyWidget(TranslationBase.of(context).noPhysicalExamination), child: EmptyWidget(TranslationBase.of(context)
.noPhysicalExamination),
), ),
), ),
} else ...{ } else ...{
Divider(), Divider(),
ListOfExamination( ListOfExamination(
listOfSelection: mySelectedExamination listOfSelection: model.patientPhysicalExaminationList)
)
} }
// if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal) // if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal)
@ -213,177 +192,143 @@ class _UpdateObjectivePageVidaPlusState
); );
} }
submitUpdateObjectivePage(SOAPViewModel model) async { // submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) { // if (mySelectedExamination.isNotEmpty) {
if (!model.isAddExamInProgress && // if (!model.isAddExamInProgress &&
widget.patientInfo.admissionNo != null && // widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) { // widget.patientInfo.admissionNo!.isNotEmpty) {
Navigator.of(context).pop(); // Navigator.of(context).pop();
} else { // } else {
widget.changeLoadingState(true); // widget.changeLoadingState(true);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); // Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
//
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
// PostPhysicalExamRequestModel postPhysicalExamRequestModel =
// new PostPhysicalExamRequestModel();
// mySelectedExamination.forEach((exam) {
// if (postPhysicalExamRequestModel
// .listHisProgNotePhysicalExaminationVM ==
// null)
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
// [];
// ListHisProgNotePhysicalExaminationVM
// listHisProgNotePhysicalExaminationVM =
// ListHisProgNotePhysicalExaminationVM(
// patientMRN: widget.patientInfo.patientMRN,
// episodeId: widget.patientInfo.episodeNo == null
// ? 0
// : widget.patientInfo.episodeNo,
// appointmentNo: widget.patientInfo.appointmentNo == null
// ? 0
// : widget.patientInfo.appointmentNo,
// remarks: exam.remark ?? '',
// createdBy: exam.createdBy ?? doctorProfile.doctorID,
// createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
// editedBy: doctorProfile.doctorID,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination!.id,
// examType: exam.selectedExamination!.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// notExamined: exam.notExamined,
// examinationType: exam.isNormal
// ? 1
// : exam.isAbnormal
// ? 2
// : 3,
// examinationTypeName: exam.isNormal
// ? "Normal"
// : exam.isAbnormal
// ? 'AbNormal'
// : "Not Examined",
// isNew: exam.isNew,
// );
// if (widget.patientInfo.admissionNo != null &&
// widget.patientInfo.admissionNo!.isNotEmpty) {
// listHisProgNotePhysicalExaminationVM.admissionNo =
// int.parse(widget.patientInfo.admissionNo!);
// } else {
// listHisProgNotePhysicalExaminationVM.admissionNo = 0;
// }
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!
// .add(listHisProgNotePhysicalExaminationVM);
// });
//
// if (model.patientPhysicalExamList.isEmpty) {
// await model.postPhysicalExam(postPhysicalExamRequestModel);
// } else {
// await model.patchPhysicalExam(postPhysicalExamRequestModel);
// }
//
// if (model.state == ViewState.ErrorLocal) {
// widget.changeLoadingState(false);
// Utils.showErrorToast(model.error);
// if (widget.patientInfo.admissionNo != null &&
// widget.patientInfo.admissionNo!.isNotEmpty) {
// // Navigator.of(context).pop();
// model.isAddExamInProgress = false;
// }
// } else {
// if (widget.patientInfo.admissionNo != null &&
// widget.patientInfo.admissionNo!.isNotEmpty) {
// // Navigator.of(context).pop();
// widget.changeLoadingState(false);
// model.isAddExamInProgress = false;
// } else {
// widget.changeLoadingState(true);
// widget.changePageViewIndex(2);
// }
// }
// }
// } else {
// Utils.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
// }
// }
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); // removeExamination(MasterKeyModel masterKey) {
PostPhysicalExamRequestModel postPhysicalExamRequestModel = // Iterable<MySelectedExamination> history = mySelectedExamination.where(
new PostPhysicalExamRequestModel(); // (element) =>
mySelectedExamination.forEach((exam) { // masterKey.id == element.selectedExamination!.id &&
if (postPhysicalExamRequestModel // masterKey.typeId == element.selectedExamination!.typeId);
.listHisProgNotePhysicalExaminationVM == //
null) // if (history.length > 0) {
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = // setState(() {
[]; // if (history.first.isLocal) {
ListHisProgNotePhysicalExaminationVM // mySelectedExamination.remove(history.first);
listHisProgNotePhysicalExaminationVM = // } else {
ListHisProgNotePhysicalExaminationVM( // history.first.notExamined = true;
patientMRN: widget.patientInfo.patientMRN, // history.first.isNormal = false;
episodeId: widget.patientInfo.episodeNo == null // history.first.isAbnormal = false;
? 0 // }
: widget.patientInfo.episodeNo, // });
appointmentNo: widget.patientInfo.appointmentNo == null // }
? 0 // }
: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination!.id,
examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew,
);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo!);
} else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0;
}
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!
.add(listHisProgNotePhysicalExaminationVM);
});
if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
Utils.showErrorToast(model.error);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop();
model.isAddExamInProgress = false;
}
} else {
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop();
widget.changeLoadingState(false);
model.isAddExamInProgress = false;
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
}
}
} else {
Utils.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
}
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination!.id &&
masterKey.typeId == element.selectedExamination!.typeId);
if (history.length > 0) {
setState(() {
if (history.first.isLocal) {
mySelectedExamination.remove(history.first);
} else {
history.first.notExamined = true;
history.first.isNormal = false;
history.first.isAbnormal = false;
}
});
}
}
openExaminationList(BuildContext context) { openExaminationList(BuildContext context) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: AddExaminationPageVidaPlus( page: AddExaminationPageVidaPlus(
mySelectedExamination: mySelectedExamination, patientInfo: widget.patientInfo,
addSelectedExamination: ),
(List<MySelectedExamination> mySelectedExaminationLocal) {
pushAddExamination(mySelectedExaminationLocal);
// mySelectedExaminationLocal.forEach((element) {
// if (mySelectedExamination.singleWhere(
// (it) =>
// it.selectedExamination!.id ==
// element.selectedExamination!.id,
// orElse: () => MySelectedExamination()) ==
// MySelectedExamination()) {
// mySelectedExamination.insert(0, element);
// }
// });
/// remove items.
// List<MySelectedExamination> removedList = [];
// mySelectedExamination.forEach((element) {
// if (mySelectedExaminationLocal.singleWhere(
// (it) =>
// it.selectedExamination!.id ==
// element.selectedExamination!.id,
// orElse: () => MySelectedExamination()) ==
// MySelectedExamination()) {
// removedList.add(element);
// }
// });
// removedList.forEach((element) {
// removeExamination(element.selectedExamination!);
// });
// Navigator.of(context).pop();
// setState(() {});
},
removeExamination: (masterKey) => removeExamination(masterKey)),
), ),
); );
} }
@override @override
nextFunction(model) async { nextFunction(model) async {
await submitUpdateObjectivePage(model); // await submitUpdateObjectivePage(model);
} }
void pushAddExamination(List<MySelectedExamination> mySelectedExaminationLocal) { // void pushAddExamination(
Navigator.push( // List<MySelectedExamination> mySelectedExaminationLocal) {
context, // Navigator.push(
FadePage( // context,
page: AddDetailsToExaminationVidaPlus( // FadePage(
mySelectedExamination: mySelectedExamination,), // page: AddDetailsToExaminationVidaPlus(
), // mySelectedExamination: mySelectedExamination,
); // ),
} // ),
// );
// }
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/Category.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -10,7 +11,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ExaminationItems extends StatefulWidget { class ExaminationItems extends StatefulWidget {
final MySelectedExamination? examination; final List<Category>? examination;
const ExaminationItems({super.key, this.examination}); const ExaminationItems({super.key, this.examination});
@ -21,142 +22,113 @@ class ExaminationItems extends StatefulWidget {
class _ExaminationItemsState extends State<ExaminationItems> { class _ExaminationItemsState extends State<ExaminationItems> {
bool isExpanded = false; bool isExpanded = false;
int status = 1; List<Category>? examinations;
TextEditingController remarksController = TextEditingController();
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
remarksController.text = widget.examination?.remark ?? ""; this.examinations = widget.examination;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Column( return SingleChildScrollView(
children: [ child: Column(
ListTileTheme( children: examinations?.map((value)=> Column(
horizontalTitleGap: 0, children: [
child: CheckboxListTile( ListTileTheme(
activeColor: Color(0xFFD02127), horizontalTitleGap: 0,
checkColor: Colors.white, child: CheckboxListTile(
contentPadding: EdgeInsets.zero, activeColor: Color(0xFFD02127),
side: MaterialStateBorderSide.resolveWith( checkColor: Colors.white,
(Set<MaterialState> states) { contentPadding: EdgeInsets.zero,
if (states.contains(MaterialState.selected)) { side: MaterialStateBorderSide.resolveWith(
return const BorderSide(color: Color(0xFFD02127)); (Set<MaterialState> states) {
} if (states.contains(MaterialState.selected)) {
return const BorderSide(color: Color(0xFFE6E6E6)); return const BorderSide(color: Color(0xFFD02127));
}, }
), return const BorderSide(color: Color(0xFFE6E6E6));
shape: },
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), ),
value: isExpanded, shape: RoundedRectangleBorder(
controlAffinity: ListTileControlAffinity.leading, borderRadius: BorderRadius.circular(16)),
onChanged: (bool? value) { value: value.isSelected,
setState(() { controlAffinity: ListTileControlAffinity.leading,
isExpanded = value ?? false; onChanged: (bool? selected) {
}); setState(() {
}, value?.isSelected = selected ?? false;
title: AppText( });
projectViewModel.isArabic },
? widget.examination!.selectedExamination!.nameAr != null && title: AppText(
widget.examination!.selectedExamination!.nameAr != "" value.name!,
? widget.examination!.selectedExamination!.nameAr! color: Color(0XFF575757),
: widget.examination!.selectedExamination!.nameEn! fontSize: 14,
: widget.examination!.selectedExamination!.nameEn!, fontWeight: FontWeight.w400,
color: Color(0XFF575757), ),
fontSize: 14, ),
fontWeight: FontWeight.w400,
), ),
), (value.isSelected == true)
), ? Container(
(isExpanded) padding: EdgeInsets.symmetric(horizontal: 12),
? Container( child: Column(
padding: EdgeInsets.symmetric(horizontal: 12), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Container(
children: [ margin: EdgeInsets.only(bottom: 8),
Container( child: AppText(
margin: EdgeInsets.only(bottom: 8), TranslationBase.of(context).condition,
child: AppText( fontWeight: FontWeight.bold,
TranslationBase.of(context).condition, fontFamily: 'Poppins',
fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier! * 1.6,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
), ),
Row( ),
children: [ SizedBox(
Expanded( width: MediaQuery.sizeOf(context).width,
child: InkWell( height: 24,
onTap: () { child: ListView.builder(
setState(() { shrinkWrap: true,
status = 1; scrollDirection: Axis.horizontal,
}); itemCount: value
widget.examination!.isNormal = true; .conditionsList
widget.examination!.isAbnormal = false; ?.length ??
widget.examination!.notExamined = false; 0,
}, itemBuilder: (context, currentIndex) => InkWell(
child: Row(
children: [
Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border:
Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 1
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).normal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6,
),
],
),
)),
Expanded(
child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
status = 2; value
.selectedCondition =
int.parse(value
.conditionsList?[
currentIndex]
.conditionName ??
"-1");
}); });
widget.examination!.isNormal = false;
widget.examination!.isAbnormal = true;
widget.examination!.notExamined = false;
}, },
child: Row( child: Row(
children: [ children: [
Container( Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6), margin: EdgeInsets.symmetric(
horizontal: 6),
width: 20, width: 20,
height: 20, height: 20,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.circle, shape: BoxShape.circle,
border: border: Border.all(
Border.all(color: Colors.grey, width: 1), color: Colors.grey, width: 1),
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: status == 2 color: value
.selectedCondition ==
int.parse(value
.conditionsList?[
currentIndex]
.conditionName ??
"-1")
? HexColor("#D02127") ? HexColor("#D02127")
: Colors.white, : Colors.white,
shape: BoxShape.circle, shape: BoxShape.circle,
@ -164,84 +136,515 @@ class _ExaminationItemsState extends State<ExaminationItems> {
), ),
), ),
AppText( AppText(
TranslationBase.of(context).abnormal, value
.conditionsList?[
currentIndex]
.conditionCode ??
'',
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.6, fontSize:
SizeConfig.textMultiplier! *
1.6,
), ),
], ],
), ),
)), )),
if (widget.examination?.isLocal == false) ),
Expanded( // Row(
child: InkWell( // children: [
onTap: () { // if(examinations?[index]
setState(() { // .conditionsList?.length == 1)
status = 3; // Expanded(
}); // child: InkWell(
widget.examination!.isNormal = false; // onTap: () {
widget.examination!.isAbnormal = false; // setState(() {
widget.examination!.notExamined = true; // examinations?[index].selectedCondition =
}, // int.parse(examinations?[index]
child: Row( // .conditionsList?[0]
children: [ // .conditionName ??
Container( // "-1");
padding: EdgeInsets.all(2.0), // });
margin: EdgeInsets.symmetric(horizontal: 6), // },
width: 20, // child: Row(
height: 20, // children: [
decoration: BoxDecoration( // Container(
color: Colors.white, // padding: EdgeInsets.all(2.0),
shape: BoxShape.circle, // margin:
border: Border.all( // EdgeInsets.symmetric(horizontal: 6),
color: Colors.grey, width: 1), // width: 20,
), // height: 20,
child: Container( // decoration: BoxDecoration(
decoration: BoxDecoration( // color: Colors.white,
color: status == 3 // shape: BoxShape.circle,
? HexColor("#D02127") // border: Border.all(
: Colors.white, // color: Colors.grey, width: 1),
shape: BoxShape.circle, // ),
), // child: Container(
), // decoration: BoxDecoration(
), // color: examinations?[index].selectedCondition ==
Expanded( // int.parse(examinations?[index]
child: AppText( // .conditionsList?[0]
TranslationBase.of(context).notExamined, // .conditionName ??
fontWeight: FontWeight.normal, // "-1")
fontFamily: 'Poppins', // ? HexColor("#D02127")
fontSize: SizeConfig.textMultiplier! * 1.6, // : Colors.white,
), // shape: BoxShape.circle,
), // ),
], // ),
), // ),
)), // AppText(
], // examinations?[index]
// .conditionsList?[0]
// .conditionCode ??
// TranslationBase.of(context).normal,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize:
// SizeConfig.textMultiplier! * 1.6,
// ),
// ],
// ),
// )),
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// setState(() {
// examinations?[index].selectedCondition =
// int.parse(examinations?[index]
// .conditionsList?[1]
// .conditionName ??
// "-1");
// });
// });
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin:
// EdgeInsets.symmetric(horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(
// color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: examinations?[index].selectedCondition ==
// int.parse(examinations?[index]
// .conditionsList?[1]
// .conditionName ??
// "-1")
// ? HexColor("#D02127")
// : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// AppText(
// examinations?[index]
// .conditionsList?[1]
// .conditionCode ??
// TranslationBase.of(context).abnormal,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize:
// SizeConfig.textMultiplier! * 1.6,
// ),
// ],
// ),
// )),
// Expanded(
// child: InkWell(
// onTap: () {
// setState(() {
// setState(() {
// examinations?[index].selectedCondition =
// int.parse(examinations?[index]
// .conditionsList?[2]
// .conditionName ??
// "-1");
// });
// });
//
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin:
// EdgeInsets.symmetric(horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(
// color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: examinations?[index].selectedCondition ==
// int.parse(examinations?[index]
// .conditionsList?[2]
// .conditionName ??
// "-1")
// ? HexColor("#D02127")
// : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// Expanded(
// child: AppText(
// examinations?[index]
// .conditionsList?[2]
// .conditionCode ??
// TranslationBase.of(context).notExamined,
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize:
// SizeConfig.textMultiplier! * 1.6,
// ),
// ),
// ],
// ),
// )),
// ],
// ),
Container(
margin: EdgeInsets.only(top: 8),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
controller: value.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, : SizedBox.shrink(),
minLines: 2, ],
maxLines: 4, ),)?.toList() ?? []
inputType: TextInputType.multiline, // Expanded(
onChanged: (value) { // child: ListView.builder(
widget.examination!.remark = value; // shrinkWrap: true,
}, // itemCount: examinations?.length ?? 0,
onClick: () {}, // itemBuilder: (context, index) => Column(
onFieldSubmitted: () {}, // children: [
), // ListTileTheme(
), // horizontalTitleGap: 0,
], // child: CheckboxListTile(
), // activeColor: Color(0xFFD02127),
) // checkColor: Colors.white,
: SizedBox.shrink(), // contentPadding: EdgeInsets.zero,
SizedBox( // side: MaterialStateBorderSide.resolveWith(
height: 8, // (Set<MaterialState> states) {
), // if (states.contains(MaterialState.selected)) {
Divider() // return const BorderSide(color: Color(0xFFD02127));
], // }
// return const BorderSide(color: Color(0xFFE6E6E6));
// },
// ),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(16)),
// value: examinations?[index].isSelected,
// controlAffinity: ListTileControlAffinity.leading,
// onChanged: (bool? value) {
// setState(() {
// examinations?[index].isSelected = value ?? false;
// });
// },
// title: AppText(
// examinations![index].name!,
// color: Color(0XFF575757),
// fontSize: 14,
// fontWeight: FontWeight.w400,
// ),
// ),
// ),
// (examinations?[index].isSelected == true)
// ? Container(
// padding: EdgeInsets.symmetric(horizontal: 12),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// margin: EdgeInsets.only(bottom: 8),
// child: AppText(
// TranslationBase.of(context).condition,
// fontWeight: FontWeight.bold,
// fontFamily: 'Poppins',
// fontSize: SizeConfig.textMultiplier! * 1.6,
// ),
// ),
// SizedBox(
// width: MediaQuery.sizeOf(context).width,
// height: 24,
// child: ListView.builder(
// shrinkWrap: true,
// scrollDirection: Axis.horizontal,
// itemCount: examinations?[index]
// .conditionsList
// ?.length ??
// 0,
// itemBuilder: (context, currentIndex) => InkWell(
// onTap: () {
// setState(() {
// examinations?[index]
// .selectedCondition =
// int.parse(examinations?[index]
// .conditionsList?[
// currentIndex]
// .conditionName ??
// "-1");
// });
// },
// child: Row(
// children: [
// Container(
// padding: EdgeInsets.all(2.0),
// margin: EdgeInsets.symmetric(
// horizontal: 6),
// width: 20,
// height: 20,
// decoration: BoxDecoration(
// color: Colors.white,
// shape: BoxShape.circle,
// border: Border.all(
// color: Colors.grey, width: 1),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: examinations?[index]
// .selectedCondition ==
// int.parse(examinations?[
// index]
// .conditionsList?[
// currentIndex]
// .conditionName ??
// "-1")
// ? HexColor("#D02127")
// : Colors.white,
// shape: BoxShape.circle,
// ),
// ),
// ),
// AppText(
// examinations?[index]
// .conditionsList?[
// currentIndex]
// .conditionCode ??
// '',
// fontWeight: FontWeight.normal,
// fontFamily: 'Poppins',
// fontSize:
// SizeConfig.textMultiplier! *
// 1.6,
// ),
// ],
// ),
// )),
// ),
// // Row(
// // children: [
// // if(examinations?[index]
// // .conditionsList?.length == 1)
// // Expanded(
// // child: InkWell(
// // onTap: () {
// // setState(() {
// // examinations?[index].selectedCondition =
// // int.parse(examinations?[index]
// // .conditionsList?[0]
// // .conditionName ??
// // "-1");
// // });
// // },
// // child: Row(
// // children: [
// // Container(
// // padding: EdgeInsets.all(2.0),
// // margin:
// // EdgeInsets.symmetric(horizontal: 6),
// // width: 20,
// // height: 20,
// // decoration: BoxDecoration(
// // color: Colors.white,
// // shape: BoxShape.circle,
// // border: Border.all(
// // color: Colors.grey, width: 1),
// // ),
// // child: Container(
// // decoration: BoxDecoration(
// // color: examinations?[index].selectedCondition ==
// // int.parse(examinations?[index]
// // .conditionsList?[0]
// // .conditionName ??
// // "-1")
// // ? HexColor("#D02127")
// // : Colors.white,
// // shape: BoxShape.circle,
// // ),
// // ),
// // ),
// // AppText(
// // examinations?[index]
// // .conditionsList?[0]
// // .conditionCode ??
// // TranslationBase.of(context).normal,
// // fontWeight: FontWeight.normal,
// // fontFamily: 'Poppins',
// // fontSize:
// // SizeConfig.textMultiplier! * 1.6,
// // ),
// // ],
// // ),
// // )),
// // Expanded(
// // child: InkWell(
// // onTap: () {
// // setState(() {
// // setState(() {
// // examinations?[index].selectedCondition =
// // int.parse(examinations?[index]
// // .conditionsList?[1]
// // .conditionName ??
// // "-1");
// // });
// // });
// // },
// // child: Row(
// // children: [
// // Container(
// // padding: EdgeInsets.all(2.0),
// // margin:
// // EdgeInsets.symmetric(horizontal: 6),
// // width: 20,
// // height: 20,
// // decoration: BoxDecoration(
// // color: Colors.white,
// // shape: BoxShape.circle,
// // border: Border.all(
// // color: Colors.grey, width: 1),
// // ),
// // child: Container(
// // decoration: BoxDecoration(
// // color: examinations?[index].selectedCondition ==
// // int.parse(examinations?[index]
// // .conditionsList?[1]
// // .conditionName ??
// // "-1")
// // ? HexColor("#D02127")
// // : Colors.white,
// // shape: BoxShape.circle,
// // ),
// // ),
// // ),
// // AppText(
// // examinations?[index]
// // .conditionsList?[1]
// // .conditionCode ??
// // TranslationBase.of(context).abnormal,
// // fontWeight: FontWeight.normal,
// // fontFamily: 'Poppins',
// // fontSize:
// // SizeConfig.textMultiplier! * 1.6,
// // ),
// // ],
// // ),
// // )),
// // Expanded(
// // child: InkWell(
// // onTap: () {
// // setState(() {
// // setState(() {
// // examinations?[index].selectedCondition =
// // int.parse(examinations?[index]
// // .conditionsList?[2]
// // .conditionName ??
// // "-1");
// // });
// // });
// //
// // },
// // child: Row(
// // children: [
// // Container(
// // padding: EdgeInsets.all(2.0),
// // margin:
// // EdgeInsets.symmetric(horizontal: 6),
// // width: 20,
// // height: 20,
// // decoration: BoxDecoration(
// // color: Colors.white,
// // shape: BoxShape.circle,
// // border: Border.all(
// // color: Colors.grey, width: 1),
// // ),
// // child: Container(
// // decoration: BoxDecoration(
// // color: examinations?[index].selectedCondition ==
// // int.parse(examinations?[index]
// // .conditionsList?[2]
// // .conditionName ??
// // "-1")
// // ? HexColor("#D02127")
// // : Colors.white,
// // shape: BoxShape.circle,
// // ),
// // ),
// // ),
// // Expanded(
// // child: AppText(
// // examinations?[index]
// // .conditionsList?[2]
// // .conditionCode ??
// // TranslationBase.of(context).notExamined,
// // fontWeight: FontWeight.normal,
// // fontFamily: 'Poppins',
// // fontSize:
// // SizeConfig.textMultiplier! * 1.6,
// // ),
// // ),
// // ],
// // ),
// // )),
// // ],
// // ),
// Container(
// margin: EdgeInsets.only(top: 8),
// child: AppTextFieldCustom(
// hintText: TranslationBase.of(context).remarks,
// controller: examinations?[index].remarksController,
// minLines: 2,
// maxLines: 4,
// inputType: TextInputType.multiline,
// onChanged: (value) {},
// onClick: () {},
// onFieldSubmitted: () {},
// ),
// ),
// ],
// ),
// )
// : SizedBox.shrink(),
// ],
// ),
// ),
// ),
// ],
),
); );
} }
} }

@ -1,28 +1,17 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; 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/SOAP/progress_note/progress_note.dart';
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/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/objective/list_of_examination.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/add_progress_note.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/add_progress_note.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/empty_progress_note.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/empty_progress_note.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -50,14 +39,7 @@ class UpdatePlanPageVidaPlus extends StatefulWidget {
class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus> class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
implements PlanCallBack { implements PlanCallBack {
bool isAddProgress = true;
bool isProgressExpanded = true; bool isProgressExpanded = true;
List<GetPatientProgressNoteResModel> listOfProgressNote = [GetPatientProgressNoteResModel()];
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
TextEditingController progressNoteController =
TextEditingController(text: null);
BoxDecoration containerBorderDecoration( BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) { Color containerColor, Color borderColor) {
@ -75,89 +57,57 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (patientProgressNote.planNote != null) {
setState(() {
isAddProgress = false;
});
}
} }
getPatientProgressNote(SOAPViewModel model, // getPatientProgressNote(SOAPViewModel model,
{bool isAddProgress = false}) async { // {bool isAddProgress = false}) async {
GetProgressNoteReqModel getGetProgressNoteReqModel = // GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel( // GetProgressNoteReqModel(
appointmentNo: // appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), // int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, // patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), // episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', // editedBy: '',
doctorID: ''); // doctorID: '');
await widget.sOAPViewModel // await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel); // .getPatientProgressNote(getGetProgressNoteReqModel);
//
///TODO set progressNote in model; // ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { // if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString( // progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote!); // widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; // patientProgressNote.planNote = progressNoteController.text;
//
patientProgressNote.createdByName = // patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; // widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = // patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn; // widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = // patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn; // widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = // patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName; // widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = // patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; // widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() { // setState(() {
isAddProgress = isAddProgress; // isAddProgress = isAddProgress;
widget.sOAPViewModel.isAddProgress = isAddProgress; // widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel.progressNoteText = progressNoteController.text; // widget.sOAPViewModel.progressNoteText = progressNoteController.text;
}); // });
} // }
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.sOAPViewModel.setPlanCallBack(this); widget.sOAPViewModel.setPlanCallBack(this);
GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
await widget.sOAPViewModel widget.changeLoadingState(true);
.getPatientProgressNote(getGetProgressNoteReqModel);});
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { model.getProgressNote(widget.patientInfo);
progressNoteController.text = Utils.parseHtmlString( widget.changeLoadingState(false);
widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
setState(() { });
isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
});
}
widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -168,7 +118,6 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.90, widthFactor: 0.90,
child: Column( child: Column(
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
@ -202,7 +151,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
height: 16, height: 16,
), ),
if (listOfProgressNote.isEmpty) ...{ if (model.progressNote.isEmpty) ...{
Center( Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(65), padding: const EdgeInsets.all(65),
@ -211,9 +160,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
), ),
} else ...{ } else ...{
Divider(), Divider(),
ListOfNotes( ListOfNotes(notes: model.progressNote)
notes: listOfProgressNote
)
} }
// if (mySelectedExamination.isEmpty) ...{ // if (mySelectedExamination.isEmpty) ...{
@ -365,94 +312,84 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
)); ));
} }
submitPlan(SOAPViewModel model) async { // submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) { // if (progressNoteController.text.isNotEmpty) {
widget.changeLoadingState(true); // widget.changeLoadingState(true);
PostProgressNoteRequestModel postProgressNoteRequestModel = // PostProgressNoteRequestModel postProgressNoteRequestModel =
new PostProgressNoteRequestModel( // new PostProgressNoteRequestModel(
patientMRN: widget.patientInfo.patientMRN, // patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, // episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, // appointmentNo: widget.patientInfo.appointmentNo,
planNote: patientProgressNote.planNote, // planNote: patientProgressNote.planNote,
doctorID: widget.patientInfo.doctorId, // doctorID: widget.patientInfo.doctorId,
createdBy: widget.patientInfo.doctorId, // createdBy: widget.patientInfo.doctorId,
createdByName: widget.patientInfo.doctorName, // createdByName: widget.patientInfo.doctorName,
editedBy: ''); // editedBy: '');
//
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { // if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel // await widget.sOAPViewModel
.postProgressNote(postProgressNoteRequestModel); // .postProgressNote(postProgressNoteRequestModel);
} else { // } else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); // Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; // postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel // await widget.sOAPViewModel
.patchProgressNote(postProgressNoteRequestModel); // .patchProgressNote(postProgressNoteRequestModel);
} // }
//
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { // if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.sOAPViewModel.error); // Utils.showErrorToast(widget.sOAPViewModel.error);
} else { // } else {
GetProgressNoteReqModel getGetProgressNoteReqModel = // GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel( // GetProgressNoteReqModel(
appointmentNo: // appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), // int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, // patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), // episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', // editedBy: '',
doctorID: ''); // doctorID: '');
await widget.sOAPViewModel // await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel); // .getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { // if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString( // progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote!); // widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; // patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = // patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; // widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = // patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn; // widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = // patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn; // widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = // patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName; // widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = // patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; // widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
//
setState(() { // setState(() {
isAddProgress = false; // isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false; // widget.sOAPViewModel.isAddProgress = false;
}); // });
} // }
//
Navigator.of(context).pop(); // Navigator.of(context).pop();
Utils.showErrorToast("Episode Created Successfully"); // Utils.showErrorToast("Episode Created Successfully");
} // }
widget.changeLoadingState(false); // widget.changeLoadingState(false);
} else { // } else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); // Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} // }
} // }
@override @override
nextFunction(model) { nextFunction(model) {
if (progressNoteController.text.isNotEmpty) { //todo handle the next event here
if (isAddProgress) {
submitPlan(model);
} else {
Navigator.of(context).pop();
}
} else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
}
} }
void navigateToAddPlan() { void navigateToAddPlan() {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: AddProgressNote ( page: AddProgressNote(),
));
),
));
} }
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
@ -11,7 +12,13 @@ class AddProgressNote extends StatelessWidget{
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model){
WidgetsBinding.instance.addPostFrameCallback((_) async {
model.getClinics();
});
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isLoading: model.state == ViewState.BusyLocal,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: TranslationBase.of(context).progressNote title: TranslationBase.of(context).progressNote

@ -1,5 +1,8 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -7,8 +10,10 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-cust
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
List<String> patientState = ["","Stable", "Not Stable", "Not Defined"]; import '../../../../../../core/model/SOAP/progress_note/Clinic.dart';
import '../../../../../base/base_view.dart';
class AddProgressNoteDetails extends StatefulWidget { class AddProgressNoteDetails extends StatefulWidget {
@override @override
@ -16,37 +21,15 @@ class AddProgressNoteDetails extends StatefulWidget {
} }
class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> { class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
String selectedItem = "Stable"; Clinic? selectedItem ;
int status = 1; int status = 1;
final TextEditingController noteController = TextEditingController(); final TextEditingController noteController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( ProjectViewModel projectViewModel = Provider.of(context);
shape: RoundedRectangleBorder( return BaseView<SOAPViewModel>(
borderRadius: BorderRadius.circular(10), builder: (_, model, w) => Material(
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).addProgressNote,
fontSize: 16,
fontWeight: FontWeight.w600,
textAlign: TextAlign.start,
color: Colors.black,
),
SizedBox(
height: 16,
),
Material(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: BorderSide( side: BorderSide(
@ -61,236 +44,269 @@ class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).patientCondition, TranslationBase.of(context).addProgressNote,
textAlign: TextAlign.start, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 11, textAlign: TextAlign.start,
color: Color(0xFF2E303A), color: Colors.black,
), ),
SizedBox( SizedBox(
height: 4, height: 16,
), ),
DropdownButtonHideUnderline( Material(
child: DropdownButton( shape: RoundedRectangleBorder(
dropdownColor: Colors.white, borderRadius: BorderRadius.circular(10),
iconEnabledColor: Colors.black, side: BorderSide(
icon: Icon(Icons.keyboard_arrow_down), width: 1,
isExpanded: true, color: Color(0xFFEFEFEF),
value: selectedItem, )),
iconSize: 25, color: Colors.white,
elevation: 16, child: Padding(
padding: const EdgeInsets.symmetric(
onChanged: (newValue) async { horizontal: 16.0, vertical: 12),
setState(() { child: Column(
selectedItem = newValue ?? ""; crossAxisAlignment: CrossAxisAlignment.start,
}); children: [
}, AppText(
items: patientState.map((item) { TranslationBase.of(context).patientCondition,
return DropdownMenuItem( textAlign: TextAlign.start,
child: AppText( fontWeight: FontWeight.w600,
item, fontSize: 11,
fontSize: 14, color: Color(0xFF2E303A),
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.normal,
textAlign: TextAlign.left,
), ),
value: item, SizedBox(
); height: 4,
}).toList(), ),
), model.clinics.isEmpty
), ? EmptyDropDown()
], : DropdownButtonHideUnderline(
), child: DropdownButton<Clinic>(
), dropdownColor: Colors.white,
), iconEnabledColor: Colors.black,
SizedBox( icon: Icon(Icons.keyboard_arrow_down),
height: 16, isExpanded: true,
), value: selectedItem == null ? model.clinics.first : selectedItem,
AppText( iconSize: 25,
TranslationBase.of(context).progressNoteType, elevation: 16,
fontWeight: FontWeight.bold, onChanged: (newValue) async {
fontFamily: 'Poppins', setState(() {
fontSize: 11, selectedItem = newValue;
), });
SizedBox( },
height: 8, items: model.clinics.map((item) {
), return DropdownMenuItem(
Row( child: AppText(
children: [ projectViewModel.isArabic
Flexible( ? item.clinicNameArabic ?? ''
child: InkWell( : item.clinicNameEnglish ?? '',
onTap: () { fontSize: 14,
setState(() { letterSpacing: -0.96,
status = 1; color: AppGlobal.appTextColor,
}); fontWeight: FontWeight.normal,
}, textAlign: TextAlign.left,
child: Row( ),
children: [ value: item,
Container( );
padding: EdgeInsets.all(2.0), }).toList(),
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).doctorProgressNote, SizedBox(
fontWeight: FontWeight.w600, height: 16,
fontFamily: 'Poppins', ),
fontSize: 12, AppText(
), TranslationBase.of(context).progressNoteType,
], fontWeight: FontWeight.bold,
), fontFamily: 'Poppins',
)), fontSize: 11,
Flexible( ),
child: InkWell( SizedBox(
onTap: () { height: 8,
setState(() { ),
status = 2; Row(
});
},
child: Row(
children: [ children: [
Container( Flexible(
padding: EdgeInsets.all(2.0), child: InkWell(
margin: EdgeInsets.symmetric(horizontal: 6), onTap: () {
width: 20, setState(() {
height: 20, status = 1;
decoration: BoxDecoration( });
color: Colors.white, },
shape: BoxShape.circle, child: Row(
border: Border.all(color: Colors.grey, width: 1), 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).doctorProgressNote,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 12,
),
],
), ),
child: Container( )),
decoration: BoxDecoration( Flexible(
color: status == 2 child: InkWell(
? HexColor("#D02127") onTap: () {
: Colors.white, setState(() {
shape: BoxShape.circle, 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).nurseNote,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 12,
),
],
), ),
), ),
), ),
AppText(
TranslationBase.of(context).nurseNote,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 12,
),
], ],
), ),
),
),
],
),
SizedBox(
height: 24,
),
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).speciality,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
fontSize: 11,
color: Color(0xFF2E303A),
),
SizedBox( SizedBox(
height: 4, height: 24,
), ),
DropdownButtonHideUnderline( Material(
child: DropdownButton( shape: RoundedRectangleBorder(
dropdownColor: Colors.white, borderRadius: BorderRadius.circular(10),
iconEnabledColor: Colors.black, side: BorderSide(
icon: Icon(Icons.keyboard_arrow_down), width: 1,
isExpanded: true, color: Color(0xFFEFEFEF),
value: selectedItem, )),
iconSize: 25, color: Colors.white,
elevation: 16, child: Padding(
padding: const EdgeInsets.symmetric(
onChanged: (newValue) async { horizontal: 16.0, vertical: 12),
setState(() { child: Column(
selectedItem = newValue ?? ""; crossAxisAlignment: CrossAxisAlignment.start,
}); children: [
}, AppText(
items: patientState.map((item) { TranslationBase.of(context).speciality,
return DropdownMenuItem( textAlign: TextAlign.start,
child: AppText( fontWeight: FontWeight.w600,
"item", fontSize: 11,
fontSize: 14, color: Color(0xFF2E303A),
letterSpacing: -0.96, ),
color: AppGlobal.appTextColor, SizedBox(
fontWeight: FontWeight.normal, height: 4,
textAlign: TextAlign.left,
), ),
value: item, model.clinics.isEmpty
); ? EmptyDropDown()
}).toList(), : DropdownButtonHideUnderline(
child: DropdownButton<Clinic>(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: selectedItem == null ? model.clinics.first : selectedItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
setState(() {
selectedItem = newValue;
});
},
items: model.clinics.map((item) {
return DropdownMenuItem(
child: AppText(
projectViewModel.isArabic
? item.clinicNameArabic ?? ''
: item.clinicNameEnglish ?? '',
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.normal,
textAlign: TextAlign.left,
),
value: item,
);
}).toList(),
),
),
],
),
), ),
), ),
SizedBox(
height: 16,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).addYourNote,
controller: noteController,
inputType: TextInputType.multiline,
maxLines: 25,
minLines: 4,
hasBorder: true,
onClick: () {},
onChanged: (value) {},
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),
),
],
)
], ],
), ),
), ),
), ));
SizedBox(
height: 16,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).addYourNote,
controller: noteController,
inputType: TextInputType.multiline,
maxLines: 25,
minLines: 4,
hasBorder: true,
onClick: () {},
onChanged: (value) {},
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),
),
],
)
],
),
),
);
} }
} }

@ -1,9 +1,10 @@
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ListOfNotes extends StatelessWidget{ class ListOfNotes extends StatelessWidget{
final List<GetPatientProgressNoteResModel> notes; final List<ProgressNote> notes;
const ListOfNotes({super.key, required this.notes}); const ListOfNotes({super.key, required this.notes});
@override @override

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

@ -503,6 +503,7 @@ class TranslationBase {
String get cancel => localizedValues['cancel']![locale.languageCode]!; String get cancel => localizedValues['cancel']![locale.languageCode]!;
String get cancelSmall => localizedValues['cancelSmall']![locale.languageCode]!; String get cancelSmall => localizedValues['cancelSmall']![locale.languageCode]!;
String get saveSmall => localizedValues['saveSmall']![locale.languageCode]!;
String get ok => localizedValues['ok']![locale.languageCode]!; String get ok => localizedValues['ok']![locale.languageCode]!;
@ -1931,6 +1932,24 @@ class TranslationBase {
String get acute => localizedValues['acute']![locale.languageCode]!; String get acute => localizedValues['acute']![locale.languageCode]!;
String get subAcute => localizedValues['subAcute']![locale.languageCode]!; String get subAcute => localizedValues['subAcute']![locale.languageCode]!;
String get chronic => localizedValues['chronic']![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]!;
String get kindlySelectCategory => localizedValues['kindlySelectCategory']![locale.languageCode]!;
String get remarksCanNotBeEmpty => localizedValues['remarksCanNotBeEmpty']![locale.languageCode]!;
String get selectedDiagnosis => localizedValues['selectedDiagnosis']![locale.languageCode]!;
String get selectConditionFirst => localizedValues['selectConditionFirst']![locale.languageCode]!;
String get editDiagnosis => localizedValues['editDiagnosis']![locale.languageCode]!;
String get noChangeRecorded => localizedValues['noChangeRecorded']![locale.languageCode]!;
String get activate => localizedValues['activate']![locale.languageCode]!; String get activate => localizedValues['activate']![locale.languageCode]!;
String get resolved => localizedValues['resolved']![locale.languageCode]!; String get resolved => localizedValues['resolved']![locale.languageCode]!;
} }

Loading…
Cancel
Save